[29/70] net/e1000/base: more function name cleanup

Message ID 20200622064634.70941-30-guinanx.sun@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series update e1000 base code |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Guinan Sun June 22, 2020, 6:45 a.m. UTC
  Now that several functions are "generic" or "base" functions, drop the
family specific names to make more generic.

This is another step closer to making the family specific files
independent from other silicon specific family files and only include
the "common" functions and files.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/e1000/base/e1000_api.c  |  11 +-
 drivers/net/e1000/base/e1000_hw.h   |  17 +-
 drivers/net/e1000/base/e1000_i225.c | 562 ++++++++++++----------------
 drivers/net/e1000/base/e1000_mac.c  |  68 +---
 drivers/net/e1000/base/e1000_mac.h  |   1 +
 5 files changed, 258 insertions(+), 401 deletions(-)
  

Patch

diff --git a/drivers/net/e1000/base/e1000_api.c b/drivers/net/e1000/base/e1000_api.c
index ae6f125a6..18fac769c 100644
--- a/drivers/net/e1000/base/e1000_api.c
+++ b/drivers/net/e1000/base/e1000_api.c
@@ -305,6 +305,10 @@  s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_82576_SERDES_QUAD:
 		mac->type = e1000_82576;
 		break;
+	case E1000_DEV_ID_82576_VF:
+	case E1000_DEV_ID_82576_VF_HV:
+		mac->type = e1000_vfadapt;
+		break;
 	case E1000_DEV_ID_82580_COPPER:
 	case E1000_DEV_ID_82580_FIBER:
 	case E1000_DEV_ID_82580_SERDES:
@@ -337,21 +341,14 @@  s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_I211_COPPER:
 		mac->type = e1000_i211;
 		break;
-#ifndef NO_I225_SUPPORT
 	case E1000_DEV_ID_I225_LM:
 	case E1000_DEV_ID_I225_V:
 		mac->type = e1000_i225;
 		break;
-#endif /* NO_I225_SUPPORT */
-	case E1000_DEV_ID_82576_VF:
-	case E1000_DEV_ID_82576_VF_HV:
-		mac->type = e1000_vfadapt;
-		break;
 	case E1000_DEV_ID_I350_VF:
 	case E1000_DEV_ID_I350_VF_HV:
 		mac->type = e1000_vfadapt_i350;
 		break;
-
 	case E1000_DEV_ID_I354_BACKPLANE_1GBPS:
 	case E1000_DEV_ID_I354_SGMII:
 	case E1000_DEV_ID_I354_BACKPLANE_2_5GBPS:
