vlib: move pci api types from vnet/pci to vlib/pci
Type: fix
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I1a60809a8bbbbb8ac8b65ab990d51aae1229647f
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
diff --git a/src/cmake/api.cmake b/src/cmake/api.cmake
index c936f73..fe2cad6 100644
--- a/src/cmake/api.cmake
+++ b/src/cmake/api.cmake
@@ -150,6 +150,5 @@
endfunction()
add_custom_target(api_headers
- DEPENDS vlibmemory_api_headers vnet_api_headers vpp_api_headers
+ DEPENDS vlibmemory_api_headers vnet_api_headers vpp_api_headers vlib_api_headers
)
-
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt
index cc27d88..c2a0d63 100644
--- a/src/vlib/CMakeLists.txt
+++ b/src/vlib/CMakeLists.txt
@@ -63,6 +63,7 @@
node_cli.c
node_format.c
pci/pci.c
+ pci/pci_types_api.c
physmem.c
punt.c
punt_node.c
@@ -103,6 +104,7 @@
node.h
pci/pci_config.h
pci/pci.h
+ pci/pci_types_api.h
physmem_funcs.h
physmem.h
punt.h
@@ -116,5 +118,10 @@
vlib.h
vmbus/vmbus.h
+ API_FILES
+ pci/pci_types.api
+
LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS}
+
+ DEPENDS api_headers
)
diff --git a/src/vnet/pci/pci_types.api b/src/vlib/pci/pci_types.api
similarity index 100%
rename from src/vnet/pci/pci_types.api
rename to src/vlib/pci/pci_types.api
diff --git a/src/vnet/pci/pci_types_api.c b/src/vlib/pci/pci_types_api.c
similarity index 71%
rename from src/vnet/pci/pci_types_api.c
rename to src/vlib/pci/pci_types_api.c
index 5d1abec..025548a 100644
--- a/src/vnet/pci/pci_types_api.c
+++ b/src/vlib/pci/pci_types_api.c
@@ -14,21 +14,9 @@
*/
#include <vlibapi/api_types.h>
-#include <vnet/pci/pci_types_api.h>
+#include <vlib/pci/pci_types_api.h>
-#define vl_typedefs /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_typedefs
-
-#define vl_endianfun /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_endianfun
-
-/* instantiate all the print functions we know about */
-#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
-#define vl_printfun
-#include <vnet/vnet_all_api_h.h>
-#undef vl_printfun
+#include <vlib/pci/pci_types.api_types.h>
void
pci_address_decode (const vl_api_pci_address_t * in, vlib_pci_addr_t * out)
diff --git a/src/vnet/pci/pci_types_api.h b/src/vlib/pci/pci_types_api.h
similarity index 100%
rename from src/vnet/pci/pci_types_api.h
rename to src/vlib/pci/pci_types_api.h
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index 95068f9..1574c3d 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -1516,20 +1516,6 @@
list(APPEND VNET_API_FILES syslog/syslog.api)
##############################################################################
-# PCI
-##############################################################################
-
-list (APPEND VNET_SOURCES
- pci/pci_types_api.c
-)
-
-list(APPEND VNET_HEADERS
- pci/pci_types_api.h
-)
-
-list(APPEND VNET_API_FILES pci/pci_types.api)
-
-##############################################################################
# Tunnel Endpoint Information Base
##############################################################################
diff --git a/src/vnet/devices/virtio/virtio.api b/src/vnet/devices/virtio/virtio.api
index efbcba8..34f00fa 100644
--- a/src/vnet/devices/virtio/virtio.api
+++ b/src/vnet/devices/virtio/virtio.api
@@ -17,7 +17,7 @@
import "vnet/interface_types.api";
import "vnet/ethernet/ethernet_types.api";
-import "vnet/pci/pci_types.api";
+import "vlib/pci/pci_types.api";
/** \brief Initialize a new virtio pci interface with the given parameters
diff --git a/src/vnet/devices/virtio/virtio_api.c b/src/vnet/devices/virtio/virtio_api.c
index 4d98e72..96ed927 100644
--- a/src/vnet/devices/virtio/virtio_api.c
+++ b/src/vnet/devices/virtio/virtio_api.c
@@ -25,7 +25,7 @@
#include <vnet/ip/ip.h>
#include <vnet/devices/virtio/virtio.h>
#include <vnet/devices/virtio/pci.h>
-#include <vnet/pci/pci_types_api.h>
+#include <vlib/pci/pci_types_api.h>
#include <vnet/vnet_msg_enum.h>