Skip to contentSkip to conversation

cxgb3 - MAC watchdog update

PATCH In review [email protected] 1 participant 1 message Apr 10, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 cxgb3 - MAC watchdog update

From: Divy Le Ray <[email protected]>

The MAC watchdog was failing if the peer interface was brought down.

---

 drivers/net/cxgb3/common.h     |    7 ++-
 drivers/net/cxgb3/cxgb3_main.c |   10 +---
 drivers/net/cxgb3/xgmac.c      |  107 ++++++++++++++++++++++++++++++----------
 3 files changed, 89 insertions(+), 35 deletions(-)
drivers/net/cxgb3/common.h +5 -2
index 97128d8..8d13796 100644
@@ -478,8 +478,11 @@ struct cmac {
 	struct adapter *adapter;
 	unsigned int offset;
 	unsigned int nucast;	/* # of address filters for unicast MACs */
-	unsigned int tcnt;
-	unsigned int xcnt;
+	unsigned int tx_tcnt;
+	unsigned int tx_xcnt;
+	u64 tx_mcnt;
+	unsigned int rx_xcnt;
+	u64 rx_mcnt;
 	unsigned int toggle_cnt;
 	unsigned int txen;
 	struct mac_stats stats;
drivers/net/cxgb3/cxgb3_main.c +4 -6
index c6ebe25..d6eb982 100644
@@ -194,15 +194,13 @@ void t3_os_link_changed(struct adapter *
 
 	if (link_stat != netif_carrier_ok(dev)) {
 		if (link_stat) {
-			t3_set_reg_field(adapter,
-					 A_XGM_TXFIFO_CFG + mac->offset,
-					 F_ENDROPPKT, 0);
+			t3_mac_enable(mac, MAC_DIRECTION_RX);
 			netif_carrier_on(dev);
 		} else {
 			netif_carrier_off(dev);
-			t3_set_reg_field(adapter,
-					 A_XGM_TXFIFO_CFG + mac->offset,
-					 F_ENDROPPKT, F_ENDROPPKT);
+			pi->phy.ops->power_down(&pi->phy, 1);
+			t3_mac_disable(mac, MAC_DIRECTION_RX);
+			t3_link_start(&pi->phy, mac, &pi->link_config);
 		}
 
 		link_report(dev);
drivers/net/cxgb3/xgmac.c +80 -27

147 lines not on this page · raw message