specialix: restore driver using new break functionality
Use the hardware break support on the specialix driver Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4a56122297
commit
faa7612c09
2 changed files with 12 additions and 28 deletions
|
@ -288,7 +288,7 @@ config RISCOM8
|
||||||
|
|
||||||
config SPECIALIX
|
config SPECIALIX
|
||||||
tristate "Specialix IO8+ card support"
|
tristate "Specialix IO8+ card support"
|
||||||
depends on SERIAL_NONSTANDARD && BROKEN
|
depends on SERIAL_NONSTANDARD
|
||||||
help
|
help
|
||||||
This is a driver for the Specialix IO8+ multiport card (both the
|
This is a driver for the Specialix IO8+ multiport card (both the
|
||||||
ISA and the PCI version) which gives you many serial ports. You
|
ISA and the PCI version) which gives you many serial ports. You
|
||||||
|
|
|
@ -1818,13 +1818,15 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void sx_send_break(struct specialix_port *port,
|
static int sx_send_break(struct tty_struct *tty, int length)
|
||||||
unsigned long length)
|
|
||||||
{
|
{
|
||||||
|
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
|
||||||
struct specialix_board *bp = port_Board(port);
|
struct specialix_board *bp = port_Board(port);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
func_enter();
|
func_enter();
|
||||||
|
if (length == 0 || length == -1)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
spin_lock_irqsave(&port->lock, flags);
|
||||||
port->break_length = SPECIALIX_TPS / HZ * length;
|
port->break_length = SPECIALIX_TPS / HZ * length;
|
||||||
|
@ -1843,6 +1845,7 @@ static void sx_send_break(struct specialix_port *port,
|
||||||
sx_wait_CCR(bp);
|
sx_wait_CCR(bp);
|
||||||
|
|
||||||
func_exit();
|
func_exit();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1929,7 +1932,6 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
|
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
|
||||||
int retval;
|
|
||||||
void __user *argp = (void __user *)arg;
|
void __user *argp = (void __user *)arg;
|
||||||
|
|
||||||
func_enter();
|
func_enter();
|
||||||
|
@ -1940,34 +1942,14 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TCSBRK: /* SVID version: non-zero arg --> no break */
|
|
||||||
retval = tty_check_change(tty);
|
|
||||||
if (retval) {
|
|
||||||
func_exit();
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
tty_wait_until_sent(tty, 0);
|
|
||||||
if (!arg)
|
|
||||||
sx_send_break(port, HZ/4); /* 1/4 second */
|
|
||||||
return 0;
|
|
||||||
case TCSBRKP: /* support for POSIX tcsendbreak() */
|
|
||||||
retval = tty_check_change(tty);
|
|
||||||
if (retval) {
|
|
||||||
func_exit();
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
tty_wait_until_sent(tty, 0);
|
|
||||||
sx_send_break(port, arg ? arg*(HZ/10) : HZ/4);
|
|
||||||
func_exit();
|
|
||||||
return 0;
|
|
||||||
case TIOCGSERIAL:
|
case TIOCGSERIAL:
|
||||||
func_exit();
|
func_exit();
|
||||||
return sx_get_serial_info(port, argp);
|
return sx_get_serial_info(port, argp);
|
||||||
case TIOCSSERIAL:
|
case TIOCSSERIAL:
|
||||||
func_exit();
|
func_exit();
|
||||||
return sx_set_serial_info(port, argp);
|
return sx_set_serial_info(port, argp);
|
||||||
default:
|
default:
|
||||||
func_exit();
|
func_exit();
|
||||||
return -ENOIOCTLCMD;
|
return -ENOIOCTLCMD;
|
||||||
}
|
}
|
||||||
func_exit();
|
func_exit();
|
||||||
|
@ -2190,6 +2172,7 @@ static const struct tty_operations sx_ops = {
|
||||||
.hangup = sx_hangup,
|
.hangup = sx_hangup,
|
||||||
.tiocmget = sx_tiocmget,
|
.tiocmget = sx_tiocmget,
|
||||||
.tiocmset = sx_tiocmset,
|
.tiocmset = sx_tiocmset,
|
||||||
|
.break_ctl = sx_send_break,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int sx_init_drivers(void)
|
static int sx_init_drivers(void)
|
||||||
|
@ -2216,7 +2199,8 @@ static int sx_init_drivers(void)
|
||||||
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
|
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
|
||||||
specialix_driver->init_termios.c_ispeed = 9600;
|
specialix_driver->init_termios.c_ispeed = 9600;
|
||||||
specialix_driver->init_termios.c_ospeed = 9600;
|
specialix_driver->init_termios.c_ospeed = 9600;
|
||||||
specialix_driver->flags = TTY_DRIVER_REAL_RAW;
|
specialix_driver->flags = TTY_DRIVER_REAL_RAW |
|
||||||
|
TTY_DRIVER_HARDWARE_BREAK;
|
||||||
tty_set_operations(specialix_driver, &sx_ops);
|
tty_set_operations(specialix_driver, &sx_ops);
|
||||||
|
|
||||||
error = tty_register_driver(specialix_driver);
|
error = tty_register_driver(specialix_driver);
|
||||||
|
|
Loading…
Reference in a new issue