aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2014-03-14 14:05:38 +0000
committerMichael Brown <mcb30@ipxe.org>2014-03-14 14:05:38 +0000
commit87465258abbd1056c8be4e934385d6c7197dc655 (patch)
tree930d2882cef8f9671839dde9945517e7b37bedbd /src/net
parent24bbaf6a38f52ef7e942fb4cea36529091af2a0c (diff)
downloadipxe-87465258abbd1056c8be4e934385d6c7197dc655.zip
ipxe-87465258abbd1056c8be4e934385d6c7197dc655.tar.gz
ipxe-87465258abbd1056c8be4e934385d6c7197dc655.tar.bz2
[netdevice] Notify upper-layer drivers when RX processing is (un)frozen
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/netdevice.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index 82d0e82..4a42ef4 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -109,6 +109,34 @@ static void netdev_notify ( struct net_device *netdev ) {
}
/**
+ * Freeze network device receive queue processing
+ *
+ * @v netdev Network device
+ */
+void netdev_rx_freeze ( struct net_device *netdev ) {
+
+ /* Mark receive queue processing as frozen */
+ netdev->state |= NETDEV_RX_FROZEN;
+
+ /* Notify drivers of change */
+ netdev_notify ( netdev );
+}
+
+/**
+ * Unfreeze network device receive queue processing
+ *
+ * @v netdev Network device
+ */
+void netdev_rx_unfreeze ( struct net_device *netdev ) {
+
+ /* Mark receive queue processing as not frozen */
+ netdev->state &= ~NETDEV_RX_FROZEN;
+
+ /* Notify drivers of change */
+ netdev_notify ( netdev );
+}
+
+/**
* Mark network device as having a specific link state
*
* @v netdev Network device