Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sfxge/common/efx_nic.c
Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
const efx_nic_ops_t *enop = enp->en_enop; | const efx_nic_ops_t *enop = enp->en_enop; | ||||
unsigned int mod_flags; | unsigned int mod_flags; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); | EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); | ||||
/* | /* | ||||
* All modules except the MCDI, PROBE, NVRAM, VPD, MON | * All modules except the MCDI, PROBE, NVRAM, VPD, MON, TUNNEL | ||||
* (which we do not reset here) must have been shut down or never | * (which we do not reset here) must have been shut down or never | ||||
* initialized. | * initialized. | ||||
* | * | ||||
* A rule of thumb here is: If the controller or MC reboots, is *any* | * A rule of thumb here is: If the controller or MC reboots, is *any* | ||||
* state lost. If it's lost and needs reapplying, then the module | * state lost. If it's lost and needs reapplying, then the module | ||||
* *must* not be initialised during the reset. | * *must* not be initialised during the reset. | ||||
*/ | */ | ||||
mod_flags = enp->en_mod_flags; | mod_flags = enp->en_mod_flags; | ||||
mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | | mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | | ||||
EFX_MOD_VPD | EFX_MOD_MON); | EFX_MOD_VPD | EFX_MOD_MON); | ||||
#if EFSYS_OPT_TUNNEL | |||||
mod_flags &= ~EFX_MOD_TUNNEL; | |||||
#endif /* EFSYS_OPT_TUNNEL */ | |||||
EFSYS_ASSERT3U(mod_flags, ==, 0); | EFSYS_ASSERT3U(mod_flags, ==, 0); | ||||
if (mod_flags != 0) { | if (mod_flags != 0) { | ||||
rc = EINVAL; | rc = EINVAL; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
if ((rc = enop->eno_reset(enp)) != 0) | if ((rc = enop->eno_reset(enp)) != 0) | ||||
goto fail2; | goto fail2; | ||||
▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines |