Commit d8d16e47 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] char/isicom: Whitespace cleanup

Trailing spaces and tabs and space used for indentation deleted.  Indented
content of structures.  Switch/case indent.
Signed-off-by: default avatarJiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d9e39538
...@@ -161,16 +161,15 @@ static unsigned long tx_count = 0; ...@@ -161,16 +161,15 @@ static unsigned long tx_count = 0;
static int ISILoad_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); static int ISILoad_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
static void isicom_tx(unsigned long _data); static void isicom_tx(unsigned long _data);
static void isicom_start(struct tty_struct * tty); static void isicom_start(struct tty_struct *tty);
static unsigned char * tmp_buf; static unsigned char *tmp_buf;
static DECLARE_MUTEX(tmp_buf_sem); static DECLARE_MUTEX(tmp_buf_sem);
/* baud index mappings from linux defns to isi */ /* baud index mappings from linux defns to isi */
static signed char linuxb_to_isib[] = { static signed char linuxb_to_isib[] = {
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19
18, 19
}; };
struct isi_board { struct isi_board {
...@@ -261,111 +260,111 @@ static void unlock_card(struct isi_board *card) ...@@ -261,111 +260,111 @@ static void unlock_card(struct isi_board *card)
* ISI Card specific ops ... * ISI Card specific ops ...
*/ */
static void raise_dtr(struct isi_port * port) static void raise_dtr(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0504, base); outw(0x0504, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status |= ISI_DTR; port->status |= ISI_DTR;
unlock_card(card); unlock_card(card);
} }
static inline void drop_dtr(struct isi_port * port) static inline void drop_dtr(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0404, base); outw(0x0404, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status &= ~ISI_DTR; port->status &= ~ISI_DTR;
unlock_card(card); unlock_card(card);
} }
static inline void raise_rts(struct isi_port * port) static inline void raise_rts(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0a04, base); outw(0x0a04, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status |= ISI_RTS; port->status |= ISI_RTS;
unlock_card(card); unlock_card(card);
} }
static inline void drop_rts(struct isi_port * port) static inline void drop_rts(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0804, base); outw(0x0804, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status &= ~ISI_RTS; port->status &= ~ISI_RTS;
unlock_card(card); unlock_card(card);
} }
static inline void raise_dtr_rts(struct isi_port * port) static inline void raise_dtr_rts(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0f04, base); outw(0x0f04, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status |= (ISI_DTR | ISI_RTS); port->status |= (ISI_DTR | ISI_RTS);
unlock_card(card); unlock_card(card);
} }
static void drop_dtr_rts(struct isi_port * port) static void drop_dtr_rts(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw(0x0c04, base); outw(0x0c04, base);
InterruptTheCard(base); InterruptTheCard(base);
port->status &= ~(ISI_RTS | ISI_DTR); port->status &= ~(ISI_RTS | ISI_DTR);
unlock_card(card); unlock_card(card);
} }
static inline void kill_queue(struct isi_port * port, short queue) static inline void kill_queue(struct isi_port *port, short queue)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
unsigned char channel = port->channel; unsigned char channel = port->channel;
if (!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | (channel << card->shift_count) | 0x02 , base); outw(0x8000 | (channel << card->shift_count) | 0x02, base);
outw((queue << 8) | 0x06, base); outw((queue << 8) | 0x06, base);
InterruptTheCard(base); InterruptTheCard(base);
unlock_card(card); unlock_card(card);
...@@ -407,15 +406,15 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -407,15 +406,15 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
/* exec_record exec_rec; */ /* exec_record exec_rec; */
if(get_user(card, (int __user *)argp)) if (get_user(card, (int __user *)argp))
return -EFAULT; return -EFAULT;
if(card < 0 || card >= BOARD_COUNT) if (card < 0 || card >= BOARD_COUNT)
return -ENXIO; return -ENXIO;
base=isi_card[card].base; base=isi_card[card].base;
if(base==0) if (base==0)
return -ENXIO; /* disabled or not used */ return -ENXIO; /* disabled or not used */
switch(cmd) { switch(cmd) {
...@@ -426,12 +425,12 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -426,12 +425,12 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
inw(base+0x8); inw(base+0x8);
for(t=jiffies+HZ/100;time_before(jiffies, t);); for (t=jiffies+HZ/100;time_before(jiffies, t););
outw(0,base+0x8); /* Reset */ outw(0,base+0x8); /* Reset */
for(j=1;j<=3;j++) { for (j=1;j<=3;j++) {
for(t=jiffies+HZ;time_before(jiffies, t);); for (t=jiffies+HZ;time_before(jiffies, t););
printk("."); printk(".");
} }
signature=(inw(base+0x4)) & 0xff; signature=(inw(base+0x4)) & 0xff;
...@@ -487,7 +486,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -487,7 +486,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if(copy_from_user(&frame, argp, sizeof(bin_frame))) if (copy_from_user(&frame, argp, sizeof(bin_frame)))
return -EFAULT; return -EFAULT;
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
...@@ -495,13 +494,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -495,13 +494,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
outw(0xf0,base); /* start upload sequence */ outw(0xf0,base); /* start upload sequence */
outw(0x00,base); outw(0x00,base);
outw((frame.addr), base);/* lsb of adderess */ outw((frame.addr), base); /* lsb of adderess */
word_count=(frame.count >> 1) + frame.count % 2; word_count=(frame.count >> 1) + frame.count % 2;
outw(word_count, base); outw(word_count, base);
InterruptTheCard(base); InterruptTheCard(base);
for(i=0;i<=0x2f;i++); /* a wee bit of delay */ for (i=0;i<=0x2f;i++); /* a wee bit of delay */
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
return -EIO; return -EIO;
...@@ -515,7 +514,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -515,7 +514,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
InterruptTheCard(base); InterruptTheCard(base);
for(i=0;i<=0x0f;i++); /* another wee bit of delay */ for (i=0;i<=0x0f;i++); /* another wee bit of delay */
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
return -EIO; return -EIO;
...@@ -530,7 +529,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -530,7 +529,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if(copy_from_user(&frame, argp, sizeof(bin_header))) if (copy_from_user(&frame, argp, sizeof(bin_header)))
return -EFAULT; return -EFAULT;
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
...@@ -538,13 +537,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -538,13 +537,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
outw(0xf1,base); /* start download sequence */ outw(0xf1,base); /* start download sequence */
outw(0x00,base); outw(0x00,base);
outw((frame.addr), base);/* lsb of adderess */ outw((frame.addr), base); /* lsb of adderess */
word_count=(frame.count >> 1) + frame.count % 2; word_count=(frame.count >> 1) + frame.count % 2;
outw(word_count+1, base); outw(word_count+1, base);
InterruptTheCard(base); InterruptTheCard(base);
for(i=0;i<=0xf;i++); /* a wee bit of delay */ for (i=0;i<=0xf;i++); /* a wee bit of delay */
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
return -EIO; return -EIO;
...@@ -559,7 +558,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -559,7 +558,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
insw(base, frame.bin_data, word_count); insw(base, frame.bin_data, word_count);
InterruptTheCard(base); InterruptTheCard(base);
for(i=0;i<=0x0f;i++); /* another wee bit of delay */ for (i=0;i<=0x0f;i++); /* another wee bit of delay */
if (WaitTillCardIsFree(base)) if (WaitTillCardIsFree(base))
return -EIO; return -EIO;
...@@ -569,7 +568,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -569,7 +568,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
return -EIO; return -EIO;
} }
if(copy_to_user(argp, &frame, sizeof(bin_frame))) if (copy_to_user(argp, &frame, sizeof(bin_frame)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -594,9 +593,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -594,9 +593,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
printk(KERN_DEBUG "ISILoad: Received Ioctl cmd 0x%x.\n", cmd); printk(KERN_DEBUG "ISILoad: Received Ioctl cmd 0x%x.\n", cmd);
#endif #endif
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
} }
...@@ -605,13 +602,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, ...@@ -605,13 +602,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
* *
*/ */
static inline int isicom_paranoia_check(struct isi_port const * port, char *name, static inline int isicom_paranoia_check(struct isi_port const *port, char *name,
const char * routine) const char *routine)
{ {
#ifdef ISICOM_DEBUG #ifdef ISICOM_DEBUG
static const char * badmagic = static const char *badmagic =
KERN_WARNING "ISICOM: Warning: bad isicom magic for dev %s in %s.\n"; KERN_WARNING "ISICOM: Warning: bad isicom magic for dev %s in %s.\n";
static const char * badport = static const char *badport =
KERN_WARNING "ISICOM: Warning: NULL isicom port for dev %s in %s.\n"; KERN_WARNING "ISICOM: Warning: NULL isicom port for dev %s in %s.\n";
if (!port) { if (!port) {
printk(badport, name, routine); printk(badport, name, routine);
...@@ -636,8 +633,8 @@ static void isicom_tx(unsigned long _data) ...@@ -636,8 +633,8 @@ static void isicom_tx(unsigned long _data)
{ {
short count = (BOARD_COUNT-1), card, base; short count = (BOARD_COUNT-1), card, base;
short txcount, wrd, residue, word_count, cnt; short txcount, wrd, residue, word_count, cnt;
struct isi_port * port; struct isi_port *port;
struct tty_struct * tty; struct tty_struct *tty;
#ifdef ISICOM_DEBUG #ifdef ISICOM_DEBUG
++tx_count; ++tx_count;
...@@ -670,7 +667,7 @@ static void isicom_tx(unsigned long _data) ...@@ -670,7 +667,7 @@ static void isicom_tx(unsigned long _data)
tty = port->tty; tty = port->tty;
if(tty == NULL) { if (tty == NULL) {
unlock_card(&isi_card[card]); unlock_card(&isi_card[card]);
continue; continue;
} }
...@@ -749,10 +746,10 @@ static void isicom_tx(unsigned long _data) ...@@ -749,10 +746,10 @@ static void isicom_tx(unsigned long _data)
/* Interrupt handlers */ /* Interrupt handlers */
static void isicom_bottomhalf(void * data) static void isicom_bottomhalf(void *data)
{ {
struct isi_port * port = (struct isi_port *) data; struct isi_port *port = (struct isi_port *) data;
struct tty_struct * tty = port->tty; struct tty_struct *tty = port->tty;
if (!tty) if (!tty)
return; return;
...@@ -768,9 +765,9 @@ static void isicom_bottomhalf(void * data) ...@@ -768,9 +765,9 @@ static void isicom_bottomhalf(void * data)
static irqreturn_t isicom_interrupt(int irq, void *dev_id, static irqreturn_t isicom_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct isi_board * card; struct isi_board *card;
struct isi_port * port; struct isi_port *port;
struct tty_struct * tty; struct tty_struct *tty;
unsigned short base, header, word_count, count; unsigned short base, header, word_count, count;
unsigned char channel; unsigned char channel;
short byte_count; short byte_count;
...@@ -951,10 +948,10 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -951,10 +948,10 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void isicom_config_port(struct isi_port * port) static void isicom_config_port(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
struct tty_struct * tty; struct tty_struct *tty;
unsigned long baud; unsigned long baud;
unsigned short channel_setup, base = card->base; unsigned short channel_setup, base = card->base;
unsigned short channel = port->channel, shift_count = card->shift_count; unsigned short channel = port->channel, shift_count = card->shift_count;
...@@ -1060,10 +1057,10 @@ static void isicom_config_port(struct isi_port * port) ...@@ -1060,10 +1057,10 @@ static void isicom_config_port(struct isi_port * port)
/* open et all */ /* open et all */
static inline void isicom_setup_board(struct isi_board * bp) static inline void isicom_setup_board(struct isi_board *bp)
{ {
int channel; int channel;
struct isi_port * port; struct isi_port *port;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&bp->card_lock, flags); spin_lock_irqsave(&bp->card_lock, flags);
...@@ -1074,14 +1071,14 @@ static inline void isicom_setup_board(struct isi_board * bp) ...@@ -1074,14 +1071,14 @@ static inline void isicom_setup_board(struct isi_board * bp)
port = bp->ports; port = bp->ports;
bp->status |= BOARD_ACTIVE; bp->status |= BOARD_ACTIVE;
spin_unlock_irqrestore(&bp->card_lock, flags); spin_unlock_irqrestore(&bp->card_lock, flags);
for(channel = 0; channel < bp->port_count; channel++, port++) for (channel = 0; channel < bp->port_count; channel++, port++)
drop_dtr_rts(port); drop_dtr_rts(port);
return; return;
} }
static int isicom_setup_port(struct isi_port * port) static int isicom_setup_port(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned long flags; unsigned long flags;
if (port->flags & ASYNC_INITIALIZED) { if (port->flags & ASYNC_INITIALIZED) {
...@@ -1118,9 +1115,9 @@ static int isicom_setup_port(struct isi_port * port) ...@@ -1118,9 +1115,9 @@ static int isicom_setup_port(struct isi_port * port)
return 0; return 0;
} }
static int block_til_ready(struct tty_struct * tty, struct file * filp, struct isi_port * port) static int block_til_ready(struct tty_struct *tty, struct file *filp, struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
int do_clocal = 0, retval; int do_clocal = 0, retval;
unsigned long flags; unsigned long flags;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
...@@ -1196,10 +1193,10 @@ static int block_til_ready(struct tty_struct * tty, struct file * filp, struct i ...@@ -1196,10 +1193,10 @@ static int block_til_ready(struct tty_struct * tty, struct file * filp, struct i
return 0; return 0;
} }
static int isicom_open(struct tty_struct * tty, struct file * filp) static int isicom_open(struct tty_struct *tty, struct file *filp)
{ {
struct isi_port * port; struct isi_port *port;
struct isi_board * card; struct isi_board *card;
unsigned int line, board; unsigned int line, board;
int error; int error;
...@@ -1235,7 +1232,7 @@ static int isicom_open(struct tty_struct * tty, struct file * filp) ...@@ -1235,7 +1232,7 @@ static int isicom_open(struct tty_struct * tty, struct file * filp)
/* close et all */ /* close et all */
static inline void isicom_shutdown_board(struct isi_board * bp) static inline void isicom_shutdown_board(struct isi_board *bp)
{ {
unsigned long flags; unsigned long flags;
...@@ -1246,10 +1243,10 @@ static inline void isicom_shutdown_board(struct isi_board * bp) ...@@ -1246,10 +1243,10 @@ static inline void isicom_shutdown_board(struct isi_board * bp)
spin_unlock_irqrestore(&bp->card_lock, flags); spin_unlock_irqrestore(&bp->card_lock, flags);
} }
static void isicom_shutdown_port(struct isi_port * port) static void isicom_shutdown_port(struct isi_port *port)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
struct tty_struct * tty; struct tty_struct *tty;
unsigned long flags; unsigned long flags;
tty = port->tty; tty = port->tty;
...@@ -1289,16 +1286,16 @@ static void isicom_shutdown_port(struct isi_port * port) ...@@ -1289,16 +1286,16 @@ static void isicom_shutdown_port(struct isi_port * port)
} }
/* last port was closed , shutdown that boad too */ /* last port was closed , shutdown that boad too */
if(C_HUPCL(tty)) { if (C_HUPCL(tty)) {
if (!card->count) if (!card->count)
isicom_shutdown_board(card); isicom_shutdown_board(card);
} }
} }
static void isicom_close(struct tty_struct * tty, struct file * filp) 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 = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned long flags; unsigned long flags;
if (!port) if (!port)
...@@ -1373,11 +1370,11 @@ static void isicom_close(struct tty_struct * tty, struct file * filp) ...@@ -1373,11 +1370,11 @@ static void isicom_close(struct tty_struct * tty, struct file * filp)
} }
/* write et all */ /* write et all */
static int isicom_write(struct tty_struct * tty, static int isicom_write(struct tty_struct *tty, const unsigned char *buf,
const unsigned char * buf, int count) int count)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned long flags; unsigned long flags;
int cnt, total = 0; int cnt, total = 0;
...@@ -1409,10 +1406,10 @@ static int isicom_write(struct tty_struct * tty, ...@@ -1409,10 +1406,10 @@ static int isicom_write(struct tty_struct * tty,
} }
/* put_char et all */ /* put_char et all */
static void isicom_put_char(struct tty_struct * tty, unsigned char ch) 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 = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned long flags; unsigned long flags;
if (isicom_paranoia_check(port, tty->name, "isicom_put_char")) if (isicom_paranoia_check(port, tty->name, "isicom_put_char"))
...@@ -1434,9 +1431,9 @@ static void isicom_put_char(struct tty_struct * tty, unsigned char ch) ...@@ -1434,9 +1431,9 @@ static void isicom_put_char(struct tty_struct * tty, unsigned char ch)
} }
/* flush_chars et all */ /* flush_chars et all */
static void isicom_flush_chars(struct tty_struct * tty) static void isicom_flush_chars(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars")) if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars"))
return; return;
...@@ -1450,9 +1447,9 @@ static void isicom_flush_chars(struct tty_struct * tty) ...@@ -1450,9 +1447,9 @@ static void isicom_flush_chars(struct tty_struct * tty)
} }
/* write_room et all */ /* write_room et all */
static int isicom_write_room(struct tty_struct * tty) static int isicom_write_room(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
int free; int free;
if (isicom_paranoia_check(port, tty->name, "isicom_write_room")) if (isicom_paranoia_check(port, tty->name, "isicom_write_room"))
...@@ -1465,21 +1462,21 @@ static int isicom_write_room(struct tty_struct * tty) ...@@ -1465,21 +1462,21 @@ static int isicom_write_room(struct tty_struct * tty)
} }
/* chars_in_buffer et all */ /* chars_in_buffer et all */
static int isicom_chars_in_buffer(struct tty_struct * tty) static int isicom_chars_in_buffer(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_chars_in_buffer")) if (isicom_paranoia_check(port, tty->name, "isicom_chars_in_buffer"))
return 0; return 0;
return port->xmit_cnt; return port->xmit_cnt;
} }
/* ioctl et all */ /* ioctl et all */
static inline void isicom_send_break(struct isi_port * port, unsigned long length) static inline void isicom_send_break(struct isi_port *port, unsigned long length)
{ {
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned short base = card->base; unsigned short base = card->base;
if(!lock_card(card)) if (!lock_card(card))
return; return;
outw(0x8000 | ((port->channel) << (card->shift_count)) | 0x3, base); outw(0x8000 | ((port->channel) << (card->shift_count)) | 0x3, base);
...@@ -1492,7 +1489,7 @@ static inline void isicom_send_break(struct isi_port * port, unsigned long lengt ...@@ -1492,7 +1489,7 @@ static inline void isicom_send_break(struct isi_port * port, unsigned long lengt
static int isicom_tiocmget(struct tty_struct *tty, struct file *file) 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 = (struct isi_port *) tty->driver_data;
/* just send the port status */ /* just send the port status */
unsigned short status = port->status; unsigned short status = port->status;
...@@ -1510,7 +1507,7 @@ static int isicom_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -1510,7 +1507,7 @@ static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
static int isicom_tiocmset(struct tty_struct *tty, struct file *file, static int isicom_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear) unsigned int set, unsigned int clear)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_ioctl")) if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
return -ENODEV; return -ENODEV;
...@@ -1528,13 +1525,13 @@ static int isicom_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -1528,13 +1525,13 @@ static int isicom_tiocmset(struct tty_struct *tty, struct file *file,
return 0; return 0;
} }
static int isicom_set_serial_info(struct isi_port * port, static int isicom_set_serial_info(struct isi_port *port,
struct serial_struct __user *info) struct serial_struct __user *info)
{ {
struct serial_struct newinfo; struct serial_struct newinfo;
int reconfig_port; int reconfig_port;
if(copy_from_user(&newinfo, info, sizeof(newinfo))) if (copy_from_user(&newinfo, info, sizeof(newinfo)))
return -EFAULT; return -EFAULT;
reconfig_port = ((port->flags & ASYNC_SPD_MASK) != reconfig_port = ((port->flags & ASYNC_SPD_MASK) !=
...@@ -1561,7 +1558,7 @@ static int isicom_set_serial_info(struct isi_port * port, ...@@ -1561,7 +1558,7 @@ static int isicom_set_serial_info(struct isi_port * port,
return 0; return 0;
} }
static int isicom_get_serial_info(struct isi_port * port, static int isicom_get_serial_info(struct isi_port *port,
struct serial_struct __user *info) struct serial_struct __user *info)
{ {
struct serial_struct out_info; struct serial_struct out_info;
...@@ -1575,15 +1572,15 @@ static int isicom_get_serial_info(struct isi_port * port, ...@@ -1575,15 +1572,15 @@ static int isicom_get_serial_info(struct isi_port * port,
/* out_info.baud_base = ? */ /* out_info.baud_base = ? */
out_info.close_delay = port->close_delay; out_info.close_delay = port->close_delay;
out_info.closing_wait = port->closing_wait; out_info.closing_wait = port->closing_wait;
if(copy_to_user(info, &out_info, sizeof(out_info))) if (copy_to_user(info, &out_info, sizeof(out_info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
static int isicom_ioctl(struct tty_struct * tty, struct file * filp, static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int retval; int retval;
...@@ -1612,7 +1609,7 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp, ...@@ -1612,7 +1609,7 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp); return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp);
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if(get_user(arg, (unsigned long __user *) argp)) if (get_user(arg, (unsigned long __user *) argp))
return -EFAULT; return -EFAULT;
tty->termios->c_cflag = tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) | ((tty->termios->c_cflag & ~CLOCAL) |
...@@ -1632,9 +1629,10 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp, ...@@ -1632,9 +1629,10 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
} }
/* set_termios et all */ /* set_termios et all */
static void isicom_set_termios(struct tty_struct * tty, struct termios * old_termios) 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 = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_set_termios")) if (isicom_paranoia_check(port, tty->name, "isicom_set_termios"))
return; return;
...@@ -1653,10 +1651,10 @@ static void isicom_set_termios(struct tty_struct * tty, struct termios * old_ter ...@@ -1653,10 +1651,10 @@ static void isicom_set_termios(struct tty_struct * tty, struct termios * old_ter
} }
/* throttle et all */ /* throttle et all */
static void isicom_throttle(struct tty_struct * tty) static void isicom_throttle(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
if (isicom_paranoia_check(port, tty->name, "isicom_throttle")) if (isicom_paranoia_check(port, tty->name, "isicom_throttle"))
return; return;
...@@ -1667,10 +1665,10 @@ static void isicom_throttle(struct tty_struct * tty) ...@@ -1667,10 +1665,10 @@ static void isicom_throttle(struct tty_struct * tty)
} }
/* unthrottle et all */ /* unthrottle et all */
static void isicom_unthrottle(struct tty_struct * tty) static void isicom_unthrottle(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
if (isicom_paranoia_check(port, tty->name, "isicom_unthrottle")) if (isicom_paranoia_check(port, tty->name, "isicom_unthrottle"))
return; return;
...@@ -1681,9 +1679,9 @@ static void isicom_unthrottle(struct tty_struct * tty) ...@@ -1681,9 +1679,9 @@ static void isicom_unthrottle(struct tty_struct * tty)
} }
/* stop et all */ /* stop et all */
static void isicom_stop(struct tty_struct * tty) static void isicom_stop(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_stop")) if (isicom_paranoia_check(port, tty->name, "isicom_stop"))
return; return;
...@@ -1694,9 +1692,9 @@ static void isicom_stop(struct tty_struct * tty) ...@@ -1694,9 +1692,9 @@ static void isicom_stop(struct tty_struct * tty)
} }
/* start et all */ /* start et all */
static void isicom_start(struct tty_struct * tty) static void isicom_start(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_start")) if (isicom_paranoia_check(port, tty->name, "isicom_start"))
return; return;
...@@ -1707,19 +1705,19 @@ static void isicom_start(struct tty_struct * tty) ...@@ -1707,19 +1705,19 @@ static void isicom_start(struct tty_struct * tty)
} }
/* hangup et all */ /* hangup et all */
static void do_isicom_hangup(void * data) static void do_isicom_hangup(void *data)
{ {
struct isi_port * port = (struct isi_port *) data; struct isi_port *port = (struct isi_port *) data;
struct tty_struct * tty; struct tty_struct *tty;
tty = port->tty; tty = port->tty;
if (tty) if (tty)
tty_hangup(tty); tty_hangup(tty);
} }
static void isicom_hangup(struct tty_struct * tty) static void isicom_hangup(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
if (isicom_paranoia_check(port, tty->name, "isicom_hangup")) if (isicom_paranoia_check(port, tty->name, "isicom_hangup"))
return; return;
...@@ -1732,10 +1730,10 @@ static void isicom_hangup(struct tty_struct * tty) ...@@ -1732,10 +1730,10 @@ static void isicom_hangup(struct tty_struct * tty)
} }
/* flush_buffer et all */ /* flush_buffer et all */
static void isicom_flush_buffer(struct tty_struct * tty) static void isicom_flush_buffer(struct tty_struct *tty)
{ {
struct isi_port * port = (struct isi_port *) tty->driver_data; struct isi_port *port = (struct isi_port *) tty->driver_data;
struct isi_board * card = port->card; struct isi_board *card = port->card;
unsigned long flags; unsigned long flags;
if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer")) if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer"))
...@@ -1880,7 +1878,7 @@ static void __exit unregister_isr(void) ...@@ -1880,7 +1878,7 @@ static void __exit unregister_isr(void)
static int __devinit isicom_init(void) static int __devinit isicom_init(void)
{ {
int card, channel, base; int card, channel, base;
struct isi_port * port; struct isi_port *port;
unsigned long page; unsigned long page;
if (!tmp_buf) { if (!tmp_buf) {
...@@ -1963,7 +1961,7 @@ static int __devinit isicom_setup(void) ...@@ -1963,7 +1961,7 @@ static int __devinit isicom_setup(void)
unsigned int ioaddr; unsigned int ioaddr;
card = 0; card = 0;
for(idx=0; idx < BOARD_COUNT; idx++) { for (idx=0; idx < BOARD_COUNT; idx++) {
if (io[idx]) { if (io[idx]) {
isi_card[idx].base=io[idx]; isi_card[idx].base=io[idx];
isi_card[idx].irq=irq[idx]; isi_card[idx].irq=irq[idx];
...@@ -2005,7 +2003,8 @@ static int __devinit isicom_setup(void) ...@@ -2005,7 +2003,8 @@ static int __devinit isicom_setup(void)
break; break;
/* found a PCI ISI card! */ /* found a PCI ISI card! */
ioaddr = pci_resource_start (dev, 3); /* i.e at offset 0x1c in the ioaddr = pci_resource_start (dev, 3);
/* i.e at offset 0x1c in the
* PCI configuration register * PCI configuration register
* space. * space.
*/ */
...@@ -2063,7 +2062,7 @@ static void __exit isicom_exit(void) ...@@ -2063,7 +2062,7 @@ static void __exit isicom_exit(void)
unregister_isr(); unregister_isr();
unregister_drivers(); unregister_drivers();
unregister_ioregion(); unregister_ioregion();
if(tmp_buf) if (tmp_buf)
free_page((unsigned long)tmp_buf); free_page((unsigned long)tmp_buf);
if (misc_deregister(&isiloader_device)) if (misc_deregister(&isiloader_device))
printk(KERN_ERR "ISICOM: Unable to unregister Firmware Loader driver\n"); printk(KERN_ERR "ISICOM: Unable to unregister Firmware Loader driver\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment