ch341.c (f43dc23d5ea91fca257be02138a255f02d98e806) | ch341.c (d14fc1a74e846d7851f24fc9519fe87dc12a1231) |
---|---|
1/* 2 * Copyright 2007, Frank A Kingswood <frank@kingswood-consulting.co.uk> 3 * Copyright 2007, Werner Cornelius <werner@cornelius-consult.de> 4 * Copyright 2009, Boris Hajduk <boris@hajduk.org> 5 * 6 * ch341.c implements a serial port driver for the Winchiphead CH341. 7 * 8 * The CH341 device can be used to implement an RS232 asynchronous --- 472 unchanged lines hidden (view full) --- 481 } 482 483 usb_serial_debug_data(debug, &port->dev, __func__, 484 urb->actual_length, urb->transfer_buffer); 485 486 if (actual_length >= 4) { 487 struct ch341_private *priv = usb_get_serial_port_data(port); 488 unsigned long flags; | 1/* 2 * Copyright 2007, Frank A Kingswood <frank@kingswood-consulting.co.uk> 3 * Copyright 2007, Werner Cornelius <werner@cornelius-consult.de> 4 * Copyright 2009, Boris Hajduk <boris@hajduk.org> 5 * 6 * ch341.c implements a serial port driver for the Winchiphead CH341. 7 * 8 * The CH341 device can be used to implement an RS232 asynchronous --- 472 unchanged lines hidden (view full) --- 481 } 482 483 usb_serial_debug_data(debug, &port->dev, __func__, 484 urb->actual_length, urb->transfer_buffer); 485 486 if (actual_length >= 4) { 487 struct ch341_private *priv = usb_get_serial_port_data(port); 488 unsigned long flags; |
489 u8 prev_line_status = priv->line_status; |
|
489 490 spin_lock_irqsave(&priv->lock, flags); 491 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; 492 if ((data[1] & CH341_MULT_STAT)) 493 priv->multi_status_change = 1; 494 spin_unlock_irqrestore(&priv->lock, flags); | 490 491 spin_lock_irqsave(&priv->lock, flags); 492 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; 493 if ((data[1] & CH341_MULT_STAT)) 494 priv->multi_status_change = 1; 495 spin_unlock_irqrestore(&priv->lock, flags); |
496 497 if ((priv->line_status ^ prev_line_status) & CH341_BIT_DCD) { 498 struct tty_struct *tty = tty_port_tty_get(&port->port); 499 if (tty) 500 usb_serial_handle_dcd_change(port, tty, 501 priv->line_status & CH341_BIT_DCD); 502 tty_kref_put(tty); 503 } 504 |
|
495 wake_up_interruptible(&priv->delta_msr_wait); 496 } 497 498exit: 499 status = usb_submit_urb(urb, GFP_ATOMIC); 500 if (status) 501 dev_err(&urb->dev->dev, 502 "%s - usb_submit_urb failed with result %d\n", --- 168 unchanged lines hidden --- | 505 wake_up_interruptible(&priv->delta_msr_wait); 506 } 507 508exit: 509 status = usb_submit_urb(urb, GFP_ATOMIC); 510 if (status) 511 dev_err(&urb->dev->dev, 512 "%s - usb_submit_urb failed with result %d\n", --- 168 unchanged lines hidden --- |