Lines Matching full:serial
8 * Supports the following Moxa USB to serial converters:
19 #include <linux/serial.h>
27 #include <linux/usb/serial.h>
105 /* Definitions for serial event type */
212 static int mxuport_recv_ctrl_urb(struct usb_serial *serial, in mxuport_recv_ctrl_urb() argument
218 status = usb_control_msg(serial->dev, in mxuport_recv_ctrl_urb()
219 usb_rcvctrlpipe(serial->dev, 0), in mxuport_recv_ctrl_urb()
226 dev_err(&serial->interface->dev, in mxuport_recv_ctrl_urb()
233 dev_err(&serial->interface->dev, in mxuport_recv_ctrl_urb()
243 static int mxuport_send_ctrl_data_urb(struct usb_serial *serial, in mxuport_send_ctrl_data_urb() argument
250 status = usb_control_msg(serial->dev, in mxuport_send_ctrl_data_urb()
251 usb_sndctrlpipe(serial->dev, 0), in mxuport_send_ctrl_data_urb()
258 dev_err(&serial->interface->dev, in mxuport_send_ctrl_data_urb()
268 static int mxuport_send_ctrl_urb(struct usb_serial *serial, in mxuport_send_ctrl_urb() argument
271 return mxuport_send_ctrl_data_urb(serial, request, value, index, in mxuport_send_ctrl_urb()
287 struct usb_serial *serial = port->serial; in mxuport_throttle() local
291 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_throttle()
306 struct usb_serial *serial = port->serial; in mxuport_unthrottle() local
310 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_unthrottle()
466 struct usb_serial *serial = port->serial; in mxuport_process_read_urb_demux_data() local
482 if (rcv_port >= serial->num_ports) { in mxuport_process_read_urb_demux_data()
488 demux_port = serial->port[rcv_port]; in mxuport_process_read_urb_demux_data()
513 struct usb_serial *serial = port->serial; in mxuport_process_read_urb_demux_event() local
529 if (rcv_port >= serial->num_ports) { in mxuport_process_read_urb_demux_event()
535 demux_port = serial->port[rcv_port]; in mxuport_process_read_urb_demux_event()
552 * contain serial data or events.
557 struct usb_serial *serial = port->serial; in mxuport_process_read_urb() local
559 if (port == serial->port[0]) in mxuport_process_read_urb()
562 if (port == serial->port[1]) in mxuport_process_read_urb()
572 struct usb_serial *serial = port->serial; in mxuport_tx_empty() local
582 err = mxuport_recv_ctrl_urb(serial, RQ_VENDOR_GET_OUTQUEUE, 0, in mxuport_tx_empty()
600 struct usb_serial *serial = port->serial; in mxuport_set_mcr() local
605 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_MCR, in mxuport_set_mcr()
616 struct usb_serial *serial = port->serial; in mxuport_set_dtr() local
621 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_DTR, in mxuport_set_dtr()
638 struct usb_serial *serial = port->serial; in mxuport_set_rts() local
666 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RTS, in mxuport_set_rts()
765 struct usb_serial *serial) in mxuport_set_termios_flow() argument
784 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_CHARS, in mxuport_set_termios_flow()
796 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_XONXOFF, in mxuport_set_termios_flow()
839 struct usb_serial *serial = port->serial; in mxuport_set_termios() local
903 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_LINE, in mxuport_set_termios()
908 err = mxuport_set_termios_flow(tty, old_termios, port, serial); in mxuport_set_termios()
919 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_SET_BAUD, in mxuport_set_termios()
938 static int mxuport_calc_num_ports(struct usb_serial *serial, in mxuport_calc_num_ports() argument
941 unsigned long features = (unsigned long)usb_get_serial_data(serial); in mxuport_calc_num_ports()
954 dev_warn(&serial->interface->dev, in mxuport_calc_num_ports()
974 static int mxuport_get_fw_version(struct usb_serial *serial, u32 *version) in mxuport_get_fw_version() argument
984 err = mxuport_recv_ctrl_urb(serial, RQ_VENDOR_GET_VERSION, 0, 0, in mxuport_get_fw_version()
999 static int mxuport_download_fw(struct usb_serial *serial, in mxuport_download_fw() argument
1011 dev_dbg(&serial->interface->dev, "Starting firmware download...\n"); in mxuport_download_fw()
1012 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_START_FW_DOWN, 0, 0); in mxuport_download_fw()
1021 err = mxuport_send_ctrl_data_urb(serial, RQ_VENDOR_FW_DATA, in mxuport_download_fw()
1024 mxuport_send_ctrl_urb(serial, RQ_VENDOR_STOP_FW_DOWN, in mxuport_download_fw()
1035 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_STOP_FW_DOWN, 0, 0); in mxuport_download_fw()
1040 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_QUERY_FW_READY, 0, 0); in mxuport_download_fw()
1047 static int mxuport_probe(struct usb_serial *serial, in mxuport_probe() argument
1050 u16 productid = le16_to_cpu(serial->dev->descriptor.idProduct); in mxuport_probe()
1058 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_QUERY_FW_CONFIG, 0, 0); in mxuport_probe()
1060 mxuport_send_ctrl_urb(serial, RQ_VENDOR_RESET_DEVICE, 0, 0); in mxuport_probe()
1064 err = mxuport_get_fw_version(serial, &version); in mxuport_probe()
1068 dev_dbg(&serial->interface->dev, "Device firmware version v%x.%x.%x\n", in mxuport_probe()
1075 err = request_firmware(&fw_p, buf, &serial->interface->dev); in mxuport_probe()
1077 dev_warn(&serial->interface->dev, "Firmware %s not found\n", in mxuport_probe()
1086 dev_dbg(&serial->interface->dev, in mxuport_probe()
1091 err = mxuport_download_fw(serial, fw_p); in mxuport_probe()
1094 err = mxuport_get_fw_version(serial, &version); in mxuport_probe()
1100 dev_info(&serial->interface->dev, in mxuport_probe()
1110 usb_set_serial_data(serial, (void *)id->driver_info); in mxuport_probe()
1120 struct usb_serial *serial = port->serial; in mxuport_port_probe() local
1136 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_FIFO_DISABLE, in mxuport_port_probe()
1142 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_HIGH_PERFOR, in mxuport_port_probe()
1148 return mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_INTERFACE, in mxuport_port_probe()
1153 static int mxuport_attach(struct usb_serial *serial) in mxuport_attach() argument
1155 struct usb_serial_port *port0 = serial->port[0]; in mxuport_attach()
1156 struct usb_serial_port *port1 = serial->port[1]; in mxuport_attach()
1179 static void mxuport_release(struct usb_serial *serial) in mxuport_release() argument
1181 struct usb_serial_port *port0 = serial->port[0]; in mxuport_release()
1182 struct usb_serial_port *port1 = serial->port[1]; in mxuport_release()
1191 struct usb_serial *serial = port->serial; in mxuport_open() local
1195 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_open()
1200 err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_OPEN, in mxuport_open()
1203 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, in mxuport_open()
1223 struct usb_serial *serial = port->serial; in mxuport_close() local
1225 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_OPEN, 0, in mxuport_close()
1228 mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN, 0, in mxuport_close()
1236 struct usb_serial *serial = port->serial; in mxuport_break_ctl() local
1247 return mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_BREAK, in mxuport_break_ctl()
1251 static int mxuport_resume(struct usb_serial *serial) in mxuport_resume() argument
1259 port = serial->port[i]; in mxuport_resume()
1266 for (i = 0; i < serial->num_ports; i++) { in mxuport_resume()
1267 port = serial->port[i]; in mxuport_resume()
1317 MODULE_DESCRIPTION("Moxa UPORT USB Serial driver");