Commit b1d5caf3 authored by Kevin Bowling's avatar Kevin Bowling
Browse files

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
parent 21ab8c75
......@@ -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 @@ ixgbe_bp_version(SYSCTL_HANDLER_ARGS)
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 @@ ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS)
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 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS)
* 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 */
......@@ -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 */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -279,7 +279,7 @@ struct ixgbe_mc_addr {
* The transmit ring, one per queue
*/
struct tx_ring {
struct adapter *adapter;
struct ixgbe_softc *sc;
union ixgbe_adv_tx_desc *tx_base;