static struct timer_list tx;
static char re_schedule = 1;
-#ifdef ISICOM_DEBUG
-static unsigned long tx_count = 0;
-#endif
static int ISILoad_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
};
struct isi_board {
- unsigned short base;
+ unsigned long base;
unsigned char irq;
unsigned char port_count;
unsigned short status;
int count;
int blocked_open;
int close_delay;
- unsigned short channel;
- unsigned short status;
- unsigned short closing_wait;
+ u16 channel;
+ u16 status;
+ u16 closing_wait;
struct isi_board * card;
struct tty_struct * tty;
wait_queue_head_t close_wait;
static int lock_card(struct isi_board *card)
{
char retries;
- unsigned short base = card->base;
+ unsigned long base = card->base;
for (retries = 0; retries < 100; retries++) {
spin_lock_irqsave(&card->card_lock, card->flags);
udelay(1000); /* 1ms */
}
}
- printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%x)\n", card->base);
+ printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", card->base);
return 0; /* Failed to aquire the card! */
}
static int lock_card_at_interrupt(struct isi_board *card)
{
unsigned char retries;
- unsigned short base = card->base;
+ unsigned long base = card->base;
for (retries = 0; retries < 200; retries++) {
spin_lock_irqsave(&card->card_lock, card->flags);
static void raise_dtr(struct isi_port *port)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static inline void drop_dtr(struct isi_port *port)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static inline void raise_rts(struct isi_port *port)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static inline void drop_rts(struct isi_port *port)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static 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;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static void drop_dtr_rts(struct isi_port *port)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
- unsigned char channel = port->channel;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
static 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;
+ unsigned long base = card->base;
+ u16 channel = port->channel;
if (!lock_card(card))
return;
};
-static inline int WaitTillCardIsFree(unsigned short base)
+static inline int WaitTillCardIsFree(unsigned long base)
{
unsigned long count=0;
while( (!(inw(base+0xe) & 0x1)) && (count++ < 6000000));
unsigned int cmd, unsigned long arg)
{
unsigned int card, i, j, signature, status, portcount = 0;
- unsigned long t;
- unsigned short word_count, base;
+ unsigned long t, base;
+ u16 word_count;
bin_frame frame;
void __user *argp = (void __user *)arg;
/* exec_record exec_rec; */
case MIOCTL_RESET_CARD:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- printk(KERN_DEBUG "ISILoad:Resetting Card%d at 0x%x ",card+1,base);
+ printk(KERN_DEBUG "ISILoad:Resetting Card%d at 0x%lx ",card+1,base);
inw(base+0x8);
#ifdef ISICOM_DEBUG
printk("\nbase+0x2=0x%x , base+0xe=0x%x",inw(base+0x2),inw(base+0xe));
#endif
- printk("\nISILoad:ISA Card%d reset failure (Possible bad I/O Port Address 0x%x).\n",card+1,base);
+ printk("\nISILoad:ISA Card%d reset failure (Possible bad I/O Port Address 0x%lx).\n",card+1,base);
return -EIO;
}
}
#ifdef ISICOM_DEBUG
printk("\nbase+0x2=0x%x , base+0xe=0x%x",inw(base+0x2),inw(base+0xe));
#endif
- printk("\nISILoad:PCI Card%d reset failure (Possible bad I/O Port Address 0x%x).\n",card+1,base);
+ printk("\nISILoad:PCI Card%d reset failure (Possible bad I/O Port Address 0x%lx).\n",card+1,base);
return -EIO;
}
}
isi_card[card].shift_count = 11;
break;
- default: printk("ISILoad:Card%d reset failure (Possible bad I/O Port Address 0x%x).\n",card+1,base);
+ default: printk("ISILoad:Card%d reset failure (Possible bad I/O Port Address 0x%lx).\n",card+1,base);
#ifdef ISICOM_DEBUG
printk("Sig=0x%x\n",signature);
#endif
struct isi_port *port;
struct tty_struct *tty;
-#ifdef ISICOM_DEBUG
- ++tx_count;
-#endif
-
/* find next active board */
card = (prev_card + 1) & 0x0003;
while(count-- > 0) {
* Main interrupt handler routine
*/
-static irqreturn_t isicom_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t isicom_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
- struct isi_board *card;
+ struct isi_board *card = dev_id;
struct isi_port *port;
struct tty_struct *tty;
- unsigned short base, header, word_count, count;
- unsigned char channel;
+ unsigned long base;
+ u16 header, word_count, count, channel;
short byte_count;
unsigned char *rp;
- card = (struct isi_board *) dev_id;
-
if (!card || !(card->status & FIRMWARE_LOADED))
return IRQ_NONE;
byte_count = header & 0xff;
if (channel + 1 > card->port_count) {
- printk(KERN_WARNING "ISICOM: isicom_interrupt(0x%x): %d(channel) > port_count.\n",
+ printk(KERN_WARNING "ISICOM: isicom_interrupt(0x%lx): %d(channel) > port_count.\n",
base, channel+1);
if (card->isa)
ClearInterrupt(base);
byte_count -= 2;
}
if (byte_count > 0) {
- printk(KERN_DEBUG "ISICOM: Intr(0x%x:%d): Flip buffer overflow! dropping bytes...\n",
+ printk(KERN_DEBUG "ISICOM: Intr(0x%lx:%d): Flip buffer overflow! dropping bytes...\n",
base, channel+1);
while(byte_count > 0) { /* drain out unread xtra data */
inw(base);
struct isi_board *card = port->card;
struct tty_struct *tty;
unsigned long baud;
- unsigned short channel_setup, base = card->base;
- unsigned short channel = port->channel, shift_count = card->shift_count;
+ unsigned long base = card->base;
+ u16 channel_setup, channel = port->channel,
+ shift_count = card->shift_count;
unsigned char flow_ctrl;
if (!(tty = port->tty) || !tty->termios)
set_bit(TTY_IO_ERROR, &tty->flags);
if (--card->count < 0) {
- printk(KERN_DEBUG "ISICOM: isicom_shutdown_port: bad board(0x%x) count %d.\n",
+ printk(KERN_DEBUG "ISICOM: isicom_shutdown_port: bad board(0x%lx) count %d.\n",
card->base, card->count);
card->count = 0;
}
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
unsigned long flags;
}
if (tty->count == 1 && port->count != 1) {
- printk(KERN_WARNING "ISICOM:(0x%x) isicom_close: bad port count"
+ printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port count"
"tty->count = 1 port count = %d.\n",
card->base, port->count);
port->count = 1;
}
if (--port->count < 0) {
- printk(KERN_WARNING "ISICOM:(0x%x) isicom_close: bad port count for"
+ printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port count for"
"channel%d = %d", card->base, port->channel,
port->count);
port->count = 0;
static int isicom_write(struct tty_struct *tty, const unsigned char *buf,
int count)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
unsigned long flags;
int cnt, total = 0;
/* put_char et all */
static void isicom_put_char(struct tty_struct *tty, unsigned char ch)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
unsigned long flags;
/* flush_chars et all */
static void isicom_flush_chars(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars"))
return;
/* write_room et all */
static int isicom_write_room(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
int free;
if (isicom_paranoia_check(port, tty->name, "isicom_write_room"))
/* chars_in_buffer et all */
static int isicom_chars_in_buffer(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_chars_in_buffer"))
return 0;
return port->xmit_cnt;
static inline void isicom_send_break(struct isi_port *port, unsigned long length)
{
struct isi_board *card = port->card;
- unsigned short base = card->base;
+ unsigned long base = card->base;
if (!lock_card(card))
return;
static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
/* just send the port status */
- unsigned short status = port->status;
+ u16 status = port->status;
if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
return -ENODEV;
static int isicom_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
return -ENODEV;
static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
unsigned int cmd, unsigned long arg)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
void __user *argp = (void __user *)arg;
int retval;
static void isicom_set_termios(struct tty_struct *tty,
struct termios *old_termios)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_set_termios"))
return;
/* throttle et all */
static void isicom_throttle(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
if (isicom_paranoia_check(port, tty->name, "isicom_throttle"))
/* unthrottle et all */
static void isicom_unthrottle(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
if (isicom_paranoia_check(port, tty->name, "isicom_unthrottle"))
/* stop et all */
static void isicom_stop(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_stop"))
return;
/* start et all */
static void isicom_start(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_start"))
return;
/* hangup et all */
static void do_isicom_hangup(void *data)
{
- struct isi_port *port = (struct isi_port *) data;
+ struct isi_port *port = data;
struct tty_struct *tty;
tty = port->tty;
static void isicom_hangup(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_hangup"))
return;
/* flush_buffer et all */
static void isicom_flush_buffer(struct tty_struct *tty)
{
- struct isi_port *port = (struct isi_port *) tty->driver_data;
+ struct isi_port *port = tty->driver_data;
struct isi_board *card = port->card;
unsigned long flags;
for (count=0; count < BOARD_COUNT; count++ ) {
if (isi_card[count].base)
if (!request_region(isi_card[count].base,16,ISICOM_NAME)) {
- printk(KERN_DEBUG "ISICOM: I/O Region 0x%x-0x%x is busy. Card%d will be disabled.\n",
+ printk(KERN_DEBUG "ISICOM: I/O Region 0x%lx-0x%lx is busy. Card%d will be disabled.\n",
isi_card[count].base,isi_card[count].base+15,count+1);
isi_card[count].base=0;
done++;
if (isi_card[count].base) {
release_region(isi_card[count].base,16);
#ifdef ISICOM_DEBUG
- printk(KERN_DEBUG "ISICOM: I/O Region 0x%x-0x%x released for Card%d.\n",isi_card[count].base,isi_card[count].base+15,count+1);
+ printk(KERN_DEBUG "ISICOM: I/O Region 0x%lx-0x%lx released for Card%d.\n",isi_card[count].base,isi_card[count].base+15,count+1);
#endif
}
}