diff options
author | Divy Le Ray <divy@chelsio.com> | 2009-03-12 17:14:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-13 14:30:47 -0400 |
commit | bf792094ef830117312b3990b63474320ec864c0 (patch) | |
tree | db47894a787ec8eee78b34c500661fd17231229f /drivers/net/cxgb3/xgmac.c | |
parent | cd40658a616050df0a50d0a3ded06e3ebcc0a04a (diff) |
cxgb3: detect mac link faults.
The driver currently ignores the local or remote link faults
raised at the mac layer. This patch fixes it.
Our mac however only advertizes link events, so wait for the
phy to stabilize the link, then enable mac link events interrupts.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/xgmac.c')
-rw-r--r-- | drivers/net/cxgb3/xgmac.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 4bd0901a97a6..f87f9435049f 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c | |||
@@ -218,6 +218,9 @@ static int t3b2_mac_reset(struct cmac *mac) | |||
218 | /* re-enable nic traffic */ | 218 | /* re-enable nic traffic */ |
219 | t3_set_reg_field(adap, A_MPS_CFG, F_ENFORCEPKT, 1); | 219 | t3_set_reg_field(adap, A_MPS_CFG, F_ENFORCEPKT, 1); |
220 | 220 | ||
221 | /* Set: re-enable NIC traffic */ | ||
222 | t3_set_reg_field(adap, A_MPS_CFG, F_ENFORCEPKT, 1); | ||
223 | |||
221 | return 0; | 224 | return 0; |
222 | } | 225 | } |
223 | 226 | ||
@@ -258,7 +261,7 @@ int t3_mac_set_num_ucast(struct cmac *mac, int n) | |||
258 | return 0; | 261 | return 0; |
259 | } | 262 | } |
260 | 263 | ||
261 | static void disable_exact_filters(struct cmac *mac) | 264 | void t3_mac_disable_exact_filters(struct cmac *mac) |
262 | { | 265 | { |
263 | unsigned int i, reg = mac->offset + A_XGM_RX_EXACT_MATCH_LOW_1; | 266 | unsigned int i, reg = mac->offset + A_XGM_RX_EXACT_MATCH_LOW_1; |
264 | 267 | ||
@@ -269,7 +272,7 @@ static void disable_exact_filters(struct cmac *mac) | |||
269 | t3_read_reg(mac->adapter, A_XGM_RX_EXACT_MATCH_LOW_1); /* flush */ | 272 | t3_read_reg(mac->adapter, A_XGM_RX_EXACT_MATCH_LOW_1); /* flush */ |
270 | } | 273 | } |
271 | 274 | ||
272 | static void enable_exact_filters(struct cmac *mac) | 275 | void t3_mac_enable_exact_filters(struct cmac *mac) |
273 | { | 276 | { |
274 | unsigned int i, reg = mac->offset + A_XGM_RX_EXACT_MATCH_HIGH_1; | 277 | unsigned int i, reg = mac->offset + A_XGM_RX_EXACT_MATCH_HIGH_1; |
275 | 278 | ||
@@ -356,7 +359,7 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) | |||
356 | 359 | ||
357 | if (adap->params.rev >= T3_REV_B2 && | 360 | if (adap->params.rev >= T3_REV_B2 && |
358 | (t3_read_reg(adap, A_XGM_RX_CTRL + mac->offset) & F_RXEN)) { | 361 | (t3_read_reg(adap, A_XGM_RX_CTRL + mac->offset) & F_RXEN)) { |
359 | disable_exact_filters(mac); | 362 | t3_mac_disable_exact_filters(mac); |
360 | v = t3_read_reg(adap, A_XGM_RX_CFG + mac->offset); | 363 | v = t3_read_reg(adap, A_XGM_RX_CFG + mac->offset); |
361 | t3_set_reg_field(adap, A_XGM_RX_CFG + mac->offset, | 364 | t3_set_reg_field(adap, A_XGM_RX_CFG + mac->offset, |
362 | F_ENHASHMCAST | F_COPYALLFRAMES, F_DISBCAST); | 365 | F_ENHASHMCAST | F_COPYALLFRAMES, F_DISBCAST); |
@@ -368,14 +371,14 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) | |||
368 | if (t3_wait_op_done(adap, reg + mac->offset, | 371 | if (t3_wait_op_done(adap, reg + mac->offset, |
369 | F_RXFIFO_EMPTY, 1, 20, 5)) { | 372 | F_RXFIFO_EMPTY, 1, 20, 5)) { |
370 | t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v); | 373 | t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v); |
371 | enable_exact_filters(mac); | 374 | t3_mac_enable_exact_filters(mac); |
372 | return -EIO; | 375 | return -EIO; |
373 | } | 376 | } |
374 | t3_set_reg_field(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, | 377 | t3_set_reg_field(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, |
375 | V_RXMAXPKTSIZE(M_RXMAXPKTSIZE), | 378 | V_RXMAXPKTSIZE(M_RXMAXPKTSIZE), |
376 | V_RXMAXPKTSIZE(mtu)); | 379 | V_RXMAXPKTSIZE(mtu)); |
377 | t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v); | 380 | t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v); |
378 | enable_exact_filters(mac); | 381 | t3_mac_enable_exact_filters(mac); |
379 | } else | 382 | } else |
380 | t3_set_reg_field(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, | 383 | t3_set_reg_field(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, |
381 | V_RXMAXPKTSIZE(M_RXMAXPKTSIZE), | 384 | V_RXMAXPKTSIZE(M_RXMAXPKTSIZE), |