From 63113f591fc8d36f3cd2c90c2b145480d9ab1926 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 18 May 2017 15:18:25 +0100 Subject: [usb] Allow for USB network devices with no interrupt endpoint Signed-off-by: Michael Brown --- src/include/ipxe/usbnet.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/ipxe/usbnet.h b/src/include/ipxe/usbnet.h index 33a8f3f5..a7276eba 100644 --- a/src/include/ipxe/usbnet.h +++ b/src/include/ipxe/usbnet.h @@ -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 ); -- cgit v1.2.3-55-g7522