Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Linus Torvalds
faa7612c 4a561222

+12 -28
+1 -1
drivers/char/Kconfig
··· 288 288 289 289 config SPECIALIX 290 290 tristate "Specialix IO8+ card support" 291 - depends on SERIAL_NONSTANDARD && BROKEN 291 + depends on SERIAL_NONSTANDARD 292 292 help 293 293 This is a driver for the Specialix IO8+ multiport card (both the 294 294 ISA and the PCI version) which gives you many serial ports. You
+11 -27
drivers/char/specialix.c
··· 1818 1818 } 1819 1819 1820 1820 1821 - static void sx_send_break(struct specialix_port *port, 1822 - unsigned long length) 1821 + static int sx_send_break(struct tty_struct *tty, int length) 1823 1822 { 1823 + struct specialix_port *port = (struct specialix_port *)tty->driver_data; 1824 1824 struct specialix_board *bp = port_Board(port); 1825 1825 unsigned long flags; 1826 1826 1827 1827 func_enter(); 1828 + if (length == 0 || length == -1) 1829 + return -EOPNOTSUPP; 1828 1830 1829 1831 spin_lock_irqsave(&port->lock, flags); 1830 1832 port->break_length = SPECIALIX_TPS / HZ * length; ··· 1845 1843 sx_wait_CCR(bp); 1846 1844 1847 1845 func_exit(); 1846 + return 0; 1848 1847 } 1849 1848 1850 1849 ··· 1932 1929 unsigned int cmd, unsigned long arg) 1933 1930 { 1934 1931 struct specialix_port *port = (struct specialix_port *)tty->driver_data; 1935 - int retval; 1936 1932 void __user *argp = (void __user *)arg; 1937 1933 1938 1934 func_enter(); ··· 1942 1940 } 1943 1941 1944 1942 switch (cmd) { 1945 - case TCSBRK: /* SVID version: non-zero arg --> no break */ 1946 - retval = tty_check_change(tty); 1947 - if (retval) { 1948 - func_exit(); 1949 - return retval; 1950 - } 1951 - tty_wait_until_sent(tty, 0); 1952 - if (!arg) 1953 - sx_send_break(port, HZ/4); /* 1/4 second */ 1954 - return 0; 1955 - case TCSBRKP: /* support for POSIX tcsendbreak() */ 1956 - retval = tty_check_change(tty); 1957 - if (retval) { 1958 - func_exit(); 1959 - return retval; 1960 - } 1961 - tty_wait_until_sent(tty, 0); 1962 - sx_send_break(port, arg ? arg*(HZ/10) : HZ/4); 1963 - func_exit(); 1964 - return 0; 1965 1943 case TIOCGSERIAL: 1966 - func_exit(); 1944 + func_exit(); 1967 1945 return sx_get_serial_info(port, argp); 1968 1946 case TIOCSSERIAL: 1969 - func_exit(); 1947 + func_exit(); 1970 1948 return sx_set_serial_info(port, argp); 1971 1949 default: 1972 - func_exit(); 1950 + func_exit(); 1973 1951 return -ENOIOCTLCMD; 1974 1952 } 1975 1953 func_exit(); ··· 2172 2190 .hangup = sx_hangup, 2173 2191 .tiocmget = sx_tiocmget, 2174 2192 .tiocmset = sx_tiocmset, 2193 + .break_ctl = sx_send_break, 2175 2194 }; 2176 2195 2177 2196 static int sx_init_drivers(void) ··· 2199 2216 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2200 2217 specialix_driver->init_termios.c_ispeed = 9600; 2201 2218 specialix_driver->init_termios.c_ospeed = 9600; 2202 - specialix_driver->flags = TTY_DRIVER_REAL_RAW; 2219 + specialix_driver->flags = TTY_DRIVER_REAL_RAW | 2220 + TTY_DRIVER_HARDWARE_BREAK; 2203 2221 tty_set_operations(specialix_driver, &sx_ops); 2204 2222 2205 2223 error = tty_register_driver(specialix_driver);