]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[netdevice] Make netdev_irq_enabled() independent of netdev_irq_supported()
authorMartin Habets <mhabets@solarflare.com>
Wed, 10 Jan 2018 15:32:34 +0000 (15:32 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 14 Jan 2018 21:53:29 +0000 (21:53 +0000)
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>
src/net/netdevice.c

index 4c211d707b966f63ca2a08f3d796d8565089a90f..71a37eccc900b76828023ae7b3e57bc9a2d33d53 100644 (file)
@@ -874,12 +874,9 @@ void unregister_netdev ( struct net_device *netdev ) {
  */
 void netdev_irq ( struct net_device *netdev, int enable ) {
 
-       /* Do nothing if device does not support interrupts */
-       if ( ! netdev_irq_supported ( netdev ) )
-               return;
-
-       /* Enable or disable device interrupts */
-       netdev->op->irq ( netdev, enable );
+       /* Enable or disable device interrupts, if applicable */
+       if ( netdev_irq_supported ( netdev ) )
+               netdev->op->irq ( netdev, enable );
 
        /* Record interrupt enabled state */
        netdev->state &= ~NETDEV_IRQ_ENABLED;