mirror of
https://github.com/ipxe/ipxe
synced 2026-02-09 23:29:33 +03:00
[netdevice] Add the concept of an insomniac network device
Some network devices (observed with the SNP interface to the wireless network card on an HP Elitebook 840 G10) will stop working if they are left for too long without being polled. Add the concept of an insomniac network device, that must continue to be polled even when closed. Note that drivers are already permitted to call netdev_rx() et al even when closed: this will already be happening for USB devices since polling operates at the level of the whole USB bus, rather than at the level of individual USB devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -611,8 +611,8 @@ void netdev_rx_err ( struct net_device *netdev,
|
||||
*/
|
||||
void netdev_poll ( struct net_device *netdev ) {
|
||||
|
||||
/* Avoid calling poll() on unopened network devices */
|
||||
if ( ! netdev_is_open ( netdev ) )
|
||||
/* Call poll() only on open (or insomniac) network devices */
|
||||
if ( ! ( netdev->state & ( NETDEV_OPEN | NETDEV_INSOMNIAC ) ) )
|
||||
return;
|
||||
|
||||
/* Guard against re-entry */
|
||||
|
||||
Reference in New Issue
Block a user