diff options
author | Steve Hodgson <shodgson@solarflare.com> | 2009-01-29 12:51:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-30 17:06:31 -0500 |
commit | 67797763c60bfe3bbf99ef81ce1042e71678d109 (patch) | |
tree | 8ced99fe0c240f506ffb7df8b509f839b6316fd5 /drivers/net/sfc | |
parent | 4b988280be13a1b4c17f51cc66948aef467e7601 (diff) |
sfc: Test for PHYXS faults whenever we cannot test link state bits
Depending on the loopback mode, there may be no pertinent link state
bits. In this case we test the PHYXS RX fault bit instead. Make
sure to do this in all cases where there are no link state bits.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/mdio_10g.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index 7f09ab581945..16bc5853d0ea 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -180,17 +180,12 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | |||
180 | return false; | 180 | return false; |
181 | else if (efx_phy_mode_disabled(efx->phy_mode)) | 181 | else if (efx_phy_mode_disabled(efx->phy_mode)) |
182 | return false; | 182 | return false; |
183 | else if (efx->loopback_mode == LOOPBACK_PHYXS) { | 183 | else if (efx->loopback_mode == LOOPBACK_PHYXS) |
184 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS | | 184 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS | |
185 | MDIO_MMDREG_DEVS_PCS | | 185 | MDIO_MMDREG_DEVS_PCS | |
186 | MDIO_MMDREG_DEVS_PMAPMD | | 186 | MDIO_MMDREG_DEVS_PMAPMD | |
187 | MDIO_MMDREG_DEVS_AN); | 187 | MDIO_MMDREG_DEVS_AN); |
188 | if (!mmd_mask) { | 188 | else if (efx->loopback_mode == LOOPBACK_PCS) |
189 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS, | ||
190 | MDIO_PHYXS_STATUS2); | ||
191 | return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN)); | ||
192 | } | ||
193 | } else if (efx->loopback_mode == LOOPBACK_PCS) | ||
194 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS | | 189 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS | |
195 | MDIO_MMDREG_DEVS_PMAPMD | | 190 | MDIO_MMDREG_DEVS_PMAPMD | |
196 | MDIO_MMDREG_DEVS_AN); | 191 | MDIO_MMDREG_DEVS_AN); |
@@ -198,6 +193,13 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | |||
198 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD | | 193 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD | |
199 | MDIO_MMDREG_DEVS_AN); | 194 | MDIO_MMDREG_DEVS_AN); |
200 | 195 | ||
196 | if (!mmd_mask) { | ||
197 | /* Use presence of XGMII faults in leui of link state */ | ||
198 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS, | ||
199 | MDIO_PHYXS_STATUS2); | ||
200 | return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN)); | ||
201 | } | ||
202 | |||
201 | while (mmd_mask) { | 203 | while (mmd_mask) { |
202 | if (mmd_mask & 1) { | 204 | if (mmd_mask & 1) { |
203 | /* Double reads because link state is latched, and a | 205 | /* Double reads because link state is latched, and a |