diff --git a/drivers/net/e1000/base/e1000_hw.h b/drivers/net/e1000/base/e1000_hw.h
index 5042740f4..054f7b3c8 100644
--- a/drivers/net/e1000/base/e1000_hw.h
+++ b/drivers/net/e1000/base/e1000_hw.h
@@ -222,9 +222,7 @@  enum e1000_mac_type {
 	e1000_i354,
 	e1000_i210,
 	e1000_i211,
-#ifndef NO_I225_SUPPORT
 	e1000_i225,
-#endif /* NO_I225_SUPPORT */
 	e1000_vfadapt,
 	e1000_vfadapt_i350,
 	e1000_num_macs  /* List is 1-based, so subtract 1 for true count. */
@@ -360,7 +358,6 @@  enum e1000_serdes_link_state {
 	e1000_serdes_link_forced_up
 };
 
-#ifndef NO_I225_SUPPORT
 enum e1000_invm_structure_type {
 	e1000_invm_unitialized_structure		= 0x00,
 	e1000_invm_word_autoload_structure		= 0x01,
@@ -370,7 +367,6 @@  enum e1000_invm_structure_type {
 	e1000_invm_invalidated_structure		= 0x0f,
 };
 
-#endif /* NO_I225_SUPPORT */
 #define __le16 u16
 #define __le32 u32
 #define __le64 u64
@@ -701,6 +697,7 @@  struct e1000_mac_operations {
 	void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
 	s32  (*reset_hw)(struct e1000_hw *);
 	s32  (*init_hw)(struct e1000_hw *);
+	s32  (*set_eee)(struct e1000_hw *, bool, bool, bool);
 	void (*shutdown_serdes)(struct e1000_hw *);
 	void (*power_up_serdes)(struct e1000_hw *);
 	s32  (*setup_link)(struct e1000_hw *);
@@ -999,9 +996,20 @@  struct e1000_dev_spec_vf {
 	u32 v2p_mailbox;
 };
 
+struct e1000_dev_spec_i225 {
+	bool global_device_reset;
+	bool eee_disable;
+	bool clear_semaphore_once;
+	bool module_plugged;
+	u8 media_port;
+	bool mas_capable;
+	u32 mtu;
+};
+
 struct e1000_hw {
 	void *back;
 
+	u8 pf_id;               /* device profile info */
 	u8 *hw_addr;
 	u8 *flash_address;
 	unsigned long io_base;
@@ -1023,6 +1031,7 @@  struct e1000_hw {
 		struct e1000_dev_spec_ich8lan ich8lan;
 		struct e1000_dev_spec_82575 _82575;
 		struct e1000_dev_spec_vf vf;
+		struct e1000_dev_spec_i225 _i225;
 	} dev_spec;
 
 	u16 device_id;
diff --git a/drivers/net/e1000/base/e1000_i225.c b/drivers/net/e1000/base/e1000_i225.c
index 505eff8f9..85c692644 100644
--- a/drivers/net/e1000/base/e1000_i225.c
+++ b/drivers/net/e1000/base/e1000_i225.c
@@ -1,14 +1,9 @@ 
-#ifndef NO_API_SUPPORT
 #include "e1000_api.h"
-#else
-#include "e1000_hw.h"
-#endif /* NO_API_SUPPORT */
-#ifndef EXTERNAL_RELEASE
-#ifdef WPP_TRACING_ENABLED
-#include <e1000_i225.tmh>
-#endif /* WPP_TRACING_ENABLED */
-#endif /* EXTERNAL_RELEASE */
 
+STATIC s32 e1000_init_nvm_params_i225(struct e1000_hw *hw);
+STATIC s32 e1000_init_mac_params_i225(struct e1000_hw *hw);
+STATIC s32 e1000_init_phy_params_i225(struct e1000_hw *hw);
+STATIC s32 e1000_reset_hw_i225(struct e1000_hw *hw);
 STATIC s32 e1000_acquire_nvm_i225(struct e1000_hw *hw);
 STATIC void e1000_release_nvm_i225(struct e1000_hw *hw);
 STATIC s32 e1000_get_hw_semaphore_i225(struct e1000_hw *hw);
@@ -19,6 +14,236 @@  STATIC s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
 STATIC s32 e1000_pool_flash_update_done_i225(struct e1000_hw *hw);
 STATIC s32 e1000_valid_led_default_i225(struct e1000_hw *hw, u16 *data);
 
+/**
+ *  e1000_init_nvm_params_i225 - Init NVM func ptrs.
+ *  @hw: pointer to the HW structure
+ **/
+STATIC s32 e1000_init_nvm_params_i225(struct e1000_hw *hw)
+{
+	struct e1000_nvm_info *nvm = &hw->nvm;
+	u32 eecd = E1000_READ_REG(hw, E1000_EECD);
+	u16 size;
+
+	DEBUGFUNC("e1000_init_nvm_params_i225");
+
+	size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
+		     E1000_EECD_SIZE_EX_SHIFT);
+	/*
+	 * Added to a constant, "size" becomes the left-shift value
+	 * for setting word_size.
+	 */
+	size += NVM_WORD_SIZE_BASE_SHIFT;
+
+	/* Just in case size is out of range, cap it to the largest
+	 * EEPROM size supported
+	 */
+	if (size > 15)
+		size = 15;
+
+	nvm->word_size = 1 << size;
+	nvm->opcode_bits = 8;
+	nvm->delay_usec = 1;
+	nvm->type = e1000_nvm_eeprom_spi;
+
+
+	nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
+	nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ?
+			    16 : 8;
+
+	if (nvm->word_size == (1 << 15))
+		nvm->page_size = 128;
+
+	nvm->ops.acquire = e1000_acquire_nvm_i225;
+	nvm->ops.release = e1000_release_nvm_i225;
+	nvm->ops.valid_led_default = e1000_valid_led_default_i225;
+	if (e1000_get_flash_presence_i225(hw)) {
+		hw->nvm.type = e1000_nvm_flash_hw;
+		nvm->ops.read    = e1000_read_nvm_srrd_i225;
+		nvm->ops.write   = e1000_write_nvm_srwr_i225;
+		nvm->ops.validate = e1000_validate_nvm_checksum_i225;
+		nvm->ops.update   = e1000_update_nvm_checksum_i225;
+	} else {
+		hw->nvm.type = e1000_nvm_invm;
+		nvm->ops.write    = e1000_null_write_nvm;
+		nvm->ops.validate = e1000_null_ops_generic;
+		nvm->ops.update   = e1000_null_ops_generic;
+	}
+
+	return E1000_SUCCESS;
+}
+
+/**
+ *  e1000_init_mac_params_i225 - Init MAC func ptrs.
+ *  @hw: pointer to the HW structure
+ **/
+STATIC s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
+{
+	struct e1000_mac_info *mac = &hw->mac;
+	struct e1000_dev_spec_i225 *dev_spec = &hw->dev_spec._i225;
+
+	DEBUGFUNC("e1000_init_mac_params_i225");
+
+	/* Initialize function pointer */
+	e1000_init_mac_ops_generic(hw);
+
+	/* Set media type */
+	hw->phy.media_type = e1000_media_type_copper;
+	/* Set mta register count */
+	mac->mta_reg_count = 128;
+	/* Set rar entry count */
+	mac->rar_entry_count = E1000_RAR_ENTRIES_BASE;
+	/* Set EEE */
+	mac->ops.set_eee = e1000_set_eee_i225;
+	/* reset */
+	mac->ops.reset_hw = e1000_reset_hw_i225;
+	/* hw initialization */
+	mac->ops.init_hw = e1000_init_hw_i225;
+	/* link setup */
+	mac->ops.setup_link = e1000_setup_link_generic;
+	mac->ops.check_for_link = e1000_check_for_copper_link_generic;
+	/* link info */
+	mac->ops.get_link_up_info = e1000_get_speed_and_duplex_copper_generic;
+	/* acquire SW_FW sync */
+	mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_i225;
+	/* release SW_FW sync */
+	mac->ops.release_swfw_sync = e1000_release_swfw_sync_i225;
+
+	/* Allow a single clear of the SW semaphore on I225 */
+	dev_spec->clear_semaphore_once = true;
+	mac->ops.setup_physical_interface = e1000_setup_copper_link_i225;
+
+	/* Set if part includes ASF firmware */
+	mac->asf_firmware_present = true;
+
+	/* multicast address update */
+	mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
+
+	mac->ops.write_vfta = e1000_write_vfta_generic;
+
+	return E1000_SUCCESS;
+}
+
+/**
+ *  e1000_init_phy_params_i225 - Init PHY func ptrs.
+ *  @hw: pointer to the HW structure
+ **/
+STATIC s32 e1000_init_phy_params_i225(struct e1000_hw *hw)
+{
+	struct e1000_phy_info *phy = &hw->phy;
+	s32 ret_val = E1000_SUCCESS;
+	u32 ctrl_ext;
+
+	DEBUGFUNC("e1000_init_phy_params_i225");
+
+	phy->ops.read_i2c_byte = e1000_read_i2c_byte_generic;
+	phy->ops.write_i2c_byte = e1000_write_i2c_byte_generic;
+
+	if (hw->phy.media_type != e1000_media_type_copper) {
+		phy->type = e1000_phy_none;
+		goto out;
+	}
+
+	phy->ops.power_up   = e1000_power_up_phy_copper;
+	phy->ops.power_down = e1000_power_down_phy_copper_base;
+
+	phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT_2500;
+
+	phy->reset_delay_us	= 100;
+
+	phy->ops.acquire	= e1000_acquire_phy_base;
+	phy->ops.check_reset_block = e1000_check_reset_block_generic;
+	phy->ops.commit		= e1000_phy_sw_reset_generic;
+	phy->ops.release	= e1000_release_phy_base;
+	phy->ops.reset		= e1000_phy_hw_reset_generic;
+
+	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
+
+	/* Make sure the PHY is in a good state. Several people have reported
+	 * firmware leaving the PHY's page select register set to something
+	 * other than the default of zero, which causes the PHY ID read to
+	 * access something other than the intended register.
+	 */
+	ret_val = hw->phy.ops.reset(hw);
+	if (ret_val)
+		goto out;
+
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
+	phy->ops.read_reg = e1000_read_phy_reg_gpy;
+	phy->ops.write_reg = e1000_write_phy_reg_gpy;
+
+	ret_val = e1000_get_phy_id(hw);
+	/* Verify phy id and set remaining function pointers */
+	switch (phy->id) {
+	case I225_I_PHY_ID:
+		phy->type		= e1000_phy_i225;
+		phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_i225;
+		phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_i225;
+		/* TODO - complete with GPY PHY information */
+		break;
+	default:
+		ret_val = -E1000_ERR_PHY;
+		goto out;
+	}
+
+out:
+	return ret_val;
+}
+
+/**
+ *  e1000_reset_hw_i225 - Reset hardware
+ *  @hw: pointer to the HW structure
+ *
+ *  This resets the hardware into a known state.
+ **/
+STATIC s32 e1000_reset_hw_i225(struct e1000_hw *hw)
+{
+	u32 ctrl;
+	s32 ret_val;
+
+	DEBUGFUNC("e1000_reset_hw_i225");
+
+	/*
+	 * Prevent the PCI-E bus from sticking if there is no TLP connection
+	 * on the last TLP read/write transaction when MAC is reset.
+	 */
+	ret_val = e1000_disable_pcie_master_generic(hw);
+	if (ret_val)
+		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+
+	DEBUGOUT("Masking off all interrupts\n");
+	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
+
+	E1000_WRITE_REG(hw, E1000_RCTL, 0);
+	E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
+	E1000_WRITE_FLUSH(hw);
+
+	msec_delay(10);
+
+	ctrl = E1000_READ_REG(hw, E1000_CTRL);
+
+	DEBUGOUT("Issuing a global reset to MAC\n");
+	E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_DEV_RST);
+
+	ret_val = e1000_get_auto_rd_done_generic(hw);
+	if (ret_val) {
+		/*
+		 * When auto config read does not complete, do not
+		 * return with an error. This can happen in situations
+		 * where there is no eeprom and prevents getting link.
+		 */
+		DEBUGOUT("Auto Read Done did not complete\n");
+	}
+
+	/* Clear any pending interrupt events. */
+	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
+	E1000_READ_REG(hw, E1000_ICR);
+
+	/* Install any alternate MAC address into RAR0 */
+	ret_val = e1000_check_alt_mac_addr_generic(hw);
+
+	return ret_val;
+}
+
 /* e1000_acquire_nvm_i225 - Request for access to EEPROM
  * @hw: pointer to the HW structure
  *
@@ -407,88 +632,6 @@  STATIC s32 e1000_read_invm_word_i225(struct e1000_hw *hw, u8 address, u16 *data)
 	return status;
 }
 
-/* e1000_read_invm_i225 - Read invm wrapper function for I225
- * @hw: pointer to the HW structure
- * @address: the word address (aka eeprom offset) to read
- * @data: pointer to the data read
- *
- * Wrapper function to return data formerly found in the NVM.
- */
-STATIC s32 e1000_read_invm_i225(struct e1000_hw *hw, u16 offset,
-				u16 E1000_UNUSEDARG words, u16 *data)
-{
-	s32 ret_val = E1000_SUCCESS;
-
-	UNREFERENCED_1PARAMETER(words);
-
-	DEBUGFUNC("e1000_read_invm_i225");
-
-	/* Only the MAC addr is required to be present in the iNVM */
-	switch (offset) {
-	case NVM_MAC_ADDR:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, &data[0]);
-		ret_val |= e1000_read_invm_word_i225(hw, (u8)offset + 1,
-						     &data[1]);
-		ret_val |= e1000_read_invm_word_i225(hw, (u8)offset + 2,
-						     &data[2]);
-		if (ret_val != E1000_SUCCESS)
-			DEBUGOUT("MAC Addr not found in iNVM\n");
-		break;
-	case NVM_INIT_CTRL_2:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, data);
-		if (ret_val != E1000_SUCCESS) {
-			*data = NVM_INIT_CTRL_2_DEFAULT_I225;
-			ret_val = E1000_SUCCESS;
-		}
-		break;
-	case NVM_INIT_CTRL_4:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, data);
-		if (ret_val != E1000_SUCCESS) {
-			*data = NVM_INIT_CTRL_4_DEFAULT_I225;
-			ret_val = E1000_SUCCESS;
-		}
-		break;
-	case NVM_LED_1_CFG:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, data);
-		if (ret_val != E1000_SUCCESS) {
-			*data = NVM_LED_1_CFG_DEFAULT_I225;
-			ret_val = E1000_SUCCESS;
-		}
-		break;
-	case NVM_LED_0_2_CFG:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, data);
-		if (ret_val != E1000_SUCCESS) {
-			*data = NVM_LED_0_2_CFG_DEFAULT_I225;
-			ret_val = E1000_SUCCESS;
-		}
-		break;
-	case NVM_ID_LED_SETTINGS:
-		ret_val = e1000_read_invm_word_i225(hw, (u8)offset, data);
-		if (ret_val != E1000_SUCCESS) {
-			*data = ID_LED_RESERVED_FFFF;
-			ret_val = E1000_SUCCESS;
-		}
-		break;
-	case NVM_SUB_DEV_ID:
-		*data = hw->subsystem_device_id;
-		break;
-	case NVM_SUB_VEN_ID:
-		*data = hw->subsystem_vendor_id;
-		break;
-	case NVM_DEV_ID:
-		*data = hw->device_id;
-		break;
-	case NVM_VEN_ID:
-		*data = hw->vendor_id;
-		break;
-	default:
-		DEBUGOUT1("NVM word 0x%02x is not mapped.\n", offset);
-		*data = NVM_RESERVED_WORD;
-		break;
-	}
-	return ret_val;
-}
-
 #if defined(NVM_VERSION_SUPPORT) || defined(QV_RELEASE)
 /* e1000_read_invm_version_i225 - Reads iNVM version and image type
  * @hw: pointer to the HW structure
@@ -750,237 +893,6 @@  s32 e1000_pool_flash_update_done_i225(struct e1000_hw *hw)
 	return ret_val;
 }
 
-/* e1000_init_nvm_params_i225 - Initialize i225 NVM function pointers
- * @hw: pointer to the HW structure
- *
- * Initialize the i225/i211 NVM parameters and function pointers.
- */
-STATIC s32 e1000_init_nvm_params_i225(struct e1000_hw *hw)
-{
-	s32 ret_val;
-	struct e1000_nvm_info *nvm = &hw->nvm;
-
-	DEBUGFUNC("e1000_init_nvm_params_i225");
-
-	ret_val = e1000_init_nvm_params_82575(hw);
-	nvm->ops.acquire = e1000_acquire_nvm_i225;
-	nvm->ops.release = e1000_release_nvm_i225;
-	nvm->ops.valid_led_default = e1000_valid_led_default_i225;
-	if (e1000_get_flash_presence_i225(hw)) {
-		hw->nvm.type = e1000_nvm_flash_hw;
-		nvm->ops.read    = e1000_read_nvm_srrd_i225;
-		nvm->ops.write   = e1000_write_nvm_srwr_i225;
-		nvm->ops.validate = e1000_validate_nvm_checksum_i225;
-		nvm->ops.update   = e1000_update_nvm_checksum_i225;
-	} else {
-		hw->nvm.type = e1000_nvm_invm;
-		nvm->ops.read     = e1000_read_invm_i225;
-#ifndef NO_NULL_OPS_SUPPORT
-		nvm->ops.write    = e1000_null_write_nvm;
-		nvm->ops.validate = e1000_null_ops_generic;
-		nvm->ops.update   = e1000_null_ops_generic;
-#else
-		nvm->ops.write    = NULL;
-		nvm->ops.validate = NULL;
-		nvm->ops.update   = NULL;
-#endif /* NO_NULL_OPS_SUPPORT */
-	}
-	return ret_val;
-}
-
-#ifdef I225_LTR_SUPPORT
-/* e1000_set_ltr_i225 - Set Latency Tolerance Reporting thresholds.
- * @hw: pointer to the HW structure
- * @link: bool indicating link status
- *
- * Set the LTR thresholds based on the link speed (Mbps), EEE, and DMAC
- * settings, otherwise specify that there is no LTR requirement.
- */
-STATIC s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
-{
-	u16 speed, duplex;
-	u32 tw_system, ltrc, ltrv, ltr_min, ltr_max, scale_min, scale_max;
-	s32 size;
-
-	DEBUGFUNC("e1000_set_ltr_i225");
-
-	/* If we do not have link, LTR thresholds are zero. */
-	if (link) {
-		hw->mac.ops.get_link_up_info(hw, &speed, &duplex);
-
-		/* Check if using copper interface with EEE enabled or if the
-		 * link speed is 10 Mbps.
-		 */
-		if ((hw->phy.media_type == e1000_media_type_copper) &&
-		    !(hw->dev_spec._82575.eee_disable) &&
-		     (speed != SPEED_10)) {
-			/* EEE enabled, so send LTRMAX threshold. */
-			ltrc = E1000_READ_REG(hw, E1000_LTRC) |
-				E1000_LTRC_EEEMS_EN;
-			E1000_WRITE_REG(hw, E1000_LTRC, ltrc);
-
-			/* Calculate tw_system (nsec). */
-			if (speed == SPEED_100) {
-				tw_system = ((E1000_READ_REG(hw, E1000_EEE_SU) &
-					     E1000_TW_SYSTEM_100_MASK) >>
-					     E1000_TW_SYSTEM_100_SHIFT) * 500;
-			} else {
-				tw_system = (E1000_READ_REG(hw, E1000_EEE_SU) &
-					     E1000_TW_SYSTEM_1000_MASK) * 500;
-				}
-		} else {
-			tw_system = 0;
-			}
-
-		/* Get the Rx packet buffer size. */
-		size = E1000_READ_REG(hw, E1000_RXPBS) &
-			E1000_RXPBS_SIZE_I225_MASK;
-
-		/* Calculations vary based on DMAC settings. */
-		if (E1000_READ_REG(hw, E1000_DMACR) & E1000_DMACR_DMAC_EN) {
-			size -= (E1000_READ_REG(hw, E1000_DMACR) &
-				 E1000_DMACR_DMACTHR_MASK) >>
-				 E1000_DMACR_DMACTHR_SHIFT;
-			/* Convert size to bits. */
-			size *= 1024 * 8;
-		} else {
-			/* Convert size to bytes, subtract the MTU, and then
-			 * convert the size to bits.
-			 */
-			size *= 1024;
-			size -= hw->dev_spec._82575.mtu;
-			size *= 8;
-		}
-
-		if (size < 0) {
-			DEBUGOUT1("Invalid effective Rx buffer size %d\n",
-				  size);
-			return -E1000_ERR_CONFIG;
-		}
-
-		/* Calculate the thresholds. Since speed is in Mbps, simplify
-		 * the calculation by multiplying size/speed by 1000 for result
-		 * to be in nsec before dividing by the scale in nsec. Set the
-		 * scale such that the LTR threshold fits in the register.
-		 */
-		ltr_min = (1000 * size) / speed;
-		ltr_max = ltr_min + tw_system;
-		scale_min = (ltr_min / 1024) < 1024 ? E1000_LTRMINV_SCALE_1024 :
-			    E1000_LTRMINV_SCALE_32768;
-		scale_max = (ltr_max / 1024) < 1024 ? E1000_LTRMAXV_SCALE_1024 :
-			    E1000_LTRMAXV_SCALE_32768;
-		ltr_min /= scale_min == E1000_LTRMINV_SCALE_1024 ? 1024 : 32768;
-		ltr_max /= scale_max == E1000_LTRMAXV_SCALE_1024 ? 1024 : 32768;
-
-		/* Only write the LTR thresholds if they differ from before. */
-		ltrv = E1000_READ_REG(hw, E1000_LTRMINV);
-		if (ltr_min != (ltrv & E1000_LTRMINV_LTRV_MASK)) {
-			ltrv = E1000_LTRMINV_LSNP_REQ | ltr_min |
-			      (scale_min << E1000_LTRMINV_SCALE_SHIFT);
-			E1000_WRITE_REG(hw, E1000_LTRMINV, ltrv);
-		}
-
-		ltrv = E1000_READ_REG(hw, E1000_LTRMAXV);
-		if (ltr_max != (ltrv & E1000_LTRMAXV_LTRV_MASK)) {
-			ltrv = E1000_LTRMAXV_LSNP_REQ | ltr_max |
-			      (scale_min << E1000_LTRMAXV_SCALE_SHIFT);
-			E1000_WRITE_REG(hw, E1000_LTRMAXV, ltrv);
-		}
-	}
-
-	return E1000_SUCCESS;
-}
-
-/* e1000_check_for_link_i225 - Check for link
- * @hw: pointer to the HW structure
- *
- * Checks to see of the link status of the hardware has changed.  If a
- * change in link status has been detected, then we read the PHY registers
- * to get the current speed/duplex if link exists.
- */
-s32 e1000_check_for_link_i225(struct e1000_hw *hw)
-{
-	struct e1000_mac_info *mac = &hw->mac;
-	s32 ret_val;
-	bool link = false;
-
-	DEBUGFUNC("e1000_check_for_link_i225");
-
-	if (hw->phy.media_type != e1000_media_type_copper) {
-		u16 speed, duplex;
-
-		ret_val = e1000_get_pcs_speed_and_duplex_82575(hw, &speed,
-							       &duplex);
-		/* Use this flag to determine if link needs to be checked or
-		 * not.  If we have link clear the flag so that we do not
-		 * continue to check for link.
-		 */
-		hw->mac.get_link_status = !hw->mac.serdes_has_link;
-
-		link = hw->mac.serdes_has_link;
-	} else {
-		/* We only want to go out to the PHY registers to see if
-		 * Auto-Neg has completed and/or if our link status has
-		 * changed.  The get_link_status flag is set upon receiving
-		 * a Link Status Change or Rx Sequence Error interrupt.
-		 */
-		if (!mac->get_link_status) {
-			ret_val = E1000_SUCCESS;
-			goto out;
-		}
-
-		/* First we want to see if the MII Status Register reports
-		 * link.  If so, then we want to get the current speed/duplex
-		 * of the PHY.
-		 */
-		ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
-		if (ret_val)
-			goto out;
-
-		if (!link)
-			goto out; /* No link detected */
-
-		mac->get_link_status = false;
-
-		/* Check if there was DownShift, must be checked
-		 * immediately after link-up
-		 */
-		e1000_check_downshift_generic(hw);
-
-		/* If we are forcing speed/duplex, then we simply return since
-		 * we have already determined whether we have link or not.
-		 */
-		if (!mac->autoneg) {
-			ret_val = -E1000_ERR_CONFIG;
-			goto out;
-		}
-
-		/* Auto-Neg is enabled.  Auto Speed Detection takes care
-		 * of MAC speed/duplex configuration.  So we only need to
-		 * configure Collision Distance in the MAC.
-		 */
-		mac->ops.config_collision_dist(hw);
-
-		/* Configure Flow Control now that Auto-Neg has completed.
-		 * First, we need to restore the desired flow control
-		 * settings because we may have had to re-autoneg with a
-		 * different link partner.
-		 */
-		ret_val = e1000_config_fc_after_link_up_generic(hw);
-		if (ret_val)
-			DEBUGOUT("Error configuring flow control\n");
-	}
-
-out:
-	/* Now that we are aware of our link settings, we can set the LTR
-	 * thresholds.
-	 */
-	ret_val = e1000_set_ltr_i225(hw, link);
-
-	return ret_val;
-}
-
-#endif /* I225_LTR_SUPPORT */
 /* e1000_init_function_pointers_i225 - Init func ptrs.
  * @hw: pointer to the HW structure
  *
@@ -988,8 +900,12 @@  s32 e1000_check_for_link_i225(struct e1000_hw *hw)
  */
 void e1000_init_function_pointers_i225(struct e1000_hw *hw)
 {
-	e1000_init_function_pointers_82575(hw);
+	e1000_init_mac_ops_generic(hw);
+	e1000_init_phy_ops_generic(hw);
+	e1000_init_nvm_ops_generic(hw);
+	hw->mac.ops.init_params = e1000_init_mac_params_i225;
 	hw->nvm.ops.init_params = e1000_init_nvm_params_i225;
+	hw->phy.ops.init_params = e1000_init_phy_params_i225;
 }
 
 /* e1000_valid_led_default_i225 - Verify a valid default LED config
diff --git a/drivers/net/e1000/base/e1000_mac.c b/drivers/net/e1000/base/e1000_mac.c
index 92ee33745..0ae2a60d8 100644
--- a/drivers/net/e1000/base/e1000_mac.c
+++ b/drivers/net/e1000/base/e1000_mac.c
@@ -4,10 +4,7 @@ 
 
 #include "e1000_api.h"
 
-STATIC s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw);
-STATIC void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw);
 STATIC void e1000_config_collision_dist_generic(struct e1000_hw *hw);
-STATIC int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
 
 /**
  *  e1000_init_mac_ops_generic - Initialize MAC function pointers
@@ -22,32 +19,8 @@  void e1000_init_mac_ops_generic(struct e1000_hw *hw)
 
 	/* General Setup */
 	mac->ops.init_params = e1000_null_ops_generic;
