| 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.6.19.1/drivers/usb/serial/usb-serial.c.orig 2006-12-11 20:32:53.000000000 +0100 |
| 7 |
+++ linux-2.6.19.1/drivers/usb/serial/usb-serial.c 2007-07-31 18:33:13.000000000 +0200 |
| 8 |
@@ -58,6 +58,7 @@ static struct usb_driver usb_serial_driv |
| 9 |
*/ |
| 10 |
|
| 11 |
static int debug; |
| 12 |
+static int max_pksz = 0; |
| 13 |
static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */ |
| 14 |
static LIST_HEAD(usb_serial_driver_list); |
| 15 |
|
| 16 |
@@ -813,6 +814,8 @@ int usb_serial_probe(struct usb_interfac |
| 17 |
goto probe_error; |
| 18 |
} |
| 19 |
buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); |
| 20 |
+ if (buffer_size < max_pksz) |
| 21 |
+ buffer_size = max_pksz; |
| 22 |
port->bulk_in_size = buffer_size; |
| 23 |
port->bulk_in_endpointAddress = endpoint->bEndpointAddress; |
| 24 |
port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL); |
| 25 |
@@ -1190,3 +1193,6 @@ MODULE_LICENSE("GPL"); |
| 26 |
|
| 27 |
module_param(debug, bool, S_IRUGO | S_IWUSR); |
| 28 |
MODULE_PARM_DESC(debug, "Debug enabled or not"); |
| 29 |
+ |
| 30 |
+module_param(max_pksz, int, 0); |
| 31 |
+MODULE_PARM_DESC(max_pksz, "User specified USB endpoint packet size"); |