Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2015 18:22:19 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r291107 - in projects/intel_net_refactor/sys: conf dev/e1000 dev/igb modules/em modules/igb
Message-ID:  <201511201822.tAKIMJxl074589@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Fri Nov 20 18:22:19 2015
New Revision: 291107
URL: https://svnweb.freebsd.org/changeset/base/291107

Log:
  First pass.
  
  Move igb(4) out of sys/dev/e1000 with its own copy of "shared code"
  
  Remove the igb(4) related shared code files from sys/dev/e1000
  
  Remove a coupld of em/lem conditionals in various switch/case statements
  from igb(4) code that shouldn't be there in the first place.
  
  Literally rename all symbols in igb(4) via s/e1000_/igb_/g that are global.
  I think I got all of them, but needs review.

Added:
  projects/intel_net_refactor/sys/dev/igb/
     - copied from r290770, projects/intel_net_refactor/sys/dev/e1000/
  projects/intel_net_refactor/sys/dev/igb/igb_80003es2lan.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_80003es2lan.h
  projects/intel_net_refactor/sys/dev/igb/igb_82541.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82541.h
  projects/intel_net_refactor/sys/dev/igb/igb_82543.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82543.h
  projects/intel_net_refactor/sys/dev/igb/igb_82571.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82571.h
  projects/intel_net_refactor/sys/dev/igb/igb_82575.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82575.c
  projects/intel_net_refactor/sys/dev/igb/igb_82575.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82575.h
  projects/intel_net_refactor/sys/dev/igb/igb_api.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_api.c
  projects/intel_net_refactor/sys/dev/igb/igb_api.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_api.h
  projects/intel_net_refactor/sys/dev/igb/igb_defines.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_defines.h
  projects/intel_net_refactor/sys/dev/igb/igb_hw.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_hw.h
  projects/intel_net_refactor/sys/dev/igb/igb_i210.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_i210.c
  projects/intel_net_refactor/sys/dev/igb/igb_i210.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_i210.h
  projects/intel_net_refactor/sys/dev/igb/igb_ich8lan.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_ich8lan.h
  projects/intel_net_refactor/sys/dev/igb/igb_mac.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_mac.c
  projects/intel_net_refactor/sys/dev/igb/igb_mac.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_mac.h
  projects/intel_net_refactor/sys/dev/igb/igb_manage.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_manage.c
  projects/intel_net_refactor/sys/dev/igb/igb_manage.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_manage.h
  projects/intel_net_refactor/sys/dev/igb/igb_mbx.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_mbx.c
  projects/intel_net_refactor/sys/dev/igb/igb_mbx.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_mbx.h
  projects/intel_net_refactor/sys/dev/igb/igb_nvm.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.c
  projects/intel_net_refactor/sys/dev/igb/igb_nvm.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.h
  projects/intel_net_refactor/sys/dev/igb/igb_osdep.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_osdep.c
  projects/intel_net_refactor/sys/dev/igb/igb_osdep.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_osdep.h
  projects/intel_net_refactor/sys/dev/igb/igb_phy.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_phy.c
  projects/intel_net_refactor/sys/dev/igb/igb_phy.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_phy.h
  projects/intel_net_refactor/sys/dev/igb/igb_regs.h
     - copied unchanged from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_regs.h
  projects/intel_net_refactor/sys/dev/igb/igb_vf.c
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_vf.c
  projects/intel_net_refactor/sys/dev/igb/igb_vf.h
     - copied, changed from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_vf.h
Deleted:
  projects/intel_net_refactor/sys/dev/e1000/e1000_82575.c
  projects/intel_net_refactor/sys/dev/e1000/e1000_i210.c
  projects/intel_net_refactor/sys/dev/e1000/if_igb.c
  projects/intel_net_refactor/sys/dev/e1000/if_igb.h
  projects/intel_net_refactor/sys/dev/igb/LICENSE
  projects/intel_net_refactor/sys/dev/igb/README
  projects/intel_net_refactor/sys/dev/igb/e1000_80003es2lan.c
  projects/intel_net_refactor/sys/dev/igb/e1000_80003es2lan.h
  projects/intel_net_refactor/sys/dev/igb/e1000_82540.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82541.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82541.h
  projects/intel_net_refactor/sys/dev/igb/e1000_82542.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82543.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82543.h
  projects/intel_net_refactor/sys/dev/igb/e1000_82571.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82571.h
  projects/intel_net_refactor/sys/dev/igb/e1000_82575.c
  projects/intel_net_refactor/sys/dev/igb/e1000_82575.h
  projects/intel_net_refactor/sys/dev/igb/e1000_api.c
  projects/intel_net_refactor/sys/dev/igb/e1000_api.h
  projects/intel_net_refactor/sys/dev/igb/e1000_defines.h
  projects/intel_net_refactor/sys/dev/igb/e1000_hw.h
  projects/intel_net_refactor/sys/dev/igb/e1000_i210.c
  projects/intel_net_refactor/sys/dev/igb/e1000_i210.h
  projects/intel_net_refactor/sys/dev/igb/e1000_ich8lan.c
  projects/intel_net_refactor/sys/dev/igb/e1000_ich8lan.h
  projects/intel_net_refactor/sys/dev/igb/e1000_mac.c
  projects/intel_net_refactor/sys/dev/igb/e1000_mac.h
  projects/intel_net_refactor/sys/dev/igb/e1000_manage.c
  projects/intel_net_refactor/sys/dev/igb/e1000_manage.h
  projects/intel_net_refactor/sys/dev/igb/e1000_mbx.c
  projects/intel_net_refactor/sys/dev/igb/e1000_mbx.h
  projects/intel_net_refactor/sys/dev/igb/e1000_nvm.c
  projects/intel_net_refactor/sys/dev/igb/e1000_nvm.h
  projects/intel_net_refactor/sys/dev/igb/e1000_osdep.c
  projects/intel_net_refactor/sys/dev/igb/e1000_osdep.h
  projects/intel_net_refactor/sys/dev/igb/e1000_phy.c
  projects/intel_net_refactor/sys/dev/igb/e1000_phy.h
  projects/intel_net_refactor/sys/dev/igb/e1000_regs.h
  projects/intel_net_refactor/sys/dev/igb/e1000_vf.c
  projects/intel_net_refactor/sys/dev/igb/e1000_vf.h
  projects/intel_net_refactor/sys/dev/igb/if_em.c
  projects/intel_net_refactor/sys/dev/igb/if_em.h
  projects/intel_net_refactor/sys/dev/igb/if_lem.c
  projects/intel_net_refactor/sys/dev/igb/if_lem.h
