Эх сурвалжийг харах

rmnet_core: point includes to relative path

Relative path is required for now for compilation
to work for both ftraces and qmi headers.

Also introduce Makefile.am for autotools compilation
and make changes to Makefile structure.

Change-Id: Iff673d79c5424c78e4d9763517c18dff5c731e95
Signed-off-by: Conner Huff <[email protected]>
Conner Huff 5 жил өмнө
parent
commit
2f6f9ae7ff

+ 9 - 0
core/Kconfig

@@ -5,6 +5,7 @@
 menuconfig RMNET_CORE
 	default m 
 	select GRO_CELLS
+	select RMNET_LA_PLATFORM
 	---help---
 	  If you select this, you will enable the RMNET module which is used
 	  for handling data in the multiplexing and aggregation protocol (MAP)
@@ -16,3 +17,11 @@ menuconfig RMNET_CTL
 	---help---
 	  Enable the RMNET CTL module which is used for handling QMAP commands
 	  for flow control purposes.
+
+config RMNET_LA_PLATFORM
+	bool "Rmnet LA Platform Setting"
+	depends on CONFIG_ARCH_LAHAINA
+	default y
+	---help---
+	  Say Y here if you want rmnet_core to be able to include android
+	  specific header file locations

+ 31 - 5
core/Makefile

@@ -1,13 +1,39 @@
-KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
+ifeq ($(RELEASE_PACKAGE),1)
+EXTRA_CFLAGS+=-DRELEASE_PACKAGE
+endif
+LBITS ?= $(shell getconf LONG_BIT)
+ifeq ($(LBITS),64)
+CCFLAGS += -m64
+EXTRA_CFLAGS+=-DSYSTEM_IS_64
+else
+CCFLAGS += -m32
+endif
+
+#obj-m := rmnet_core.o rmnet_ctl.o
+
+rmnet_core-y += 	rmnet_config.o \
+			rmnet_descriptor.o \
+			rmnet_genl.o \
+			rmnet_handlers.o \
+			rmnet_map_command.o \
+			rmnet_map_data.o \
+			rmnet_vnd.o \
+			dfc_qmap.c \
+			dfc_qmi.c \
+			qmi_rmnet.0 \
+			wda_qmi.0
 
-KBUILD_OPTIONS := RMNET_CORE_ROOT=$(PWD)
-KBUILD_OPTIONS += MODNAME?=rmnet_core
+rmnet_ctl-y += 		rmnet_ctl_client.o \
+			rmnet_ctl_ipa.o \
+			rmnet_ctl_mhi.o
+
+KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
 
 all:
 	$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
 
 modules_install:
-	$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
+	$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules_install
 
 clean:
-	$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
+	$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean

+ 34 - 0
core/Makefile.am

@@ -0,0 +1,34 @@
+ifeq ($(RELEASE_PACKAGE),1)
+EXTRA_CFLAGS+=-DRELEASE_PACKAGE
+endif
+LBITS := $(shell getconf LONG_BIT)
+ifeq ($(LBITS),64)
+CCFLAGS += -m64
+EXTRA_CFLAGS+=-DSYSTEM_IS_64
+else
+CCFLAGS += -m32
+endif
+
+rmnet_core_dir	        = $(prefix)/rmnet_core
+rmnet_core_CFLAGS	= -Werror
+
+KERNEL_FLAGS ?= ARCH=arm
+
+module = rmnet_core.ko
+kmake  = $(MAKE) $(KERNEL_FLAGS) -C $(KERNEL_DIR) M=$(CURDIR)
+
+$(module):
+	$(kmake) modules
+
+all-local: $(module)
+
+install-exec-local: $(module)
+	$(kmake) INSTALL_MOD_PATH=$(DESTDIR)$(prefix)/modules modules_install
+
+# "make distclean" will always run clean-local in this directory,
+# regardless of the KERNELMODULES conditional. Therefore, ensure
+# KERNEL_DIR exists before running clean. Further, don't fail even
+# if there is a problem.
+clean-local:
+	-test ! -d "$(KERNEL_DIR)" || $(kmake) clean
+

+ 4 - 0
core/dfc.h

@@ -13,7 +13,11 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM dfc
 #undef TRACE_INCLUDE_PATH
+#ifdef RMNET_LA_PLATFORM
 #define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+#else
+#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+#endif
 #define TRACE_INCLUDE_FILE dfc
 
 #if !defined(_TRACE_DFC_H) || defined(TRACE_HEADER_MULTI_READ)

+ 4 - 0
core/dfc_defs.h

@@ -6,7 +6,11 @@
 #ifndef _DFC_DEFS_H
 #define _DFC_DEFS_H
 
+#ifdef RMNET_LA_PLATFORM
 #include <linux/soc/qcom/qmi.h>
+#else
+#include "../../../../../../../src/kernel/msm-5.4/include/linux/soc/qcom/qmi.h"
+#endif
 #include "qmi_rmnet_i.h"
 
 #define DFC_ACK_TYPE_DISABLE 1

+ 4 - 0
core/qmi_rmnet.c

@@ -10,7 +10,11 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+#ifdef RMNET_LA_PLATFORM
 #include <linux/soc/qcom/qmi.h>
+#else
+#include "../../../../../../../src/kernel/msm-5.4/include/linux/soc/qcom/qmi.h"
+#endif
 
 #include "qmi_rmnet_i.h"
 #include "qmi_rmnet.h"

+ 4 - 0
core/rmnet_trace.h

@@ -5,7 +5,11 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM rmnet
 #undef TRACE_INCLUDE_PATH
+#ifdef RMNET_LA_PLATFORM
 #define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+#else
+#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+#endif
 #define TRACE_INCLUDE_FILE rmnet_trace
 
 #if !defined(_TRACE_RMNET_H) || defined(TRACE_HEADER_MULTI_READ)

+ 4 - 0
core/wda.h

@@ -5,7 +5,11 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM wda
 #undef TRACE_INCLUDE_PATH
+#ifdef RMNET_LA_PLATFORM
 #define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+#else
+#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+#endif
 #define TRACE_INCLUDE_FILE wda
 
 #if !defined(_TRACE_WDA_H) || defined(TRACE_HEADER_MULTI_READ)

+ 4 - 0
core/wda_qmi.c

@@ -12,7 +12,11 @@
  */
 
 #include <linux/rtnetlink.h>
+#ifdef RMNET_LA_PLATFORM
 #include <linux/soc/qcom/qmi.h>
+#else
+#include "../../../../../../../src/kernel/msm-5.4/include/linux/soc/qcom/qmi.h"
+#endif
 #include "rmnet_qmi.h"
 #define CREATE_TRACE_POINTS
 #include "wda.h"