From 168beebc4ecd37d295d53d47cf4f45be193d147e Mon Sep 17 00:00:00 2001 From: Purushottam Kushwaha Date: Mon, 21 May 2018 18:19:46 +0530 Subject: [PATCH] QSAP: Do not modify hw_mode when channel is set to 0 (for ACS). Currently when channel value is less than 14, hw_mode is set to g (or b). Application might want to run ACS by setting channel=0 in all possible hw modes. This commit skip changing hw_mode, if channel is set to 0. Change-Id: I0da492d70ec9c9455d79e4df33fb86a7313633ba CRs-Fixed: 2245734 --- softap/sdk/qsap_api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/softap/sdk/qsap_api.c b/softap/sdk/qsap_api.c index 30b8aad..4f030ba 100644 --- a/softap/sdk/qsap_api.c +++ b/softap/sdk/qsap_api.c @@ -2373,6 +2373,10 @@ static int qsap_set_channel(s32 channel, s8 *tbuf, u32 *tlen) ulen = *tlen; + /* Do not worry about hw_mode if intention is to use ACS (channel=0) */ + if (channel == 0) + goto end; + /** Read the current operating mode */ if(NULL == (pcfgval = qsap_get_config_value(pconffile, &cmd_list[eCMD_HW_MODE], tbuf, &ulen))) { return eERR_UNKNOWN; @@ -2409,6 +2413,7 @@ static int qsap_set_channel(s32 channel, s8 *tbuf, u32 *tlen) } } +end: qsap_scnprintf(schan, sizeof(schan), "%ld", channel); return qsap_write_cfg(pcfg, &cmd_list[eCMD_CHAN], schan, tbuf, tlen, HOSTAPD_CONF_QCOM_FILE);