sfxge: rename Huntington VPD methods to ef10 and use for Medford

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4872
This commit is contained in:
Andrew Rybchenko 2016-01-12 13:36:21 +00:00
parent b627be989d
commit 5311abfa25
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293755
3 changed files with 57 additions and 43 deletions

View File

@ -91,22 +91,22 @@ static efx_vpd_ops_t __efx_vpd_siena_ops = {
#endif /* EFSYS_OPT_SIENA */
#if EFSYS_OPT_HUNTINGTON
#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
static efx_vpd_ops_t __efx_vpd_hunt_ops = {
hunt_vpd_init, /* evpdo_init */
hunt_vpd_size, /* evpdo_size */
hunt_vpd_read, /* evpdo_read */
hunt_vpd_verify, /* evpdo_verify */
hunt_vpd_reinit, /* evpdo_reinit */
hunt_vpd_get, /* evpdo_get */
hunt_vpd_set, /* evpdo_set */
hunt_vpd_next, /* evpdo_next */
hunt_vpd_write, /* evpdo_write */
hunt_vpd_fini, /* evpdo_fini */
static efx_vpd_ops_t __efx_vpd_ef10_ops = {
ef10_vpd_init, /* evpdo_init */
ef10_vpd_size, /* evpdo_size */
ef10_vpd_read, /* evpdo_read */
ef10_vpd_verify, /* evpdo_verify */
ef10_vpd_reinit, /* evpdo_reinit */
ef10_vpd_get, /* evpdo_get */
ef10_vpd_set, /* evpdo_set */
ef10_vpd_next, /* evpdo_next */
ef10_vpd_write, /* evpdo_write */
ef10_vpd_fini, /* evpdo_fini */
};
#endif /* EFSYS_OPT_HUNTINGTON */
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
__checkReturn efx_rc_t
efx_vpd_init(
@ -134,10 +134,16 @@ efx_vpd_init(
#if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
evpdop = (efx_vpd_ops_t *)&__efx_vpd_hunt_ops;
evpdop = (efx_vpd_ops_t *)&__efx_vpd_ef10_ops;
break;
#endif /* EFSYS_OPT_HUNTINGTON */
#if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
evpdop = (efx_vpd_ops_t *)&__efx_vpd_ef10_ops;
break;
#endif /* EFSYS_OPT_MEDFORD */
default:
EFSYS_ASSERT(0);
rc = ENOTSUP;

View File

@ -758,48 +758,48 @@ hunt_nic_pio_unlink(
#if EFSYS_OPT_VPD
extern __checkReturn efx_rc_t
hunt_vpd_init(
ef10_vpd_init(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
hunt_vpd_size(
ef10_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep);
extern __checkReturn efx_rc_t
hunt_vpd_read(
ef10_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size);
extern __checkReturn efx_rc_t
hunt_vpd_verify(
ef10_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
extern __checkReturn efx_rc_t
hunt_vpd_reinit(
ef10_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
extern __checkReturn efx_rc_t
hunt_vpd_get(
ef10_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__inout efx_vpd_value_t *evvp);
extern __checkReturn efx_rc_t
hunt_vpd_set(
ef10_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp);
extern __checkReturn efx_rc_t
hunt_vpd_next(
ef10_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
@ -807,13 +807,13 @@ hunt_vpd_next(
__inout unsigned int *contp);
extern __checkReturn efx_rc_t
hunt_vpd_write(
ef10_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
extern void
hunt_vpd_fini(
ef10_vpd_fini(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_VPD */

View File

@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
#include "ef10_tlv_layout.h"
__checkReturn efx_rc_t
hunt_vpd_init(
ef10_vpd_init(
__in efx_nic_t *enp)
{
caddr_t svpd;
@ -54,7 +54,8 @@ hunt_vpd_init(
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
pci_pf = enp->en_nic_cfg.enc_pf;
/*
@ -98,13 +99,14 @@ hunt_vpd_init(
}
__checkReturn efx_rc_t
hunt_vpd_size(
ef10_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep)
{
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
/*
* This function returns the total size the user should allocate
@ -125,7 +127,7 @@ hunt_vpd_size(
}
__checkReturn efx_rc_t
hunt_vpd_read(
ef10_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size)
@ -135,7 +137,8 @@ hunt_vpd_read(
uint32_t pci_pf;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
pci_pf = enp->en_nic_cfg.enc_pf;
@ -169,7 +172,7 @@ hunt_vpd_read(
}
__checkReturn efx_rc_t
hunt_vpd_verify(
ef10_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
@ -182,12 +185,13 @@ hunt_vpd_verify(
unsigned int dcont;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
/*
* Strictly you could take the view that dynamic vpd is optional.
* Instead, to conform more closely to the read/verify/reinit()
* paradigm, we require dynamic vpd. hunt_vpd_reinit() will
* paradigm, we require dynamic vpd. ef10_vpd_reinit() will
* reinitialize it as required.
*/
if ((rc = efx_vpd_hunk_verify(data, size, NULL)) != 0)
@ -243,7 +247,7 @@ hunt_vpd_verify(
}
__checkReturn efx_rc_t
hunt_vpd_reinit(
ef10_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
@ -285,7 +289,7 @@ hunt_vpd_reinit(
}
__checkReturn efx_rc_t
hunt_vpd_get(
ef10_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
@ -295,7 +299,8 @@ hunt_vpd_get(
uint8_t length;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
/* Attempt to satisfy the request from svpd first */
if (enp->en_arch.ef10.ena_svpd_length > 0) {
@ -329,7 +334,7 @@ hunt_vpd_get(
}
__checkReturn efx_rc_t
hunt_vpd_set(
ef10_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
@ -337,7 +342,8 @@ hunt_vpd_set(
{
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
/* If the provided (tag,keyword) exists in svpd, then it is readonly */
if (enp->en_arch.ef10.ena_svpd_length > 0) {
@ -366,7 +372,7 @@ hunt_vpd_set(
}
__checkReturn efx_rc_t
hunt_vpd_next(
ef10_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
@ -379,7 +385,7 @@ hunt_vpd_next(
}
__checkReturn efx_rc_t
hunt_vpd_write(
ef10_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
@ -388,7 +394,8 @@ hunt_vpd_write(
uint32_t pci_pf;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
pci_pf = enp->en_nic_cfg.enc_pf;
@ -416,10 +423,11 @@ hunt_vpd_write(
}
void
hunt_vpd_fini(
ef10_vpd_fini(
__in efx_nic_t *enp)
{
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
if (enp->en_arch.ef10.ena_svpd_length > 0) {
EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length,