Lines Matching refs:port
91 static int ti_port_probe(struct usb_serial_port *port);
92 static int ti_port_remove(struct usb_serial_port *port);
93 static int ti_open(struct tty_struct *tty, struct usb_serial_port *port);
94 static void ti_close(struct usb_serial_port *port);
95 static int ti_write(struct tty_struct *tty, struct usb_serial_port *port,
99 static bool ti_tx_empty(struct usb_serial_port *port);
105 struct usb_serial_port *port, struct ktermios *old_termios);
114 static void ti_recv(struct usb_serial_port *port, unsigned char *data,
133 static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
358 static int ti_port_probe(struct usb_serial_port *port) in ti_port_probe() argument
367 if (port == port->serial->port[0]) in ti_port_probe()
371 port->port.closing_wait = msecs_to_jiffies(10 * closing_wait); in ti_port_probe()
372 tport->tp_port = port; in ti_port_probe()
373 tport->tp_tdev = usb_get_serial_data(port->serial); in ti_port_probe()
376 usb_set_serial_port_data(port, tport); in ti_port_probe()
378 port->port.drain_delay = 3; in ti_port_probe()
383 static int ti_port_remove(struct usb_serial_port *port) in ti_port_remove() argument
387 tport = usb_get_serial_port_data(port); in ti_port_remove()
393 static int ti_open(struct tty_struct *tty, struct usb_serial_port *port) in ti_open() argument
395 struct ti_port *tport = usb_get_serial_port_data(port); in ti_open()
408 dev = port->serial->dev; in ti_open()
415 port_number = port->port_number; in ti_open()
422 dev_dbg(&port->dev, "%s - start interrupt in urb\n", __func__); in ti_open()
423 urb = tdev->td_serial->port[0]->interrupt_in_urb; in ti_open()
425 dev_err(&port->dev, "%s - no interrupt urb\n", __func__); in ti_open()
432 dev_err(&port->dev, "%s - submit interrupt urb failed, %d\n", __func__, status); in ti_open()
438 ti_set_termios(tty, port, &tty->termios); in ti_open()
440 dev_dbg(&port->dev, "%s - sending TI_OPEN_PORT\n", __func__); in ti_open()
444 dev_err(&port->dev, "%s - cannot send open command, %d\n", in ti_open()
449 dev_dbg(&port->dev, "%s - sending TI_START_PORT\n", __func__); in ti_open()
453 dev_err(&port->dev, "%s - cannot send start command, %d\n", in ti_open()
458 dev_dbg(&port->dev, "%s - sending TI_PURGE_PORT\n", __func__); in ti_open()
462 dev_err(&port->dev, "%s - cannot clear input buffers, %d\n", in ti_open()
469 dev_err(&port->dev, "%s - cannot clear output buffers, %d\n", in ti_open()
476 usb_clear_halt(dev, port->write_urb->pipe); in ti_open()
477 usb_clear_halt(dev, port->read_urb->pipe); in ti_open()
480 ti_set_termios(tty, port, &tty->termios); in ti_open()
482 dev_dbg(&port->dev, "%s - sending TI_OPEN_PORT (2)\n", __func__); in ti_open()
486 dev_err(&port->dev, "%s - cannot send open command (2), %d\n", in ti_open()
491 dev_dbg(&port->dev, "%s - sending TI_START_PORT (2)\n", __func__); in ti_open()
495 dev_err(&port->dev, "%s - cannot send start command (2), %d\n", in ti_open()
501 dev_dbg(&port->dev, "%s - start read urb\n", __func__); in ti_open()
502 urb = port->read_urb; in ti_open()
504 dev_err(&port->dev, "%s - no read urb\n", __func__); in ti_open()
512 dev_err(&port->dev, "%s - submit read urb failed, %d\n", in ti_open()
524 usb_kill_urb(port->serial->port[0]->interrupt_in_urb); in ti_open()
527 dev_dbg(&port->dev, "%s - exit %d\n", __func__, status); in ti_open()
532 static void ti_close(struct usb_serial_port *port) in ti_close() argument
541 tdev = usb_get_serial_data(port->serial); in ti_close()
542 tport = usb_get_serial_port_data(port); in ti_close()
548 usb_kill_urb(port->read_urb); in ti_close()
549 usb_kill_urb(port->write_urb); in ti_close()
552 kfifo_reset_out(&port->write_fifo); in ti_close()
555 port_number = port->port_number; in ti_close()
557 dev_dbg(&port->dev, "%s - sending TI_CLOSE_PORT\n", __func__); in ti_close()
561 dev_err(&port->dev, in ti_close()
570 usb_kill_urb(port->serial->port[0]->interrupt_in_urb); in ti_close()
578 static int ti_write(struct tty_struct *tty, struct usb_serial_port *port, in ti_write() argument
581 struct ti_port *tport = usb_get_serial_port_data(port); in ti_write()
584 dev_dbg(&port->dev, "%s - write request of 0 bytes\n", __func__); in ti_write()
591 count = kfifo_in_locked(&port->write_fifo, data, count, in ti_write()
601 struct usb_serial_port *port = tty->driver_data; in ti_write_room() local
602 struct ti_port *tport = usb_get_serial_port_data(port); in ti_write_room()
610 room = kfifo_avail(&port->write_fifo); in ti_write_room()
613 dev_dbg(&port->dev, "%s - returns %d\n", __func__, room); in ti_write_room()
620 struct usb_serial_port *port = tty->driver_data; in ti_chars_in_buffer() local
621 struct ti_port *tport = usb_get_serial_port_data(port); in ti_chars_in_buffer()
629 chars = kfifo_len(&port->write_fifo); in ti_chars_in_buffer()
632 dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); in ti_chars_in_buffer()
636 static bool ti_tx_empty(struct usb_serial_port *port) in ti_tx_empty() argument
638 struct ti_port *tport = usb_get_serial_port_data(port); in ti_tx_empty()
651 struct usb_serial_port *port = tty->driver_data; in ti_throttle() local
652 struct ti_port *tport = usb_get_serial_port_data(port); in ti_throttle()
665 struct usb_serial_port *port = tty->driver_data; in ti_unthrottle() local
666 struct ti_port *tport = usb_get_serial_port_data(port); in ti_unthrottle()
675 dev_err(&port->dev, "%s - cannot restart read, %d\n", in ti_unthrottle()
683 struct usb_serial_port *port = tty->driver_data; in ti_ioctl() local
684 struct ti_port *tport = usb_get_serial_port_data(port); in ti_ioctl()
691 dev_dbg(&port->dev, "%s - TIOCGSERIAL\n", __func__); in ti_ioctl()
695 dev_dbg(&port->dev, "%s - TIOCSSERIAL\n", __func__); in ti_ioctl()
704 struct usb_serial_port *port, struct ktermios *old_termios) in ti_set_termios() argument
706 struct ti_port *tport = usb_get_serial_port_data(port); in ti_set_termios()
711 int port_number = port->port_number; in ti_set_termios()
717 dev_dbg(&port->dev, "%s - cflag %08x, iflag %08x\n", __func__, cflag, iflag); in ti_set_termios()
718 dev_dbg(&port->dev, "%s - old clfag %08x, old iflag %08x\n", __func__, in ti_set_termios()
806 dev_dbg(&port->dev, in ti_set_termios()
819 dev_err(&port->dev, "%s - cannot set config on port %d, %d\n", in ti_set_termios()
829 dev_err(&port->dev, in ti_set_termios()
839 struct usb_serial_port *port = tty->driver_data; in ti_tiocmget() local
840 struct ti_port *tport = usb_get_serial_port_data(port); in ti_tiocmget()
862 dev_dbg(&port->dev, "%s - 0x%04X\n", __func__, result); in ti_tiocmget()
871 struct usb_serial_port *port = tty->driver_data; in ti_tiocmset() local
872 struct ti_port *tport = usb_get_serial_port_data(port); in ti_tiocmset()
903 struct usb_serial_port *port = tty->driver_data; in ti_break() local
904 struct ti_port *tport = usb_get_serial_port_data(port); in ti_break()
907 dev_dbg(&port->dev, "%s - state = %d\n", __func__, break_state); in ti_break()
912 status = ti_write_byte(port, tport->tp_tdev, in ti_break()
917 dev_dbg(&port->dev, "%s - error setting break, %d\n", __func__, status); in ti_break()
924 struct usb_serial_port *port; in ti_interrupt_callback() local
973 port = serial->port[port_number]; in ti_interrupt_callback()
975 tport = usb_get_serial_port_data(port); in ti_interrupt_callback()
1008 struct usb_serial_port *port = tport->tp_port; in ti_bulk_in_callback() local
1044 ti_recv(port, urb->transfer_buffer, urb->actual_length); in ti_bulk_in_callback()
1046 port->icount.rx += urb->actual_length; in ti_bulk_in_callback()
1068 struct usb_serial_port *port = tport->tp_port; in ti_bulk_out_callback() local
1079 dev_dbg(&port->dev, "%s - urb shutting down, %d\n", __func__, status); in ti_bulk_out_callback()
1083 dev_err_console(port, "%s - nonzero urb status, %d\n", in ti_bulk_out_callback()
1093 static void ti_recv(struct usb_serial_port *port, unsigned char *data, in ti_recv() argument
1099 cnt = tty_insert_flip_string(&port->port, data, length); in ti_recv()
1101 dev_err(&port->dev, "%s - dropping data, %d bytes lost\n", in ti_recv()
1106 tty_flip_buffer_push(&port->port); in ti_recv()
1116 struct usb_serial_port *port = tport->tp_port; in ti_send() local
1124 count = kfifo_out(&port->write_fifo, in ti_send()
1125 port->write_urb->transfer_buffer, in ti_send()
1126 port->bulk_out_size); in ti_send()
1135 usb_serial_debug_data(&port->dev, __func__, count, in ti_send()
1136 port->write_urb->transfer_buffer); in ti_send()
1138 usb_fill_bulk_urb(port->write_urb, port->serial->dev, in ti_send()
1139 usb_sndbulkpipe(port->serial->dev, in ti_send()
1140 port->bulk_out_endpointAddress), in ti_send()
1141 port->write_urb->transfer_buffer, count, in ti_send()
1144 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); in ti_send()
1146 dev_err_console(port, "%s - submit write urb failed, %d\n", in ti_send()
1152 port->icount.tx += count; in ti_send()
1157 tty_port_tty_wakeup(&port->port); in ti_send()
1188 struct usb_serial_port *port = tport->tp_port; in ti_get_lsr() local
1189 int port_number = port->port_number; in ti_get_lsr()
1200 dev_err(&port->dev, in ti_get_lsr()
1206 dev_dbg(&port->dev, "%s - lsr 0x%02X\n", __func__, data->bLSR); in ti_get_lsr()
1219 struct usb_serial_port *port = tport->tp_port; in ti_get_serial_info() local
1226 cwait = port->port.closing_wait; in ti_get_serial_info()
1233 ret_serial.line = port->minor; in ti_get_serial_info()
1234 ret_serial.port = port->port_number; in ti_get_serial_info()
1236 ret_serial.xmit_fifo_size = kfifo_size(&port->write_fifo); in ti_get_serial_info()
1261 tport->tp_port->port.closing_wait = cwait; in ti_set_serial_info()
1286 wake_up_interruptible(&tport->tp_port->port.delta_msr_wait); in ti_handle_new_msr()
1293 tty = tty_port_tty_get(&tport->tp_port->port); in ti_handle_new_msr()
1378 static int ti_write_byte(struct usb_serial_port *port, in ti_write_byte() argument
1386 dev_dbg(&port->dev, "%s - addr 0x%08lX, mask 0x%02X, byte 0x%02X\n", __func__, in ti_write_byte()
1406 dev_err(&port->dev, "%s - failed, %d\n", __func__, status); in ti_write_byte()
1449 tdev->td_serial->port[0]->bulk_out_endpointAddress); in ti_download_firmware()