/* source 2 is always smaller than source 1 */
js L_bugged_1
- testl $0x80000000,SIGH(%edi) /* The args are assumed to be be normalized */
+ testl $0x80000000,SIGH(%edi) /* The args are assumed to be normalized */
je L_bugged_2
testl $0x80000000,SIGH(%esi)
* Printk clean up
*/
+/*
+ * Currently ISICOM_BH is hard coded to 16 in isicom.h, cannot
+ * ask the kernel for a free slot as of 2.0.x - sameer
+ */
+
+
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/io.h>
-#include "isicom.h"
+#include <linux/isicom.h>
static int isicom_refcount = 0;
static int prev_card = 3; /* start servicing isi_card[0] */
static int ISILoad_open(struct inode *inode, struct file *filp)
{
#ifdef ISICOM_DEBUG
- printk(KERN_DEBUG "ISILoad:Card%d Opened!!!\n",MINOR(inode->i_rdev)+1);
+ printk(KERN_DEBUG "ISILoad:Firmware loader Opened!!!\n");
#endif
return 0;
}
static void ISILoad_release(struct inode *inode, struct file *filp)
{
#ifdef ISICOM_DEBUG
- printk(KERN_DEBUG "ISILoad:Card%d Close(Release)d\n",MINOR(inode->i_rdev)+1);
+ printk(KERN_DEBUG "ISILoad:Firmware loader Close(Release)d\n",);
#endif
}
bin_frame frame;
/* exec_record exec_rec; */
- i=get_user((int *)arg);
- if(i<0 || i >= BOARD_COUNT)
+ /* Added this check to avoid oopses on an ioctl with no
+ * args - sameer
+ */
+ error=verify_area(VERIFY_READ, (void *) arg, sizeof(int));
+ if (error)
+ return error;
+ card=get_user((int *)arg);
+ if(card < 0 || card >= BOARD_COUNT)
return -ENXIO;
- card=i;
base=isi_card[card].base;
if(base==0)
- return -ENXIO;
+ return -ENXIO; /* disabled or not used */
switch(cmd) {
case MIOCTL_RESET_CARD:
static void isicom_tx(unsigned long _data)
{
short count = (BOARD_COUNT-1), card, base;
- short txcount, wait, wrd;
+ short txcount, wait, wrd, residue, word_count, cnt;
struct isi_port * port;
struct tty_struct * tty;
unsigned long flags;
#endif
/* find next active board */
- card = (prev_card + 1) % 4;
+ card = (prev_card + 1) & 0x0003;
while(count-- > 0) {
if (isi_card[card].status & BOARD_ACTIVE)
break;
- card = (card + 1) % 4;
+ card = (card + 1) & 0x0003;
}
if (!(isi_card[card].status & BOARD_ACTIVE))
goto sched_again;
restore_flags(flags);
continue;
}
- wait = 300;
+ wait = 200;
while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
if (wait <= 0) {
restore_flags(flags);
#endif
outw((port->channel << isi_card[card].shift_count) | txcount
, base);
+ residue = NO;
+ wrd = 0;
+ while (1) {
+ cnt = MIN(txcount, (SERIAL_XMIT_SIZE - port->xmit_tail));
+ if (residue == YES) {
+ residue = NO;
+ if (cnt > 0) {
+ wrd |= (port->xmit_buf[port->xmit_tail] << 8);
+ port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
+ port->xmit_cnt--;
+ txcount--;
+ cnt--;
+ outw(wrd, base);
+ }
+ else {
+ outw(wrd, base);
+ break;
+ }
+ }
+ if (cnt <= 0) break;
+ word_count = cnt >> 1;
+ outsw(base, port->xmit_buf+port->xmit_tail, word_count);
+ port->xmit_tail = (port->xmit_tail + (word_count << 1)) &
+ (SERIAL_XMIT_SIZE - 1);
+ txcount -= (word_count << 1);
+ port->xmit_cnt -= (word_count << 1);
+ if (cnt & 0x0001) {
+ residue = YES;
+ wrd = port->xmit_buf[port->xmit_tail];
+ port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
+ port->xmit_cnt--;
+ txcount--;
+ }
+ }
+/*
+ * Replaced the code below with hopefully a faster loop - sameer
+ */
+
+/*
while (1) {
wrd = port->xmit_buf[port->xmit_tail++];
port->xmit_tail = port->xmit_tail & (SERIAL_XMIT_SIZE - 1);
break;
}
}
+*/
InterruptTheCard(base);
if (port->xmit_cnt <= 0)
port->status &= ~ISI_TXOK;
if (!re_schedule)
return;
init_timer(&tx);
- tx.expires = jiffies + 1;
+ tx.expires = jiffies + HZ/100;
tx.data = 0;
tx.function = isicom_tx;
add_timer(&tx);
insw(base, tty->flip.char_buf_ptr, word_count);
tty->flip.char_buf_ptr += (word_count << 1);
byte_count -= (word_count << 1);
- if (count % 2) {
+ if (count & 0x0001) {
*tty->flip.char_buf_ptr++ = (char)(inw(base) & 0xff);
byte_count -= 2;
}
tty->flip.flag_buf_ptr += count;
tty->flip.count += count;
- if (byte_count > 0)
+ if (byte_count > 0) {
printk(KERN_DEBUG "ISICOM: Intr(0x%x:%d): Flip buffer overflow! dropping bytes...\n",
base, channel+1);
- while(byte_count > 0) { /* drain out unread xtra data */
- inw(base);
- byte_count -= 2;
+ while(byte_count > 0) { /* drain out unread xtra data */
+ inw(base);
+ byte_count -= 2;
+ }
}
queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
}
((status & ISI_DTR) ? TIOCM_DTR : 0) |
((status & ISI_DCD) ? TIOCM_CAR : 0) |
((status & ISI_DSR) ? TIOCM_DSR : 0) |
- ((status & ISI_CTS) ? TIOCM_CTS : 0);
+ ((status & ISI_CTS) ? TIOCM_CTS : 0) |
+ ((status & ISI_RI ) ? TIOCM_RI : 0);
put_user(info, (unsigned long *) value);
return 0;
}
+++ /dev/null
-#ifndef ISICOM_H
-#define ISICOM_H
-
-/*#define ISICOM_DEBUG*/
-/*#define ISICOM_DEBUG_DTR_RTS*/
-
-
-
-/*
- * Firmware Loader definitions ...
- */
-
-#define ISILOAD_MISC_MINOR 155 /* /dev/isctl */
-#define ISILOAD_NAME "ISILoad"
-
-#define MultiTech ('M'<<8)
-#define MIOCTL_LOAD_FIRMWARE (MultiTech | 0x01)
-#define MIOCTL_READ_FIRMWARE (MultiTech | 0x02)
-#define MIOCTL_XFER_CTRL (MultiTech | 0x03)
-#define MIOCTL_RESET_CARD (MultiTech | 0x04)
-
-#define DATA_SIZE 16
-
-typedef struct {
- unsigned short exec_segment;
- unsigned short exec_addr;
-} exec_record;
-
-typedef struct {
- int board; /* Board to load */
- unsigned short addr;
- unsigned short count;
-} bin_header;
-
-typedef struct {
- int board; /* Board to load */
- unsigned short addr;
- unsigned short count;
- unsigned short segment;
- unsigned char bin_data[DATA_SIZE];
-} bin_frame;
-
-#ifdef __KERNEL__
-
-/*
- * ISICOM Driver definitions ...
- *
- */
-
-#define ISICOM_NAME "ISICom"
-
-/*
- * These are now officially allocated numbers
- */
-
-#define ISICOM_NMAJOR 112 /* normal */
-#define ISICOM_CMAJOR 113 /* callout */
-#define ISICOM_MAGIC (('M' << 8) | 'T')
-
-#define ISICOM_BH 16 /* bottom half entry # */
-
-#define WAKEUP_CHARS 256 /* hard coded for now */
-#define TX_SIZE 254
-
-#define BOARD_COUNT 4
-#define PORT_COUNT (BOARD_COUNT*16)
-
-#define SERIAL_TYPE_NORMAL 1
-#define SERIAL_TYPE_CALLOUT 2
-
-/* character sizes */
-
-#define ISICOM_CS5 0x0000
-#define ISICOM_CS6 0x0001
-#define ISICOM_CS7 0x0002
-#define ISICOM_CS8 0x0003
-
-/* stop bits */
-
-#define ISICOM_1SB 0x0000
-#define ISICOM_2SB 0x0004
-
-/* parity */
-
-#define ISICOM_NOPAR 0x0000
-#define ISICOM_ODPAR 0x0008
-#define ISICOM_EVPAR 0x0018
-
-/* flow control */
-
-#define ISICOM_CTSRTS 0x03
-#define ISICOM_INITIATE_XONXOFF 0x04
-#define ISICOM_RESPOND_XONXOFF 0x08
-
-#define InterruptTheCard(base) (outw(0,(base)+0xc))
-#define ClearInterrupt(base) (inw((base)+0x0a))
-
-#define BOARD(line) (((line) >> 4) & 0x3)
-#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
-
- /* isi kill queue bitmap */
-
-#define ISICOM_KILLTX 0x01
-#define ISICOM_KILLRX 0x02
-
- /* isi_board status bitmap */
-
-#define FIRMWARE_LOADED 0x0001
-#define BOARD_ACTIVE 0x0002
-
- /* isi_port status bitmap */
-
-#define ISI_CTS 0x1000
-#define ISI_DSR 0x2000
-#define ISI_RI 0x4000
-#define ISI_DCD 0x8000
-#define ISI_DTR 0x0100
-#define ISI_RTS 0x0200
-
-
-#define ISI_TXOK 0x0001
-
-struct isi_board {
- unsigned short base;
- unsigned char irq;
- unsigned char port_count;
- unsigned short status;
- unsigned short port_status; /* each bit represents a single port */
- unsigned short shift_count;
- struct isi_port * ports;
- signed char count;
-};
-
-struct isi_port {
- unsigned short magic;
- unsigned int flags;
- int count;
- int blocked_open;
- int close_delay;
- unsigned short channel;
- unsigned short status;
- unsigned short closing_wait;
- long session;
- long pgrp;
- struct isi_board * card;
- struct tty_struct * tty;
- struct wait_queue * close_wait;
- struct wait_queue * open_wait;
- struct tq_struct hangup_tq;
- struct tq_struct bh_tqueue;
- unsigned char * xmit_buf;
- int xmit_head;
- int xmit_tail;
- int xmit_cnt;
- struct termios normal_termios;
- struct termios callout_termios;
-};
-
-
-/*
- * ISI Card specific ops ...
- */
-
-extern inline void raise_dtr(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: raise_dtr.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0504, base);
- InterruptTheCard(base);
- port->status |= ISI_DTR;
-}
-extern inline void drop_dtr(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: drop_dtr.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0404, base);
- InterruptTheCard(base);
- port->status &= ~ISI_DTR;
-}
-extern inline void raise_rts(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in raise_rts.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: raise_rts.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0a04, base);
- InterruptTheCard(base);
- port->status |= ISI_RTS;
-}
-extern inline void drop_rts(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in drop_rts.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: drop_rts.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0804, base);
- InterruptTheCard(base);
- port->status &= ~ISI_RTS;
-}
-extern inline void raise_dtr_rts(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr_rts.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: raise_dtr_rts.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0f04, base);
- InterruptTheCard(base);
- port->status |= (ISI_DTR | ISI_RTS);
-}
-extern inline void drop_dtr_rts(struct isi_port * port)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr_rts.\n");
- return;
- }
-#ifdef ISICOM_DEBUG_DTR_RTS
- printk(KERN_DEBUG "ISICOM: drop_dtr_rts.\n");
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw(0x0c04, base);
- InterruptTheCard(base);
- port->status &= ~(ISI_RTS | ISI_DTR);
-}
-
-extern inline void kill_queue(struct isi_port * port, short queue)
-{
- struct isi_board * card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
- short wait=300;
- while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
- if (wait <= 0) {
- printk(KERN_WARNING "ISICOM: Card found busy in kill_queue.\n");
- return;
- }
-#ifdef ISICOM_DEBUG
- printk(KERN_DEBUG "ISICOM: kill_queue 0x%x.\n", queue);
-#endif
- outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
- outw((queue << 8) | 0x06, base);
- InterruptTheCard(base);
-}
-
-#endif /* __KERNEL__ */
-
-#endif /* ISICOM_H */
\ No newline at end of file
{
unsigned long low, high;
__asm__(".byte 0x0f,0x31" :"=a" (low), "=d" (high));
- return (((unsigned long long) high << 31) | low);
+ return (((unsigned long long) high << 32) | low);
}
static void initialize_benchmark(struct random_benchmark *bench,
lp = (struct de4x5_private *)dev->priv;
iobase = dev->base_addr;
- if (dev->interrupt)
+ if (test_and_set_bit(0, (void*) &dev->interrupt))
printk("%s: Re-entering the interrupt handler.\n", dev->name);
DISABLE_IRQs; /* Ensure non re-entrancy */
/* If we had an ILLEGAL REQUEST returned, then we may have
* performed an unsupported command. The only thing this should be
* would be a ten byte read where only a six byte read was supported.
- * Also, on a system where READ CAPACITY failed, we have have read
- * past the end of the disk.
+ * Also, on a system where READ CAPACITY failed, we have read past
+ * the end of the disk.
*/
if (SCpnt->sense_buffer[2] == ILLEGAL_REQUEST) {
return DID_BAD_TARGET;
/*
- * We work it differently depending on if this is is "the first time,"
+ * We work it differently depending on if this is "the first time,"
* or a reconnect. If this is a reselect phase, then SEL will
* be asserted, and we must skip selection / arbitration phases.
*/
with impossible parameters. Check that the application is
for sound driver version 2.X or later.
-In general the printout of of /dev/sndstat should tell what is the problem.
+In general the printout of /dev/sndstat should tell what is the problem.
It's possible that there are bugs in the sound driver but 99% of the problems
reported to me are caused by somehow incorrect setup during "make config".
* The AD1848 codec has generic input lines called Line, Aux1 and Aux2.
* Soundcard manufacturers have connected actual inputs (CD, synth, line,
* etc) to these inputs in different order. Therefore it's difficult
- * to assign mixer channels to to these inputs correctly. The following
+ * to assign mixer channels to these inputs correctly. The following
* contains two alternative mappings. The first one is for GUS MAX and
* the second is just a generic one (line1, line2 and line3).
* (Actually this is not a mapping but rather some kind of interleaving
/*
* raw_scan performs raw_scan_sector on any sector.
*
- * NOTE: raw_scan must not be used on a directory that is is the process of
+ * NOTE: raw_scan must not be used on a directory that is the process of
* being created.
*/
IMMEDIATE_BH,
KEYBOARD_BH,
CYCLADES_BH,
- CM206_BH
+ CM206_BH,
+ ISICOM_BH
};
extern inline void init_bh(int nr, void (*routine)(void))
--- /dev/null
+#ifndef _LINUX_ISICOM_H
+#define _LINUX_ISICOM_H
+
+/*#define ISICOM_DEBUG*/
+/*#define ISICOM_DEBUG_DTR_RTS*/
+
+
+/*
+ * Firmware Loader definitions ...
+ */
+
+#define __MultiTech ('M'<<8)
+#define MIOCTL_LOAD_FIRMWARE (__MultiTech | 0x01)
+#define MIOCTL_READ_FIRMWARE (__MultiTech | 0x02)
+#define MIOCTL_XFER_CTRL (__MultiTech | 0x03)
+#define MIOCTL_RESET_CARD (__MultiTech | 0x04)
+
+#define DATA_SIZE 16
+
+typedef struct {
+ unsigned short exec_segment;
+ unsigned short exec_addr;
+} exec_record;
+
+typedef struct {
+ int board; /* Board to load */
+ unsigned short addr;
+ unsigned short count;
+} bin_header;
+
+typedef struct {
+ int board; /* Board to load */
+ unsigned short addr;
+ unsigned short count;
+ unsigned short segment;
+ unsigned char bin_data[DATA_SIZE];
+} bin_frame;
+
+#ifdef __KERNEL__
+
+#define YES 1
+#define NO 0
+
+#define ISILOAD_MISC_MINOR 155 /* /dev/isctl */
+#define ISILOAD_NAME "ISILoad"
+
+/*
+ * ISICOM Driver definitions ...
+ *
+ */
+
+#define ISICOM_NAME "ISICom"
+
+/*
+ * These are now officially allocated numbers
+ */
+
+#define ISICOM_NMAJOR 112 /* normal */
+#define ISICOM_CMAJOR 113 /* callout */
+#define ISICOM_MAGIC (('M' << 8) | 'T')
+
+#define WAKEUP_CHARS 256 /* hard coded for now */
+#define TX_SIZE 254
+
+#define BOARD_COUNT 4
+#define PORT_COUNT (BOARD_COUNT*16)
+
+#define SERIAL_TYPE_NORMAL 1
+#define SERIAL_TYPE_CALLOUT 2
+
+/* character sizes */
+
+#define ISICOM_CS5 0x0000
+#define ISICOM_CS6 0x0001
+#define ISICOM_CS7 0x0002
+#define ISICOM_CS8 0x0003
+
+/* stop bits */
+
+#define ISICOM_1SB 0x0000
+#define ISICOM_2SB 0x0004
+
+/* parity */
+
+#define ISICOM_NOPAR 0x0000
+#define ISICOM_ODPAR 0x0008
+#define ISICOM_EVPAR 0x0018
+
+/* flow control */
+
+#define ISICOM_CTSRTS 0x03
+#define ISICOM_INITIATE_XONXOFF 0x04
+#define ISICOM_RESPOND_XONXOFF 0x08
+
+#define InterruptTheCard(base) (outw(0,(base)+0xc))
+#define ClearInterrupt(base) (inw((base)+0x0a))
+
+#define BOARD(line) (((line) >> 4) & 0x3)
+#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
+
+ /* isi kill queue bitmap */
+
+#define ISICOM_KILLTX 0x01
+#define ISICOM_KILLRX 0x02
+
+ /* isi_board status bitmap */
+
+#define FIRMWARE_LOADED 0x0001
+#define BOARD_ACTIVE 0x0002
+
+ /* isi_port status bitmap */
+
+#define ISI_CTS 0x1000
+#define ISI_DSR 0x2000
+#define ISI_RI 0x4000
+#define ISI_DCD 0x8000
+#define ISI_DTR 0x0100
+#define ISI_RTS 0x0200
+
+
+#define ISI_TXOK 0x0001
+
+struct isi_board {
+ unsigned short base;
+ unsigned char irq;
+ unsigned char port_count;
+ unsigned short status;
+ unsigned short port_status; /* each bit represents a single port */
+ unsigned short shift_count;
+ struct isi_port * ports;
+ signed char count;
+};
+
+struct isi_port {
+ unsigned short magic;
+ unsigned int flags;
+ int count;
+ int blocked_open;
+ int close_delay;
+ unsigned short channel;
+ unsigned short status;
+ unsigned short closing_wait;
+ long session;
+ long pgrp;
+ struct isi_board * card;
+ struct tty_struct * tty;
+ struct wait_queue * close_wait;
+ struct wait_queue * open_wait;
+ struct tq_struct hangup_tq;
+ struct tq_struct bh_tqueue;
+ unsigned char * xmit_buf;
+ int xmit_head;
+ int xmit_tail;
+ int xmit_cnt;
+ struct termios normal_termios;
+ struct termios callout_termios;
+};
+
+
+/*
+ * ISI Card specific ops ...
+ */
+
+extern inline void raise_dtr(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: raise_dtr.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0504, base);
+ InterruptTheCard(base);
+ port->status |= ISI_DTR;
+}
+extern inline void drop_dtr(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: drop_dtr.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0404, base);
+ InterruptTheCard(base);
+ port->status &= ~ISI_DTR;
+}
+extern inline void raise_rts(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in raise_rts.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: raise_rts.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0a04, base);
+ InterruptTheCard(base);
+ port->status |= ISI_RTS;
+}
+extern inline void drop_rts(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in drop_rts.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: drop_rts.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0804, base);
+ InterruptTheCard(base);
+ port->status &= ~ISI_RTS;
+}
+extern inline void raise_dtr_rts(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr_rts.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: raise_dtr_rts.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0f04, base);
+ InterruptTheCard(base);
+ port->status |= (ISI_DTR | ISI_RTS);
+}
+extern inline void drop_dtr_rts(struct isi_port * port)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr_rts.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG_DTR_RTS
+ printk(KERN_DEBUG "ISICOM: drop_dtr_rts.\n");
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw(0x0c04, base);
+ InterruptTheCard(base);
+ port->status &= ~(ISI_RTS | ISI_DTR);
+}
+
+extern inline void kill_queue(struct isi_port * port, short queue)
+{
+ struct isi_board * card = port->card;
+ unsigned short base = card->base;
+ unsigned char channel = port->channel;
+ short wait=300;
+ while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+ if (wait <= 0) {
+ printk(KERN_WARNING "ISICOM: Card found busy in kill_queue.\n");
+ return;
+ }
+#ifdef ISICOM_DEBUG
+ printk(KERN_DEBUG "ISICOM: kill_queue 0x%x.\n", queue);
+#endif
+ outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+ outw((queue << 8) | 0x06, base);
+ InterruptTheCard(base);
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* ISICOM_H */
\ No newline at end of file
#ifndef _LINUX_TYPES_H
#define _LINUX_TYPES_H
-#ifdef __KERNEL__
+#if defined(__KERNEL__) && !defined(STDC_HEADERS)
#if ((__GNUC_MINOR__ >= 8) || (__GNUC_MAJOR >=3))
#warning "This code is tested with gcc 2.7.2.x only. Using egcs/gcc 2.8.x needs"
#warning "additional patches that have not been sufficiently tested to include by"
#warning "default."
+#warning "See http://www.suse.de/~florian/kernel+egcs.html for more information"
#error "Remove this if you have applied the gcc 2.8/egcs patches and wish to use them"
#endif
#endif
sti();
check_bugs();
-#ifdef CONFIG_MTRR
+#if defined(CONFIG_MTRR) && defined(__SMP__)
init_mtrr_config();
#endif
nr++;
}
free_page(page);
+#ifdef CONFIG_SYSVIPC
shm_unuse(type);
+#endif
return 0;
}
err = 0;
out:
sockfd_put(sock);
- return(0);
+ return err;
}