Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2021 01:33:12 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 4418b03c6759 - stable/13 - ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
Message-ID:  <202110030133.1931XCBs013116@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=4418b03c675939033682722fe65e8ddab39cbc25

commit 4418b03c675939033682722fe65e8ddab39cbc25
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2021-09-25 23:12:23 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-10-03 01:32:01 +0000

    ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
    
    Rename the 'struct adapter' to 'struct ixgbe_softc' to avoid type
    ambiguity in things like kgdb.
    
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D32131
    
    (cherry picked from commit b1d5caf3c7504a1ece0498ec3f7360ac760577f7)
---
 sys/dev/ixgbe/if_bypass.c    |  186 +++----
 sys/dev/ixgbe/if_fdir.c      |   26 +-
 sys/dev/ixgbe/if_ix.c        | 1263 +++++++++++++++++++++---------------------
 sys/dev/ixgbe/if_ixv.c       |  602 ++++++++++----------
 sys/dev/ixgbe/if_sriov.c     |  296 +++++-----
 sys/dev/ixgbe/ix_txrx.c      |   47 +-
 sys/dev/ixgbe/ixgbe.h        |   22 +-
 sys/dev/ixgbe/ixgbe_bypass.h |    2 +-
 sys/dev/ixgbe/ixgbe_fdir.h   |    2 +-
 sys/dev/ixgbe/ixgbe_osdep.c  |   20 +-
 sys/dev/ixgbe/ixgbe_sriov.h  |    8 +-
 11 files changed, 1232 insertions(+), 1242 deletions(-)

diff --git a/sys/dev/ixgbe/if_bypass.c b/sys/dev/ixgbe/if_bypass.c
index 41669e29d475..7e8848512e05 100644
--- a/sys/dev/ixgbe/if_bypass.c
+++ b/sys/dev/ixgbe/if_bypass.c
@@ -43,11 +43,11 @@
  *   over other threads.
  ************************************************************************/
 static void
-ixgbe_bypass_mutex_enter(struct adapter *adapter)
+ixgbe_bypass_mutex_enter(struct ixgbe_softc *sc)
 {
-	while (atomic_cmpset_int(&adapter->bypass.low, 0, 1) == 0)
+	while (atomic_cmpset_int(&sc->bypass.low, 0, 1) == 0)
 		usec_delay(3000);
-	while (atomic_cmpset_int(&adapter->bypass.high, 0, 1) == 0)
+	while (atomic_cmpset_int(&sc->bypass.high, 0, 1) == 0)
 		usec_delay(3000);
 	return;
 } /* ixgbe_bypass_mutex_enter */
@@ -56,11 +56,11 @@ ixgbe_bypass_mutex_enter(struct adapter *adapter)
  * ixgbe_bypass_mutex_clear
  ************************************************************************/
 static void
-ixgbe_bypass_mutex_clear(struct adapter *adapter)
+ixgbe_bypass_mutex_clear(struct ixgbe_softc *sc)
 {
-	while (atomic_cmpset_int(&adapter->bypass.high, 1, 0) == 0)
+	while (atomic_cmpset_int(&sc->bypass.high, 1, 0) == 0)
 		usec_delay(6000);
-	while (atomic_cmpset_int(&adapter->bypass.low, 1, 0) == 0)
+	while (atomic_cmpset_int(&sc->bypass.low, 1, 0) == 0)
 		usec_delay(6000);
 	return;
 } /* ixgbe_bypass_mutex_clear */
@@ -71,9 +71,9 @@ ixgbe_bypass_mutex_clear(struct adapter *adapter)
  *   Watchdog entry is allowed to simply grab the high priority
  ************************************************************************/
 static void
-ixgbe_bypass_wd_mutex_enter(struct adapter *adapter)
+ixgbe_bypass_wd_mutex_enter(struct ixgbe_softc *sc)
 {
-	while (atomic_cmpset_int(&adapter->bypass.high, 0, 1) == 0)
+	while (atomic_cmpset_int(&sc->bypass.high, 0, 1) == 0)
 		usec_delay(3000);
 	return;
 } /* ixgbe_bypass_wd_mutex_enter */
@@ -82,9 +82,9 @@ ixgbe_bypass_wd_mutex_enter(struct adapter *adapter)
  * ixgbe_bypass_wd_mutex_clear
  ************************************************************************/
 static void
-ixgbe_bypass_wd_mutex_clear(struct adapter *adapter)
+ixgbe_bypass_wd_mutex_clear(struct ixgbe_softc *sc)
 {
-	while (atomic_cmpset_int(&adapter->bypass.high, 1, 0) == 0)
+	while (atomic_cmpset_int(&sc->bypass.high, 1, 0) == 0)
 		usec_delay(6000);
 	return;
 } /* ixgbe_bypass_wd_mutex_clear */
