Date: Mon, 18 Jan 2016 06:14:44 +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: r294250 - head/sys/dev/sfxge/common Message-ID: <201601180614.u0I6EiAG038309@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Mon Jan 18 06:14:43 2016 New Revision: 294250 URL: https://svnweb.freebsd.org/changeset/base/294250 Log: sfxge: convert nvram rw_finish method to use partition id Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/efx_impl.h Mon Jan 18 06:14:43 2016 (r294250) @@ -486,7 +486,6 @@ typedef struct efx_nvram_ops_s { #endif /* EFSYS_OPT_DIAG */ efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t, uint32_t *, uint16_t *); - void (*envo_rw_finish)(efx_nic_t *, efx_nvram_type_t); efx_rc_t (*envo_set_version)(efx_nic_t *, efx_nvram_type_t, uint16_t *); @@ -500,6 +499,7 @@ typedef struct efx_nvram_ops_s { unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); + void (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/efx_nvram.c Mon Jan 18 06:14:43 2016 (r294250) @@ -43,7 +43,6 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ falcon_nvram_get_version, /* envo_get_version */ - falcon_nvram_rw_finish, /* envo_rw_finish */ falcon_nvram_set_version, /* envo_set_version */ falcon_nvram_type_to_partn, /* envo_type_to_partn */ falcon_nvram_partn_size, /* envo_partn_size */ @@ -51,6 +50,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_partn_read, /* envo_partn_read */ falcon_nvram_partn_erase, /* envo_partn_erase */ falcon_nvram_partn_write, /* envo_partn_write */ + falcon_nvram_partn_rw_finish, /* envo_partn_rw_finish */ }; #endif /* EFSYS_OPT_FALCON */ @@ -62,7 +62,6 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ siena_nvram_get_version, /* envo_get_version */ - siena_nvram_rw_finish, /* envo_rw_finish */ siena_nvram_set_version, /* envo_set_version */ siena_nvram_type_to_partn, /* envo_type_to_partn */ siena_nvram_partn_size, /* envo_partn_size */ @@ -70,6 +69,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_partn_read, /* envo_partn_read */ siena_nvram_partn_erase, /* envo_partn_erase */ siena_nvram_partn_write, /* envo_partn_write */ + siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */ }; #endif /* EFSYS_OPT_SIENA */ @@ -81,7 +81,6 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ ef10_nvram_get_version, /* envo_get_version */ - ef10_nvram_rw_finish, /* envo_rw_finish */ ef10_nvram_set_version, /* envo_set_version */ ef10_nvram_type_to_partn, /* envo_type_to_partn */ ef10_nvram_partn_size, /* envo_partn_size */ @@ -89,6 +88,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_partn_read, /* envo_partn_read */ ef10_nvram_partn_erase, /* envo_partn_erase */ ef10_nvram_partn_write, /* envo_partn_write */ + ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -384,6 +384,7 @@ efx_nvram_rw_finish( __in efx_nvram_type_t type) { efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); @@ -393,7 +394,8 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - envop->envo_rw_finish(enp, type); + if (envop->envo_type_to_partn(enp, type, &partn) == 0) + envop->envo_partn_rw_finish(enp, partn); enp->en_nvram_locked = EFX_NVRAM_INVALID; } Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/hunt_impl.h Mon Jan 18 06:14:43 2016 (r294250) @@ -393,11 +393,6 @@ ef10_nvram_get_version( __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]); -extern void -ef10_nvram_rw_finish( - __in efx_nic_t *enp, - __in efx_nvram_type_t type); - extern __checkReturn efx_rc_t ef10_nvram_partn_set_version( __in efx_nic_t *enp, @@ -451,6 +446,11 @@ ef10_nvram_partn_write( __out_bcount(size) caddr_t data, __in size_t size); +extern void +ef10_nvram_partn_rw_finish( + __in efx_nic_t *enp, + __in uint32_t partn); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/hunt_nvram.c Mon Jan 18 06:14:43 2016 (r294250) @@ -1769,15 +1769,11 @@ fail1: } void -ef10_nvram_rw_finish( +ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in uint32_t partn) { - uint32_t partn; - efx_rc_t rc; - - if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) == 0) - ef10_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn); } __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/siena_impl.h Mon Jan 18 06:14:43 2016 (r294250) @@ -193,11 +193,6 @@ siena_nvram_get_version( __out uint32_t *subtypep, __out_ecount(4) uint16_t version[4]); -extern void -siena_nvram_rw_finish( - __in efx_nic_t *enp, - __in efx_nvram_type_t type); - extern __checkReturn efx_rc_t siena_nvram_set_version( __in efx_nic_t *enp, @@ -245,6 +240,12 @@ siena_nvram_partn_write( __out_bcount(size) caddr_t data, __in size_t size); +extern void +siena_nvram_partn_rw_finish( + __in efx_nic_t *enp, + __in uint32_t partn); + + #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Mon Jan 18 06:13:09 2016 (r294249) +++ head/sys/dev/sfxge/common/siena_nvram.c Mon Jan 18 06:14:43 2016 (r294250) @@ -594,15 +594,11 @@ fail1: } void -siena_nvram_rw_finish( +siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in uint32_t partn) { - uint32_t partn; - efx_rc_t rc; - - if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) == 0) - siena_nvram_partn_unlock(enp, partn); + siena_nvram_partn_unlock(enp, partn); } __checkReturn efx_rc_t
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601180614.u0I6EiAG038309>