Modified:
  projects/intel_net_refactor/sys/conf/files
  projects/intel_net_refactor/sys/dev/e1000/e1000_api.c
  projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.c
  projects/intel_net_refactor/sys/dev/igb/if_igb.c
  projects/intel_net_refactor/sys/dev/igb/if_igb.h
  projects/intel_net_refactor/sys/modules/em/Makefile
  projects/intel_net_refactor/sys/modules/igb/Makefile

Modified: projects/intel_net_refactor/sys/conf/files
==============================================================================
--- projects/intel_net_refactor/sys/conf/files	Fri Nov 20 18:10:02 2015	(r291106)
+++ projects/intel_net_refactor/sys/conf/files	Fri Nov 20 18:22:19 2015	(r291107)
@@ -1335,25 +1335,19 @@ dev/e1000/if_em.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/if_lem.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/if_igb.c		optional igb \
+dev/e1000/e1000_80003es2lan.c	optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_80003es2lan.c	optional em | igb \
+dev/e1000/e1000_82540.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82540.c		optional em | igb \
+dev/e1000/e1000_82541.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82541.c		optional em | igb \
+dev/e1000/e1000_82542.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82542.c		optional em | igb \
+dev/e1000/e1000_82543.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82543.c		optional em | igb \
+dev/e1000/e1000_82571.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82571.c		optional em | igb \
-	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_82575.c		optional em | igb \
-	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_ich8lan.c	optional em | igb \
-	compile-with "${NORMAL_C} -I$S/dev/e1000"
-dev/e1000/e1000_i210.c		optional em | igb \
+dev/e1000/e1000_ich8lan.c	optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
@@ -1371,6 +1365,30 @@ dev/e1000/e1000_mbx.c		optional em | igb
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_osdep.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
+
+dev/igb/if_igb.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_82575.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_i210.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_api.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_mac.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_manage.c	optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_nvm.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_phy.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_vf.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_mbx.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+dev/igb/igb_osdep.c		optional igb \
+	compile-with "${NORMAL_C} -I$S/dev/igb"
+
 dev/et/if_et.c			optional et
 dev/en/if_en_pci.c		optional en pci
 dev/en/midway.c			optional en

