English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/freewrt_1_0/target/linux/generic-2.4/patches/221-usb_serial_endpoint_size.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3782 - (show annotations) (download)
Wed Jul 30 17:29:57 2008 UTC (5 years, 6 months ago) by dnehring
File size: 1212 byte(s)
By default the linux usb core sees only 64 bytes of capacity. Without this work-around there is no way to specify what the maximum packet size on the inbound bulk endpoint should be. If you consider that the MTU on these cards is set at 1500 and the usb bulk endpoint callbacks are only reading 64 bytes at a time off of the serial tty, it doesn't take long to start dropping packets and seriously junkify your connection.

This patch adds a third module parameter so you can specify what you think the inbound endpoint maximum packet size should be. If the parameter is not set at module loading time, it defaults to 0 and the maximum packet size detected by the usb core will be used.

The parameter name is : maxSize.

1 Index: linux-2.4.35.4/drivers/usb/serial/usbserial.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/drivers/usb/serial/usbserial.c
4 +++ linux-2.4.35.4/drivers/usb/serial/usbserial.c
5 @@ -331,6 +331,7 @@ static void generic_shutdown (struct us
6 #ifdef CONFIG_USB_SERIAL_GENERIC
7 static __u16 vendor = 0x05f9;
8 static __u16 product = 0xffff;
9 +static int maxSize = 0;
10
11 static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
12
13 @@ -1557,7 +1558,11 @@ static void * usb_serial_probe(struct us
14 err("No free urbs available");
15 goto probe_error;
16 }
17 +#ifdef CONFIG_USB_SERIAL_GENERIC
18 + buffer_size = (endpoint->wMaxPacketSize > maxSize) ? endpoint->wMaxPacketSize : maxSize;
19 +#else
20 buffer_size = endpoint->wMaxPacketSize;
21 +#endif
22 port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
23 port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
24 if (!port->bulk_in_buffer) {
25 @@ -1921,4 +1926,7 @@ MODULE_PARM_DESC(vendor, "User specified
26
27 MODULE_PARM(product, "h");
28 MODULE_PARM_DESC(product, "User specified USB idProduct");
29 +
30 +MODULE_PARM(maxSize,"i");
31 +MODULE_PARM_DESC(maxSize,"User specified USB endpoint size");
32 #endif

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20