@@ -115,13 +115,13 @@ ixgbe_get_bypass_time(u32 *year, u32 *sec)
 static int
 ixgbe_bp_version(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      version = 0;
 	u32             cmd;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	cmd = BYPASS_PAGE_CTL2 | BYPASS_WE;
 	cmd |= (BYPASS_EEPROM_VER_ADD << BYPASS_CTL2_OFFSET_SHIFT) &
 	    BYPASS_CTL2_OFFSET_M;
@@ -131,12 +131,12 @@ ixgbe_bp_version(SYSCTL_HANDLER_ARGS)
 	cmd &= ~BYPASS_WE;
 	if ((error = hw->mac.ops.bypass_rw(hw, cmd, &version) != 0))
 		goto err;
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	version &= BYPASS_CTL2_DATA_M;
 	error = sysctl_handle_int(oidp, &version, 0, req);
 	return (error);
 err:
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	return (error);
 
 } /* ixgbe_bp_version */
@@ -155,16 +155,16 @@ err:
 static int
 ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      state = 0;
 
 	/* Get the current state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw,
 	    BYPASS_PAGE_CTL0, &state);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error != 0)
 		return (error);
 	state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3;
@@ -182,7 +182,7 @@ ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS)
 	default:
 		return (EINVAL);
 	}
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	if ((error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_MODE_OFF_M, state) != 0))
 		goto out;
@@ -190,7 +190,7 @@ ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS)
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_MODE_OFF_M, BYPASS_AUTO);
 out:
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_set_state */
@@ -217,15 +217,15 @@ out:
 static int
 ixgbe_bp_timeout(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      timeout = 0;
 
 	/* Get the current value */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &timeout);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 	timeout = (timeout >> BYPASS_WDTIMEOUT_SHIFT) & 0x3;
@@ -246,10 +246,10 @@ ixgbe_bp_timeout(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_WDTIMEOUT_M, timeout << BYPASS_WDTIMEOUT_SHIFT);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_timeout */
@@ -260,15 +260,15 @@ ixgbe_bp_timeout(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_main_on(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      main_on = 0;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &main_on);
 	main_on = (main_on >> BYPASS_MAIN_ON_SHIFT) & 0x3;
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 
@@ -288,10 +288,10 @@ ixgbe_bp_main_on(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_MAIN_ON_M, main_on << BYPASS_MAIN_ON_SHIFT);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_main_on */
@@ -302,14 +302,14 @@ ixgbe_bp_main_on(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_main_off(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      main_off = 0;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &main_off);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 	main_off = (main_off >> BYPASS_MAIN_OFF_SHIFT) & 0x3;
@@ -330,10 +330,10 @@ ixgbe_bp_main_off(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_MAIN_OFF_M, main_off << BYPASS_MAIN_OFF_SHIFT);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_main_off */
@@ -344,14 +344,14 @@ ixgbe_bp_main_off(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_aux_on(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      aux_on = 0;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &aux_on);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 	aux_on = (aux_on >> BYPASS_AUX_ON_SHIFT) & 0x3;
@@ -372,10 +372,10 @@ ixgbe_bp_aux_on(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_AUX_ON_M, aux_on << BYPASS_AUX_ON_SHIFT);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_aux_on */
@@ -386,14 +386,14 @@ ixgbe_bp_aux_on(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_aux_off(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error = 0;
 	static int      aux_off = 0;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &aux_off);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 	aux_off = (aux_off >> BYPASS_AUX_OFF_SHIFT) & 0x3;
@@ -414,10 +414,10 @@ ixgbe_bp_aux_off(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new state */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0,
 	    BYPASS_AUX_OFF_M, aux_off << BYPASS_AUX_OFF_SHIFT);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	usec_delay(6000);
 	return (error);
 } /* ixgbe_bp_aux_off */
@@ -433,16 +433,16 @@ ixgbe_bp_aux_off(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	int             error, tmp;
 	static int      timeout = 0;
 	u32             mask, arg;
 
 	/* Get the current hardware value */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &tmp);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	if (error)
 		return (error);
 	/*
@@ -489,9 +489,9 @@ ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS)
 	}
 
 	/* Set the new watchdog */
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 
 	return (error);
 } /* ixgbe_bp_wd_set */
@@ -504,8 +504,8 @@ ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter  *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_softc  *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw *hw = &sc->hw;
 	u32             sec, year;
 	int             cmd, count = 0, error = 0;
 	int             reset_wd = 0;
@@ -522,7 +522,7 @@ ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS)
 	cmd |= (sec & BYPASS_CTL1_TIME_M) | BYPASS_CTL1_VALID;
 	cmd |= BYPASS_CTL1_OFFTRST;
 
-	ixgbe_bypass_wd_mutex_enter(adapter);
+	ixgbe_bypass_wd_mutex_enter(sc);
 	error = hw->mac.ops.bypass_rw(hw, cmd, &reset_wd);
 
 	/* Read until it matches what we wrote, or we time out */
@@ -539,7 +539,7 @@ ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS)
 	} while (!hw->mac.ops.bypass_valid_rd(cmd, reset_wd));
 
 	reset_wd = 0;
