summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2016-01-14 16:01:32 +0000
committerarybchik <arybchik@FreeBSD.org>2016-01-14 16:01:32 +0000
commit410af88639bbc79feb4ffe18e621ecf0ce141ae8 (patch)
treeaa625bb29af7322baab713b6354d8661be2ca9b2 /sys/dev
parenta07017a9a7bb1fc4e281b6c7b6ed18062f705d9a (diff)
downloadFreeBSD-src-410af88639bbc79feb4ffe18e621ecf0ce141ae8.zip
FreeBSD-src-410af88639bbc79feb4ffe18e621ecf0ce141ae8.tar.gz
MFC r293755
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.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sfxge/common/efx_vpd.c36
-rw-r--r--sys/dev/sfxge/common/hunt_impl.h20
-rw-r--r--sys/dev/sfxge/common/hunt_vpd.c46
3 files changed, 58 insertions, 44 deletions
diff --git a/sys/dev/sfxge/common/efx_vpd.c b/sys/dev/sfxge/common/efx_vpd.c
index 8c6e993..032dcd6 100644
--- a/sys/dev/sfxge/common/efx_vpd.c
+++ b/sys/dev/sfxge/common/efx_vpd.c
@@ -91,22 +91,22 @@ static efx_vpd_ops_t __efx_vpd_siena_ops = {
#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_HUNTINGTON
-
-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 */
+#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
+
+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;
diff --git a/sys/dev/sfxge/common/hunt_impl.h b/sys/dev/sfxge/common/hunt_impl.h
index b0ee587..d43f972 100644
--- a/sys/dev/sfxge/common/hunt_impl.h
+++ b/sys/dev/sfxge/common/hunt_impl.h
@@ -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 */
diff --git a/sys/dev/sfxge/common/hunt_vpd.c b/sys/dev/sfxge/common/hunt_vpd.c
index c11f452..ca2ea68 100644
--- a/sys/dev/sfxge/common/hunt_vpd.c
+++ b/sys/dev/sfxge/common/hunt_vpd.c
@@ -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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
__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 @@ fail1:
}
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,
OpenPOWER on IntegriCloud