MCPcopy Create free account
hub / github.com/F-Stack/f-stack / efx_mac_select

Function efx_mac_select

dpdk/drivers/common/sfc_efx/base/efx_mac.c:911–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909#endif /* EFSYS_OPT_MAC_STATS */
910
911 __checkReturn efx_rc_t
912efx_mac_select(
913 __in efx_nic_t *enp)
914{
915 efx_port_t *epp = &(enp->en_port);
916 efx_mac_type_t type = EFX_MAC_INVALID;
917 const efx_mac_ops_t *emop;
918 int rc = EINVAL;
919
920 switch (enp->en_family) {
921#if EFSYS_OPT_SIENA
922 case EFX_FAMILY_SIENA:
923 emop = &__efx_mac_siena_ops;
924 type = EFX_MAC_SIENA;
925 break;
926#endif /* EFSYS_OPT_SIENA */
927
928#if EFSYS_OPT_HUNTINGTON
929 case EFX_FAMILY_HUNTINGTON:
930 emop = &__efx_mac_ef10_ops;
931 type = EFX_MAC_HUNTINGTON;
932 break;
933#endif /* EFSYS_OPT_HUNTINGTON */
934
935#if EFSYS_OPT_MEDFORD
936 case EFX_FAMILY_MEDFORD:
937 emop = &__efx_mac_ef10_ops;
938 type = EFX_MAC_MEDFORD;
939 break;
940#endif /* EFSYS_OPT_MEDFORD */
941
942#if EFSYS_OPT_MEDFORD2
943 case EFX_FAMILY_MEDFORD2:
944 emop = &__efx_mac_ef10_ops;
945 type = EFX_MAC_MEDFORD2;
946 break;
947#endif /* EFSYS_OPT_MEDFORD2 */
948
949#if EFSYS_OPT_RIVERHEAD
950 case EFX_FAMILY_RIVERHEAD:
951 emop = &__efx_mac_rhead_ops;
952 type = EFX_MAC_RIVERHEAD;
953 break;
954#endif /* EFSYS_OPT_RIVERHEAD */
955
956 default:
957 rc = EINVAL;
958 goto fail1;
959 }
960
961 EFSYS_ASSERT(type != EFX_MAC_INVALID);
962 EFSYS_ASSERT3U(type, <, EFX_MAC_NTYPES);
963 EFSYS_ASSERT(emop != NULL);
964
965 epp->ep_emop = emop;
966 epp->ep_mac_type = type;
967
968 return (0);

Callers 2

efx_port_initFunction · 0.85
efx_impl.hFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected