diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-13 00:59:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-13 00:59:24 -0500 |
commit | 766ca0fa6bf1600bdf4bc7726c74f14c8455c6b8 (patch) | |
tree | b1ea2df622753f2493b1053fda21c0db3f18a043 /drivers/net/sfc/falcon_xmac.c | |
parent | 04cc8cacb01c09fba2297faf1477cd570ba43f0b (diff) |
sfc: Rework MAC, PHY and board event handling
From: Steve Hodgson <shodgson@solarflare.com>
MAC, PHY and board events may be separately enabled and signalled.
Our current arrangement of chaining the polling functions can result
in events being missed. Change them to be more independent.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon_xmac.c')
-rw-r--r-- | drivers/net/sfc/falcon_xmac.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c index 0ce8f015386c..5a03713685ac 100644 --- a/drivers/net/sfc/falcon_xmac.c +++ b/drivers/net/sfc/falcon_xmac.c | |||
@@ -342,33 +342,35 @@ static void falcon_update_stats_xmac(struct efx_nic *efx) | |||
342 | mac_stats->rx_control * 64); | 342 | mac_stats->rx_control * 64); |
343 | } | 343 | } |
344 | 344 | ||
345 | static int falcon_check_xmac(struct efx_nic *efx) | 345 | static void falcon_xmac_irq(struct efx_nic *efx) |
346 | { | 346 | { |
347 | bool xaui_link_ok; | 347 | /* The XGMII link has a transient fault, which indicates either: |
348 | int rc; | 348 | * - there's a transient xgmii fault |
349 | * - falcon's end of the xaui link may need a kick | ||
350 | * - the wire-side link may have gone down, but the lasi/poll() | ||
351 | * hasn't noticed yet. | ||
352 | * | ||
353 | * We only want to even bother polling XAUI if we're confident it's | ||
354 | * not (1) or (3). In both cases, the only reliable way to spot this | ||
355 | * is to wait a bit. We do this here by forcing the mac link state | ||
356 | * to down, and waiting for the mac poll to come round and check | ||
357 | */ | ||
358 | efx->mac_up = false; | ||
359 | } | ||
349 | 360 | ||
350 | if ((efx->loopback_mode == LOOPBACK_NETWORK) || | 361 | static void falcon_poll_xmac(struct efx_nic *efx) |
351 | efx_phy_mode_disabled(efx->phy_mode)) | 362 | { |
352 | return 0; | 363 | if (!EFX_WORKAROUND_5147(efx) || !efx->link_up || efx->mac_up) |
364 | return; | ||
353 | 365 | ||
354 | falcon_mask_status_intr(efx, false); | 366 | falcon_mask_status_intr(efx, false); |
355 | xaui_link_ok = falcon_xaui_link_ok(efx); | 367 | falcon_check_xaui_link_up(efx, 1); |
356 | 368 | falcon_mask_status_intr(efx, true); | |
357 | if (EFX_WORKAROUND_5147(efx) && !xaui_link_ok) | ||
358 | falcon_reset_xaui(efx); | ||
359 | |||
360 | /* Call the PHY check_hw routine */ | ||
361 | rc = efx->phy_op->check_hw(efx); | ||
362 | |||
363 | /* Unmask interrupt if everything was (and still is) ok */ | ||
364 | if (xaui_link_ok && efx->link_up) | ||
365 | falcon_mask_status_intr(efx, true); | ||
366 | |||
367 | return rc; | ||
368 | } | 369 | } |
369 | 370 | ||
370 | struct efx_mac_operations falcon_xmac_operations = { | 371 | struct efx_mac_operations falcon_xmac_operations = { |
371 | .reconfigure = falcon_reconfigure_xmac, | 372 | .reconfigure = falcon_reconfigure_xmac, |
372 | .update_stats = falcon_update_stats_xmac, | 373 | .update_stats = falcon_update_stats_xmac, |
373 | .check_hw = falcon_check_xmac, | 374 | .irq = falcon_xmac_irq, |
375 | .poll = falcon_poll_xmac, | ||
374 | }; | 376 | }; |