diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2012-02-13 10:20:06 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-13 15:57:31 -0500 |
commit | 9a21fb8fc3a74429a4eee2d53df5a3167c290f2a (patch) | |
tree | e0b98ec9a22efeac943f46412c2d8beb075f24bc /drivers/net/ethernet/broadcom/tg3.c | |
parent | ebf3312e781aee1bc22bb3a42cb324eb973a7c02 (diff) | |
download | blackbird-op-linux-9a21fb8fc3a74429a4eee2d53df5a3167c290f2a.tar.gz blackbird-op-linux-9a21fb8fc3a74429a4eee2d53df5a3167c290f2a.zip |
tg3: Relocate tg3_reset_task
This patch moves tg3_reset_task further down in the file where it makes
more sense to be.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 92 |
1 files changed, 45 insertions, 47 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index a352c44d31ec..3ab1af67d7d9 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -6303,53 +6303,6 @@ static void tg3_poll_controller(struct net_device *dev) } #endif -static int tg3_init_hw(struct tg3 *, int); -static int tg3_halt(struct tg3 *, int, int); - -static void tg3_reset_task(struct work_struct *work) -{ - struct tg3 *tp = container_of(work, struct tg3, reset_task); - int err; - - tg3_full_lock(tp, 0); - - if (!netif_running(tp->dev)) { - tg3_flag_clear(tp, RESET_TASK_PENDING); - tg3_full_unlock(tp); - return; - } - - tg3_full_unlock(tp); - - tg3_phy_stop(tp); - - tg3_netif_stop(tp); - - tg3_full_lock(tp, 1); - - if (tg3_flag(tp, TX_RECOVERY_PENDING)) { - tp->write32_tx_mbox = tg3_write32_tx_mbox; - tp->write32_rx_mbox = tg3_write_flush_reg32; - tg3_flag_set(tp, MBOX_WRITE_REORDER); - tg3_flag_clear(tp, TX_RECOVERY_PENDING); - } - - tg3_halt(tp, RESET_KIND_SHUTDOWN, 0); - err = tg3_init_hw(tp, 1); - if (err) - goto out; - - tg3_netif_start(tp); - -out: - tg3_full_unlock(tp); - - if (!err) - tg3_phy_start(tp); - - tg3_flag_clear(tp, RESET_TASK_PENDING); -} - static void tg3_tx_timeout(struct net_device *dev) { struct tg3 *tp = netdev_priv(dev); @@ -6991,6 +6944,7 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp, } static int tg3_restart_hw(struct tg3 *tp, int reset_phy); +static int tg3_halt(struct tg3 *, int, int); static int tg3_change_mtu(struct net_device *dev, int new_mtu) { @@ -9137,6 +9091,50 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy) return err; } +static void tg3_reset_task(struct work_struct *work) +{ + struct tg3 *tp = container_of(work, struct tg3, reset_task); + int err; + + tg3_full_lock(tp, 0); + + if (!netif_running(tp->dev)) { + tg3_flag_clear(tp, RESET_TASK_PENDING); + tg3_full_unlock(tp); + return; + } + + tg3_full_unlock(tp); + + tg3_phy_stop(tp); + + tg3_netif_stop(tp); + + tg3_full_lock(tp, 1); + + if (tg3_flag(tp, TX_RECOVERY_PENDING)) { + tp->write32_tx_mbox = tg3_write32_tx_mbox; + tp->write32_rx_mbox = tg3_write_flush_reg32; + tg3_flag_set(tp, MBOX_WRITE_REORDER); + tg3_flag_clear(tp, TX_RECOVERY_PENDING); + } + + tg3_halt(tp, RESET_KIND_SHUTDOWN, 0); + err = tg3_init_hw(tp, 1); + if (err) + goto out; + + tg3_netif_start(tp); + +out: + tg3_full_unlock(tp); + + if (!err) + tg3_phy_start(tp); + + tg3_flag_clear(tp, RESET_TASK_PENDING); +} + #define TG3_STAT_ADD32(PSTAT, REG) \ do { u32 __val = tr32(REG); \ (PSTAT)->low += __val; \ |