Modified: projects/intel_net_refactor/sys/dev/e1000/e1000_api.c
==============================================================================
--- projects/intel_net_refactor/sys/dev/e1000/e1000_api.c	Fri Nov 20 18:10:02 2015	(r291106)
+++ projects/intel_net_refactor/sys/dev/e1000/e1000_api.c	Fri Nov 20 18:22:19 2015	(r291107)
@@ -451,17 +451,6 @@ s32 e1000_setup_init_funcs(struct e1000_
 	case e1000_pch_lpt:
 		e1000_init_function_pointers_ich8lan(hw);
 		break;
-	case e1000_82575:
-	case e1000_82576:
-	case e1000_82580:
-	case e1000_i350:
-	case e1000_i354:
-		e1000_init_function_pointers_82575(hw);
-		break;
-	case e1000_i210:
-	case e1000_i211:
-		e1000_init_function_pointers_i210(hw);
-		break;
 	case e1000_vfadapt:
 		e1000_init_function_pointers_vf(hw);
 		break;

Modified: projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.c
==============================================================================
--- projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.c	Fri Nov 20 18:10:02 2015	(r291106)
+++ projects/intel_net_refactor/sys/dev/e1000/e1000_nvm.c	Fri Nov 20 18:22:19 2015	(r291107)
@@ -775,12 +775,6 @@ s32 e1000_read_pba_string_generic(struct
 
 	DEBUGFUNC("e1000_read_pba_string_generic");
 
-	if ((hw->mac.type >= e1000_i210) &&
-	    !e1000_get_flash_presence_i210(hw)) {
-		DEBUGOUT("Flashless no PBA string\n");
-		return -E1000_ERR_NVM_PBA_SECTION;
-	}
-
 	if (pba_num == NULL) {
 		DEBUGOUT("PBA string buffer was null\n");
 		return -E1000_ERR_INVALID_ARGUMENT;

Modified: projects/intel_net_refactor/sys/dev/igb/if_igb.c
==============================================================================
--- projects/intel_net_refactor/sys/dev/e1000/if_igb.c	Fri Nov 13 16:35:22 2015	(r290770)
+++ projects/intel_net_refactor/sys/dev/igb/if_igb.c	Fri Nov 20 18:22:19 2015	(r291107)
@@ -445,13 +445,13 @@ igb_attach(device_t dev)
 	}
 
 	/* Do Shared Code initialization */
-	if (e1000_setup_init_funcs(&adapter->hw, TRUE)) {
+	if (igb_setup_init_funcs(&adapter->hw, TRUE)) {
 		device_printf(dev, "Setup of Shared code failed\n");
 		error = ENXIO;
 		goto err_pci;
 	}
 
-	e1000_get_bus_info(&adapter->hw);
+	igb_get_bus_info(&adapter->hw);
 
 	/* Sysctl for limiting the amount of work done in the taskqueue */
 	igb_set_sysctl_value(adapter, "rx_processing_limit",
@@ -541,9 +541,9 @@ igb_attach(device_t dev)
 		    "Disable Energy Efficient Ethernet");
 		if (adapter->hw.phy.media_type == e1000_media_type_copper) {
 			if (adapter->hw.mac.type == e1000_i354)
-				e1000_set_eee_i354(&adapter->hw);
+				igb_set_eee_i354(&adapter->hw);
 			else
-				e1000_set_eee_i350(&adapter->hw);
+				igb_set_eee_i350(&adapter->hw);
 		}
 	}
 
@@ -552,18 +552,18 @@ igb_attach(device_t dev)
 	** important in reading the nvm and
 	** mac from that.
 	*/
-	e1000_reset_hw(&adapter->hw);
+	igb_reset_hw(&adapter->hw);
 
 	/* Make sure we have a good EEPROM before we read from it */
 	if (((adapter->hw.mac.type != e1000_i210) &&
 	    (adapter->hw.mac.type != e1000_i211)) &&
-	    (e1000_validate_nvm_checksum(&adapter->hw) < 0)) {
+	    (igb_validate_nvm_checksum(&adapter->hw) < 0)) {
 		/*
 		** Some PCI-E parts fail the first check due to
 		** the link being in sleep state, call it again,
 		** if it fails a second time its a real issue.
 		*/
-		if (e1000_validate_nvm_checksum(&adapter->hw) < 0) {
+		if (igb_validate_nvm_checksum(&adapter->hw) < 0) {
 			device_printf(dev,
 			    "The EEPROM Checksum Is Not Valid\n");
 			error = EIO;
@@ -574,7 +574,7 @@ igb_attach(device_t dev)
 	/*
 	** Copy the permanent MAC address out of the EEPROM
 	*/
-	if (e1000_read_mac_addr(&adapter->hw) < 0) {
+	if (igb_read_mac_addr(&adapter->hw) < 0) {
 		device_printf(dev, "EEPROM read error while reading MAC"
 		    " address\n");
 		error = EIO;
@@ -601,12 +601,12 @@ igb_attach(device_t dev)
 	igb_update_link_status(adapter);
 
 	/* Indicate SOL/IDER usage */
-	if (e1000_check_reset_block(&adapter->hw))
+	if (igb_check_reset_block(&adapter->hw))
 		device_printf(dev,
 		    "PHY reset is blocked due to SOL/IDER session.\n");
 
 	/* Determine if we have to control management hardware */
-	adapter->has_manage = e1000_enable_mng_pass_thru(&adapter->hw);
+	adapter->has_manage = igb_enable_mng_pass_thru(&adapter->hw);
 
 	/*
 	 * Setup Wake-on-Lan
@@ -702,7 +702,7 @@ igb_detach(device_t dev)
 	igb_stop(adapter);
 	IGB_CORE_UNLOCK(adapter);
 
-	e1000_phy_hw_reset(&adapter->hw);
+	igb_phy_hw_reset(&adapter->hw);
 
 	/* Give control back to firmware */
 	igb_release_manageability(adapter);
@@ -1135,7 +1135,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm
 	case SIOCSIFMEDIA:
 		/* Check SOL/IDER usage */
 		IGB_CORE_LOCK(adapter);
-		if (e1000_check_reset_block(&adapter->hw)) {
+		if (igb_check_reset_block(&adapter->hw)) {
 			IGB_CORE_UNLOCK(adapter);
 			device_printf(adapter->dev, "Media change is"
 			    " blocked due to SOL/IDER session.\n");
@@ -1246,7 +1246,7 @@ igb_init_locked(struct adapter *adapter)
               ETHER_ADDR_LEN);
 
 	/* Put the address into the Receive Address Array */
-	e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
+	igb_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
 
 	igb_reset(adapter);
 	igb_update_link_status(adapter);
@@ -1294,7 +1294,7 @@ igb_init_locked(struct adapter *adapter)
 		return;
 	}
 	igb_initialize_receive_units(adapter);
-	e1000_rx_fifo_flush_82575(&adapter->hw);
+	igb_rx_fifo_flush_82575(&adapter->hw);
 
         /* Enable VLAN support */
 	if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
@@ -1307,7 +1307,7 @@ igb_init_locked(struct adapter *adapter)
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
 	callout_reset(&adapter->timer, hz, igb_local_timer, adapter);
-	e1000_clear_hw_cntrs_base_generic(&adapter->hw);
+	igb_clear_hw_cntrs_base_generic(&adapter->hw);
 
 	if (adapter->msix > 1) /* Set up queue routing */
 		igb_configure_queues(adapter);
@@ -1331,9 +1331,9 @@ igb_init_locked(struct adapter *adapter)
 	/* Set Energy Efficient Ethernet */
 	if (adapter->hw.phy.media_type == e1000_media_type_copper) {
 		if (adapter->hw.mac.type == e1000_i354)
-			e1000_set_eee_i354(&adapter->hw);
+			igb_set_eee_i354(&adapter->hw);
 		else
-			e1000_set_eee_i350(&adapter->hw);
+			igb_set_eee_i350(&adapter->hw);
 	}
 }
 
@@ -1925,7 +1925,7 @@ igb_set_promisc(struct adapter *adapter)
 	u32		reg;
 
 	if (adapter->vf_ifp) {
-		e1000_promisc_set_vf(hw, e1000_promisc_enabled);
+		igb_promisc_set_vf(hw, e1000_promisc_enabled);
 		return;
 	}
 
@@ -1949,7 +1949,7 @@ igb_disable_promisc(struct adapter *adap
 	int		mcnt = 0;
 
 	if (adapter->vf_ifp) {
-		e1000_promisc_set_vf(hw, e1000_promisc_disabled);
+		igb_promisc_set_vf(hw, e1000_promisc_disabled);
 		return;
 	}
 	reg = E1000_READ_REG(hw, E1000_RCTL);
@@ -2033,7 +2033,7 @@ igb_set_multi(struct adapter *adapter)
 		reg_rctl |= E1000_RCTL_MPE;
 		E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl);
 	} else
-		e1000_update_mc_addr_list(&adapter->hw, mta, mcnt);
+		igb_update_mc_addr_list(&adapter->hw, mta, mcnt);
 }
 
 
@@ -2121,23 +2121,23 @@ igb_update_link_status(struct adapter *a
         case e1000_media_type_copper:
                 if (hw->mac.get_link_status) {
 			/* Do the work to read phy */
-                        e1000_check_for_link(hw);
+                        igb_check_for_link(hw);
                         link_check = !hw->mac.get_link_status;
                 } else
                         link_check = TRUE;
                 break;
         case e1000_media_type_fiber:
-                e1000_check_for_link(hw);
+                igb_check_for_link(hw);
                 link_check = (E1000_READ_REG(hw, E1000_STATUS) &
                                  E1000_STATUS_LU);
                 break;
         case e1000_media_type_internal_serdes:
-                e1000_check_for_link(hw);
+                igb_check_for_link(hw);
                 link_check = adapter->hw.mac.serdes_has_link;
                 break;
 	/* VF device is type_unknown */
         case e1000_media_type_unknown:
-                e1000_check_for_link(hw);
+                igb_check_for_link(hw);
 		link_check = !hw->mac.get_link_status;
 		/* Fall thru */
         default:
@@ -2169,7 +2169,7 @@ igb_update_link_status(struct adapter *a
 
 	/* Now we check if a transition has happened */
 	if (link_check && (adapter->link_active == 0)) {
-		e1000_get_speed_and_duplex(&adapter->hw, 
+		igb_get_speed_and_duplex(&adapter->hw, 
 		    &adapter->link_speed, &adapter->link_duplex);
 		if (bootverbose)
 			device_printf(dev, "Link is up %d Mbps %s,"
@@ -2245,11 +2245,11 @@ igb_stop(void *arg)
 		IGB_TX_UNLOCK(txr);
 	}
 
-	e1000_reset_hw(&adapter->hw);
+	igb_reset_hw(&adapter->hw);
 	E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0);
 
-	e1000_led_off(&adapter->hw);
-	e1000_cleanup_led(&adapter->hw);
+	igb_led_off(&adapter->hw);
+	igb_cleanup_led(&adapter->hw);
 }
 
 
@@ -2277,7 +2277,7 @@ igb_identify_hardware(struct adapter *ad
 	    pci_read_config(dev, PCIR_SUBDEV_0, 2);
 
 	/* Set MAC type early for PCI setup */
-	e1000_set_mac_type(&adapter->hw);
+	igb_set_mac_type(&adapter->hw);
 
 	/* Are we a VF device? */
 	if ((adapter->hw.mac.type == e1000_vfadapt) ||
@@ -3016,7 +3016,7 @@ igb_reset(struct adapter *adapter)
 	case e1000_i354:
 	case e1000_vfadapt_i350:
 		pba = E1000_READ_REG(hw, E1000_RXPBS);
-		pba = e1000_rxpbs_adjust_82580(pba);
+		pba = igb_rxpbs_adjust_82580(pba);
 		break;
 	case e1000_i210:
 	case e1000_i211:
@@ -3081,25 +3081,25 @@ igb_reset(struct adapter *adapter)
 		fc->requested_mode = e1000_fc_default;
 
 	/* Issue a global reset */
-	e1000_reset_hw(hw);
+	igb_reset_hw(hw);
 	E1000_WRITE_REG(hw, E1000_WUC, 0);
 
 	/* Reset for AutoMediaDetect */
 	if (adapter->flags & IGB_MEDIA_RESET) {
-		e1000_setup_init_funcs(hw, TRUE);
-		e1000_get_bus_info(hw);
+		igb_setup_init_funcs(hw, TRUE);
+		igb_get_bus_info(hw);
 		adapter->flags &= ~IGB_MEDIA_RESET;
 	}
 
-	if (e1000_init_hw(hw) < 0)
+	if (igb_init_hw(hw) < 0)
 		device_printf(dev, "Hardware Initialization Failed\n");
 
 	/* Setup DMA Coalescing */
 	igb_init_dmac(adapter, pba);
 
 	E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN);
-	e1000_get_phy_info(hw);
-	e1000_check_for_link(hw);
+	igb_get_phy_info(hw);
+	igb_check_for_link(hw);
 	return;
 }
 
@@ -3621,7 +3621,7 @@ igb_initialize_transmit_units(struct ada
 	if (adapter->vf_ifp)
 		return;
 
-	e1000_config_collision_dist(hw);
+	igb_config_collision_dist(hw);
 
 	/* Program the Transmit Control Register */
 	tctl = E1000_READ_REG(hw, E1000_TCTL);
@@ -5266,7 +5266,7 @@ igb_setup_vlan_hw_support(struct adapter
 	u32             reg;
 
 	if (adapter->vf_ifp) {
-		e1000_rlpml_set_vf(hw,
+		igb_rlpml_set_vf(hw,
 		    adapter->max_frame_size + VLAN_TAG_SIZE);
 		return;
 	}
@@ -5298,10 +5298,10 @@ igb_setup_vlan_hw_support(struct adapter
 	for (int i = 0; i < IGB_VFTA_SIZE; i++)
                 if (adapter->shadow_vfta[i] != 0) {
 			if (adapter->vf_ifp)
-				e1000_vfta_set_vf(hw,
+				igb_vfta_set_vf(hw,
 				    adapter->shadow_vfta[i], TRUE);
 			else
-				e1000_write_vfta(hw,
+				igb_write_vfta(hw,
 				    i, adapter->shadow_vfta[i]);
 		}
 }
@@ -5464,11 +5464,11 @@ igb_led_func(void *arg, int onoff)
 
 	IGB_CORE_LOCK(adapter);
 	if (onoff) {
-		e1000_setup_led(&adapter->hw);
-		e1000_led_on(&adapter->hw);
+		igb_setup_led(&adapter->hw);
+		igb_led_on(&adapter->hw);
 	} else {
-		e1000_led_off(&adapter->hw);
-		e1000_cleanup_led(&adapter->hw);
+		igb_led_off(&adapter->hw);
+		igb_cleanup_led(&adapter->hw);
 	}
 	IGB_CORE_UNLOCK(adapter);
 }
@@ -6252,7 +6252,7 @@ igb_print_nvm_info(struct adapter *adapt
 			j = 0; ++row;
 			printf("\n0x00%x0  ",row);
 		}
-		e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data);
+		igb_read_nvm(&adapter->hw, i, 1, &eeprom_data);
 		printf("%04x ", eeprom_data);
 	}
 	printf("\n");
@@ -6302,7 +6302,7 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
 	}
 
 	adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
-	e1000_force_mac_fc(&adapter->hw);
+	igb_force_mac_fc(&adapter->hw);
 	/* XXX TODO: update DROP_EN on each RX queue if appropriate */
 	return (error);
 }

Modified: projects/intel_net_refactor/sys/dev/igb/if_igb.h
==============================================================================
--- projects/intel_net_refactor/sys/dev/e1000/if_igb.h	Fri Nov 13 16:35:22 2015	(r290770)
+++ projects/intel_net_refactor/sys/dev/igb/if_igb.h	Fri Nov 20 18:22:19 2015	(r291107)
@@ -88,8 +88,8 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
-#include "e1000_api.h"
-#include "e1000_82575.h"
+#include "igb_api.h"
+#include "igb_82575.h"
 
 /* Tunables */
 /*

Copied: projects/intel_net_refactor/sys/dev/igb/igb_80003es2lan.h (from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_80003es2lan.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/intel_net_refactor/sys/dev/igb/igb_80003es2lan.h	Fri Nov 20 18:22:19 2015	(r291107, copy of r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_80003es2lan.h)
@@ -0,0 +1,101 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2015, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _E1000_80003ES2LAN_H_
+#define _E1000_80003ES2LAN_H_
+
+#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL	0x00
+#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL	0x02
+#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL	0x10
+#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE	0x1F
+
+#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS	0x0008
+#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS	0x0800
+#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING	0x0010
+
+#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004
+#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT	0x0000
+#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE		0x2000
+
+#define E1000_KMRNCTRLSTA_OPMODE_MASK		0x000C
+#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO	0x0004
+
+#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gig Carry Extend Padding */
+#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN	0x00010000
+
+#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN	0x8
+#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN	0x9
+
+/* GG82563 PHY Specific Status Register (Page 0, Register 16 */
+#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE	0x0002 /* 1=Reversal Dis */
+#define GG82563_PSCR_CROSSOVER_MODE_MASK	0x0060
+#define GG82563_PSCR_CROSSOVER_MODE_MDI		0x0000 /* 00=Manual MDI */
+#define GG82563_PSCR_CROSSOVER_MODE_MDIX	0x0020 /* 01=Manual MDIX */
+#define GG82563_PSCR_CROSSOVER_MODE_AUTO	0x0060 /* 11=Auto crossover */
+
+/* PHY Specific Control Register 2 (Page 0, Register 26) */
+#define GG82563_PSCR2_REVERSE_AUTO_NEG		0x2000 /* 1=Reverse Auto-Neg */
+
+/* MAC Specific Control Register (Page 2, Register 21) */
+/* Tx clock speed for Link Down and 1000BASE-T for the following speeds */
+#define GG82563_MSCR_TX_CLK_MASK		0x0007
+#define GG82563_MSCR_TX_CLK_10MBPS_2_5		0x0004
+#define GG82563_MSCR_TX_CLK_100MBPS_25		0x0005
+#define GG82563_MSCR_TX_CLK_1000MBPS_25		0x0007
+
+#define GG82563_MSCR_ASSERT_CRS_ON_TX		0x0010 /* 1=Assert */
+
+/* DSP Distance Register (Page 5, Register 26)
+ * 0 = <50M
+ * 1 = 50-80M
+ * 2 = 80-100M
+ * 3 = 110-140M
+ * 4 = >140M
+ */
+#define GG82563_DSPD_CABLE_LENGTH		0x0007
+
+/* Kumeran Mode Control Register (Page 193, Register 16) */
+#define GG82563_KMCR_PASS_FALSE_CARRIER		0x0800
+
+/* Max number of times Kumeran read/write should be validated */
+#define GG82563_MAX_KMRN_RETRY			0x5
+
+/* Power Management Control Register (Page 193, Register 20) */
+/* 1=Enable SERDES Electrical Idle */
+#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE	0x0001
+
+/* In-Band Control Register (Page 194, Register 18) */
+#define GG82563_ICR_DIS_PADDING			0x0010 /* Disable Padding */
+
+#endif

Copied: projects/intel_net_refactor/sys/dev/igb/igb_82541.h (from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82541.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/intel_net_refactor/sys/dev/igb/igb_82541.h	Fri Nov 20 18:22:19 2015	(r291107, copy of r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82541.h)
@@ -0,0 +1,92 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2015, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _E1000_82541_H_
+#define _E1000_82541_H_
+
+#define NVM_WORD_SIZE_BASE_SHIFT_82541 (NVM_WORD_SIZE_BASE_SHIFT + 1)
+
+#define IGP01E1000_PHY_CHANNEL_NUM		4
+
+#define IGP01E1000_PHY_AGC_A			0x1172
+#define IGP01E1000_PHY_AGC_B			0x1272
+#define IGP01E1000_PHY_AGC_C			0x1472
+#define IGP01E1000_PHY_AGC_D			0x1872
+
+#define IGP01E1000_PHY_AGC_PARAM_A		0x1171
+#define IGP01E1000_PHY_AGC_PARAM_B		0x1271
+#define IGP01E1000_PHY_AGC_PARAM_C		0x1471
+#define IGP01E1000_PHY_AGC_PARAM_D		0x1871
+
+#define IGP01E1000_PHY_EDAC_MU_INDEX		0xC000
+#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS	0x8000
+
+#define IGP01E1000_PHY_DSP_RESET		0x1F33
+
+#define IGP01E1000_PHY_DSP_FFE			0x1F35
+#define IGP01E1000_PHY_DSP_FFE_CM_CP		0x0069
+#define IGP01E1000_PHY_DSP_FFE_DEFAULT		0x002A
+
+#define IGP01E1000_IEEE_FORCE_GIG		0x0140
+#define IGP01E1000_IEEE_RESTART_AUTONEG		0x3300
+
+#define IGP01E1000_AGC_LENGTH_SHIFT		7
+#define IGP01E1000_AGC_RANGE			10
+
+#define FFE_IDLE_ERR_COUNT_TIMEOUT_20		20
+#define FFE_IDLE_ERR_COUNT_TIMEOUT_100		100
+
+#define IGP01E1000_ANALOG_FUSE_STATUS		0x20D0
+#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS	0x20D1
+#define IGP01E1000_ANALOG_FUSE_CONTROL		0x20DC
+#define IGP01E1000_ANALOG_FUSE_BYPASS		0x20DE
+
+#define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED	0x0100
+#define IGP01E1000_ANALOG_FUSE_FINE_MASK	0x0F80
+#define IGP01E1000_ANALOG_FUSE_COARSE_MASK	0x0070
+#define IGP01E1000_ANALOG_FUSE_COARSE_THRESH	0x0040
+#define IGP01E1000_ANALOG_FUSE_COARSE_10	0x0010
+#define IGP01E1000_ANALOG_FUSE_FINE_1		0x0080
+#define IGP01E1000_ANALOG_FUSE_FINE_10		0x0500
+#define IGP01E1000_ANALOG_FUSE_POLY_MASK	0xF000
+#define IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL 0x0002
+
+#define IGP01E1000_MSE_CHANNEL_D		0x000F
+#define IGP01E1000_MSE_CHANNEL_C		0x00F0
+#define IGP01E1000_MSE_CHANNEL_B		0x0F00
+#define IGP01E1000_MSE_CHANNEL_A		0xF000
+
+
+void e1000_init_script_state_82541(struct e1000_hw *hw, bool state);
+#endif

Copied: projects/intel_net_refactor/sys/dev/igb/igb_82543.h (from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82543.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/intel_net_refactor/sys/dev/igb/igb_82543.h	Fri Nov 20 18:22:19 2015	(r291107, copy of r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82543.h)
@@ -0,0 +1,57 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2015, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _E1000_82543_H_
+#define _E1000_82543_H_
+
+#define PHY_PREAMBLE		0xFFFFFFFF
+#define PHY_PREAMBLE_SIZE	32
+#define PHY_SOF			0x1
+#define PHY_OP_READ		0x2
+#define PHY_OP_WRITE		0x1
+#define PHY_TURNAROUND		0x2
+
+#define TBI_COMPAT_ENABLED	0x1 /* Global "knob" for the workaround */
+/* If TBI_COMPAT_ENABLED, then this is the current state (on/off) */
+#define TBI_SBP_ENABLED		0x2
+
+void e1000_tbi_adjust_stats_82543(struct e1000_hw *hw,
+				  struct e1000_hw_stats *stats,
+				  u32 frame_len, u8 *mac_addr,
+				  u32 max_frame_size);
+void e1000_set_tbi_compatibility_82543(struct e1000_hw *hw,
+				       bool state);
+bool e1000_tbi_sbp_enabled_82543(struct e1000_hw *hw);
+
+#endif

Copied: projects/intel_net_refactor/sys/dev/igb/igb_82571.h (from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82571.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/intel_net_refactor/sys/dev/igb/igb_82571.h	Fri Nov 20 18:22:19 2015	(r291107, copy of r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82571.h)
@@ -0,0 +1,65 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2015, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _E1000_82571_H_
+#define _E1000_82571_H_
+
+#define ID_LED_RESERVED_F746	0xF746
+#define ID_LED_DEFAULT_82573	((ID_LED_DEF1_DEF2 << 12) | \
+				 (ID_LED_OFF1_ON2  <<  8) | \
+				 (ID_LED_DEF1_DEF2 <<  4) | \
+				 (ID_LED_DEF1_DEF2))
+
+#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX	0x08000000
+#define AN_RETRY_COUNT		5 /* Autoneg Retry Count value */
+
+/* Intr Throttling - RW */
+#define E1000_EITR_82574(_n)	(0x000E8 + (0x4 * (_n)))
+
+#define E1000_EIAC_82574	0x000DC /* Ext. Interrupt Auto Clear - RW */
+#define E1000_EIAC_MASK_82574	0x01F00000
+
+#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
+
+#define E1000_RXCFGL    0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */
+
+#define E1000_BASE1000T_STATUS		10
+#define E1000_IDLE_ERROR_COUNT_MASK	0xFF
+#define E1000_RECEIVE_ERROR_COUNTER	21
+#define E1000_RECEIVE_ERROR_MAX		0xFFFF
+bool e1000_check_phy_82574(struct e1000_hw *hw);
+bool e1000_get_laa_state_82571(struct e1000_hw *hw);
+void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state);
+
+#endif

Copied and modified: projects/intel_net_refactor/sys/dev/igb/igb_82575.c (from r290770, projects/intel_net_refactor/sys/dev/e1000/e1000_82575.c)
==============================================================================
--- projects/intel_net_refactor/sys/dev/e1000/e1000_82575.c	Fri Nov 13 16:35:22 2015	(r290770, copy source)
+++ projects/intel_net_refactor/sys/dev/igb/igb_82575.c	Fri Nov 20 18:22:19 2015	(r291107)
@@ -42,79 +42,79 @@
  * I350 Gigabit Network Connection
  */
 
-#include "e1000_api.h"
-#include "e1000_i210.h"
+#include "igb_api.h"
+#include "igb_i210.h"
 
-static s32  e1000_init_phy_params_82575(struct e1000_hw *hw);
-static s32  e1000_init_mac_params_82575(struct e1000_hw *hw);
-static s32  e1000_acquire_phy_82575(struct e1000_hw *hw);
-static void e1000_release_phy_82575(struct e1000_hw *hw);
-static s32  e1000_acquire_nvm_82575(struct e1000_hw *hw);
-static void e1000_release_nvm_82575(struct e1000_hw *hw);
-static s32  e1000_check_for_link_82575(struct e1000_hw *hw);
-static s32  e1000_check_for_link_media_swap(struct e1000_hw *hw);
-static s32  e1000_get_cfg_done_82575(struct e1000_hw *hw);
-static s32  e1000_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
+static s32  igb_init_phy_params_82575(struct e1000_hw *hw);
+static s32  igb_init_mac_params_82575(struct e1000_hw *hw);
+static s32  igb_acquire_phy_82575(struct e1000_hw *hw);
+static void igb_release_phy_82575(struct e1000_hw *hw);
+static s32  igb_acquire_nvm_82575(struct e1000_hw *hw);
+static void igb_release_nvm_82575(struct e1000_hw *hw);
+static s32  igb_check_for_link_82575(struct e1000_hw *hw);
+static s32  igb_check_for_link_media_swap(struct e1000_hw *hw);
+static s32  igb_get_cfg_done_82575(struct e1000_hw *hw);
+static s32  igb_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
 					 u16 *duplex);
-static s32  e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw);
-static s32  e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
+static s32  igb_phy_hw_reset_sgmii_82575(struct e1000_hw *hw);
+static s32  igb_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
 					   u16 *data);
-static s32  e1000_reset_hw_82575(struct e1000_hw *hw);
-static s32  e1000_reset_hw_82580(struct e1000_hw *hw);
-static s32  e1000_read_phy_reg_82580(struct e1000_hw *hw,
+static s32  igb_reset_hw_82575(struct e1000_hw *hw);
+static s32  igb_reset_hw_82580(struct e1000_hw *hw);
+static s32  igb_read_phy_reg_82580(struct e1000_hw *hw,
 				     u32 offset, u16 *data);
-static s32  e1000_write_phy_reg_82580(struct e1000_hw *hw,
+static s32  igb_write_phy_reg_82580(struct e1000_hw *hw,
 				      u32 offset, u16 data);
-static s32  e1000_set_d0_lplu_state_82580(struct e1000_hw *hw,
+static s32  igb_set_d0_lplu_state_82580(struct e1000_hw *hw,
 					  bool active);
-static s32  e1000_set_d3_lplu_state_82580(struct e1000_hw *hw,
+static s32  igb_set_d3_lplu_state_82580(struct e1000_hw *hw,
 					  bool active);
-static s32  e1000_set_d0_lplu_state_82575(struct e1000_hw *hw,
+static s32  igb_set_d0_lplu_state_82575(struct e1000_hw *hw,
 					  bool active);
-static s32  e1000_setup_copper_link_82575(struct e1000_hw *hw);
-static s32  e1000_setup_serdes_link_82575(struct e1000_hw *hw);
-static s32  e1000_get_media_type_82575(struct e1000_hw *hw);
-static s32  e1000_set_sfp_media_type_82575(struct e1000_hw *hw);
-static s32  e1000_valid_led_default_82575(struct e1000_hw *hw, u16 *data);
-static s32  e1000_write_phy_reg_sgmii_82575(struct e1000_hw *hw,
+static s32  igb_setup_copper_link_82575(struct e1000_hw *hw);
+static s32  igb_setup_serdes_link_82575(struct e1000_hw *hw);
+static s32  igb_get_media_type_82575(struct e1000_hw *hw);
+static s32  igb_set_sfp_media_type_82575(struct e1000_hw *hw);
+static s32  igb_valid_led_default_82575(struct e1000_hw *hw, u16 *data);
+static s32  igb_write_phy_reg_sgmii_82575(struct e1000_hw *hw,
 					    u32 offset, u16 data);
-static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw);
-static s32  e1000_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
-static s32  e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw,
+static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw);
+static s32  igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
+static s32  igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw,
 						 u16 *speed, u16 *duplex);
-static s32  e1000_get_phy_id_82575(struct e1000_hw *hw);
-static void e1000_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
-static bool e1000_sgmii_active_82575(struct e1000_hw *hw);
-static s32  e1000_reset_init_script_82575(struct e1000_hw *hw);
-static s32  e1000_read_mac_addr_82575(struct e1000_hw *hw);
-static void e1000_config_collision_dist_82575(struct e1000_hw *hw);
-static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw);
-static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw);
-static void e1000_power_up_serdes_link_82575(struct e1000_hw *hw);
-static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw);
-static s32 e1000_reset_mdicnfg_82580(struct e1000_hw *hw);
-static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw);
-static s32 e1000_update_nvm_checksum_82580(struct e1000_hw *hw);
-static s32 e1000_update_nvm_checksum_with_offset(struct e1000_hw *hw,
+static s32  igb_get_phy_id_82575(struct e1000_hw *hw);
+static void igb_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
+static bool igb_sgmii_active_82575(struct e1000_hw *hw);
+static s32  igb_reset_init_script_82575(struct e1000_hw *hw);
+static s32  igb_read_mac_addr_82575(struct e1000_hw *hw);
+static void igb_config_collision_dist_82575(struct e1000_hw *hw);
+static void igb_power_down_phy_copper_82575(struct e1000_hw *hw);
+static void igb_shutdown_serdes_link_82575(struct e1000_hw *hw);
+static void igb_power_up_serdes_link_82575(struct e1000_hw *hw);
+static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw);
+static s32 igb_reset_mdicnfg_82580(struct e1000_hw *hw);
+static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw);
+static s32 igb_update_nvm_checksum_82580(struct e1000_hw *hw);
+static s32 igb_update_nvm_checksum_with_offset(struct e1000_hw *hw,
 						 u16 offset);
-static s32 e1000_validate_nvm_checksum_with_offset(struct e1000_hw *hw,
+static s32 igb_validate_nvm_checksum_with_offset(struct e1000_hw *hw,
 						   u16 offset);
-static s32 e1000_validate_nvm_checksum_i350(struct e1000_hw *hw);
-static s32 e1000_update_nvm_checksum_i350(struct e1000_hw *hw);
-static void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
-static void e1000_clear_vfta_i350(struct e1000_hw *hw);
-
-static void e1000_i2c_start(struct e1000_hw *hw);
-static void e1000_i2c_stop(struct e1000_hw *hw);
-static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data);
-static s32 e1000_clock_out_i2c_byte(struct e1000_hw *hw, u8 data);
-static s32 e1000_get_i2c_ack(struct e1000_hw *hw);
-static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data);
-static s32 e1000_clock_out_i2c_bit(struct e1000_hw *hw, bool data);
-static void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl);
-static void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl);
-static s32 e1000_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data);
-static bool e1000_get_i2c_data(u32 *i2cctl);
+static s32 igb_validate_nvm_checksum_i350(struct e1000_hw *hw);
+static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw);
+static void igb_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
+static void igb_clear_vfta_i350(struct e1000_hw *hw);
+
+static void igb_i2c_start(struct e1000_hw *hw);
+static void igb_i2c_stop(struct e1000_hw *hw);
+static s32 igb_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data);
+static s32 igb_clock_out_i2c_byte(struct e1000_hw *hw, u8 data);
+static s32 igb_get_i2c_ack(struct e1000_hw *hw);
+static s32 igb_clock_in_i2c_bit(struct e1000_hw *hw, bool *data);
+static s32 igb_clock_out_i2c_bit(struct e1000_hw *hw, bool data);
+static void igb_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl);
+static void igb_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl);
+static s32 igb_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data);
+static bool igb_get_i2c_data(u32 *i2cctl);
 
 static const u16 e1000_82580_rxpbs_table[] = {
 	36, 72, 144, 1, 2, 4, 8, 16, 35, 70, 140 };
