Lines Matching refs:serial
216 static int mxuport_recv_ctrl_urb(struct usb_serial *serial, in mxuport_recv_ctrl_urb() argument
222 status = usb_control_msg(serial->dev, in mxuport_recv_ctrl_urb()
223 usb_rcvctrlpipe(serial->dev, 0), in mxuport_recv_ctrl_urb()
230 dev_err(&serial->interface->dev, in mxuport_recv_ctrl_urb()
237 dev_err(&serial->interface->dev, in mxuport_recv_ctrl_urb()
247 static int mxuport_send_ctrl_data_urb(struct usb_serial *serial, in mxuport_send_ctrl_data_urb() argument
254 status = usb_control_msg(serial->dev, in mxuport_send_ctrl_data_urb()
255 usb_sndctrlpipe(serial->dev, 0), in mxuport_send_ctrl_data_urb()
262 dev_err(&serial->interface->dev, in mxuport_send_ctrl_data_urb()
269 dev_err(&serial->interface->dev, in mxuport_send_ctrl_data_urb()
279 static int mxuport_send_ctrl_urb(struct usb_serial *serial, in mxuport_send_ctrl_urb() argument
282 return mxuport_send_ctrl_data_urb(serial, request, value, index, in mxuport_send_ctrl_urb()
298 struct usb_serial *serial = port->serial; in mxuport_throttle() local
302 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_throttle()
317 struct usb_serial *serial = port->serial; in mxuport_unthrottle() local
321 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_unthrottle()
477 struct usb_serial *serial = port->serial; in mxuport_process_read_urb_demux_data() local
493 if (rcv_port >= serial->num_ports) { in mxuport_process_read_urb_demux_data()
499 demux_port = serial->port[rcv_port]; in mxuport_process_read_urb_demux_data()
524 struct usb_serial *serial = port->serial; in mxuport_process_read_urb_demux_event() local
540 if (rcv_port >= serial->num_ports) { in mxuport_process_read_urb_demux_event()
546 demux_port = serial->port[rcv_port]; in mxuport_process_read_urb_demux_event()
568 struct usb_serial *serial = port->serial; in mxuport_process_read_urb() local
570 if (port == serial->port[0]) in mxuport_process_read_urb()
573 if (port == serial->port[1]) in mxuport_process_read_urb()
583 struct usb_serial *serial = port->serial; in mxuport_tx_empty() local
593 err = mxuport_recv_ctrl_urb(serial, RQ_VENDOR_GET_OUTQUEUE, 0, in mxuport_tx_empty()
611 struct usb_serial *serial = port->serial; in mxuport_set_mcr() local
616 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_MCR, in mxuport_set_mcr()
627 struct usb_serial *serial = port->serial; in mxuport_set_dtr() local
632 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_DTR, in mxuport_set_dtr()
649 struct usb_serial *serial = port->serial; in mxuport_set_rts() local
677 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RTS, in mxuport_set_rts()
776 struct usb_serial *serial) in mxuport_set_termios_flow() argument
795 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_CHARS, in mxuport_set_termios_flow()
807 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_XONXOFF, in mxuport_set_termios_flow()
850 struct usb_serial *serial = port->serial; in mxuport_set_termios() local
914 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_LINE, in mxuport_set_termios()
919 err = mxuport_set_termios_flow(tty, old_termios, port, serial); in mxuport_set_termios()
930 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_BAUD, in mxuport_set_termios()
949 static int mxuport_calc_num_ports(struct usb_serial *serial) in mxuport_calc_num_ports() argument
951 unsigned long features = (unsigned long)usb_get_serial_data(serial); in mxuport_calc_num_ports()
966 static int mxuport_get_fw_version(struct usb_serial *serial, u32 *version) in mxuport_get_fw_version() argument
976 err = mxuport_recv_ctrl_urb(serial, RQ_VENDOR_GET_VERSION, 0, 0, in mxuport_get_fw_version()
991 static int mxuport_download_fw(struct usb_serial *serial, in mxuport_download_fw() argument
1003 dev_dbg(&serial->interface->dev, "Starting firmware download...\n"); in mxuport_download_fw()
1004 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_START_FW_DOWN, 0, 0); in mxuport_download_fw()
1013 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_FW_DATA, in mxuport_download_fw()
1016 mxuport_send_ctrl_urb(serial, RQ_VENDOR_STOP_FW_DOWN, in mxuport_download_fw()
1027 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_STOP_FW_DOWN, 0, 0); in mxuport_download_fw()
1032 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_QUERY_FW_READY, 0, 0); in mxuport_download_fw()
1039 static int mxuport_probe(struct usb_serial *serial, in mxuport_probe() argument
1042 u16 productid = le16_to_cpu(serial->dev->descriptor.idProduct); in mxuport_probe()
1050 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_QUERY_FW_CONFIG, 0, 0); in mxuport_probe()
1052 mxuport_send_ctrl_urb(serial, RQ_VENDOR_RESET_DEVICE, 0, 0); in mxuport_probe()
1056 err = mxuport_get_fw_version(serial, &version); in mxuport_probe()
1060 dev_dbg(&serial->interface->dev, "Device firmware version v%x.%x.%x\n", in mxuport_probe()
1067 err = request_firmware(&fw_p, buf, &serial->interface->dev); in mxuport_probe()
1069 dev_warn(&serial->interface->dev, "Firmware %s not found\n", in mxuport_probe()
1078 dev_dbg(&serial->interface->dev, in mxuport_probe()
1083 err = mxuport_download_fw(serial, fw_p); in mxuport_probe()
1086 err = mxuport_get_fw_version(serial, &version); in mxuport_probe()
1092 dev_info(&serial->interface->dev, in mxuport_probe()
1102 usb_set_serial_data(serial, (void *)id->driver_info); in mxuport_probe()
1112 struct usb_serial *serial = port->serial; in mxuport_port_probe() local
1128 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_FIFO_DISABLE, in mxuport_port_probe()
1134 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_HIGH_PERFOR, in mxuport_port_probe()
1140 return mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_INTERFACE, in mxuport_port_probe()
1145 static int mxuport_alloc_write_urb(struct usb_serial *serial, in mxuport_alloc_write_urb() argument
1150 struct usb_device *dev = interface_to_usbdev(serial->interface); in mxuport_alloc_write_urb()
1165 serial->type->write_bulk_callback, in mxuport_alloc_write_urb()
1171 static int mxuport_alloc_write_urbs(struct usb_serial *serial, in mxuport_alloc_write_urbs() argument
1179 ret = mxuport_alloc_write_urb(serial, port, port0, j); in mxuport_alloc_write_urbs()
1187 static int mxuport_attach(struct usb_serial *serial) in mxuport_attach() argument
1189 struct usb_serial_port *port0 = serial->port[0]; in mxuport_attach()
1190 struct usb_serial_port *port1 = serial->port[1]; in mxuport_attach()
1200 for (i = 1; i < serial->num_bulk_out; ++i) { in mxuport_attach()
1201 port = serial->port[i]; in mxuport_attach()
1216 for (i = 1; i < serial->num_ports; ++i) { in mxuport_attach()
1217 port = serial->port[i]; in mxuport_attach()
1222 err = mxuport_alloc_write_urbs(serial, port, port0); in mxuport_attach()
1262 static void mxuport_release(struct usb_serial *serial) in mxuport_release() argument
1264 struct usb_serial_port *port0 = serial->port[0]; in mxuport_release()
1265 struct usb_serial_port *port1 = serial->port[1]; in mxuport_release()
1274 struct usb_serial *serial = port->serial; in mxuport_open() local
1278 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_open()
1283 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_OPEN, in mxuport_open()
1286 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_open()
1306 struct usb_serial *serial = port->serial; in mxuport_close() local
1308 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_OPEN, 0, in mxuport_close()
1311 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, 0, in mxuport_close()
1319 struct usb_serial *serial = port->serial; in mxuport_break_ctl() local
1330 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_BREAK, in mxuport_break_ctl()
1334 static int mxuport_resume(struct usb_serial *serial) in mxuport_resume() argument
1342 port = serial->port[i]; in mxuport_resume()
1349 for (i = 0; i < serial->num_ports; i++) { in mxuport_resume()
1350 port = serial->port[i]; in mxuport_resume()