Browse Source

[netdevice] Make netdev_irq_enabled() independent of netdev_irq_supported()

The UNDI layer uses the NETDEV_IRQ_ENABLED flag to choose whether to
return PXENV_UNDI_ISR_OUT_OURS or PXENV_UNDI_ISR_OUT_NOT_OURS for a
given interrupt.  For a network device that does not support
interrupts, the flag will never be set and so pxenv_undi_isr() will
always return PXENV_UNDI_ISR_OUT_NOT_OURS.  This causes some NBPs
(such as lpxelinux.0) to hang.

Redefine NETDEV_IRQ_ENABLED as a simple administrative flag which can
be set even on network devices that do not support interrupts.  This
allows pxenv_undi_isr() (which is the sole user of NETDEV_IRQ_ENABLED)
to function as expected by lpxelinux.0.

Signed-off-by: Martin Habets <mhabets@solarflare.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Martin Habets 7 years ago
parent
commit
70189a8e47
1 changed files with 3 additions and 6 deletions
  1. 3
    6
      src/net/netdevice.c

+ 3
- 6
src/net/netdevice.c View File

@@ -874,12 +874,9 @@ void unregister_netdev ( struct net_device *netdev ) {
874 874
  */
875 875
 void netdev_irq ( struct net_device *netdev, int enable ) {
876 876
 
877
-	/* Do nothing if device does not support interrupts */
878
-	if ( ! netdev_irq_supported ( netdev ) )
879
-		return;
880
-
881
-	/* Enable or disable device interrupts */
882
-	netdev->op->irq ( netdev, enable );
877
+	/* Enable or disable device interrupts, if applicable */
878
+	if ( netdev_irq_supported ( netdev ) )
879
+		netdev->op->irq ( netdev, enable );
883 880
 
884 881
 	/* Record interrupt enabled state */
885 882
 	netdev->state &= ~NETDEV_IRQ_ENABLED;

Loading…
Cancel
Save