net/pfe: add MTU and MAC address set
[dpdk.git] / drivers / net / sfc / base / ef10_vpd.c
index b21861b..c641936 100644 (file)
@@ -25,9 +25,7 @@ ef10_vpd_init(
        efx_rc_t rc;
 
        EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        if (enp->en_nic_cfg.enc_vpd_is_global) {
                tag = TLV_TAG_GLOBAL_STATIC_VPD;
@@ -81,10 +79,9 @@ ef10_vpd_size(
        __out                   size_t *sizep)
 {
        efx_rc_t rc;
+       efx_nvram_info_t eni = { 0 };
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        /*
         * This function returns the total size the user should allocate
@@ -92,10 +89,12 @@ ef10_vpd_size(
         * so we just need to return an upper bound on the dynamic vpd,
         * which is the size of the DYNAMIC_CONFIG partition.
         */
-       if ((rc = efx_mcdi_nvram_info(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
-                   sizep, NULL, NULL, NULL)) != 0)
+       if ((rc = efx_mcdi_nvram_info(enp,
+                   NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, &eni)) != 0)
                goto fail1;
 
+       *sizep = eni.eni_partn_size;
+
        return (0);
 
 fail1:
@@ -116,9 +115,7 @@ ef10_vpd_read(
        uint32_t tag;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        if (enp->en_nic_cfg.enc_vpd_is_global) {
                tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
@@ -172,9 +169,7 @@ ef10_vpd_verify(
        unsigned int dcont;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        /*
         * Strictly you could take the view that dynamic vpd is optional.
@@ -294,9 +289,7 @@ ef10_vpd_get(
        uint8_t length;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        /* Attempt to satisfy the request from svpd first */
        if (enp->en_arch.ef10.ena_svpd_length > 0) {
@@ -341,9 +334,7 @@ ef10_vpd_set(
 {
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        /* If the provided (tag,keyword) exists in svpd, then it is readonly */
        if (enp->en_arch.ef10.ena_svpd_length > 0) {
@@ -395,9 +386,7 @@ ef10_vpd_write(
        uint32_t tag;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        if (enp->en_nic_cfg.enc_vpd_is_global) {
                tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
@@ -432,9 +421,7 @@ fail1:
 ef10_vpd_fini(
        __in                    efx_nic_t *enp)
 {
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
-           enp->en_family == EFX_FAMILY_MEDFORD ||
-           enp->en_family == EFX_FAMILY_MEDFORD2);
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
 
        if (enp->en_arch.ef10.ena_svpd_length > 0) {
                EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length,