Commit 94d8186a authored by Bruce Allan's avatar Bruce Allan Committed by David S. Miller

e1000e: cleanup ops function pointers

The phy and nvm operations structures have function pointers that contain
"phy" and "nvm" in the pointer names which are redundant since the
structures are already obviously in phy and nvm structures.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3bb99fe2
...@@ -1671,64 +1671,64 @@ static struct e1000_mac_operations e82571_mac_ops = { ...@@ -1671,64 +1671,64 @@ static struct e1000_mac_operations e82571_mac_ops = {
}; };
static struct e1000_phy_operations e82_phy_ops_igp = { static struct e1000_phy_operations e82_phy_ops_igp = {
.acquire_phy = e1000_get_hw_semaphore_82571, .acquire = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic, .check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = NULL, .commit = NULL,
.force_speed_duplex = e1000e_phy_force_speed_duplex_igp, .force_speed_duplex = e1000e_phy_force_speed_duplex_igp,
.get_cfg_done = e1000_get_cfg_done_82571, .get_cfg_done = e1000_get_cfg_done_82571,
.get_cable_length = e1000e_get_cable_length_igp_2, .get_cable_length = e1000e_get_cable_length_igp_2,
.get_phy_info = e1000e_get_phy_info_igp, .get_info = e1000e_get_phy_info_igp,
.read_phy_reg = e1000e_read_phy_reg_igp, .read_reg = e1000e_read_phy_reg_igp,
.release_phy = e1000_put_hw_semaphore_82571, .release = e1000_put_hw_semaphore_82571,
.reset_phy = e1000e_phy_hw_reset_generic, .reset = e1000e_phy_hw_reset_generic,
.set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
.set_d3_lplu_state = e1000e_set_d3_lplu_state, .set_d3_lplu_state = e1000e_set_d3_lplu_state,
.write_phy_reg = e1000e_write_phy_reg_igp, .write_reg = e1000e_write_phy_reg_igp,
.cfg_on_link_up = NULL, .cfg_on_link_up = NULL,
}; };
static struct e1000_phy_operations e82_phy_ops_m88 = { static struct e1000_phy_operations e82_phy_ops_m88 = {
.acquire_phy = e1000_get_hw_semaphore_82571, .acquire = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic, .check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset, .commit = e1000e_phy_sw_reset,
.force_speed_duplex = e1000e_phy_force_speed_duplex_m88, .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
.get_cfg_done = e1000e_get_cfg_done, .get_cfg_done = e1000e_get_cfg_done,
.get_cable_length = e1000e_get_cable_length_m88, .get_cable_length = e1000e_get_cable_length_m88,
.get_phy_info = e1000e_get_phy_info_m88, .get_info = e1000e_get_phy_info_m88,
.read_phy_reg = e1000e_read_phy_reg_m88, .read_reg = e1000e_read_phy_reg_m88,
.release_phy = e1000_put_hw_semaphore_82571, .release = e1000_put_hw_semaphore_82571,
.reset_phy = e1000e_phy_hw_reset_generic, .reset = e1000e_phy_hw_reset_generic,
.set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
.set_d3_lplu_state = e1000e_set_d3_lplu_state, .set_d3_lplu_state = e1000e_set_d3_lplu_state,
.write_phy_reg = e1000e_write_phy_reg_m88, .write_reg = e1000e_write_phy_reg_m88,
.cfg_on_link_up = NULL, .cfg_on_link_up = NULL,
}; };
static struct e1000_phy_operations e82_phy_ops_bm = { static struct e1000_phy_operations e82_phy_ops_bm = {
.acquire_phy = e1000_get_hw_semaphore_82571, .acquire = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic, .check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset, .commit = e1000e_phy_sw_reset,
.force_speed_duplex = e1000e_phy_force_speed_duplex_m88, .force_speed_duplex = e1000e_phy_force_speed_duplex_m88,
.get_cfg_done = e1000e_get_cfg_done, .get_cfg_done = e1000e_get_cfg_done,
.get_cable_length = e1000e_get_cable_length_m88, .get_cable_length = e1000e_get_cable_length_m88,
.get_phy_info = e1000e_get_phy_info_m88, .get_info = e1000e_get_phy_info_m88,
.read_phy_reg = e1000e_read_phy_reg_bm2, .read_reg = e1000e_read_phy_reg_bm2,
.release_phy = e1000_put_hw_semaphore_82571, .release = e1000_put_hw_semaphore_82571,
.reset_phy = e1000e_phy_hw_reset_generic, .reset = e1000e_phy_hw_reset_generic,
.set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571,
.set_d3_lplu_state = e1000e_set_d3_lplu_state, .set_d3_lplu_state = e1000e_set_d3_lplu_state,
.write_phy_reg = e1000e_write_phy_reg_bm2, .write_reg = e1000e_write_phy_reg_bm2,
.cfg_on_link_up = NULL, .cfg_on_link_up = NULL,
}; };
static struct e1000_nvm_operations e82571_nvm_ops = { static struct e1000_nvm_operations e82571_nvm_ops = {
.acquire_nvm = e1000_acquire_nvm_82571, .acquire = e1000_acquire_nvm_82571,
.read_nvm = e1000e_read_nvm_eerd, .read = e1000e_read_nvm_eerd,
.release_nvm = e1000_release_nvm_82571, .release = e1000_release_nvm_82571,
.update_nvm = e1000_update_nvm_checksum_82571, .update = e1000_update_nvm_checksum_82571,
.valid_led_default = e1000_valid_led_default_82571, .valid_led_default = e1000_valid_led_default_82571,
.validate_nvm = e1000_validate_nvm_checksum_82571, .validate = e1000_validate_nvm_checksum_82571,
.write_nvm = e1000_write_nvm_82571, .write = e1000_write_nvm_82571,
}; };
struct e1000_info e1000_82571_info = { struct e1000_info e1000_82571_info = {
......
...@@ -584,7 +584,7 @@ extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw); ...@@ -584,7 +584,7 @@ extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
{ {
return hw->phy.ops.reset_phy(hw); return hw->phy.ops.reset(hw);
} }
static inline s32 e1000_check_reset_block(struct e1000_hw *hw) static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
...@@ -594,12 +594,12 @@ static inline s32 e1000_check_reset_block(struct e1000_hw *hw) ...@@ -594,12 +594,12 @@ static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data) static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
{ {
return hw->phy.ops.read_phy_reg(hw, offset, data); return hw->phy.ops.read_reg(hw, offset, data);
} }
static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data) static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data)
{ {
return hw->phy.ops.write_phy_reg(hw, offset, data); return hw->phy.ops.write_reg(hw, offset, data);
} }
static inline s32 e1000_get_cable_length(struct e1000_hw *hw) static inline s32 e1000_get_cable_length(struct e1000_hw *hw)
...@@ -619,27 +619,27 @@ extern s32 e1000e_read_mac_addr(struct e1000_hw *hw); ...@@ -619,27 +619,27 @@ extern s32 e1000e_read_mac_addr(struct e1000_hw *hw);
static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw) static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
{ {
return hw->nvm.ops.validate_nvm(hw); return hw->nvm.ops.validate(hw);
} }
static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw) static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw)
{ {
return hw->nvm.ops.update_nvm(hw); return hw->nvm.ops.update(hw);
} }
static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
{ {
return hw->nvm.ops.read_nvm(hw, offset, words, data); return hw->nvm.ops.read(hw, offset, words, data);
} }
static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
{ {
return hw->nvm.ops.write_nvm(hw, offset, words, data); return hw->nvm.ops.write(hw, offset, words, data);
} }
static inline s32 e1000_get_phy_info(struct e1000_hw *hw) static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
{ {
return hw->phy.ops.get_phy_info(hw); return hw->phy.ops.get_info(hw);
} }
static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw) static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw)
......
...@@ -1378,30 +1378,30 @@ static struct e1000_mac_operations es2_mac_ops = { ...@@ -1378,30 +1378,30 @@ static struct e1000_mac_operations es2_mac_ops = {
}; };
static struct e1000_phy_operations es2_phy_ops = { static struct e1000_phy_operations es2_phy_ops = {
.acquire_phy = e1000_acquire_phy_80003es2lan, .acquire = e1000_acquire_phy_80003es2lan,
.check_reset_block = e1000e_check_reset_block_generic, .check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset, .commit = e1000e_phy_sw_reset,
.force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan, .force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan,
.get_cfg_done = e1000_get_cfg_done_80003es2lan, .get_cfg_done = e1000_get_cfg_done_80003es2lan,
.get_cable_length = e1000_get_cable_length_80003es2lan, .get_cable_length = e1000_get_cable_length_80003es2lan,
.get_phy_info = e1000e_get_phy_info_m88, .get_info = e1000e_get_phy_info_m88,
.read_phy_reg = e1000_read_phy_reg_gg82563_80003es2lan, .read_reg = e1000_read_phy_reg_gg82563_80003es2lan,
.release_phy = e1000_release_phy_80003es2lan, .release = e1000_release_phy_80003es2lan,
.reset_phy = e1000e_phy_hw_reset_generic, .reset = e1000e_phy_hw_reset_generic,
.set_d0_lplu_state = NULL, .set_d0_lplu_state = NULL,
.set_d3_lplu_state = e1000e_set_d3_lplu_state, .set_d3_lplu_state = e1000e_set_d3_lplu_state,
.write_phy_reg = e1000_write_phy_reg_gg82563_80003es2lan, .write_reg = e1000_write_phy_reg_gg82563_80003es2lan,
.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan, .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan,
}; };
static struct e1000_nvm_operations es2_nvm_ops = { static struct e1000_nvm_operations es2_nvm_ops = {
.acquire_nvm = e1000_acquire_nvm_80003es2lan, .acquire = e1000_acquire_nvm_80003es2lan,
.read_nvm = e1000e_read_nvm_eerd, .read = e1000e_read_nvm_eerd,
.release_nvm = e1000_release_nvm_80003es2lan, .release = e1000_release_nvm_80003es2lan,
.update_nvm = e1000e_update_nvm_checksum_generic, .update = e1000e_update_nvm_checksum_generic,
.valid_led_default = e1000e_valid_led_default, .valid_led_default = e1000e_valid_led_default,
.validate_nvm = e1000e_validate_nvm_checksum_generic, .validate = e1000e_validate_nvm_checksum_generic,
.write_nvm = e1000_write_nvm_80003es2lan, .write = e1000_write_nvm_80003es2lan,
}; };
struct e1000_info e1000_es2_info = { struct e1000_info e1000_es2_info = {
......
...@@ -755,34 +755,34 @@ struct e1000_mac_operations { ...@@ -755,34 +755,34 @@ struct e1000_mac_operations {
/* Function pointers for the PHY. */ /* Function pointers for the PHY. */
struct e1000_phy_operations { struct e1000_phy_operations {
s32 (*acquire_phy)(struct e1000_hw *); s32 (*acquire)(struct e1000_hw *);
s32 (*cfg_on_link_up)(struct e1000_hw *);
s32 (*check_polarity)(struct e1000_hw *); s32 (*check_polarity)(struct e1000_hw *);
s32 (*check_reset_block)(struct e1000_hw *); s32 (*check_reset_block)(struct e1000_hw *);
s32 (*commit_phy)(struct e1000_hw *); s32 (*commit)(struct e1000_hw *);
s32 (*force_speed_duplex)(struct e1000_hw *); s32 (*force_speed_duplex)(struct e1000_hw *);
s32 (*get_cfg_done)(struct e1000_hw *hw); s32 (*get_cfg_done)(struct e1000_hw *hw);
s32 (*get_cable_length)(struct e1000_hw *); s32 (*get_cable_length)(struct e1000_hw *);
s32 (*get_phy_info)(struct e1000_hw *); s32 (*get_info)(struct e1000_hw *);
s32 (*read_phy_reg)(struct e1000_hw *, u32, u16 *); s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
s32 (*read_phy_reg_locked)(struct e1000_hw *, u32, u16 *); s32 (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
void (*release_phy)(struct e1000_hw *); void (*release)(struct e1000_hw *);
s32 (*reset_phy)(struct e1000_hw *); s32 (*reset)(struct e1000_hw *);
s32 (*set_d0_lplu_state)(struct e1000_hw *, bool); s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
s32 (*set_d3_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);
s32 (*write_phy_reg_locked)(struct e1000_hw *, u32, u16); s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
s32 (*cfg_on_link_up)(struct e1000_hw *);
}; };
/* Function pointers for the NVM. */ /* Function pointers for the NVM. */
struct e1000_nvm_operations { struct e1000_nvm_operations {
s32 (*acquire_nvm)(struct e1000_hw *); s32 (*acquire)(struct e1000_hw *);
s32 (*read_nvm)(struct e1000_hw *, u16, u16, u16 *); s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
void (*release_nvm)(struct e1000_hw *); void (*release)(struct e1000_hw *);
s32 (*update_nvm)(struct e1000_hw *); s32 (*update)(struct e1000_hw *);
s32 (*valid_led_default)(struct e1000_hw *, u16 *); s32 (*valid_led_default)(struct e1000_hw *, u16 *);
s32 (*validate_nvm)(struct e1000_hw *); s32 (*validate)(struct e1000_hw *);
s32 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *); s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
}; };
struct e1000_mac_info { struct e1000_mac_info {
......
This diff is collapsed.
...@@ -1985,7 +1985,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -1985,7 +1985,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
return -E1000_ERR_NVM; return -E1000_ERR_NVM;
} }
ret_val = nvm->ops.acquire_nvm(hw); ret_val = nvm->ops.acquire(hw);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
...@@ -1996,7 +1996,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -1996,7 +1996,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
ret_val = e1000_ready_nvm_eeprom(hw); ret_val = e1000_ready_nvm_eeprom(hw);
if (ret_val) { if (ret_val) {
nvm->ops.release_nvm(hw); nvm->ops.release(hw);
return ret_val; return ret_val;
} }
...@@ -2035,7 +2035,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -2035,7 +2035,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
} }
msleep(10); msleep(10);
nvm->ops.release_nvm(hw); nvm->ops.release(hw);
return 0; return 0;
} }
......
...@@ -4419,7 +4419,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc) ...@@ -4419,7 +4419,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
e1e_wphy(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); e1e_wphy(&adapter->hw, BM_WUC, E1000_WUC_PME_EN);
/* activate PHY wakeup */ /* activate PHY wakeup */
retval = hw->phy.ops.acquire_phy(hw); retval = hw->phy.ops.acquire(hw);
if (retval) { if (retval) {
e_err("Could not acquire PHY\n"); e_err("Could not acquire PHY\n");
return retval; return retval;
...@@ -4436,7 +4436,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc) ...@@ -4436,7 +4436,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
if (retval) if (retval)
e_err("Could not set PHY Host Wakeup bit\n"); e_err("Could not set PHY Host Wakeup bit\n");
out: out:
hw->phy.ops.release_phy(hw); hw->phy.ops.release(hw);
return retval; return retval;
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment