|
@@ -236,6 +236,9 @@ struct net_device_operations {
|
236
|
236
|
*
|
237
|
237
|
* @v netdev Network device
|
238
|
238
|
* @v enable Interrupts should be enabled
|
|
239
|
+ *
|
|
240
|
+ * This method may be NULL to indicate that interrupts are not
|
|
241
|
+ * supported.
|
239
|
242
|
*/
|
240
|
243
|
void ( * irq ) ( struct net_device *netdev, int enable );
|
241
|
244
|
};
|
|
@@ -515,6 +518,17 @@ netdev_is_open ( struct net_device *netdev ) {
|
515
|
518
|
return ( netdev->state & NETDEV_OPEN );
|
516
|
519
|
}
|
517
|
520
|
|
|
521
|
+/**
|
|
522
|
+ * Check whether or not network device supports interrupts
|
|
523
|
+ *
|
|
524
|
+ * @v netdev Network device
|
|
525
|
+ * @ret irq_supported Network device supports interrupts
|
|
526
|
+ */
|
|
527
|
+static inline __attribute__ (( always_inline )) int
|
|
528
|
+netdev_irq_supported ( struct net_device *netdev ) {
|
|
529
|
+ return ( netdev->op->irq != NULL );
|
|
530
|
+}
|
|
531
|
+
|
518
|
532
|
/**
|
519
|
533
|
* Check whether or not network device interrupts are currently enabled
|
520
|
534
|
*
|