meta-digi/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0005-qcacld-3.0-module-para...

52 lines
1.6 KiB
Diff

From: Isaac Hermida <isaac.hermida@digi.com>
Date: Wed, 22 Jun 2022 10:51:01 +0200
Subject: [PATCH] add a module parameter to enable p2p support
enable or disable the P2P support based on the enable_p2p module
parameter.
(partial cherry-pick of dbdf5ff9a3f9c6ae0a153395c382384b3dfc7738
in qcacld-2.0)
https://onedigi.atlassian.net/browse/DEL-7986
https://onedigi.atlassian.net/browse/DEL-6503
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
---
core/hdd/src/wlan_hdd_main.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 03138b61ce5d..a866a90110f6 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -271,6 +271,10 @@ static struct attribute *attrs[] = {
#endif
#endif
+#ifdef WLAN_OPEN_P2P_INTERFACE
+static int enable_p2p = -1;
+#endif
+
/* the Android framework expects this param even though we don't use it */
#define BUF_LEN 20
static char fwpath_buffer[BUF_LEN];
@@ -15005,6 +15009,10 @@ static QDF_STATUS hdd_open_p2p_interface(struct hdd_context *hdd_ctx)
bool p2p_dev_addr_admin;
bool is_p2p_locally_administered = false;
+ hdd_info("P2P interface %s", enable_p2p == 1 ? "enabled" : "disabled");
+ if (enable_p2p != 1)
+ return QDF_STATUS_SUCCESS;
+
cfg_p2p_get_device_addr_admin(hdd_ctx->psoc, &p2p_dev_addr_admin);
if (p2p_dev_addr_admin) {
@@ -19521,3 +19529,6 @@ static const struct kernel_param_ops timer_multiplier_ops = {
module_param_cb(timer_multiplier, &timer_multiplier_ops, NULL, 0644);
+#ifdef WLAN_OPEN_P2P_INTERFACE
+module_param(enable_p2p, int, S_IRUSR | S_IRGRP | S_IROTH);
+#endif