diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-03-31 03:23:24 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-03 22:31:09 -0400 |
commit | 6d6dabac382604db22ff51c5e0d25af18529ac8b (patch) | |
tree | 52a3c0cd002fd3fb7bf30dd488d8d157fee7c1b4 /drivers/net/cxgb3 | |
parent | 8ac3ba68e25a73594646ec30b7c482b364644c92 (diff) |
cxgb3 - Tighten xgmac workaround
Run the watchdog task when the link is up.
Flush the XGMAC Tx FIFO when the link drops.
Also remove a statistics update that should have gone
in the previous modification of xgmac.c.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 16 | ||||
-rw-r--r-- | drivers/net/cxgb3/regs.h | 4 | ||||
-rw-r--r-- | drivers/net/cxgb3/xgmac.c | 1 |
3 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 145b67cc1d2e..512daf738948 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -185,16 +185,26 @@ void t3_os_link_changed(struct adapter *adapter, int port_id, int link_stat, | |||
185 | int speed, int duplex, int pause) | 185 | int speed, int duplex, int pause) |
186 | { | 186 | { |
187 | struct net_device *dev = adapter->port[port_id]; | 187 | struct net_device *dev = adapter->port[port_id]; |
188 | struct port_info *pi = netdev_priv(dev); | ||
189 | struct cmac *mac = &pi->mac; | ||
188 | 190 | ||
189 | /* Skip changes from disabled ports. */ | 191 | /* Skip changes from disabled ports. */ |
190 | if (!netif_running(dev)) | 192 | if (!netif_running(dev)) |
191 | return; | 193 | return; |
192 | 194 | ||
193 | if (link_stat != netif_carrier_ok(dev)) { | 195 | if (link_stat != netif_carrier_ok(dev)) { |
194 | if (link_stat) | 196 | if (link_stat) { |
197 | t3_set_reg_field(adapter, | ||
198 | A_XGM_TXFIFO_CFG + mac->offset, | ||
199 | F_ENDROPPKT, 0); | ||
195 | netif_carrier_on(dev); | 200 | netif_carrier_on(dev); |
196 | else | 201 | } else { |
197 | netif_carrier_off(dev); | 202 | netif_carrier_off(dev); |
203 | t3_set_reg_field(adapter, | ||
204 | A_XGM_TXFIFO_CFG + mac->offset, | ||
205 | F_ENDROPPKT, F_ENDROPPKT); | ||
206 | } | ||
207 | |||
198 | link_report(dev); | 208 | link_report(dev); |
199 | } | 209 | } |
200 | } | 210 | } |
@@ -2119,7 +2129,7 @@ static void check_t3b2_mac(struct adapter *adapter) | |||
2119 | continue; | 2129 | continue; |
2120 | 2130 | ||
2121 | status = 0; | 2131 | status = 0; |
2122 | if (netif_running(dev)) | 2132 | if (netif_running(dev) && netif_carrier_ok(dev)) |
2123 | status = t3b2_mac_watchdog_task(&p->mac); | 2133 | status = t3b2_mac_watchdog_task(&p->mac); |
2124 | if (status == 1) | 2134 | if (status == 1) |
2125 | p->mac.stats.num_toggled++; | 2135 | p->mac.stats.num_toggled++; |
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h index b38629a244d0..f8be41c5a081 100644 --- a/drivers/net/cxgb3/regs.h +++ b/drivers/net/cxgb3/regs.h | |||
@@ -1940,6 +1940,10 @@ | |||
1940 | 1940 | ||
1941 | #define V_TXFIFOTHRESH(x) ((x) << S_TXFIFOTHRESH) | 1941 | #define V_TXFIFOTHRESH(x) ((x) << S_TXFIFOTHRESH) |
1942 | 1942 | ||
1943 | #define S_ENDROPPKT 21 | ||
1944 | #define V_ENDROPPKT(x) ((x) << S_ENDROPPKT) | ||
1945 | #define F_ENDROPPKT V_ENDROPPKT(1U) | ||
1946 | |||
1943 | #define A_XGM_SERDES_CTRL 0x890 | 1947 | #define A_XGM_SERDES_CTRL 0x890 |
1944 | #define A_XGM_SERDES_CTRL0 0x8e0 | 1948 | #define A_XGM_SERDES_CTRL0 0x8e0 |
1945 | 1949 | ||
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 2b42c13ba8e0..94aaff005a35 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c | |||
@@ -471,7 +471,6 @@ const struct mac_stats *t3_mac_update_stats(struct cmac *mac) | |||
471 | RMON_UPDATE(mac, rx_symbol_errs, RX_SYM_CODE_ERR_FRAMES); | 471 | RMON_UPDATE(mac, rx_symbol_errs, RX_SYM_CODE_ERR_FRAMES); |
472 | 472 | ||
473 | RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES); | 473 | RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES); |
474 | mac->stats.rx_too_long += RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); | ||
475 | 474 | ||
476 | v = RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); | 475 | v = RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); |
477 | if (mac->adapter->params.rev == T3_REV_B2) | 476 | if (mac->adapter->params.rev == T3_REV_B2) |