]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[netdevice] Notify upper-layer drivers when RX processing is (un)frozen
authorMichael Brown <mcb30@ipxe.org>
Fri, 14 Mar 2014 14:05:38 +0000 (14:05 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 14 Mar 2014 14:05:38 +0000 (14:05 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/netdevice.h
src/net/netdevice.c

index 2ea3c8bb19aa5e5a850f62671bbbd0dcc15651ec..6ef9cb1e51f8f827fc451fb6726546643ce6a005 100644 (file)
@@ -658,6 +658,8 @@ netdev_rx_frozen ( struct net_device *netdev ) {
        return ( netdev->state & NETDEV_RX_FROZEN );
 }
 
+extern void netdev_rx_freeze ( struct net_device *netdev );
+extern void netdev_rx_unfreeze ( struct net_device *netdev );
 extern void netdev_link_err ( struct net_device *netdev, int rc );
 extern void netdev_link_down ( struct net_device *netdev );
 extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
@@ -733,24 +735,4 @@ netdev_link_up ( struct net_device *netdev ) {
        netdev_link_err ( netdev, 0 );
 }
 
-/**
- * Freeze network device receive queue processing
- *
- * @v netdev           Network device
- */
-static inline __attribute__ (( always_inline )) void
-netdev_rx_freeze ( struct net_device *netdev ) {
-       netdev->state |= NETDEV_RX_FROZEN;
-}
-
-/**
- * Unfreeze network device receive queue processing
- *
- * @v netdev           Network device
- */
-static inline __attribute__ (( always_inline )) void
-netdev_rx_unfreeze ( struct net_device *netdev ) {
-       netdev->state &= ~NETDEV_RX_FROZEN;
-}
-
 #endif /* _IPXE_NETDEVICE_H */
index 82d0e82b62c9ebbf9da6ff0b1a0476812eebe591..4a42ef42c4ea84409d50a13f26a129fc880bfca6 100644 (file)
@@ -108,6 +108,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
  *