[PATCH 17/25] drivers: move device module to common library
Chaoyong He
chaoyong.he at corigine.com
Tue Oct 17 07:45:37 CEST 2023
Move the device module to the common library.
Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
drivers/common/nfp/meson.build | 1 +
drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.c | 0
drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.h | 3 +++
drivers/common/nfp/version.map | 1 +
drivers/net/nfp/meson.build | 1 -
drivers/net/nfp/nfp_net_common.h | 2 +-
drivers/net/nfp/nfpcore/nfp6000_pcie.h | 2 +-
7 files changed, 7 insertions(+), 3 deletions(-)
rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.c (100%)
rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.h (96%)
diff --git a/drivers/common/nfp/meson.build b/drivers/common/nfp/meson.build
index 727d21e00b..7f496c2da5 100644
--- a/drivers/common/nfp/meson.build
+++ b/drivers/common/nfp/meson.build
@@ -12,4 +12,5 @@ sources = files(
'nfp_common.c',
'nfp_common_log.c',
'nfp_common_pci.c',
+ 'nfp_dev.c',
)
diff --git a/drivers/net/nfp/nfpcore/nfp_dev.c b/drivers/common/nfp/nfp_dev.c
similarity index 100%
rename from drivers/net/nfp/nfpcore/nfp_dev.c
rename to drivers/common/nfp/nfp_dev.c
diff --git a/drivers/net/nfp/nfpcore/nfp_dev.h b/drivers/common/nfp/nfp_dev.h
similarity index 96%
rename from drivers/net/nfp/nfpcore/nfp_dev.h
rename to drivers/common/nfp/nfp_dev.h
index b0fffff619..ffcdd17227 100644
--- a/drivers/net/nfp/nfpcore/nfp_dev.h
+++ b/drivers/common/nfp/nfp_dev.h
@@ -8,6 +8,8 @@
#include <stdint.h>
+#include <rte_compat.h>
+
#define PCI_VENDOR_ID_NETRONOME 0x19ee
#define PCI_VENDOR_ID_CORIGINE 0x1da8
@@ -39,6 +41,7 @@ struct nfp_dev_info {
uint8_t pf_num_per_unit;
};
+__rte_internal
const struct nfp_dev_info *nfp_dev_info_get(uint16_t device_id);
#endif /* __NFP_DEV_H__ */
diff --git a/drivers/common/nfp/version.map b/drivers/common/nfp/version.map
index 55ef81701f..cedd34974e 100644
--- a/drivers/common/nfp/version.map
+++ b/drivers/common/nfp/version.map
@@ -9,6 +9,7 @@ INTERNAL {
nfp_write_mac;
nfp_enable_queues;
nfp_disable_queues;
+ nfp_dev_info_get;
local: *;
};
diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
index d54dca36e9..c566c6d2e6 100644
--- a/drivers/net/nfp/meson.build
+++ b/drivers/net/nfp/meson.build
@@ -16,7 +16,6 @@ sources = files(
'nfdk/nfp_nfdk_dp.c',
'nfpcore/nfp_cppcore.c',
'nfpcore/nfp_crc.c',
- 'nfpcore/nfp_dev.c',
'nfpcore/nfp_hwinfo.c',
'nfpcore/nfp_mip.c',
'nfpcore/nfp_mutex.c',
diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index 0ded35a874..aae20d1d6f 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -9,10 +9,10 @@
#include <bus_pci_driver.h>
#include <ethdev_driver.h>
#include <nfp_common.h>
+#include <nfp_dev.h>
#include <rte_spinlock.h>
#include "nfp_net_ctrl.h"
-#include "nfpcore/nfp_dev.h"
/* Interrupt definitions */
#define NFP_NET_IRQ_LSC_IDX 0
diff --git a/drivers/net/nfp/nfpcore/nfp6000_pcie.h b/drivers/net/nfp/nfpcore/nfp6000_pcie.h
index 8e2cfb69e6..59b58ddd04 100644
--- a/drivers/net/nfp/nfpcore/nfp6000_pcie.h
+++ b/drivers/net/nfp/nfpcore/nfp6000_pcie.h
@@ -7,9 +7,9 @@
#define __NFP6000_PCIE_H__
#include <ethdev_pci.h>
+#include <nfp_dev.h>
#include "nfp_cpp.h"
-#include "nfp_dev.h"
const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
--
2.39.1
More information about the dev
mailing list