summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2010-03-23 01:46:23 +0100
committerMichael Brown2010-03-23 01:46:35 +0100
commit88e436376cbdedee73483a9b57203c60a34316ac (patch)
tree4b23f51f32be9190621b44e497ef392510f1fd69 /src/include
parent[phantom] Update interrupt support to match current firmware (diff)
downloadipxe-88e436376cbdedee73483a9b57203c60a34316ac.tar.gz
ipxe-88e436376cbdedee73483a9b57203c60a34316ac.tar.xz
ipxe-88e436376cbdedee73483a9b57203c60a34316ac.zip
[netdevice] Add netdev_is_open() wrapper function
Signed-off-by: Michael Brown <mcb30@etherboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/netdevice.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index 858d8e97d..4f469e6b2 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -480,6 +480,17 @@ netdev_link_ok ( struct net_device *netdev ) {
return ( netdev->link_rc == 0 );
}
+/**
+ * Check whether or not network device is open
+ *
+ * @v netdev Network device
+ * @v is_open Network device is open
+ */
+static inline __attribute__ (( always_inline )) int
+netdev_is_open ( struct net_device *netdev ) {
+ return ( netdev->state & NETDEV_OPEN );
+}
+
extern void netdev_link_down ( struct net_device *netdev );
extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
extern void netdev_tx_complete_err ( struct net_device *netdev,