__checkReturn efx_rc_t efx_nic_probe( __in efx_nic_t *enp) { const efx_nic_ops_t *enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); #if EFSYS_OPT_MCDI EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); #endif /* EFSYS_OPT_MCDI */ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE)); enop = enp->en_enop; if ((rc = enop->eno_probe(enp)) != 0) goto fail1; if ((rc = efx_phy_probe(enp)) != 0) goto fail2; enp->en_mod_flags |= EFX_MOD_PROBE; return (0); fail2: EFSYS_PROBE(fail2); enop->eno_unprobe(enp); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); }
__checkReturn efx_rc_t efx_nic_probe( __in efx_nic_t *enp, __in efx_fw_variant_t efv) { const efx_nic_ops_t *enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); #if EFSYS_OPT_MCDI EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); #endif /* EFSYS_OPT_MCDI */ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE)); /* Ensure FW variant codes match with MC_CMD_FW codes */ EFX_STATIC_ASSERT(EFX_FW_VARIANT_FULL_FEATURED == MC_CMD_FW_FULL_FEATURED); EFX_STATIC_ASSERT(EFX_FW_VARIANT_LOW_LATENCY == MC_CMD_FW_LOW_LATENCY); EFX_STATIC_ASSERT(EFX_FW_VARIANT_PACKED_STREAM == MC_CMD_FW_PACKED_STREAM); EFX_STATIC_ASSERT(EFX_FW_VARIANT_HIGH_TX_RATE == MC_CMD_FW_HIGH_TX_RATE); EFX_STATIC_ASSERT(EFX_FW_VARIANT_PACKED_STREAM_HASH_MODE_1 == MC_CMD_FW_PACKED_STREAM_HASH_MODE_1); EFX_STATIC_ASSERT(EFX_FW_VARIANT_RULES_ENGINE == MC_CMD_FW_RULES_ENGINE); EFX_STATIC_ASSERT(EFX_FW_VARIANT_DPDK == MC_CMD_FW_DPDK); EFX_STATIC_ASSERT(EFX_FW_VARIANT_DONT_CARE == (int)MC_CMD_FW_DONT_CARE); enop = enp->en_enop; enp->efv = efv; if ((rc = enop->eno_probe(enp)) != 0) goto fail1; if ((rc = efx_phy_probe(enp)) != 0) goto fail2; enp->en_mod_flags |= EFX_MOD_PROBE; return (0); fail2: EFSYS_PROBE(fail2); enop->eno_unprobe(enp); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); }
__checkReturn int efx_nic_probe( __in efx_nic_t *enp) { efx_nic_ops_t *enop; efx_oword_t oword; int rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); #if EFSYS_OPT_MCDI EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); #endif /* EFSYS_OPT_MCDI */ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE)); /* Test BIU */ if ((rc = efx_nic_biu_test(enp)) != 0) goto fail1; /* Clear the region register */ EFX_POPULATE_OWORD_4(oword, FRF_AZ_ADR_REGION0, 0, FRF_AZ_ADR_REGION1, (1 << 16), FRF_AZ_ADR_REGION2, (2 << 16), FRF_AZ_ADR_REGION3, (3 << 16)); EFX_BAR_WRITEO(enp, FR_AZ_ADR_REGION_REG, &oword); enop = enp->en_enop; if ((rc = enop->eno_probe(enp)) != 0) goto fail2; if ((rc = efx_phy_probe(enp)) != 0) goto fail3; enp->en_mod_flags |= EFX_MOD_PROBE; return (0); fail3: EFSYS_PROBE(fail3); enop->eno_unprobe(enp); fail2: EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, int, rc); return (rc); }