Date: Tue, 12 Jan 2016 13:36:22 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293755 - head/sys/dev/sfxge/common Message-ID: <201601121336.u0CDaM9M095896@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Tue Jan 12 13:36:21 2016 New Revision: 293755 URL: https://svnweb.freebsd.org/changeset/base/293755 Log: 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 Modified: head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_vpd.c Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/efx_vpd.c Tue Jan 12 13:36:21 2016 (r293755) @@ -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; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Jan 12 13:36:21 2016 (r293755) @@ -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 */ Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:34:55 2016 (r293754) +++ head/sys/dev/sfxge/common/hunt_vpd.c Tue Jan 12 13:36:21 2016 (r293755) @@ -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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601121336.u0CDaM9M095896>