-	ixgbe_bypass_wd_mutex_clear(adapter);
+	ixgbe_bypass_wd_mutex_clear(sc);
 	return (error);
 } /* ixgbe_bp_wd_reset */
 
@@ -551,8 +551,8 @@ ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS)
 static int
 ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 {
-	struct adapter             *adapter = (struct adapter *) arg1;
-	struct ixgbe_hw            *hw = &adapter->hw;
+	struct ixgbe_softc             *sc = (struct ixgbe_softc *) arg1;
+	struct ixgbe_hw            *hw = &sc->hw;
 	u32                        cmd, base, head;
 	u32                        log_off, count = 0;
 	static int                 status = 0;
@@ -565,10 +565,10 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 		return (error);
 
 	/* Keep the log display single-threaded */
-	while (atomic_cmpset_int(&adapter->bypass.log, 0, 1) == 0)
+	while (atomic_cmpset_int(&sc->bypass.log, 0, 1) == 0)
 		usec_delay(3000);
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 
 	/* Find Current head of the log eeprom offset */
 	cmd = BYPASS_PAGE_CTL2 | BYPASS_WE;
@@ -586,7 +586,7 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 	if (error)
 		goto unlock_err;
 
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 
 	base = status & BYPASS_CTL2_DATA_M;
 	head = (status & BYPASS_CTL2_HEAD_M) >> BYPASS_CTL2_HEAD_SHIFT;
@@ -601,19 +601,19 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 
 		/* Log 5 bytes store in on u32 and a u8 */
 		for (i = 0; i < 4; i++) {
-			ixgbe_bypass_mutex_enter(adapter);
+			ixgbe_bypass_mutex_enter(sc);
 			error = hw->mac.ops.bypass_rd_eep(hw, log_off + i,
 			    &data);
-			ixgbe_bypass_mutex_clear(adapter);
+			ixgbe_bypass_mutex_clear(sc);
 			if (error)
 				return (EINVAL);
 			eeprom[count].logs += data << (8 * i);
 		}
 
-		ixgbe_bypass_mutex_enter(adapter);
+		ixgbe_bypass_mutex_enter(sc);
 		error = hw->mac.ops.bypass_rd_eep(hw,
 		    log_off + i, &eeprom[count].actions);
-		ixgbe_bypass_mutex_clear(adapter);
+		ixgbe_bypass_mutex_clear(sc);
 		if (error)
 			return (EINVAL);
 
@@ -668,7 +668,7 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 		time %= (60 * 60);
 		min = time / 60;
 		sec = time % 60;
-		device_printf(adapter->dev,
+		device_printf(sc->dev,
 		    "UT %02d/%02d %02d:%02d:%02d %8.8s -> %7.7s\n",
 		    mon, days, hours, min, sec, event_str[event],
 		    action_str[action]);
@@ -677,14 +677,14 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 		    << BYPASS_CTL2_OFFSET_SHIFT) & BYPASS_CTL2_OFFSET_M;
 		cmd |= ((eeprom[count].logs & ~BYPASS_LOG_CLEAR_M) >> 24);
 
-		ixgbe_bypass_mutex_enter(adapter);
+		ixgbe_bypass_mutex_enter(sc);
 
 		error = hw->mac.ops.bypass_rw(hw, cmd, &status);
 
 		/* wait for the write to stick */
 		msec_delay(100);
 
-		ixgbe_bypass_mutex_clear(adapter);
+		ixgbe_bypass_mutex_clear(sc);
 
 		if (error)
 			return (EINVAL);
@@ -692,14 +692,14 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
 
 	status = 0; /* reset */
 	/* Another log command can now run */
-	while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0)
+	while (atomic_cmpset_int(&sc->bypass.log, 1, 0) == 0)
 		usec_delay(3000);
 	return (error);
 
 unlock_err:
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 	status = 0; /* reset */
-	while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0)
+	while (atomic_cmpset_int(&sc->bypass.log, 1, 0) == 0)
 		usec_delay(3000);
 	return (EINVAL);
 } /* ixgbe_bp_log */
@@ -711,15 +711,15 @@ unlock_err:
  *   only enabled for the first port of a bypass adapter.
  ************************************************************************/
 void
