int riotopen(struct tty_struct * tty, struct file * filp);
int riotclose(void *ptr);
int RIOCookMode(struct ttystatics *);
-int riotioctl(struct rio_info *, dev_t, register int, register caddr_t);
+int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t);
void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
/* riotable.c */
#endif
extern int rio_pcicopy(char *src, char *dst, int n);
-extern int rio_minor (kdev_t device);
-extern int rio_ismodem (kdev_t device);
+extern int rio_minor (struct tty_struct *tty);
+extern int rio_ismodem (struct tty_struct *tty);
extern void rio_udelay (int usecs);
extern void rio_start_card_running (struct Host * HostP);
/* This doesn't work. Who's paranoid around here? Not me! */
static inline int rio_paranoia_check(struct rio_port const * port,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
static const char *badmagic =
KERN_ERR "rio: Warning: null rio port for device %s in %s\n";
if (!port) {
- printk (badinfo, cdevname(device), routine);
+ printk (badinfo, name, routine);
return 1;
}
if (port->magic != RIO_MAGIC) {
- printk (badmagic, cdevname(device), routine);
+ printk (badmagic, name, routine);
return 1;
}
}
-int rio_minor (kdev_t device)
+int rio_minor(struct tty_struct *tty)
{
- return minor (device) +
- 256 * ((major (device) == RIO_NORMAL_MAJOR1) ||
- (major (device) == RIO_CALLOUT_MAJOR1));
+ return tty->index + (tty->driver->termios - rio_termios);
}
-int rio_ismodem (kdev_t device)
+int rio_ismodem(struct tty_struct *tty)
{
- return (major (device) == RIO_NORMAL_MAJOR0) ||
- (major (device) == RIO_NORMAL_MAJOR1);
+ return tty->driver == &rio_driver || tty->driver == &rio_driver2;
}
tty = ((struct Port *)ptr)->gs.tty;
- modem = (major(tty->device) == RIO_NORMAL_MAJOR0) || (major(tty->device) == RIO_NORMAL_MAJOR1);
+ modem = rio_ismodem(tty);
rv = RIOParam( (struct Port *) ptr, CONFIG, modem, 1);
rio_driver.hangup = gs_hangup;
rio_driver2 = rio_driver;
- rio_driver.major = RIO_NORMAL_MAJOR1;
+ rio_driver2.major = RIO_NORMAL_MAJOR1;
+ rio_driver2.termios += 256;
+ rio_driver2.termios_locked += 256;
rio_callout_driver = rio_driver;
rio_callout_driver.name = "cusr";
rio_callout_driver2 = rio_callout_driver;
rio_callout_driver2.major = RIO_CALLOUT_MAJOR1;
+ rio_callout_driver2.termios += 256;
+ rio_callout_driver2.termios_locked += 256;
rio_dprintk (RIO_DEBUG_INIT, "set_termios = %p\n", gs_set_termios);
*/
tty->driver_data = NULL;
- SysPort = rio_minor (tty->device);
- Modem = rio_ismodem (tty->device);
+ SysPort = rio_minor(tty);
+ Modem = rio_ismodem(tty);
if ( p->RIOFailed ) {
rio_dprintk (RIO_DEBUG_TTY, "System initialisation failed\n");
else
end_time = jiffies + MAX_SCHEDULE_TIMEOUT;
- Modem = rio_ismodem(tty->device);
+ Modem = rio_ismodem(tty);
#if 0
/* What F.CKING cache? Even then, a higly idle multiprocessor,
system with large caches this won't work . Better find out when
** its all about.
*/
int
-riotioctl(p, dev, cmd, arg)
-struct rio_info * p;
-dev_t dev;
-register int cmd;
-register caddr_t arg;
+riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg)
{
register struct Port *PortP;
register struct ttystatics *tp;
short vpix_cflag;
short divisor;
int baud;
- uint SysPort = dev;
- int Modem = rio_ismodem(dev);
+ uint SysPort = rio_minor(tty);
+ int Modem = rio_ismodem(tty);
int ioctl_processed;
rio_dprintk (RIO_DEBUG_TTY, "port ioctl SysPort %d command 0x%x argument 0x%x %s\n",