git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: use SPDX tag for bnx2x guide
[dpdk.git]
/
drivers
/
net
/
sfc
/
base
/
ef10_vpd.c
diff --git
a/drivers/net/sfc/base/ef10_vpd.c
b/drivers/net/sfc/base/ef10_vpd.c
index
097fe1d
..
c641936
100644
(file)
--- a/
drivers/net/sfc/base/ef10_vpd.c
+++ b/
drivers/net/sfc/base/ef10_vpd.c
@@
-10,7
+10,7
@@
#if EFSYS_OPT_VPD
#if EFSYS_OPT_VPD
-#if EF
SYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
+#if EF
X_OPTS_EF10()
#include "ef10_tlv_layout.h"
#include "ef10_tlv_layout.h"
@@
-25,9
+25,7
@@
ef10_vpd_init(
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
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;
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;
__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
/*
* 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.
*/
* 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;
goto fail1;
+ *sizep = eni.eni_partn_size;
+
return (0);
fail1:
return (0);
fail1:
@@
-116,9
+115,7
@@
ef10_vpd_read(
uint32_t tag;
efx_rc_t rc;
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;
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;
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.
/*
* 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;
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) {
/* 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;
{
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) {
/* 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;
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;
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)
{
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,
if (enp->en_arch.ef10.ena_svpd_length > 0) {
EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length,
@@
-445,6
+432,6
@@
ef10_vpd_fini(
}
}
}
}
-#endif /* EF
SYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
*/
+#endif /* EF
X_OPTS_EF10()
*/
#endif /* EFSYS_OPT_VPD */
#endif /* EFSYS_OPT_VPD */