@@ -130,7 +130,7 @@ static const u16 e1000_82580_rxpbs_table
  *  Called to determine if the I2C pins are being used for I2C or as an
  *  external MDIO interface since the two options are mutually exclusive.
  **/
-static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw)
+static bool igb_sgmii_uses_mdio_82575(struct e1000_hw *hw)
 {
 	u32 reg = 0;
 	bool ext_mdio = FALSE;
@@ -161,7 +161,7 @@ static bool e1000_sgmii_uses_mdio_82575(
  *  e1000_init_phy_params_82575 - Init PHY func ptrs.
  *  @hw: pointer to the HW structure
  **/
-static s32 e1000_init_phy_params_82575(struct e1000_hw *hw)
+static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
 {
 	struct e1000_phy_info *phy = &hw->phy;
 	s32 ret_val = E1000_SUCCESS;
@@ -169,63 +169,63 @@ static s32 e1000_init_phy_params_82575(s
 
 	DEBUGFUNC("e1000_init_phy_params_82575");
 
-	phy->ops.read_i2c_byte = e1000_read_i2c_byte_generic;
-	phy->ops.write_i2c_byte = e1000_write_i2c_byte_generic;
+	phy->ops.read_i2c_byte = igb_read_i2c_byte_generic;
+	phy->ops.write_i2c_byte = igb_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_82575;
+	phy->ops.power_up   = igb_power_up_phy_copper;
+	phy->ops.power_down = igb_power_down_phy_copper_82575;
 
 	phy->autoneg_mask	= AUTONEG_ADVERTISE_SPEED_DEFAULT;
 	phy->reset_delay_us	= 100;
 
-	phy->ops.acquire	= e1000_acquire_phy_82575;
-	phy->ops.check_reset_block = e1000_check_reset_block_generic;
-	phy->ops.commit		= e1000_phy_sw_reset_generic;
-	phy->ops.get_cfg_done	= e1000_get_cfg_done_82575;
-	phy->ops.release	= e1000_release_phy_82575;
+	phy->ops.acquire	= igb_acquire_phy_82575;
+	phy->ops.check_reset_block = igb_check_reset_block_generic;
+	phy->ops.commit		= igb_phy_sw_reset_generic;
+	phy->ops.get_cfg_done	= igb_get_cfg_done_82575;
+	phy->ops.release	= igb_release_phy_82575;
 
 	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 
-	if (e1000_sgmii_active_82575(hw)) {
-		phy->ops.reset = e1000_phy_hw_reset_sgmii_82575;
+	if (igb_sgmii_active_82575(hw)) {
+		phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
 		ctrl_ext |= E1000_CTRL_I2C_ENA;
 	} else {
-		phy->ops.reset = e1000_phy_hw_reset_generic;
+		phy->ops.reset = igb_phy_hw_reset_generic;
 		ctrl_ext &= ~E1000_CTRL_I2C_ENA;
 	}
 
 	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
-	e1000_reset_mdicnfg_82580(hw);
+	igb_reset_mdicnfg_82580(hw);
 
-	if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) {
-		phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575;
-		phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575;
+	if (igb_sgmii_active_82575(hw) && !igb_sgmii_uses_mdio_82575(hw)) {
+		phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
+		phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
 	} else {
 		switch (hw->mac.type) {
 		case e1000_82580:
 		case e1000_i350:
 		case e1000_i354:
-			phy->ops.read_reg = e1000_read_phy_reg_82580;
-			phy->ops.write_reg = e1000_write_phy_reg_82580;
+			phy->ops.read_reg = igb_read_phy_reg_82580;
+			phy->ops.write_reg = igb_write_phy_reg_82580;
 			break;
 		case e1000_i210:
 		case e1000_i211:
-			phy->ops.read_reg = e1000_read_phy_reg_gs40g;
-			phy->ops.write_reg = e1000_write_phy_reg_gs40g;
+			phy->ops.read_reg = igb_read_phy_reg_gs40g;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511201822.tAKIMJxl074589>