From 15d3b0d7b2dcf9ae95d7cff3f33933653625f157 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Wed, 12 Feb 2020 12:58:09 +0530 Subject: [PATCH] qcacld-3.0: Add support to dynamically set dwell time for 2g Currently there is no support to dynamically set dwell time for 2g channels. Add support in existing command SETDWELLTIME to dynamically configure dwell time for 2g channels. Along with set, add support to get dwell time for 2g channels with the existing driver command GETDWELLTIME. Change-Id: Ifb4722ff3fdb2671e02794fc5b691b06aad98256 CRs-Fixed: 2620366 --- core/hdd/src/wlan_hdd_ioctl.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 0df4af7726ba..4702d1784045 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2794,6 +2794,12 @@ static int hdd_get_dwell_time(struct wlan_objmgr_psoc *psoc, uint8_t *command, val); return 0; } + if (strncmp(command, "GETDWELLTIME 2G MAX", 19) == 0) { + ucfg_scan_cfg_get_active_2g_dwelltime(psoc, &val); + *len = scnprintf(extra, n, "GETDWELLTIME 2G MAX %u\n", + val); + return 0; + } if (strncmp(command, "GETDWELLTIME", 12) == 0) { ucfg_scan_cfg_get_active_dwelltime(psoc, &val); *len = scnprintf(extra, n, "GETDWELLTIME %u\n", val); @@ -2821,7 +2827,7 @@ static int hdd_set_dwell_time(struct wlan_objmgr_psoc *psoc, uint8_t *command) value = value + 24; temp = kstrtou32(value, 10, &val); if (temp || !cfg_in_range(CFG_ACTIVE_MAX_CHANNEL_TIME, val)) { - hdd_err("argument passed for SETDWELLTIME ACTIVE MAX is incorrect"); + hdd_err_rl("argument passed for SETDWELLTIME ACTIVE MAX is incorrect"); return -EFAULT; } ucfg_scan_cfg_set_active_dwelltime(psoc, val); @@ -2832,10 +2838,22 @@ static int hdd_set_dwell_time(struct wlan_objmgr_psoc *psoc, uint8_t *command) value = value + 25; temp = kstrtou32(value, 10, &val); if (temp || !cfg_in_range(CFG_PASSIVE_MAX_CHANNEL_TIME, val)) { - hdd_err("argument passed for SETDWELLTIME PASSIVE MAX is incorrect"); + hdd_err_rl("argument passed for SETDWELLTIME PASSIVE MAX is incorrect"); return -EFAULT; } ucfg_scan_cfg_set_passive_dwelltime(psoc, val); + } else if (strncmp(command, "SETDWELLTIME 2G MAX", 19) == 0) { + if (drv_cmd_validate(command, 19)) + return -EINVAL; + + value = value + 20; + temp = kstrtou32(value, 10, &val); + if (temp || !cfg_in_range(CFG_ACTIVE_MAX_2G_CHANNEL_TIME, + val)) { + hdd_err_rl("argument passed for SETDWELLTIME 2G MAX is incorrect"); + return -EFAULT; + } + ucfg_scan_cfg_set_active_2g_dwelltime(psoc, val); } else if (strncmp(command, "SETDWELLTIME", 12) == 0) { if (drv_cmd_validate(command, 12)) return -EINVAL; @@ -2843,7 +2861,7 @@ static int hdd_set_dwell_time(struct wlan_objmgr_psoc *psoc, uint8_t *command) value = value + 13; temp = kstrtou32(value, 10, &val); if (temp || !cfg_in_range(CFG_ACTIVE_MAX_CHANNEL_TIME, val)) { - hdd_err("argument passed for SETDWELLTIME is incorrect"); + hdd_err_rl("argument passed for SETDWELLTIME is incorrect"); return -EFAULT; } ucfg_scan_cfg_set_active_dwelltime(psoc, val);