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
 	burst = ( descx ? descx->burst : USB_ENDPOINT_BURST ( sizes ) );
265
 	burst = ( descx ? descx->burst : USB_ENDPOINT_BURST ( sizes ) );
266
 
266
 
267
 	/* Calculate interval */
267
 	/* Calculate interval */
268
-	if ( type == USB_INTERRUPT ) {
268
+	if ( ( type & USB_ENDPOINT_ATTR_TYPE_MASK ) ==
269
+	     USB_ENDPOINT_ATTR_INTERRUPT ) {
269
 		if ( port->speed >= USB_SPEED_HIGH ) {
270
 		if ( port->speed >= USB_SPEED_HIGH ) {
270
 			/* 2^(desc->interval-1) is a microframe count */
271
 			/* 2^(desc->interval-1) is a microframe count */
271
 			interval = ( 1 << ( desc->interval - 1 ) );
272
 			interval = ( 1 << ( desc->interval - 1 ) );

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

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

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

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

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

277
 /** Bulk IN endpoint (internal) type */
277
 /** Bulk IN endpoint (internal) type */
278
 #define USB_BULK_IN ( USB_ENDPOINT_ATTR_BULK | USB_DIR_IN )
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
 /** USB endpoint MTU */
286
 /** USB endpoint MTU */
284
 #define USB_ENDPOINT_MTU(sizes) ( ( (sizes) >> 0 ) & 0x07ff )
287
 #define USB_ENDPOINT_MTU(sizes) ( ( (sizes) >> 0 ) & 0x07ff )

Loading…
Cancel
Save