USB: serial: add generic support for TIOCSSERIAL
authorJohan Hovold <johan@kernel.org>
Wed, 7 Apr 2021 10:39:21 +0000 (12:39 +0200)
committerJohan Hovold <johan@kernel.org>
Thu, 8 Apr 2021 07:46:02 +0000 (09:46 +0200)
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

The closing_wait parameter determines how long to wait for the transfer
buffers to drain during close and the default timeout of 30 seconds may
not be sufficient at low line speeds. In other cases, when for example
flow is stopped, the default timeout may instead be too long.

Add generic support for TIOCSSERIAL and TIOCGSERIAL with handling of the
three common parameters close_delay, closing_wait and line for the
benefit of all USB serial drivers while still allowing drivers to
implement further functionality through the existing callbacks.

This currently includes a few drivers that report their base baud clock
rate even if that is really only of interest when setting custom
divisors through the deprecated ASYNC_SPD_CUST interface; an interface
which only the FTDI driver actually implements.

Some drivers have also been reporting back a fake UART type, something
which should no longer be needed and will be dropped by a follow-on
patch.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
19 files changed:
drivers/usb/serial/ark3116.c
drivers/usb/serial/f81232.c
drivers/usb/serial/f81534.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/mos7840.c
drivers/usb/serial/opticon.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/quatech2.c
drivers/usb/serial/ssu100.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-wwan.h
drivers/usb/serial/usb_wwan.c
drivers/usb/serial/whiteheat.c
include/linux/usb/serial.h

index 957cdd694b1ff865f8372d6ee4703a6fa7d938d8..c0cf60e9273d4e53c1a28ab14f409cc3897d4614 100644 (file)
@@ -385,17 +385,10 @@ err_free:
        return result;
 }
 
