summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStar Chang <starchang@google.com>2023-03-23 06:27:39 +0000
committerStar Chang <starchang@google.com>2023-03-31 06:39:14 +0000
commit8e46c35c266d844bf28e55885d3877a08890e805 (patch)
tree48017282aa8e4bcaad4a2652003e32d4b4e73358
parentf68ee4b90bef2ab3b6d796a037081f26d1d97255 (diff)
downloadwlan_ptracker-8e46c35c266d844bf28e55885d3877a08890e805.tar.gz
wlan_ptracker: Modify for support kleaf build in kernel 5.15
Bug: 253348062 Test: Build pass Change-Id: Iba8bb0c8d28d0db4e2e60c57cf7041241d45d615 Signed-off-by: Star Chang <starchang@google.com>
-rw-r--r--BUILD.bazel50
-rw-r--r--Kconfig15
-rw-r--r--Makefile5
-rw-r--r--main.c10
4 files changed, 55 insertions, 25 deletions
diff --git a/BUILD.bazel b/BUILD.bazel
index 2f49773..5302f28 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,20 +1,48 @@
-# NOTE: THIS FILE IS EXPERIMENTAL FOR THE BAZEL MIGRATION AND NOT USED FOR
-# YOUR BUILDS CURRENTLY.
-#
-# It is not yet the source of truth for your build. If you're looking to modify
-# the build file, modify the Android.bp file instead. Do *not* modify this file
-# unless you have coordinated with the team managing the Soong to Bazel
-# migration.
+# SPDX-License-Identifier: GPL-2.0-or-later
-load("//build/kleaf:kernel.bzl", "kernel_module")
+load("//build/kernel/kleaf:kernel.bzl", "kernel_module")
+
+filegroup(
+ name = "wlan_ptracker.kconfig",
+ srcs = glob([
+ "Kconfig",
+ ]),
+ visibility = [
+ "//private/devices/google:__subpackages__",
+ "//private/google-modules/soc/gs:__pkg__",
+ ],
+)
+
+filegroup(
+ name = "wlan_ptracker_headers",
+ srcs = glob([
+ "**/*.h",
+ ]),
+ visibility = [
+ "//private/devices/google:__subpackages__",
+ "//private/google-modules/soc/gs:__pkg__",
+ "//private/google-modules/wlan/bcm4398:__pkg__",
+ ],
+)
kernel_module(
- name = "wlan_ptracker.cloudripper",
+ name = "wlan_ptracker",
+ srcs = glob([
+ "**/*.c",
+ "**/*.h",
+ "Kbuild",
+ ]) + [
+ "//private/google-modules/soc/gs:gs_soc_headers",
+ ],
outs = [
"wlan_ptracker.ko",
],
- kernel_build = "//private/gs-google:cloudripper",
+ kernel_build = "//private/google-modules/soc/gs:gs_kernel_build",
visibility = [
- "//private/gs-google:__pkg__",
+ "//private/devices/google:__subpackages__",
+ "//private/google-modules/soc/gs:__pkg__",
+ ],
+ deps = [
+ "//private/google-modules/soc/gs:gs_soc_module",
],
)
diff --git a/Kconfig b/Kconfig
index 24d6608..82afcdc 100644
--- a/Kconfig
+++ b/Kconfig
@@ -3,14 +3,7 @@
# WiFi Performance Tracker Driver
#
-config WLAN_PTRACKER
- bool "WiFi Performance Tracker Driver"
- help
- WiFi Performance Tracker support.
- default y
-
-config DYNAMIC_TWT_SUPPORT
- bool "Dynamic TWT Setup Support "
- help
- WiFi Performance Tracker support dynamic TWT setup.
- default y
+config WLAN_TRACKER
+ tristate "WiFi performance tracker driver"
+ help
+ Module for wlan performance tracker.
diff --git a/Makefile b/Makefile
index 7e3342f..28dd73f 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,10 @@ endif
EXTRA_CFLAGS += -I$(KERNEL_SRC)/../google-modules/wlan/wlan_ptracker
+EXTRA_SYMBOLS += $(OUT_DIR)/../private/google-modules/wlan/wlan_ptracker/Module.symvers
+
ccflags-y := $(EXTRA_CFLAGS)
modules modules_install clean:
- $(MAKE) -C $(KERNEL_SRC) M=$(M) $(KBUILD_OPTIONS) W=1 $(@)
+ $(MAKE) -C $(KERNEL_SRC) M=$(M) W=1 \
+ $(KBUILD_OPTIONS) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(EXTRA_SYMBOLS)" $(@)
diff --git a/main.c b/main.c
index f0d3ad5..395369c 100644
--- a/main.c
+++ b/main.c
@@ -14,7 +14,6 @@
#include "core.h"
#define client_to_core(client) ((struct wlan_ptracker_core *)((client)->core))
-
/* Default mapping rule follow 802.11e */
static const int dscp_trans[WMM_AC_MAX][DSCP_MAP_MAX] = {
{0, 24, 26, 28, 30, -1}, /* AC_BE */
@@ -41,6 +40,7 @@ static void dscp_to_ac_init(u8 *dscp_to_ac)
static struct wlan_ptracker_core *wlan_ptracker_core_init(struct wlan_ptracker_client *client)
{
struct wlan_ptracker_core *core;
+ int ret;
core = kzalloc(sizeof(struct wlan_ptracker_core), GFP_KERNEL);
if (!core)
@@ -49,13 +49,19 @@ static struct wlan_ptracker_core *wlan_ptracker_core_init(struct wlan_ptracker_c
core->client = client;
device_initialize(&core->device);
dev_set_name(&core->device, PTRACKER_PREFIX);
- device_add(&core->device);
+ ret = device_add(&core->device);
+ if (ret)
+ goto err_add;
+
dscp_to_ac_init(core->dscp_to_ac);
wlan_ptracker_debugfs_init(&core->debugfs);
wlan_ptracker_notifier_init(&core->notifier);
scenes_fsm_init(&core->fsm);
dytwt_init(core);
return core;
+err_add:
+ kfree(core);
+ return NULL;
}
static void wlan_ptracker_core_exit(struct wlan_ptracker_core *core)