[v2,06/17] net/sfc: add dedicated header file with MCDI interface
Checks
Commit Message
MCDI helpers will be shared by net and vDPA drivers.
Prepare to move it to common/sfc_efx.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
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
@@ -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);
@@ -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"
new file mode 100644
@@ -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 <stdint.h>
+
+#include <rte_spinlock.h>
+
+#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 */