aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/intel/e1000e/80003es2lan.c12
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c10
-rw-r--r--drivers/net/ethernet/intel/e1000e/e1000.h18
-rw-r--r--drivers/net/ethernet/intel/e1000e/ethtool.c6
-rw-r--r--drivers/net/ethernet/intel/e1000e/hw.h2
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c32
-rw-r--r--drivers/net/ethernet/intel/e1000e/mac.c31
-rw-r--r--drivers/net/ethernet/intel/e1000e/manage.c4
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c8
-rw-r--r--drivers/net/ethernet/intel/e1000e/nvm.c4
-rw-r--r--drivers/net/ethernet/intel/e1000e/phy.c6
11 files changed, 66 insertions, 67 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 1f8f8524d863..bac9dda31b6c 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -820,7 +820,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
820 e1000_initialize_hw_bits_80003es2lan(hw); 820 e1000_initialize_hw_bits_80003es2lan(hw);
821 821
822 /* Initialize identification LED */ 822 /* Initialize identification LED */
823 ret_val = e1000e_id_led_init(hw); 823 ret_val = mac->ops.id_led_init(hw);
824 if (ret_val) 824 if (ret_val)
825 e_dbg("Error initializing identification LED\n"); 825 e_dbg("Error initializing identification LED\n");
826 /* This is not fatal and we should not stop init due to this */ 826 /* This is not fatal and we should not stop init due to this */
@@ -838,7 +838,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
838 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); 838 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
839 839
840 /* Setup link and flow control */ 840 /* Setup link and flow control */
841 ret_val = e1000e_setup_link(hw); 841 ret_val = mac->ops.setup_link(hw);
842 842
843 /* Disable IBIST slave mode (far-end loopback) */ 843 /* Disable IBIST slave mode (far-end loopback) */
844 e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, 844 e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
@@ -1056,7 +1056,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
1056 * firmware will have already initialized them. We only initialize 1056 * firmware will have already initialized them. We only initialize
1057 * them if the HW is not in IAMT mode. 1057 * them if the HW is not in IAMT mode.
1058 */ 1058 */
1059 if (!e1000e_check_mng_mode(hw)) { 1059 if (!hw->mac.ops.check_mng_mode(hw)) {
1060 /* Enable Electrical Idle on the PHY */ 1060 /* Enable Electrical Idle on the PHY */
1061 data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; 1061 data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
1062 ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data); 1062 ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
@@ -1413,7 +1413,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
1413 1413
1414static const struct e1000_mac_operations es2_mac_ops = { 1414static const struct e1000_mac_operations es2_mac_ops = {
1415 .read_mac_addr = e1000_read_mac_addr_80003es2lan, 1415 .read_mac_addr = e1000_read_mac_addr_80003es2lan,
1416 .id_led_init = e1000e_id_led_init, 1416 .id_led_init = e1000e_id_led_init_generic,
1417 .blink_led = e1000e_blink_led_generic, 1417 .blink_led = e1000e_blink_led_generic,
1418 .check_mng_mode = e1000e_check_mng_mode_generic, 1418 .check_mng_mode = e1000e_check_mng_mode_generic,
1419 /* check_for_link dependent on media type */ 1419 /* check_for_link dependent on media type */
@@ -1429,9 +1429,10 @@ static const struct e1000_mac_operations es2_mac_ops = {
1429 .clear_vfta = e1000_clear_vfta_generic, 1429 .clear_vfta = e1000_clear_vfta_generic,
1430 .reset_hw = e1000_reset_hw_80003es2lan, 1430 .reset_hw = e1000_reset_hw_80003es2lan,
1431 .init_hw = e1000_init_hw_80003es2lan, 1431 .init_hw = e1000_init_hw_80003es2lan,
1432 .setup_link = e1000e_setup_link, 1432 .setup_link = e1000e_setup_link_generic,
1433 /* setup_physical_interface dependent on media type */ 1433 /* setup_physical_interface dependent on media type */
1434 .setup_led = e1000e_setup_led_generic, 1434 .setup_led = e1000e_setup_led_generic,
1435 .config_collision_dist = e1000e_config_collision_dist_generic,
1435}; 1436};
1436 1437
1437static const struct e1000_phy_operations es2_phy_ops = { 1438static const struct e1000_phy_operations es2_phy_ops = {
@@ -1456,6 +1457,7 @@ static const struct e1000_nvm_operations es2_nvm_ops = {
1456 .acquire = e1000_acquire_nvm_80003es2lan, 1457 .acquire = e1000_acquire_nvm_80003es2lan,
1457 .read = e1000e_read_nvm_eerd, 1458 .read = e1000e_read_nvm_eerd,
1458 .release = e1000_release_nvm_80003es2lan, 1459 .release = e1000_release_nvm_80003es2lan,
1460 .reload = e1000e_reload_nvm_generic,
1459 .update = e1000e_update_nvm_checksum_generic, 1461 .update = e1000e_update_nvm_checksum_generic,
1460 .valid_led_default = e1000e_valid_led_default, 1462 .valid_led_default = e1000e_valid_led_default,
1461 .validate = e1000e_validate_nvm_checksum_generic, 1463 .validate = e1000e_validate_nvm_checksum_generic,
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index b6b7bc4c33aa..086dad709179 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1118,7 +1118,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
1118 e1000_initialize_hw_bits_82571(hw); 1118 e1000_initialize_hw_bits_82571(hw);
1119 1119
1120 /* Initialize identification LED */ 1120 /* Initialize identification LED */
1121 ret_val = e1000e_id_led_init(hw); 1121 ret_val = mac->ops.id_led_init(hw);
1122 if (ret_val) 1122 if (ret_val)
1123 e_dbg("Error initializing identification LED\n"); 1123 e_dbg("Error initializing identification LED\n");
1124 /* This is not fatal and we should not stop init due to this */ 1124 /* This is not fatal and we should not stop init due to this */
@@ -1143,7 +1143,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
1143 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); 1143 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
1144 1144
1145 /* Setup link and flow control */ 1145 /* Setup link and flow control */
1146 ret_val = e1000_setup_link_82571(hw); 1146 ret_val = mac->ops.setup_link(hw);
1147 1147
1148 /* Set the transmit descriptor write-back policy */ 1148 /* Set the transmit descriptor write-back policy */
1149 reg_data = er32(TXDCTL(0)); 1149 reg_data = er32(TXDCTL(0));
@@ -1455,7 +1455,7 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
1455 break; 1455 break;
1456 } 1456 }
1457 1457
1458 return e1000e_setup_link(hw); 1458 return e1000e_setup_link_generic(hw);
1459} 1459}
1460 1460
1461/** 1461/**
@@ -1911,7 +1911,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
1911static const struct e1000_mac_operations e82571_mac_ops = { 1911static const struct e1000_mac_operations e82571_mac_ops = {
1912 /* .check_mng_mode: mac type dependent */ 1912 /* .check_mng_mode: mac type dependent */
1913 /* .check_for_link: media type dependent */ 1913 /* .check_for_link: media type dependent */
1914 .id_led_init = e1000e_id_led_init, 1914 .id_led_init = e1000e_id_led_init_generic,
1915 .cleanup_led = e1000e_cleanup_led_generic, 1915 .cleanup_led = e1000e_cleanup_led_generic,
1916 .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, 1916 .clear_hw_cntrs = e1000_clear_hw_cntrs_82571,
1917 .get_bus_info = e1000e_get_bus_info_pcie, 1917 .get_bus_info = e1000e_get_bus_info_pcie,
@@ -1927,6 +1927,7 @@ static const struct e1000_mac_operations e82571_mac_ops = {
1927 .setup_link = e1000_setup_link_82571, 1927 .setup_link = e1000_setup_link_82571,
1928 /* .setup_physical_interface: media type dependent */ 1928 /* .setup_physical_interface: media type dependent */
1929 .setup_led = e1000e_setup_led_generic, 1929 .setup_led = e1000e_setup_led_generic,
1930 .config_collision_dist = e1000e_config_collision_dist_generic,
1930 .read_mac_addr = e1000_read_mac_addr_82571, 1931 .read_mac_addr = e1000_read_mac_addr_82571,
1931}; 1932};
1932 1933
@@ -1988,6 +1989,7 @@ static const struct e1000_nvm_operations e82571_nvm_ops = {
1988 .acquire = e1000_acquire_nvm_82571, 1989 .acquire = e1000_acquire_nvm_82571,
1989 .read = e1000e_read_nvm_eerd, 1990 .read = e1000e_read_nvm_eerd,
1990 .release = e1000_release_nvm_82571, 1991 .release = e1000_release_nvm_82571,
1992 .reload = e1000e_reload_nvm_generic,
1991 .update = e1000_update_nvm_checksum_82571, 1993 .update = e1000_update_nvm_checksum_82571,
1992 .valid_led_default = e1000_valid_led_default_82571, 1994 .valid_led_default = e1000_valid_led_default_82571,
1993 .validate = e1000_validate_nvm_checksum_82571, 1995 .validate = e1000_validate_nvm_checksum_82571,
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 04a21fcb827e..86cdd4793992 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -559,12 +559,12 @@ extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u
559extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex); 559extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
560extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw); 560extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
561extern s32 e1000e_get_auto_rd_done(struct e1000_hw *hw); 561extern s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
562extern s32 e1000e_id_led_init(struct e1000_hw *hw); 562extern s32 e1000e_id_led_init_generic(struct e1000_hw *hw);
563extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw); 563extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
564extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw); 564extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
565extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw); 565extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
566extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw); 566extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
567extern s32 e1000e_setup_link(struct e1000_hw *hw); 567extern s32 e1000e_setup_link_generic(struct e1000_hw *hw);
568extern void e1000_clear_vfta_generic(struct e1000_hw *hw); 568extern void e1000_clear_vfta_generic(struct e1000_hw *hw);
569extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count); 569extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
570extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, 570extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
@@ -575,7 +575,7 @@ extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
575extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop); 575extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
576extern s32 e1000e_get_hw_semaphore(struct e1000_hw *hw); 576extern s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
577extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data); 577extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
578extern void e1000e_config_collision_dist(struct e1000_hw *hw); 578extern void e1000e_config_collision_dist_generic(struct e1000_hw *hw);
579extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); 579extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
580extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); 580extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
581extern s32 e1000e_blink_led_generic(struct e1000_hw *hw); 581extern s32 e1000e_blink_led_generic(struct e1000_hw *hw);
@@ -662,11 +662,6 @@ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
662 return hw->phy.ops.reset(hw); 662 return hw->phy.ops.reset(hw);
663} 663}
664 664
665static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
666{
667 return hw->phy.ops.check_reset_block(hw);
668}
669
670static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data) 665static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
671{ 666{
672 return hw->phy.ops.read_reg(hw, offset, data); 667 return hw->phy.ops.read_reg(hw, offset, data);
@@ -689,7 +684,7 @@ extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
689extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); 684extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
690extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw); 685extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
691extern void e1000e_release_nvm(struct e1000_hw *hw); 686extern void e1000e_release_nvm(struct e1000_hw *hw);
692extern void e1000e_reload_nvm(struct e1000_hw *hw); 687extern void e1000e_reload_nvm_generic(struct e1000_hw *hw);
693extern s32 e1000_read_mac_addr_generic(struct e1000_hw *hw); 688extern s32 e1000_read_mac_addr_generic(struct e1000_hw *hw);
694 689
695static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw) 690static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw)
@@ -725,11 +720,6 @@ static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
725 return hw->phy.ops.get_info(hw); 720 return hw->phy.ops.get_info(hw);
726} 721}
727 722
728static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw)
729{
730 return hw->mac.ops.check_mng_mode(hw);
731}
732
733extern bool e1000e_check_mng_mode_generic(struct e1000_hw *hw); 723extern bool e1000e_check_mng_mode_generic(struct e1000_hw *hw);
734extern bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw); 724extern bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
735extern s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length); 725extern s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index b1f5d7491b57..db35dd5d96de 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -258,7 +258,7 @@ static int e1000_set_settings(struct net_device *netdev,
258 * When SoL/IDER sessions are active, autoneg/speed/duplex 258 * When SoL/IDER sessions are active, autoneg/speed/duplex
259 * cannot be changed 259 * cannot be changed
260 */ 260 */
261 if (e1000_check_reset_block(hw)) { 261 if (hw->phy.ops.check_reset_block(hw)) {
262 e_err("Cannot change link characteristics when SoL/IDER is " 262 e_err("Cannot change link characteristics when SoL/IDER is "
263 "active.\n"); 263 "active.\n");
264 return -EINVAL; 264 return -EINVAL;
@@ -1598,11 +1598,13 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
1598 1598
1599static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) 1599static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
1600{ 1600{
1601 struct e1000_hw *hw = &adapter->hw;
1602
1601 /* 1603 /*
1602 * PHY loopback cannot be performed if SoL/IDER 1604 * PHY loopback cannot be performed if SoL/IDER
1603 * sessions are active 1605 * sessions are active
1604 */ 1606 */
1605 if (e1000_check_reset_block(&adapter->hw)) { 1607 if (hw->phy.ops.check_reset_block(hw)) {
1606 e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); 1608 e_err("Cannot do PHY loopback test when SoL/IDER is active.\n");
1607 *data = 0; 1609 *data = 0;
1608 goto out; 1610 goto out;
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index 197059bb9abf..f82ecf536c8b 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -781,6 +781,7 @@ struct e1000_mac_operations {
781 s32 (*setup_physical_interface)(struct e1000_hw *); 781 s32 (*setup_physical_interface)(struct e1000_hw *);
782 s32 (*setup_led)(struct e1000_hw *); 782 s32 (*setup_led)(struct e1000_hw *);
783 void (*write_vfta)(struct e1000_hw *, u32, u32); 783 void (*write_vfta)(struct e1000_hw *, u32, u32);
784 void (*config_collision_dist)(struct e1000_hw *);
784 s32 (*read_mac_addr)(struct e1000_hw *); 785 s32 (*read_mac_addr)(struct e1000_hw *);
785}; 786};
786 787
@@ -829,6 +830,7 @@ struct e1000_nvm_operations {
829 s32 (*acquire)(struct e1000_hw *); 830 s32 (*acquire)(struct e1000_hw *);
830 s32 (*read)(struct e1000_hw *, u16, u16, u16 *); 831 s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
831 void (*release)(struct e1000_hw *); 832 void (*release)(struct e1000_hw *);
833 void (*reload)(struct e1000_hw *);
832 s32 (*update)(struct e1000_hw *); 834 s32 (*update)(struct e1000_hw *);
833 s32 (*valid_led_default)(struct e1000_hw *, u16 *); 835 s32 (*valid_led_default)(struct e1000_hw *, u16 *);
834 s32 (*validate)(struct e1000_hw *); 836 s32 (*validate)(struct e1000_hw *);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index f3282dc5588e..8e9af624d54a 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -324,7 +324,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
324 phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; 324 phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
325 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; 325 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
326 326
327 if (!e1000_check_reset_block(hw)) { 327 if (!hw->phy.ops.check_reset_block(hw)) {
328 u32 fwsm = er32(FWSM); 328 u32 fwsm = er32(FWSM);
329 329
330 /* 330 /*
@@ -580,7 +580,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
580 /* check management mode */ 580 /* check management mode */
581 mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan; 581 mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan;
582 /* ID LED init */ 582 /* ID LED init */
583 mac->ops.id_led_init = e1000e_id_led_init; 583 mac->ops.id_led_init = e1000e_id_led_init_generic;
584 /* blink LED */ 584 /* blink LED */
585 mac->ops.blink_led = e1000e_blink_led_generic; 585 mac->ops.blink_led = e1000e_blink_led_generic;
586 /* setup LED */ 586 /* setup LED */
@@ -746,7 +746,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
746 * of MAC speed/duplex configuration. So we only need to 746 * of MAC speed/duplex configuration. So we only need to
747 * configure Collision Distance in the MAC. 747 * configure Collision Distance in the MAC.
748 */ 748 */
749 e1000e_config_collision_dist(hw); 749 mac->ops.config_collision_dist(hw);
750 750
751 /* 751 /*
752 * Configure Flow Control now that Auto-Neg has completed. 752 * Configure Flow Control now that Auto-Neg has completed.
@@ -1314,7 +1314,7 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
1314 oem_reg |= HV_OEM_BITS_LPLU; 1314 oem_reg |= HV_OEM_BITS_LPLU;
1315 1315
1316 /* Set Restart auto-neg to activate the bits */ 1316 /* Set Restart auto-neg to activate the bits */
1317 if (!e1000_check_reset_block(hw)) 1317 if (!hw->phy.ops.check_reset_block(hw))
1318 oem_reg |= HV_OEM_BITS_RESTART_AN; 1318 oem_reg |= HV_OEM_BITS_RESTART_AN;
1319 } else { 1319 } else {
1320 if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | 1320 if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE |
@@ -1788,7 +1788,7 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
1788 s32 ret_val = 0; 1788 s32 ret_val = 0;
1789 u16 reg; 1789 u16 reg;
1790 1790
1791 if (e1000_check_reset_block(hw)) 1791 if (hw->phy.ops.check_reset_block(hw))
1792 return 0; 1792 return 0;
1793 1793
1794 /* Allow time for h/w to get to quiescent state after reset */ 1794 /* Allow time for h/w to get to quiescent state after reset */
@@ -1897,7 +1897,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active)
1897 else 1897 else
1898 oem_reg &= ~HV_OEM_BITS_LPLU; 1898 oem_reg &= ~HV_OEM_BITS_LPLU;
1899 1899
1900 if (!e1000_check_reset_block(hw)) 1900 if (!hw->phy.ops.check_reset_block(hw))
1901 oem_reg |= HV_OEM_BITS_RESTART_AN; 1901 oem_reg |= HV_OEM_BITS_RESTART_AN;
1902 1902
1903 return e1e_wphy(hw, HV_OEM_BITS, oem_reg); 1903 return e1e_wphy(hw, HV_OEM_BITS, oem_reg);
@@ -2609,7 +2609,7 @@ release:
2609 * until after the next adapter reset. 2609 * until after the next adapter reset.
2610 */ 2610 */
2611 if (!ret_val) { 2611 if (!ret_val) {
2612 e1000e_reload_nvm(hw); 2612 nvm->ops.reload(hw);
2613 usleep_range(10000, 20000); 2613 usleep_range(10000, 20000);
2614 } 2614 }
2615 2615
@@ -2962,7 +2962,7 @@ static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)
2962 * 2962 *
2963 * PCH also does not have an "always on" or "always off" mode which 2963 * PCH also does not have an "always on" or "always off" mode which
2964 * complicates the ID feature. Instead of using the "on" mode to indicate 2964 * complicates the ID feature. Instead of using the "on" mode to indicate
2965 * in ledctl_mode2 the LEDs to use for ID (see e1000e_id_led_init()), 2965 * in ledctl_mode2 the LEDs to use for ID (see e1000e_id_led_init_generic()),
2966 * use "link_up" mode. The LEDs will still ID on request if there is no 2966 * use "link_up" mode. The LEDs will still ID on request if there is no
2967 * link based on logic in e1000_led_[on|off]_pchlan(). 2967 * link based on logic in e1000_led_[on|off]_pchlan().
2968 **/ 2968 **/
@@ -3109,7 +3109,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
3109 3109
3110 ctrl = er32(CTRL); 3110 ctrl = er32(CTRL);
3111 3111
3112 if (!e1000_check_reset_block(hw)) { 3112 if (!hw->phy.ops.check_reset_block(hw)) {
3113 /* 3113 /*
3114 * Full-chip reset requires MAC and PHY reset at the same 3114 * Full-chip reset requires MAC and PHY reset at the same
3115 * time to make sure the interface between MAC and the 3115 * time to make sure the interface between MAC and the
@@ -3212,7 +3212,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
3212 } 3212 }
3213 3213
3214 /* Setup link and flow control */ 3214 /* Setup link and flow control */
3215 ret_val = e1000_setup_link_ich8lan(hw); 3215 ret_val = mac->ops.setup_link(hw);
3216 3216
3217 /* Set the transmit descriptor write-back policy for both queues */ 3217 /* Set the transmit descriptor write-back policy for both queues */
3218 txdctl = er32(TXDCTL(0)); 3218 txdctl = er32(TXDCTL(0));
@@ -3327,7 +3327,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
3327{ 3327{
3328 s32 ret_val; 3328 s32 ret_val;
3329 3329
3330 if (e1000_check_reset_block(hw)) 3330 if (hw->phy.ops.check_reset_block(hw))
3331 return 0; 3331 return 0;
3332 3332
3333 /* 3333 /*
@@ -3353,7 +3353,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
3353 hw->fc.current_mode); 3353 hw->fc.current_mode);
3354 3354
3355 /* Continue to configure the copper link. */ 3355 /* Continue to configure the copper link. */
3356 ret_val = e1000_setup_copper_link_ich8lan(hw); 3356 ret_val = hw->mac.ops.setup_physical_interface(hw);
3357 if (ret_val) 3357 if (ret_val)
3358 return ret_val; 3358 return ret_val;
3359 3359
@@ -3555,7 +3555,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
3555} 3555}
3556 3556
3557/** 3557/**
3558 * e1000_set_kmrn_lock_loss_workaround_ich8lan - Set Kumeran workaround state 3558 * e1000e_set_kmrn_lock_loss_workaround_ich8lan - Set Kumeran workaround state
3559 * @hw: pointer to the HW structure 3559 * @hw: pointer to the HW structure
3560 * @state: boolean value used to set the current Kumeran workaround state 3560 * @state: boolean value used to set the current Kumeran workaround state
3561 * 3561 *
@@ -3707,7 +3707,8 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
3707 u16 phy_id1, phy_id2; 3707 u16 phy_id1, phy_id2;
3708 s32 ret_val; 3708 s32 ret_val;
3709 3709
3710 if ((hw->mac.type != e1000_pch2lan) || e1000_check_reset_block(hw)) 3710 if ((hw->mac.type != e1000_pch2lan) ||
3711 hw->phy.ops.check_reset_block(hw))
3711 return; 3712 return;
3712 3713
3713 ret_val = hw->phy.ops.acquire(hw); 3714 ret_val = hw->phy.ops.acquire(hw);
@@ -4006,7 +4007,6 @@ release:
4006} 4007}
4007 4008
4008static const struct e1000_mac_operations ich8_mac_ops = { 4009static const struct e1000_mac_operations ich8_mac_ops = {
4009 .id_led_init = e1000e_id_led_init,
4010 /* check_mng_mode dependent on mac type */ 4010 /* check_mng_mode dependent on mac type */
4011 .check_for_link = e1000_check_for_copper_link_ich8lan, 4011 .check_for_link = e1000_check_for_copper_link_ich8lan,
4012 /* cleanup_led dependent on mac type */ 4012 /* cleanup_led dependent on mac type */
@@ -4022,6 +4022,7 @@ static const struct e1000_mac_operations ich8_mac_ops = {
4022 .setup_link = e1000_setup_link_ich8lan, 4022 .setup_link = e1000_setup_link_ich8lan,
4023 .setup_physical_interface= e1000_setup_copper_link_ich8lan, 4023 .setup_physical_interface= e1000_setup_copper_link_ich8lan,
4024 /* id_led_init dependent on mac type */ 4024 /* id_led_init dependent on mac type */
4025 .config_collision_dist = e1000e_config_collision_dist_generic,
4025}; 4026};
4026 4027
4027static const struct e1000_phy_operations ich8_phy_ops = { 4028static const struct e1000_phy_operations ich8_phy_ops = {
@@ -4042,6 +4043,7 @@ static const struct e1000_nvm_operations ich8_nvm_ops = {
4042 .acquire = e1000_acquire_nvm_ich8lan, 4043 .acquire = e1000_acquire_nvm_ich8lan,
4043 .read = e1000_read_nvm_ich8lan, 4044 .read = e1000_read_nvm_ich8lan,
4044 .release = e1000_release_nvm_ich8lan, 4045 .release = e1000_release_nvm_ich8lan,
4046 .reload = e1000e_reload_nvm_generic,
4045 .update = e1000_update_nvm_checksum_ich8lan, 4047 .update = e1000_update_nvm_checksum_ich8lan,
4046 .valid_led_default = e1000_valid_led_default_ich8lan, 4048 .valid_led_default = e1000_valid_led_default_ich8lan,
4047 .validate = e1000_validate_nvm_checksum_ich8lan, 4049 .validate = e1000_validate_nvm_checksum_ich8lan,
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 17991e63083d..59ac9f6353de 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -263,8 +263,7 @@ void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
263 * @mc_addr: pointer to a multicast address 263 * @mc_addr: pointer to a multicast address
264 * 264 *
265 * Generates a multicast address hash value which is used to determine 265 * Generates a multicast address hash value which is used to determine
266 * the multicast filter table array address and new table value. See 266 * the multicast filter table array address and new table value.
267 * e1000_mta_set_generic()
268 **/ 267 **/
269static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) 268static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
270{ 269{
@@ -465,7 +464,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
465 * of MAC speed/duplex configuration. So we only need to 464 * of MAC speed/duplex configuration. So we only need to
466 * configure Collision Distance in the MAC. 465 * configure Collision Distance in the MAC.
467 */ 466 */
468 e1000e_config_collision_dist(hw); 467 mac->ops.config_collision_dist(hw);
469 468
470 /* 469 /*
471 * Configure Flow Control now that Auto-Neg has completed. 470 * Configure Flow Control now that Auto-Neg has completed.
@@ -693,7 +692,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
693} 692}
694 693
695/** 694/**
696 * e1000e_setup_link - Setup flow control and link settings 695 * e1000e_setup_link_generic - Setup flow control and link settings
697 * @hw: pointer to the HW structure 696 * @hw: pointer to the HW structure
698 * 697 *
699 * Determines which flow control settings to use, then configures flow 698 * Determines which flow control settings to use, then configures flow
@@ -702,16 +701,15 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
702 * should be established. Assumes the hardware has previously been reset 701 * should be established. Assumes the hardware has previously been reset
703 * and the transmitter and receiver are not enabled. 702 * and the transmitter and receiver are not enabled.
704 **/ 703 **/
705s32 e1000e_setup_link(struct e1000_hw *hw) 704s32 e1000e_setup_link_generic(struct e1000_hw *hw)
706{ 705{
707 struct e1000_mac_info *mac = &hw->mac;
708 s32 ret_val; 706 s32 ret_val;
709 707
710 /* 708 /*
711 * In the case of the phy reset being blocked, we already have a link. 709 * In the case of the phy reset being blocked, we already have a link.
712 * We do not need to set it up again. 710 * We do not need to set it up again.
713 */ 711 */
714 if (e1000_check_reset_block(hw)) 712 if (hw->phy.ops.check_reset_block(hw))
715 return 0; 713 return 0;
716 714
717 /* 715 /*
@@ -733,7 +731,7 @@ s32 e1000e_setup_link(struct e1000_hw *hw)
733 e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode); 731 e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode);
734 732
735 /* Call the necessary media_type subroutine to configure the link. */ 733 /* Call the necessary media_type subroutine to configure the link. */
736 ret_val = mac->ops.setup_physical_interface(hw); 734 ret_val = hw->mac.ops.setup_physical_interface(hw);
737 if (ret_val) 735 if (ret_val)
738 return ret_val; 736 return ret_val;
739 737
@@ -890,7 +888,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
890 /* Take the link out of reset */ 888 /* Take the link out of reset */
891 ctrl &= ~E1000_CTRL_LRST; 889 ctrl &= ~E1000_CTRL_LRST;
892 890
893 e1000e_config_collision_dist(hw); 891 hw->mac.ops.config_collision_dist(hw);
894 892
895 ret_val = e1000_commit_fc_settings_generic(hw); 893 ret_val = e1000_commit_fc_settings_generic(hw);
896 if (ret_val) 894 if (ret_val)
@@ -925,14 +923,13 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
925} 923}
926 924
927/** 925/**
928 * e1000e_config_collision_dist - Configure collision distance 926 * e1000e_config_collision_dist_generic - Configure collision distance
929 * @hw: pointer to the HW structure 927 * @hw: pointer to the HW structure
930 * 928 *
931 * Configures the collision distance to the default value and is used 929 * Configures the collision distance to the default value and is used
932 * during link setup. Currently no func pointer exists and all 930 * during link setup.
933 * implementations are handled in the generic version of this function.
934 **/ 931 **/
935void e1000e_config_collision_dist(struct e1000_hw *hw) 932void e1000e_config_collision_dist_generic(struct e1000_hw *hw)
936{ 933{
937 u32 tctl; 934 u32 tctl;
938 935
@@ -971,7 +968,9 @@ s32 e1000e_set_fc_watermarks(struct e1000_hw *hw)
971 * XON frames. 968 * XON frames.
972 */ 969 */
973 fcrtl = hw->fc.low_water; 970 fcrtl = hw->fc.low_water;
974 fcrtl |= E1000_FCRTL_XONE; 971 if (hw->fc.send_xon)
972 fcrtl |= E1000_FCRTL_XONE;
973
975 fcrth = hw->fc.high_water; 974 fcrth = hw->fc.high_water;
976 } 975 }
977 ew32(FCRTL, fcrtl); 976 ew32(FCRTL, fcrtl);
@@ -1399,11 +1398,11 @@ s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data)
1399} 1398}
1400 1399
1401/** 1400/**
1402 * e1000e_id_led_init - 1401 * e1000e_id_led_init_generic -
1403 * @hw: pointer to the HW structure 1402 * @hw: pointer to the HW structure
1404 * 1403 *
1405 **/ 1404 **/
1406s32 e1000e_id_led_init(struct e1000_hw *hw) 1405s32 e1000e_id_led_init_generic(struct e1000_hw *hw)
1407{ 1406{
1408 struct e1000_mac_info *mac = &hw->mac; 1407 struct e1000_mac_info *mac = &hw->mac;
1409 s32 ret_val; 1408 s32 ret_val;
diff --git a/drivers/net/ethernet/intel/e1000e/manage.c b/drivers/net/ethernet/intel/e1000e/manage.c
index 0d24b13ce763..473f8e711510 100644
--- a/drivers/net/ethernet/intel/e1000e/manage.c
+++ b/drivers/net/ethernet/intel/e1000e/manage.c
@@ -106,7 +106,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
106} 106}
107 107
108/** 108/**
109 * e1000e_check_mng_mode_generic - check management mode 109 * e1000e_check_mng_mode_generic - Generic check management mode
110 * @hw: pointer to the HW structure 110 * @hw: pointer to the HW structure
111 * 111 *
112 * Reads the firmware semaphore register and returns true (>0) if 112 * Reads the firmware semaphore register and returns true (>0) if
@@ -138,7 +138,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
138 hw->mac.tx_pkt_filtering = true; 138 hw->mac.tx_pkt_filtering = true;
139 139
140 /* No manageability, no filtering */ 140 /* No manageability, no filtering */
141 if (!e1000e_check_mng_mode(hw)) { 141 if (!hw->mac.ops.check_mng_mode(hw)) {
142 hw->mac.tx_pkt_filtering = false; 142 hw->mac.tx_pkt_filtering = false;
143 return hw->mac.tx_pkt_filtering; 143 return hw->mac.tx_pkt_filtering;
144 } 144 }
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c30e99ee66c6..8b62870e2c25 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2855,7 +2855,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
2855 /* enable Report Status bit */ 2855 /* enable Report Status bit */
2856 adapter->txd_cmd |= E1000_TXD_CMD_RS; 2856 adapter->txd_cmd |= E1000_TXD_CMD_RS;
2857 2857
2858 e1000e_config_collision_dist(hw); 2858 hw->mac.ops.config_collision_dist(hw);
2859} 2859}
2860 2860
2861/** 2861/**
@@ -3464,7 +3464,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
3464 fc->pause_time = 0xFFFF; 3464 fc->pause_time = 0xFFFF;
3465 else 3465 else
3466 fc->pause_time = E1000_FC_PAUSE_TIME; 3466 fc->pause_time = E1000_FC_PAUSE_TIME;
3467 fc->send_xon = 1; 3467 fc->send_xon = true;
3468 fc->current_mode = fc->requested_mode; 3468 fc->current_mode = fc->requested_mode;
3469 3469
3470 switch (hw->mac.type) { 3470 switch (hw->mac.type) {
@@ -6236,7 +6236,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
6236 adapter->hw.phy.ms_type = e1000_ms_hw_default; 6236 adapter->hw.phy.ms_type = e1000_ms_hw_default;
6237 } 6237 }
6238 6238
6239 if (e1000_check_reset_block(&adapter->hw)) 6239 if (hw->phy.ops.check_reset_block(hw))
6240 e_info("PHY reset is blocked due to SOL/IDER session.\n"); 6240 e_info("PHY reset is blocked due to SOL/IDER session.\n");
6241 6241
6242 /* Set initial default active device features */ 6242 /* Set initial default active device features */
@@ -6403,7 +6403,7 @@ err_register:
6403 if (!(adapter->flags & FLAG_HAS_AMT)) 6403 if (!(adapter->flags & FLAG_HAS_AMT))
6404 e1000e_release_hw_control(adapter); 6404 e1000e_release_hw_control(adapter);
6405err_eeprom: 6405err_eeprom:
6406 if (!e1000_check_reset_block(&adapter->hw)) 6406 if (!hw->phy.ops.check_reset_block(hw))
6407 e1000_phy_hw_reset(&adapter->hw); 6407 e1000_phy_hw_reset(&adapter->hw);
6408err_hw_init: 6408err_hw_init:
6409 kfree(adapter->tx_ring); 6409 kfree(adapter->tx_ring);
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
index 24b7930b7500..a969f1af1b4e 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.c
+++ b/drivers/net/ethernet/intel/e1000e/nvm.c
@@ -625,13 +625,13 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
625} 625}
626 626
627/** 627/**
628 * e1000e_reload_nvm - Reloads EEPROM 628 * e1000e_reload_nvm_generic - Reloads EEPROM
629 * @hw: pointer to the HW structure 629 * @hw: pointer to the HW structure
630 * 630 *
631 * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the 631 * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
632 * extended control register. 632 * extended control register.
633 **/ 633 **/
634void e1000e_reload_nvm(struct e1000_hw *hw) 634void e1000e_reload_nvm_generic(struct e1000_hw *hw)
635{ 635{
636 u32 ctrl_ext; 636 u32 ctrl_ext;
637 637
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index d4dbbe741246..683abac4a049 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1181,7 +1181,7 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
1181 1181
1182 if (link) { 1182 if (link) {
1183 e_dbg("Valid link established!!!\n"); 1183 e_dbg("Valid link established!!!\n");
1184 e1000e_config_collision_dist(hw); 1184 hw->mac.ops.config_collision_dist(hw);
1185 ret_val = e1000e_config_fc_after_link_up(hw); 1185 ret_val = e1000e_config_fc_after_link_up(hw);
1186 } else { 1186 } else {
1187 e_dbg("Unable to establish link!!!\n"); 1187 e_dbg("Unable to establish link!!!\n");
@@ -1489,7 +1489,7 @@ void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
1489 e_dbg("Forcing 10mb\n"); 1489 e_dbg("Forcing 10mb\n");
1490 } 1490 }
1491 1491
1492 e1000e_config_collision_dist(hw); 1492 hw->mac.ops.config_collision_dist(hw);
1493 1493
1494 ew32(CTRL, ctrl); 1494 ew32(CTRL, ctrl);
1495} 1495}
@@ -2133,7 +2133,7 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
2133 s32 ret_val; 2133 s32 ret_val;
2134 u32 ctrl; 2134 u32 ctrl;
2135 2135
2136 ret_val = e1000_check_reset_block(hw); 2136 ret_val = phy->ops.check_reset_block(hw);
2137 if (ret_val) 2137 if (ret_val)
2138 return 0; 2138 return 0;
2139 2139