-ixgbe_bypass_init(struct adapter *adapter)
+ixgbe_bypass_init(struct ixgbe_softc *sc)
 {
-	struct ixgbe_hw        *hw = &adapter->hw;
-	device_t               dev = adapter->dev;
+	struct ixgbe_hw        *hw = &sc->hw;
+	device_t               dev = sc->dev;
 	struct sysctl_oid      *bp_node;
 	struct sysctl_oid_list *bp_list;
 	u32                    mask, value, sec, year;
 
-	if (!(adapter->feat_cap & IXGBE_FEATURE_BYPASS))
+	if (!(sc->feat_cap & IXGBE_FEATURE_BYPASS))
 		return;
 
 	/* First set up time for the hardware */
@@ -733,9 +733,9 @@ ixgbe_bypass_init(struct adapter *adapter)
 	      | BYPASS_CTL1_VALID
 	      | BYPASS_CTL1_OFFTRST;
 
-	ixgbe_bypass_mutex_enter(adapter);
+	ixgbe_bypass_mutex_enter(sc);
 	hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL1, mask, value);
-	ixgbe_bypass_mutex_clear(adapter);
+	ixgbe_bypass_mutex_clear(sc);
 
 	/* Now set up the SYSCTL infrastructure */
 
@@ -748,7 +748,7 @@ ixgbe_bypass_init(struct adapter *adapter)
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 	    OID_AUTO, "bypass_log",
 	    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_log, "I", "Bypass Log");
+	    sc, 0, ixgbe_bp_log, "I", "Bypass Log");
 
 	/* All other setting are hung from the 'bypass' node */
 	bp_node = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
@@ -759,40 +759,40 @@ ixgbe_bypass_init(struct adapter *adapter)
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "version", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_version, "I", "Bypass Version");
+	    sc, 0, ixgbe_bp_version, "I", "Bypass Version");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_set_state, "I", "Bypass State");
+	    sc, 0, ixgbe_bp_set_state, "I", "Bypass State");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "timeout", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_timeout, "I", "Bypass Timeout");
+	    sc, 0, ixgbe_bp_timeout, "I", "Bypass Timeout");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "main_on", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_main_on, "I", "Bypass Main On");
+	    sc, 0, ixgbe_bp_main_on, "I", "Bypass Main On");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "main_off", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_main_off, "I", "Bypass Main Off");
+	    sc, 0, ixgbe_bp_main_off, "I", "Bypass Main Off");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "aux_on", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_aux_on, "I", "Bypass Aux On");
+	    sc, 0, ixgbe_bp_aux_on, "I", "Bypass Aux On");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "aux_off", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_aux_off, "I", "Bypass Aux Off");
+	    sc, 0, ixgbe_bp_aux_off, "I", "Bypass Aux Off");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "wd_set", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_wd_set, "I", "Set BP Watchdog");
+	    sc, 0, ixgbe_bp_wd_set, "I", "Set BP Watchdog");
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list,
 	    OID_AUTO, "wd_reset", CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_NEEDGIANT,
-	    adapter, 0, ixgbe_bp_wd_reset, "S", "Bypass WD Reset");
+	    sc, 0, ixgbe_bp_wd_reset, "S", "Bypass WD Reset");
 
-	adapter->feat_en |= IXGBE_FEATURE_BYPASS;
+	sc->feat_en |= IXGBE_FEATURE_BYPASS;
 } /* ixgbe_bypass_init */
 
diff --git a/sys/dev/ixgbe/if_fdir.c b/sys/dev/ixgbe/if_fdir.c
index 09a5b70464ae..22b71f2bdf09 100644
--- a/sys/dev/ixgbe/if_fdir.c
+++ b/sys/dev/ixgbe/if_fdir.c
@@ -37,33 +37,33 @@
 #ifdef IXGBE_FDIR
 
 void
-ixgbe_init_fdir(struct adapter *adapter)
+ixgbe_init_fdir(struct ixgbe_softc *sc)
 {
 	u32 hdrm = 32 << fdir_pballoc;
 
-	if (!(adapter->feat_en & IXGBE_FEATURE_FDIR))
+	if (!(sc->feat_en & IXGBE_FEATURE_FDIR))
 		return;
 
-	adapter->hw.mac.ops.setup_rxpba(&adapter->hw, 0, hdrm,
+	sc->hw.mac.ops.setup_rxpba(&sc->hw, 0, hdrm,
 	    PBA_STRATEGY_EQUAL);
-	ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc);
+	ixgbe_init_fdir_signature_82599(&sc->hw, fdir_pballoc);
 } /* ixgbe_init_fdir */
 
 void
 ixgbe_reinit_fdir(void *context)
 {
 	if_ctx_t       ctx = context;
-	struct adapter *adapter = iflib_get_softc(ctx);
+	struct ixgbe_softc *sc = iflib_get_softc(ctx);
 	struct ifnet   *ifp = iflib_get_ifp(ctx);
 
-	if (!(adapter->feat_en & IXGBE_FEATURE_FDIR))
+	if (!(sc->feat_en & IXGBE_FEATURE_FDIR))
 		return;
-	if (adapter->fdir_reinit != 1) /* Shouldn't happen */
+	if (sc->fdir_reinit != 1) /* Shouldn't happen */
 		return;
-	ixgbe_reinit_fdir_tables_82599(&adapter->hw);
-	adapter->fdir_reinit = 0;
+	ixgbe_reinit_fdir_tables_82599(&sc->hw);
+	sc->fdir_reinit = 0;
 	/* re-enable flow director interrupts */
-	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR);
+	IXGBE_WRITE_REG(&sc->hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR);
 	/* Restart the interface */
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 } /* ixgbe_reinit_fdir */
@@ -80,7 +80,7 @@ ixgbe_reinit_fdir(void *context)
 void
 ixgbe_atr(struct tx_ring *txr, struct mbuf *mp)
 {
-	struct adapter             *adapter = txr->adapter;
+	struct ixgbe_softc             *sc = txr->sc;
 	struct ix_queue            *que;
 	struct ip                  *ip;
 	struct tcphdr              *th;
@@ -134,12 +134,12 @@ ixgbe_atr(struct tx_ring *txr, struct mbuf *mp)
 		common.flex_bytes ^= etype;
 	common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr;
 
-	que = &adapter->queues[txr->me];
+	que = &sc->queues[txr->me];
 	/*
 	 * This assumes the Rx queue and Tx
 	 * queue are bound to the same CPU
 	 */
-	ixgbe_fdir_add_signature_filter_82599(&adapter->hw,
+	ixgbe_fdir_add_signature_filter_82599(&sc->hw,
 	    input, common, que->msix);
 } /* ixgbe_atr */
 
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 42523f82cc01..b3960a129c29 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -109,87 +109,82 @@ static pci_vendor_info_t ixgbe_vendor_info_array[] =
   PVID_END
 };
 
-static void *ixgbe_register(device_t dev);
-static int  ixgbe_if_attach_pre(if_ctx_t ctx);
-static int  ixgbe_if_attach_post(if_ctx_t ctx);
-static int  ixgbe_if_detach(if_ctx_t ctx);
-static int  ixgbe_if_shutdown(if_ctx_t ctx);
-static int  ixgbe_if_suspend(if_ctx_t ctx);
-static int  ixgbe_if_resume(if_ctx_t ctx);
-
-static void ixgbe_if_stop(if_ctx_t ctx);
-void ixgbe_if_enable_intr(if_ctx_t ctx);
-static void ixgbe_if_disable_intr(if_ctx_t ctx);
-static void ixgbe_link_intr_enable(if_ctx_t ctx);
-static int  ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid);
-static void ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq * ifmr);
-static int  ixgbe_if_media_change(if_ctx_t ctx);
+static void *ixgbe_register(device_t);
+static int  ixgbe_if_attach_pre(if_ctx_t);
+static int  ixgbe_if_attach_post(if_ctx_t);
+static int  ixgbe_if_detach(if_ctx_t);
+static int  ixgbe_if_shutdown(if_ctx_t);
+static int  ixgbe_if_suspend(if_ctx_t);
+static int  ixgbe_if_resume(if_ctx_t);
+
+static void ixgbe_if_stop(if_ctx_t);
+void ixgbe_if_enable_intr(if_ctx_t);
+static void ixgbe_if_disable_intr(if_ctx_t);
+static void ixgbe_link_intr_enable(if_ctx_t);
+static int  ixgbe_if_rx_queue_intr_enable(if_ctx_t, uint16_t);
+static void ixgbe_if_media_status(if_ctx_t, struct ifmediareq *);
+static int  ixgbe_if_media_change(if_ctx_t);
 static int  ixgbe_if_msix_intr_assign(if_ctx_t, int);
