Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168935
b: refs/heads/master
c: 842ec8b
h: refs/heads/master
i:
  168933: 6aba487
  168931: 1c70cad
  168927: 2f80bb3
v: v3
  • Loading branch information
Bruce Allan authored and David S. Miller committed Nov 20, 2009
1 parent 4f2ebf9 commit 1b26940
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 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: 38eb394e33d65abb9d05411547d2058db53b4d23
refs/heads/master: 842ec8b64ac34e9b245da31b4a5a49c3e744a714
46 changes: 22 additions & 24 deletions trunk/drivers/net/e1000e/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2658,27 +2658,26 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
page = 0;

if (reg > MAX_PHY_MULTI_PAGE_REG) {
if ((hw->phy.type != e1000_phy_82578) ||
((reg != I82578_ADDR_REG) &&
(reg != I82578_ADDR_REG + 1))) {
u32 phy_addr = hw->phy.addr;
u32 phy_addr = hw->phy.addr;

hw->phy.addr = 1;
hw->phy.addr = 1;

/* Page is shifted left, PHY expects (page x 32) */
ret_val = e1000e_write_phy_reg_mdic(hw,
IGP01E1000_PHY_PAGE_SELECT,
(page << IGP_PAGE_SHIFT));
hw->phy.addr = phy_addr;
}
/* Page is shifted left, PHY expects (page x 32) */
ret_val = e1000e_write_phy_reg_mdic(hw,
IGP01E1000_PHY_PAGE_SELECT,
(page << IGP_PAGE_SHIFT));
hw->phy.addr = phy_addr;

if (ret_val)
goto out;
}

ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
data);
out:
/* Revert to MDIO fast mode, if applicable */
if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
ret_val = e1000_set_mdio_slow_mode_hv(hw, false);
ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);

if (!locked)
hw->phy.ops.release_phy(hw);
Expand Down Expand Up @@ -2784,19 +2783,18 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
}

if (reg > MAX_PHY_MULTI_PAGE_REG) {
if ((hw->phy.type != e1000_phy_82578) ||
((reg != I82578_ADDR_REG) &&
(reg != I82578_ADDR_REG + 1))) {
u32 phy_addr = hw->phy.addr;
u32 phy_addr = hw->phy.addr;

hw->phy.addr = 1;
hw->phy.addr = 1;

/* Page is shifted left, PHY expects (page x 32) */
ret_val = e1000e_write_phy_reg_mdic(hw,
IGP01E1000_PHY_PAGE_SELECT,
(page << IGP_PAGE_SHIFT));
hw->phy.addr = phy_addr;
}
/* Page is shifted left, PHY expects (page x 32) */
ret_val = e1000e_write_phy_reg_mdic(hw,
IGP01E1000_PHY_PAGE_SELECT,
(page << IGP_PAGE_SHIFT));
hw->phy.addr = phy_addr;

if (ret_val)
goto out;
}

ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
Expand All @@ -2805,7 +2803,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
out:
/* Revert to MDIO fast mode, if applicable */
if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
ret_val = e1000_set_mdio_slow_mode_hv(hw, false);
ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);

if (!locked)
hw->phy.ops.release_phy(hw);
Expand Down

0 comments on commit 1b26940

Please sign in to comment.