Sfoglia il codice sorgente

core: Allow compilation in UML

Add a specific trace path for arch uml.
This change assumes that the kernel and datarmnet source at the same
parent folder when compiling for UML.

Additionally, compilation is skipped for ipa and related low latency
modules for UML.

CRs-Fixed: 3237924
Change-Id: I6151578373b3822cade3fb7fd306390e99f617c4
Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]>
Subash Abhinov Kasiviswanathan 4 anni fa
parent
commit
95a8eb69ff
4 ha cambiato i file con 46 aggiunte e 25 eliminazioni
  1. 11 8
      core/dfc.h
  2. 11 3
      core/rmnet_ll_ipa.c
  3. 12 6
      core/rmnet_trace.h
  4. 12 8
      core/wda.h

+ 11 - 8
core/dfc.h

@@ -10,18 +10,21 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-
+#include <linux/version.h>
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM dfc
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
-#ifdef RMNET_LA_PLATFORM
-#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
-#elif RMNET_TRACE_INCLUDE_LE
-#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
+
+#if defined(RMNET_LA_PLATFORM)
+	#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+#elif defined(__arch_um__)
+	#define TRACE_INCLUDE_PATH ../../datarmnet/core
+#elif defined(RMNET_TRACE_INCLUDE_LE)
+	#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
 #else
-#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
-#endif
+	#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+#endif /* defined(RMNET_LA_PLATFORM) */
+
 #define TRACE_INCLUDE_FILE dfc
 
 #if !defined(_TRACE_DFC_H) || defined(TRACE_HEADER_MULTI_READ)

+ 11 - 3
core/rmnet_ll_ipa.c

@@ -1,5 +1,5 @@
 /* Copyright (c) 2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -15,7 +15,9 @@
 
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
-#include <linux/ipa.h>
+#if !defined(__arch_um__)
+	#include <linux/ipa.h>
+#endif /* !defined(__arch_um__) */
 #include <linux/if_ether.h>
 #include <linux/interrupt.h>
 #include <linux/version.h>
@@ -27,6 +29,7 @@
 
 #define MAX_Q_LEN 1000
 
+#if !defined(__arch_um__)
 static struct rmnet_ll_endpoint *rmnet_ll_ipa_ep;
 static struct sk_buff_head tx_pending_list;
 extern spinlock_t rmnet_ll_tx_lock;
@@ -208,10 +211,15 @@ static int rmnet_ll_ipa_exit(void)
 
 	return 0;
 }
+#else
+static int rmnet_ll_ipa_tx(struct sk_buff *skb){return 0;};
+static int rmnet_ll_ipa_init(void){return 0;}
+static int rmnet_ll_ipa_exit(void){return 0;};
+#endif /* !defined(__arch_um__) */
 
 /* Export operations struct to the main framework */
 struct rmnet_ll_client_ops rmnet_ll_client = {
 	.tx = rmnet_ll_ipa_tx,
 	.init = rmnet_ll_ipa_init,
 	.exit = rmnet_ll_ipa_exit,
-};
+};

+ 12 - 6
core/rmnet_trace.h

@@ -6,15 +6,21 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM rmnet
 #undef TRACE_INCLUDE_PATH
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
-#ifdef CONFIG_ARCH_SDXNIGHTJAR
-#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
+	#ifdef CONFIG_ARCH_SDXNIGHTJAR
+		#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
+	#else
+		#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+	#endif /* CONFIG_ARCH_SDXNIGHTJAR */
 #else
-#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+	#if defined(__arch_um__)
+		#define TRACE_INCLUDE_PATH ../../../../datarmnet/core
+	#else
+		#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+	#endif /* defined(__arch_um__) */
 #endif /* endif LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) */
-#else
-#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
-#endif
+
 #define TRACE_INCLUDE_FILE rmnet_trace
 
 #if !defined(_TRACE_RMNET_H) || defined(TRACE_HEADER_MULTI_READ)

+ 12 - 8
core/wda.h

@@ -1,18 +1,22 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (c) 2018,2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
-
+#include <linux/version.h>
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM wda
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
-#ifdef RMNET_LA_PLATFORM
-#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
-#elif RMNET_TRACE_INCLUDE_LE
-#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
+
+#if defined(RMNET_LA_PLATFORM)
+	#define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
+#elif defined(__arch_um__)
+	#define TRACE_INCLUDE_PATH ../../datarmnet/core
+#elif defined(RMNET_TRACE_INCLUDE_LE)
+	#define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
 #else
-#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
-#endif
+	#define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
+#endif /* defined(RMNET_LA_PLATFORM) */
+
 #define TRACE_INCLUDE_FILE wda
 
 #if !defined(_TRACE_WDA_H) || defined(TRACE_HEADER_MULTI_READ)