Lines Matching +full:gphy +full:- +full:fw

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2007-2016 Solarflare Communications Inc.
224 enp->en_magic = EFX_NIC_MAGIC; in efx_nic_create()
229 enp->en_enop = &__efx_nic_siena_ops; in efx_nic_create()
230 enp->en_features = in efx_nic_create()
244 enp->en_enop = &__efx_nic_hunt_ops; in efx_nic_create()
245 enp->en_features = in efx_nic_create()
262 enp->en_enop = &__efx_nic_medford_ops; in efx_nic_create()
267 enp->en_features = in efx_nic_create()
283 enp->en_enop = &__efx_nic_medford2_ops; in efx_nic_create()
284 enp->en_features = in efx_nic_create()
303 enp->en_family = family; in efx_nic_create()
304 enp->en_esip = esip; in efx_nic_create()
305 enp->en_esbp = esbp; in efx_nic_create()
306 enp->en_eslp = eslp; in efx_nic_create()
315 enp->en_magic = 0; in efx_nic_create()
334 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_probe()
336 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); in efx_nic_probe()
338 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE)); in efx_nic_probe()
340 /* Ensure FW variant codes match with MC_CMD_FW codes */ in efx_nic_probe()
358 enop = enp->en_enop; in efx_nic_probe()
359 enp->efv = efv; in efx_nic_probe()
361 if ((rc = enop->eno_probe(enp)) != 0) in efx_nic_probe()
367 enp->en_mod_flags |= EFX_MOD_PROBE; in efx_nic_probe()
374 enop->eno_unprobe(enp); in efx_nic_probe()
387 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_set_drv_limits()
390 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_set_drv_limits()
391 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_set_drv_limits()
393 if (enop->eno_set_drv_limits != NULL) { in efx_nic_set_drv_limits()
394 if ((rc = enop->eno_set_drv_limits(enp, edlp)) != 0) in efx_nic_set_drv_limits()
413 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_get_bar_region()
416 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_get_bar_region()
417 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_get_bar_region()
418 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); in efx_nic_get_bar_region()
420 if (enop->eno_get_bar_region == NULL) { in efx_nic_get_bar_region()
424 if ((rc = (enop->eno_get_bar_region)(enp, in efx_nic_get_bar_region()
447 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_get_vi_pool()
448 efx_nic_cfg_t *encp = &enp->en_nic_cfg; in efx_nic_get_vi_pool()
451 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_get_vi_pool()
452 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_get_vi_pool()
453 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); in efx_nic_get_vi_pool()
455 if (enop->eno_get_vi_pool != NULL) { in efx_nic_get_vi_pool()
458 if ((rc = (enop->eno_get_vi_pool)(enp, &vi_count)) != 0) in efx_nic_get_vi_pool()
466 *evq_countp = encp->enc_evq_limit; in efx_nic_get_vi_pool()
467 *rxq_countp = encp->enc_rxq_limit; in efx_nic_get_vi_pool()
468 *txq_countp = encp->enc_txq_limit; in efx_nic_get_vi_pool()
483 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_init()
486 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_init()
487 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_init()
489 if (enp->en_mod_flags & EFX_MOD_NIC) { in efx_nic_init()
494 if ((rc = enop->eno_init(enp)) != 0) in efx_nic_init()
497 enp->en_mod_flags |= EFX_MOD_NIC; in efx_nic_init()
513 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_fini()
515 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_fini()
516 EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); in efx_nic_fini()
517 EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_NIC); in efx_nic_fini()
518 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_INTR)); in efx_nic_fini()
519 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV)); in efx_nic_fini()
520 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_RX)); in efx_nic_fini()
521 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TX)); in efx_nic_fini()
523 enop->eno_fini(enp); in efx_nic_fini()
525 enp->en_mod_flags &= ~EFX_MOD_NIC; in efx_nic_fini()
532 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_unprobe()
534 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_unprobe()
536 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); in efx_nic_unprobe()
538 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_unprobe()
539 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_NIC)); in efx_nic_unprobe()
540 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_INTR)); in efx_nic_unprobe()
541 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV)); in efx_nic_unprobe()
542 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_RX)); in efx_nic_unprobe()
543 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TX)); in efx_nic_unprobe()
547 enop->eno_unprobe(enp); in efx_nic_unprobe()
549 enp->en_mod_flags &= ~EFX_MOD_PROBE; in efx_nic_unprobe()
556 efsys_identifier_t *esip = enp->en_esip; in efx_nic_destroy()
558 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_destroy()
559 EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0); in efx_nic_destroy()
561 enp->en_family = EFX_FAMILY_INVALID; in efx_nic_destroy()
562 enp->en_esip = NULL; in efx_nic_destroy()
563 enp->en_esbp = NULL; in efx_nic_destroy()
564 enp->en_eslp = NULL; in efx_nic_destroy()
566 enp->en_enop = NULL; in efx_nic_destroy()
568 enp->en_magic = 0; in efx_nic_destroy()
578 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_reset()
582 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_reset()
583 EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); in efx_nic_reset()
593 mod_flags = enp->en_mod_flags; in efx_nic_reset()
605 if ((rc = enop->eno_reset(enp)) != 0) in efx_nic_reset()
622 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_cfg_get()
623 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_cfg_get()
625 return (&(enp->en_nic_cfg)); in efx_nic_cfg_get()
641 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); in efx_nic_get_fw_version()
642 EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); in efx_nic_get_fw_version()
661 &enfip->enfi_rx_dpcpu_fw_id, in efx_nic_get_fw_version()
662 &enfip->enfi_tx_dpcpu_fw_id, in efx_nic_get_fw_version()
665 enfip->enfi_dpcpu_fw_ids_valid = B_TRUE; in efx_nic_get_fw_version()
667 enfip->enfi_dpcpu_fw_ids_valid = B_FALSE; in efx_nic_get_fw_version()
668 enfip->enfi_rx_dpcpu_fw_id = 0; in efx_nic_get_fw_version()
669 enfip->enfi_tx_dpcpu_fw_id = 0; in efx_nic_get_fw_version()
674 memcpy(enfip->enfi_mc_fw_version, mc_fw_version, in efx_nic_get_fw_version()
693 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_hw_unavailable()
695 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_hw_unavailable()
698 if (enop->eno_hw_unavailable != NULL) { in efx_nic_hw_unavailable()
699 if ((enop->eno_hw_unavailable)(enp) != B_FALSE) in efx_nic_hw_unavailable()
713 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_set_hw_unavailable()
715 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_set_hw_unavailable()
717 if (enop->eno_set_hw_unavailable != NULL) in efx_nic_set_hw_unavailable()
718 enop->eno_set_hw_unavailable(enp); in efx_nic_set_hw_unavailable()
727 const efx_nic_ops_t *enop = enp->en_enop; in efx_nic_register_test()
730 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); in efx_nic_register_test()
731 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); in efx_nic_register_test()
732 EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_NIC)); in efx_nic_register_test()
734 if ((rc = enop->eno_register_test(enp)) != 0) in efx_nic_register_test()
777 LOOPBACK_CHECK(GPHY, GPHY); in efx_loopback_mask()
815 * mean loopbacks supported by on-chip hardware. Keep that in efx_loopback_mask()
816 * meaning here, and include on-chip PHY layer loopbacks. in efx_loopback_mask()
840 * mean loopbacks supported by off-chip hardware. Keep that in efx_loopback_mask()
856 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); in efx_mcdi_get_loopback_modes()
895 encp->enc_loopback_types[EFX_LINK_100FDX] = modes; in efx_mcdi_get_loopback_modes()
899 encp->enc_loopback_types[EFX_LINK_1000FDX] = modes; in efx_mcdi_get_loopback_modes()
903 encp->enc_loopback_types[EFX_LINK_10000FDX] = modes; in efx_mcdi_get_loopback_modes()
912 encp->enc_loopback_types[EFX_LINK_40000FDX] = modes; in efx_mcdi_get_loopback_modes()
922 encp->enc_loopback_types[EFX_LINK_25000FDX] = modes; in efx_mcdi_get_loopback_modes()
932 encp->enc_loopback_types[EFX_LINK_50000FDX] = modes; in efx_mcdi_get_loopback_modes()
942 encp->enc_loopback_types[EFX_LINK_100000FDX] = modes; in efx_mcdi_get_loopback_modes()
947 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_100FDX]); in efx_mcdi_get_loopback_modes()
948 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_1000FDX]); in efx_mcdi_get_loopback_modes()
949 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_10000FDX]); in efx_mcdi_get_loopback_modes()
950 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_40000FDX]); in efx_mcdi_get_loopback_modes()
951 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_25000FDX]); in efx_mcdi_get_loopback_modes()
952 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_50000FDX]); in efx_mcdi_get_loopback_modes()
953 EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_100000FDX]); in efx_mcdi_get_loopback_modes()
954 encp->enc_loopback_types[EFX_LINK_UNKNOWN] = modes; in efx_mcdi_get_loopback_modes()
1099 efx_nic_cfg_t *encp = &(enp->en_nic_cfg); in efx_nic_check_pcie_link_speed()
1104 if ((encp->enc_required_pcie_bandwidth_mbps == 0) || in efx_nic_check_pcie_link_speed()
1122 if (bandwidth < encp->enc_required_pcie_bandwidth_mbps) { in efx_nic_check_pcie_link_speed()
1124 } else if (pcie_link_gen < encp->enc_max_pcie_link_gen) { in efx_nic_check_pcie_link_speed()