diff options
author | Aleksey Gorelov <dared1st@yahoo.com> | 2008-06-19 18:22:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:16:37 -0400 |
commit | 71be4f81e97fe1f42c48a6dfc411dc6d3c18687f (patch) | |
tree | bc6d75dd6375644b3aeacf0a94fc88f009a72539 /drivers/usb/serial/usb_debug.c | |
parent | 830f4021a8d5ce97c6bed267132e5e90fb166192 (diff) |
USB: debug port converter does not accept more than 8 byte packets
USB debug port only supports 8 byte rx/tx packets. Although spec implies that
"if a packet larger than eight bytes is received from the remote computer, the
device must break the larger packet into eight-byte packets before sending the
data to the Debug Port", the real PLX NET20DC device does not handle it right -
data is corrupted on debug port end if serial interface sends >8 byte urbs.
Patch below fixes the issue by limiting tx urb to 8 byte.
Signed off by: Aleks Gorelov <dared1st@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb_debug.c')
-rw-r--r-- | drivers/usb/serial/usb_debug.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index f9fc926b56d8..9ca4d4db1ddd 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/usb.h> | 15 | #include <linux/usb.h> |
16 | #include <linux/usb/serial.h> | 16 | #include <linux/usb/serial.h> |
17 | 17 | ||
18 | #define USB_DEBUG_MAX_PACKET_SIZE 8 | ||
19 | |||
18 | static struct usb_device_id id_table [] = { | 20 | static struct usb_device_id id_table [] = { |
19 | { USB_DEVICE(0x0525, 0x127a) }, | 21 | { USB_DEVICE(0x0525, 0x127a) }, |
20 | { }, | 22 | { }, |
@@ -29,6 +31,12 @@ static struct usb_driver debug_driver = { | |||
29 | .no_dynamic_id = 1, | 31 | .no_dynamic_id = 1, |
30 | }; | 32 | }; |
31 | 33 | ||
34 | int usb_debug_open(struct usb_serial_port *port, struct file *filp) | ||
35 | { | ||
36 | port->bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE; | ||
37 | return usb_serial_generic_open(port, filp); | ||
38 | } | ||
39 | |||
32 | static struct usb_serial_driver debug_device = { | 40 | static struct usb_serial_driver debug_device = { |
33 | .driver = { | 41 | .driver = { |
34 | .owner = THIS_MODULE, | 42 | .owner = THIS_MODULE, |
@@ -36,6 +44,7 @@ static struct usb_serial_driver debug_device = { | |||
36 | }, | 44 | }, |
37 | .id_table = id_table, | 45 | .id_table = id_table, |
38 | .num_ports = 1, | 46 | .num_ports = 1, |
47 | .open = usb_debug_open, | ||
39 | }; | 48 | }; |
40 | 49 | ||
41 | static int __init debug_init(void) | 50 | static int __init debug_init(void) |