patch-2.3.43 linux/drivers/usb/usb.c

Next file: linux/drivers/usb/usb_storage.h
Previous file: linux/drivers/usb/usb-uhci.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/drivers/usb/usb.c linux/drivers/usb/usb.c
@@ -1363,7 +1363,7 @@
 
 static void usb_set_maxpacket(struct usb_device *dev)
 {
-	int i, j;
+	int i, j, b;
 	struct usb_interface *ifp;
 
 	for (i=0; i<dev->actconfig->bNumInterfaces; i++) {
@@ -1375,12 +1375,15 @@
 			int e;
 
 			for (e=0; e<as->bNumEndpoints; e++) {
-				if (usb_endpoint_out(ep[e].bEndpointAddress))
-					dev->epmaxpacketout[ep[e].bEndpointAddress & 0x0f] =
-						ep[e].wMaxPacketSize;
-				else
-					dev->epmaxpacketin [ep[e].bEndpointAddress & 0x0f] =
-						ep[e].wMaxPacketSize;
+				b = ep[e].bEndpointAddress & 0x0f;
+				if (usb_endpoint_out(ep[e].bEndpointAddress)) {
+					if (ep[e].wMaxPacketSize > dev->epmaxpacketout[b])
+						dev->epmaxpacketout[b] = ep[e].wMaxPacketSize;
+				}
+				else {
+					if (ep[e].wMaxPacketSize > dev->epmaxpacketin [b])
+						dev->epmaxpacketin [b] = ep[e].wMaxPacketSize;
+				}
 			}
 		}
 	}
@@ -1756,16 +1759,7 @@
 }
 
 static struct file_operations usb_fops = {
-	NULL,		/* seek */
-	NULL,		/* read */
-	NULL,		/* write */
-	NULL,		/* readdir */
-	NULL,		/* poll */
-	NULL,		/* ioctl */
-	NULL,		/* mmap */
-	usb_open,
-	NULL,		/* flush */
-	NULL		/* release */
+	open:		usb_open,
 };
 
 int usb_major_init(void)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)