-static int ark3116_get_serial_info(struct tty_struct *tty,
+static void ark3116_get_serial_info(struct tty_struct *tty,
                        struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static int ark3116_tiocmget(struct tty_struct *tty)
index af0fe2a82eb2f4e137518496c6ff16638953b913..5e34b364d94d058f19dc9636798d87f26d944876 100644 (file)
@@ -820,19 +820,13 @@ static int f81232_carrier_raised(struct usb_serial_port *port)
        return 0;
 }
 
-static int f81232_get_serial_info(struct tty_struct *tty,
-               struct serial_struct *ss)
+static void f81232_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct f81232_private *priv = usb_get_serial_port_data(port);
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = priv->baud_base;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void  f81232_interrupt_work(struct work_struct *work)
@@ -1023,7 +1017,7 @@ static struct usb_serial_driver f81232_device = {
        .close =                f81232_close,
        .dtr_rts =              f81232_dtr_rts,
        .carrier_raised =       f81232_carrier_raised,
-       .get_serial =           f81232_get_serial_info,
+       .get_serial =           f81232_get_serial,
        .break_ctl =            f81232_break_ctl,
        .set_termios =          f81232_set_termios,
        .tiocmget =             f81232_tiocmget,
@@ -1048,7 +1042,7 @@ static struct usb_serial_driver f81534a_device = {
        .close =                f81232_close,
        .dtr_rts =              f81232_dtr_rts,
        .carrier_raised =       f81232_carrier_raised,
-       .get_serial =           f81232_get_serial_info,
+       .get_serial =           f81232_get_serial,
        .break_ctl =            f81232_break_ctl,
        .set_termios =          f81232_set_termios,
        .tiocmget =             f81232_tiocmget,
index c9f90d437e3a44c3636cee5a4fb174435bbf5f20..633de52feaad6f9c2f88c5388092c1085dc55f0a 100644 (file)
@@ -1140,8 +1140,7 @@ static void f81534_close(struct usb_serial_port *port)
        mutex_unlock(&serial_priv->urb_mutex);
 }
 
-static int f81534_get_serial_info(struct tty_struct *tty,
-                                 struct serial_struct *ss)
+static void f81534_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct f81534_port_private *port_priv;
@@ -1149,12 +1148,7 @@ static int f81534_get_serial_info(struct tty_struct *tty,
        port_priv = usb_get_serial_port_data(port);
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = port_priv->baud_base;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void f81534_process_per_serial_block(struct usb_serial_port *port,
index f8a0911f90ea7cdf942b8e2316fce4518f8cef0b..16d3e50487e611c23838916842995866cb84f6d5 100644 (file)
@@ -1082,8 +1082,7 @@ static int  ftdi_tiocmset(struct tty_struct *tty,
                        unsigned int set, unsigned int clear);
 static int  ftdi_ioctl(struct tty_struct *tty,
                        unsigned int cmd, unsigned long arg);
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss);
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss);
 static int set_serial_info(struct tty_struct *tty,
                                struct serial_struct *ss);
 static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
@@ -1477,20 +1476,14 @@ static int read_latency_timer(struct usb_serial_port *port)
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct ftdi_private *priv = usb_get_serial_port_data(port);
 
-       ss->line = port->minor;
        ss->flags = priv->flags;
        ss->baud_base = priv->baud_base;
        ss->custom_divisor = priv->custom_divisor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static int set_serial_info(struct tty_struct *tty,
index 3b4809875a71134f8751fff0901c2ee91a2c2c7e..6b86e68ee2e8eed020af6b5ff1bd1a8126c5e870 100644 (file)
@@ -1594,17 +1594,9 @@ static int edge_tiocmget(struct tty_struct *tty)
        return result;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 
index f5aab570fd0574e1d50887ceb399b4b9284507c7..dce994c29afe06d4c61d866495a5e5e58f1cdaf8 100644 (file)
@@ -2433,22 +2433,9 @@ static int edge_tiocmget(struct tty_struct *tty)
        return result;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-       unsigned cwait;
-
-       cwait = port->port.closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = jiffies_to_msecs(cwait) / 10;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = cwait;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static void edge_break(struct tty_struct *tty, int break_state)
index 7289d46c3164ae5af5223955e710a06914f3cb67..4012b448388a88e2d2dc023d87c865251a728d5a 100644 (file)
@@ -1634,17 +1634,9 @@ static int mos7720_tiocmset(struct tty_struct *tty,
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static int mos7720_ioctl(struct tty_struct *tty,
index 77cbe18a16290cd5988d5f33960a8de1b4d5fc4e..d20fb0a678dc196443423713ca3b3d2ed6f742e8 100644 (file)
@@ -1388,17 +1388,9 @@ static int mos7840_get_lsr_info(struct tty_struct *tty,
  *      function to get information about serial port
  *****************************************************************************/
 
-static int mos7840_get_serial_info(struct tty_struct *tty,
-                                  struct serial_struct *ss)
+static void mos7840_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16550A;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 /*****************************************************************************
index 1c7e5dc2c272680616b2485d42692f41deef8d72..db84afcf7f1ab9c88210ad5d00659eba6d676f2a 100644 (file)
@@ -352,18 +352,10 @@ static int opticon_tiocmset(struct tty_struct *tty,
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        /* fake emulate a 16550 uart to make userspace code happy */
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static int opticon_port_probe(struct usb_serial_port *port)
index c6969ca72839083ebac780ee31dc5b6304bbde12..3e79a543d3e771d515bdd502c7df5035becbe617 100644 (file)
@@ -2095,8 +2095,6 @@ static struct usb_serial_driver option_1port_device = {
        .chars_in_buffer   = usb_wwan_chars_in_buffer,
        .tiocmget          = usb_wwan_tiocmget,
        .tiocmset          = usb_wwan_tiocmset,
-       .get_serial        = usb_wwan_get_serial_info,
-       .set_serial        = usb_wwan_set_serial_info,
        .attach            = option_attach,
        .release           = option_release,
        .port_probe        = usb_wwan_port_probe,
index 1bb870ca704481689986d43b88048f3ecf33f0a9..64f08a45eb4698b66a8de2c1d2347c9f1badcfc3 100644 (file)
@@ -1048,17 +1048,9 @@ static int pl2303_carrier_raised(struct usb_serial_port *port)
        return 0;
 }
 
-static int pl2303_get_serial(struct tty_struct *tty,
-                       struct serial_struct *ss)
+static void pl2303_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void pl2303_set_break(struct usb_serial_port *port, bool enable)
index 0d23e565e0d287d389bccec7e866913c17590840..5f2e7f668e687953305918df4bfcc8a99dc7572a 100644 (file)
@@ -453,18 +453,6 @@ static void qt2_disconnect(struct usb_serial *serial)
        usb_kill_urb(serial_priv->read_urb);
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
-}
-
 static void qt2_process_status(struct usb_serial_port *port, unsigned char *ch)
 {
        switch (*ch) {
@@ -975,7 +963,6 @@ static struct usb_serial_driver qt2_device = {
        .tiocmset            = qt2_tiocmset,
        .tiocmiwait          = usb_serial_generic_tiocmiwait,
        .get_icount          = usb_serial_generic_get_icount,
-       .get_serial          = get_serial_info,
        .set_termios         = qt2_set_termios,
 };
 
index c4616c37f33f73a96c0d14f3f5bec913d6b64276..3baf7c0f5a9810c094d378587b60b53a717e1835 100644 (file)
@@ -331,18 +331,6 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)
        return usb_serial_generic_open(tty, port);
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
-}
-
 static int ssu100_attach(struct usb_serial *serial)
 {
        return ssu100_initdevice(serial->dev);
@@ -542,7 +530,6 @@ static struct usb_serial_driver ssu100_device = {
        .tiocmset            = ssu100_tiocmset,
        .tiocmiwait          = usb_serial_generic_tiocmiwait,
        .get_icount          = usb_serial_generic_get_icount,
-       .get_serial          = get_serial_info,
        .set_termios         = ssu100_set_termios,
 };
 
index bb50098a0ce66e48e82846f8d7823c556fccd937..6df316bdb40f11d7d52a20c1ffe3bf47f6a3ca6f 100644 (file)
@@ -328,10 +328,7 @@ static void ti_recv(struct usb_serial_port *port, unsigned char *data,
 static void ti_send(struct ti_port *tport);
 static int ti_set_mcr(struct ti_port *tport, unsigned int mcr);
 static int ti_get_lsr(struct ti_port *tport, u8 *lsr);
-static int ti_get_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss);
-static int ti_set_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss);
+static void ti_get_serial_info(struct tty_struct *tty, struct serial_struct *ss);
 static void ti_handle_new_msr(struct ti_port *tport, u8 msr);
 
 static void ti_stop_read(struct ti_port *tport, struct tty_struct *tty);
@@ -435,7 +432,6 @@ static struct usb_serial_driver ti_1port_device = {
        .throttle               = ti_throttle,
        .unthrottle             = ti_unthrottle,
        .get_serial             = ti_get_serial_info,
-       .set_serial             = ti_set_serial_info,
        .set_termios            = ti_set_termios,
        .tiocmget               = ti_tiocmget,
        .tiocmset               = ti_tiocmset,
@@ -469,7 +465,6 @@ static struct usb_serial_driver ti_2port_device = {
        .throttle               = ti_throttle,
        .unthrottle             = ti_unthrottle,
        .get_serial             = ti_get_serial_info,
-       .set_serial             = ti_set_serial_info,
        .set_termios            = ti_set_termios,
        .tiocmget               = ti_tiocmget,
        .tiocmset               = ti_tiocmset,
@@ -1393,46 +1388,13 @@ free_data:
 }
 
 
-static int ti_get_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss)
+static void ti_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct ti_port *tport = usb_get_serial_port_data(port);
-       unsigned cwait;
-
-       cwait = port->port.closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = jiffies_to_msecs(cwait) / 10;
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = tport->tp_tdev->td_is_3410 ? 921600 : 460800;
-       ss->close_delay = 50;
-       ss->closing_wait = cwait;
-
-       return 0;
-}
-
-
-static int ti_set_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-       struct tty_port *tport = &port->port;
-       unsigned cwait;
-
-       cwait = ss->closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = msecs_to_jiffies(10 * ss->closing_wait);
-
-       if (!capable(CAP_SYS_ADMIN)) {
-               if (cwait != tport->closing_wait)
-                       return -EPERM;
-       }
-
-       tport->closing_wait = cwait;
-
-       return 0;
 }
 
 
index f53a830f4094e8a91acd44bf42a2804800a55c21..255f562ef1a00b9cfbfa85e1ed89eff0de6fd4e5 100644 (file)
@@ -437,19 +437,62 @@ static void serial_unthrottle(struct tty_struct *tty)
 static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
+       struct tty_port *tport = &port->port;
+       unsigned int close_delay, closing_wait;
+
+       mutex_lock(&tport->mutex);
+
+       close_delay = jiffies_to_msecs(tport->close_delay) / 10;
+       closing_wait = tport->closing_wait;
+       if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
+               closing_wait = jiffies_to_msecs(closing_wait) / 10;
+
+       ss->line = port->minor;
+       ss->close_delay = close_delay;
+       ss->closing_wait = closing_wait;
 
        if (port->serial->type->get_serial)
-               return port->serial->type->get_serial(tty, ss);
-       return -ENOTTY;
+               port->serial->type->get_serial(tty, ss);
+
+       mutex_unlock(&tport->mutex);
+
+       return 0;
 }
 
 static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
+       struct tty_port *tport = &port->port;
+       unsigned int close_delay, closing_wait;
+       int ret = 0;
+
+       close_delay = msecs_to_jiffies(ss->close_delay * 10);
+       closing_wait = ss->closing_wait;
+       if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
+               closing_wait = msecs_to_jiffies(closing_wait * 10);
+
+       mutex_lock(&tport->mutex);
+
+       if (!capable(CAP_SYS_ADMIN)) {
+               if (close_delay != tport->close_delay ||
+                               closing_wait != tport->closing_wait) {
+                       ret = -EPERM;
+                       goto out_unlock;
+               }
+       }
 
-       if (port->serial->type->set_serial)
-               return port->serial->type->set_serial(tty, ss);
-       return -ENOTTY;
+       if (port->serial->type->set_serial) {
+               ret = port->serial->type->set_serial(tty, ss);
+               if (ret)
+                       goto out_unlock;
+       }
+
+       tport->close_delay = close_delay;
+       tport->closing_wait = closing_wait;
+out_unlock:
+       mutex_unlock(&tport->mutex);
+
+       return ret;
 }
 
 static int serial_ioctl(struct tty_struct *tty,
index 79dafd98e0a1832c2375efa503489d1df7a4cc16..b5331d03092fa42b49acd15267ec7eb82c66f043 100644 (file)
@@ -15,10 +15,6 @@ extern int usb_wwan_write_room(struct tty_struct *tty);
 extern int usb_wwan_tiocmget(struct tty_struct *tty);
 extern int usb_wwan_tiocmset(struct tty_struct *tty,
                             unsigned int set, unsigned int clear);
-extern int usb_wwan_get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss);
-extern int usb_wwan_set_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss);
 extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
                          const unsigned char *buf, int count);
 extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
