From: Andrew Rybchenko Date: Thu, 17 Sep 2020 06:34:35 +0000 (+0100) Subject: net/sfc: start to make MCDI helpers interface shareable X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4064574535e5f9a4f576432565e8dbac768dd156;p=dpdk.git net/sfc: start to make MCDI helpers interface shareable sfc_adapter is network driver specific structure which finally should not be used in shared MCDI helpers interface. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c index c716caabdf..35e1f3940d 100644 --- a/drivers/net/sfc/sfc_mcdi.c +++ b/drivers/net/sfc/sfc_mcdi.c @@ -248,17 +248,14 @@ sfc_efx_mcdi_ev_proxy_response(void *arg, uint32_t handle, efx_rc_t result) } static int -sfc_efx_mcdi_init(struct sfc_adapter *sa) +sfc_efx_mcdi_init(struct sfc_adapter *sa, struct sfc_efx_mcdi *mcdi) { - struct sfc_efx_mcdi *mcdi; size_t max_msg_size; efx_mcdi_transport_t *emtp; int rc; sfc_log_init(sa, "entry"); - mcdi = &sa->mcdi; - SFC_ASSERT(mcdi->state == SFC_EFX_MCDI_UNINITIALIZED); rte_spinlock_init(&mcdi->lock); @@ -301,14 +298,12 @@ fail_dma_alloc: } static void -sfc_efx_mcdi_fini(struct sfc_adapter *sa) +sfc_efx_mcdi_fini(struct sfc_adapter *sa, struct sfc_efx_mcdi *mcdi) { - struct sfc_efx_mcdi *mcdi; efx_mcdi_transport_t *emtp; sfc_log_init(sa, "entry"); - mcdi = &sa->mcdi; emtp = &mcdi->transport; rte_spinlock_lock(&mcdi->lock); @@ -328,11 +323,11 @@ sfc_efx_mcdi_fini(struct sfc_adapter *sa) int sfc_mcdi_init(struct sfc_adapter *sa) { - return sfc_efx_mcdi_init(sa); + return sfc_efx_mcdi_init(sa, &sa->mcdi); } void sfc_mcdi_fini(struct sfc_adapter *sa) { - sfc_efx_mcdi_fini(sa); + sfc_efx_mcdi_fini(sa, &sa->mcdi); }