[12/13] net/nfp: improve modularazation of CPP bridge module
Checks
Commit Message
Try to keep the API small by move the logic which need not expose from
header file to source file verbatim.
Also remove the unneeded header file include statement of source file.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_cpp_bridge.c | 14 ++++++++++----
drivers/net/nfp/nfp_cpp_bridge.h | 8 --------
2 files changed, 10 insertions(+), 12 deletions(-)
@@ -5,17 +5,23 @@
* Small portions derived from code Copyright(c) 2010-2015 Intel Corporation.
*/
+#include "nfp_cpp_bridge.h"
+
#include <unistd.h>
#include <sys/ioctl.h>
#include <rte_service_component.h>
#include "nfpcore/nfp_cpp.h"
-#include "nfpcore/nfp_mip.h"
-#include "nfpcore/nfp_nsp.h"
-
#include "nfp_logs.h"
-#include "nfp_cpp_bridge.h"
+
+#define NFP_CPP_MEMIO_BOUNDARY (1 << 20)
+#define NFP_BRIDGE_OP_READ 20
+#define NFP_BRIDGE_OP_WRITE 30
+#define NFP_BRIDGE_OP_IOCTL 40
+
+#define NFP_IOCTL 'n'
+#define NFP_IOCTL_CPP_IDENTIFICATION _IOW(NFP_IOCTL, 0x8f, uint32_t)
/* Prototypes */
static int nfp_cpp_bridge_serve_write(int sockfd, struct nfp_cpp *cpp);
@@ -10,14 +10,6 @@
#include "nfp_common.h"
-#define NFP_CPP_MEMIO_BOUNDARY (1 << 20)
-#define NFP_BRIDGE_OP_READ 20
-#define NFP_BRIDGE_OP_WRITE 30
-#define NFP_BRIDGE_OP_IOCTL 40
-
-#define NFP_IOCTL 'n'
-#define NFP_IOCTL_CPP_IDENTIFICATION _IOW(NFP_IOCTL, 0x8f, uint32_t)
-
int nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev);
int nfp_map_service(uint32_t service_id);