Lines Matching refs:port

4  *   Controls the Moschip 7720 usb to dual port serial converter
55 /* This structure holds all of the local serial port information */
61 struct usb_serial_port *port; /* loop back to the owner */
106 __u8 shadowECR; /* parallel port regs... */
119 MOS7720_THR, /* serial port regs */
131 MOS7720_DPR, /* parallel port regs */
136 MOS7720_SP2_REG, /* serial port 2 (7720 only) */
182 else if (reg >= MOS7720_DPR) /* parallel port reg (7715 only) */
185 else /* serial port reg */
192 * not specific to a particular serial port.
214 * ignored for registers that are not specific to a particular serial port.
284 * port callback had to be deferred because the disconnect mutex could not be
341 /* callback for parallel port control urbs submitted asynchronously */
437 * This is the the common top part of all parallel port callback operations that
439 * that avoids two scenarios: (1) a port operation is called after usbserial
442 * not called the release function yet because someone has a serial port open.
455 /* release fn called, port struct destroyed */
476 * This is the common bottom part of all parallel port functions that send
705 * Allocate and initialize parallel port control struct, initialize
706 * the parallel port hardware device, and register with the parport subsystem.
712 /* allocate and initialize parallel port control struct */
727 /* cycle parallel port reset bit */
792 * Byte 1 IIR Port 1 (port.number is 0)
793 * Byte 2 IIR Port 2 (port.number is 1)
879 * Byte 2: DSR parallel port
888 if (!(iir & 0x01)) { /* serial port interrupt pending */
904 struct usb_serial_port *port = urb->context;
905 struct mos7715_parport *mos_parport = port->serial->private;
927 struct usb_serial_port *port;
935 port = urb->context;
937 dev_dbg(&port->dev, "Entering...%s\n", __func__);
942 tty_insert_flip_string(&port->port, data, urb->actual_length);
943 tty_flip_buffer_push(&port->port);
946 if (port->read_urb->status != -EINPROGRESS) {
947 retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
949 dev_dbg(&port->dev, "usb_submit_urb(read bulk) failed, retval = %d\n", retval);
975 tty_port_tty_wakeup(&mos7720_port->port->port);
986 * parallel port, and the second for the serial port. We swap
988 * only registered port structure uses the serial-port
1000 static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port)
1011 serial = port->serial;
1013 mos7720_port = usb_get_serial_port_data(port);
1017 usb_clear_halt(serial->dev, port->write_urb->pipe);
1018 usb_clear_halt(serial->dev, port->read_urb->pipe);
1054 port_number = port->port_number;
1057 dev_dbg(&port->dev, "SS::%p LSR:%x\n", mos7720_port, data);
1075 data = data | (port->port_number + 1);
1087 response = usb_submit_urb(port->read_urb, GFP_KERNEL);
1089 dev_err(&port->dev, "%s - Error %d submitting read urb\n",
1092 /* initialize our port settings */
1095 /* send a open port command */
1104 * bytes of data we currently have outstanding in the port (data that has
1105 * been written, but hasn't made it out the port yet)
1112 struct usb_serial_port *port = tty->driver_data;
1117 mos7720_port = usb_get_serial_port_data(port);
1126 dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
1130 static void mos7720_close(struct usb_serial_port *port)
1136 serial = port->serial;
1138 mos7720_port = usb_get_serial_port_data(port);
1153 /* While closing port, shutdown all bulk read, write *
1155 usb_kill_urb(port->write_urb);
1156 usb_kill_urb(port->read_urb);
1158 write_mos_reg(serial, port->port_number, MOS7720_MCR, 0x00);
1159 write_mos_reg(serial, port->port_number, MOS7720_IER, 0x00);
1166 struct usb_serial_port *port = tty->driver_data;
1171 serial = port->serial;
1173 mos7720_port = usb_get_serial_port_data(port);
1183 write_mos_reg(serial, port->port_number, MOS7720_LCR,
1190 * bytes of data we can accept for a specific port.
1191 * If successful, we return the amount of room that we have for this port
1196 struct usb_serial_port *port = tty->driver_data;
1201 mos7720_port = usb_get_serial_port_data(port);
1212 dev_dbg(&port->dev, "%s - returns %d\n", __func__, room);
1216 static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
1229 serial = port->serial;
1231 mos7720_port = usb_get_serial_port_data(port);
1242 dev_dbg(&port->dev, "URB:%d\n", i);
1248 dev_dbg(&port->dev, "%s - no more free urbs\n", __func__);
1263 usb_serial_debug_data(&port->dev, __func__, transfer_size,
1269 port->bulk_out_endpointAddress),
1276 dev_err_console(port, "%s - usb_submit_urb(write bulk) failed "
1289 struct usb_serial_port *port = tty->driver_data;
1293 mos7720_port = usb_get_serial_port_data(port);
1299 dev_dbg(&port->dev, "%s - port not opened\n", __func__);
1306 status = mos7720_write(tty, port, &stop_char, 1);
1314 write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
1321 struct usb_serial_port *port = tty->driver_data;
1322 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
1329 dev_dbg(&port->dev, "%s - port not opened\n", __func__);
1336 status = mos7720_write(tty, port, &start_char, 1);
1344 write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
1353 struct usb_serial_port *port;
1360 port = mos7720_port->port;
1361 serial = port->serial;
1366 dev_dbg(&port->dev, "Sending Setting Commands ..........\n");
1367 port_number = port->port_number;
1439 static int calc_baud_rate_divisor(struct usb_serial_port *port, int baudrate, int *divisor)
1447 dev_dbg(&port->dev, "%s - %d\n", __func__, baudrate);
1469 dev_dbg(&port->dev, "Baud %d = %d\n", baudrate, custom);
1473 dev_dbg(&port->dev, "Baud calculation Failed...\n");
1480 * specified port.
1485 struct usb_serial_port *port;
1494 port = mos7720_port->port;
1495 serial = port->serial;
1497 number = port->port_number;
1498 dev_dbg(&port->dev, "%s - baud = %d\n", __func__, baudrate);
1501 status = calc_baud_rate_divisor(port, baudrate, &divisor);
1503 dev_err(&port->dev, "%s - bad baud rate\n", __func__);
1532 struct usb_serial_port *port;
1545 port = mos7720_port->port;
1546 serial = port->serial;
1547 port_number = port->port_number;
1550 dev_dbg(&port->dev, "%s - port not opened\n", __func__);
1583 dev_dbg(&port->dev, "%s - parity = odd\n", __func__);
1586 dev_dbg(&port->dev, "%s - parity = even\n", __func__);
1590 dev_dbg(&port->dev, "%s - parity = none\n", __func__);
1599 dev_dbg(&port->dev, "%s - stop bits = 2\n", __func__);
1602 dev_dbg(&port->dev, "%s - stop bits = 1\n", __func__);
1635 * serial port, in SP1/2_CONTROL_REG */
1653 dev_dbg(&port->dev, "Picked default baud...\n");
1664 dev_dbg(&port->dev, "%s - baud rate = %d\n", __func__, baud);
1673 if (port->read_urb->status != -EINPROGRESS) {
1674 status = usb_submit_urb(port->read_urb, GFP_KERNEL);
1676 dev_dbg(&port->dev, "usb_submit_urb(read bulk) failed, status = %d\n", status);
1686 struct usb_serial_port *port, struct ktermios *old_termios)
1691 mos7720_port = usb_get_serial_port_data(port);
1697 dev_dbg(&port->dev, "%s - port not opened\n", __func__);
1701 /* change the port settings to the new ones specified */
1704 if (port->read_urb->status != -EINPROGRESS) {
1705 status = usb_submit_urb(port->read_urb, GFP_KERNEL);
1707 dev_dbg(&port->dev, "usb_submit_urb(read bulk) failed, status = %d\n", status);
1724 struct usb_serial_port *port = tty->driver_data;
1727 int port_number = port->port_number;
1732 read_mos_reg(port->serial, port_number, MOS7720_LSR, &data);
1735 dev_dbg(&port->dev, "%s -- Empty\n", __func__);
1746 struct usb_serial_port *port = tty->driver_data;
1747 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
1768 struct usb_serial_port *port = tty->driver_data;
1769 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
1789 write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
1798 struct usb_serial_port *port = tty->driver_data;
1799 struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
1802 ss->line = mos7720_port->port->minor;
1803 ss->port = mos7720_port->port->port_number;
1815 struct usb_serial_port *port = tty->driver_data;
1818 mos7720_port = usb_get_serial_port_data(port);
1824 dev_dbg(&port->dev, "%s TIOCSERGETLSR\n", __func__);
1843 struct urb *urb = serial->port[0]->interrupt_in_urb;
1854 ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL);
1869 usb_kill_urb(serial->port[0]->interrupt_in_urb);
1872 /* close the parallel port */
1881 /* prevent NULL ptr dereference in port callbacks */
1912 static int mos7720_port_probe(struct usb_serial_port *port)
1920 mos7720_port->port = port;
1922 usb_set_serial_port_data(port, mos7720_port);
1927 static int mos7720_port_remove(struct usb_serial_port *port)
1931 mos7720_port = usb_get_serial_port_data(port);
1942 .description = "Moschip 2 port adapter",