-static int  ixgbe_if_mtu_set(if_ctx_t ctx, uint32_t mtu);
-static void ixgbe_if_crcstrip_set(if_ctx_t ctx, int onoff, int strip);
-static void ixgbe_if_multi_set(if_ctx_t ctx);
-static int  ixgbe_if_promisc_set(if_ctx_t ctx, int flags);
-static int  ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs,
-                                     uint64_t *paddrs, int nrxqs, int nrxqsets);
-static int  ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs,
-                                     uint64_t *paddrs, int nrxqs, int nrxqsets);
-static void ixgbe_if_queues_free(if_ctx_t ctx);
-static void ixgbe_if_timer(if_ctx_t ctx, uint16_t);
-static void ixgbe_if_update_admin_status(if_ctx_t ctx);
-static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag);
-static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag);
-static int  ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req);
-static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
-int ixgbe_intr(void *arg);
+static int  ixgbe_if_mtu_set(if_ctx_t, uint32_t);
+static void ixgbe_if_crcstrip_set(if_ctx_t, int, int);
+static void ixgbe_if_multi_set(if_ctx_t);
+static int  ixgbe_if_promisc_set(if_ctx_t, int);
+static int  ixgbe_if_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int);
+static int  ixgbe_if_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int);
+static void ixgbe_if_queues_free(if_ctx_t);
+static void ixgbe_if_timer(if_ctx_t, uint16_t);
+static void ixgbe_if_update_admin_status(if_ctx_t);
+static void ixgbe_if_vlan_register(if_ctx_t, u16);
+static void ixgbe_if_vlan_unregister(if_ctx_t, u16);
+static int  ixgbe_if_i2c_req(if_ctx_t, struct ifi2creq *);
+static bool ixgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event);
+int ixgbe_intr(void *);
 
 /************************************************************************
  * Function prototypes
  ************************************************************************/
-#if __FreeBSD_version >= 1100036
 static uint64_t ixgbe_if_get_counter(if_ctx_t, ift_counter);
-#endif
 
-static void ixgbe_enable_queue(struct adapter *adapter, u32 vector);
-static void ixgbe_disable_queue(struct adapter *adapter, u32 vector);
-static void ixgbe_add_device_sysctls(if_ctx_t ctx);
-static int  ixgbe_allocate_pci_resources(if_ctx_t ctx);
-static int  ixgbe_setup_low_power_mode(if_ctx_t ctx);
+static void ixgbe_enable_queue(struct ixgbe_softc *, u32);
+static void ixgbe_disable_queue(struct ixgbe_softc *, u32);
+static void ixgbe_add_device_sysctls(if_ctx_t);
+static int  ixgbe_allocate_pci_resources(if_ctx_t);
+static int  ixgbe_setup_low_power_mode(if_ctx_t);
 
-static void ixgbe_config_dmac(struct adapter *adapter);
-static void ixgbe_configure_ivars(struct adapter *adapter);
-static void ixgbe_set_ivar(struct adapter *adapter, u8 entry, u8 vector,
-                           s8 type);
+static void ixgbe_config_dmac(struct ixgbe_softc *);
+static void ixgbe_configure_ivars(struct ixgbe_softc *);
+static void ixgbe_set_ivar(struct ixgbe_softc *, u8, u8, s8);
 static u8   *ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
-static bool ixgbe_sfp_probe(if_ctx_t ctx);
+static bool ixgbe_sfp_probe(if_ctx_t);
 
-static void ixgbe_free_pci_resources(if_ctx_t ctx);
+static void ixgbe_free_pci_resources(if_ctx_t);
 
-static int  ixgbe_msix_link(void *arg);
-static int  ixgbe_msix_que(void *arg);
-static void ixgbe_initialize_rss_mapping(struct adapter *adapter);
-static void ixgbe_initialize_receive_units(if_ctx_t ctx);
-static void ixgbe_initialize_transmit_units(if_ctx_t ctx);
+static int  ixgbe_msix_link(void *);
+static int  ixgbe_msix_que(void *);
+static void ixgbe_initialize_rss_mapping(struct ixgbe_softc *);
+static void ixgbe_initialize_receive_units(if_ctx_t);
+static void ixgbe_initialize_transmit_units(if_ctx_t);
 
-static int  ixgbe_setup_interface(if_ctx_t ctx);
-static void ixgbe_init_device_features(struct adapter *adapter);
-static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
+static int  ixgbe_setup_interface(if_ctx_t);
+static void ixgbe_init_device_features(struct ixgbe_softc *);
+static void ixgbe_check_fan_failure(struct ixgbe_softc *, u32, bool);
 static void ixgbe_sbuf_fw_version(struct ixgbe_hw *, struct sbuf *);