-	mac->ops.init_hw = e1000_null_ops_generic;
-	mac->ops.reset_hw = e1000_null_ops_generic;
-	mac->ops.setup_physical_interface = e1000_null_ops_generic;
-	mac->ops.get_bus_info = e1000_null_ops_generic;
-	mac->ops.set_lan_id = e1000_set_lan_id_multi_port_pcie;
-	mac->ops.read_mac_addr = e1000_read_mac_addr_generic;
 	mac->ops.config_collision_dist = e1000_config_collision_dist_generic;
-	mac->ops.clear_hw_cntrs = e1000_null_mac_generic;
-	/* LED */
-	mac->ops.cleanup_led = e1000_null_ops_generic;
-	mac->ops.setup_led = e1000_null_ops_generic;
-	mac->ops.blink_led = e1000_null_ops_generic;
-	mac->ops.led_on = e1000_null_ops_generic;
-	mac->ops.led_off = e1000_null_ops_generic;
-	/* LINK */
-	mac->ops.setup_link = e1000_null_ops_generic;
-	mac->ops.get_link_up_info = e1000_null_link_info;
-	mac->ops.check_for_link = e1000_null_ops_generic;
-	/* Management */
-	mac->ops.check_mng_mode = e1000_null_mng_mode;
-	/* VLAN, MC, etc. */
-	mac->ops.update_mc_addr_list = e1000_null_update_mc;
-	mac->ops.clear_vfta = e1000_null_mac_generic;
-	mac->ops.write_vfta = e1000_null_write_vfta;
 	mac->ops.rar_set = e1000_rar_set_generic;
