aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-03-31 00:23:24 -0700
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 145b67cc1d2..512daf73894 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,
int speed, int duplex, int pause)
{
struct net_device *dev = adapter->port[port_id];
+ struct port_info *pi = netdev_priv(dev);
+ struct cmac *mac = &pi->mac;
/* Skip changes from disabled ports. */
if (!netif_running(dev))
return;
if (link_stat != netif_carrier_ok(dev)) {
- if (link_stat)
+ if (link_stat) {
+ t3_set_reg_field(adapter,
+ A_XGM_TXFIFO_CFG + mac->offset,
+ F_ENDROPPKT, 0);
netif_carrier_on(dev);
- else
+ } else {
netif_carrier_off(dev);
+ t3_set_reg_field(adapter,
+ A_XGM_TXFIFO_CFG + mac->offset,
+ F_ENDROPPKT, F_ENDROPPKT);
+ }
+
link_report(dev);
}
}
@@ -2119,7 +2129,7 @@ static void check_t3b2_mac(struct adapter *adapter)
continue;
status = 0;
- if (netif_running(dev))
+ if (netif_running(dev) && netif_carrier_ok(dev))
status = t3b2_mac_watchdog_task(&p->mac);
if (status == 1)
p->mac.stats.num_toggled++;