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

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

diff -u --recursive --new-file v2.3.48/linux/drivers/usb/usb.c linux/drivers/usb/usb.c
@@ -1375,8 +1375,13 @@
 			int e;
 
 			for (e=0; e<as->bNumEndpoints; e++) {
-				b = ep[e].bEndpointAddress & 0x0f;
-				if (usb_endpoint_out(ep[e].bEndpointAddress)) {
+				b = ep[e].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+				if ((ep[e].bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+					USB_ENDPOINT_XFER_CONTROL) {	/* Control => bidirectional */
+					dev->epmaxpacketout[b] = ep[e].wMaxPacketSize;
+					dev->epmaxpacketin [b] = ep[e].wMaxPacketSize;
+					}
+				else if (usb_endpoint_out(ep[e].bEndpointAddress)) {
 					if (ep[e].wMaxPacketSize > dev->epmaxpacketout[b])
 						dev->epmaxpacketout[b] = ep[e].wMaxPacketSize;
 				}

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