-	mac->ops.validate_mdi_setting = e1000_validate_mdi_setting_generic;
 }
 
 /**
@@ -240,26 +213,6 @@  s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw)
 	return E1000_SUCCESS;
 }
 
-/**
- *  e1000_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
- *
- *  @hw: pointer to the HW structure
- *
- *  Determines the LAN function id by reading memory-mapped registers
- *  and swaps the port value if requested.
- **/
-STATIC void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
-{
-	struct e1000_bus_info *bus = &hw->bus;
-	u32 reg;
-
-	/* The status register reports the correct function number
-	 * for the device regardless of function swap state.
-	 */
-	reg = E1000_READ_REG(hw, E1000_STATUS);
-	bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
-}
-
 /**
  *  e1000_set_lan_id_multi_port_pci - Set LAN id for PCI multiple port devices
  *  @hw: pointer to the HW structure
@@ -448,7 +401,7 @@  s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
  *  Sets the receive address array register at index to the address passed
  *  in by addr.
  **/
-STATIC int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
+int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
 {
 	u32 rar_low, rar_high;
 
@@ -2165,25 +2118,6 @@  void e1000_update_adaptive_generic(struct e1000_hw *hw)
 	}
 }
 
-/**
- *  e1000_validate_mdi_setting_generic - Verify MDI/MDIx settings
- *  @hw: pointer to the HW structure
- *
- *  Verify that when not using auto-negotiation that MDI/MDIx is correctly
- *  set, which is forced to MDI mode only.
- **/
-STATIC s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw)
-{
-	DEBUGFUNC("e1000_validate_mdi_setting_generic");
-
-	if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) {
-		DEBUGOUT("Invalid MDI setting detected\n");
-		hw->phy.mdix = 1;
-		return -E1000_ERR_CONFIG;
-	}
-
-	return E1000_SUCCESS;
-}
 
 /**
  *  e1000_validate_mdi_setting_crossover_generic - Verify MDI/MDIx settings
diff --git a/drivers/net/e1000/base/e1000_mac.h b/drivers/net/e1000/base/e1000_mac.h
index bbd2a7388..35a691f63 100644
--- a/drivers/net/e1000/base/e1000_mac.h
+++ b/drivers/net/e1000/base/e1000_mac.h
@@ -41,6 +41,7 @@  s32  e1000_led_on_generic(struct e1000_hw *hw);
 s32  e1000_led_off_generic(struct e1000_hw *hw);
 void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,
 				       u8 *mc_addr_list, u32 mc_addr_count);
+int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
 s32  e1000_set_default_fc_generic(struct e1000_hw *hw);
 s32  e1000_set_fc_watermarks_generic(struct e1000_hw *hw);
 s32  e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw);