mirror of
https://github.com/ipxe/ipxe
synced 2025-12-29 11:03:15 +03:00
[netdevice] Notify upper-layer drivers when RX processing is (un)frozen
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user