diff options
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index abe3306855fd..5346410aeb6e 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1069,6 +1069,24 @@ static void nv_disable_hw_interrupts(struct net_device *dev, u32 mask) | |||
1069 | } | 1069 | } |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | static void nv_napi_enable(struct net_device *dev) | ||
1073 | { | ||
1074 | #ifdef CONFIG_FORCEDETH_NAPI | ||
1075 | struct fe_priv *np = get_nvpriv(dev); | ||
1076 | |||
1077 | napi_enable(&np->napi); | ||
1078 | #endif | ||
1079 | } | ||
1080 | |||
1081 | static void nv_napi_disable(struct net_device *dev) | ||
1082 | { | ||
1083 | #ifdef CONFIG_FORCEDETH_NAPI | ||
1084 | struct fe_priv *np = get_nvpriv(dev); | ||
1085 | |||
1086 | napi_disable(&np->napi); | ||
1087 | #endif | ||
1088 | } | ||
1089 | |||
1072 | #define MII_READ (-1) | 1090 | #define MII_READ (-1) |
1073 | /* mii_rw: read/write a register on the PHY. | 1091 | /* mii_rw: read/write a register on the PHY. |
1074 | * | 1092 | * |
@@ -2924,6 +2942,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu) | |||
2924 | * Changing the MTU is a rare event, it shouldn't matter. | 2942 | * Changing the MTU is a rare event, it shouldn't matter. |
2925 | */ | 2943 | */ |
2926 | nv_disable_irq(dev); | 2944 | nv_disable_irq(dev); |
2945 | nv_napi_disable(dev); | ||
2927 | netif_tx_lock_bh(dev); | 2946 | netif_tx_lock_bh(dev); |
2928 | netif_addr_lock(dev); | 2947 | netif_addr_lock(dev); |
2929 | spin_lock(&np->lock); | 2948 | spin_lock(&np->lock); |
@@ -2952,6 +2971,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu) | |||
2952 | spin_unlock(&np->lock); | 2971 | spin_unlock(&np->lock); |
2953 | netif_addr_unlock(dev); | 2972 | netif_addr_unlock(dev); |
2954 | netif_tx_unlock_bh(dev); | 2973 | netif_tx_unlock_bh(dev); |
2974 | nv_napi_enable(dev); | ||
2955 | nv_enable_irq(dev); | 2975 | nv_enable_irq(dev); |
2956 | } | 2976 | } |
2957 | return 0; | 2977 | return 0; |
@@ -4592,6 +4612,7 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri | |||
4592 | 4612 | ||
4593 | if (netif_running(dev)) { | 4613 | if (netif_running(dev)) { |
4594 | nv_disable_irq(dev); | 4614 | nv_disable_irq(dev); |
4615 | nv_napi_disable(dev); | ||
4595 | netif_tx_lock_bh(dev); | 4616 | netif_tx_lock_bh(dev); |
4596 | netif_addr_lock(dev); | 4617 | netif_addr_lock(dev); |
4597 | spin_lock(&np->lock); | 4618 | spin_lock(&np->lock); |
@@ -4644,6 +4665,7 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri | |||
4644 | spin_unlock(&np->lock); | 4665 | spin_unlock(&np->lock); |
4645 | netif_addr_unlock(dev); | 4666 | netif_addr_unlock(dev); |
4646 | netif_tx_unlock_bh(dev); | 4667 | netif_tx_unlock_bh(dev); |
4668 | nv_napi_enable(dev); | ||
4647 | nv_enable_irq(dev); | 4669 | nv_enable_irq(dev); |
4648 | } | 4670 | } |
4649 | return 0; | 4671 | return 0; |
@@ -5070,9 +5092,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64 | |||
5070 | if (test->flags & ETH_TEST_FL_OFFLINE) { | 5092 | if (test->flags & ETH_TEST_FL_OFFLINE) { |
5071 | if (netif_running(dev)) { | 5093 | if (netif_running(dev)) { |
5072 | netif_stop_queue(dev); | 5094 | netif_stop_queue(dev); |
5073 | #ifdef CONFIG_FORCEDETH_NAPI | 5095 | nv_napi_disable(dev); |
5074 | napi_disable(&np->napi); | ||
5075 | #endif | ||
5076 | netif_tx_lock_bh(dev); | 5096 | netif_tx_lock_bh(dev); |
5077 | netif_addr_lock(dev); | 5097 | netif_addr_lock(dev); |
5078 | spin_lock_irq(&np->lock); | 5098 | spin_lock_irq(&np->lock); |
@@ -5130,9 +5150,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64 | |||
5130 | /* restart rx engine */ | 5150 | /* restart rx engine */ |
5131 | nv_start_rxtx(dev); | 5151 | nv_start_rxtx(dev); |
5132 | netif_start_queue(dev); | 5152 | netif_start_queue(dev); |
5133 | #ifdef CONFIG_FORCEDETH_NAPI | 5153 | nv_napi_enable(dev); |
5134 | napi_enable(&np->napi); | ||
5135 | #endif | ||
5136 | nv_enable_hw_interrupts(dev, np->irqmask); | 5154 | nv_enable_hw_interrupts(dev, np->irqmask); |
5137 | } | 5155 | } |
5138 | } | 5156 | } |
@@ -5424,9 +5442,7 @@ static int nv_open(struct net_device *dev) | |||
5424 | ret = nv_update_linkspeed(dev); | 5442 | ret = nv_update_linkspeed(dev); |
5425 | nv_start_rxtx(dev); | 5443 | nv_start_rxtx(dev); |
5426 | netif_start_queue(dev); | 5444 | netif_start_queue(dev); |
5427 | #ifdef CONFIG_FORCEDETH_NAPI | 5445 | nv_napi_enable(dev); |
5428 | napi_enable(&np->napi); | ||
5429 | #endif | ||
5430 | 5446 | ||
5431 | if (ret) { | 5447 | if (ret) { |
5432 | netif_carrier_on(dev); | 5448 | netif_carrier_on(dev); |
@@ -5458,9 +5474,7 @@ static int nv_close(struct net_device *dev) | |||
5458 | spin_lock_irq(&np->lock); | 5474 | spin_lock_irq(&np->lock); |
5459 | np->in_shutdown = 1; | 5475 | np->in_shutdown = 1; |
5460 | spin_unlock_irq(&np->lock); | 5476 | spin_unlock_irq(&np->lock); |
5461 | #ifdef CONFIG_FORCEDETH_NAPI | 5477 | nv_napi_disable(dev); |
5462 | napi_disable(&np->napi); | ||
5463 | #endif | ||
5464 | synchronize_irq(np->pci_dev->irq); | 5478 | synchronize_irq(np->pci_dev->irq); |
5465 | 5479 | ||
5466 | del_timer_sync(&np->oom_kick); | 5480 | del_timer_sync(&np->oom_kick); |