Commit fe4c2723 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: istallion

istallion annotated, cleaned up, a bunch of useless verify_area()
removed.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c09d206b
...@@ -680,8 +680,8 @@ static int stli_portinfo(stlibrd_t *brdp, stliport_t *portp, int portnr, char *p ...@@ -680,8 +680,8 @@ static int stli_portinfo(stlibrd_t *brdp, stliport_t *portp, int portnr, char *p
static int stli_brdinit(stlibrd_t *brdp); static int stli_brdinit(stlibrd_t *brdp);
static int stli_startbrd(stlibrd_t *brdp); static int stli_startbrd(stlibrd_t *brdp);
static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *offp); static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp);
static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, loff_t *offp); static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp);
static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg); static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
static void stli_brdpoll(stlibrd_t *brdp, volatile cdkhdr_t *hdrp); static void stli_brdpoll(stlibrd_t *brdp, volatile cdkhdr_t *hdrp);
static void stli_poll(unsigned long arg); static void stli_poll(unsigned long arg);
...@@ -700,14 +700,14 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio ...@@ -700,14 +700,14 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio
static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts); static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
static long stli_mktiocm(unsigned long sigvalue); static long stli_mktiocm(unsigned long sigvalue);
static void stli_read(stlibrd_t *brdp, stliport_t *portp); static void stli_read(stlibrd_t *brdp, stliport_t *portp);
static int stli_getserial(stliport_t *portp, struct serial_struct *sp); static int stli_getserial(stliport_t *portp, struct serial_struct __user *sp);
static int stli_setserial(stliport_t *portp, struct serial_struct *sp); static int stli_setserial(stliport_t *portp, struct serial_struct __user *sp);
static int stli_getbrdstats(combrd_t *bp); static int stli_getbrdstats(combrd_t __user *bp);
static int stli_getportstats(stliport_t *portp, comstats_t *cp); static int stli_getportstats(stliport_t *portp, comstats_t __user *cp);
static int stli_portcmdstats(stliport_t *portp); static int stli_portcmdstats(stliport_t *portp);
static int stli_clrportstats(stliport_t *portp, comstats_t *cp); static int stli_clrportstats(stliport_t *portp, comstats_t __user *cp);
static int stli_getportstruct(unsigned long arg); static int stli_getportstruct(stliport_t __user *arg);
static int stli_getbrdstruct(unsigned long arg); static int stli_getbrdstruct(stlibrd_t __user *arg);
static void *stli_memalloc(int len); static void *stli_memalloc(int len);
static stlibrd_t *stli_allocbrd(void); static stlibrd_t *stli_allocbrd(void);
...@@ -808,7 +808,7 @@ static int __init istallion_module_init(void) ...@@ -808,7 +808,7 @@ static int __init istallion_module_init(void)
{ {
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("init_module()\n"); printk("init_module()\n");
#endif #endif
...@@ -829,7 +829,7 @@ static void __exit istallion_module_exit(void) ...@@ -829,7 +829,7 @@ static void __exit istallion_module_exit(void)
unsigned long flags; unsigned long flags;
int i, j; int i, j;
#if DEBUG #ifdef DEBUG
printk("cleanup_module()\n"); printk("cleanup_module()\n");
#endif #endif
...@@ -901,13 +901,13 @@ module_exit(istallion_module_exit); ...@@ -901,13 +901,13 @@ module_exit(istallion_module_exit);
* Check for any arguments passed in on the module load command line. * Check for any arguments passed in on the module load command line.
*/ */
static void stli_argbrds() static void stli_argbrds(void)
{ {
stlconf_t conf; stlconf_t conf;
stlibrd_t *brdp; stlibrd_t *brdp;
int nrargs, i; int nrargs, i;
#if DEBUG #ifdef DEBUG
printk("stli_argbrds()\n"); printk("stli_argbrds()\n");
#endif #endif
...@@ -975,7 +975,7 @@ static int stli_parsebrd(stlconf_t *confp, char **argp) ...@@ -975,7 +975,7 @@ static int stli_parsebrd(stlconf_t *confp, char **argp)
char *sp; char *sp;
int nrbrdnames, i; int nrbrdnames, i;
#if DEBUG #ifdef DEBUG
printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp); printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
#endif #endif
...@@ -1025,7 +1025,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp) ...@@ -1025,7 +1025,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
unsigned int minordev; unsigned int minordev;
int brdnr, portnr, rc; int brdnr, portnr, rc;
#if DEBUG #ifdef DEBUG
printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty, printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
(int) filp, tty->name); (int) filp, tty->name);
#endif #endif
...@@ -1125,7 +1125,7 @@ static void stli_close(struct tty_struct *tty, struct file *filp) ...@@ -1125,7 +1125,7 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
stliport_t *portp; stliport_t *portp;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_close(tty=%x,filp=%x)\n", (int) tty, (int) filp); printk("stli_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
#endif #endif
...@@ -1210,7 +1210,7 @@ static int stli_initopen(stlibrd_t *brdp, stliport_t *portp) ...@@ -1210,7 +1210,7 @@ static int stli_initopen(stlibrd_t *brdp, stliport_t *portp)
asyport_t aport; asyport_t aport;
int rc; int rc;
#if DEBUG #ifdef DEBUG
printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp); printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp);
#endif #endif
...@@ -1263,7 +1263,7 @@ static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, i ...@@ -1263,7 +1263,7 @@ static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, i
unsigned long flags; unsigned long flags;
int rc; int rc;
#if DEBUG #ifdef DEBUG
printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n", printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait); (int) brdp, (int) portp, (int) arg, wait);
#endif #endif
...@@ -1344,7 +1344,7 @@ static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, ...@@ -1344,7 +1344,7 @@ static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg,
unsigned long flags; unsigned long flags;
int rc; int rc;
#if DEBUG #ifdef DEBUG
printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n", printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait); (int) brdp, (int) portp, (int) arg, wait);
#endif #endif
...@@ -1417,7 +1417,7 @@ static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, v ...@@ -1417,7 +1417,7 @@ static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, v
{ {
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d," printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd, "copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback); (int) arg, size, copyback);
...@@ -1461,7 +1461,7 @@ static int stli_setport(stliport_t *portp) ...@@ -1461,7 +1461,7 @@ static int stli_setport(stliport_t *portp)
stlibrd_t *brdp; stlibrd_t *brdp;
asyport_t aport; asyport_t aport;
#if DEBUG #ifdef DEBUG
printk("stli_setport(portp=%x)\n", (int) portp); printk("stli_setport(portp=%x)\n", (int) portp);
#endif #endif
...@@ -1489,7 +1489,7 @@ static int stli_setport(stliport_t *portp) ...@@ -1489,7 +1489,7 @@ static int stli_setport(stliport_t *portp)
static void stli_delay(int len) static void stli_delay(int len)
{ {
#if DEBUG #ifdef DEBUG
printk("stli_delay(len=%d)\n", len); printk("stli_delay(len=%d)\n", len);
#endif #endif
if (len > 0) { if (len > 0) {
...@@ -1510,7 +1510,7 @@ static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *fil ...@@ -1510,7 +1510,7 @@ static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *fil
unsigned long flags; unsigned long flags;
int rc, doclocal; int rc, doclocal;
#if DEBUG #ifdef DEBUG
printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n", printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n",
(int) brdp, (int) portp, (int) filp); (int) brdp, (int) portp, (int) filp);
#endif #endif
...@@ -1578,7 +1578,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char ...@@ -1578,7 +1578,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char
unsigned int len, stlen, head, tail, size; unsigned int len, stlen, head, tail, size;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_write(tty=%x,from_user=%d,buf=%x,count=%d)\n", printk("stli_write(tty=%x,from_user=%d,buf=%x,count=%d)\n",
(int) tty, from_user, (int) buf, count); (int) tty, from_user, (int) buf, count);
#endif #endif
...@@ -1699,7 +1699,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char ...@@ -1699,7 +1699,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char
static void stli_putchar(struct tty_struct *tty, unsigned char ch) static void stli_putchar(struct tty_struct *tty, unsigned char ch)
{ {
#if DEBUG #ifdef DEBUG
printk("stli_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch); printk("stli_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
#endif #endif
...@@ -1736,7 +1736,7 @@ static void stli_flushchars(struct tty_struct *tty) ...@@ -1736,7 +1736,7 @@ static void stli_flushchars(struct tty_struct *tty)
unsigned char *buf, *shbuf; unsigned char *buf, *shbuf;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_flushchars(tty=%x)\n", (int) tty); printk("stli_flushchars(tty=%x)\n", (int) tty);
#endif #endif
...@@ -1827,7 +1827,7 @@ static int stli_writeroom(struct tty_struct *tty) ...@@ -1827,7 +1827,7 @@ static int stli_writeroom(struct tty_struct *tty)
unsigned int head, tail, len; unsigned int head, tail, len;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_writeroom(tty=%x)\n", (int) tty); printk("stli_writeroom(tty=%x)\n", (int) tty);
#endif #endif
...@@ -1887,7 +1887,7 @@ static int stli_charsinbuffer(struct tty_struct *tty) ...@@ -1887,7 +1887,7 @@ static int stli_charsinbuffer(struct tty_struct *tty)
unsigned int head, tail, len; unsigned int head, tail, len;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk("stli_charsinbuffer(tty=%x)\n", (int) tty); printk("stli_charsinbuffer(tty=%x)\n", (int) tty);
#endif #endif
...@@ -1927,12 +1927,12 @@ static int stli_charsinbuffer(struct tty_struct *tty) ...@@ -1927,12 +1927,12 @@ static int stli_charsinbuffer(struct tty_struct *tty)
* Generate the serial struct info. * Generate the serial struct info.
*/ */
static int stli_getserial(stliport_t *portp, struct serial_struct *sp) static int stli_getserial(stliport_t *portp, struct serial_struct __user *sp)
{ {
struct serial_struct sio; struct serial_struct sio;
stlibrd_t *brdp; stlibrd_t *brdp;
#if DEBUG #ifdef DEBUG
printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
#endif #endif
...@@ -1964,13 +1964,13 @@ static int stli_getserial(stliport_t *portp, struct serial_struct *sp) ...@@ -1964,13 +1964,13 @@ static int stli_getserial(stliport_t *portp, struct serial_struct *sp)
* just quietly ignore any requests to change irq, etc. * just quietly ignore any requests to change irq, etc.
*/ */
static int stli_setserial(stliport_t *portp, struct serial_struct *sp) static int stli_setserial(stliport_t *portp, struct serial_struct __user *sp)
{ {
struct serial_struct sio; struct serial_struct sio;
int rc; int rc;
#if DEBUG #ifdef DEBUG
printk("stli_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); printk("stli_setserial(portp=%p,sp=%p)\n", portp, sp);
#endif #endif
if (copy_from_user(&sio, sp, sizeof(struct serial_struct))) if (copy_from_user(&sio, sp, sizeof(struct serial_struct)))
...@@ -2058,8 +2058,9 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm ...@@ -2058,8 +2058,9 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
stlibrd_t *brdp; stlibrd_t *brdp;
unsigned int ival; unsigned int ival;
int rc; int rc;
void __user *argp = (void __user *)arg;
#if DEBUG #ifdef DEBUG
printk("stli_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n", printk("stli_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
(int) tty, (int) file, cmd, (int) arg); (int) tty, (int) file, cmd, (int) arg);
#endif #endif
...@@ -2086,40 +2087,32 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm ...@@ -2086,40 +2087,32 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
switch (cmd) { switch (cmd) {
case TIOCGSOFTCAR: case TIOCGSOFTCAR:
rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
(unsigned int *) arg); (unsigned __user *) arg);
break; break;
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) if ((rc = get_user(ival, (unsigned __user *) arg)) == 0)
tty->termios->c_cflag = tty->termios->c_cflag =
(tty->termios->c_cflag & ~CLOCAL) | (tty->termios->c_cflag & ~CLOCAL) |
(ival ? CLOCAL : 0); (ival ? CLOCAL : 0);
break; break;
case TIOCGSERIAL: case TIOCGSERIAL:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg, rc = stli_getserial(portp, argp);
sizeof(struct serial_struct))) == 0)
rc = stli_getserial(portp, (struct serial_struct *) arg);
break; break;
case TIOCSSERIAL: case TIOCSSERIAL:
if ((rc = verify_area(VERIFY_READ, (void *) arg, rc = stli_setserial(portp, argp);
sizeof(struct serial_struct))) == 0)
rc = stli_setserial(portp, (struct serial_struct *)arg);
break; break;
case STL_GETPFLAG: case STL_GETPFLAG:
rc = put_user(portp->pflag, (unsigned int *) arg); rc = put_user(portp->pflag, (unsigned __user *)argp);
break; break;
case STL_SETPFLAG: case STL_SETPFLAG:
if ((rc = get_user(portp->pflag, (unsigned int *) arg)) == 0) if ((rc = get_user(portp->pflag, (unsigned __user *)argp)) == 0)
stli_setport(portp); stli_setport(portp);
break; break;
case COM_GETPORTSTATS: case COM_GETPORTSTATS:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg, rc = stli_getportstats(portp, argp);
sizeof(comstats_t))) == 0)
rc = stli_getportstats(portp, (comstats_t *) arg);
break; break;
case COM_CLRPORTSTATS: case COM_CLRPORTSTATS:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg, rc = stli_clrportstats(portp, argp);
sizeof(comstats_t))) == 0)
rc = stli_clrportstats(portp, (comstats_t *) arg);
break; break;
case TIOCSERCONFIG: case TIOCSERCONFIG:
case TIOCSERGWILD: case TIOCSERGWILD:
...@@ -2150,7 +2143,7 @@ static void stli_settermios(struct tty_struct *tty, struct termios *old) ...@@ -2150,7 +2143,7 @@ static void stli_settermios(struct tty_struct *tty, struct termios *old)
struct termios *tiosp; struct termios *tiosp;
asyport_t aport; asyport_t aport;
#if DEBUG #ifdef DEBUG
printk("stli_settermios(tty=%x,old=%x)\n", (int) tty, (int) old); printk("stli_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
#endif #endif
...@@ -2197,7 +2190,7 @@ static void stli_throttle(struct tty_struct *tty) ...@@ -2197,7 +2190,7 @@ static void stli_throttle(struct tty_struct *tty)
{ {
stliport_t *portp; stliport_t *portp;
#if DEBUG #ifdef DEBUG
printk("stli_throttle(tty=%x)\n", (int) tty); printk("stli_throttle(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2222,7 +2215,7 @@ static void stli_unthrottle(struct tty_struct *tty) ...@@ -2222,7 +2215,7 @@ static void stli_unthrottle(struct tty_struct *tty)
{ {
stliport_t *portp; stliport_t *portp;
#if DEBUG #ifdef DEBUG
printk("stli_unthrottle(tty=%x)\n", (int) tty); printk("stli_unthrottle(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2248,7 +2241,7 @@ static void stli_stop(struct tty_struct *tty) ...@@ -2248,7 +2241,7 @@ static void stli_stop(struct tty_struct *tty)
stliport_t *portp; stliport_t *portp;
asyctrl_t actrl; asyctrl_t actrl;
#if DEBUG #ifdef DEBUG
printk("stli_stop(tty=%x)\n", (int) tty); printk("stli_stop(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2282,7 +2275,7 @@ static void stli_start(struct tty_struct *tty) ...@@ -2282,7 +2275,7 @@ static void stli_start(struct tty_struct *tty)
stlibrd_t *brdp; stlibrd_t *brdp;
asyctrl_t actrl; asyctrl_t actrl;
#if DEBUG #ifdef DEBUG
printk("stli_start(tty=%x)\n", (int) tty); printk("stli_start(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2319,7 +2312,7 @@ static void stli_dohangup(void *arg) ...@@ -2319,7 +2312,7 @@ static void stli_dohangup(void *arg)
{ {
stliport_t *portp; stliport_t *portp;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_dohangup(portp=%x)\n", (int) arg); printk(KERN_DEBUG "stli_dohangup(portp=%x)\n", (int) arg);
#endif #endif
...@@ -2351,7 +2344,7 @@ static void stli_hangup(struct tty_struct *tty) ...@@ -2351,7 +2344,7 @@ static void stli_hangup(struct tty_struct *tty)
stlibrd_t *brdp; stlibrd_t *brdp;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_hangup(tty=%x)\n", (int) tty); printk(KERN_DEBUG "stli_hangup(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2409,7 +2402,7 @@ static void stli_flushbuffer(struct tty_struct *tty) ...@@ -2409,7 +2402,7 @@ static void stli_flushbuffer(struct tty_struct *tty)
stlibrd_t *brdp; stlibrd_t *brdp;
unsigned long ftype, flags; unsigned long ftype, flags;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_flushbuffer(tty=%x)\n", (int) tty); printk(KERN_DEBUG "stli_flushbuffer(tty=%x)\n", (int) tty);
#endif #endif
...@@ -2459,7 +2452,7 @@ static void stli_breakctl(struct tty_struct *tty, int state) ...@@ -2459,7 +2452,7 @@ static void stli_breakctl(struct tty_struct *tty, int state)
long arg; long arg;
/* long savestate, savetime; */ /* long savestate, savetime; */
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_breakctl(tty=%x,state=%d)\n", (int) tty, state); printk(KERN_DEBUG "stli_breakctl(tty=%x,state=%d)\n", (int) tty, state);
#endif #endif
...@@ -2498,7 +2491,7 @@ static void stli_waituntilsent(struct tty_struct *tty, int timeout) ...@@ -2498,7 +2491,7 @@ static void stli_waituntilsent(struct tty_struct *tty, int timeout)
stliport_t *portp; stliport_t *portp;
unsigned long tend; unsigned long tend;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_waituntilsent(tty=%x,timeout=%x)\n", (int) tty, timeout); printk(KERN_DEBUG "stli_waituntilsent(tty=%x,timeout=%x)\n", (int) tty, timeout);
#endif #endif
...@@ -2529,7 +2522,7 @@ static void stli_sendxchar(struct tty_struct *tty, char ch) ...@@ -2529,7 +2522,7 @@ static void stli_sendxchar(struct tty_struct *tty, char ch)
stliport_t *portp; stliport_t *portp;
asyctrl_t actrl; asyctrl_t actrl;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch); printk(KERN_DEBUG "stli_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
#endif #endif
...@@ -2636,7 +2629,7 @@ static int stli_readproc(char *page, char **start, off_t off, int count, int *eo ...@@ -2636,7 +2629,7 @@ static int stli_readproc(char *page, char **start, off_t off, int count, int *eo
int curoff, maxoff; int curoff, maxoff;
char *pos; char *pos;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_readproc(page=%x,start=%x,off=%x,count=%d,eof=%x," printk(KERN_DEBUG "stli_readproc(page=%x,start=%x,off=%x,count=%d,eof=%x,"
"data=%x\n", (int) page, (int) start, (int) off, count, "data=%x\n", (int) page, (int) start, (int) off, count,
(int) eof, (int) data); (int) eof, (int) data);
...@@ -2712,7 +2705,7 @@ static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, ...@@ -2712,7 +2705,7 @@ static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd,
volatile unsigned char *bits; volatile unsigned char *bits;
unsigned long flags; unsigned long flags;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d," printk(KERN_DEBUG "stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd, "copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback); (int) arg, size, copyback);
...@@ -2766,7 +2759,7 @@ static inline void stli_read(stlibrd_t *brdp, stliport_t *portp) ...@@ -2766,7 +2759,7 @@ static inline void stli_read(stlibrd_t *brdp, stliport_t *portp)
unsigned int head, tail, size; unsigned int head, tail, size;
unsigned int len, stlen; unsigned int len, stlen;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_read(brdp=%x,portp=%d)\n", printk(KERN_DEBUG "stli_read(brdp=%x,portp=%d)\n",
(int) brdp, (int) portp); (int) brdp, (int) portp);
#endif #endif
...@@ -2883,7 +2876,7 @@ static inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp) ...@@ -2883,7 +2876,7 @@ static inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp)
unsigned long oldsigs; unsigned long oldsigs;
int rc, donerx; int rc, donerx;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_hostcmd(brdp=%x,channr=%d)\n", printk(KERN_DEBUG "stli_hostcmd(brdp=%x,channr=%d)\n",
(int) brdp, channr); (int) brdp, channr);
#endif #endif
...@@ -3135,7 +3128,7 @@ static void stli_poll(unsigned long arg) ...@@ -3135,7 +3128,7 @@ static void stli_poll(unsigned long arg)
static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp) static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n", printk(KERN_DEBUG "stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n",
(int) portp, (int) pp, (int) tiosp); (int) portp, (int) pp, (int) tiosp);
#endif #endif
...@@ -3258,7 +3251,7 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio ...@@ -3258,7 +3251,7 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio
static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts) static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_mkasysigs(sp=%x,dtr=%d,rts=%d)\n", printk(KERN_DEBUG "stli_mkasysigs(sp=%x,dtr=%d,rts=%d)\n",
(int) sp, dtr, rts); (int) sp, dtr, rts);
#endif #endif
...@@ -3285,7 +3278,7 @@ static long stli_mktiocm(unsigned long sigvalue) ...@@ -3285,7 +3278,7 @@ static long stli_mktiocm(unsigned long sigvalue)
{ {
long tiocm; long tiocm;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_mktiocm(sigvalue=%x)\n", (int) sigvalue); printk(KERN_DEBUG "stli_mktiocm(sigvalue=%x)\n", (int) sigvalue);
#endif #endif
...@@ -3311,7 +3304,7 @@ static inline int stli_initports(stlibrd_t *brdp) ...@@ -3311,7 +3304,7 @@ static inline int stli_initports(stlibrd_t *brdp)
stliport_t *portp; stliport_t *portp;
int i, panelnr, panelport; int i, panelnr, panelport;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_initports(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_initports(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3355,7 +3348,7 @@ static void stli_ecpinit(stlibrd_t *brdp) ...@@ -3355,7 +3348,7 @@ static void stli_ecpinit(stlibrd_t *brdp)
{ {
unsigned long memconf; unsigned long memconf;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpinit(brdp=%d)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpinit(brdp=%d)\n", (int) brdp);
#endif #endif
...@@ -3372,7 +3365,7 @@ static void stli_ecpinit(stlibrd_t *brdp) ...@@ -3372,7 +3365,7 @@ static void stli_ecpinit(stlibrd_t *brdp)
static void stli_ecpenable(stlibrd_t *brdp) static void stli_ecpenable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpenable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpenable(brdp=%x)\n", (int) brdp);
#endif #endif
outb(ECP_ATENABLE, (brdp->iobase + ECP_ATCONFR)); outb(ECP_ATENABLE, (brdp->iobase + ECP_ATCONFR));
...@@ -3382,7 +3375,7 @@ static void stli_ecpenable(stlibrd_t *brdp) ...@@ -3382,7 +3375,7 @@ static void stli_ecpenable(stlibrd_t *brdp)
static void stli_ecpdisable(stlibrd_t *brdp) static void stli_ecpdisable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpdisable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpdisable(brdp=%x)\n", (int) brdp);
#endif #endif
outb(ECP_ATDISABLE, (brdp->iobase + ECP_ATCONFR)); outb(ECP_ATDISABLE, (brdp->iobase + ECP_ATCONFR));
...@@ -3395,7 +3388,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3395,7 +3388,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
void *ptr; void *ptr;
unsigned char val; unsigned char val;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpgetmemptr(brdp=%x,offset=%x)\n", (int) brdp, printk(KERN_DEBUG "stli_ecpgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset); (int) offset);
#endif #endif
...@@ -3404,7 +3397,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3404,7 +3397,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % ECP_ATPAGESIZE); ptr = brdp->membase + (offset % ECP_ATPAGESIZE);
...@@ -3418,7 +3411,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3418,7 +3411,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
static void stli_ecpreset(stlibrd_t *brdp) static void stli_ecpreset(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpreset(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpreset(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3432,7 +3425,7 @@ static void stli_ecpreset(stlibrd_t *brdp) ...@@ -3432,7 +3425,7 @@ static void stli_ecpreset(stlibrd_t *brdp)
static void stli_ecpintr(stlibrd_t *brdp) static void stli_ecpintr(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpintr(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpintr(brdp=%x)\n", (int) brdp);
#endif #endif
outb(0x1, brdp->iobase); outb(0x1, brdp->iobase);
...@@ -3448,7 +3441,7 @@ static void stli_ecpeiinit(stlibrd_t *brdp) ...@@ -3448,7 +3441,7 @@ static void stli_ecpeiinit(stlibrd_t *brdp)
{ {
unsigned long memconf; unsigned long memconf;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpeiinit(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecpeiinit(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3485,7 +3478,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line ...@@ -3485,7 +3478,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line
void *ptr; void *ptr;
unsigned char val; unsigned char val;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecpeigetmemptr(brdp=%x,offset=%x,line=%d)\n", printk(KERN_DEBUG "stli_ecpeigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line); (int) brdp, (int) offset, line);
#endif #endif
...@@ -3494,7 +3487,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line ...@@ -3494,7 +3487,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % ECP_EIPAGESIZE); ptr = brdp->membase + (offset % ECP_EIPAGESIZE);
...@@ -3546,7 +3539,7 @@ static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line ...@@ -3546,7 +3539,7 @@ static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % ECP_MCPAGESIZE); ptr = brdp->membase + (offset % ECP_MCPAGESIZE);
...@@ -3574,7 +3567,7 @@ static void stli_ecpmcreset(stlibrd_t *brdp) ...@@ -3574,7 +3567,7 @@ static void stli_ecpmcreset(stlibrd_t *brdp)
static void stli_ecppciinit(stlibrd_t *brdp) static void stli_ecppciinit(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecppciinit(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_ecppciinit(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3591,7 +3584,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin ...@@ -3591,7 +3584,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin
void *ptr; void *ptr;
unsigned char val; unsigned char val;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_ecppcigetmemptr(brdp=%x,offset=%x,line=%d)\n", printk(KERN_DEBUG "stli_ecppcigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line); (int) brdp, (int) offset, line);
#endif #endif
...@@ -3600,7 +3593,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin ...@@ -3600,7 +3593,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), board=%d\n", "range at line=%d(%d), board=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % ECP_PCIPAGESIZE); ptr = brdp->membase + (offset % ECP_PCIPAGESIZE);
...@@ -3630,7 +3623,7 @@ static void stli_onbinit(stlibrd_t *brdp) ...@@ -3630,7 +3623,7 @@ static void stli_onbinit(stlibrd_t *brdp)
{ {
unsigned long memconf; unsigned long memconf;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbinit(brdp=%d)\n", (int) brdp); printk(KERN_DEBUG "stli_onbinit(brdp=%d)\n", (int) brdp);
#endif #endif
...@@ -3649,7 +3642,7 @@ static void stli_onbinit(stlibrd_t *brdp) ...@@ -3649,7 +3642,7 @@ static void stli_onbinit(stlibrd_t *brdp)
static void stli_onbenable(stlibrd_t *brdp) static void stli_onbenable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbenable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_onbenable(brdp=%x)\n", (int) brdp);
#endif #endif
outb((brdp->enabval | ONB_ATENABLE), (brdp->iobase + ONB_ATCONFR)); outb((brdp->enabval | ONB_ATENABLE), (brdp->iobase + ONB_ATCONFR));
...@@ -3659,7 +3652,7 @@ static void stli_onbenable(stlibrd_t *brdp) ...@@ -3659,7 +3652,7 @@ static void stli_onbenable(stlibrd_t *brdp)
static void stli_onbdisable(stlibrd_t *brdp) static void stli_onbdisable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbdisable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_onbdisable(brdp=%x)\n", (int) brdp);
#endif #endif
outb((brdp->enabval | ONB_ATDISABLE), (brdp->iobase + ONB_ATCONFR)); outb((brdp->enabval | ONB_ATDISABLE), (brdp->iobase + ONB_ATCONFR));
...@@ -3671,7 +3664,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3671,7 +3664,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
{ {
void *ptr; void *ptr;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbgetmemptr(brdp=%x,offset=%x)\n", (int) brdp, printk(KERN_DEBUG "stli_onbgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset); (int) offset);
#endif #endif
...@@ -3680,7 +3673,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3680,7 +3673,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
} else { } else {
ptr = brdp->membase + (offset % ONB_ATPAGESIZE); ptr = brdp->membase + (offset % ONB_ATPAGESIZE);
} }
...@@ -3692,7 +3685,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3692,7 +3685,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
static void stli_onbreset(stlibrd_t *brdp) static void stli_onbreset(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbreset(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_onbreset(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3712,7 +3705,7 @@ static void stli_onbeinit(stlibrd_t *brdp) ...@@ -3712,7 +3705,7 @@ static void stli_onbeinit(stlibrd_t *brdp)
{ {
unsigned long memconf; unsigned long memconf;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbeinit(brdp=%d)\n", (int) brdp); printk(KERN_DEBUG "stli_onbeinit(brdp=%d)\n", (int) brdp);
#endif #endif
...@@ -3734,7 +3727,7 @@ static void stli_onbeinit(stlibrd_t *brdp) ...@@ -3734,7 +3727,7 @@ static void stli_onbeinit(stlibrd_t *brdp)
static void stli_onbeenable(stlibrd_t *brdp) static void stli_onbeenable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbeenable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_onbeenable(brdp=%x)\n", (int) brdp);
#endif #endif
outb(ONB_EIENABLE, (brdp->iobase + ONB_EICONFR)); outb(ONB_EIENABLE, (brdp->iobase + ONB_EICONFR));
...@@ -3744,7 +3737,7 @@ static void stli_onbeenable(stlibrd_t *brdp) ...@@ -3744,7 +3737,7 @@ static void stli_onbeenable(stlibrd_t *brdp)
static void stli_onbedisable(stlibrd_t *brdp) static void stli_onbedisable(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbedisable(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_onbedisable(brdp=%x)\n", (int) brdp);
#endif #endif
outb(ONB_EIDISABLE, (brdp->iobase + ONB_EICONFR)); outb(ONB_EIDISABLE, (brdp->iobase + ONB_EICONFR));
...@@ -3757,7 +3750,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3757,7 +3750,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
void *ptr; void *ptr;
unsigned char val; unsigned char val;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_onbegetmemptr(brdp=%x,offset=%x,line=%d)\n", printk(KERN_DEBUG "stli_onbegetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line); (int) brdp, (int) offset, line);
#endif #endif
...@@ -3766,7 +3759,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3766,7 +3759,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % ONB_EIPAGESIZE); ptr = brdp->membase + (offset % ONB_EIPAGESIZE);
...@@ -3784,7 +3777,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3784,7 +3777,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
static void stli_onbereset(stlibrd_t *brdp) static void stli_onbereset(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_ERR "stli_onbereset(brdp=%x)\n", (int) brdp); printk(KERN_ERR "stli_onbereset(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3803,7 +3796,7 @@ static void stli_onbereset(stlibrd_t *brdp) ...@@ -3803,7 +3796,7 @@ static void stli_onbereset(stlibrd_t *brdp)
static void stli_bbyinit(stlibrd_t *brdp) static void stli_bbyinit(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_ERR "stli_bbyinit(brdp=%d)\n", (int) brdp); printk(KERN_ERR "stli_bbyinit(brdp=%d)\n", (int) brdp);
#endif #endif
...@@ -3822,7 +3815,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3822,7 +3815,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
void *ptr; void *ptr;
unsigned char val; unsigned char val;
#if DEBUG #ifdef DEBUG
printk(KERN_ERR "stli_bbygetmemptr(brdp=%x,offset=%x)\n", (int) brdp, printk(KERN_ERR "stli_bbygetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset); (int) offset);
#endif #endif
...@@ -3831,7 +3824,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3831,7 +3824,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
val = 0; val = 0;
} else { } else {
ptr = brdp->membase + (offset % BBY_PAGESIZE); ptr = brdp->membase + (offset % BBY_PAGESIZE);
...@@ -3846,7 +3839,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3846,7 +3839,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
static void stli_bbyreset(stlibrd_t *brdp) static void stli_bbyreset(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_bbyreset(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_bbyreset(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3865,7 +3858,7 @@ static void stli_bbyreset(stlibrd_t *brdp) ...@@ -3865,7 +3858,7 @@ static void stli_bbyreset(stlibrd_t *brdp)
static void stli_stalinit(stlibrd_t *brdp) static void stli_stalinit(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_stalinit(brdp=%d)\n", (int) brdp); printk(KERN_DEBUG "stli_stalinit(brdp=%d)\n", (int) brdp);
#endif #endif
...@@ -3879,7 +3872,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3879,7 +3872,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
{ {
void *ptr; void *ptr;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_stalgetmemptr(brdp=%x,offset=%x)\n", (int) brdp, printk(KERN_DEBUG "stli_stalgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset); (int) offset);
#endif #endif
...@@ -3888,7 +3881,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) ...@@ -3888,7 +3881,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
printk(KERN_ERR "STALLION: shared memory pointer=%x out of " printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n", "range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr); (int) offset, line, __LINE__, brdp->brdnr);
ptr = 0; ptr = NULL;
} else { } else {
ptr = brdp->membase + (offset % STAL_PAGESIZE); ptr = brdp->membase + (offset % STAL_PAGESIZE);
} }
...@@ -3901,7 +3894,7 @@ static void stli_stalreset(stlibrd_t *brdp) ...@@ -3901,7 +3894,7 @@ static void stli_stalreset(stlibrd_t *brdp)
{ {
volatile unsigned long *vecp; volatile unsigned long *vecp;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_stalreset(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_stalreset(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -3926,7 +3919,7 @@ static inline int stli_initecp(stlibrd_t *brdp) ...@@ -3926,7 +3919,7 @@ static inline int stli_initecp(stlibrd_t *brdp)
char *name; char *name;
int panelnr, nrports; int panelnr, nrports;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_initecp(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_initecp(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -4086,7 +4079,7 @@ static inline int stli_initonb(stlibrd_t *brdp) ...@@ -4086,7 +4079,7 @@ static inline int stli_initonb(stlibrd_t *brdp)
char *name; char *name;
int i; int i;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_initonb(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_initonb(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -4254,7 +4247,7 @@ static int stli_startbrd(stlibrd_t *brdp) ...@@ -4254,7 +4247,7 @@ static int stli_startbrd(stlibrd_t *brdp)
stliport_t *portp; stliport_t *portp;
int portnr, nrdevs, i, rc; int portnr, nrdevs, i, rc;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_startbrd(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_startbrd(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -4360,7 +4353,7 @@ static int stli_startbrd(stlibrd_t *brdp) ...@@ -4360,7 +4353,7 @@ static int stli_startbrd(stlibrd_t *brdp)
static int __init stli_brdinit(stlibrd_t *brdp) static int __init stli_brdinit(stlibrd_t *brdp)
{ {
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_brdinit(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_brdinit(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -4427,7 +4420,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp) ...@@ -4427,7 +4420,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
cdkonbsig_t onbsig, *onbsigp; cdkonbsig_t onbsig, *onbsigp;
int i, foundit; int i, foundit;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_eisamemprobe(brdp=%x)\n", (int) brdp); printk(KERN_DEBUG "stli_eisamemprobe(brdp=%x)\n", (int) brdp);
#endif #endif
...@@ -4504,7 +4497,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp) ...@@ -4504,7 +4497,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
if (! foundit) { if (! foundit) {
brdp->memaddr = 0; brdp->memaddr = 0;
brdp->membase = 0; brdp->membase = NULL;
printk(KERN_ERR "STALLION: failed to probe shared memory " printk(KERN_ERR "STALLION: failed to probe shared memory "
"region for %s in EISA slot=%d\n", "region for %s in EISA slot=%d\n",
stli_brdnames[brdp->brdtype], (brdp->iobase >> 12)); stli_brdnames[brdp->brdtype], (brdp->iobase >> 12));
...@@ -4513,6 +4506,20 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp) ...@@ -4513,6 +4506,20 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
return(0); return(0);
} }
static inline int stli_getbrdnr(void)
{
int i;
for (i = 0; i < STL_MAXBRDS; i++) {
if (!stli_brds[i]) {
if (i >= stli_nrbrds)
stli_nrbrds = i + 1;
return i;
}
}
return -1;
}
/*****************************************************************************/ /*****************************************************************************/
/* /*
...@@ -4525,13 +4532,13 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp) ...@@ -4525,13 +4532,13 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
* do is go probing around in the usual places hoping we can find it. * do is go probing around in the usual places hoping we can find it.
*/ */
static inline int stli_findeisabrds() static inline int stli_findeisabrds(void)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
unsigned int iobase, eid; unsigned int iobase, eid;
int i; int i;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_findeisabrds()\n"); printk(KERN_DEBUG "stli_findeisabrds()\n");
#endif #endif
...@@ -4599,20 +4606,6 @@ static inline int stli_findeisabrds() ...@@ -4599,20 +4606,6 @@ static inline int stli_findeisabrds()
* Find the next available board number that is free. * Find the next available board number that is free.
*/ */
static inline int stli_getbrdnr()
{
int i;
for (i = 0; (i < STL_MAXBRDS); i++) {
if (stli_brds[i] == (stlibrd_t *) NULL) {
if (i >= stli_nrbrds)
stli_nrbrds = i + 1;
return(i);
}
}
return(-1);
}
/*****************************************************************************/ /*****************************************************************************/
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -4627,7 +4620,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp) ...@@ -4627,7 +4620,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n", printk(KERN_DEBUG "stli_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n",
brdtype, dev->bus->number, dev->devfn); brdtype, dev->bus->number, dev->devfn);
#endif #endif
...@@ -4643,7 +4636,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp) ...@@ -4643,7 +4636,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
} }
brdp->brdtype = brdtype; brdp->brdtype = brdtype;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "%s(%d): BAR[]=%lx,%lx,%lx,%lx\n", __FILE__, __LINE__, printk(KERN_DEBUG "%s(%d): BAR[]=%lx,%lx,%lx,%lx\n", __FILE__, __LINE__,
pci_resource_start(devp, 0), pci_resource_start(devp, 0),
pci_resource_start(devp, 1), pci_resource_start(devp, 1),
...@@ -4669,12 +4662,12 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp) ...@@ -4669,12 +4662,12 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
* one as it is found. * one as it is found.
*/ */
static inline int stli_findpcibrds() static inline int stli_findpcibrds(void)
{ {
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
int rc; int rc;
#if DEBUG #ifdef DEBUG
printk("stli_findpcibrds()\n"); printk("stli_findpcibrds()\n");
#endif #endif
...@@ -4695,7 +4688,7 @@ static inline int stli_findpcibrds() ...@@ -4695,7 +4688,7 @@ static inline int stli_findpcibrds()
* Allocate a new board structure. Fill out the basic info in it. * Allocate a new board structure. Fill out the basic info in it.
*/ */
static stlibrd_t *stli_allocbrd() static stlibrd_t *stli_allocbrd(void)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
...@@ -4718,13 +4711,13 @@ static stlibrd_t *stli_allocbrd() ...@@ -4718,13 +4711,13 @@ static stlibrd_t *stli_allocbrd()
* can find. * can find.
*/ */
static inline int stli_initbrds() static inline int stli_initbrds(void)
{ {
stlibrd_t *brdp, *nxtbrdp; stlibrd_t *brdp, *nxtbrdp;
stlconf_t *confp; stlconf_t *confp;
int i, j; int i, j;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_initbrds()\n"); printk(KERN_DEBUG "stli_initbrds()\n");
#endif #endif
...@@ -4815,14 +4808,14 @@ static inline int stli_initbrds() ...@@ -4815,14 +4808,14 @@ static inline int stli_initbrds()
* the slave image (and debugging :-) * the slave image (and debugging :-)
*/ */
static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *offp) static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp)
{ {
unsigned long flags; unsigned long flags;
void *memptr; void *memptr;
stlibrd_t *brdp; stlibrd_t *brdp;
int brdnr, size, n; int brdnr, size, n;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_memread(fp=%x,buf=%x,count=%x,offp=%x)\n", printk(KERN_DEBUG "stli_memread(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp); (int) fp, (int) buf, count, (int) offp);
#endif #endif
...@@ -4869,15 +4862,15 @@ static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *of ...@@ -4869,15 +4862,15 @@ static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *of
* the slave image (and debugging :-) * the slave image (and debugging :-)
*/ */
static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, loff_t *offp) static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp)
{ {
unsigned long flags; unsigned long flags;
void *memptr; void *memptr;
stlibrd_t *brdp; stlibrd_t *brdp;
char *chbuf; char __user *chbuf;
int brdnr, size, n; int brdnr, size, n;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_memwrite(fp=%x,buf=%x,count=%x,offp=%x)\n", printk(KERN_DEBUG "stli_memwrite(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp); (int) fp, (int) buf, count, (int) offp);
#endif #endif
...@@ -4893,7 +4886,7 @@ static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, lof ...@@ -4893,7 +4886,7 @@ static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, lof
if (fp->f_pos >= brdp->memsize) if (fp->f_pos >= brdp->memsize)
return(0); return(0);
chbuf = (char *) buf; chbuf = (char __user *) buf;
size = MIN(count, (brdp->memsize - fp->f_pos)); size = MIN(count, (brdp->memsize - fp->f_pos));
save_flags(flags); save_flags(flags);
...@@ -4923,7 +4916,7 @@ static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, lof ...@@ -4923,7 +4916,7 @@ static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, lof
* Return the board stats structure to user app. * Return the board stats structure to user app.
*/ */
static int stli_getbrdstats(combrd_t *bp) static int stli_getbrdstats(combrd_t __user *bp)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
int i; int i;
...@@ -5062,26 +5055,26 @@ static int stli_portcmdstats(stliport_t *portp) ...@@ -5062,26 +5055,26 @@ static int stli_portcmdstats(stliport_t *portp)
* what port to get stats for (used through board control device). * what port to get stats for (used through board control device).
*/ */
static int stli_getportstats(stliport_t *portp, comstats_t *cp) static int stli_getportstats(stliport_t *portp, comstats_t __user *cp)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
int rc; int rc;
if (portp == (stliport_t *) NULL) { if (!portp) {
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t))) if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT; return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel, portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port); stli_comstats.port);
if (portp == (stliport_t *) NULL) if (!portp)
return(-ENODEV); return -ENODEV;
} }
brdp = stli_brds[portp->brdnr]; brdp = stli_brds[portp->brdnr];
if (brdp == (stlibrd_t *) NULL) if (!brdp)
return(-ENODEV); return -ENODEV;
if ((rc = stli_portcmdstats(portp)) < 0) if ((rc = stli_portcmdstats(portp)) < 0)
return(rc); return rc;
return copy_to_user(cp, &stli_comstats, sizeof(comstats_t)) ? return copy_to_user(cp, &stli_comstats, sizeof(comstats_t)) ?
-EFAULT : 0; -EFAULT : 0;
...@@ -5093,27 +5086,27 @@ static int stli_getportstats(stliport_t *portp, comstats_t *cp) ...@@ -5093,27 +5086,27 @@ static int stli_getportstats(stliport_t *portp, comstats_t *cp)
* Clear the port stats structure. We also return it zeroed out... * Clear the port stats structure. We also return it zeroed out...
*/ */
static int stli_clrportstats(stliport_t *portp, comstats_t *cp) static int stli_clrportstats(stliport_t *portp, comstats_t __user *cp)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
int rc; int rc;
if (portp == (stliport_t *) NULL) { if (!portp) {
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t))) if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT; return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel, portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port); stli_comstats.port);
if (portp == (stliport_t *) NULL) if (!portp)
return(-ENODEV); return -ENODEV;
} }
brdp = stli_brds[portp->brdnr]; brdp = stli_brds[portp->brdnr];
if (brdp == (stlibrd_t *) NULL) if (!brdp)
return(-ENODEV); return -ENODEV;
if (brdp->state & BST_STARTED) { if (brdp->state & BST_STARTED) {
if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0) if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, NULL, 0, 0)) < 0)
return(rc); return rc;
} }
memset(&stli_comstats, 0, sizeof(comstats_t)); memset(&stli_comstats, 0, sizeof(comstats_t));
...@@ -5123,7 +5116,7 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp) ...@@ -5123,7 +5116,7 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp)
if (copy_to_user(cp, &stli_comstats, sizeof(comstats_t))) if (copy_to_user(cp, &stli_comstats, sizeof(comstats_t)))
return -EFAULT; return -EFAULT;
return(0); return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -5132,19 +5125,19 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp) ...@@ -5132,19 +5125,19 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp)
* Return the entire driver ports structure to a user app. * Return the entire driver ports structure to a user app.
*/ */
static int stli_getportstruct(unsigned long arg) static int stli_getportstruct(stliport_t __user *arg)
{ {
stliport_t *portp; stliport_t *portp;
if (copy_from_user(&stli_dummyport, (void *)arg, sizeof(stliport_t))) if (copy_from_user(&stli_dummyport, arg, sizeof(stliport_t)))
return -EFAULT; return -EFAULT;
portp = stli_getport(stli_dummyport.brdnr, stli_dummyport.panelnr, portp = stli_getport(stli_dummyport.brdnr, stli_dummyport.panelnr,
stli_dummyport.portnr); stli_dummyport.portnr);
if (portp == (stliport_t *) NULL) if (!portp)
return(-ENODEV); return -ENODEV;
if (copy_to_user((void *) arg, portp, sizeof(stliport_t))) if (copy_to_user(arg, portp, sizeof(stliport_t)))
return -EFAULT; return -EFAULT;
return(0); return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -5153,20 +5146,20 @@ static int stli_getportstruct(unsigned long arg) ...@@ -5153,20 +5146,20 @@ static int stli_getportstruct(unsigned long arg)
* Return the entire driver board structure to a user app. * Return the entire driver board structure to a user app.
*/ */
static int stli_getbrdstruct(unsigned long arg) static int stli_getbrdstruct(stlibrd_t __user *arg)
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
if (copy_from_user(&stli_dummybrd, (void *)arg, sizeof(stlibrd_t))) if (copy_from_user(&stli_dummybrd, arg, sizeof(stlibrd_t)))
return -EFAULT; return -EFAULT;
if ((stli_dummybrd.brdnr < 0) || (stli_dummybrd.brdnr >= STL_MAXBRDS)) if ((stli_dummybrd.brdnr < 0) || (stli_dummybrd.brdnr >= STL_MAXBRDS))
return(-ENODEV); return -ENODEV;
brdp = stli_brds[stli_dummybrd.brdnr]; brdp = stli_brds[stli_dummybrd.brdnr];
if (brdp == (stlibrd_t *) NULL) if (!brdp)
return(-ENODEV); return -ENODEV;
if (copy_to_user((void *) arg, brdp, sizeof(stlibrd_t))) if (copy_to_user(arg, brdp, sizeof(stlibrd_t)))
return -EFAULT; return -EFAULT;
return(0); return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -5181,8 +5174,9 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un ...@@ -5181,8 +5174,9 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
{ {
stlibrd_t *brdp; stlibrd_t *brdp;
int brdnr, rc, done; int brdnr, rc, done;
void __user *argp = (void __user *)arg;
#if DEBUG #ifdef DEBUG
printk(KERN_DEBUG "stli_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n", printk(KERN_DEBUG "stli_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n",
(int) ip, (int) fp, cmd, (int) arg); (int) ip, (int) fp, cmd, (int) arg);
#endif #endif
...@@ -5195,23 +5189,23 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un ...@@ -5195,23 +5189,23 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
switch (cmd) { switch (cmd) {
case COM_GETPORTSTATS: case COM_GETPORTSTATS:
rc = stli_getportstats((stliport_t *)NULL, (comstats_t *)arg); rc = stli_getportstats(NULL, argp);
done++; done++;
break; break;
case COM_CLRPORTSTATS: case COM_CLRPORTSTATS:
rc = stli_clrportstats((stliport_t *)NULL, (comstats_t *)arg); rc = stli_clrportstats(NULL, argp);
done++; done++;
break; break;
case COM_GETBRDSTATS: case COM_GETBRDSTATS:
rc = stli_getbrdstats((combrd_t *) arg); rc = stli_getbrdstats(argp);
done++; done++;
break; break;
case COM_READPORT: case COM_READPORT:
rc = stli_getportstruct(arg); rc = stli_getportstruct(argp);
done++; done++;
break; break;
case COM_READBOARD: case COM_READBOARD:
rc = stli_getbrdstruct(arg); rc = stli_getbrdstruct(argp);
done++; done++;
break; break;
} }
...@@ -5227,7 +5221,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un ...@@ -5227,7 +5221,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
if (brdnr >= STL_MAXBRDS) if (brdnr >= STL_MAXBRDS)
return(-ENODEV); return(-ENODEV);
brdp = stli_brds[brdnr]; brdp = stli_brds[brdnr];
if (brdp == (stlibrd_t *) NULL) if (!brdp)
return(-ENODEV); return(-ENODEV);
if (brdp->state == 0) if (brdp->state == 0)
return(-ENODEV); return(-ENODEV);
......
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