Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122943
b: refs/heads/master
c: caa8d8b
h: refs/heads/master
i:
  122941: 498a9a4
  122939: 75bc7df
  122935: 4320842
  122927: 2a44151
  122911: ec31b5a
  122879: b3224e7
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Dec 26, 2008
1 parent 3079a54 commit 867cc92
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6977dc6309ea8bbcb24c0a1356c33969e4a07410
refs/heads/master: caa8d8bbddc9157cb8f34465be98fc83faf37155
22 changes: 13 additions & 9 deletions trunk/drivers/net/sfc/mdio_10g.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int mdio_clause45_check_mmds(struct efx_nic *efx,
bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask)
{
int phy_id = efx->mii.phy_id;
int status;
u32 reg;
bool ok = true;
int mmd = 0;

Expand All @@ -179,12 +179,17 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask)
return false;
else if (efx_phy_mode_disabled(efx->phy_mode))
return false;
else if (efx->loopback_mode == LOOPBACK_PHYXS)
else if (efx->loopback_mode == LOOPBACK_PHYXS) {
mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS |
MDIO_MMDREG_DEVS_PCS |
MDIO_MMDREG_DEVS_PMAPMD |
MDIO_MMDREG_DEVS_AN);
else if (efx->loopback_mode == LOOPBACK_PCS)
if (!mmd_mask) {
reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS,
MDIO_PHYXS_STATUS2);
return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN));
}
} else if (efx->loopback_mode == LOOPBACK_PCS)
mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS |
MDIO_MMDREG_DEVS_PMAPMD |
MDIO_MMDREG_DEVS_AN);
Expand All @@ -196,12 +201,11 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask)
if (mmd_mask & 1) {
/* Double reads because link state is latched, and a
* read moves the current state into the register */
status = mdio_clause45_read(efx, phy_id,
mmd, MDIO_MMDREG_STAT1);
status = mdio_clause45_read(efx, phy_id,
mmd, MDIO_MMDREG_STAT1);

ok = ok && (status & (1 << MDIO_MMDREG_STAT1_LINK_LBN));
reg = mdio_clause45_read(efx, phy_id,
mmd, MDIO_MMDREG_STAT1);
reg = mdio_clause45_read(efx, phy_id,
mmd, MDIO_MMDREG_STAT1);
ok = ok && (reg & (1 << MDIO_MMDREG_STAT1_LINK_LBN));
}
mmd_mask = (mmd_mask >> 1);
mmd++;
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/sfc/mdio_10g.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
#define MDIO_PMAPMD_10GBT_TXPWR_SHORT_LBN (0)
#define MDIO_PMAPMD_10GBT_TXPWR_SHORT_WIDTH (1)

/* PHY XGXS Status 2 */
#define MDIO_PHYXS_STATUS2 (8)
#define MDIO_PHYXS_STATUS2_RX_FAULT_LBN 10

/* PHY XGXS lane state */
#define MDIO_PHYXS_LANE_STATE (0x18)
#define MDIO_PHYXS_LANE_ALIGNED_LBN (12)
Expand Down
11 changes: 7 additions & 4 deletions trunk/drivers/net/sfc/tenxpress.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,13 @@ static bool sft9001_link_ok(struct efx_nic *efx, struct ethtool_cmd *ecmd)
int phy_id = efx->mii.phy_id;
u32 reg;

if (efx->loopback_mode == LOOPBACK_GPHY)
return true;
else if (efx_phy_mode_disabled(efx->phy_mode))
if (efx_phy_mode_disabled(efx->phy_mode))
return false;
else if (efx->loopback_mode == LOOPBACK_GPHY)
return true;
else if (efx->loopback_mode)
return mdio_clause45_links_ok(efx,
MDIO_MMDREG_DEVS_PMAPMD |
MDIO_MMDREG_DEVS_PCS |
MDIO_MMDREG_DEVS_PHYXS);

/* We must use the same definition of link state as LASI,
Expand Down Expand Up @@ -588,6 +587,10 @@ static void tenxpress_phy_poll(struct efx_nic *efx)
change = true;
}
sfx7101_check_bad_lp(efx, link_ok);
} else if (efx->loopback_mode) {
bool link_ok = sft9001_link_ok(efx, NULL);
if (link_ok != efx->link_up)
change = true;
} else {
u32 status = mdio_clause45_read(efx, efx->mii.phy_id,
MDIO_MMD_PMAPMD,
Expand Down

0 comments on commit 867cc92

Please sign in to comment.