From 5ad753cec8095fe66d3f66a591546e1d13a8abe7 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 17 Sep 2020 07:34:32 +0100 Subject: [PATCH] net/sfc: add dedicated header file with MCDI interface MCDI helpers will be shared by net and vDPA drivers. Prepare to move it to common/sfc_efx. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc.h | 23 +--------------- drivers/net/sfc/sfc_mcdi.c | 1 + drivers/net/sfc/sfc_mcdi.h | 54 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 drivers/net/sfc/sfc_mcdi.h diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index cdff9be3ec..a530b12a8e 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -23,6 +23,7 @@ #include "sfc_debug.h" #include "sfc_filter.h" +#include "sfc_mcdi.h" #ifdef __cplusplus extern "C" { @@ -86,25 +87,6 @@ enum sfc_dev_filter_mode { SFC_DEV_FILTER_NMODES }; -enum sfc_mcdi_state { - SFC_MCDI_UNINITIALIZED = 0, - SFC_MCDI_INITIALIZED, - SFC_MCDI_BUSY, - SFC_MCDI_COMPLETED, - - SFC_MCDI_NSTATES -}; - -struct sfc_mcdi { - rte_spinlock_t lock; - efsys_mem_t mem; - enum sfc_mcdi_state state; - efx_mcdi_transport_t transport; - uint32_t logtype; - uint32_t proxy_handle; - efx_rc_t proxy_result; -}; - struct sfc_intr { efx_intr_type_t type; rte_intr_callback_fn handler; @@ -384,9 +366,6 @@ void sfc_stop(struct sfc_adapter *sa); void sfc_schedule_restart(struct sfc_adapter *sa); -int sfc_mcdi_init(struct sfc_adapter *sa); -void sfc_mcdi_fini(struct sfc_adapter *sa); - int sfc_configure(struct sfc_adapter *sa); void sfc_close(struct sfc_adapter *sa); diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c index ec62ba95ff..9a51b3e030 100644 --- a/drivers/net/sfc/sfc_mcdi.c +++ b/drivers/net/sfc/sfc_mcdi.c @@ -13,6 +13,7 @@ #include "efx_mcdi.h" #include "efx_regs_mcdi.h" +#include "sfc_mcdi.h" #include "sfc.h" #include "sfc_debug.h" #include "sfc_log.h" diff --git a/drivers/net/sfc/sfc_mcdi.h b/drivers/net/sfc/sfc_mcdi.h new file mode 100644 index 0000000000..789a16d8bb --- /dev/null +++ b/drivers/net/sfc/sfc_mcdi.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2016-2019 Solarflare Communications Inc. + * + * This software was jointly developed between OKTET Labs (under contract + * for Solarflare) and Solarflare Communications, Inc. + */ + +#ifndef _SFC_MCDI_H +#define _SFC_MCDI_H + +#include + +#include + +#include "efsys.h" +#include "efx.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +enum sfc_mcdi_state { + SFC_MCDI_UNINITIALIZED = 0, + SFC_MCDI_INITIALIZED, + SFC_MCDI_BUSY, + SFC_MCDI_COMPLETED, + + SFC_MCDI_NSTATES +}; + +struct sfc_mcdi { + rte_spinlock_t lock; + efsys_mem_t mem; + enum sfc_mcdi_state state; + efx_mcdi_transport_t transport; + uint32_t logtype; + uint32_t proxy_handle; + efx_rc_t proxy_result; +}; + + +struct sfc_adapter; + +int sfc_mcdi_init(struct sfc_adapter *sa); +void sfc_mcdi_fini(struct sfc_adapter *sa); + +#ifdef __cplusplus +} +#endif + +#endif /* _SFC_MCDI_H */ -- 2.20.1