| 1 |
$FreeWRT$ |
| 2 |
|
| 3 |
Originally from http://www.junxion.com/opensource/linux_highspeed_usbserial.html |
| 4 |
except that we don't do camel-case and honour coding style(9) |
| 5 |
|
| 6 |
--- linux-2.4.34.orig/drivers/usb/serial/usbserial.c 2007-07-31 18:06:05.000000000 +0200 |
| 7 |
+++ linux-2.4.34/drivers/usb/serial/usbserial.c 2007-07-31 18:29:28.000000000 +0200 |
| 8 |
@@ -331,6 +331,7 @@ static void generic_shutdown (struct us |
| 9 |
#ifdef CONFIG_USB_SERIAL_GENERIC |
| 10 |
static __u16 vendor = 0x05f9; |
| 11 |
static __u16 product = 0xffff; |
| 12 |
+static int maxpksz = 0; |
| 13 |
|
| 14 |
static struct usb_device_id generic_device_ids[8]; /* Initially all zeroes. */ |
| 15 |
|
| 16 |
@@ -1558,6 +1559,10 @@ static void * usb_serial_probe(struct us |
| 17 |
goto probe_error; |
| 18 |
} |
| 19 |
buffer_size = endpoint->wMaxPacketSize; |
| 20 |
+#ifdef CONFIG_USB_SERIAL_GENERIC |
| 21 |
+ if (buffer_size < maxpksz) |
| 22 |
+ buffer_size = maxpksz; |
| 23 |
+#endif |
| 24 |
port->bulk_in_endpointAddress = endpoint->bEndpointAddress; |
| 25 |
port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL); |
| 26 |
if (!port->bulk_in_buffer) { |
| 27 |
@@ -1945,4 +1950,7 @@ MODULE_PARM_DESC(vendor, "User specified |
| 28 |
|
| 29 |
MODULE_PARM(product, "h"); |
| 30 |
MODULE_PARM_DESC(product, "User specified USB idProduct"); |
| 31 |
+ |
| 32 |
+MODULE_PARM(max_pksz, "i"); |
| 33 |
+MODULE_PARM_DESC(max_pksz, "User specified USB endpoint packet size"); |
| 34 |
#endif |