-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 __user *buf, size_t count, loff_t *offp);
+static ssize_t stli_memread(struct file *fp, char *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 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_poll(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_poll(unsigned long arg);
static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
static long stli_mktiocm(unsigned long sigvalue);
static void stli_read(stlibrd_t *brdp, stliport_t *portp);
static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
static long stli_mktiocm(unsigned long sigvalue);
static void stli_read(stlibrd_t *brdp, stliport_t *portp);
-static int stli_getserial(stliport_t *portp, struct serial_struct __user *sp);
-static int stli_setserial(stliport_t *portp, struct serial_struct __user *sp);
-static int stli_getbrdstats(combrd_t __user *bp);
-static int stli_getportstats(stliport_t *portp, comstats_t __user *cp);
+static int stli_getserial(stliport_t *portp, struct serial_struct *sp);
+static int stli_setserial(stliport_t *portp, struct serial_struct *sp);
+static int stli_getbrdstats(combrd_t *bp);
+static int stli_getportstats(stliport_t *portp, comstats_t *cp);
-static int stli_clrportstats(stliport_t *portp, comstats_t __user *cp);
-static int stli_getportstruct(stliport_t __user *arg);
-static int stli_getbrdstruct(stlibrd_t __user *arg);
+static int stli_clrportstats(stliport_t *portp, comstats_t *cp);
+static int stli_getportstruct(unsigned long arg);
+static int stli_getbrdstruct(unsigned long arg);
printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
#endif
printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
#endif
printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
(int) filp, tty->name);
#endif
printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
(int) filp, tty->name);
#endif
printk("stli_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
#endif
printk("stli_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
#endif
printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp);
#endif
printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp);
#endif
printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait);
#endif
printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait);
#endif
printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait);
#endif
printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
(int) brdp, (int) portp, (int) arg, wait);
#endif
printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback);
printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback);
printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n",
(int) brdp, (int) portp, (int) filp);
#endif
printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n",
(int) brdp, (int) portp, (int) filp);
#endif
unsigned int len, stlen, head, tail, size;
unsigned long flags;
unsigned int len, stlen, head, tail, size;
unsigned long flags;
printk("stli_write(tty=%x,from_user=%d,buf=%x,count=%d)\n",
(int) tty, from_user, (int) buf, count);
#endif
printk("stli_write(tty=%x,from_user=%d,buf=%x,count=%d)\n",
(int) tty, from_user, (int) buf, count);
#endif
printk("stli_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
#endif
printk("stli_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
#endif
printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
#endif
printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
#endif
-#ifdef DEBUG
- printk("stli_setserial(portp=%p,sp=%p)\n", portp, sp);
+#if DEBUG
+ printk("stli_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
printk("stli_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
(int) tty, (int) file, cmd, (int) arg);
#endif
printk("stli_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
(int) tty, (int) file, cmd, (int) arg);
#endif
- rc = stli_getserial(portp, argp);
+ if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
+ sizeof(struct serial_struct))) == 0)
+ rc = stli_getserial(portp, (struct serial_struct *) arg);
- rc = stli_setserial(portp, argp);
+ if ((rc = verify_area(VERIFY_READ, (void *) arg,
+ sizeof(struct serial_struct))) == 0)
+ rc = stli_setserial(portp, (struct serial_struct *)arg);
- rc = stli_getportstats(portp, argp);
+ if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
+ sizeof(comstats_t))) == 0)
+ rc = stli_getportstats(portp, (comstats_t *) arg);
- rc = stli_clrportstats(portp, argp);
+ if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
+ sizeof(comstats_t))) == 0)
+ rc = stli_clrportstats(portp, (comstats_t *) arg);
printk("stli_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
#endif
printk("stli_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
#endif
printk(KERN_DEBUG "stli_breakctl(tty=%x,state=%d)\n", (int) tty, state);
#endif
printk(KERN_DEBUG "stli_breakctl(tty=%x,state=%d)\n", (int) tty, state);
#endif
printk(KERN_DEBUG "stli_waituntilsent(tty=%x,timeout=%x)\n", (int) tty, timeout);
#endif
printk(KERN_DEBUG "stli_waituntilsent(tty=%x,timeout=%x)\n", (int) tty, timeout);
#endif
printk(KERN_DEBUG "stli_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
#endif
printk(KERN_DEBUG "stli_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
#endif
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,
(int) eof, (int) data);
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,
(int) eof, (int) data);
printk(KERN_DEBUG "stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback);
printk(KERN_DEBUG "stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
(int) arg, size, copyback);
printk(KERN_DEBUG "stli_read(brdp=%x,portp=%d)\n",
(int) brdp, (int) portp);
#endif
printk(KERN_DEBUG "stli_read(brdp=%x,portp=%d)\n",
(int) brdp, (int) portp);
#endif
printk(KERN_DEBUG "stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n",
(int) portp, (int) pp, (int) tiosp);
#endif
printk(KERN_DEBUG "stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n",
(int) portp, (int) pp, (int) tiosp);
#endif
printk(KERN_DEBUG "stli_mkasysigs(sp=%x,dtr=%d,rts=%d)\n",
(int) sp, dtr, rts);
#endif
printk(KERN_DEBUG "stli_mkasysigs(sp=%x,dtr=%d,rts=%d)\n",
(int) sp, dtr, rts);
#endif
printk(KERN_DEBUG "stli_ecpenable(brdp=%x)\n", (int) brdp);
#endif
outb(ECP_ATENABLE, (brdp->iobase + ECP_ATCONFR));
printk(KERN_DEBUG "stli_ecpenable(brdp=%x)\n", (int) brdp);
#endif
outb(ECP_ATENABLE, (brdp->iobase + ECP_ATCONFR));
printk(KERN_DEBUG "stli_ecpdisable(brdp=%x)\n", (int) brdp);
#endif
outb(ECP_ATDISABLE, (brdp->iobase + ECP_ATCONFR));
printk(KERN_DEBUG "stli_ecpdisable(brdp=%x)\n", (int) brdp);
#endif
outb(ECP_ATDISABLE, (brdp->iobase + ECP_ATCONFR));
printk(KERN_DEBUG "stli_ecpgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_DEBUG "stli_ecpgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_DEBUG "stli_ecpeigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_DEBUG "stli_ecpeigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_DEBUG "stli_ecppcigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_DEBUG "stli_ecppcigetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), board=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), board=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_DEBUG "stli_onbenable(brdp=%x)\n", (int) brdp);
#endif
outb((brdp->enabval | ONB_ATENABLE), (brdp->iobase + ONB_ATCONFR));
printk(KERN_DEBUG "stli_onbenable(brdp=%x)\n", (int) brdp);
#endif
outb((brdp->enabval | ONB_ATENABLE), (brdp->iobase + ONB_ATCONFR));
printk(KERN_DEBUG "stli_onbdisable(brdp=%x)\n", (int) brdp);
#endif
outb((brdp->enabval | ONB_ATDISABLE), (brdp->iobase + ONB_ATCONFR));
printk(KERN_DEBUG "stli_onbdisable(brdp=%x)\n", (int) brdp);
#endif
outb((brdp->enabval | ONB_ATDISABLE), (brdp->iobase + ONB_ATCONFR));
printk(KERN_DEBUG "stli_onbgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_DEBUG "stli_onbgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_DEBUG "stli_onbeenable(brdp=%x)\n", (int) brdp);
#endif
outb(ONB_EIENABLE, (brdp->iobase + ONB_EICONFR));
printk(KERN_DEBUG "stli_onbeenable(brdp=%x)\n", (int) brdp);
#endif
outb(ONB_EIENABLE, (brdp->iobase + ONB_EICONFR));
printk(KERN_DEBUG "stli_onbedisable(brdp=%x)\n", (int) brdp);
#endif
outb(ONB_EIDISABLE, (brdp->iobase + ONB_EICONFR));
printk(KERN_DEBUG "stli_onbedisable(brdp=%x)\n", (int) brdp);
#endif
outb(ONB_EIDISABLE, (brdp->iobase + ONB_EICONFR));
printk(KERN_DEBUG "stli_onbegetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_DEBUG "stli_onbegetmemptr(brdp=%x,offset=%x,line=%d)\n",
(int) brdp, (int) offset, line);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "stli_bbygetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_ERR "stli_bbygetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_DEBUG "stli_stalgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_DEBUG "stli_stalgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
(int) offset);
#endif
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
"range at line=%d(%d), brd=%d\n",
(int) offset, line, __LINE__, brdp->brdnr);
stliport_t *portp;
int portnr, nrdevs, i, rc;
stliport_t *portp;
int portnr, nrdevs, i, rc;
printk(KERN_ERR "STALLION: failed to probe shared memory "
"region for %s in EISA slot=%d\n",
stli_brdnames[brdp->brdtype], (brdp->iobase >> 12));
printk(KERN_ERR "STALLION: failed to probe shared memory "
"region for %s in EISA slot=%d\n",
stli_brdnames[brdp->brdtype], (brdp->iobase >> 12));
printk(KERN_DEBUG "stli_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n",
brdtype, dev->bus->number, dev->devfn);
#endif
printk(KERN_DEBUG "stli_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n",
brdtype, dev->bus->number, dev->devfn);
#endif
printk(KERN_DEBUG "%s(%d): BAR[]=%lx,%lx,%lx,%lx\n", __FILE__, __LINE__,
pci_resource_start(devp, 0),
pci_resource_start(devp, 1),
printk(KERN_DEBUG "%s(%d): BAR[]=%lx,%lx,%lx,%lx\n", __FILE__, __LINE__,
pci_resource_start(devp, 0),
pci_resource_start(devp, 1),
-static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp)
+static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *offp)
printk(KERN_DEBUG "stli_memread(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp);
#endif
printk(KERN_DEBUG "stli_memread(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp);
#endif
-static ssize_t stli_memwrite(struct file *fp, const 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)
printk(KERN_DEBUG "stli_memwrite(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp);
#endif
printk(KERN_DEBUG "stli_memwrite(fp=%x,buf=%x,count=%x,offp=%x)\n",
(int) fp, (int) buf, count, (int) offp);
#endif
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
return -EFAULT;
portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
stli_comstats.port);
- if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, NULL, 0, 0)) < 0)
- return rc;
+ if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0)
+ return(rc);
- if (!portp)
- return -ENODEV;
- if (copy_to_user(arg, portp, sizeof(stliport_t)))
+ if (portp == (stliport_t *) NULL)
+ return(-ENODEV);
+ if (copy_to_user((void *) arg, portp, sizeof(stliport_t)))
- if (!brdp)
- return -ENODEV;
- if (copy_to_user(arg, brdp, sizeof(stlibrd_t)))
+ if (brdp == (stlibrd_t *) NULL)
+ return(-ENODEV);
+ if (copy_to_user((void *) arg, brdp, sizeof(stlibrd_t)))
printk(KERN_DEBUG "stli_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n",
(int) ip, (int) fp, cmd, (int) arg);
#endif
printk(KERN_DEBUG "stli_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n",
(int) ip, (int) fp, cmd, (int) arg);
#endif