summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAleksey Gorelov <dared1st@yahoo.com>2008-06-19 15:22:17 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 15:16:37 -0700
commit71be4f81e97fe1f42c48a6dfc411dc6d3c18687f (patch)
treebc6d75dd6375644b3aeacf0a94fc88f009a72539 /drivers/usb
parent830f4021a8d5ce97c6bed267132e5e90fb166192 (diff)
downloadop-kernel-dev-71be4f81e97fe1f42c48a6dfc411dc6d3c18687f.zip
op-kernel-dev-71be4f81e97fe1f42c48a6dfc411dc6d3c18687f.tar.gz
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')
-rw-r--r--drivers/usb/serial/usb_debug.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
index f9fc926..9ca4d4d 100644
--- a/drivers/usb/serial/usb_debug.c
+++ b/drivers/usb/serial/usb_debug.c
@@ -15,6 +15,8 @@
#include <linux/usb.h>
#include <linux/usb/serial.h>
+#define USB_DEBUG_MAX_PACKET_SIZE 8
+
static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x0525, 0x127a) },
{ },
@@ -29,6 +31,12 @@ static struct usb_driver debug_driver = {
.no_dynamic_id = 1,
};
+int usb_debug_open(struct usb_serial_port *port, struct file *filp)
+{
+ port->bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE;
+ return usb_serial_generic_open(port, filp);
+}
+
static struct usb_serial_driver debug_device = {
.driver = {
.owner = THIS_MODULE,
@@ -36,6 +44,7 @@ static struct usb_serial_driver debug_device = {
},
.id_table = id_table,
.num_ports = 1,
+ .open = usb_debug_open,
};
static int __init debug_init(void)
OpenPOWER on IntegriCloud