mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 04:03:58 +08:00
USB: serial: add Moxa UPORT 12XX/14XX/16XX driver
Add a driver which supports the following Moxa USB to serial converters: * 2 ports : UPort 1250, UPort 1250I * 4 ports : UPort 1410, UPort 1450, UPort 1450I * 8 ports : UPort 1610-8, UPort 1650-8 * 16 ports : UPort 1610-16, UPort 1650-16 The UPORT devices don't directly fit the USB serial model. USB serial assumes a bulk in/out endpoint pair per serial port. Thus a dual port USB serial device is expected to have two bulk in/out pairs. The Moxa UPORT only has one pair for data transfer and places a header on each transfer over the endpoint indicating for which port the transfer relates to. There is a second endpoint pair for events, such as modem control lines changing state, setting baud rates etc. Again, a multiplexing header is used on these endpoints. Some ports need to have a kfifo explicitly allocated since the framework does not allocate one if there is no associated endpoints. The framework will however free it on unload of the module. All data transfers are made on port0, yet the locks are taken on PortN. urb->context points to PortN, even though the URB is for port0. Where possible, code from the generic driver is called. However mxuport_process_read_urb_data() is mostly a cut/paste of usb_serial_generic_process_read_urb(). The driver will attempt to load firmware from userspace and compare the available version and the running version. If the available version is newer, it will be download into RAM of the device and started. This is optional and the driver appears to work O.K. with older firmware in the devices ROM. This driver is based on the MOXA driver and retains MOXAs copyright. [jhovold@gmail.com: fix get_fw_version error path and some style issues] Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e58b57a354
commit
ee467a1f20
@ -472,6 +472,35 @@ config USB_SERIAL_MOS7840
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mos7840. If unsure, choose N.
|
||||
|
||||
config USB_SERIAL_MXUPORT
|
||||
tristate "USB Moxa UPORT Serial Driver"
|
||||
---help---
|
||||
Say Y here if you want to use a MOXA UPort Serial hub.
|
||||
|
||||
This driver supports:
|
||||
|
||||
[2 Port]
|
||||
- UPort 1250 : 2 Port RS-232/422/485 USB to Serial Hub
|
||||
- UPort 1250I : 2 Port RS-232/422/485 USB to Serial Hub with
|
||||
Isolation
|
||||
|
||||
[4 Port]
|
||||
- UPort 1410 : 4 Port RS-232 USB to Serial Hub
|
||||
- UPort 1450 : 4 Port RS-232/422/485 USB to Serial Hub
|
||||
- UPort 1450I : 4 Port RS-232/422/485 USB to Serial Hub with
|
||||
Isolation
|
||||
|
||||
[8 Port]
|
||||
- UPort 1610-8 : 8 Port RS-232 USB to Serial Hub
|
||||
- UPort 1650-8 : 8 Port RS-232/422/485 USB to Serial Hub
|
||||
|
||||
[16 Port]
|
||||
- UPort 1610-16 : 16 Port RS-232 USB to Serial Hub
|
||||
- UPort 1650-16 : 16 Port RS-232/422/485 USB to Serial Hub
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mxuport.
|
||||
|
||||
config USB_SERIAL_NAVMAN
|
||||
tristate "USB Navman GPS device"
|
||||
help
|
||||
|
@ -37,6 +37,7 @@ obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o
|
||||
obj-$(CONFIG_USB_SERIAL_METRO) += metro-usb.o
|
||||
obj-$(CONFIG_USB_SERIAL_MOS7720) += mos7720.o
|
||||
obj-$(CONFIG_USB_SERIAL_MOS7840) += mos7840.o
|
||||
obj-$(CONFIG_USB_SERIAL_MXUPORT) += mxuport.o
|
||||
obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o
|
||||
obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o
|
||||
obj-$(CONFIG_USB_SERIAL_OPTICON) += opticon.o
|
||||
|
1394
drivers/usb/serial/mxuport.c
Normal file
1394
drivers/usb/serial/mxuport.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user