[usb] Allow for USB network devices with no interrupt endpoint

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2017-05-18 15:18:25 +01:00
parent 84e25513b1
commit 63113f591f
2 changed files with 34 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ struct usbnet_device {
*
* @v usbnet USB network device
* @v func USB function
* @v intr Interrupt endpoint operations
* @v intr Interrupt endpoint operations, or NULL
* @v in Bulk IN endpoint operations
* @v out Bulk OUT endpoint operations
*/
@@ -53,6 +53,18 @@ usbnet_init ( struct usbnet_device *usbnet, struct usb_function *func,
usb_endpoint_init ( &usbnet->out, usb, out );
}
/**
* Check if USB network device has an interrupt endpoint
*
* @v usbnet USB network device
* @ret has_intr Device has an interrupt endpoint
*/
static inline __attribute__ (( always_inline )) int
usbnet_has_intr ( struct usbnet_device *usbnet ) {
return ( usbnet->intr.driver != NULL );
}
extern int usbnet_open ( struct usbnet_device *usbnet );
extern void usbnet_close ( struct usbnet_device *usbnet );
extern int usbnet_refill ( struct usbnet_device *usbnet );