aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cp210x.c
diff options
context:
space:
mode:
authorLibor Pechacek <lpechacek@suse.cz>2011-01-14 08:30:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-22 21:53:26 -0500
commitd14fc1a74e846d7851f24fc9519fe87dc12a1231 (patch)
tree9d014b0200d4f2ba94c6d5ed1002c46027147fae /drivers/usb/serial/cp210x.c
parentca9cfea09fc5802074f79d086547c6363ddc894b (diff)
USB: serial: handle Data Carrier Detect changes
Alan's commit 335f8514f200e63d689113d29cb7253a5c282967 introduced .carrier_raised function in several drivers. That also means tty_port_block_til_ready can now suspend the process trying to open the serial port when Carrier Detect is low and put it into tty_port.open_wait queue. We need to wake up the process when Carrier Detect goes high and trigger TTY hangup when CD goes low. Some of the devices do not report modem status line changes, or at least we don't understand the status message, so for those we remove .carrier_raised again. Signed-off-by: Libor Pechacek <lpechacek@suse.cz> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/cp210x.c')
-rw-r--r--drivers/usb/serial/cp210x.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index c3bea46e87fb..735ea03157ab 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -49,7 +49,6 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *,
49static void cp210x_break_ctl(struct tty_struct *, int); 49static void cp210x_break_ctl(struct tty_struct *, int);
50static int cp210x_startup(struct usb_serial *); 50static int cp210x_startup(struct usb_serial *);
51static void cp210x_dtr_rts(struct usb_serial_port *p, int on); 51static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
52static int cp210x_carrier_raised(struct usb_serial_port *p);
53 52
54static int debug; 53static int debug;
55 54
@@ -166,8 +165,7 @@ static struct usb_serial_driver cp210x_device = {
166 .tiocmget = cp210x_tiocmget, 165 .tiocmget = cp210x_tiocmget,
167 .tiocmset = cp210x_tiocmset, 166 .tiocmset = cp210x_tiocmset,
168 .attach = cp210x_startup, 167 .attach = cp210x_startup,
169 .dtr_rts = cp210x_dtr_rts, 168 .dtr_rts = cp210x_dtr_rts
170 .carrier_raised = cp210x_carrier_raised
171}; 169};
172 170
173/* Config request types */ 171/* Config request types */
@@ -766,15 +764,6 @@ static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)
766 return result; 764 return result;
767} 765}
768 766
769static int cp210x_carrier_raised(struct usb_serial_port *p)
770{
771 unsigned int control;
772 cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1);
773 if (control & CONTROL_DCD)
774 return 1;
775 return 0;
776}
777
778static void cp210x_break_ctl (struct tty_struct *tty, int break_state) 767static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
779{ 768{
780 struct usb_serial_port *port = tty->driver_data; 769 struct usb_serial_port *port = tty->driver_data;