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 <chuff@codeaurora.org>
This commit is contained in:
Conner Huff
2020-06-16 15:04:46 -07:00
committed by Subash Abhinov Kasiviswanathan
parent e994290ed7
commit 2f6f9ae7ff
9 changed files with 98 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
menuconfig RMNET_CORE menuconfig RMNET_CORE
default m default m
select GRO_CELLS select GRO_CELLS
select RMNET_LA_PLATFORM
---help--- ---help---
If you select this, you will enable the RMNET module which is used If you select this, you will enable the RMNET module which is used
for handling data in the multiplexing and aggregation protocol (MAP) for handling data in the multiplexing and aggregation protocol (MAP)
@@ -16,3 +17,11 @@ menuconfig RMNET_CTL
---help--- ---help---
Enable the RMNET CTL module which is used for handling QMAP commands Enable the RMNET CTL module which is used for handling QMAP commands
for flow control purposes. 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

View File

@@ -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
KBUILD_OPTIONS := RMNET_CORE_ROOT=$(PWD) #obj-m := rmnet_core.o rmnet_ctl.o
KBUILD_OPTIONS += MODNAME?=rmnet_core
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
rmnet_ctl-y += rmnet_ctl_client.o \
rmnet_ctl_ipa.o \
rmnet_ctl_mhi.o
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
all: all:
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS) $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
modules_install: 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: clean:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean

34
core/Makefile.am Normal file
View File

@@ -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

View File

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

View File

@@ -6,7 +6,11 @@
#ifndef _DFC_DEFS_H #ifndef _DFC_DEFS_H
#define _DFC_DEFS_H #define _DFC_DEFS_H
#ifdef RMNET_LA_PLATFORM
#include <linux/soc/qcom/qmi.h> #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_i.h"
#define DFC_ACK_TYPE_DISABLE 1 #define DFC_ACK_TYPE_DISABLE 1

View File

@@ -10,7 +10,11 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#ifdef RMNET_LA_PLATFORM
#include <linux/soc/qcom/qmi.h> #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_i.h"
#include "qmi_rmnet.h" #include "qmi_rmnet.h"

View File

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

View File

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

View File

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