forcedeth: fix missing napi enable/disable calls

This patch adds missing napi enable/disable calls.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ayaz Abdulla 2009-03-05 08:01:55 +00:00 committed by David S. Miller
parent 8ed1454aa8
commit 08d9357574

View File

@ -1069,6 +1069,24 @@ static void nv_disable_hw_interrupts(struct net_device *dev, u32 mask)
} }
} }
static void nv_napi_enable(struct net_device *dev)
{
#ifdef CONFIG_FORCEDETH_NAPI
struct fe_priv *np = get_nvpriv(dev);
napi_enable(&np->napi);
#endif
}
static void nv_napi_disable(struct net_device *dev)
{
#ifdef CONFIG_FORCEDETH_NAPI
struct fe_priv *np = get_nvpriv(dev);
napi_disable(&np->napi);
#endif
}
#define MII_READ (-1) #define MII_READ (-1)
/* mii_rw: read/write a register on the PHY. /* mii_rw: read/write a register on the PHY.
* *
@ -2924,6 +2942,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
* Changing the MTU is a rare event, it shouldn't matter. * Changing the MTU is a rare event, it shouldn't matter.
*/ */
nv_disable_irq(dev); nv_disable_irq(dev);
nv_napi_disable(dev);
netif_tx_lock_bh(dev); netif_tx_lock_bh(dev);
netif_addr_lock(dev); netif_addr_lock(dev);
spin_lock(&np->lock); spin_lock(&np->lock);
@ -2952,6 +2971,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
spin_unlock(&np->lock); spin_unlock(&np->lock);
netif_addr_unlock(dev); netif_addr_unlock(dev);
netif_tx_unlock_bh(dev); netif_tx_unlock_bh(dev);
nv_napi_enable(dev);
nv_enable_irq(dev); nv_enable_irq(dev);
} }
return 0; return 0;
@ -4592,6 +4612,7 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri
if (netif_running(dev)) { if (netif_running(dev)) {
nv_disable_irq(dev); nv_disable_irq(dev);
nv_napi_disable(dev);
netif_tx_lock_bh(dev); netif_tx_lock_bh(dev);
netif_addr_lock(dev); netif_addr_lock(dev);
spin_lock(&np->lock); spin_lock(&np->lock);
@ -4644,6 +4665,7 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri
spin_unlock(&np->lock); spin_unlock(&np->lock);
netif_addr_unlock(dev); netif_addr_unlock(dev);
netif_tx_unlock_bh(dev); netif_tx_unlock_bh(dev);
nv_napi_enable(dev);
nv_enable_irq(dev); nv_enable_irq(dev);
} }
return 0; return 0;
@ -5070,9 +5092,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
if (test->flags & ETH_TEST_FL_OFFLINE) { if (test->flags & ETH_TEST_FL_OFFLINE) {
if (netif_running(dev)) { if (netif_running(dev)) {
netif_stop_queue(dev); netif_stop_queue(dev);
#ifdef CONFIG_FORCEDETH_NAPI nv_napi_disable(dev);
napi_disable(&np->napi);
#endif
netif_tx_lock_bh(dev); netif_tx_lock_bh(dev);
netif_addr_lock(dev); netif_addr_lock(dev);
spin_lock_irq(&np->lock); spin_lock_irq(&np->lock);
@ -5130,9 +5150,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
/* restart rx engine */ /* restart rx engine */
nv_start_rxtx(dev); nv_start_rxtx(dev);
netif_start_queue(dev); netif_start_queue(dev);
#ifdef CONFIG_FORCEDETH_NAPI nv_napi_enable(dev);
napi_enable(&np->napi);
#endif
nv_enable_hw_interrupts(dev, np->irqmask); nv_enable_hw_interrupts(dev, np->irqmask);
} }
} }
@ -5424,9 +5442,7 @@ static int nv_open(struct net_device *dev)
ret = nv_update_linkspeed(dev); ret = nv_update_linkspeed(dev);
nv_start_rxtx(dev); nv_start_rxtx(dev);
netif_start_queue(dev); netif_start_queue(dev);
#ifdef CONFIG_FORCEDETH_NAPI nv_napi_enable(dev);
napi_enable(&np->napi);
#endif
if (ret) { if (ret) {
netif_carrier_on(dev); netif_carrier_on(dev);
@ -5458,9 +5474,7 @@ static int nv_close(struct net_device *dev)
spin_lock_irq(&np->lock); spin_lock_irq(&np->lock);
np->in_shutdown = 1; np->in_shutdown = 1;
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
#ifdef CONFIG_FORCEDETH_NAPI nv_napi_disable(dev);
napi_disable(&np->napi);
#endif
synchronize_irq(np->pci_dev->irq); synchronize_irq(np->pci_dev->irq);
del_timer_sync(&np->oom_kick); del_timer_sync(&np->oom_kick);