-static void ixgbe_print_fw_version(if_ctx_t ctx);
-static void ixgbe_add_media_types(if_ctx_t ctx);
-static void ixgbe_update_stats_counters(struct adapter *adapter);
-static void ixgbe_config_link(if_ctx_t ctx);
-static void ixgbe_get_slot_info(struct adapter *);
-static void ixgbe_check_wol_support(struct adapter *adapter);
-static void ixgbe_enable_rx_drop(struct adapter *);
-static void ixgbe_disable_rx_drop(struct adapter *);
-
-static void ixgbe_add_hw_stats(struct adapter *adapter);
-static int  ixgbe_set_flowcntl(struct adapter *, int);
-static int  ixgbe_set_advertise(struct adapter *, int);
-static int  ixgbe_get_advertise(struct adapter *);
-static void ixgbe_setup_vlan_hw_support(if_ctx_t ctx);
-static void ixgbe_config_gpie(struct adapter *adapter);
-static void ixgbe_config_delay_values(struct adapter *adapter);
+static void ixgbe_print_fw_version(if_ctx_t);
+static void ixgbe_add_media_types(if_ctx_t);
+static void ixgbe_update_stats_counters(struct ixgbe_softc *);
+static void ixgbe_config_link(if_ctx_t);
+static void ixgbe_get_slot_info(struct ixgbe_softc *);
+static void ixgbe_check_wol_support(struct ixgbe_softc *);
+static void ixgbe_enable_rx_drop(struct ixgbe_softc *);
+static void ixgbe_disable_rx_drop(struct ixgbe_softc *);
+
+static void ixgbe_add_hw_stats(struct ixgbe_softc *);
+static int  ixgbe_set_flowcntl(struct ixgbe_softc *, int);
+static int  ixgbe_set_advertise(struct ixgbe_softc *, int);
+static int  ixgbe_get_advertise(struct ixgbe_softc *);
+static void ixgbe_setup_vlan_hw_support(if_ctx_t);
+static void ixgbe_config_gpie(struct ixgbe_softc *);
+static void ixgbe_config_delay_values(struct ixgbe_softc *);
 
 /* Sysctl handlers */
 static int  ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS);
@@ -237,7 +232,7 @@ static device_method_t ix_methods[] = {
 };
 
 static driver_t ix_driver = {
-	"ix", ix_methods, sizeof(struct adapter),
+	"ix", ix_methods, sizeof(struct ixgbe_softc),
 };
 
 devclass_t ix_devclass;
@@ -293,7 +288,7 @@ static device_method_t ixgbe_if_methods[] = {
 static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
     "IXGBE driver parameters");
 static driver_t ixgbe_if_driver = {
-  "ixgbe_if", ixgbe_if_methods, sizeof(struct adapter)
+  "ixgbe_if", ixgbe_if_methods, sizeof(struct ixgbe_softc)
 };
 
 static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY);
