diff options
author | Steve Hodgson <shodgson@solarflare.com> | 2010-02-03 04:30:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-03 22:12:44 -0500 |
commit | 7a6b8f6f7f74085a1330b0f9765d81bcea8c58b7 (patch) | |
tree | 6358e7e8d94d3475c864c114188df2c6eb4a98ff /drivers | |
parent | 8b2103add08b79abd3ac7015b4bac744c0af534e (diff) |
sfc: Enable autonegotiated flow-control by default if supported
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sfc/falcon.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/mcdi_phy.c | 14 | ||||
-rw-r--r-- | drivers/net/sfc/siena.c | 7 |
3 files changed, 16 insertions, 7 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 9d009c46e962..1e7858511e35 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -909,6 +909,8 @@ static int falcon_probe_port(struct efx_nic *efx) | |||
909 | efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; | 909 | efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; |
910 | else | 910 | else |
911 | efx->wanted_fc = EFX_FC_RX; | 911 | efx->wanted_fc = EFX_FC_RX; |
912 | if (efx->mdio.mmds & MDIO_DEVS_AN) | ||
913 | efx->wanted_fc |= EFX_FC_AUTO; | ||
912 | 914 | ||
913 | /* Allocate buffer for stats */ | 915 | /* Allocate buffer for stats */ |
914 | rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer, | 916 | rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer, |
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c index eb694af7a473..d87e74d3994e 100644 --- a/drivers/net/sfc/mcdi_phy.c +++ b/drivers/net/sfc/mcdi_phy.c | |||
@@ -381,6 +381,18 @@ static int efx_mcdi_phy_probe(struct efx_nic *efx) | |||
381 | * but by convention we don't */ | 381 | * but by convention we don't */ |
382 | efx->loopback_modes &= ~(1 << LOOPBACK_NONE); | 382 | efx->loopback_modes &= ~(1 << LOOPBACK_NONE); |
383 | 383 | ||
384 | /* Set the initial link mode */ | ||
385 | efx_mcdi_phy_decode_link( | ||
386 | efx, &efx->link_state, | ||
387 | MCDI_DWORD(outbuf, GET_LINK_OUT_LINK_SPEED), | ||
388 | MCDI_DWORD(outbuf, GET_LINK_OUT_FLAGS), | ||
389 | MCDI_DWORD(outbuf, GET_LINK_OUT_FCNTL)); | ||
390 | |||
391 | /* Default to Autonegotiated flow control if the PHY supports it */ | ||
392 | efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; | ||
393 | if (phy_data->supported_cap & (1 << MC_CMD_PHY_CAP_AN_LBN)) | ||
394 | efx->wanted_fc |= EFX_FC_AUTO; | ||
395 | |||
384 | return 0; | 396 | return 0; |
385 | 397 | ||
386 | fail: | 398 | fail: |
@@ -436,7 +448,7 @@ void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa) | |||
436 | 448 | ||
437 | /* The link partner capabilities are only relevent if the | 449 | /* The link partner capabilities are only relevent if the |
438 | * link supports flow control autonegotiation */ | 450 | * link supports flow control autonegotiation */ |
439 | if (~phy_cfg->supported_cap & (1 << MC_CMD_PHY_CAP_ASYM_LBN)) | 451 | if (~phy_cfg->supported_cap & (1 << MC_CMD_PHY_CAP_AN_LBN)) |
440 | return; | 452 | return; |
441 | 453 | ||
442 | /* If flow control autoneg is supported and enabled, then fine */ | 454 | /* If flow control autoneg is supported and enabled, then fine */ |
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index 0e4c13abf087..f6a53895ff27 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -106,16 +106,11 @@ static int siena_probe_port(struct efx_nic *efx) | |||
106 | efx->mdio.mdio_read = siena_mdio_read; | 106 | efx->mdio.mdio_read = siena_mdio_read; |
107 | efx->mdio.mdio_write = siena_mdio_write; | 107 | efx->mdio.mdio_write = siena_mdio_write; |
108 | 108 | ||
109 | /* Fill out MDIO structure and loopback modes */ | 109 | /* Fill out MDIO structure, loopback modes, and initial link state */ |
110 | rc = efx->phy_op->probe(efx); | 110 | rc = efx->phy_op->probe(efx); |
111 | if (rc != 0) | 111 | if (rc != 0) |
112 | return rc; | 112 | return rc; |
113 | 113 | ||
114 | /* Initial assumption */ | ||
115 | efx->link_state.speed = 10000; | ||
116 | efx->link_state.fd = true; | ||
117 | efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; | ||
118 | |||
119 | /* Allocate buffer for stats */ | 114 | /* Allocate buffer for stats */ |
120 | rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer, | 115 | rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer, |
121 | MC_CMD_MAC_NSTATS * sizeof(u64)); | 116 | MC_CMD_MAC_NSTATS * sizeof(u64)); |