From b8292a122a551f8d96d394ec4ee36789d2c2b046 Mon Sep 17 00:00:00 2001 From: Ranjeet Gupta Date: Thu, 20 Apr 2017 14:57:32 -0500 Subject: [PATCH 01/39] prop (CR)-Support for 12M WLAN Radiated Power test Changes based on new TLV2 format to support 12M wlan radiated power test on Production SW. Change-Id: I90e2dfe8d2828f054cb5f540d51e3ef71d5112a5 Reviewed-on: https://gerrit.mot.com/983481 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Santhosh Kumar Gillella Tested-by: Jira Key Submit-Approved: Jira Key --- Kbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Kbuild b/Kbuild index a2b8091f7624..bf26c85edebe 100644 --- a/Kbuild +++ b/Kbuild @@ -2697,6 +2697,13 @@ cppflags-$(CONFIG_QCA_WIFI_FTM) += -DQCA_WIFI_FTM cppflags-$(CONFIG_NL80211_TESTMODE) += -DQCA_WIFI_FTM_NL80211 cppflags-$(CONFIG_LINUX_QCMBR) += -DLINUX_QCMBR -DQCA_WIFI_FTM_IOCTL +# WLAN_WHITE_LIST - WLAN Radiated Power Test +# For user software build, wlan driver needs to allow the factory +# commnds only for Tx_opcode and NART commands based off 12M doc +ifeq ($(TARGET_BUILD_VARIANT),user) +CDEFINES += -DWLAN_WHITE_LIST +endif + #Enable Checksum Offload support cppflags-$(CONFIG_CHECKSUM_OFFLOAD) += -DCHECKSUM_OFFLOAD From 2ed0846b30db56457a47b3861e251f4ea3f9d3e9 Mon Sep 17 00:00:00 2001 From: liaoxl Date: Fri, 19 Oct 2018 14:12:17 +0800 Subject: [PATCH 02/39] WLAN: Implement reading of MAC address from UTAG for sm6150 - Read MAC Address from UTAG - Generate new MAC address from serial number, if UTAG is not programmed with MAC addresses in Factory. Port changes from (CR) to new Helium platform(sm6150). Change-Id: If6d2e532907ff0cd267262710b3c694bf73c9129 Reviewed-on: https://gerrit.mot.com/1257719 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Bin Liu Submit-Approved: Jira Key --- Kbuild | 2 + core/hdd/inc/wlan_hdd_cfg.h | 5 + core/hdd/src/wlan_hdd_cfg.c | 230 +++++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 8 ++ 4 files changed, 245 insertions(+) mode change 100644 => 100755 core/hdd/src/wlan_hdd_cfg.c diff --git a/Kbuild b/Kbuild index bf26c85edebe..c88962f5f1c8 100644 --- a/Kbuild +++ b/Kbuild @@ -3021,6 +3021,8 @@ cppflags-$(CONFIG_WLAN_HANG_EVENT) += -DHIF_BUS_LOG_INFO cppflags-$(CONFIG_WLAN_HANG_EVENT) += -DDP_SUPPORT_RECOVERY_NOTIFY #endof dummy flags +cppflags-y += -DMOTO_UTAGS_MAC + ccflags-$(CONFIG_ENABLE_SIZE_OPTIMIZE) += -Os # DFS component diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 79edc72848ff..43e4f617f616 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -268,6 +268,11 @@ struct hdd_config { eCsrRoamWmmUserModeType hdd_to_csr_wmm_mode(uint8_t mode); QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx); +#ifdef MOTO_UTAGS_MAC +QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx); +QDF_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, + int serialength, char *computedMac); +#endif QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx); QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx); QDF_STATUS hdd_set_sme_chan_list(struct hdd_context *hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c old mode 100644 new mode 100755 index 68f9492dff61..8694ef141b8a --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -49,6 +49,151 @@ #include "hdd_dp_cfg.h" #include "wlan_hdd_object_manager.h" +#ifdef MOTO_UTAGS_MAC +#include +#include +#include +#include + +#define WIFI_MAC_BOOTARG "androidboot.wifimacaddr=" +#define DEVICE_SERIALNO_BOOTARG "androidboot.serialno=" +#define MACSTRLEN 12 +#define MACSTRCOLON 58 +#define MACADDRESSUSED 1 + +struct sdesc { + struct shash_desc shash; + char ctx[]; +}; + +QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) +{ + QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; + + int len = 0; + int serialnoLen = 0; + + char *buffer = NULL; + char *bufferPtr = NULL; + char *computedMac = NULL; + const char *cmd_line = NULL; + + struct device_node *chosen_node = NULL; + computedMac = (char*)qdf_mem_malloc(QDF_MAC_ADDR_SIZE); + + chosen_node = of_find_node_by_name(NULL, "chosen"); + hdd_err("%s: get chosen node \n", __func__); + + if (!chosen_node) + { + hdd_err("%s: get chosen node read failed \n", __func__); + goto config_exit; + } else { + cmd_line = of_get_property(chosen_node, "bootargs", &len); + if (!cmd_line || len <= 0) { + hdd_err("%s: get the barcode bootargs failed \n", __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer = strstr(cmd_line, DEVICE_SERIALNO_BOOTARG); + if (buffer == NULL) { + hdd_err("%s: " DEVICE_SERIALNO_BOOTARG" not present cmd line argc", + __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer += strlen(DEVICE_SERIALNO_BOOTARG); + bufferPtr = buffer; + while (*bufferPtr != ' ') { + bufferPtr++; + serialnoLen = serialnoLen + 1; + } + } + } + } + /*Data have been read from boot serial no */ + /*Now generate random unique the 6 byte string */ + if (hdd_generate_random_mac_from_serialno(buffer, serialnoLen, + computedMac) != QDF_STATUS_SUCCESS) { + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } + qdf_mem_copy(&hdd_ctx->config->intfMacAddr[0].bytes[0], + (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); + +config_exit: + qdf_mem_free(computedMac); + return qdf_status; +} + +QDF_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, int serialnoLen, + char *macAddr) +{ + unsigned int size; + struct crypto_shash *md5; + struct sdesc *sdescmd5; + char *hashBuf = NULL; + + QDF_STATUS cryptoStatus = QDF_STATUS_SUCCESS; + hashBuf = (char*)qdf_mem_malloc(16); + + /*Motorola OUI*/ + macAddr[0] = 0xA4; + macAddr[1] = 0x07; + macAddr[2] = 0xd6; + + md5 = crypto_alloc_shash("md5", 0, 0); + if (IS_ERR(md5)) { + cryptoStatus = QDF_STATUS_E_FAILURE; + hdd_err("%s: Crypto md5 allocation error \n", __func__); + qdf_mem_free(hashBuf); + return QDF_STATUS_E_FAILURE; + } + + size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); + + sdescmd5 = kmalloc(size, GFP_KERNEL); + if (!sdescmd5) { + cryptoStatus = QDF_STATUS_E_FAILURE; + hdd_err("%s: Memory allocation error \n", __func__); + goto crypto_hash_err; + } + + sdescmd5->shash.tfm = md5; + sdescmd5->shash.flags = 0x0; + + if (crypto_shash_init(&sdescmd5->shash)) { + cryptoStatus = QDF_STATUS_E_FAILURE; + goto crypto_hash_err; + } + + if (crypto_shash_update(&sdescmd5->shash, serialNo, serialnoLen)) { + cryptoStatus = QDF_STATUS_E_FAILURE; + goto crypto_hash_err; + } + + if (crypto_shash_final(&sdescmd5->shash, &hashBuf[0])) { + cryptoStatus = QDF_STATUS_E_FAILURE; + goto crypto_hash_err; + } + + macAddr[3] = hashBuf[0]; + macAddr[4] = hashBuf[1]; + macAddr[5] = hashBuf[2]; + + hdd_err("%02X:%02X:%02X:%02X:%02X:%02X is the new MAC generated from serial number \n", macAddr[0], + macAddr[1], macAddr[2], macAddr[3], + macAddr[4], macAddr[5]); + crypto_hash_err: + qdf_mem_free(hashBuf); + crypto_free_shash(md5); + kfree(sdescmd5); + + return cryptoStatus; +} +#endif + + /** * get_next_line() - find and locate the new line pointer * @str: pointer to string @@ -226,6 +371,7 @@ static void hdd_set_power_save_offload_config(struct hdd_context *hdd_ctx) * Return: QDF_STATUS_SUCCESS if the MAC address is found from cfg file * and overwritten, otherwise QDF_STATUS_E_INVAL */ +#ifndef MOTO_UTAGS_MAC QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) { int status, i = 0; @@ -339,6 +485,90 @@ config_exit: return qdf_status; } +#else +QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) +{ + int len = 0; + int iteration = 0; + + char *bufferPtr = NULL; + char buffer_temp[MACSTRLEN]; + const char *cmd_line = NULL; + struct device_node *chosen_node = NULL; + char *buffer = NULL; + + struct hdd_cfg_entry macTable[QDF_MAX_CONCURRENCY_PERSONA]; + tSirMacAddr customMacAddr; + + QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; + + memset(macTable, 0, sizeof(macTable)); + + /*Implemenation of QCOM is to read the MAC address from the predefined*/ + /*location where WLAN MMAC File have the MAC Address */ + /* Read MACs from bootparams. */ + chosen_node = of_find_node_by_name(NULL, "chosen"); + hdd_err("%s: get chosen node \n", __func__); + if (!chosen_node) + { + hdd_err("%s: get chosen node read failed \n", __func__); + goto config_exit; + } else { + cmd_line = of_get_property(chosen_node, "bootargs", &len); + + if (!cmd_line || len <= 0) { + hdd_err("%s: get wlan MACs bootargs failed \n", __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer = strstr(cmd_line, WIFI_MAC_BOOTARG); + if (buffer == NULL) { + hdd_err("%s: " WIFI_MAC_BOOTARG " bootarg cmd line is null", __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer += strlen(WIFI_MAC_BOOTARG); + bufferPtr = buffer; + } + } + } + /* Mac address data format used by qcom: + * Intf0MacAddress=00AA00BB00CC + * Intf1MacAddress=00AA00BB00CD + * xxxxxxxxxxxxxxxxxxxxxxxxxxxx + * From bootarg we need to strip off : from macaddress + */ + for (iteration = 0; iteration < MACSTRLEN; iteration++) { + if (*bufferPtr != MACSTRCOLON) { + buffer_temp[iteration] = *bufferPtr; + } else { + iteration = iteration - 1; + } + bufferPtr++; + } + /* Mac address data format used by qcom: + * Intf0MacAddress used for 1 macaddress + * if gp2pdeviceAdmistered is set to 1 + * if s020deviceAdmisnited is set to 0 + * it will use Intf1MacAddress for P2P seprately + * Motorola decided to use gp2pdeviceAdmistered = 1 i.e use + * locally gerated bin MAC addr for P2P + */ + macTable[0].name = "Intf0MacAddress"; + macTable[0].value = &buffer_temp[0]; + update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); + qdf_mem_copy(&customMacAddr, + &hdd_ctx->config->intfMacAddr[0].bytes[0], + sizeof(tSirMacAddr)); + sme_set_custom_mac_addr(customMacAddr); + +config_exit: + + return qdf_status; +} + +#endif + /** * hdd_disable_runtime_pm() - Override to disable runtime_pm. * @cfg_ini: Handle to struct hdd_config diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 06d1bff6b9b1..4bb1a35757f2 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12603,6 +12603,14 @@ static int hdd_initialize_mac_address(struct hdd_context *hdd_ctx) return 0; } +#ifdef MOTO_UTAGS_MAC + hdd_warn("Can't update mac config via wlan_mac.bin, using MAC from serial number"); + + status = hdd_update_mac_serial(hdd_ctx); + if (QDF_IS_STATUS_SUCCESS(status)) + return; +#endif + hdd_info("using default MAC address"); /* Use fw provided MAC */ From 1597115bd2a93173a0bfc3a0bb557be3d62bf41f Mon Sep 17 00:00:00 2001 From: Santhosh Gillella Date: Tue, 19 Jun 2018 15:49:29 -0500 Subject: [PATCH 03/39] Rework reading MAC address from UTAG In WLAN driver for Helium family, QC has updated hdd_context_t structure and removed intfMacAddr variable. As a result, with Motorola MAC address changes, compilation was failing. Replaced intfMacAddr with new provisioned and derived variables to read and use MAC address from UTAG properly. Updated the MOT OUI with latest MOT OUI values. Change-Id: I78e942aefc5b802e6297402c796d5d002b6d955a Reviewed-on: https://gerrit.mot.com/1196122 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Yun Ma --- core/hdd/src/wlan_hdd_cfg.c | 12 +++++++----- core/hdd/src/wlan_hdd_main.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 8694ef141b8a..4724e36052c4 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -118,8 +118,9 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) qdf_status = QDF_STATUS_E_FAILURE; goto config_exit; } - qdf_mem_copy(&hdd_ctx->config->intfMacAddr[0].bytes[0], + qdf_mem_copy(&pHddCtx->derived_mac_addr[0].bytes, (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); + pHddCtx->num_derived_addr++; config_exit: qdf_mem_free(computedMac); @@ -138,9 +139,9 @@ QDF_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, int serialnoLen hashBuf = (char*)qdf_mem_malloc(16); /*Motorola OUI*/ - macAddr[0] = 0xA4; - macAddr[1] = 0x07; - macAddr[2] = 0xd6; + macAddr[0] = 0x38; + macAddr[1] = 0x80; + macAddr[2] = 0xDF; md5 = crypto_alloc_shash("md5", 0, 0); if (IS_ERR(md5)) { @@ -557,8 +558,9 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) macTable[0].name = "Intf0MacAddress"; macTable[0].value = &buffer_temp[0]; update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); + pHddCtx->num_provisioned_addr = MACADDRESSUSED; qdf_mem_copy(&customMacAddr, - &hdd_ctx->config->intfMacAddr[0].bytes[0], + &pHddCtx->provisioned_mac_addr[0].bytes[0], sizeof(tSirMacAddr)); sme_set_custom_mac_addr(customMacAddr); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4bb1a35757f2..9d979672957e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12608,7 +12608,7 @@ static int hdd_initialize_mac_address(struct hdd_context *hdd_ctx) status = hdd_update_mac_serial(hdd_ctx); if (QDF_IS_STATUS_SUCCESS(status)) - return; + return 0; #endif hdd_info("using default MAC address"); From 386fe031cec7d3234a41e878bcfd2892ee34de54 Mon Sep 17 00:00:00 2001 From: jmng34 Date: Tue, 12 Nov 2019 11:19:40 +0530 Subject: [PATCH 04/39] prop (CR)-Support STA+MHS concurrency mode Add the code to read the 2nd MAC address from the utag for SAP to support STA+SAP concurrency Change-Id: Ibb884c39a3751569429aabff1f757783eb4f76c8 --- core/hdd/src/wlan_hdd_cfg.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 4724e36052c4..a3b3e5d9e808 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -59,7 +59,7 @@ #define DEVICE_SERIALNO_BOOTARG "androidboot.serialno=" #define MACSTRLEN 12 #define MACSTRCOLON 58 -#define MACADDRESSUSED 1 +#define MACADDRESSUSED 2 struct sdesc { struct shash_desc shash; @@ -494,6 +494,7 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) char *bufferPtr = NULL; char buffer_temp[MACSTRLEN]; + char buffer_mac2[MACSTRLEN]; const char *cmd_line = NULL; struct device_node *chosen_node = NULL; char *buffer = NULL; @@ -547,6 +548,17 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) } bufferPtr++; } + if( *bufferPtr == ',' || *bufferPtr == '-') { + bufferPtr++; + } + for (iteration = 0; iteration < MACSTRLEN; iteration++) { + if (*bufferPtr != MACSTRCOLON) { + buffer_mac2[iteration] = *bufferPtr; + } else { + iteration = iteration - 1; + } + bufferPtr++; + } /* Mac address data format used by qcom: * Intf0MacAddress used for 1 macaddress * if gp2pdeviceAdmistered is set to 1 @@ -557,8 +569,10 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) */ macTable[0].name = "Intf0MacAddress"; macTable[0].value = &buffer_temp[0]; + macTable[1].value = &buffer_mac2[0]; update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); pHddCtx->num_provisioned_addr = MACADDRESSUSED; + hdd_populate_random_mac_addr(pHddCtx, QDF_MAX_CONCURRENCY_PERSONA - MACADDRESSUSED); qdf_mem_copy(&customMacAddr, &pHddCtx->provisioned_mac_addr[0].bytes[0], sizeof(tSirMacAddr)); From 0b153ce0293e21d88d25a5340ab587f45bebc768 Mon Sep 17 00:00:00 2001 From: hurui1 Date: Wed, 9 Aug 2017 14:46:53 +0800 Subject: [PATCH 05/39] update NOTICE for vendor/qcom/opensource/wlan/qcacld-3.0$ Change-Id: I4e04919006ea6ba01f0e395259251e0e9a32126f Signed-off-by: hurui1 Change-Id: Iecc20e489869bb2380016fb59f0fe429c3126f1f Reviewed-on: https://gerrit.mot.com/1038433 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Hongcheng Xia Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1077672 Reviewed-by: Ranjeet Gupta --- NOTICE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 NOTICE diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000000..cab58c63efb4 --- /dev/null +++ b/NOTICE @@ -0,0 +1,21 @@ +Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + +Previously licensed under the ISC license by Qualcomm Atheros, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all +copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +This file was originally distributed by Qualcomm Atheros, Inc. +under proprietary terms before Copyright ownership was assigned +to the Linux Foundation. From 4a5469e11d7856eeef4201a35ec9707e941d18aa Mon Sep 17 00:00:00 2001 From: jmng34 Date: Tue, 12 Nov 2019 19:24:48 +0530 Subject: [PATCH 06/39] Resolve compilation issues changes in the interface of APIs related to generating mac address Change-Id: I440e07452c2ffb7b3cb15528e7777d6db0012909 --- core/hdd/src/wlan_hdd_cfg.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index a3b3e5d9e808..9f265acd6023 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -118,9 +118,10 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) qdf_status = QDF_STATUS_E_FAILURE; goto config_exit; } - qdf_mem_copy(&pHddCtx->derived_mac_addr[0].bytes, + hdd_ctx->num_provisioned_addr = MACADDRESSUSED; + qdf_mem_copy(&hdd_ctx->provisioned_mac_addr[0].bytes[0], (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); - pHddCtx->num_derived_addr++; + //pHddCtx->num_derived_addr++; config_exit: qdf_mem_free(computedMac); @@ -192,8 +193,7 @@ QDF_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, int serialnoLen return cryptoStatus; } -#endif - +#else /** * get_next_line() - find and locate the new line pointer @@ -272,6 +272,8 @@ static char *i_trim(char *str) return str; } +#endif + /** struct hdd_cfg_entry - ini configuration entry * @name: name of the entry * @value: value of the entry @@ -571,10 +573,10 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) macTable[0].value = &buffer_temp[0]; macTable[1].value = &buffer_mac2[0]; update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); - pHddCtx->num_provisioned_addr = MACADDRESSUSED; - hdd_populate_random_mac_addr(pHddCtx, QDF_MAX_CONCURRENCY_PERSONA - MACADDRESSUSED); + hdd_ctx->num_provisioned_addr = MACADDRESSUSED; + hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - MACADDRESSUSED); qdf_mem_copy(&customMacAddr, - &pHddCtx->provisioned_mac_addr[0].bytes[0], + &hdd_ctx->provisioned_mac_addr[0].bytes[0], sizeof(tSirMacAddr)); sme_set_custom_mac_addr(customMacAddr); From 36f34f0e1a19ab294e74aa3e8f9196835f7641a9 Mon Sep 17 00:00:00 2001 From: Prashanth Chakravarthy Date: Fri, 2 Nov 2018 15:23:51 +0530 Subject: [PATCH 07/39] 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 9d979672957e..b5c8ab22f446 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -269,6 +269,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; @@ -16300,6 +16311,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; @@ -18150,6 +18166,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, +}; + module_param_cb(con_mode, &con_mode_ops, &con_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); @@ -18163,6 +18184,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); From fd8355050034ff7b81ad358c53f266345efe10ba Mon Sep 17 00:00:00 2001 From: jmng34 Date: Fri, 15 Nov 2019 17:50:24 +0530 Subject: [PATCH 08/39] Fix iwpriv panic iwpriv tool uses extra parameter whereas Mot ioctl uses wrqu data structure. Need to differentiate between the two to resolve panic Change-Id: Icb1c9e4f75ad1f89f43ff2be5fc7f551f3176851 Reviewed-on: https://gerrit.mot.com/1456946 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_hostapd_wext.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index b427b28f01cf..80062bad8b5c 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -343,15 +343,33 @@ static __iw_softap_setparam(struct net_device *dev, { struct hdd_adapter *adapter = (netdev_priv(dev)); mac_handle_t mac_handle; - int *value = (int *)extra; - int sub_cmd = value[0]; - int set_value = value[1]; + //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic + int *value; + int sub_cmd; + int set_value; + int *tmp = (int *) extra; + //END IKDREL3KK-11113 QDF_STATUS status; int ret = 0; struct hdd_context *hdd_ctx; bool bval = false; hdd_enter_dev(dev); + //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic to 8998 + if (tmp[0] < 0 || tmp[0] > QCASAP_SET_TM_LEVEL) { + value = (int *)(wrqu->data.pointer); + } else { + value = (int *)extra; + } + + sub_cmd = value[0]; + set_value = value[1]; + + if (!adapter || !adapter->hdd_ctx) { + hdd_err("Either hostpad adapter is null or Hal ctx is null"); + return -EINVAL; + } + //END IKDREL3KK-11113 hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); From dfbe8806ce6803d941ce66bd9f5999585c1d6851 Mon Sep 17 00:00:00 2001 From: jmng34 Date: Fri, 15 Nov 2019 18:06:23 +0530 Subject: [PATCH 09/39] (CR):Not able to disconnect any connected device Ioctls value was being filled up with wrq data structure in softap sdk, but extra parameter was being read from driver. Fix to read the wrq data structure in driver Change-Id: I06d8be4e3665bad937614fcb579c36f5f1159e10 Reviewed-on: https://gerrit.mot.com/1456947 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_hostapd_wext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 80062bad8b5c..16a4c1120c7d 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -1416,7 +1416,7 @@ int __iw_softap_modify_acl(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct hdd_adapter *adapter = (netdev_priv(dev)); - uint8_t *value = (uint8_t *) extra; + uint8_t *value = (uint8_t *)(wrqu->data.pointer); uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; int list_type, cmd, i; int ret; @@ -1835,7 +1835,7 @@ static __iw_softap_disassoc_sta(struct net_device *dev, /* iwpriv tool or framework calls this ioctl with * data passed in extra (less than 16 octets); */ - peer_macaddr = (uint8_t *) (extra); + peer_macaddr = (uint8_t *) (wrqu->data.pointer); hdd_debug("data " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(peer_macaddr)); From 057201eae4001f34284584214525241c12bf6307 Mon Sep 17 00:00:00 2001 From: Santhosh Gillella Date: Thu, 26 Jan 2017 16:44:50 -0600 Subject: [PATCH 10/39] prop (CR)-Allow ioctl called from Motcode The ioctl handling needs to be differentiated between calls made by Mot code and iwpriv code since they fill in different parameters. Change-Id: If5276c14e20f87c88123c8d3c68849ac8f4e6173 Reviewed-on: https://gerrit.mot.com/1456948 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Prashanth ChakRavarthy Tested-by: Jira Key Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_wext.c | 40 +++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 62b25d8a3556..66ddcd0457b7 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -980,6 +980,8 @@ */ #define WE_SET_CHANNEL 88 #define WE_SET_CONC_SYSTEM_PREF 89 +#define MAX_SUB_CMD 91 // Motorola, IKDREL3KK-10418 + /* * @@ -6639,9 +6641,13 @@ static int __iw_set_three_ints_getnone(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); - int *value = (int *)extra; - int sub_cmd = value[0]; - int ret; + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code + int *value; + int sub_cmd, cmd_len; + int *tmp_value; + int *get_value = NULL; + int ret = 0; + //END IKSWL-15774 uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); QDF_STATUS status; @@ -6656,6 +6662,29 @@ static int __iw_set_three_ints_getnone(struct net_device *dev, ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) return ret; + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code + tmp_value = (int *)extra; + + // Copy from wrqu structure if it was a ioctl from Motorola code + if(tmp_value[0] < 0 || (tmp_value[0] >= MAX_SUB_CMD)) { + cmd_len = wrqu->data.length; + get_value = (int *) kmalloc(cmd_len+1, GFP_KERNEL); // Motorola, IKHSS7-39028 + + if(get_value == NULL) + return -ENOMEM; + + if(copy_from_user((char *) get_value, (char*)(wrqu->data.pointer), cmd_len)) { + hdd_alert("copy_from_user --data pointer failed! bailing"); + kfree(get_value); + return -EFAULT; + } + + value = (int *)get_value; + } else { + value = (int *)extra; + } + sub_cmd = value[0]; + //END IKSWL-15774 ret = hdd_check_private_wext_control(hdd_ctx, info); if (0 != ret) @@ -6700,6 +6729,11 @@ static int __iw_set_three_ints_getnone(struct net_device *dev, break; } + + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code + if(get_value != NULL) + kfree(get_value); + //END IKSWL-15774 hdd_exit(); return ret; } From 11b8daa5c876aade91c44c4b5eb54bbd53019092 Mon Sep 17 00:00:00 2001 From: jmng34 Date: Fri, 15 Nov 2019 18:33:55 +0530 Subject: [PATCH 11/39] Prop (CR) WLAN Clark Enable extended iwpriv cmnds Enable hostapd ioctl handling fore new iwpriv range added in Rome 2 driver Change-Id: I04ea509aede003fa987f4ebbb012f674eb33a185 Reviewed-on: https://gerrit.mot.com/1456949 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_hostapd_wext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 16a4c1120c7d..49bbc25707c0 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -356,7 +356,7 @@ static __iw_softap_setparam(struct net_device *dev, hdd_enter_dev(dev); //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic to 8998 - if (tmp[0] < 0 || tmp[0] > QCASAP_SET_TM_LEVEL) { + if (tmp[0] < 0 || tmp[0] > QCASAP_SET_PHYMODE) { value = (int *)(wrqu->data.pointer); } else { value = (int *)extra; From 4da35ab6adbf53fd6ec3d262a166ae92a246971f Mon Sep 17 00:00:00 2001 From: jmng34 Date: Mon, 18 Nov 2019 10:59:49 +0530 Subject: [PATCH 12/39] get correct tx power from ioctl Propogate (CR) : get correct tx power from ioctl. Restructured based on the 8250 files Change-Id: I2216a0442cbb8dbb7fd9a1fcbbed5be9bec177ac Reviewed-on: https://gerrit.mot.com/1456950 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_hostapd_wext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 49bbc25707c0..b16b70511a13 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -1532,7 +1532,7 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, { struct hdd_adapter *adapter = (netdev_priv(dev)); struct hdd_context *hdd_ctx; - int *value = (int *)extra; + int *value = (int *)(wrqu->data.pointer); int set_value; int ret; struct qdf_mac_addr bssid = QDF_MAC_ADDR_BCAST_INIT; From 5810e6bb4f4e15bc455f9f6cd02f60d29cb4942b Mon Sep 17 00:00:00 2001 From: jmng34 Date: Mon, 18 Nov 2019 11:42:28 +0530 Subject: [PATCH 13/39] Restructure (CR): Use copy_from_user function Since we use wrqu structure to pass data from qsap, use copy_from_user function to avoid data corruption. Change-Id: Ic5f4f8631246c932432fc2317829534b521ec438 Reviewed-on: https://gerrit.mot.com/1456951 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Raja Phani K --- core/hdd/src/wlan_hdd_hostapd_wext.c | 79 ++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index b16b70511a13..35cc50641343 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -345,6 +345,7 @@ static __iw_softap_setparam(struct net_device *dev, mac_handle_t mac_handle; //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic int *value; + uint8_t *mot_value; //MOT a19110 IKLOCSEN-3014 Use copy from user int sub_cmd; int set_value; int *tmp = (int *) extra; @@ -356,15 +357,24 @@ static __iw_softap_setparam(struct net_device *dev, hdd_enter_dev(dev); //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic to 8998 - if (tmp[0] < 0 || tmp[0] > QCASAP_SET_PHYMODE) { - value = (int *)(wrqu->data.pointer); + //BEGIN MOT a19110 IKLOCSEN-3014 use copy_from_user to avoid junk value + if (tmp[0] < 0 || tmp[0] > QCSAP_SET_BTCOEX_LOW_RSSI_THRESHOLD) { + mot_value = (uint8_t *)kmalloc(wrqu->data.length+1, GFP_KERNEL); + if(copy_from_user((uint8_t *) mot_value, (uint8_t *)(wrqu->data.pointer), wrqu->data.length)) { + hdd_err("%s -- copy_from_user --data pointer failed! bailing", + __func__); + kfree(mot_value); + return -EFAULT; + } + sub_cmd = (int )(*(mot_value + 0)); + set_value = (int )(*(mot_value + 1)); + kfree(mot_value); } else { value = (int *)extra; + sub_cmd = value[0]; + set_value = value[1]; } - - sub_cmd = value[0]; - set_value = value[1]; - + //END IKLOCSEN-3014 if (!adapter || !adapter->hdd_ctx) { hdd_err("Either hostpad adapter is null or Hal ctx is null"); return -EINVAL; @@ -1416,7 +1426,7 @@ int __iw_softap_modify_acl(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct hdd_adapter *adapter = (netdev_priv(dev)); - uint8_t *value = (uint8_t *)(wrqu->data.pointer); + uint8_t *value = (uint8_t *) kmalloc(wrqu->data.length+1, GFP_KERNEL); //MOT IKLOCSEN-3014 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; int list_type, cmd, i; int ret; @@ -1427,8 +1437,18 @@ int __iw_softap_modify_acl(struct net_device *dev, hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; + if (0 != ret) { + kfree(value); //MOT IKLOCSEN-3014 + return ret; + } + //BEGIN MOT a19110 IKLOCSEN-3014 use copy_from_user to avoid junk value + if(copy_from_user((uint8_t *) value, (uint8_t *)(wrqu->data.pointer), wrqu->data.length)) { + hdd_err("%s -- copy_from_user --data pointer failed! bailing", + __func__); + kfree(value); + return -EFAULT; + } + //END IKLOCSEN-3014 ret = hdd_check_private_wext_control(hdd_ctx, info); if (0 != ret) @@ -1441,6 +1461,7 @@ int __iw_softap_modify_acl(struct net_device *dev, i++; cmd = (int)(*(value + i)); + kfree(value);//MOT IKLOCSEN-3014 hdd_debug("Modify ACL mac:" QDF_MAC_ADDR_FMT " type: %d cmd: %d", QDF_MAC_ADDR_REF(peer_mac), list_type, cmd); @@ -1532,17 +1553,23 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, { struct hdd_adapter *adapter = (netdev_priv(dev)); struct hdd_context *hdd_ctx; - int *value = (int *)(wrqu->data.pointer); + uint8_t *mot_value; int set_value; int ret; struct qdf_mac_addr bssid = QDF_MAC_ADDR_BCAST_INIT; struct qdf_mac_addr selfMac = QDF_MAC_ADDR_BCAST_INIT; hdd_enter_dev(dev); - - if (!value) + mot_value = (uint8_t*)kmalloc(wrqu->data.length+1, GFP_KERNEL); + if (NULL == mot_value) return -ENOMEM; - + if(copy_from_user((uint8_t *)mot_value, (uint8_t *)(wrqu->data.pointer), wrqu->data.length)) { + hdd_err("%s -- copy from user -- data pointer failed! bailing", __func__); + kfree(mot_value); + return -EFAULT; + } + set_value = (int)(*(mot_value + 0)); + kfree(mot_value); hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) @@ -1556,8 +1583,7 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, qdf_copy_macaddr(&bssid, &adapter->mac_addr); qdf_copy_macaddr(&selfMac, &adapter->mac_addr); - set_value = value[0]; - if (QDF_STATUS_SUCCESS != + if (QDF_STATUS_SUCCESS != sme_set_max_tx_power(hdd_ctx->mac_handle, bssid, selfMac, set_value)) { hdd_err("Setting maximum tx power failed"); @@ -1812,7 +1838,7 @@ static __iw_softap_disassoc_sta(struct net_device *dev, { struct hdd_adapter *adapter = (netdev_priv(dev)); struct hdd_context *hdd_ctx; - uint8_t *peer_macaddr; + uint8_t *peer_macaddr = (uint8_t *)kmalloc(wrqu->data.length+1, GFP_KERNEL); //MOT IKLOCSEN-3014 int ret; struct csr_del_sta_params del_sta_params; @@ -1820,22 +1846,33 @@ static __iw_softap_disassoc_sta(struct net_device *dev, if (!capable(CAP_NET_ADMIN)) { hdd_err("permission check failed"); + kfree(peer_macaddr); //MOT IKLOCSEN-3014 return -EPERM; } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) + if (0 != ret){ + kfree(peer_macaddr); //MOT IKLOCSEN-3014 return ret; - + } ret = hdd_check_private_wext_control(hdd_ctx, info); - if (0 != ret) + if (0 != ret){ + kfree(peer_macaddr); //MOT IKLOCSEN-3014 return ret; + } /* iwpriv tool or framework calls this ioctl with * data passed in extra (less than 16 octets); */ - peer_macaddr = (uint8_t *) (wrqu->data.pointer); + //BEGIN MOT a19110 IKLOCSEN-3014 use copy_from_user to avoid junk value + if(copy_from_user((uint8_t *) peer_macaddr, (uint8_t *)(wrqu->data.pointer), wrqu->data.length)) { + hdd_err("%s -- copy_from_user --data pointer failed! bailing", + __func__); + kfree(peer_macaddr); + return -EFAULT; + } + //END IKLOCSEN-3014 hdd_debug("data " QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(peer_macaddr)); @@ -1844,7 +1881,7 @@ static __iw_softap_disassoc_sta(struct net_device *dev, SIR_MAC_MGMT_DISASSOC, &del_sta_params); hdd_softap_sta_disassoc(adapter, &del_sta_params); - + kfree(peer_macaddr); //MOT IKLOCSEN-3014 hdd_exit(); return 0; } From 93e7932def828430b28b627663f56453d9a007af Mon Sep 17 00:00:00 2001 From: Prashanth Chakravarthy Date: Fri, 13 Oct 2017 12:28:29 +0530 Subject: [PATCH 14/39] prop (CR) Dont initialise ACL list Dont initialise ACL list when soft ap turns on, Qsap sends ioctl command to set the list. Change-Id: Iaee9a7c85dcb12798b7ec871bffc6f006c9ab4fb Reviewed-on: https://gerrit.mot.com/1073553 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Coverity Analysis Reviewed-by: Ishwara J A Reviewed-by: Ranjeet Gupta Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1463706 Reviewed-by: Prashanth ChakRavarthy --- core/sap/src/sap_module.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 90973e7c8857..0f3642dd1803 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -797,6 +797,9 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, pmac->sap.SapDfsInfo.sap_ch_switch_mode, pmac->sap.SapDfsInfo.reduced_beacon_interval); + //BEGIN MOT a19110 IKSWO-8490 Comment out initialisation of + //acl list. We use driver ioctl to set it +#if 0 /* Copy MAC filtering settings to sap context */ sap_ctx->eSapMacAddrAclMode = config->SapMacaddr_acl; qdf_mem_copy(sap_ctx->acceptMacList, config->accept_mac, @@ -807,7 +810,10 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, sizeof(config->deny_mac)); sap_ctx->nDenyMac = config->num_deny_mac; sap_sort_mac_list(sap_ctx->denyMacList, sap_ctx->nDenyMac); - sap_ctx->beacon_tx_rate = config->beacon_tx_rate; +#endif + //END IKSWO-8490 + sap_ctx->beacon_tx_rate = config->beacon_tx_rate; + /* Fill in the event structure for FSM */ sap_event.event = eSAP_HDD_START_INFRA_BSS; From 6139f21d52b1206e512d28710349e776b2f22a2d Mon Sep 17 00:00:00 2001 From: Abhay Kumar Date: Tue, 10 Dec 2019 14:12:20 +0530 Subject: [PATCH 15/39] demsg error logs cleaup Moving this log as debug logs by Motorola as Qualcomm need to support multiple configuration. Change-Id: Ic7dbfe906b844d23f159e73d2795159158e4dbcc Reviewed-on: https://gerrit.mot.com/1469662 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_debugfs_csr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 core/hdd/src/wlan_hdd_debugfs_csr.c diff --git a/core/hdd/src/wlan_hdd_debugfs_csr.c b/core/hdd/src/wlan_hdd_debugfs_csr.c old mode 100644 new mode 100755 index 720dd6f5f50c..b58792c7deb9 --- a/core/hdd/src/wlan_hdd_debugfs_csr.c +++ b/core/hdd/src/wlan_hdd_debugfs_csr.c @@ -335,8 +335,8 @@ void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter) adapter->debugfs_phy, csr, &fops_csr_debugfs); if (!csr->entry) - hdd_err("Failed to create debugfs file: %s", - csr->name); + hdd_debug("Failed to create debugfs file: %s", + csr->name); // MOT IKSWQ-39460 abhkumar Error logs cleanup } csr = &adapter->csr_file[HDD_DEBUFS_FILE_ID_OFFLOAD_INFO]; @@ -348,7 +348,7 @@ void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter) adapter->debugfs_phy, csr, &fops_csr_debugfs); if (!csr->entry) - hdd_err("Failed to create generic_info debugfs file"); + hdd_debug("Failed to create generic_info debugfs file"); // MOT IKSWQ-39460 abhkumar Error logs cleanup } csr = &adapter->csr_file[HDD_DEBUFS_FILE_ID_ROAM_SCAN_STATS_INFO]; @@ -360,7 +360,7 @@ void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter) adapter->debugfs_phy, csr, &fops_csr_debugfs); if (!csr->entry) - hdd_err("Failed to create generic_info debugfs file"); + hdd_debug("Failed to create generic_info debugfs file"); // MOT IKSWQ-39460 abhkumar Error logs cleanup } } From b65e2dd7a2f3815468b82b73c27ca1697763144e Mon Sep 17 00:00:00 2001 From: jmng34 Date: Thu, 9 Jan 2020 15:06:35 +0530 Subject: [PATCH 16/39] generate 2 mac address based on serial number For the concurrency mode sta+sap , we need 2 mac addresses DUT is generating only 1 mac address based on serial number added the code to generate the remaining mac addresses Change-Id: I6d2880f746656d332ace67417edb29ad8b97b44a Reviewed-on: https://gerrit.mot.com/1481319 Reviewed-by: Prashanth ChakRavarthy SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 9f265acd6023..6486d66df276 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -60,6 +60,7 @@ #define MACSTRLEN 12 #define MACSTRCOLON 58 #define MACADDRESSUSED 2 +#define MACSERIALADDR 1 struct sdesc { struct shash_desc shash; @@ -118,9 +119,10 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) qdf_status = QDF_STATUS_E_FAILURE; goto config_exit; } - hdd_ctx->num_provisioned_addr = MACADDRESSUSED; + hdd_ctx->num_provisioned_addr = MACSERIALADDR; qdf_mem_copy(&hdd_ctx->provisioned_mac_addr[0].bytes[0], (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); + hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - MACSERIALADDR); //pHddCtx->num_derived_addr++; config_exit: From 9b14f0d89607fd65f8d4979edc0611e37fd5e667 Mon Sep 17 00:00:00 2001 From: K Purushotham Reddy Date: Wed, 17 Jan 2018 15:15:28 +0530 Subject: [PATCH 17/39] Prop (CR): Store WLAN Unstripped in build archives Copy qca_cld3_wlan.ko.unstripped to out symbols folder during build time. This will save significant time to fetch the unstripped during Kernel panic analysis by avoiding repo Sync and rebuilding the image on which issue happened. Change-Id: I1fc720560e0f74178Montana0ef604413e5b553dbd2f Reviewed-on: https://gerrit.mot.com/1119046 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1456501 Submit-Approved: Raja Phani K Date: Thu, 25 Jun 2020 10:12:58 +0530 Subject: [PATCH 18/39] Disable CH14 for JAPAN We do not enable CH14 for JAPAN on all of our products and have disabled it on 8998 as well. QC SR : 04679882 Change-Id: Ibd37d238877c81b180dcd1e3e72e84ef4d868592 Signed-off-by: vineetv Reviewed-on: https://gerrit.mot.com/1642393 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg80211.c | 4 ++-- core/sap/src/sap_module.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2a8d403f4655..e299f280eddb 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -263,7 +263,7 @@ static const struct ieee80211_channel hdd_channels_2_4_ghz[] = { HDD2GHZCHAN(2462, 11, 0), HDD2GHZCHAN(2467, 12, 0), HDD2GHZCHAN(2472, 13, 0), - HDD2GHZCHAN(2484, 14, 0), + }; static const struct ieee80211_channel hdd_channels_5_ghz[] = { @@ -1937,7 +1937,7 @@ static int wlan_hdd_set_acs_ch_range( sap_cfg->acs_cfg.start_ch_freq = wlan_reg_ch_to_freq(CHAN_ENUM_2412); sap_cfg->acs_cfg.end_ch_freq = - wlan_reg_ch_to_freq(CHAN_ENUM_2484); + wlan_reg_ch_to_freq(CHAN_ENUM_2472); } else if (hw_mode == QCA_ACS_MODE_IEEE80211G) { sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11g; sap_cfg->acs_cfg.start_ch_freq = diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 0f3642dd1803..78be79ef4b25 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2237,11 +2237,11 @@ void wlansap_extend_to_acs_range(mac_handle_t mac_handle, } if (*end_ch_freq <= wlan_reg_ch_to_freq(CHAN_ENUM_2484)) { - *bandEndChannel = CHAN_ENUM_2484; + *bandEndChannel = CHAN_ENUM_2472; tmp_end_ch_freq = (*end_ch_freq + ACS_2G_EXTEND) <= - wlan_reg_ch_to_freq(CHAN_ENUM_2484) ? + wlan_reg_ch_to_freq(CHAN_ENUM_2472) ? (*end_ch_freq + ACS_2G_EXTEND) : - wlan_reg_ch_to_freq(CHAN_ENUM_2484); + wlan_reg_ch_to_freq(CHAN_ENUM_2472); } else if (*end_ch_freq <= wlan_reg_ch_to_freq(CHAN_ENUM_5865)) { *bandEndChannel = CHAN_ENUM_5865; tmp_end_ch_freq = (*end_ch_freq + ACS_5G_EXTEND) <= From b813b870d6fb62ebdf1845af660f345a0a895b00 Mon Sep 17 00:00:00 2001 From: K Purushotham Reddy Date: Wed, 17 Jan 2018 15:15:28 +0530 Subject: [PATCH 19/39] Store WLAN Unstripped and ELF in build archives Copy qca_cld3_wlan.ko.unstripped and WLAN_MERGED.elf files to out symbols folder during build time. This will save significant time to fetch the unstripped and elf files during Kernel panic analysis by avoiding repo Sync and rebuilding the image on which issue happened. This is a squash for all Helium products. Change-Id: I5a4ce7b77e9ead134ae969efa46bbecedc0f9d37 --- Android.mk | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Android.mk b/Android.mk index 31ccb852e0a8..bf7eda7c959f 100644 --- a/Android.mk +++ b/Android.mk @@ -133,13 +133,35 @@ KBUILD_OPTIONS += WLAN_CFG_OVERRIDE="$(WLAN_CFG_OVERRIDE_$(LOCAL_DEV_NAME))" endif ########################################################## -# Copy the unstrip file to out symbols folders +# Copy the unstrip file and corresponding elf file to out symbols folders WLAN_SYMBOLS_OUT := $(TARGET_OUT_UNSTRIPPED)/$(LOCAL_PATH) UNSTRIPPED_MODULE := $(WLAN_CHIPSET)_$(LOCAL_DEV_NAME).ko.unstripped UNSTRIPPED_FILE_PATH := $(TARGET_OUT_INTERMEDIATES)/$(LOCAL_PATH)/$(UNSTRIPPED_MODULE) INSTALL_WLAN_UNSTRIPPED_MODULE := mkdir -p $(WLAN_SYMBOLS_OUT); \ - cp -rf $(UNSTRIPPED_FILE_PATH) $(WLAN_SYMBOLS_OUT) + cp -rf $(UNSTRIPPED_FILE_PATH) $(WLAN_SYMBOLS_OUT); + +ifneq ($(filter msm8998 sdm845 sdm670 sdm710, $(TARGET_BOARD_PLATFORM)),) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/wlan_proc/build/ms/WLAN_MERGED.elf +else ifneq ($(filter sdm660, $(TARGET_BOARD_PLATFORM)),) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.1.0.1/wlan_proc/build/ms/WLAN_MERGED.elf +else ifneq ($(filter sm6150, $(TARGET_BOARD_PLATFORM)),) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.1/wlan_proc/build/ms/*.elf +else ifneq ($(filter trinket, $(TARGET_BOARD_PLATFORM)),) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.2/wlan_proc/build/ms/WLAN_MERGED.elf +else ifneq ($(filter lito, $(TARGET_BOARD_PLATFORM)),) + ifeq ($(WLAN_FW_ALT_VER), 5) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.5/wlan_proc/build/ms/Msaipan_WLAN_MERGED.elf + else + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.1/wlan_proc/build/ms/Msaipan_WLAN_MERGED.elf + endif +else ifneq ($(filter bengal, $(TARGET_BOARD_PLATFORM)),) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.4/wlan_proc/build/ms/WLAN_MERGED.elf +endif + +ifneq ($(WLAN_ELF_FILE_PATH),) + INSTALL_WLAN_UNSTRIPPED_MODULE += cp -rf $(WLAN_ELF_FILE_PATH) $(WLAN_SYMBOLS_OUT) +endif include $(CLEAR_VARS) LOCAL_MODULE := $(WLAN_CHIPSET)_$(LOCAL_DEV_NAME).ko From 3a015e74e345c4c51a87532d69599b31a764fdb4 Mon Sep 17 00:00:00 2001 From: liubin7 Date: Sat, 30 Nov 2019 10:36:54 +0800 Subject: [PATCH 20/39] use bt_coex_mode_set to deterministically signify the DHCP start / Stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the current infrastructure , “setPowerSave false” is known for DHCP start and “setPowerSave true” for DHCP stop. Thus, the BT Coex will give preference to Wi-Fi during this period of DHCP start – stop. This setPowerSave false / true interface is not only triggered on DHCP start / stop but this is also a public API which can be triggered by the applications when they want the Wi-Fi system to go in to WIFI_MODE_FULL_HIGH_PERF. Thus , the “setpowersave false“ will be triggered but not the corresponding “true” . As a result , the BT Coex module shall assume that the DHCP is still in progress and keeps giving preference to Wi-Fi. and WifiNative.setBluetoothCoexistenceMode() is invoked only when DHCP start & stop, hence we can use bt_coex_mode_set to deterministically signify the DHCP start / Stop and send DHCP start / stop indication to FW Change-Id: If5cca595aec22b7a10af4b127a5f75118d1ddc26 Signed-off-by: liubin7 Reviewed-on: https://gerrit.mot.com/1464100 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_power.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f27a1eee511c..7e3ef4ed76a6 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2263,8 +2263,10 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, status = wlan_hdd_set_powersave(adapter, allow_power_save, timeout); - allow_power_save ? hdd_stop_dhcp_ind(adapter) : - hdd_start_dhcp_ind(adapter); + if ( hdd_ctx->bt_coex_mode_set ) { + allow_power_save ? hdd_stop_dhcp_ind(adapter) : + hdd_start_dhcp_ind(adapter); + } hdd_exit(); return status; From 14d91947863a9bf7e3f40aba9994f2b545bf0d47 Mon Sep 17 00:00:00 2001 From: liaoxl Date: Wed, 12 Feb 2020 13:42:52 +0800 Subject: [PATCH 21/39] add wifi tx pwr limit cmd for mimo device (CR) add wifi tx pwr limit cmd for mimo device (CR) add wifi mimo tx pwr limit cmd under softap mode Per RF team req, add cmd to call QCom wmi api, so we can change TX power limit values of each ANT channel. add sub ioctl for wifi mimo tx pwr limit settings under softap mode reworked for Android R. Change-Id: Ibafe21c99b6f91e6ddf881a6109cb1a478e9284f --- core/hdd/inc/qc_sap_ioctl.h | 3 + core/hdd/src/wlan_hdd_hostapd_wext.c | 7 +++ core/hdd/src/wlan_hdd_wext.c | 83 ++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index 7226536b5a83..d76aa38c65ff 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -89,6 +89,9 @@ struct channel_list_info { #define WE_SET_THERMAL_THROTTLE_CFG 27 +/* for moto SAR features, support tx pwr limit settings on mimo device */ +#define WE_SET_MIMO_TX_POWER 32 + #define WE_P2P_NOA_CMD 2 #define QCSAP_IOCTL_MODIFY_ACL (SIOCIWFIRSTPRIV + 18) diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 35cc50641343..c566a13502d8 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -3133,6 +3133,13 @@ static const struct iw_priv_args hostapd_private_args[] = { } , #endif /* FW_THERMAL_THROTTLE_SUPPORT */ + /* for moto SAR feature */ + { + WE_SET_MIMO_TX_POWER, + IW_PRIV_TYPE_INT | MAX_VAR_ARGS, + 0, "setTxPowerM" + } + , /* handlers for main ioctl */ { QCSAP_IOCTL_MODIFY_ACL, diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 66ddcd0457b7..c54427770038 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -2581,6 +2581,9 @@ #define WE_SET_TXRX_STATS 24 +/* for moto SAR features, support tx pwr limit settings on mimo device */ +#define WE_SET_MIMO_TX_POWER 32 + #ifdef FEATURE_WLAN_TDLS #undef MAX_VAR_ARGS #define MAX_VAR_ARGS 11 @@ -8194,6 +8197,81 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, break; } #endif /* FW_THERMAL_THROTTLE_SUPPORT */ + + /* for moto SAR features, support tx pwr limit settings on mimo device */ + case WE_SET_MIMO_TX_POWER: + { + struct sar_limit_cmd_params *sar_limit_cmd; + mac_handle_t mac_handle = hdd_ctx->mac_handle; + int ret = -EINVAL; + uint32_t num_limit_rows = 4; + struct sar_limit_cmd_row *row; + + if (!mac_handle) + return -EINVAL; + + sar_limit_cmd = qdf_mem_malloc(sizeof(struct sar_limit_cmd_params)); + if (!sar_limit_cmd) + return -ENOMEM; + + sar_limit_cmd->commit_limits = 1; + sar_limit_cmd->sar_enable = WMI_SAR_FEATURE_ON_USER_DEFINED; + + row = qdf_mem_malloc(sizeof(*row) * num_limit_rows); + if (!row) { + qdf_mem_free(sar_limit_cmd); + hdd_err("Failed to allocate memory for sar_limit_row_list"); + return -EINVAL; + } + + //Below band/chain/limit_value number will get from Modem + //either CCK or OFDM, set the validity_bitmap as WMI_SAR_BAND_ID_VALID_MASK |WMI_SAR_CHAIN_ID_VALID_MASK + row[0].band_id = WMI_SAR_2G_ID; //WMI_SAR_2G_ID - 0; WMI_SAR_5G_ID - 1 + row[0].chain_id = 0; + row[0].mod_id = WMI_SAR_MOD_OFDM; + row[0].limit_value = apps_args[0]; + row[0].validity_bitmap = WMI_SAR_BAND_ID_VALID_MASK |WMI_SAR_CHAIN_ID_VALID_MASK; + + row[1].band_id = WMI_SAR_2G_ID; //WMI_SAR_2G_ID - 0; WMI_SAR_5G_ID - 1 + row[1].chain_id = 1; + row[1].mod_id = WMI_SAR_MOD_OFDM; + row[1].limit_value = apps_args[1]; + row[1].validity_bitmap = WMI_SAR_BAND_ID_VALID_MASK |WMI_SAR_CHAIN_ID_VALID_MASK; + + row[2].band_id = WMI_SAR_5G_ID; //WMI_SAR_2G_ID - 0; WMI_SAR_5G_ID - 1 + row[2].chain_id = 0; + row[2].mod_id = WMI_SAR_MOD_OFDM; + row[2].limit_value = apps_args[2]; + row[2].validity_bitmap = WMI_SAR_BAND_ID_VALID_MASK |WMI_SAR_CHAIN_ID_VALID_MASK |WMI_SAR_MOD_ID_VALID_MASK; + + row[3].band_id = WMI_SAR_5G_ID; //WMI_SAR_2G_ID - 0; WMI_SAR_5G_ID - 1 + row[3].chain_id = 1; + row[3].mod_id = WMI_SAR_MOD_OFDM; + row[3].limit_value = apps_args[3]; + row[3].validity_bitmap = WMI_SAR_BAND_ID_VALID_MASK |WMI_SAR_CHAIN_ID_VALID_MASK |WMI_SAR_MOD_ID_VALID_MASK; + + sar_limit_cmd->num_limit_rows = num_limit_rows; + sar_limit_cmd->sar_limit_row_list = row; + hdd_info("change pwr limit to [%d, %d, %d, %d].", + row[0].limit_value, row[1].limit_value, row[2].limit_value, row[3].limit_value); + if (sme_set_sar_power_limits(mac_handle,sar_limit_cmd) + != QDF_STATUS_SUCCESS) { + hdd_err("Setting maximum tx power failed"); + if(sar_limit_cmd) { + qdf_mem_free(sar_limit_cmd->sar_limit_row_list); + qdf_mem_free(sar_limit_cmd); + } + ret = -EIO; + break; + } + else{ + /* save settings in hdd_ctx, so can restore configs after SSR */ + hdd_store_sar_config(hdd_ctx, sar_limit_cmd); + hdd_info("Setting maximum tx power successful"); + } + } + break; + default: { hdd_err("Invalid IOCTL command %d", sub_cmd); @@ -10869,6 +10947,11 @@ static const struct iw_priv_args we_private_args[] = { 0, "ch_avoid"}, #endif + /* for moto SAR features, support tx pwr limit settings on mimo device */ + {WE_SET_MIMO_TX_POWER, + IW_PRIV_TYPE_INT | MAX_VAR_ARGS, + 0, + "setTxPowerM"}, /* handlers for main ioctl */ {WLAN_PRIV_FIPS_TEST, IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, From 14e782b060ac029618e66a9a946bdc09b6d162c9 Mon Sep 17 00:00:00 2001 From: Mark Reed-MREED1 Date: Tue, 4 Aug 2020 09:34:14 -0500 Subject: [PATCH 22/39] - Update wifimacaddr command line arg Remove wifimacaddr from android ro.boot property set as this property is not required and just leaks information. Change-Id: If097394bc4e9dff819fd871bcff66575a4db04c7 Reviewed-on: https://gerrit.mot.com/1714017 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Sireesha Kosuri Reviewed-by: Prashanth ChakRavarthy Tested-by: Jira Key Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 6486d66df276..75b49cdf2d50 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -55,7 +55,7 @@ #include #include -#define WIFI_MAC_BOOTARG "androidboot.wifimacaddr=" +#define WIFI_MAC_BOOTARG "wifimacaddr=" #define DEVICE_SERIALNO_BOOTARG "androidboot.serialno=" #define MACSTRLEN 12 #define MACSTRCOLON 58 From 1c432629672795ad9209aa50765b0fbc70bfc34b Mon Sep 17 00:00:00 2001 From: Daniel Finimundi Date: Thu, 16 Jul 2020 15:06:30 -0300 Subject: [PATCH 23/39] lito: Update FW version for R 7250 products will use the same WLAN version on R WLAN.HL.3.3.1. Only copy this version. Change-Id: I8d97d00a5271f23b7723020d5740e4677f51a338 Signed-off-by: Daniel Finimundi Reviewed-on: https://gerrit.mot.com/1687654 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Yinjun Chen Submit-Approved: Jira Key --- Android.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Android.mk b/Android.mk index bf7eda7c959f..9d0dbd43226d 100644 --- a/Android.mk +++ b/Android.mk @@ -150,11 +150,7 @@ else ifneq ($(filter sm6150, $(TARGET_BOARD_PLATFORM)),) else ifneq ($(filter trinket, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.2/wlan_proc/build/ms/WLAN_MERGED.elf else ifneq ($(filter lito, $(TARGET_BOARD_PLATFORM)),) - ifeq ($(WLAN_FW_ALT_VER), 5) - WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.5/wlan_proc/build/ms/Msaipan_WLAN_MERGED.elf - else - WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.1/wlan_proc/build/ms/Msaipan_WLAN_MERGED.elf - endif + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.3.1/wlan_proc/build/ms/Msaipan_WLAN_MERGED.elf else ifneq ($(filter bengal, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.4/wlan_proc/build/ms/WLAN_MERGED.elf endif From 7c75633fc79507720ebae24acf4b13c82f11666e Mon Sep 17 00:00:00 2001 From: sunyue5 Date: Fri, 20 Mar 2020 11:05:19 +0800 Subject: [PATCH 24/39] prop (CR)-Fill the MAC address more appropriately 1. Compatible with utag that only has one MAC address 2. For the generated MAC address from serialno, set the provisioned mac address as the custom mac address Change-Id: I80e96dd906c32411a42e875447504baadd66d4b6 Signed-off-by: sunyue5 Reviewed-on: https://gerrit.mot.com/1744536 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Sireesha Kosuri Reviewed-by: Zhilu Yin Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg.c | 154 +++++++++++++++++------------------- 1 file changed, 74 insertions(+), 80 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 75b49cdf2d50..db5e29d5fb69 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -58,9 +58,6 @@ #define WIFI_MAC_BOOTARG "wifimacaddr=" #define DEVICE_SERIALNO_BOOTARG "androidboot.serialno=" #define MACSTRLEN 12 -#define MACSTRCOLON 58 -#define MACADDRESSUSED 2 -#define MACSERIALADDR 1 struct sdesc { struct shash_desc shash; @@ -78,6 +75,7 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) char *bufferPtr = NULL; char *computedMac = NULL; const char *cmd_line = NULL; + tSirMacAddr mac_addr; struct device_node *chosen_node = NULL; computedMac = (char*)qdf_mem_malloc(QDF_MAC_ADDR_SIZE); @@ -119,12 +117,13 @@ QDF_STATUS hdd_update_mac_serial(struct hdd_context *hdd_ctx) qdf_status = QDF_STATUS_E_FAILURE; goto config_exit; } - hdd_ctx->num_provisioned_addr = MACSERIALADDR; qdf_mem_copy(&hdd_ctx->provisioned_mac_addr[0].bytes[0], (uint8_t *)computedMac, QDF_MAC_ADDR_SIZE); - hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - MACSERIALADDR); - //pHddCtx->num_derived_addr++; - + qdf_mem_copy(&mac_addr, &hdd_ctx->provisioned_mac_addr[0].bytes[0], + sizeof(tSirMacAddr)); + hdd_ctx->num_provisioned_addr = 1; // Only one address was generated + hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - 1); + sme_set_custom_mac_addr(mac_addr); config_exit: qdf_mem_free(computedMac); return qdf_status; @@ -494,11 +493,11 @@ config_exit: QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) { int len = 0; - int iteration = 0; - + int i = 0; + int intf = 0; char *bufferPtr = NULL; - char buffer_temp[MACSTRLEN]; - char buffer_mac2[MACSTRLEN]; + char name[QDF_MAX_CONCURRENCY_PERSONA][16] = {{0}}; + char buffer_temp[QDF_MAX_CONCURRENCY_PERSONA][MACSTRLEN+1] = {{0}}; const char *cmd_line = NULL; struct device_node *chosen_node = NULL; char *buffer = NULL; @@ -510,76 +509,71 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx) memset(macTable, 0, sizeof(macTable)); - /*Implemenation of QCOM is to read the MAC address from the predefined*/ - /*location where WLAN MMAC File have the MAC Address */ - /* Read MACs from bootparams. */ - chosen_node = of_find_node_by_name(NULL, "chosen"); - hdd_err("%s: get chosen node \n", __func__); - if (!chosen_node) - { - hdd_err("%s: get chosen node read failed \n", __func__); - goto config_exit; - } else { - cmd_line = of_get_property(chosen_node, "bootargs", &len); + /*Implemenation of QCOM is to read the MAC address from the predefined*/ + /*location where WLAN MMAC File have the MAC Address */ + /* Read MACs from bootparams. */ + chosen_node = of_find_node_by_name(NULL, "chosen"); + hdd_err("%s: get chosen node \n", __func__); + if (!chosen_node) + { + hdd_err("%s: get chosen node read failed \n", __func__); + goto config_exit; + } else { + cmd_line = of_get_property(chosen_node, "bootargs", &len); - if (!cmd_line || len <= 0) { - hdd_err("%s: get wlan MACs bootargs failed \n", __func__); - qdf_status = QDF_STATUS_E_FAILURE; - goto config_exit; - } else { - buffer = strstr(cmd_line, WIFI_MAC_BOOTARG); - if (buffer == NULL) { - hdd_err("%s: " WIFI_MAC_BOOTARG " bootarg cmd line is null", __func__); - qdf_status = QDF_STATUS_E_FAILURE; - goto config_exit; - } else { - buffer += strlen(WIFI_MAC_BOOTARG); - bufferPtr = buffer; - } - } - } - /* Mac address data format used by qcom: - * Intf0MacAddress=00AA00BB00CC - * Intf1MacAddress=00AA00BB00CD - * xxxxxxxxxxxxxxxxxxxxxxxxxxxx - * From bootarg we need to strip off : from macaddress - */ - for (iteration = 0; iteration < MACSTRLEN; iteration++) { - if (*bufferPtr != MACSTRCOLON) { - buffer_temp[iteration] = *bufferPtr; - } else { - iteration = iteration - 1; - } - bufferPtr++; - } - if( *bufferPtr == ',' || *bufferPtr == '-') { - bufferPtr++; - } - for (iteration = 0; iteration < MACSTRLEN; iteration++) { - if (*bufferPtr != MACSTRCOLON) { - buffer_mac2[iteration] = *bufferPtr; - } else { - iteration = iteration - 1; - } - bufferPtr++; - } - /* Mac address data format used by qcom: - * Intf0MacAddress used for 1 macaddress - * if gp2pdeviceAdmistered is set to 1 - * if s020deviceAdmisnited is set to 0 - * it will use Intf1MacAddress for P2P seprately - * Motorola decided to use gp2pdeviceAdmistered = 1 i.e use - * locally gerated bin MAC addr for P2P - */ - macTable[0].name = "Intf0MacAddress"; - macTable[0].value = &buffer_temp[0]; - macTable[1].value = &buffer_mac2[0]; - update_mac_from_string(hdd_ctx, &macTable[0], MACADDRESSUSED); - hdd_ctx->num_provisioned_addr = MACADDRESSUSED; - hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - MACADDRESSUSED); - qdf_mem_copy(&customMacAddr, - &hdd_ctx->provisioned_mac_addr[0].bytes[0], - sizeof(tSirMacAddr)); + if (!cmd_line || len <= 0) { + hdd_err("%s: get wlan MACs bootargs failed \n", __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer = strstr(cmd_line, WIFI_MAC_BOOTARG); + if (buffer == NULL) { + hdd_err("%s: " WIFI_MAC_BOOTARG " bootarg cmd line is null", __func__); + qdf_status = QDF_STATUS_E_FAILURE; + goto config_exit; + } else { + buffer += strlen(WIFI_MAC_BOOTARG); + bufferPtr = buffer; + } + } + } + /* Mac address data format used by qcom: + * Intf0MacAddress=00AA00BB00CC + * Intf1MacAddress=00AA00BB00CD + * xxxxxxxxxxxxxxxxxxxxxxxxxxxx + * Intf0MacAddress used for 1 macaddress + * if gp2pdeviceAdmistered is set to 1 + * if s020deviceAdmisnited is set to 0 + * it will use Intf1MacAddress for P2P seprately + * Motorola decided to use gp2pdeviceAdmistered = 1 i.e use + * locally gerated bin MAC addr for P2P + * From bootarg we need to strip off : from macaddress + */ + while (*bufferPtr != '\0' && *bufferPtr != ' ') { + if (*bufferPtr != ':' && *bufferPtr != ',') { + buffer_temp[intf][i++] = *bufferPtr; + if (i == MACSTRLEN) { + buffer_temp[intf][i] = '\0'; + sprintf(name[intf], "Intf%dMacAddress", intf); + macTable[intf].name = name[intf]; + macTable[intf].value = buffer_temp[intf]; + i = 0; + intf++; + hdd_ctx->num_provisioned_addr++; + if (intf >= QDF_MAX_CONCURRENCY_PERSONA) + break; + } + } + bufferPtr++; + } + + for (i = 0; i < intf; i++) + hdd_err("Mac address table from utag: [%s][%s]", macTable[i].name, macTable[i].value); + + update_mac_from_string(hdd_ctx, &macTable[0], intf); + hdd_populate_random_mac_addr(hdd_ctx, QDF_MAX_CONCURRENCY_PERSONA - intf); + qdf_mem_copy(&customMacAddr, &hdd_ctx->provisioned_mac_addr[0].bytes[0], + sizeof(tSirMacAddr)); sme_set_custom_mac_addr(customMacAddr); config_exit: From 310d889f6bdc4ee9eb501f7ab4a25c37f99a61fb Mon Sep 17 00:00:00 2001 From: Ningkai Zhuang Date: Sat, 26 Sep 2020 16:45:45 +0800 Subject: [PATCH 25/39] fix wlan fw path error Fix wlan fw patch error change path from 3.0.1 to 3.2.2 Change-Id: Ie1a7c8c8e6195b3e12585e6f30f1f0fb3941216e Signed-off-by: Ningkai Zhuang Reviewed-on: https://gerrit.mot.com/1760762 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Tao Sun Submit-Approved: Jira Key --- Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 9d0dbd43226d..392a3f646360 100644 --- a/Android.mk +++ b/Android.mk @@ -146,7 +146,7 @@ ifneq ($(filter msm8998 sdm845 sdm670 sdm710, $(TARGET_BOARD_PLATFORM)),) else ifneq ($(filter sdm660, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.1.0.1/wlan_proc/build/ms/WLAN_MERGED.elf else ifneq ($(filter sm6150, $(TARGET_BOARD_PLATFORM)),) - WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.1/wlan_proc/build/ms/*.elf + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.2/wlan_proc/build/ms/*.elf else ifneq ($(filter trinket, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.2/wlan_proc/build/ms/WLAN_MERGED.elf else ifneq ($(filter lito, $(TARGET_BOARD_PLATFORM)),) From d03089d01e9e8c2a94bf8493cb9b28c372b078c7 Mon Sep 17 00:00:00 2001 From: "Frederico A. M. Prado" Date: Wed, 23 Dec 2020 18:28:34 -0300 Subject: [PATCH 26/39] Revert "(CR) use bt_coex_mode_set to deterministically signify the DHCP start / Stop" This reverts commit 3aadc4d2035b97cac258b8c2e1a616765a42c678. This workaround was provoking DHCP problems. Qualcomm solved this issue in QCOM WLAN.HL.3.0.2-00597-QCAHLSWMTPLZ-1.356879.1.359825.1. Change-Id: Ibe244c2ab42441b5b2dc3fa5c55a84f6efe453c6 Reviewed-on: https://gerrit.mot.com/1835994 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Daniel Finimundi Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_power.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 7e3ef4ed76a6..f27a1eee511c 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2263,10 +2263,8 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, status = wlan_hdd_set_powersave(adapter, allow_power_save, timeout); - if ( hdd_ctx->bt_coex_mode_set ) { - allow_power_save ? hdd_stop_dhcp_ind(adapter) : - hdd_start_dhcp_ind(adapter); - } + allow_power_save ? hdd_stop_dhcp_ind(adapter) : + hdd_start_dhcp_ind(adapter); hdd_exit(); return status; From 6479c5c0c0e753d26d3149fcc908189a4bbfe065 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Thu, 7 Jan 2021 21:31:16 +0530 Subject: [PATCH 27/39] qcacld-3.0: Validate TWT setup cmd/request type value Validate TWT setup request type value obtained from user space, before sending down to fw Change-Id: I820f4912bafb84b76583ac9ed1cd88f59ea9fb3d CRs-Fixed: 2770628 Reviewed-on: https://gerrit.mot.com/1848491 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Sireesha Kosuri Reviewed-by: Bin Liu Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e299f280eddb..ae626790a552 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9433,7 +9433,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, ¶ms.twt_cmd); if (QDF_IS_STATUS_ERROR(status)) { hdd_err_rl("TWT cmd type is invalid"); - goto send_err; + return qdf_status_to_os_return(status); } cmd_id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_TRIGGER; From 8c2884a89a1f4d29559f1c1a205853a922d94803 Mon Sep 17 00:00:00 2001 From: Prashanth Chakravarthy Date: Mon, 11 Jan 2021 21:16:43 +0530 Subject: [PATCH 28/39] Handle invalid TWT value correctly. Return correctly in case of invalid TWT value is specified in test command. Change-Id: If2aa167bd2f08ab890b2c627db151087b0a9bc60 Reviewed-on: https://gerrit.mot.com/1848634 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Sireesha Kosuri Reviewed-by: Yinjun Chen Submit-Approved: Yinjun Chen Tested-by: Yinjun Chen --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ae626790a552..e299f280eddb 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9433,7 +9433,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, ¶ms.twt_cmd); if (QDF_IS_STATUS_ERROR(status)) { hdd_err_rl("TWT cmd type is invalid"); - return qdf_status_to_os_return(status); + goto send_err; } cmd_id = QCA_WLAN_VENDOR_ATTR_TWT_SETUP_TRIGGER; From 3b06734b06b03e1c55415b5e6367e7a5b8081b19 Mon Sep 17 00:00:00 2001 From: Ajit Vaishya Date: Mon, 21 Sep 2020 03:27:30 +0530 Subject: [PATCH 29/39] qcacld-3.0: Advertise Adaptive 11R supported feature to user space Currently when Adaptive 11R feature is disable via ini then user space parse Vendor Specific IE and trigger connection in FT-PSK/EAP based on STA configured key mgmt, but due to feature disabled via ini it failed to connect AP and trigger Assoc reject to user space. To overcome this advertise Adaptive 11R supported feature bit to user space and based on this feature bit user space parse, trigger connection in FT-PSK/EAP other wise fallback to PSK/EAP. Change-Id: I5d67a0cb77c3f39328467a6313a7a795e6a7a4d8 CRs-Fixed: 2785878 Mot-CRs-fixed: (CR) Reviewed-on: https://gerrit.mot.com/1855372 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Jira Key --- .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 18 ++++++++++++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 16 ++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.c | 10 ++++++++++ 3 files changed, 44 insertions(+) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index b91b7ea8b5ce..4b5dafb5c7e5 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1179,6 +1179,16 @@ ucfg_mlme_is_roam_scan_offload_enabled(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc *psoc, bool val); +/** + * ucfg_mlme_get_adaptive11r_enabled() - get adaptive 11R enabled status + * @psoc: pointer to psoc object + * @value: pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_adaptive11r_enabled(struct wlan_objmgr_psoc *psoc, + bool *value); #else static inline QDF_STATUS ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc *psoc, @@ -1186,6 +1196,14 @@ ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc *psoc, { return QDF_STATUS_SUCCESS; } + +static inline QDF_STATUS +ucfg_mlme_get_adaptive11r_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + *value = false; + return QDF_STATUS_SUCCESS; +} #endif /** diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index bdbc2aaa4243..c29ae19e0bb4 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -896,6 +896,22 @@ ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } + +QDF_STATUS +ucfg_mlme_get_adaptive11r_enabled(struct wlan_objmgr_psoc *psoc, bool *val) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *val = cfg_default(CFG_ADAPTIVE_11R); + return QDF_STATUS_E_INVAL; + } + + *val = mlme_obj->cfg.lfr.enable_adaptive_11r; + + return QDF_STATUS_SUCCESS; +} #endif QDF_STATUS diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e299f280eddb..3142918c6c2d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4017,6 +4017,16 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy, wlan_hdd_cfg80211_set_feature(feature_flags, QCA_WLAN_VENDOR_FEATURE_OCE_STA_CFON); + value = false; + status = ucfg_mlme_get_adaptive11r_enabled(hdd_ctx->psoc, &value); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("could not get FT-Adaptive 11R info"); + if (value) { + hdd_debug("FT-Adaptive 11R is Enabled"); + wlan_hdd_cfg80211_set_feature(feature_flags, + QCA_WLAN_VENDOR_FEATURE_ADAPTIVE_11R); + } + ucfg_mlme_get_twt_requestor(hdd_ctx->psoc, &twt_req); ucfg_mlme_get_twt_responder(hdd_ctx->psoc, &twt_res); From 783e9e68f3603e43cc3d8fcde5f94cebf1f9af7b Mon Sep 17 00:00:00 2001 From: sunyue5 Date: Wed, 3 Feb 2021 21:42:08 +0800 Subject: [PATCH 30/39] Support loading moto specific ini configurations In order to reuse hardware to save cost, our projects have gradually begun to use different software but the same set of hardware. Therefore, we have been unable to override some specific ini configurations in the driver according to the different hwid. Now we introduce a new file WCNSS_mot_cfg.ini which will be packaged into different software and be read by the driver to override some specific configurations Change-Id: I954497039b69af2b193b9fcd9bf278d9ed3b06a2 Signed-off-by: sunyue5 Reviewed-on: https://gerrit.mot.com/1870064 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhilu Yin Submit-Approved: Jira Key --- Android.mk | 5 +++++ core/hdd/inc/wlan_hdd_misc.h | 3 +++ core/hdd/src/wlan_hdd_main.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/Android.mk b/Android.mk index 392a3f646360..621b7311d08a 100644 --- a/Android.mk +++ b/Android.mk @@ -200,6 +200,11 @@ endif $(shell mkdir -p $(TARGET_FW_PATH); \ ln -sf $(TARGET_MAC_BIN_PATH)/wlan_mac.bin $(TARGET_FW_PATH)/wlan_mac.bin) + +# BEGIN IKSWR-45692, support loading moto specific configurations +$(shell ln -sf $(TARGET_CFG_PATH)/WCNSS_mot_cfg.ini $(TARGET_FW_PATH)/WCNSS_mot_cfg.ini) +# END IKSWR-45692 + ifneq ($(GENERIC_ODM_IMAGE),true) $(shell ln -sf $(TARGET_CFG_PATH)/WCNSS_qcom_cfg.ini $(TARGET_FW_PATH)/WCNSS_qcom_cfg.ini) endif diff --git a/core/hdd/inc/wlan_hdd_misc.h b/core/hdd/inc/wlan_hdd_misc.h index b105df1b3a98..f018d2efc3e4 100644 --- a/core/hdd/inc/wlan_hdd_misc.h +++ b/core/hdd/inc/wlan_hdd_misc.h @@ -44,6 +44,9 @@ #ifdef MSM_PLATFORM #define WLAN_INI_FILE "wlan/qca_cld/" PREFIX "WCNSS_qcom_cfg.ini" #define WLAN_MAC_FILE "wlan/qca_cld/" PREFIX "wlan_mac.bin" +// BEGIN IKSWR-45692, support loading moto specific configurations +#define WLAN_MOT_INI_FILE "wlan/qca_cld/" PREFIX "WCNSS_mot_cfg.ini" +// END IKSWR-45692 #else #define WLAN_INI_FILE "wlan/" PREFIX "qcom_cfg.ini" #define WLAN_MAC_FILE "wlan/" PREFIX "wlan_mac.bin" diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b5c8ab22f446..7da68668b3ac 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11777,6 +11777,14 @@ struct hdd_context *hdd_context_create(struct device *dev) goto err_release_store; } + // BEGIN IKSWR-45692, support loading moto specific configurations + status = cfg_psoc_parse(hdd_ctx->psoc, WLAN_MOT_INI_FILE); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to parse cfg %s, skip!", + WLAN_MOT_INI_FILE); + } + // END IKSWR-45692 + hdd_cfg_params_init(hdd_ctx); /* apply multiplier config, if not already set via module parameter */ From 848cd56f8f1fdfe4947d0b62204125f5d5fa3b47 Mon Sep 17 00:00:00 2001 From: Gabriel Tutui Date: Thu, 1 Apr 2021 16:10:16 -0300 Subject: [PATCH 31/39] Export correct ELF file for Odessa Odessa will use WLAN.HL.3.0.1 in order to match the modem release. Export the correct ELF file. Change-Id: I2a8afc725ff873acbdb99380b22b12e6ac4d1789 Reviewed-on: https://gerrit.mot.com/1915723 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Daniel Finimundi Submit-Approved: Jira Key --- Android.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Android.mk b/Android.mk index 621b7311d08a..022974c8c8ca 100644 --- a/Android.mk +++ b/Android.mk @@ -146,7 +146,11 @@ ifneq ($(filter msm8998 sdm845 sdm670 sdm710, $(TARGET_BOARD_PLATFORM)),) else ifneq ($(filter sdm660, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.1.0.1/wlan_proc/build/ms/WLAN_MERGED.elf else ifneq ($(filter sm6150, $(TARGET_BOARD_PLATFORM)),) + ifeq ($(WLAN_FW_ALT_AT43), true) + WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.1/wlan_proc/build/ms/*.elf + else WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.2.2/wlan_proc/build/ms/*.elf + endif else ifneq ($(filter trinket, $(TARGET_BOARD_PLATFORM)),) WLAN_ELF_FILE_PATH := vendor/qcom/nonhlos/WLAN.HL.3.0.2/wlan_proc/build/ms/WLAN_MERGED.elf else ifneq ($(filter lito, $(TARGET_BOARD_PLATFORM)),) From 39b9bf654dbcf964f56989253e1694a8f7168d33 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Wed, 4 Aug 2021 11:45:44 +0800 Subject: [PATCH 32/39] qcacld-3.0: Reset the wiphy suspended flag at the end of SSR During the wakeup sequence if there is any firmware recovery the resume would be rejected and the flag "is_wiphy_suspended" would not be reset in the system resume. So, at the end of the SSR reset the flag since the system has already resumed completely. Change-Id: I9f8d9fcc27d0909af2c8cd0486ce7b8c8b661287 CRs-Fixed: 3005606 Mot-CRs-fixed: (CR) Signed-off-by: zhaoqh3 Change-Id: I9f8d9fcc27d0909af2c8cd0486ce7b8c8b661287 Reviewed-on: https://gerrit.mot.com/2032304 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Rui Hu Reviewed-by: Ming Xiang Reviewed-by: Tao Sun Submit-Approved: Jira Key (cherry picked from commit 306e6895b502be64778921ceb613b17655a3404d) Reviewed-on: https://gerrit.mot.com/2033628 Reviewed-by: Zhilu Yin --- core/hdd/src/wlan_hdd_power.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f27a1eee511c..8917555b5dd1 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1632,6 +1632,9 @@ QDF_STATUS hdd_wlan_re_init(void) if (hdd_ctx->hdd_wlan_suspended) hdd_ctx->hdd_wlan_suspended = false; + if (hdd_ctx->is_wiphy_suspended) + hdd_ctx->is_wiphy_suspended = false; + return QDF_STATUS_SUCCESS; err_re_init: From f96b11246a58689a5a2a191a08db2e0fbf520fc9 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Mon, 11 Oct 2021 12:05:00 +0530 Subject: [PATCH 33/39] qcacld-3.0: Update VHT IE with highest supported LGI rate Currently, the Rx/Tx highest Long GI data rate field in the VHT IE is filled with short GI data rate. Therefore, change the highest supported data rate back to LGI data rate. Allow the short GI rate to be filled as the highest supported rate in the wiphy if short GI is enabled. Change-Id: Ie0652b4cdeef370cb8ad3d11b5d36b6959c1cbcb CRs-Fixed: 3053946 Mot-CRs-fixed:(CR) Reviewed-on: https://gerrit.mot.com/2088370 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Prashanth ChakRavarthy Submit-Approved: Jira Key --- .../mlme/dispatcher/inc/cfg_mlme_vht_caps.h | 8 +-- core/hdd/src/wlan_hdd_main.c | 53 +++++++++---------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_vht_caps.h b/components/mlme/dispatcher/inc/cfg_mlme_vht_caps.h index cc4bb01740fc..bab5d53d0d7e 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_vht_caps.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_vht_caps.h @@ -113,16 +113,16 @@ #define CFG_VHT_RX_SUPP_DATA_RATE CFG_UINT( \ "rx_supp_data_rate", \ 0, \ - 866, \ - 866, \ + 780, \ + 780, \ CFG_VALUE_OR_DEFAULT, \ "VHT RX SUPP DATA RATE") #define CFG_VHT_TX_SUPP_DATA_RATE CFG_UINT( \ "tx_supp_data_rate", \ 0, \ - 866, \ - 866, \ + 780, \ + 780, \ CFG_VALUE_OR_DEFAULT, \ "VHT TX SUPP DATA RATE") diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7da68668b3ac..40888a84ce4e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1891,43 +1891,42 @@ static void hdd_update_tgt_vht_cap(struct hdd_context *hdd_ctx, hdd_err("unable to get vht_enable2x2"); if (vht_enable_2x2) { - if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) { - /* Update 2x2 Highest Short GI data rate */ + tx_highest_data_rate = + VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2; + rx_highest_data_rate = + VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2; + } else { + tx_highest_data_rate = + VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1; + rx_highest_data_rate = + VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1; + } + + status = ucfg_mlme_cfg_set_vht_rx_supp_data_rate(hdd_ctx->psoc, + rx_highest_data_rate); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("Failed to set rx_supp_data_rate"); + + status = ucfg_mlme_cfg_set_vht_tx_supp_data_rate(hdd_ctx->psoc, + tx_highest_data_rate); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("Failed to set tx_supp_data_rate"); + + /* Update the real highest data rate to wiphy */ + if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) { + if (vht_enable_2x2) { tx_highest_data_rate = VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80; rx_highest_data_rate = VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80; } else { - /* Update 2x2 Rx Highest Long GI data Rate */ tx_highest_data_rate = - VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2; - rx_highest_data_rate = - VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2; - } - } else if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) { - /* Update 1x1 Highest Short GI data rate */ - tx_highest_data_rate = VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80; - rx_highest_data_rate = + rx_highest_data_rate = VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80; - } else { - /* Update 1x1 Highest Long GI data rate */ - tx_highest_data_rate = VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1; - rx_highest_data_rate = VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1; + } } - status = ucfg_mlme_cfg_set_vht_rx_supp_data_rate( - hdd_ctx->psoc, - rx_highest_data_rate); - if (!QDF_IS_STATUS_SUCCESS(status)) - hdd_err("Failed to set rx_supp_data_rate"); - - status = ucfg_mlme_cfg_set_vht_tx_supp_data_rate( - hdd_ctx->psoc, - tx_highest_data_rate); - if (!QDF_IS_STATUS_SUCCESS(status)) - hdd_err("Failed to set tx_supp_data_rate"); - if (WMI_VHT_CAP_MAX_MPDU_LEN_11454 == cfg->vht_max_mpdu) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454; else if (WMI_VHT_CAP_MAX_MPDU_LEN_7935 == cfg->vht_max_mpdu) From 65e9f966adfb7eeef99e66ce91034c9047240614 Mon Sep 17 00:00:00 2001 From: sunyue5 Date: Wed, 1 Dec 2021 16:28:51 +0800 Subject: [PATCH 34/39] Report the actual link speed by default The link layer speed is useful for the Android frameworks hence we need report the actual value Change-Id: Ibbca77c79c96746ff07604889396f613d8b5d915 Signed-off-by: sunyue5 Reviewed-on: https://gerrit.mot.com/2131949 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Zhilu Yin Submit-Approved: Jira Key Reviewed-by: Bin Liu --- components/mlme/dispatcher/inc/cfg_mlme_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_stats.h b/components/mlme/dispatcher/inc/cfg_mlme_stats.h index 613cb68770a2..9920ed2bbafb 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_stats.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_stats.h @@ -97,7 +97,7 @@ enum mlme_stats_link_speed_rpt_type { "gReportMaxLinkSpeed", \ CFG_STATS_LINK_SPEED_REPORT_ACTUAL, \ CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED, \ - CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED, \ + CFG_STATS_LINK_SPEED_REPORT_ACTUAL, \ CFG_VALUE_OR_DEFAULT, \ "Max link speed") From 1e47c80fe3e11f0028750135a6ca91cef144f761 Mon Sep 17 00:00:00 2001 From: VIJAY RAJ Date: Fri, 13 May 2022 12:38:55 +0530 Subject: [PATCH 35/39] qcacld-3.0: Success return from dynamic nss chain support check for 1x1 In api hdd_update_nss(), when unit test command 'iwpriv wlan0 nss 1' is used in 1x1 mode, the fail status is returned resulting in test case failure. Return a success status in api hdd_update_nss() for 1x1 mode resulting successful execution of test case. Change-Id: Id482c2686b48a0b6cdd41980c4eb4424da775ad0 CRs-Fixed: 3195517 Mot-CRs-fixed: (CR) Reviewed-on: https://gerrit.mot.com/2295901 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Daniel Finimundi Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_cfg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index db5e29d5fb69..462d943667ab 100755 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1362,7 +1363,7 @@ QDF_STATUS hdd_update_nss(struct hdd_adapter *adapter, uint8_t tx_nss, adapter->vdev_id); if (!bval) { hdd_err("Nss in 1x1, no change required, 2x2 mode disabled"); - return QDF_STATUS_E_FAILURE; + return QDF_STATUS_SUCCESS; } for (band = NSS_CHAINS_BAND_2GHZ; band < NSS_CHAINS_BAND_MAX; From 3bcae3a9c04dd4de36b673dfaffe58e722092aa6 Mon Sep 17 00:00:00 2001 From: Nagalakshmi Date: Tue, 29 Nov 2022 22:48:35 -0800 Subject: [PATCH 36/39] qcacld-3.0: Fix OOB in wma_scan_roam.c Currently in wma_extscan_hotlist_match_event_handler API, dest_hotlist get memory allocation based on numap which takes value from event->total_entries. But numap is limited to WMA_EXTSCAN_MAX_HOTLIST_ENTRIES and event->total_entries more than WMA_EXTSCAN_MAX_HOTLIST_ENTRIES can cause out of bound issue. Fix is to populate dest_hotlist->numOfAps from numap instead of event->total_entries to avoid any out of bound issue. Change-Id: If8c5de81bec2cf2a1a6546a4319e41e9b07a139d CRs-Fixed: 3346781 Mot-CRs-fixed: (CR) CVE- fixed: CVE-2023-21656 QC-CR#3346781 Signed-off-by: Sipra Patel Change-Id: If8c5de81bec2cf2a1a6546a4319e41e9b07a139d Reviewed-on: https://gerrit.mot.com/2594249 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhengjie Zhu Reviewed-by: Bin Liu Submit-Approved: Jira Key --- core/wma/src/wma_scan_roam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 32b57d9c4e50..dd596c4e7e4a 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -4965,7 +4965,7 @@ int wma_extscan_hotlist_match_event_handler(void *handle, return -ENOMEM; dest_ap = &dest_hotlist->ap[0]; - dest_hotlist->numOfAps = event->total_entries; + dest_hotlist->numOfAps = numap; dest_hotlist->requestId = event->config_request_id; if (event->first_entry_index + From 715a9dc0d2b82a013fd38bf66861f7fbbca78ca4 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Tue, 6 Dec 2022 16:31:04 +0800 Subject: [PATCH 37/39] qcacld-3.0: Fix OOB issue when access wma_find_vdev_by_addr The function 'wma_find_vdev_by_addr' returns pointer to cdp_vdev, so should avoid to comapre with QDF_STATUS_SUCCESS. Change-Id: Ia302fcc8e705cc01a27bd1dce9f7cb09a8ef29b0 CRs-Fixed: 3346764 Mot-CRs-fixed: (CR) CVE- fixed: CVE-2023-21669 QC-CR#3346764 Signed-off-by: Sipra Patel Change-Id: Ia302fcc8e705cc01a27bd1dce9f7cb09a8ef29b0 Reviewed-on: https://gerrit.mot.com/2594389 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhengjie Zhu Reviewed-by: Bin Liu Submit-Approved: Jira Key --- core/wma/src/wma_mgmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 00ba18715cca..584d5e49ed06 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3478,7 +3479,7 @@ int wma_form_rx_packet(qdf_nbuf_t buf, if (status) return status; } else if (wma_find_vdev_id_by_addr(wma_handle, wh->i_addr1, - &vdev_id) == QDF_STATUS_SUCCESS) { + &vdev_id)) { status = wma_check_and_process_rmf_frame(wma_handle, vdev_id, &wh, From 8f40a98744b62eb3f77374d016bacaf6626e5e01 Mon Sep 17 00:00:00 2001 From: Sipra Patel Date: Tue, 27 Jun 2023 22:48:52 -0500 Subject: [PATCH 38/39] Revert "qcacld-3.0: Fix OOB issue when access wma_find_vdev_by_addr" This reverts commit 9d226c736c0a33b0ff0eeeed9f1d59fdd1965415. "wma_find_vdev_id_by_addr" returns QDF_STATUS so the original code was correct. Change-Id: I47fab8e776d6787e426235bf073b9d62e1a4e6f2 Reviewed-on: https://gerrit.mot.com/2658239 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Bin Liu Tested-by: Navya Vijayan Submit-Approved: Jira Key (cherry picked from commit f858d4c4688e93192df150f428f0b13b8522a226) --- core/wma/src/wma_mgmt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 584d5e49ed06..00ba18715cca 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3479,7 +3478,7 @@ int wma_form_rx_packet(qdf_nbuf_t buf, if (status) return status; } else if (wma_find_vdev_id_by_addr(wma_handle, wh->i_addr1, - &vdev_id)) { + &vdev_id) == QDF_STATUS_SUCCESS) { status = wma_check_and_process_rmf_frame(wma_handle, vdev_id, &wh, From 2be68b65c5017751160b6e370f67991c7ee7a215 Mon Sep 17 00:00:00 2001 From: Aravind Kishore Sukla Date: Wed, 8 Feb 2023 14:45:03 +0530 Subject: [PATCH 39/39] qcacld-3.0: Ignore CSA request for invalid channel In present scenario, STA disconnects with AP if it receives invalid channel in CSA IE. In this case STA shouldn't disconnect with AP as this request may come from a spoof AP. Ignore this CSA request as it might be from spoof AP and if it is from genuine AP heart beat failure happens and results in disconnection. After disconnection DUT may reconnect to same or other APs. Mot-CRs-fixed: (CR) CVE-Fixed: CVE-2023-28584 Bug: 285903061 Change-Id: Ied7911da42f1c46a4431b46f57679a686a2f1f24 CRs-Fixed: 3390251 Signed-off-by: Ashutosh Verma Change-Id: Ied7911da42f1c46a4431b46f57679a686a2f1f24 Reviewed-on: https://gerrit.mot.com/2705280 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- core/mac/src/pe/lim/lim_utils.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 25b5c858e588..f4ad67174fdd 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -1934,22 +1934,16 @@ static void __lim_process_channel_switch_timeout(struct pe_session *pe_session) } /* - * If the channel-list that AP is asking us to switch is invalid - * then we cannot switch the channel. Just disassociate from AP. - * We will find a better AP !!! + * The channel switch request received from AP is carrying + * invalid channel. It's ok to ignore this channel switch + * request as it might be from spoof AP. If it's from genuine + * AP, it may lead to heart beat failure and result in + * disconnection. DUT can go ahead and reconnect to it/any + * other AP once it disconnects. */ - if ((pe_session->limMlmState == - eLIM_MLM_LINK_ESTABLISHED_STATE) && - (pe_session->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && - (pe_session->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) { - pe_err("Invalid channel! Disconnect"); - lim_tear_down_link_with_ap(mac, - mac->lim.lim_timers. - gLimChannelSwitchTimer.sessionId, - eSIR_MAC_UNSUPPORTED_CHANNEL_CSA, - eLIM_LINK_MONITORING_DISASSOC); - return; - } + pe_err("Invalid channel freq %u Ignore CSA request", + channel_freq); + return; } switch (pe_session->gLimChannelSwitch.state) { case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY: