summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2017-05-18 16:18:25 +0200
committerMichael Brown2017-06-14 13:14:54 +0200
commit63113f591fc8d36f3cd2c90c2b145480d9ab1926 (patch)
tree7ab06217d9481f0241bc324c610efd408a2a0c86 /src/include
parent[hdprefix] Avoid attempts to read beyond the end of the disk (diff)
downloadipxe-63113f591fc8d36f3cd2c90c2b145480d9ab1926.tar.gz
ipxe-63113f591fc8d36f3cd2c90c2b145480d9ab1926.tar.xz
ipxe-63113f591fc8d36f3cd2c90c2b145480d9ab1926.zip
[usb] Allow for USB network devices with no interrupt endpoint
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/usbnet.h14
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 );