net/sfc: add dedicated header file with MCDI interface
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 17 Sep 2020 06:34:32 +0000 (07:34 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:08 +0000 (19:19 +0200)
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
drivers/net/sfc/sfc_mcdi.c
drivers/net/sfc/sfc_mcdi.h [new file with mode: 0644]

index cdff9be..a530b12 100644 (file)
@@ -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);
 
index ec62ba9..9a51b3e 100644 (file)
@@ -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 (file)
index 0000000..789a16d
--- /dev/null
@@ -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 */