tag rc6
[openwrt/svn-archive/openwrt.git] / target / linux / linux-2.4 / patches / generic / 219-usbserial_buffer.patch
1 --- linux.old/drivers/usb/serial/usbserial.c 2006-08-19 18:48:07.000000000 +0200
2 +++ linux.dev/drivers/usb/serial/usbserial.c 2006-08-19 18:46:02.000000000 +0200
3 @@ -1359,7 +1359,7 @@
4 wake_up_interruptible(&tty->write_wait);
5 }
6
7 -
8 +#define MIN(a, b) (((a) < (b)) ? (a) : (b))
9 static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,
10 const struct usb_device_id *id)
11 {
12 @@ -1512,7 +1512,8 @@
13 err("No free urbs available");
14 goto probe_error;
15 }
16 - buffer_size = endpoint->wMaxPacketSize;
17 + /* Minimum buffer size for EVDO and HSDPA cards */
18 + buffer_size = MIN(2048,endpoint->wMaxPacketSize);
19 port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
20 port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
21 if (!port->bulk_in_buffer) {