mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aleksey Gorelov <dared1st@yahoo.com>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Cc: greg@kroah.com
Subject: [PATCH] USB: debug port converter does not accept more than 8 byte packets
Date: Thu, 19 Jun 2008 15:22:17 -0700 (PDT)	[thread overview]
Message-ID: <911755.27146.qm@web83307.mail.sp1.yahoo.com> (raw)

Hi,

  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>

--- a/drivers/usb/serial/usb_debug.c    2008-06-19 14:52:19.000000000 -0700
+++ b/drivers/usb/serial/usb_debug.c    2008-06-19 14:48:32.000000000 -0700
@@ -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 @@
     .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,
@@ -39,6 +47,7 @@
     .num_bulk_in =        NUM_DONT_CARE,
     .num_bulk_out =        NUM_DONT_CARE,
     .num_ports =        1,
+    .open =            usb_debug_open,
 };
 
 static int __init debug_init(void)


                 reply	other threads:[~2008-06-19 22:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=911755.27146.qm@web83307.mail.sp1.yahoo.com \
    --to=dared1st@yahoo.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®