aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-03-31 03:23:24 -0400
committerJeff Garzik <jeff@garzik.org>2007-04-03 22:31:09 -0400
commit6d6dabac382604db22ff51c5e0d25af18529ac8b (patch)
tree52a3c0cd002fd3fb7bf30dd488d8d157fee7c1b4 /drivers/net/cxgb3/cxgb3_main.c
parent8ac3ba68e25a73594646ec30b7c482b364644c92 (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/cxgb3_main.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c16
1 files changed, 13 insertions, 3 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++;