diff options
author | Michael Chan <mchan@broadcom.com> | 2005-05-29 17:57:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-29 17:57:48 -0400 |
commit | 944d980ecaabe44616a9e2d50101ce774f517bb6 (patch) | |
tree | a8e1c794fd332c19c739ba663a8d66acaee3d309 /drivers/net/tg3.c | |
parent | ca43007a92662621e5819912fc31c346e3a2eed8 (diff) |
[TG3]: Add parameter to tg3_halt
Add a reset kind parameter to tg3_halt() so that the RESET_KIND_SUSPEND
parameter can be passed to tg3_halt() before doing offline tests.
All other calls to tg3_halt() will use the RESET_KIND_SHUTDOWN
parameter.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 30349c5fd73c..73f6e962ed5e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3083,7 +3083,7 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id, | |||
3083 | } | 3083 | } |
3084 | 3084 | ||
3085 | static int tg3_init_hw(struct tg3 *); | 3085 | static int tg3_init_hw(struct tg3 *); |
3086 | static int tg3_halt(struct tg3 *, int); | 3086 | static int tg3_halt(struct tg3 *, int, int); |
3087 | 3087 | ||
3088 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3088 | #ifdef CONFIG_NET_POLL_CONTROLLER |
3089 | static void tg3_poll_controller(struct net_device *dev) | 3089 | static void tg3_poll_controller(struct net_device *dev) |
@@ -3107,7 +3107,7 @@ static void tg3_reset_task(void *_data) | |||
3107 | restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; | 3107 | restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; |
3108 | tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; | 3108 | tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; |
3109 | 3109 | ||
3110 | tg3_halt(tp, 0); | 3110 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 0); |
3111 | tg3_init_hw(tp); | 3111 | tg3_init_hw(tp); |
3112 | 3112 | ||
3113 | tg3_netif_start(tp); | 3113 | tg3_netif_start(tp); |
@@ -3453,7 +3453,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu) | |||
3453 | spin_lock_irq(&tp->lock); | 3453 | spin_lock_irq(&tp->lock); |
3454 | spin_lock(&tp->tx_lock); | 3454 | spin_lock(&tp->tx_lock); |
3455 | 3455 | ||
3456 | tg3_halt(tp, 1); | 3456 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
3457 | 3457 | ||
3458 | tg3_set_mtu(dev, tp, new_mtu); | 3458 | tg3_set_mtu(dev, tp, new_mtu); |
3459 | 3459 | ||
@@ -4144,19 +4144,19 @@ static void tg3_stop_fw(struct tg3 *tp) | |||
4144 | } | 4144 | } |
4145 | 4145 | ||
4146 | /* tp->lock is held. */ | 4146 | /* tp->lock is held. */ |
4147 | static int tg3_halt(struct tg3 *tp, int silent) | 4147 | static int tg3_halt(struct tg3 *tp, int kind, int silent) |
4148 | { | 4148 | { |
4149 | int err; | 4149 | int err; |
4150 | 4150 | ||
4151 | tg3_stop_fw(tp); | 4151 | tg3_stop_fw(tp); |
4152 | 4152 | ||
4153 | tg3_write_sig_pre_reset(tp, RESET_KIND_SHUTDOWN); | 4153 | tg3_write_sig_pre_reset(tp, kind); |
4154 | 4154 | ||
4155 | tg3_abort_hw(tp, silent); | 4155 | tg3_abort_hw(tp, silent); |
4156 | err = tg3_chip_reset(tp); | 4156 | err = tg3_chip_reset(tp); |
4157 | 4157 | ||
4158 | tg3_write_sig_legacy(tp, RESET_KIND_SHUTDOWN); | 4158 | tg3_write_sig_legacy(tp, kind); |
4159 | tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN); | 4159 | tg3_write_sig_post_reset(tp, kind); |
4160 | 4160 | ||
4161 | if (err) | 4161 | if (err) |
4162 | return err; | 4162 | return err; |
@@ -5997,7 +5997,7 @@ static int tg3_test_msi(struct tg3 *tp) | |||
5997 | spin_lock_irq(&tp->lock); | 5997 | spin_lock_irq(&tp->lock); |
5998 | spin_lock(&tp->tx_lock); | 5998 | spin_lock(&tp->tx_lock); |
5999 | 5999 | ||
6000 | tg3_halt(tp, 1); | 6000 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
6001 | err = tg3_init_hw(tp); | 6001 | err = tg3_init_hw(tp); |
6002 | 6002 | ||
6003 | spin_unlock(&tp->tx_lock); | 6003 | spin_unlock(&tp->tx_lock); |
@@ -6073,7 +6073,7 @@ static int tg3_open(struct net_device *dev) | |||
6073 | 6073 | ||
6074 | err = tg3_init_hw(tp); | 6074 | err = tg3_init_hw(tp); |
6075 | if (err) { | 6075 | if (err) { |
6076 | tg3_halt(tp, 1); | 6076 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
6077 | tg3_free_rings(tp); | 6077 | tg3_free_rings(tp); |
6078 | } else { | 6078 | } else { |
6079 | if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) | 6079 | if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) |
@@ -6117,7 +6117,7 @@ static int tg3_open(struct net_device *dev) | |||
6117 | pci_disable_msi(tp->pdev); | 6117 | pci_disable_msi(tp->pdev); |
6118 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; | 6118 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; |
6119 | } | 6119 | } |
6120 | tg3_halt(tp, 1); | 6120 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
6121 | tg3_free_rings(tp); | 6121 | tg3_free_rings(tp); |
6122 | tg3_free_consistent(tp); | 6122 | tg3_free_consistent(tp); |
6123 | 6123 | ||
@@ -6390,7 +6390,7 @@ static int tg3_close(struct net_device *dev) | |||
6390 | 6390 | ||
6391 | tg3_disable_ints(tp); | 6391 | tg3_disable_ints(tp); |
6392 | 6392 | ||
6393 | tg3_halt(tp, 1); | 6393 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
6394 | tg3_free_rings(tp); | 6394 | tg3_free_rings(tp); |
6395 | tp->tg3_flags &= | 6395 | tp->tg3_flags &= |
6396 | ~(TG3_FLAG_INIT_COMPLETE | | 6396 | ~(TG3_FLAG_INIT_COMPLETE | |
@@ -7110,7 +7110,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e | |||
7110 | tp->tx_pending = ering->tx_pending; | 7110 | tp->tx_pending = ering->tx_pending; |
7111 | 7111 | ||
7112 | if (netif_running(dev)) { | 7112 | if (netif_running(dev)) { |
7113 | tg3_halt(tp, 1); | 7113 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
7114 | tg3_init_hw(tp); | 7114 | tg3_init_hw(tp); |
7115 | tg3_netif_start(tp); | 7115 | tg3_netif_start(tp); |
7116 | } | 7116 | } |
@@ -7153,7 +7153,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam | |||
7153 | tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE; | 7153 | tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE; |
7154 | 7154 | ||
7155 | if (netif_running(dev)) { | 7155 | if (netif_running(dev)) { |
7156 | tg3_halt(tp, 1); | 7156 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
7157 | tg3_init_hw(tp); | 7157 | tg3_init_hw(tp); |
7158 | tg3_netif_start(tp); | 7158 | tg3_netif_start(tp); |
7159 | } | 7159 | } |
@@ -9586,7 +9586,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
9586 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { | 9586 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { |
9587 | pci_save_state(tp->pdev); | 9587 | pci_save_state(tp->pdev); |
9588 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); | 9588 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); |
9589 | tg3_halt(tp, 1); | 9589 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
9590 | } | 9590 | } |
9591 | 9591 | ||
9592 | err = tg3_test_dma(tp); | 9592 | err = tg3_test_dma(tp); |
@@ -9713,7 +9713,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) | |||
9713 | 9713 | ||
9714 | spin_lock_irq(&tp->lock); | 9714 | spin_lock_irq(&tp->lock); |
9715 | spin_lock(&tp->tx_lock); | 9715 | spin_lock(&tp->tx_lock); |
9716 | tg3_halt(tp, 1); | 9716 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
9717 | spin_unlock(&tp->tx_lock); | 9717 | spin_unlock(&tp->tx_lock); |
9718 | spin_unlock_irq(&tp->lock); | 9718 | spin_unlock_irq(&tp->lock); |
9719 | 9719 | ||