From 4de485412c11f37bf73eff3bf3915a816ade887c Mon Sep 17 00:00:00 2001 From: Prashanth Chakravarthy Date: Fri, 2 Nov 2018 15:23:51 +0530 Subject: [PATCH] : prop (CR): Add new sysfs entries for SAR cutback Create sar_mhs and sar_sta sysfs entries for recording wlan states for SAR cutback. The WLAN driver does not care about these entries but they are needed as IPC over to the mdmcutback daemon. Change-Id: I277f7c68e3b74557edb6ff82fa0224d1f470fd95 Reviewed-on: https://gerrit.mot.com/1264155 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Binesh Balasingh Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1456500 Reviewed-by: Prashanth Chakravarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_main.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 50a8e44d98b3..85ab73d32571 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -287,6 +287,17 @@ static int enable_11d = -1; static int enable_dfs_chan_scan = -1; static bool is_mode_change_psoc_idle_shutdown; +#define BUF_LEN_SAR 10 +static char sar_sta_buffer[BUF_LEN_SAR]; +static struct kparam_string sar_sta = { + .string = sar_sta_buffer, + .maxlen = BUF_LEN_SAR, +}; +static char sar_mhs_buffer[BUF_LEN_SAR]; +static struct kparam_string sar_mhs = { + .string = sar_mhs_buffer, + .maxlen = BUF_LEN_SAR, +}; #define WLAN_NLINK_CESIUM 30 static qdf_wake_lock_t wlan_wake_lock; @@ -17745,6 +17756,11 @@ exit: return errno; } +static int sar_changed_handler(const char *kmessage, + const struct kernel_param *kp) +{ + return param_set_copystring(kmessage, kp); +} static int hdd_set_con_mode(enum QDF_GLOBAL_MODE mode) { con_mode = mode; @@ -19584,6 +19600,11 @@ static const struct kernel_param_ops fwpath_ops = { .get = param_get_string, }; +static const struct kernel_param_ops sar_ops = { + .set = sar_changed_handler, + .get = param_get_string, +}; + static int __pcie_set_gen_speed_handler(void) { int ret; @@ -19650,6 +19671,11 @@ module_param_cb(con_mode_epping, &con_mode_epping_ops, module_param_cb(fwpath, &fwpath_ops, &fwpath, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_cb(sar_sta, &sar_ops, &sar_sta, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_cb(sar_mhs, &sar_ops, &sar_mhs, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + module_param(enable_dfs_chan_scan, int, S_IRUSR | S_IRGRP | S_IROTH);