@@ -6,7 +6,11 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --enable-test-cpp \
--with-testdir
#@with_platform@ works alone in subdir but not as part of a path???
-SUBDIRS = @platform_with_platform@ \
+SUBDIRS =
+if WITH_DRIVERS
+SUBDIRS += drivers
+endif
+SUBDIRS += @platform_with_platform@ \
helper \
test \
@platform_with_platform_test@ \
@@ -135,6 +135,22 @@ AC_ARG_ENABLE([cunit_support],
cunit_support=yes
fi])
+##########################################################################
+# Enable NIC driver support
+##########################################################################
+nic_driver_support=no
+AC_ARG_ENABLE([drivers],
+ [ --enable-drivers include NIC drivers],
+ [if test x$enableval = xyes; then
+ nic_driver_support=yes
+ fi])
+AM_CONDITIONAL([WITH_DRIVERS], [test x$nic_driver_support = xyes ])
+
+if test "x$nic_driver_support" == "xyes";
+then
+ AM_CFLAGS="$AM_CFLAGS -DWITH_DRIVERS"
+ m4_include([./drivers/m4/configure.m4])
+fi
##########################################################################
# Setup doxygen documentation
new file mode 100644
@@ -0,0 +1,6 @@
+INCFLAGS = -I$(top_srcdir)/platform/@with_platform@/include \
+ -I$(top_srcdir)/platform/linux-generic/include \
+ -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libdrivers.la
+libdrivers_la_SOURCES = driver_init.c
new file mode 100644
@@ -0,0 +1 @@
+This is the directory for ODP drivers
new file mode 100644
@@ -0,0 +1,11 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "driver_init.h"
+void _odp_driver_init(void)
+{
+ /* call each driver init function here */
+}
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+void _odp_driver_init(void);
new file mode 100644
@@ -0,0 +1,3 @@
+AC_CONFIG_FILES([
+ drivers/Makefile
+ ])
@@ -7,6 +7,10 @@ AM_CFLAGS += -I$(srcdir)/include
AM_CFLAGS += -I$(top_srcdir)/include
AM_CFLAGS += -I$(top_srcdir)/helper/include
+if WITH_DRIVERS
+AM_CFLAGS += -I$(top_srcdir)/drivers
+endif
+
include_HEADERS = \
$(top_srcdir)/include/odp.h
@@ -119,6 +123,9 @@ noinst_HEADERS = \
${srcdir}/include/odp_timer_wheel_internal.h \
${srcdir}/include/odp_traffic_mngr_internal.h \
${srcdir}/Makefile.inc
+if WITH_DRIVERS
+noinst_HEADERS += $(top_srcdir)/drivers/driver_init.h
+endif
__LIB__libodp_la_SOURCES = \
odp_atomic.c \
@@ -178,3 +185,7 @@ EXTRA_DIST = \
if HAVE_PCAP
__LIB__libodp_la_SOURCES += pktio/pcap.c
endif
+
+if WITH_DRIVERS
+__LIB__libodp_la_LIBADD = $(top_srcdir)/drivers/libdrivers.la
+endif
ODP nic drivers should be OS and platform agnosic (the only assumption being that pci is available through the odp pci interface, and the availability the the C lib). The drivers are hence placed directely into /drivers. This also defines the driver compilation option: --enable-drivers which should be used to compiles the ODP nic drivers with ODP. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- Makefile.am | 6 +++++- configure.ac | 16 ++++++++++++++++ drivers/Makefile.am | 6 ++++++ drivers/README | 1 + drivers/driver_init.c | 11 +++++++++++ drivers/driver_init.h | 7 +++++++ drivers/m4/configure.m4 | 3 +++ platform/linux-generic/Makefile.am | 11 +++++++++++ 8 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 drivers/Makefile.am create mode 100644 drivers/README create mode 100644 drivers/driver_init.c create mode 100644 drivers/driver_init.h create mode 100644 drivers/m4/configure.m4