mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 21:41:43 +03:00
[netdevice] Allow devices to indicate that interrupts are not supported
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -236,6 +236,9 @@ struct net_device_operations {
|
||||
*
|
||||
* @v netdev Network device
|
||||
* @v enable Interrupts should be enabled
|
||||
*
|
||||
* This method may be NULL to indicate that interrupts are not
|
||||
* supported.
|
||||
*/
|
||||
void ( * irq ) ( struct net_device *netdev, int enable );
|
||||
};
|
||||
@@ -515,6 +518,17 @@ netdev_is_open ( struct net_device *netdev ) {
|
||||
return ( netdev->state & NETDEV_OPEN );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether or not network device supports interrupts
|
||||
*
|
||||
* @v netdev Network device
|
||||
* @ret irq_supported Network device supports interrupts
|
||||
*/
|
||||
static inline __attribute__ (( always_inline )) int
|
||||
netdev_irq_supported ( struct net_device *netdev ) {
|
||||
return ( netdev->op->irq != NULL );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether or not network device interrupts are currently enabled
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user