801-usb_serial_endpoint_size.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
  11. @@ -1557,7 +1558,11 @@ static void * usb_serial_probe(struct us
  12. err("No free urbs available");
  13. goto probe_error;
  14. }
  15. +#ifdef CONFIG_USB_SERIAL_GENERIC
  16. + buffer_size = (endpoint->wMaxPacketSize > maxSize) ? endpoint->wMaxPacketSize : maxSize;
  17. +#else
  18. buffer_size = endpoint->wMaxPacketSize;
  19. +#endif
  20. port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
  21. port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
  22. if (!port->bulk_in_buffer) {
  23. @@ -1921,4 +1926,7 @@ MODULE_PARM_DESC(vendor, "User specified
  24. MODULE_PARM(product, "h");
  25. MODULE_PARM_DESC(product, "User specified USB idProduct");
  26. +
  27. +MODULE_PARM(maxSize,"i");
  28. +MODULE_PARM_DESC(maxSize,"User specified USB endpoint size");
  29. #endif