aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/igb/e1000_82575.c8
-rw-r--r--drivers/net/igb/e1000_hw.h8
-rw-r--r--drivers/net/igb/e1000_mac.c9
-rw-r--r--drivers/net/igb/e1000_nvm.c14
-rw-r--r--drivers/net/igb/igb_ethtool.c14
-rw-r--r--drivers/net/igb/igb_main.c3
6 files changed, 27 insertions, 29 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 9a66e345729e..527d4c8e53fc 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1429,10 +1429,10 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = {
1429}; 1429};
1430 1430
1431static struct e1000_nvm_operations e1000_nvm_ops_82575 = { 1431static struct e1000_nvm_operations e1000_nvm_ops_82575 = {
1432 .acquire_nvm = igb_acquire_nvm_82575, 1432 .acquire = igb_acquire_nvm_82575,
1433 .read_nvm = igb_read_nvm_eerd, 1433 .read = igb_read_nvm_eerd,
1434 .release_nvm = igb_release_nvm_82575, 1434 .release = igb_release_nvm_82575,
1435 .write_nvm = igb_write_nvm_spi, 1435 .write = igb_write_nvm_spi,
1436}; 1436};
1437 1437
1438const struct e1000_info e1000_82575_info = { 1438const struct e1000_info e1000_82575_info = {
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 5acb8497cd64..acb42a21e95c 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -437,10 +437,10 @@ struct e1000_phy_operations {
437}; 437};
438 438
439struct e1000_nvm_operations { 439struct e1000_nvm_operations {
440 s32 (*acquire_nvm)(struct e1000_hw *); 440 s32 (*acquire)(struct e1000_hw *);
441 s32 (*read_nvm)(struct e1000_hw *, u16, u16, u16 *); 441 s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
442 void (*release_nvm)(struct e1000_hw *); 442 void (*release)(struct e1000_hw *);
443 s32 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *); 443 s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
444}; 444};
445 445
446struct e1000_info { 446struct e1000_info {
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index d0b695cf956c..6682206750dc 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -135,7 +135,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
135 u16 offset, nvm_alt_mac_addr_offset, nvm_data; 135 u16 offset, nvm_alt_mac_addr_offset, nvm_data;
136 u8 alt_mac_addr[ETH_ALEN]; 136 u8 alt_mac_addr[ETH_ALEN];
137 137
138 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, 138 ret_val = hw->nvm.ops.read(hw, NVM_ALT_MAC_ADDR_PTR, 1,
139 &nvm_alt_mac_addr_offset); 139 &nvm_alt_mac_addr_offset);
140 if (ret_val) { 140 if (ret_val) {
141 hw_dbg("NVM Read Error\n"); 141 hw_dbg("NVM Read Error\n");
@@ -152,7 +152,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
152 152
153 for (i = 0; i < ETH_ALEN; i += 2) { 153 for (i = 0; i < ETH_ALEN; i += 2) {
154 offset = nvm_alt_mac_addr_offset + (i >> 1); 154 offset = nvm_alt_mac_addr_offset + (i >> 1);
155 ret_val = hw->nvm.ops.read_nvm(hw, offset, 1, &nvm_data); 155 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
156 if (ret_val) { 156 if (ret_val) {
157 hw_dbg("NVM Read Error\n"); 157 hw_dbg("NVM Read Error\n");
158 goto out; 158 goto out;
@@ -575,8 +575,7 @@ static s32 igb_set_default_fc(struct e1000_hw *hw)
575 * control setting, then the variable hw->fc will 575 * control setting, then the variable hw->fc will
576 * be initialized based on a value in the EEPROM. 576 * be initialized based on a value in the EEPROM.
577 */ 577 */
578 ret_val = hw->nvm.ops.read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, 578 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
579 &nvm_data);
580 579
581 if (ret_val) { 580 if (ret_val) {
582 hw_dbg("NVM Read Error\n"); 581 hw_dbg("NVM Read Error\n");
@@ -1028,7 +1027,7 @@ static s32 igb_valid_led_default(struct e1000_hw *hw, u16 *data)
1028{ 1027{
1029 s32 ret_val; 1028 s32 ret_val;
1030 1029
1031 ret_val = hw->nvm.ops.read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data); 1030 ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
1032 if (ret_val) { 1031 if (ret_val) {
1033 hw_dbg("NVM Read Error\n"); 1032 hw_dbg("NVM Read Error\n");
1034 goto out; 1033 goto out;
diff --git a/drivers/net/igb/e1000_nvm.c b/drivers/net/igb/e1000_nvm.c
index 5942da107a9c..337986422086 100644
--- a/drivers/net/igb/e1000_nvm.c
+++ b/drivers/net/igb/e1000_nvm.c
@@ -419,7 +419,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
419 goto out; 419 goto out;
420 } 420 }
421 421
422 ret_val = hw->nvm.ops.acquire_nvm(hw); 422 ret_val = hw->nvm.ops.acquire(hw);
423 if (ret_val) 423 if (ret_val)
424 goto out; 424 goto out;
425 425
@@ -468,7 +468,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
468 468
469 msleep(10); 469 msleep(10);
470release: 470release:
471 hw->nvm.ops.release_nvm(hw); 471 hw->nvm.ops.release(hw);
472 472
473out: 473out:
474 return ret_val; 474 return ret_val;
@@ -487,14 +487,14 @@ s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num)
487 s32 ret_val; 487 s32 ret_val;
488 u16 nvm_data; 488 u16 nvm_data;
489 489
490 ret_val = hw->nvm.ops.read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); 490 ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
491 if (ret_val) { 491 if (ret_val) {
492 hw_dbg("NVM Read Error\n"); 492 hw_dbg("NVM Read Error\n");
493 goto out; 493 goto out;
494 } 494 }
495 *part_num = (u32)(nvm_data << 16); 495 *part_num = (u32)(nvm_data << 16);
496 496
497 ret_val = hw->nvm.ops.read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); 497 ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
498 if (ret_val) { 498 if (ret_val) {
499 hw_dbg("NVM Read Error\n"); 499 hw_dbg("NVM Read Error\n");
500 goto out; 500 goto out;
@@ -548,7 +548,7 @@ s32 igb_validate_nvm_checksum(struct e1000_hw *hw)
548 u16 i, nvm_data; 548 u16 i, nvm_data;
549 549
550 for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { 550 for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
551 ret_val = hw->nvm.ops.read_nvm(hw, i, 1, &nvm_data); 551 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
552 if (ret_val) { 552 if (ret_val) {
553 hw_dbg("NVM Read Error\n"); 553 hw_dbg("NVM Read Error\n");
554 goto out; 554 goto out;
@@ -581,7 +581,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
581 u16 i, nvm_data; 581 u16 i, nvm_data;
582 582
583 for (i = 0; i < NVM_CHECKSUM_REG; i++) { 583 for (i = 0; i < NVM_CHECKSUM_REG; i++) {
584 ret_val = hw->nvm.ops.read_nvm(hw, i, 1, &nvm_data); 584 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
585 if (ret_val) { 585 if (ret_val) {
586 hw_dbg("NVM Read Error while updating checksum.\n"); 586 hw_dbg("NVM Read Error while updating checksum.\n");
587 goto out; 587 goto out;
@@ -589,7 +589,7 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
589 checksum += nvm_data; 589 checksum += nvm_data;
590 } 590 }
591 checksum = (u16) NVM_SUM - checksum; 591 checksum = (u16) NVM_SUM - checksum;
592 ret_val = hw->nvm.ops.write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum); 592 ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
593 if (ret_val) 593 if (ret_val)
594 hw_dbg("NVM Write Error while updating checksum.\n"); 594 hw_dbg("NVM Write Error while updating checksum.\n");
595 595
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 4606e63fc6f5..a5bf8ef2848a 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -593,12 +593,12 @@ static int igb_get_eeprom(struct net_device *netdev,
593 return -ENOMEM; 593 return -ENOMEM;
594 594
595 if (hw->nvm.type == e1000_nvm_eeprom_spi) 595 if (hw->nvm.type == e1000_nvm_eeprom_spi)
596 ret_val = hw->nvm.ops.read_nvm(hw, first_word, 596 ret_val = hw->nvm.ops.read(hw, first_word,
597 last_word - first_word + 1, 597 last_word - first_word + 1,
598 eeprom_buff); 598 eeprom_buff);
599 else { 599 else {
600 for (i = 0; i < last_word - first_word + 1; i++) { 600 for (i = 0; i < last_word - first_word + 1; i++) {
601 ret_val = hw->nvm.ops.read_nvm(hw, first_word + i, 1, 601 ret_val = hw->nvm.ops.read(hw, first_word + i, 1,
602 &eeprom_buff[i]); 602 &eeprom_buff[i]);
603 if (ret_val) 603 if (ret_val)
604 break; 604 break;
@@ -645,14 +645,14 @@ static int igb_set_eeprom(struct net_device *netdev,
645 if (eeprom->offset & 1) { 645 if (eeprom->offset & 1) {
646 /* need read/modify/write of first changed EEPROM word */ 646 /* need read/modify/write of first changed EEPROM word */
647 /* only the second byte of the word is being modified */ 647 /* only the second byte of the word is being modified */
648 ret_val = hw->nvm.ops.read_nvm(hw, first_word, 1, 648 ret_val = hw->nvm.ops.read(hw, first_word, 1,
649 &eeprom_buff[0]); 649 &eeprom_buff[0]);
650 ptr++; 650 ptr++;
651 } 651 }
652 if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) { 652 if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
653 /* need read/modify/write of last changed EEPROM word */ 653 /* need read/modify/write of last changed EEPROM word */
654 /* only the first byte of the word is being modified */ 654 /* only the first byte of the word is being modified */
655 ret_val = hw->nvm.ops.read_nvm(hw, last_word, 1, 655 ret_val = hw->nvm.ops.read(hw, last_word, 1,
656 &eeprom_buff[last_word - first_word]); 656 &eeprom_buff[last_word - first_word]);
657 } 657 }
658 658
@@ -665,7 +665,7 @@ static int igb_set_eeprom(struct net_device *netdev,
665 for (i = 0; i < last_word - first_word + 1; i++) 665 for (i = 0; i < last_word - first_word + 1; i++)
666 eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]); 666 eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
667 667
668 ret_val = hw->nvm.ops.write_nvm(hw, first_word, 668 ret_val = hw->nvm.ops.write(hw, first_word,
669 last_word - first_word + 1, eeprom_buff); 669 last_word - first_word + 1, eeprom_buff);
670 670
671 /* Update the checksum over the first part of the EEPROM if needed 671 /* 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 689
690 /* EEPROM image version # is reported as firmware version # for 690 /* EEPROM image version # is reported as firmware version # for
691 * 82575 controllers */ 691 * 82575 controllers */
692 adapter->hw.nvm.ops.read_nvm(&adapter->hw, 5, 1, &eeprom_data); 692 adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data);
693 sprintf(firmware_version, "%d.%d-%d", 693 sprintf(firmware_version, "%d.%d-%d",
694 (eeprom_data & 0xF000) >> 12, 694 (eeprom_data & 0xF000) >> 12,
695 (eeprom_data & 0x0FF0) >> 4, 695 (eeprom_data & 0x0FF0) >> 4,
@@ -1056,7 +1056,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
1056 *data = 0; 1056 *data = 0;
1057 /* Read and add up the contents of the EEPROM */ 1057 /* Read and add up the contents of the EEPROM */
1058 for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) { 1058 for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
1059 if ((adapter->hw.nvm.ops.read_nvm(&adapter->hw, i, 1, &temp)) 1059 if ((adapter->hw.nvm.ops.read(&adapter->hw, i, 1, &temp))
1060 < 0) { 1060 < 0) {
1061 *data = 1; 1061 *data = 1;
1062 break; 1062 break;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index cb3ac349f3b3..e3a3582fec90 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1243,8 +1243,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1243 1243
1244 if (hw->bus.func == 0 || 1244 if (hw->bus.func == 0 ||
1245 hw->device_id == E1000_DEV_ID_82575EB_COPPER) 1245 hw->device_id == E1000_DEV_ID_82575EB_COPPER)
1246 hw->nvm.ops.read_nvm(hw, NVM_INIT_CONTROL3_PORT_A, 1, 1246 hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
1247 &eeprom_data);
1248 1247
1249 if (eeprom_data & eeprom_apme_mask) 1248 if (eeprom_data & eeprom_apme_mask)
1250 adapter->eeprom_wol |= E1000_WUFC_MAG; 1249 adapter->eeprom_wol |= E1000_WUFC_MAG;