aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-11-24 03:31:47 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-24 14:06:17 -0500
commitd2394e6bb1aa636f3bd142cb6f7845a4332514b5 (patch)
tree3bf7d8f415c2c0dc86c80c1c65cbd6f02e7f6fe6 /drivers/net/tg3.c
parentb75cc0e4c1caac63941d96a73b2214e8007b934b (diff)
tg3: Always turn on APE features in mac_mode reg
The APE needs certain bits in the mac_mode register to be enabled for traffic to flow correctly. This patch changes the code to always enable these bits in the presence of the APE. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-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.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4dc07564e141..2624d714d16e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2728,12 +2728,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
2728 (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))) 2728 (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)))
2729 mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL; 2729 mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL;
2730 2730
2731 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { 2731 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
2732 mac_mode |= tp->mac_mode & 2732 mac_mode |= MAC_MODE_APE_TX_EN |
2733 (MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN); 2733 MAC_MODE_APE_RX_EN |
2734 if (mac_mode & MAC_MODE_APE_TX_EN) 2734 MAC_MODE_TDE_ENABLE;
2735 mac_mode |= MAC_MODE_TDE_ENABLE;
2736 }
2737 2735
2738 tw32_f(MAC_MODE, mac_mode); 2736 tw32_f(MAC_MODE, mac_mode);
2739 udelay(100); 2737 udelay(100);
@@ -7222,19 +7220,21 @@ static int tg3_chip_reset(struct tg3 *tp)
7222 tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl); 7220 tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
7223 } 7221 }
7224 7222
7223 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
7224 tp->mac_mode = MAC_MODE_APE_TX_EN |
7225 MAC_MODE_APE_RX_EN |
7226 MAC_MODE_TDE_ENABLE;
7227
7225 if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) { 7228 if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
7226 tp->mac_mode = MAC_MODE_PORT_MODE_TBI; 7229 tp->mac_mode |= MAC_MODE_PORT_MODE_TBI;
7227 tw32_f(MAC_MODE, tp->mac_mode); 7230 val = tp->mac_mode;
7228 } else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) { 7231 } else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
7229 tp->mac_mode = MAC_MODE_PORT_MODE_GMII; 7232 tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
7230 tw32_f(MAC_MODE, tp->mac_mode); 7233 val = tp->mac_mode;
7231 } else if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
7232 tp->mac_mode &= (MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN);
7233 if (tp->mac_mode & MAC_MODE_APE_TX_EN)
7234 tp->mac_mode |= MAC_MODE_TDE_ENABLE;
7235 tw32_f(MAC_MODE, tp->mac_mode);
7236 } else 7234 } else
7237 tw32_f(MAC_MODE, 0); 7235 val = 0;
7236
7237 tw32_f(MAC_MODE, val);
7238 udelay(40); 7238 udelay(40);
7239 7239
7240 tg3_ape_unlock(tp, TG3_APE_LOCK_GRC); 7240 tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
@@ -8287,7 +8287,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
8287 } 8287 }
8288 8288
8289 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) 8289 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
8290 tp->mac_mode &= MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN; 8290 tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
8291 else 8291 else
8292 tp->mac_mode = 0; 8292 tp->mac_mode = 0;
8293 tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE | 8293 tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
@@ -13729,8 +13729,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
13729 13729
13730 /* Preserve the APE MAC_MODE bits */ 13730 /* Preserve the APE MAC_MODE bits */
13731 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) 13731 if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
13732 tp->mac_mode = tr32(MAC_MODE) | 13732 tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
13733 MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
13734 else 13733 else
13735 tp->mac_mode = TG3_DEF_MAC_MODE; 13734 tp->mac_mode = TG3_DEF_MAC_MODE;
13736 13735