summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2011-01-25 15:16:11 +0100
committerMichael Brown2011-01-25 15:16:11 +0100
commit66caec3f005f3ae2a9cd3d131af710e60d246182 (patch)
treeb1fe9e875425ba47b5b5736efb7f0f108a97dd15 /src/include
parent[pci] Auto-resize VPD fields used for non-volatile storage (diff)
downloadipxe-66caec3f005f3ae2a9cd3d131af710e60d246182.tar.gz
ipxe-66caec3f005f3ae2a9cd3d131af710e60d246182.tar.xz
ipxe-66caec3f005f3ae2a9cd3d131af710e60d246182.zip
[netdevice] Allow devices to indicate that interrupts are not supported
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/netdevice.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/ipxe/netdevice.h b/src/include/ipxe/netdevice.h
index a7852a810..ac7cec521 100644
--- a/src/include/ipxe/netdevice.h
+++ b/src/include/ipxe/netdevice.h
@@ -236,6 +236,9 @@ struct net_device_operations {
*
* @v netdev Network device
* @v enable Interrupts should be enabled
+ *
+ * This method may be NULL to indicate that interrupts are not
+ * supported.
*/
void ( * irq ) ( struct net_device *netdev, int enable );
};
@@ -516,6 +519,17 @@ netdev_is_open ( struct net_device *netdev ) {
}
/**
+ * Check whether or not network device supports interrupts
+ *
+ * @v netdev Network device
+ * @ret irq_supported Network device supports interrupts
+ */
+static inline __attribute__ (( always_inline )) int
+netdev_irq_supported ( struct net_device *netdev ) {
+ return ( netdev->op->irq != NULL );
+}
+
+/**
* Check whether or not network device interrupts are currently enabled
*
* @v netdev Network device