@@ -412,33 +407,33 @@ static int
 ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs,
                          int ntxqs, int ntxqsets)
 {
-	struct adapter     *adapter = iflib_get_softc(ctx);
-	if_softc_ctx_t     scctx = adapter->shared;
+	struct ixgbe_softc *sc = iflib_get_softc(ctx);
+	if_softc_ctx_t     scctx = sc->shared;
 	struct ix_tx_queue *que;
 	int                i, j, error;
 
-	MPASS(adapter->num_tx_queues > 0);
-	MPASS(adapter->num_tx_queues == ntxqsets);
+	MPASS(sc->num_tx_queues > 0);
+	MPASS(sc->num_tx_queues == ntxqsets);
 	MPASS(ntxqs == 1);
 
 	/* Allocate queue structure memory */
-	adapter->tx_queues =
+	sc->tx_queues =
 	    (struct ix_tx_queue *)malloc(sizeof(struct ix_tx_queue) * ntxqsets,
 	                                 M_IXGBE, M_NOWAIT | M_ZERO);
-	if (!adapter->tx_queues) {
+	if (!sc->tx_queues) {
 		device_printf(iflib_get_dev(ctx),
 		    "Unable to allocate TX ring memory\n");
 		return (ENOMEM);
 	}
 
-	for (i = 0, que = adapter->tx_queues; i < ntxqsets; i++, que++) {
+	for (i = 0, que = sc->tx_queues; i < ntxqsets; i++, que++) {
 		struct tx_ring *txr = &que->txr;
 
 		/* In case SR-IOV is enabled, align the index properly */
-		txr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool,
+		txr->me = ixgbe_vf_que_index(sc->iov_mode, sc->pool,
 		    i);
 
-		txr->adapter = que->adapter = adapter;
+		txr->sc = que->sc = sc;
 
 		/* Allocate report status array */
 		txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_IXGBE, M_NOWAIT | M_ZERO);
@@ -457,13 +452,13 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs,
 		txr->total_packets = 0;
 
 		/* Set the rate at which we sample packets */
-		if (adapter->feat_en & IXGBE_FEATURE_FDIR)
+		if (sc->feat_en & IXGBE_FEATURE_FDIR)
 			txr->atr_sample = atr_sample_rate;
 
 	}
 
 	device_printf(iflib_get_dev(ctx), "allocated for %d queues\n",
-	    adapter->num_tx_queues);
+	    sc->num_tx_queues);
 
 	return (0);
 
@@ -480,32 +475,32 @@ static int
 ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs,
                          int nrxqs, int nrxqsets)
 {
-	struct adapter     *adapter = iflib_get_softc(ctx);
+	struct ixgbe_softc     *sc = iflib_get_softc(ctx);
 	struct ix_rx_queue *que;
 	int                i;
 
-	MPASS(adapter->num_rx_queues > 0);
-	MPASS(adapter->num_rx_queues == nrxqsets);
+	MPASS(sc->num_rx_queues > 0);
+	MPASS(sc->num_rx_queues == nrxqsets);
 	MPASS(nrxqs == 1);
 
 	/* Allocate queue structure memory */
-	adapter->rx_queues =
+	sc->rx_queues =
 	    (struct ix_rx_queue *)malloc(sizeof(struct ix_rx_queue)*nrxqsets,
 	                                 M_IXGBE, M_NOWAIT | M_ZERO);
-	if (!adapter->rx_queues) {
+	if (!sc->rx_queues) {
 		device_printf(iflib_get_dev(ctx),
 		    "Unable to allocate TX ring memory\n");
 		return (ENOMEM);
 	}
 
-	for (i = 0, que = adapter->rx_queues; i < nrxqsets; i++, que++) {
+	for (i = 0, que = sc->rx_queues; i < nrxqsets; i++, que++) {
 		struct rx_ring *rxr = &que->rxr;
 
 		/* In case SR-IOV is enabled, align the index properly */
-		rxr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool,
+		rxr->me = ixgbe_vf_que_index(sc->iov_mode, sc->pool,
 		    i);
 
-		rxr->adapter = que->adapter = adapter;
+		rxr->sc = que->sc = sc;
 
 		/* get the virtual and physical address of the hw queues */
 		rxr->tail = IXGBE_RDT(rxr->me);
@@ -516,7 +511,7 @@ ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs,
 	}
 
 	device_printf(iflib_get_dev(ctx), "allocated for %d rx queues\n",
-	    adapter->num_rx_queues);
+	    sc->num_rx_queues);
 
 	return (0);
 } /* ixgbe_if_rx_queues_alloc */
@@ -527,13 +522,13 @@ ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs,
 static void
 ixgbe_if_queues_free(if_ctx_t ctx)
 {
-	struct adapter     *adapter = iflib_get_softc(ctx);
-	struct ix_tx_queue *tx_que = adapter->tx_queues;
-	struct ix_rx_queue *rx_que = adapter->rx_queues;
+	struct ixgbe_softc     *sc = iflib_get_softc(ctx);
+	struct ix_tx_queue *tx_que = sc->tx_queues;
+	struct ix_rx_queue *rx_que = sc->rx_queues;
 	int                i;
 
 	if (tx_que != NULL) {
-		for (i = 0; i < adapter->num_tx_queues; i++, tx_que++) {
+		for (i = 0; i < sc->num_tx_queues; i++, tx_que++) {
 			struct tx_ring *txr = &tx_que->txr;
 			if (txr->tx_rsq == NULL)
 				break;
@@ -542,12 +537,12 @@ ixgbe_if_queues_free(if_ctx_t ctx)
 			txr->tx_rsq = NULL;
 		}
 
-		free(adapter->tx_queues, M_IXGBE);
-		adapter->tx_queues = NULL;
+		free(sc->tx_queues, M_IXGBE);
+		sc->tx_queues = NULL;
 	}
 	if (rx_que != NULL) {
-		free(adapter->rx_queues, M_IXGBE);
-		adapter->rx_queues = NULL;
+		free(sc->rx_queues, M_IXGBE);
+		sc->rx_queues = NULL;
 	}
 } /* ixgbe_if_queues_free */
 
@@ -555,15 +550,15 @@ ixgbe_if_queues_free(if_ctx_t ctx)
  * ixgbe_initialize_rss_mapping
  ************************************************************************/
 static void
-ixgbe_initialize_rss_mapping(struct adapter *adapter)
+ixgbe_initialize_rss_mapping(struct ixgbe_softc *sc)
 {
-	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_hw *hw = &sc->hw;
 	u32             reta = 0, mrqc, rss_key[10];
 	int             queue_id, table_size, index_mult;
 	int             i, j;
 	u32             rss_hash_config;
 
-	if (adapter->feat_en & IXGBE_FEATURE_RSS) {
+	if (sc->feat_en & IXGBE_FEATURE_RSS) {
 		/* Fetch the configured RSS key */
 		rss_getkey((uint8_t *)&rss_key);
*** 5365 LINES SKIPPED ***



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