Browse Source

[usb] Add USB_INTERRUPT_OUT internal type

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
0eaa3a34bf
4 changed files with 9 additions and 5 deletions
  1. 2
    1
      src/drivers/bus/usb.c
  2. 1
    1
      src/drivers/usb/usbhub.c
  3. 1
    1
      src/drivers/usb/usbnet.c
  4. 5
    2
      src/include/ipxe/usb.h

+ 2
- 1
src/drivers/bus/usb.c View File

@@ -265,7 +265,8 @@ int usb_endpoint_described ( struct usb_endpoint *ep,
265 265
 	burst = ( descx ? descx->burst : USB_ENDPOINT_BURST ( sizes ) );
266 266
 
267 267
 	/* Calculate interval */
268
-	if ( type == USB_INTERRUPT ) {
268
+	if ( ( type & USB_ENDPOINT_ATTR_TYPE_MASK ) ==
269
+	     USB_ENDPOINT_ATTR_INTERRUPT ) {
269 270
 		if ( port->speed >= USB_SPEED_HIGH ) {
270 271
 			/* 2^(desc->interval-1) is a microframe count */
271 272
 			interval = ( 1 << ( desc->interval - 1 ) );

+ 1
- 1
src/drivers/usb/usbhub.c View File

@@ -425,7 +425,7 @@ static int hub_probe ( struct usb_function *func,
425 425
 
426 426
 	/* Locate interrupt endpoint descriptor */
427 427
 	if ( ( rc = usb_endpoint_described ( &hubdev->intr, config, interface,
428
-					     USB_INTERRUPT, 0 ) ) != 0 ) {
428
+					     USB_INTERRUPT_IN, 0 ) ) != 0 ) {
429 429
 		DBGC ( hubdev, "HUB %s could not describe interrupt endpoint: "
430 430
 		       "%s\n", hubdev->name, strerror ( rc ) );
431 431
 		goto err_endpoint;

+ 1
- 1
src/drivers/usb/usbnet.c View File

@@ -185,7 +185,7 @@ static int usbnet_comms_describe ( struct usbnet_device *usbnet,
185 185
 
186 186
 		/* Describe interrupt endpoint */
187 187
 		if ( ( rc = usb_endpoint_described ( &usbnet->intr, config,
188
-						     desc, USB_INTERRUPT,
188
+						     desc, USB_INTERRUPT_IN,
189 189
 						     0 ) ) != 0 )
190 190
 			continue;
191 191
 

+ 5
- 2
src/include/ipxe/usb.h View File

@@ -277,8 +277,11 @@ struct usb_endpoint_descriptor {
277 277
 /** Bulk IN endpoint (internal) type */
278 278
 #define USB_BULK_IN ( USB_ENDPOINT_ATTR_BULK | USB_DIR_IN )
279 279
 
280
-/** Interrupt endpoint (internal) type */
281
-#define USB_INTERRUPT ( USB_ENDPOINT_ATTR_INTERRUPT | USB_DIR_IN )
280
+/** Interrupt IN endpoint (internal) type */
281
+#define USB_INTERRUPT_IN ( USB_ENDPOINT_ATTR_INTERRUPT | USB_DIR_IN )
282
+
283
+/** Interrupt OUT endpoint (internal) type */
284
+#define USB_INTERRUPT_OUT ( USB_ENDPOINT_ATTR_INTERRUPT | USB_DIR_OUT )
282 285
 
283 286
 /** USB endpoint MTU */
284 287
 #define USB_ENDPOINT_MTU(sizes) ( ( (sizes) >> 0 ) & 0x07ff )

Loading…
Cancel
Save