aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tg3.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2e0f4a50633f..a4e46e4de927 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -694,25 +694,39 @@ static void tg3_int_reenable(struct tg3_napi *tnapi)
694 HOSTCC_MODE_ENABLE | tnapi->coal_now); 694 HOSTCC_MODE_ENABLE | tnapi->coal_now);
695} 695}
696 696
697static void tg3_napi_disable(struct tg3 *tp)
698{
699 int i;
700
701 for (i = tp->irq_cnt - 1; i >= 0; i--)
702 napi_disable(&tp->napi[i].napi);
703}
704
705static void tg3_napi_enable(struct tg3 *tp)
706{
707 int i;
708
709 for (i = 0; i < tp->irq_cnt; i++)
710 napi_enable(&tp->napi[i].napi);
711}
712
697static inline void tg3_netif_stop(struct tg3 *tp) 713static inline void tg3_netif_stop(struct tg3 *tp)
698{ 714{
699 tp->dev->trans_start = jiffies; /* prevent tx timeout */ 715 tp->dev->trans_start = jiffies; /* prevent tx timeout */
700 napi_disable(&tp->napi[0].napi); 716 tg3_napi_disable(tp);
701 netif_tx_disable(tp->dev); 717 netif_tx_disable(tp->dev);
702} 718}
703 719
704static inline void tg3_netif_start(struct tg3 *tp) 720static inline void tg3_netif_start(struct tg3 *tp)
705{ 721{
706 struct tg3_napi *tnapi = &tp->napi[0];
707
708 /* NOTE: unconditional netif_tx_wake_all_queues is only 722 /* NOTE: unconditional netif_tx_wake_all_queues is only
709 * appropriate so long as all callers are assured to 723 * appropriate so long as all callers are assured to
710 * have free tx slots (such as after tg3_init_hw) 724 * have free tx slots (such as after tg3_init_hw)
711 */ 725 */
712 netif_tx_wake_all_queues(tp->dev); 726 netif_tx_wake_all_queues(tp->dev);
713 727
714 napi_enable(&tnapi->napi); 728 tg3_napi_enable(tp);
715 tnapi->hw_status->status |= SD_STATUS_UPDATED; 729 tp->napi[0].hw_status->status |= SD_STATUS_UPDATED;
716 tg3_enable_ints(tp); 730 tg3_enable_ints(tp);
717} 731}
718 732
@@ -4958,7 +4972,7 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
4958 tg3_full_unlock(tp); 4972 tg3_full_unlock(tp);
4959 del_timer_sync(&tp->timer); 4973 del_timer_sync(&tp->timer);
4960 tp->irq_sync = 0; 4974 tp->irq_sync = 0;
4961 napi_enable(&tp->napi[0].napi); 4975 tg3_napi_enable(tp);
4962 dev_close(tp->dev); 4976 dev_close(tp->dev);
4963 tg3_full_lock(tp, 0); 4977 tg3_full_lock(tp, 0);
4964 } 4978 }
@@ -8153,7 +8167,7 @@ static int tg3_open(struct net_device *dev)
8153 if (err) 8167 if (err)
8154 goto err_out1; 8168 goto err_out1;
8155 8169
8156 napi_enable(&tp->napi[0].napi); 8170 tg3_napi_enable(tp);
8157 8171
8158 for (i = 0; i < tp->irq_cnt; i++) { 8172 for (i = 0; i < tp->irq_cnt; i++) {
8159 struct tg3_napi *tnapi = &tp->napi[i]; 8173 struct tg3_napi *tnapi = &tp->napi[i];
@@ -8240,7 +8254,7 @@ err_out3:
8240 } 8254 }
8241 8255
8242err_out2: 8256err_out2:
8243 napi_disable(&tp->napi[0].napi); 8257 tg3_napi_disable(tp);
8244 tg3_free_consistent(tp); 8258 tg3_free_consistent(tp);
8245 8259
8246err_out1: 8260err_out1:
@@ -8486,7 +8500,7 @@ static int tg3_close(struct net_device *dev)
8486 int i; 8500 int i;
8487 struct tg3 *tp = netdev_priv(dev); 8501 struct tg3 *tp = netdev_priv(dev);
8488 8502
8489 napi_disable(&tp->napi[0].napi); 8503 tg3_napi_disable(tp);
8490 cancel_work_sync(&tp->reset_task); 8504 cancel_work_sync(&tp->reset_task);
8491 8505
8492 netif_tx_stop_all_queues(dev); 8506 netif_tx_stop_all_queues(dev);