sfxge(4): add Medford2 support to VPD module
Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18156
This commit is contained in:
parent
df0385e554
commit
77226f8941
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341034
@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#if EFSYS_OPT_VPD
|
||||
|
||||
#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
|
||||
#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
|
||||
|
||||
#include "ef10_tlv_layout.h"
|
||||
|
||||
@ -53,7 +53,8 @@ ef10_vpd_init(
|
||||
|
||||
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_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
if (enp->en_nic_cfg.enc_vpd_is_global) {
|
||||
tag = TLV_TAG_GLOBAL_STATIC_VPD;
|
||||
@ -109,7 +110,8 @@ ef10_vpd_size(
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD);
|
||||
enp->en_family == EFX_FAMILY_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
/*
|
||||
* This function returns the total size the user should allocate
|
||||
@ -142,7 +144,8 @@ ef10_vpd_read(
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD);
|
||||
enp->en_family == EFX_FAMILY_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
if (enp->en_nic_cfg.enc_vpd_is_global) {
|
||||
tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
|
||||
@ -194,7 +197,8 @@ ef10_vpd_verify(
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD);
|
||||
enp->en_family == EFX_FAMILY_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
/*
|
||||
* Strictly you could take the view that dynamic vpd is optional.
|
||||
@ -315,7 +319,8 @@ ef10_vpd_get(
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD);
|
||||
enp->en_family == EFX_FAMILY_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
/* Attempt to satisfy the request from svpd first */
|
||||
if (enp->en_arch.ef10.ena_svpd_length > 0) {
|
||||
@ -361,7 +366,8 @@ 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_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
/* If the provided (tag,keyword) exists in svpd, then it is readonly */
|
||||
if (enp->en_arch.ef10.ena_svpd_length > 0) {
|
||||
@ -414,7 +420,8 @@ ef10_vpd_write(
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD);
|
||||
enp->en_family == EFX_FAMILY_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
if (enp->en_nic_cfg.enc_vpd_is_global) {
|
||||
tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
|
||||
@ -450,7 +457,8 @@ 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_MEDFORD ||
|
||||
enp->en_family == EFX_FAMILY_MEDFORD2);
|
||||
|
||||
if (enp->en_arch.ef10.ena_svpd_length > 0) {
|
||||
EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length,
|
||||
@ -461,6 +469,6 @@ ef10_vpd_fini(
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
|
||||
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */
|
||||
|
||||
#endif /* EFSYS_OPT_VPD */
|
||||
|
@ -73,7 +73,7 @@ static const efx_vpd_ops_t __efx_vpd_siena_ops = {
|
||||
|
||||
#endif /* EFSYS_OPT_SIENA */
|
||||
|
||||
#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
|
||||
#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
|
||||
|
||||
static const efx_vpd_ops_t __efx_vpd_ef10_ops = {
|
||||
ef10_vpd_init, /* evpdo_init */
|
||||
@ -88,7 +88,7 @@ static const efx_vpd_ops_t __efx_vpd_ef10_ops = {
|
||||
ef10_vpd_fini, /* evpdo_fini */
|
||||
};
|
||||
|
||||
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
|
||||
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */
|
||||
|
||||
__checkReturn efx_rc_t
|
||||
efx_vpd_init(
|
||||
@ -120,6 +120,12 @@ efx_vpd_init(
|
||||
break;
|
||||
#endif /* EFSYS_OPT_MEDFORD */
|
||||
|
||||
#if EFSYS_OPT_MEDFORD2
|
||||
case EFX_FAMILY_MEDFORD2:
|
||||
evpdop = &__efx_vpd_ef10_ops;
|
||||
break;
|
||||
#endif /* EFSYS_OPT_MEDFORD2 */
|
||||
|
||||
default:
|
||||
EFSYS_ASSERT(0);
|
||||
rc = ENOTSUP;
|
||||
|
Loading…
Reference in New Issue
Block a user