index 4ea315e5e69b24df1cad38483c160bcd588a804a..3eb72c59ede6766551704146983af7992dc7ed24 100644 (file)
@@ -132,48 +132,6 @@ int usb_wwan_tiocmset(struct tty_struct *tty,
 }
 EXPORT_SYMBOL(usb_wwan_tiocmset);
 
-int usb_wwan_get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line            = port->minor;
-       ss->close_delay     = jiffies_to_msecs(port->port.close_delay) / 10;
-       ss->closing_wait    = port->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-                                ASYNC_CLOSING_WAIT_NONE :
-                                jiffies_to_msecs(port->port.closing_wait) / 10;
-       return 0;
-}
-EXPORT_SYMBOL(usb_wwan_get_serial_info);
-
-int usb_wwan_set_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-       unsigned int closing_wait, close_delay;
-       int retval = 0;
-
-       close_delay = msecs_to_jiffies(ss->close_delay * 10);
-       closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-                       ASYNC_CLOSING_WAIT_NONE :
-                       msecs_to_jiffies(ss->closing_wait * 10);
-
-       mutex_lock(&port->port.mutex);
-
-       if (!capable(CAP_SYS_ADMIN)) {
-               if ((close_delay != port->port.close_delay) ||
-                   (closing_wait != port->port.closing_wait))
-                       retval = -EPERM;
-       } else {
-               port->port.close_delay  = close_delay;
-               port->port.closing_wait = closing_wait;
-       }
-
-       mutex_unlock(&port->port.mutex);
-       return retval;
-}
-EXPORT_SYMBOL(usb_wwan_set_serial_info);
-
 int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
                   const unsigned char *buf, int count)
 {
index c8b10faa2ff889b65c0be060b8d666530166bdf4..6a95c5a0056f0dc9a0a36dbe711bfd9618b65993 100644 (file)
@@ -83,7 +83,7 @@ static void whiteheat_port_remove(struct usb_serial_port *port);
 static int  whiteheat_open(struct tty_struct *tty,
                        struct usb_serial_port *port);
 static void whiteheat_close(struct usb_serial_port *port);
-static int  whiteheat_get_serial(struct tty_struct *tty,
+static void whiteheat_get_serial(struct tty_struct *tty,
                        struct serial_struct *ss);
 static void whiteheat_set_termios(struct tty_struct *tty,
                        struct usb_serial_port *port, struct ktermios *old);
@@ -439,18 +439,10 @@ static int whiteheat_tiocmset(struct tty_struct *tty,
 }
 
 
-static int whiteheat_get_serial(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void whiteheat_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
        ss->baud_base = 460800;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 
index e9b90577f50b45fc56f6b144aa372cdecf1ac31c..8c63fa9bfc746478e0174ca0b24f76695e07354f 100644 (file)
@@ -279,7 +279,7 @@ struct usb_serial_driver {
        int  (*write_room)(struct tty_struct *tty);
        int  (*ioctl)(struct tty_struct *tty,
                      unsigned int cmd, unsigned long arg);
-       int  (*get_serial)(struct tty_struct *tty, struct serial_struct *ss);
+       void (*get_serial)(struct tty_struct *tty, struct serial_struct *ss);
        int  (*set_serial)(struct tty_struct *tty, struct serial_struct *ss);
        void (*set_termios)(struct tty_struct *tty,
                        struct usb_serial_port *port, struct ktermios *old);