diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ipxe/usbnet.h | 14 |
1 files changed, 13 insertions, 1 deletions
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 ); |