aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/spcp8x5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/spcp8x5.c')
-rw-r--r--drivers/usb/serial/spcp8x5.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index e24d23b524b1..f34930cda68d 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -456,57 +456,6 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port)
456 return usb_serial_generic_open(tty, port); 456 return usb_serial_generic_open(tty, port);
457} 457}
458 458
459static void spcp8x5_process_read_urb(struct urb *urb)
460{
461 struct usb_serial_port *port = urb->context;
462 struct spcp8x5_private *priv = usb_get_serial_port_data(port);
463 unsigned char *data = urb->transfer_buffer;
464 unsigned long flags;
465 u8 status;
466 char tty_flag;
467
468 /* get tty_flag from status */
469 tty_flag = TTY_NORMAL;
470
471 spin_lock_irqsave(&priv->lock, flags);
472 status = priv->line_status;
473 priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
474 spin_unlock_irqrestore(&priv->lock, flags);
475
476 if (!urb->actual_length)
477 return;
478
479
480 if (status & UART_STATE_TRANSIENT_MASK) {
481 /* break takes precedence over parity, which takes precedence
482 * over framing errors */
483 if (status & UART_BREAK_ERROR)
484 tty_flag = TTY_BREAK;
485 else if (status & UART_PARITY_ERROR)
486 tty_flag = TTY_PARITY;
487 else if (status & UART_FRAME_ERROR)
488 tty_flag = TTY_FRAME;
489 dev_dbg(&port->dev, "tty_flag = %d\n", tty_flag);
490
491 /* overrun is special, not associated with a char */
492 if (status & UART_OVERRUN_ERROR)
493 tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
494
495 if (status & UART_DCD) {
496 struct tty_struct *tty = tty_port_tty_get(&port->port);
497 if (tty) {
498 usb_serial_handle_dcd_change(port, tty,
499 priv->line_status & MSR_STATUS_LINE_DCD);
500 tty_kref_put(tty);
501 }
502 }
503 }
504
505 tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
506 urb->actual_length);
507 tty_flip_buffer_push(&port->port);
508}
509
510static int spcp8x5_tiocmset(struct tty_struct *tty, 459static int spcp8x5_tiocmset(struct tty_struct *tty,
511 unsigned int set, unsigned int clear) 460 unsigned int set, unsigned int clear)
512{ 461{
@@ -571,7 +520,6 @@ static struct usb_serial_driver spcp8x5_device = {
571 .tiocmset = spcp8x5_tiocmset, 520 .tiocmset = spcp8x5_tiocmset,
572 .port_probe = spcp8x5_port_probe, 521 .port_probe = spcp8x5_port_probe,
573 .port_remove = spcp8x5_port_remove, 522 .port_remove = spcp8x5_port_remove,
574 .process_read_urb = spcp8x5_process_read_urb,
575}; 523};
576 524
577static struct usb_serial_driver * const serial_drivers[] = { 525static struct usb_serial_driver * const serial_drivers[] = {