Commit 312c75ae authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: rename nvm ops

All of the nvm ops have the tag _nvm added to the end which is redundant
since all of the calls to the ops have to go through the nvm ops struct
anyway.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8d2a0c2
...@@ -1429,10 +1429,10 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = { ...@@ -1429,10 +1429,10 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = {
}; };
static struct e1000_nvm_operations e1000_nvm_ops_82575 = { static struct e1000_nvm_operations e1000_nvm_ops_82575 = {
.acquire_nvm = igb_acquire_nvm_82575, .acquire = igb_acquire_nvm_82575,
.read_nvm = igb_read_nvm_eerd, .read = igb_read_nvm_eerd,
.release_nvm = igb_release_nvm_82575, .release = igb_release_nvm_82575,
.write_nvm = igb_write_nvm_spi, .write = igb_write_nvm_spi,
}; };
const struct e1000_info e1000_82575_info = { const struct e1000_info e1000_82575_info = {
......
...@@ -437,10 +437,10 @@ struct e1000_phy_operations { ...@@ -437,10 +437,10 @@ struct e1000_phy_operations {
}; };
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 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *); s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
}; };
struct e1000_info { struct e1000_info {
......
...@@ -135,7 +135,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw) ...@@ -135,7 +135,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
u16 offset, nvm_alt_mac_addr_offset, nvm_data; u16 offset, nvm_alt_mac_addr_offset, nvm_data;
u8 alt_mac_addr[ETH_ALEN]; u8 alt_mac_addr[ETH_ALEN];
ret_val = hw->nvm.ops.read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, ret_val = hw->nvm.ops.read(hw, NVM_ALT_MAC_ADDR_PTR, 1,
&nvm_alt_mac_addr_offset); &nvm_alt_mac_addr_offset);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
...@@ -152,7 +152,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw) ...@@ -152,7 +152,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
for (i = 0; i < ETH_ALEN; i += 2) { for (i = 0; i < ETH_ALEN; i += 2) {
offset = nvm_alt_mac_addr_offset + (i >> 1); offset = nvm_alt_mac_addr_offset + (i >> 1);
ret_val = hw->nvm.ops.read_nvm(hw, offset, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
goto out; goto out;
...@@ -575,8 +575,7 @@ static s32 igb_set_default_fc(struct e1000_hw *hw) ...@@ -575,8 +575,7 @@ static s32 igb_set_default_fc(struct e1000_hw *hw)
* control setting, then the variable hw->fc will * control setting, then the variable hw->fc will
* be initialized based on a value in the EEPROM. * be initialized based on a value in the EEPROM.
*/ */
ret_val = hw->nvm.ops.read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
&nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
...@@ -1028,7 +1027,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data) ...@@ -1028,7 +1027,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data)
{ {
s32 ret_val; s32 ret_val;
ret_val = hw->nvm.ops.read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
goto out; goto out;
......
...@@ -419,7 +419,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -419,7 +419,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
goto out; goto out;
} }
ret_val = hw->nvm.ops.acquire_nvm(hw); ret_val = hw->nvm.ops.acquire(hw);
if (ret_val) if (ret_val)
goto out; goto out;
...@@ -468,7 +468,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -468,7 +468,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
msleep(10); msleep(10);
release: release:
hw->nvm.ops.release_nvm(hw); hw->nvm.ops.release(hw);
out: out:
return ret_val; return ret_val;
...@@ -487,14 +487,14 @@ s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num) ...@@ -487,14 +487,14 @@ s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num)
s32 ret_val; s32 ret_val;
u16 nvm_data; u16 nvm_data;
ret_val = hw->nvm.ops.read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
goto out; goto out;
} }
*part_num = (u32)(nvm_data << 16); *part_num = (u32)(nvm_data << 16);
ret_val = hw->nvm.ops.read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
goto out; goto out;
...@@ -548,7 +548,7 @@ s32 igb_validate_nvm_checksum(struct e1000_hw *hw) ...@@ -548,7 +548,7 @@ s32 igb_validate_nvm_checksum(struct e1000_hw *hw)
u16 i, nvm_data; u16 i, nvm_data;
for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
ret_val = hw->nvm.ops.read_nvm(hw, i, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error\n"); hw_dbg("NVM Read Error\n");
goto out; goto out;
...@@ -581,7 +581,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw) ...@@ -581,7 +581,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
u16 i, nvm_data; u16 i, nvm_data;
for (i = 0; i < NVM_CHECKSUM_REG; i++) { for (i = 0; i < NVM_CHECKSUM_REG; i++) {
ret_val = hw->nvm.ops.read_nvm(hw, i, 1, &nvm_data); ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
if (ret_val) { if (ret_val) {
hw_dbg("NVM Read Error while updating checksum.\n"); hw_dbg("NVM Read Error while updating checksum.\n");
goto out; goto out;
...@@ -589,7 +589,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw) ...@@ -589,7 +589,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
checksum += nvm_data; checksum += nvm_data;
} }
checksum = (u16) NVM_SUM - checksum; checksum = (u16) NVM_SUM - checksum;
ret_val = hw->nvm.ops.write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum); ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
if (ret_val) if (ret_val)
hw_dbg("NVM Write Error while updating checksum.\n"); hw_dbg("NVM Write Error while updating checksum.\n");
......
...@@ -593,12 +593,12 @@ static int igb_get_eeprom(struct net_device *netdev, ...@@ -593,12 +593,12 @@ static int igb_get_eeprom(struct net_device *netdev,
return -ENOMEM; return -ENOMEM;
if (hw->nvm.type == e1000_nvm_eeprom_spi) if (hw->nvm.type == e1000_nvm_eeprom_spi)
ret_val = hw->nvm.ops.read_nvm(hw, first_word, ret_val = hw->nvm.ops.read(hw, first_word,
last_word - first_word + 1, last_word - first_word + 1,
eeprom_buff); eeprom_buff);
else { else {
for (i = 0; i < last_word - first_word + 1; i++) { for (i = 0; i < last_word - first_word + 1; i++) {
ret_val = hw->nvm.ops.read_nvm(hw, first_word + i, 1, ret_val = hw->nvm.ops.read(hw, first_word + i, 1,
&eeprom_buff[i]); &eeprom_buff[i]);
if (ret_val) if (ret_val)
break; break;
...@@ -645,14 +645,14 @@ static int igb_set_eeprom(struct net_device *netdev, ...@@ -645,14 +645,14 @@ static int igb_set_eeprom(struct net_device *netdev,
if (eeprom->offset & 1) { if (eeprom->offset & 1) {
/* need read/modify/write of first changed EEPROM word */ /* need read/modify/write of first changed EEPROM word */
/* only the second byte of the word is being modified */ /* only the second byte of the word is being modified */
ret_val = hw->nvm.ops.read_nvm(hw, first_word, 1, ret_val = hw->nvm.ops.read(hw, first_word, 1,
&eeprom_buff[0]); &eeprom_buff[0]);
ptr++; ptr++;
} }
if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) { if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
/* need read/modify/write of last changed EEPROM word */ /* need read/modify/write of last changed EEPROM word */
/* only the first byte of the word is being modified */ /* only the first byte of the word is being modified */
ret_val = hw->nvm.ops.read_nvm(hw, last_word, 1, ret_val = hw->nvm.ops.read(hw, last_word, 1,
&eeprom_buff[last_word - first_word]); &eeprom_buff[last_word - first_word]);
} }
...@@ -665,7 +665,7 @@ static int igb_set_eeprom(struct net_device *netdev, ...@@ -665,7 +665,7 @@ static int igb_set_eeprom(struct net_device *netdev,
for (i = 0; i < last_word - first_word + 1; i++) for (i = 0; i < last_word - first_word + 1; i++)
eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]); eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
ret_val = hw->nvm.ops.write_nvm(hw, first_word, ret_val = hw->nvm.ops.write(hw, first_word,
last_word - first_word + 1, eeprom_buff); last_word - first_word + 1, eeprom_buff);
/* Update the checksum over the first part of the EEPROM if needed /* Update the checksum over the first part of the EEPROM if needed
...@@ -689,7 +689,7 @@ static void igb_get_drvinfo(struct net_device *netdev, ...@@ -689,7 +689,7 @@ static void igb_get_drvinfo(struct net_device *netdev,
/* EEPROM image version # is reported as firmware version # for /* EEPROM image version # is reported as firmware version # for
* 82575 controllers */ * 82575 controllers */
adapter->hw.nvm.ops.read_nvm(&adapter->hw, 5, 1, &eeprom_data); adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data);
sprintf(firmware_version, "%d.%d-%d", sprintf(firmware_version, "%d.%d-%d",
(eeprom_data & 0xF000) >> 12, (eeprom_data & 0xF000) >> 12,
(eeprom_data & 0x0FF0) >> 4, (eeprom_data & 0x0FF0) >> 4,
...@@ -1056,7 +1056,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data) ...@@ -1056,7 +1056,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
*data = 0; *data = 0;
/* Read and add up the contents of the EEPROM */ /* Read and add up the contents of the EEPROM */
for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
if ((adapter->hw.nvm.ops.read_nvm(&adapter->hw, i, 1, &temp)) if ((adapter->hw.nvm.ops.read(&adapter->hw, i, 1, &temp))
< 0) { < 0) {
*data = 1; *data = 1;
break; break;
......
...@@ -1243,8 +1243,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1243,8 +1243,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
if (hw->bus.func == 0 || if (hw->bus.func == 0 ||
hw->device_id == E1000_DEV_ID_82575EB_COPPER) hw->device_id == E1000_DEV_ID_82575EB_COPPER)
hw->nvm.ops.read_nvm(hw, NVM_INIT_CONTROL3_PORT_A, 1, hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
&eeprom_data);
if (eeprom_data & eeprom_apme_mask) if (eeprom_data & eeprom_apme_mask)
adapter->eeprom_wol |= E1000_WUFC_MAG; adapter->eeprom_wol |= E1000_WUFC_MAG;
......
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