Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134332
b: refs/heads/master
c: a8d2a0c
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Feb 7, 2009
1 parent e1a5ce3 commit 6d6ac9f
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 255 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: 40a70b3889ea50daa10a7f3468920c1f5483155d
refs/heads/master: a8d2a0c27f84bdbf54b7e1c1a52ef7b8b7196dbc
38 changes: 19 additions & 19 deletions trunk/drivers/net/igb/e1000_82575.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)

/* PHY function pointers */
if (igb_sgmii_active_82575(hw)) {
phy->ops.reset_phy = igb_phy_hw_reset_sgmii_82575;
phy->ops.read_phy_reg = igb_read_phy_reg_sgmii_82575;
phy->ops.write_phy_reg = igb_write_phy_reg_sgmii_82575;
phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
} else {
phy->ops.reset_phy = igb_phy_hw_reset;
phy->ops.read_phy_reg = igb_read_phy_reg_igp;
phy->ops.write_phy_reg = igb_write_phy_reg_igp;
phy->ops.reset = igb_phy_hw_reset;
phy->ops.read_reg = igb_read_phy_reg_igp;
phy->ops.write_reg = igb_write_phy_reg_igp;
}

/* Set phy->phy_addr and phy->id. */
Expand Down Expand Up @@ -435,7 +435,7 @@ static s32 igb_phy_hw_reset_sgmii_82575(struct e1000_hw *hw)
* SFP documentation requires the following to configure the SPF module
* to work on SGMII. No further documentation is given.
*/
ret_val = hw->phy.ops.write_phy_reg(hw, 0x1B, 0x8084);
ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084);
if (ret_val)
goto out;

Expand Down Expand Up @@ -464,28 +464,28 @@ static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active)
s32 ret_val;
u16 data;

ret_val = phy->ops.read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
if (ret_val)
goto out;

if (active) {
data |= IGP02E1000_PM_D0_LPLU;
ret_val = phy->ops.write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT,
ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
data);
if (ret_val)
goto out;

/* When LPLU is enabled, we should disable SmartSpeed */
ret_val = phy->ops.read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
&data);
data &= ~IGP01E1000_PSCFR_SMART_SPEED;
ret_val = phy->ops.write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
data);
if (ret_val)
goto out;
} else {
data &= ~IGP02E1000_PM_D0_LPLU;
ret_val = phy->ops.write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT,
ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
data);
/*
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
Expand All @@ -494,24 +494,24 @@ static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active)
* SmartSpeed, so performance is maintained.
*/
if (phy->smart_speed == e1000_smart_speed_on) {
ret_val = phy->ops.read_phy_reg(hw,
ret_val = phy->ops.read_reg(hw,
IGP01E1000_PHY_PORT_CONFIG, &data);
if (ret_val)
goto out;

data |= IGP01E1000_PSCFR_SMART_SPEED;
ret_val = phy->ops.write_phy_reg(hw,
ret_val = phy->ops.write_reg(hw,
IGP01E1000_PHY_PORT_CONFIG, data);
if (ret_val)
goto out;
} else if (phy->smart_speed == e1000_smart_speed_off) {
ret_val = phy->ops.read_phy_reg(hw,
ret_val = phy->ops.read_reg(hw,
IGP01E1000_PHY_PORT_CONFIG, &data);
if (ret_val)
goto out;

data &= ~IGP01E1000_PSCFR_SMART_SPEED;
ret_val = phy->ops.write_phy_reg(hw,
ret_val = phy->ops.write_reg(hw,
IGP01E1000_PHY_PORT_CONFIG, data);
if (ret_val)
goto out;
Expand Down Expand Up @@ -1035,7 +1035,7 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
* depending on user settings.
*/
hw_dbg("Forcing Speed and Duplex\n");
ret_val = igb_phy_force_speed_duplex(hw);
ret_val = hw->phy.ops.force_speed_duplex(hw);
if (ret_val) {
hw_dbg("Error Forcing Speed and Duplex\n");
goto out;
Expand Down Expand Up @@ -1423,9 +1423,9 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
};

static struct e1000_phy_operations e1000_phy_ops_82575 = {
.acquire_phy = igb_acquire_phy_82575,
.acquire = igb_acquire_phy_82575,
.get_cfg_done = igb_get_cfg_done_82575,
.release_phy = igb_release_phy_82575,
.release = igb_release_phy_82575,
};

static struct e1000_nvm_operations e1000_nvm_ops_82575 = {
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/igb/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,18 +422,18 @@ struct e1000_mac_operations {
};

struct e1000_phy_operations {
s32 (*acquire_phy)(struct e1000_hw *);
s32 (*acquire)(struct e1000_hw *);
s32 (*check_reset_block)(struct e1000_hw *);
s32 (*force_speed_duplex)(struct e1000_hw *);
s32 (*get_cfg_done)(struct e1000_hw *hw);
s32 (*get_cable_length)(struct e1000_hw *);
s32 (*get_phy_info)(struct e1000_hw *);
s32 (*read_phy_reg)(struct e1000_hw *, u32, u16 *);
void (*release_phy)(struct e1000_hw *);
s32 (*reset_phy)(struct e1000_hw *);
s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
void (*release)(struct e1000_hw *);
s32 (*reset)(struct e1000_hw *);
s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
s32 (*write_phy_reg)(struct e1000_hw *, u32, u16);
s32 (*write_reg)(struct e1000_hw *, u32, u16);
};

struct e1000_nvm_operations {
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/igb/e1000_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
* has completed. We read this twice because this reg has
* some "sticky" (latched) bits.
*/
ret_val = hw->phy.ops.read_phy_reg(hw, PHY_STATUS,
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
goto out;
ret_val = hw->phy.ops.read_phy_reg(hw, PHY_STATUS,
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
goto out;
Expand All @@ -729,11 +729,11 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
* Page Ability Register (Address 5) to determine how
* flow control was negotiated.
*/
ret_val = hw->phy.ops.read_phy_reg(hw, PHY_AUTONEG_ADV,
ret_val = hw->phy.ops.read_reg(hw, PHY_AUTONEG_ADV,
&mii_nway_adv_reg);
if (ret_val)
goto out;
ret_val = hw->phy.ops.read_phy_reg(hw, PHY_LP_ABILITY,
ret_val = hw->phy.ops.read_reg(hw, PHY_LP_ABILITY,
&mii_nway_lp_ability_reg);
if (ret_val)
goto out;
Expand Down
Loading

0 comments on commit 6d6ac9f

Please sign in to comment.