From 9a9266eac5a2e5a551faf80ec9646a854aa2bd9e Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Fri, 16 Sep 2016 14:19:43 +0530 Subject: qcacld-3.0: Start BSS on operating band based on ACS hw mode qcacld-2.0 to qcacld-3.0 propagation. Currently, SAP start's on 2.4ghz channels on detecting unsafe channels even though operating band ACS hw mode is configured on 5ghz channels. Fix is to start BSS on band based on ACS hw mode Change-Id: I210937b4b464c408d5a22c348c028fa9a11b2142 CRs-Fixed: 1005327 --- core/sap/src/sap_api_link_cntl.c | 15 ++++++--------- core/sap/src/sap_fsm.c | 27 +++++++++++++++++++++++++-- core/sap/src/sap_internal.h | 1 + 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index bf694c2ed6db..2447879bcab7 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -325,14 +325,9 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("CSR scan_status = eCSR_SCAN_ABORT/FAILURE (%d), choose default channel"), scan_status); -#ifdef SOFTAP_CHANNEL_RANGE - if (sap_ctx->acs_cfg->hw_mode == eCSR_DOT11_MODE_11a) - sap_ctx->channel = SAP_DEFAULT_5GHZ_CHANNEL; - else - sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL; -#else - sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL; -#endif + sap_ctx->channel = + sap_select_default_oper_chan(hal_handle, + sap_ctx->acs_cfg->hw_mode); sap_ctx->sap_state = eSAP_ACS_CHANNEL_SELECTED; sap_ctx->sap_status = eSAP_STATUS_SUCCESS; goto close_session; @@ -396,7 +391,9 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext, goto close_session; } else { #else - sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL; + sap_ctx->channel = + sap_select_default_oper_chan(hal_handle, + sap_ctx->acs_cfg->hw_mode); } else { #endif /* Valid Channel Found from scan results. */ diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 32fca747bc2e..8eef7af80814 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2089,6 +2089,28 @@ sap_dfs_is_channel_in_nol_list(ptSapContext sap_context, return false; } +/** + * sap_select_default_oper_chan() - Select operating channel based on acs hwmode + * @hal: pointer to HAL + * @acs_hwmode: HW mode of ACS + * + * Return: selected operating channel + */ +uint8_t sap_select_default_oper_chan(tHalHandle hal, uint32_t acs_hwmode) +{ + uint8_t channel; + + if ((acs_hwmode == QCA_ACS_MODE_IEEE80211A) || + (acs_hwmode == QCA_ACS_MODE_IEEE80211AD)) + channel = SAP_DEFAULT_5GHZ_CHANNEL; + else + channel = SAP_DEFAULT_24GHZ_CHANNEL; + + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, + FL("channel selected to start bss %d"), channel); + return channel; +} + /** * sap_goto_channel_sel - Function for initiating scan request for SME * @sap_context: Sap Context value. @@ -2297,8 +2319,9 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("SAP Configuring default channel, Ch=%d"), sap_context->channel); - /* In case of error, switch to default channel */ - sap_context->channel = SAP_DEFAULT_24GHZ_CHANNEL; + sap_context->channel = + sap_select_default_oper_chan(h_hal, + sap_context->acs_cfg->hw_mode); #ifdef SOFTAP_CHANNEL_RANGE if (sap_context->channelList != NULL) { diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index e8e50f6350ed..dc52e2fe304c 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -434,4 +434,5 @@ QDF_STATUS sap_close_session(tHalHandle hHal, #ifdef __cplusplus } #endif +uint8_t sap_select_default_oper_chan(tHalHandle hal, uint32_t acs_hwmode); #endif -- cgit v1.2.3 From 994d423a61d50303652dae6a4af812a1c0cefe3f Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 26 Sep 2016 12:24:27 -0700 Subject: Release 5.1.0.28F Release 5.1.0.28F Change-Id: I6fa4708d7bbb66697dfb8c486ae2703c50afc79d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4961be7d0034..8b8421d2ee73 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28E" +#define QWLAN_VERSIONSTR "5.1.0.28F" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 3ca74839718bfd08c44c9fa66191629196b49e34 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 22 Sep 2016 15:18:02 -0700 Subject: qcacld-3.0: Fix NSS being sent to firmware Send NSS value to firmware in update_nss as received from AP in OTA frame, VHT Operation notifcation IE. Change-Id: Iad92cc3ce634b69397666f574917b5254a73dcda CRs-Fixed: 1070224 --- core/mac/src/pe/lim/lim_process_action_frame.c | 3 ++- core/mac/src/pe/sch/sch_beacon_process.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 7b8e00944635..df4b83cd9299 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -577,7 +577,8 @@ static void __lim_process_operating_mode_action_frame(tpAniSirGlobal mac_ctx, (operating_mode_frm->OperatingMode.rxNSS + 1)) { sta_ptr->vhtSupportedRxNss = operating_mode_frm->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session, sta_ptr->vhtSupportedRxNss, + lim_set_nss_change(mac_ctx, session, + operating_mode_frm->OperatingMode.rxNSS, sta_ptr->staIndex, mac_hdr->sa); } diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 7978ec11542a..af1fc51ce010 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -494,8 +494,7 @@ void update_nss(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, tpSirMacMgmtHdr mgmt_hdr) { if (sta_ds->vhtSupportedRxNss != (beacon->OperatingMode.rxNSS + 1)) { - sta_ds->vhtSupportedRxNss = - beacon->OperatingMode.rxNSS + 1; + sta_ds->vhtSupportedRxNss = beacon->OperatingMode.rxNSS; lim_set_nss_change(mac_ctx, session_entry, sta_ds->vhtSupportedRxNss, sta_ds->staIndex, mgmt_hdr->sa); -- cgit v1.2.3 From 8716fb891bc46d7c3a9c44e5760f1c26a60f3245 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 26 Sep 2016 14:05:14 -0700 Subject: Release 5.1.0.28G Release 5.1.0.28G Change-Id: I3b13a9f1c856b13ac5e0a45134b7b74f08cd4f0e CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8b8421d2ee73..89887d6b9dc6 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "G" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28F" +#define QWLAN_VERSIONSTR "5.1.0.28G" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From f97e822df47d7794f10d77e8f3f842a23844825e Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Wed, 21 Sep 2016 10:31:38 -0700 Subject: qcacld-3.0: Use PLD API to get SOC serial number Socinfo API is not a standard system API. Hence, use PLD API to get SOC serial number instead of calling socinfo API directly to enhance driver portability. Change-Id: I1d673d2f3b0066f4e05f2f465abc8a6cad7a1f8f CRs-Fixed: 1069480 --- core/hdd/src/wlan_hdd_main.c | 3 +-- core/pld/inc/pld_common.h | 1 + core/pld/src/pld_common.c | 26 ++++++++++++++++++++++++++ core/pld/src/pld_snoc.h | 10 ++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 211603a66366..cd6a4348403e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -80,7 +80,6 @@ #ifdef MSM_PLATFORM #include #endif -#include #include #include #include "cfg_api.h" @@ -1344,7 +1343,7 @@ static int hdd_generate_macaddr_auto(hdd_context_t *hdd_ctx) {0x00, 0x0A, 0xF5, 0x00, 0x00, 0x00} }; - serialno = socinfo_get_serial_number(); + serialno = pld_socinfo_get_serial_number(hdd_ctx->parent_dev); if (serialno == 0) return -EINVAL; diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 28760ff459f8..bcf647b0b1a4 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -378,4 +378,5 @@ int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, void *pld_smmu_get_mapping(struct device *dev); int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); +unsigned int pld_socinfo_get_serial_number(struct device *dev); #endif diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index b5db8a502006..737cc389c600 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1518,3 +1518,29 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr, return ret; } + +/** + * pld_socinfo_get_serial_number() - Get SOC serial number + * @dev: device + * + * Return: SOC serial number + */ +unsigned int pld_socinfo_get_serial_number(struct device *dev) +{ + unsigned int ret = 0; + enum pld_bus_type type = pld_get_bus_type(dev); + + switch (type) { + case PLD_BUS_TYPE_SNOC: + ret = pld_snoc_socinfo_get_serial_number(dev); + break; + case PLD_BUS_TYPE_PCIE: + pr_err("Not supported on type %d\n", type); + break; + default: + pr_err("Invalid device type %d\n", type); + break; + } + + return ret; +} diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index 07a60e69cf12..9c8a53b8a889 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -130,6 +130,11 @@ static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, { return 0; } +static inline +unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) +{ + return 0; +} #else int pld_snoc_register_driver(void); void pld_snoc_unregister_driver(void); @@ -213,5 +218,10 @@ static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, { return icnss_smmu_map(dev, paddr, iova_addr, size); } +static inline +unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) +{ + return icnss_socinfo_get_serial_number(dev); +} #endif #endif -- cgit v1.2.3 From 4a03c3c1edbc50963274847a559570c3d3f222ae Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 26 Sep 2016 15:04:21 -0700 Subject: Release 5.1.0.28H Release 5.1.0.28H Change-Id: I00b5dcc0bf86e7b829cef4703821103ea8f8ffd8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 89887d6b9dc6..0bf49ba45619 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28G" +#define QWLAN_VERSIONSTR "5.1.0.28H" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 71c0c2b698f48c14eeff12dd3f31ff6a130ef9b6 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 27 Sep 2016 04:05:06 -0700 Subject: Release 5.1.0.28I Release 5.1.0.28I Change-Id: I6b4301cad3754dc7cda85f49f7aaebb0896e6a73 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 0bf49ba45619..35c3154b76c2 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28H" +#define QWLAN_VERSIONSTR "5.1.0.28I" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 52198e44dbefc528cb82e1dbb4cb98a45469d72d Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 26 Sep 2016 13:53:09 -0700 Subject: qcacld-3.0: Reorganize HT caps from hdd_update_config_dat API Reorganizing HT caps from hdd_update_config_dat API before refactoring it. Change-Id: I3ec667873952f1a4f2ce8414960b7d936fc93d90 CRs-Fixed: 1069659 --- core/hdd/src/wlan_hdd_cfg.c | 69 +++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index f16c31324d8a..03255b62a92c 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6161,29 +6161,23 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, return QDF_STATUS_SUCCESS; } - /** - * hdd_update_config_dat() - scan the string and convery to u8 array - * @str: the pointer to the string - * @intArray: the pointer of buffer to store the u8 value - * @len: size of the buffer + * hdd_update_ht_cap_in_cfg() - to update HT cap in global CFG + * @hdd_ctx: pointer to hdd context * - * Return: QDF_STATUS_SUCCESS if the configuration could be updated corectly, - * otherwise QDF_STATUS_E_INVAL + * This API will update the HT config in CFG after taking intersection + * of INI and firmware capabilities provided reading CFG + * + * Return: true or false */ -bool hdd_update_config_dat(hdd_context_t *pHddCtx) +static bool hdd_update_ht_cap_in_cfg(hdd_context_t *pHddCtx) { bool fStatus = true; uint32_t val; uint16_t val16; - struct hdd_config *pConfig = pHddCtx->config; tSirMacHTCapabilityInfo *phtCapInfo; - /* - * During the initialization both 2G and 5G capabilities should be same. - * So read 5G HT capablity and update 2G and 5G capablities. - */ if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val) == QDF_STATUS_E_FAILURE) { @@ -6206,6 +6200,44 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) fStatus = false; hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); } + sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val); + val16 = (uint16_t) val; + phtCapInfo = (tSirMacHTCapabilityInfo *) &val16; + phtCapInfo->rxSTBC = pConfig->enableRxSTBC; + phtCapInfo->advCodingCap = pConfig->enableRxLDPC; + val = val16; + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val) + == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); + } + + return fStatus; +} + +/** + * hdd_update_config_dat() - scan the string and convery to u8 array + * @str: the pointer to the string + * @intArray: the pointer of buffer to store the u8 value + * @len: size of the buffer + * + * Return: QDF_STATUS_SUCCESS if the configuration could be updated corectly, + * otherwise QDF_STATUS_E_INVAL + */ +bool hdd_update_config_dat(hdd_context_t *pHddCtx) +{ + bool fStatus = true; + uint32_t val; + struct hdd_config *pConfig = pHddCtx->config; + + /* + * During the initialization both 2G and 5G capabilities should be same. + * So read 5G HT capablity and update 2G and 5G capablities. + */ + if (!hdd_update_ht_cap_in_cfg(pHddCtx)) { + fStatus = false; + hddLog(LOGE, "Could not set HT CAP in cfg"); + } if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate) == QDF_STATUS_E_FAILURE) { @@ -6600,17 +6632,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) } } - sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val); - val16 = (uint16_t) val; - phtCapInfo = (tSirMacHTCapabilityInfo *) &val16; - phtCapInfo->rxSTBC = pConfig->enableRxSTBC; - phtCapInfo->advCodingCap = pConfig->enableRxLDPC; - val = val16; - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val) - == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); - } if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC, pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) { -- cgit v1.2.3 From 6c7c39fd27df0df1958d6762f7ea9ba03c4c2bdf Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 26 Sep 2016 14:30:34 -0700 Subject: qcacld-3.0: Reorganize VHT caps from hdd_update_config_dat API Reorganizing VHT caps from hdd_update_config_dat API before refactoring it. Change-Id: Id9b514590185f331c7437d5e20259b14411a40dc CRs-Fixed: 1069659 --- core/hdd/src/wlan_hdd_cfg.c | 231 ++++++++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 104 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 03255b62a92c..7654fd6eebbc 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6163,7 +6163,7 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, /** * hdd_update_ht_cap_in_cfg() - to update HT cap in global CFG - * @hdd_ctx: pointer to hdd context + * @pHddCtx: pointer to hdd context * * This API will update the HT config in CFG after taking intersection * of INI and firmware capabilities provided reading CFG @@ -6215,6 +6215,127 @@ static bool hdd_update_ht_cap_in_cfg(hdd_context_t *pHddCtx) return fStatus; } +/** + * hdd_update_vht_cap_in_cfg() - to update VHT cap in global CFG + * @pHddctx: pointer to hdd context + * + * This API will update the VHT config in CFG after taking intersection + * of INI and firmware capabilities provided reading CFG + * + * Return: true or false + */ +static bool hdd_update_vht_cap_in_cfg(hdd_context_t *pHddCtx) +{ + bool fStatus = true; + uint32_t val; + struct hdd_config *pConfig = pHddCtx->config; + + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_ENABLE_TXBF_20MHZ, + pConfig->enableTxBFin20MHz) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not set value for WNI_CFG_VHT_ENABLE_TXBF_20MHZ"); + } + /* Based on cfg.ini, update the Basic MCS set, RX/TX MCS map + * in the cfg.dat. Valid values are 0(MCS0-7), 1(MCS0-8), 2(MCS0-9) + * we update only the least significant 2 bits in the + * corresponding fields. + */ + if ((pConfig->dot11Mode == eHDD_DOT11_MODE_AUTO) || + (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) || + (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac)) { + /* Currently shortGI40Mhz is used for shortGI80Mhz */ + if (sme_cfg_set_int + (pHddCtx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ, + pConfig->ShortGI40MhzEnable) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass WNI_VHT_SHORT_GI_80MHZ to CFG"); + } + /* Hardware is capable of doing + * 128K AMPDU in 11AC mode */ + if (sme_cfg_set_int(pHddCtx->hHal, + WNI_CFG_VHT_AMPDU_LEN_EXPONENT, + pConfig->fVhtAmpduLenExponent) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_VHT_AMPDU_LEN_EXPONENT to CFG"); + } + /* Change MU Bformee only when TxBF is enabled */ + if (pConfig->enableTxBF) { + sme_cfg_get_int(pHddCtx->hHal, + WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &val); + + if (val != pConfig->enableMuBformee) { + if (sme_cfg_set_int(pHddCtx->hHal, + WNI_CFG_VHT_MU_BEAMFORMEE_CAP, + pConfig->enableMuBformee + ) == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_VHT_MU_BEAMFORMEE_CAP to CFG"); + } + } + } + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, + pConfig->vhtMpduLen) == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_VHT_MAX_MPDU_LENGTH to CFG"); + } + + if (pConfig->enable2x2 && pConfig->enable_su_tx_bformer) { + if (sme_cfg_set_int(pHddCtx->hHal, + WNI_CFG_VHT_SU_BEAMFORMER_CAP, + pConfig->enable_su_tx_bformer) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hdd_err("set SU_BEAMFORMER_CAP to CFG failed"); + } + if (sme_cfg_set_int(pHddCtx->hHal, + WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, + NUM_OF_SOUNDING_DIMENSIONS) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hdd_err("failed to set NUM_OF_SOUNDING_DIM"); + } + } + } + + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC, + pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, "Could not pass on WNI_CFG_VHT_RXSTBC to CFG"); + } + + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_TXSTBC, + pConfig->enableTxSTBC) == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, "Could not pass on WNI_CFG_VHT_TXSTBC to CFG"); + } + + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, + pConfig->enableRxLDPC) == QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG"); + } + + if (sme_cfg_set_int(pHddCtx->hHal, + WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, + pConfig->txBFCsnValue) == + QDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED to CFG"); + } + return fStatus; + +} + /** * hdd_update_config_dat() - scan the string and convery to u8 array * @str: the pointer to the string @@ -6239,6 +6360,11 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) hddLog(LOGE, "Could not set HT CAP in cfg"); } + if (!hdd_update_vht_cap_in_cfg(pHddCtx)) { + fStatus = false; + hddLog(LOGE, "Could not set VHT CAP in cfg"); + } + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate) == QDF_STATUS_E_FAILURE) { fStatus = false; @@ -6532,14 +6658,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) "Failure: Could not set value for WNI_CFG_DFS_MASTER_ENABLED"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_ENABLE_TXBF_20MHZ, - pConfig->enableTxBFin20MHz) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not set value for WNI_CFG_VHT_ENABLE_TXBF_20MHZ"); - } - if (sme_cfg_set_int (pHddCtx->hHal, WNI_CFG_HEART_BEAT_THRESHOLD, pConfig->HeartbeatThresh24) == QDF_STATUS_E_FAILURE) { @@ -6564,93 +6682,7 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) hddLog(LOGE, "Could not pass on WNI_CFG_ENABLE_MC_ADDR_LIST to CFG"); } - /* Based on cfg.ini, update the Basic MCS set, RX/TX MCS map - * in the cfg.dat. Valid values are 0(MCS0-7), 1(MCS0-8), 2(MCS0-9) - * we update only the least significant 2 bits in the - * corresponding fields. - */ - if ((pConfig->dot11Mode == eHDD_DOT11_MODE_AUTO) || - (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) || - (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac)) { - /* Currently shortGI40Mhz is used for shortGI80Mhz */ - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ, - pConfig->ShortGI40MhzEnable) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass WNI_VHT_SHORT_GI_80MHZ to CFG"); - } - /* Hardware is capable of doing - * 128K AMPDU in 11AC mode */ - if (sme_cfg_set_int(pHddCtx->hHal, - WNI_CFG_VHT_AMPDU_LEN_EXPONENT, - pConfig->fVhtAmpduLenExponent) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_AMPDU_LEN_EXPONENT to CFG"); - } - /* Change MU Bformee only when TxBF is enabled */ - if (pConfig->enableTxBF) { - sme_cfg_get_int(pHddCtx->hHal, - WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &val); - - if (val != pConfig->enableMuBformee) { - if (sme_cfg_set_int(pHddCtx->hHal, - WNI_CFG_VHT_MU_BEAMFORMEE_CAP, - pConfig->enableMuBformee - ) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_MU_BEAMFORMEE_CAP to CFG"); - } - } - } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, - pConfig->vhtMpduLen) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_MAX_MPDU_LENGTH to CFG"); - } - - if (pConfig->enable2x2 && pConfig->enable_su_tx_bformer) { - if (sme_cfg_set_int(pHddCtx->hHal, - WNI_CFG_VHT_SU_BEAMFORMER_CAP, - pConfig->enable_su_tx_bformer) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hdd_err("set SU_BEAMFORMER_CAP to CFG failed"); - } - if (sme_cfg_set_int(pHddCtx->hHal, - WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, - NUM_OF_SOUNDING_DIMENSIONS) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hdd_err("failed to set NUM_OF_SOUNDING_DIM"); - } - } - } - - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC, - pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_VHT_RXSTBC to CFG"); - } - - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_TXSTBC, - pConfig->enableTxSTBC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_VHT_TXSTBC to CFG"); - } - - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, - pConfig->enableRxLDPC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG"); - } #ifdef WLAN_SOFTAP_VSTA_FEATURE if (pConfig->fEnableVSTASupport) { sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, &val); @@ -6827,15 +6859,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) "Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, - WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, - pConfig->txBFCsnValue) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED to CFG"); - } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TGT_GTX_USR_CFG, pConfig->tgt_gtx_usr_cfg) == QDF_STATUS_E_FAILURE) { fStatus = false; -- cgit v1.2.3 From df0f8742c058e1b92cd09ff7d90b63508287cb17 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 26 Sep 2016 14:56:31 -0700 Subject: qcacld-3.0: Refactor few APIs related to updating config in HDD Refactor following HDD APIs to match coding standard: hdd_update_vht_cap_in_cfg hdd_update_ht_cap_in_cfg hdd_update_config_dat Change-Id: I0da05cad92a558aa4ca5dc585d80adb3a8ea9f1e CRs-Fixed: 1069659 --- core/hdd/inc/wlan_hdd_cfg.h | 2 +- core/hdd/src/wlan_hdd_cfg.c | 781 +++++++++++++++++++------------------------ core/hdd/src/wlan_hdd_main.c | 2 +- core/hdd/src/wlan_hdd_wext.c | 2 +- 4 files changed, 341 insertions(+), 446 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 65640a50fa28..ba1e3d5f56b6 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -4255,7 +4255,7 @@ QDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx); QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx); QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx); QDF_STATUS hdd_set_sme_chan_list(hdd_context_t *hdd_ctx); -bool hdd_update_config_dat(hdd_context_t *pHddCtx); +bool hdd_update_config_cfg(hdd_context_t *pHddCtx); QDF_STATUS hdd_cfg_get_global_config(hdd_context_t *pHddCtx, char *pBuf, int buflen); diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 7654fd6eebbc..dcef23ecfb4b 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6163,709 +6163,604 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, /** * hdd_update_ht_cap_in_cfg() - to update HT cap in global CFG - * @pHddCtx: pointer to hdd context + * @hdd_ctx: pointer to hdd context * * This API will update the HT config in CFG after taking intersection * of INI and firmware capabilities provided reading CFG * * Return: true or false */ -static bool hdd_update_ht_cap_in_cfg(hdd_context_t *pHddCtx) +static bool hdd_update_ht_cap_in_cfg(hdd_context_t *hdd_ctx) { - bool fStatus = true; + bool status = true; uint32_t val; uint16_t val16; - struct hdd_config *pConfig = pHddCtx->config; - tSirMacHTCapabilityInfo *phtCapInfo; + struct hdd_config *config = hdd_ctx->config; + tSirMacHTCapabilityInfo *ht_cap_info; - if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, + if (sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); } - if (pConfig->ShortGI20MhzEnable) + if (config->ShortGI20MhzEnable) val |= HT_CAPS_SHORT_GI20; else val &= ~(HT_CAPS_SHORT_GI20); - if (pConfig->ShortGI40MhzEnable) + if (config->ShortGI40MhzEnable) val |= HT_CAPS_SHORT_GI40; else val &= ~(HT_CAPS_SHORT_GI40); - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, val) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); } - sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val); + sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val); val16 = (uint16_t) val; - phtCapInfo = (tSirMacHTCapabilityInfo *) &val16; - phtCapInfo->rxSTBC = pConfig->enableRxSTBC; - phtCapInfo->advCodingCap = pConfig->enableRxLDPC; + ht_cap_info = (tSirMacHTCapabilityInfo *) &val16; + ht_cap_info->rxSTBC = config->enableRxSTBC; + ht_cap_info->advCodingCap = config->enableRxLDPC; val = val16; - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val) + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, val) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); } - return fStatus; + return status; } /** * hdd_update_vht_cap_in_cfg() - to update VHT cap in global CFG - * @pHddctx: pointer to hdd context + * @hdd_ctx: pointer to hdd context * * This API will update the VHT config in CFG after taking intersection * of INI and firmware capabilities provided reading CFG * * Return: true or false */ -static bool hdd_update_vht_cap_in_cfg(hdd_context_t *pHddCtx) +static bool hdd_update_vht_cap_in_cfg(hdd_context_t *hdd_ctx) { - bool fStatus = true; + bool status = true; uint32_t val; - struct hdd_config *pConfig = pHddCtx->config; + struct hdd_config *config = hdd_ctx->config; - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_ENABLE_TXBF_20MHZ, - pConfig->enableTxBFin20MHz) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_ENABLE_TXBF_20MHZ, + config->enableTxBFin20MHz) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not set value for WNI_CFG_VHT_ENABLE_TXBF_20MHZ"); + status = false; + hdd_err("Couldn't set value for WNI_CFG_VHT_ENABLE_TXBF_20MHZ"); } /* Based on cfg.ini, update the Basic MCS set, RX/TX MCS map * in the cfg.dat. Valid values are 0(MCS0-7), 1(MCS0-8), 2(MCS0-9) * we update only the least significant 2 bits in the * corresponding fields. */ - if ((pConfig->dot11Mode == eHDD_DOT11_MODE_AUTO) || - (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) || - (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac)) { + if ((config->dot11Mode == eHDD_DOT11_MODE_AUTO) || + (config->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) || + (config->dot11Mode == eHDD_DOT11_MODE_11ac)) { /* Currently shortGI40Mhz is used for shortGI80Mhz */ - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ, - pConfig->ShortGI40MhzEnable) == - QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass WNI_VHT_SHORT_GI_80MHZ to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ, + config->ShortGI40MhzEnable) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass WNI_VHT_SHORT_GI_80MHZ to CFG"); } /* Hardware is capable of doing * 128K AMPDU in 11AC mode */ - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_AMPDU_LEN_EXPONENT, - pConfig->fVhtAmpduLenExponent) == + config->fVhtAmpduLenExponent) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_AMPDU_LEN_EXPONENT to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_AMPDU_LEN_EXPONENT to CFG"); } /* Change MU Bformee only when TxBF is enabled */ - if (pConfig->enableTxBF) { - sme_cfg_get_int(pHddCtx->hHal, + if (config->enableTxBF) { + sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &val); - if (val != pConfig->enableMuBformee) { - if (sme_cfg_set_int(pHddCtx->hHal, + if (val != config->enableMuBformee) { + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, - pConfig->enableMuBformee + config->enableMuBformee ) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_MU_BEAMFORMEE_CAP to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_MU_BEAMFORMEE_CAP to CFG"); } } } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, - pConfig->vhtMpduLen) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_MAX_MPDU_LENGTH to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, + config->vhtMpduLen) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_MAX_MPDU_LENGTH to CFG"); } - if (pConfig->enable2x2 && pConfig->enable_su_tx_bformer) { - if (sme_cfg_set_int(pHddCtx->hHal, + if (config->enable2x2 && config->enable_su_tx_bformer) { + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_SU_BEAMFORMER_CAP, - pConfig->enable_su_tx_bformer) == + config->enable_su_tx_bformer) == QDF_STATUS_E_FAILURE) { - fStatus = false; + status = false; hdd_err("set SU_BEAMFORMER_CAP to CFG failed"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, NUM_OF_SOUNDING_DIMENSIONS) == QDF_STATUS_E_FAILURE) { - fStatus = false; + status = false; hdd_err("failed to set NUM_OF_SOUNDING_DIM"); } } } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC, - pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_VHT_RXSTBC to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_RXSTBC, + config->enableRxSTBC) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_RXSTBC to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_TXSTBC, - pConfig->enableTxSTBC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_VHT_TXSTBC to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_TXSTBC, + config->enableTxSTBC) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_TXSTBC to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, - pConfig->enableRxLDPC) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, + config->enableRxLDPC) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, - pConfig->txBFCsnValue) == + config->txBFCsnValue) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED to CFG"); } - return fStatus; + return status; } /** - * hdd_update_config_dat() - scan the string and convery to u8 array - * @str: the pointer to the string - * @intArray: the pointer of buffer to store the u8 value - * @len: size of the buffer + * hdd_update_config_cfg() - API to update INI setting based on hw/fw caps + * @hdd_ctx: pointer to hdd_ctx * - * Return: QDF_STATUS_SUCCESS if the configuration could be updated corectly, - * otherwise QDF_STATUS_E_INVAL + * This API reads the cfg file which is updated with hardware/firmware + * capabilities and intersect it with INI setting provided by user. After + * taking intersection it adjust cfg it self. For example, if user has enabled + * RX LDPC through INI but hardware/firmware doesn't support it then disable + * it in CFG file here. + * + * Return: true or false based on outcome. */ -bool hdd_update_config_dat(hdd_context_t *pHddCtx) +bool hdd_update_config_cfg(hdd_context_t *hdd_ctx) { - bool fStatus = true; + bool status = true; uint32_t val; - struct hdd_config *pConfig = pHddCtx->config; + struct hdd_config *config = hdd_ctx->config; /* * During the initialization both 2G and 5G capabilities should be same. * So read 5G HT capablity and update 2G and 5G capablities. */ - if (!hdd_update_ht_cap_in_cfg(pHddCtx)) { - fStatus = false; - hddLog(LOGE, "Could not set HT CAP in cfg"); + if (!hdd_update_ht_cap_in_cfg(hdd_ctx)) { + status = false; + hdd_err("Couldn't set HT CAP in cfg"); } - if (!hdd_update_vht_cap_in_cfg(pHddCtx)) { - fStatus = false; - hddLog(LOGE, "Could not set VHT CAP in cfg"); + if (!hdd_update_vht_cap_in_cfg(hdd_ctx)) { + status = false; + hdd_err("Couldn't set VHT CAP in cfg"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate) + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_FIXED_RATE, config->TxRate) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_FIXED_RATE to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_FIXED_RATE to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_MAX_RX_AMPDU_FACTOR, - pConfig->MaxRxAmpduFactor) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MAX_RX_AMPDU_FACTOR, + config->MaxRxAmpduFactor) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_MPDU_DENSITY, - pConfig->ht_mpdu_density) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MPDU_DENSITY, + config->ht_mpdu_density) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_MPDU_DENSITY to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_MPDU_DENSITY to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_SHORT_PREAMBLE, - pConfig->fIsShortPreamble) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_SHORT_PREAMBLE to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_SHORT_PREAMBLE, + config->fIsShortPreamble) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_SHORT_PREAMBLE to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME, - pConfig->nPassiveMinChnTime) + config->nPassiveMinChnTime) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME" - " to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME, - pConfig->nPassiveMaxChnTime) + config->nPassiveMaxChnTime) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME" - " to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_BEACON_INTERVAL, - pConfig->nBeaconInterval) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_BEACON_INTERVAL to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_BEACON_INTERVAL, + config->nBeaconInterval) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_BEACON_INTERVAL to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_MAX_PS_POLL, - pConfig->nMaxPsPoll) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, "Could not pass on WNI_CFG_MAX_PS_POLL to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MAX_PS_POLL, + config->nMaxPsPoll) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_MAX_PS_POLL to CFG"); } - if (sme_cfg_set_int (pHddCtx->hHal, WNI_CFG_LOW_GAIN_OVERRIDE, - pConfig->fIsLowGainOverride) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_LOW_GAIN_OVERRIDE to HAL"); + if (sme_cfg_set_int (hdd_ctx->hHal, WNI_CFG_LOW_GAIN_OVERRIDE, + config->fIsLowGainOverride) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_LOW_GAIN_OVERRIDE to HAL"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_RSSI_FILTER_PERIOD, - pConfig->nRssiFilterPeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_RSSI_FILTER_PERIOD to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_RSSI_FILTER_PERIOD, + config->nRssiFilterPeriod) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_RSSI_FILTER_PERIOD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_IGNORE_DTIM, - pConfig->fIgnoreDtim) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_IGNORE_DTIM to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_IGNORE_DTIM, + config->fIgnoreDtim) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_IGNORE_DTIM to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_PS_ENABLE_HEART_BEAT, - pConfig->fEnableFwHeartBeatMonitoring) + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PS_ENABLE_HEART_BEAT, + config->fEnableFwHeartBeatMonitoring) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PS_HEART_BEAT to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_PS_HEART_BEAT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_PS_ENABLE_BCN_FILTER, - pConfig->fEnableFwBeaconFiltering) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PS_ENABLE_BCN_FILTER, + config->fEnableFwBeaconFiltering) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PS_BCN_FILTER to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_PS_BCN_FILTER to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, - pConfig->fEnableFwRssiMonitoring) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, + config->fEnableFwRssiMonitoring) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PS_RSSI_MONITOR to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_PS_RSSI_MONITOR to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, - pConfig->nDataInactivityTimeout) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, + config->nDataInactivityTimeout) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_ENABLE_LTE_COEX, - pConfig->enableLTECoex) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ENABLE_LTE_COEX to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ENABLE_LTE_COEX, + config->enableLTECoex) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_ENABLE_LTE_COEX to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT, - pConfig->apKeepAlivePeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_AP_KEEP_ALIVE_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT, + config->apKeepAlivePeriod) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_AP_KEEP_ALIVE_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT, - pConfig->goKeepAlivePeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_GO_KEEP_ALIVE_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT, + config->goKeepAlivePeriod) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_GO_KEEP_ALIVE_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_AP_LINK_MONITOR_TIMEOUT, - pConfig->apLinkMonitorPeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_AP_LINK_MONITOR_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_AP_LINK_MONITOR_TIMEOUT, + config->apLinkMonitorPeriod) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_AP_LINK_MONITOR_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_GO_LINK_MONITOR_TIMEOUT, - pConfig->goLinkMonitorPeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_GO_LINK_MONITOR_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_GO_LINK_MONITOR_TIMEOUT, + config->goLinkMonitorPeriod) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_GO_LINK_MONITOR_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_MCAST_BCAST_FILTER_SETTING, - pConfig->mcastBcastFilterSetting) == QDF_STATUS_E_FAILURE) - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_MCAST_BCAST_FILTER_SETTING to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MCAST_BCAST_FILTER_SETTING, + config->mcastBcastFilterSetting) == QDF_STATUS_E_FAILURE) + status = false; + hdd_err("Couldn't pass on WNI_CFG_MCAST_BCAST_FILTER_SETTING to CFG"); - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_SINGLE_TID_RC, - pConfig->bSingleTidRc) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_SINGLE_TID_RC to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_SINGLE_TID_RC, + config->bSingleTidRc) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_SINGLE_TID_RC to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_TELE_BCN_WAKEUP_EN, - pConfig->teleBcnWakeupEn) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TELE_BCN_WAKEUP_EN to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TELE_BCN_WAKEUP_EN, + config->teleBcnWakeupEn) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_TELE_BCN_WAKEUP_EN to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_TELE_BCN_TRANS_LI, - pConfig->nTeleBcnTransListenInterval) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TELE_BCN_TRANS_LI, + config->nTeleBcnTransListenInterval) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TELE_BCN_TRANS_LI to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TELE_BCN_TRANS_LI to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_TELE_BCN_MAX_LI, - pConfig->nTeleBcnMaxListenInterval) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TELE_BCN_MAX_LI, + config->nTeleBcnMaxListenInterval) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TELE_BCN_MAX_LI to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TELE_BCN_MAX_LI to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS, - pConfig->nTeleBcnTransLiNumIdleBeacons) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS, + config->nTeleBcnTransLiNumIdleBeacons) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS, - pConfig->nTeleBcnMaxLiNumIdleBeacons) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS, + config->nTeleBcnMaxLiNumIdleBeacons) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_RF_SETTLING_TIME_CLK, - pConfig->rfSettlingTimeUs) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_RF_SETTLING_TIME_CLK to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_RF_SETTLING_TIME_CLK, + config->rfSettlingTimeUs) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_RF_SETTLING_TIME_CLK to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, - pConfig->infraStaKeepAlivePeriod) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, + config->infraStaKeepAlivePeriod) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_DYNAMIC_PS_POLL_VALUE, - pConfig->dynamicPsPollValue) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DYNAMIC_PS_POLL_VALUE to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DYNAMIC_PS_POLL_VALUE, + config->dynamicPsPollValue) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_DYNAMIC_PS_POLL_VALUE to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT, - pConfig->nNullDataApRespTimeout) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_PS_NULLDATA_DELAY_TIMEOUT to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT, + config->nNullDataApRespTimeout) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_PS_NULLDATA_DELAY_TIMEOUT to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, - pConfig->apDataAvailPollPeriodInMs) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, + config->apDataAvailPollPeriodInMs) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_FRAGMENTATION_THRESHOLD, - pConfig->FragmentationThreshold) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_FRAGMENTATION_THRESHOLD to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_FRAGMENTATION_THRESHOLD, + config->FragmentationThreshold) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_FRAGMENTATION_THRESHOLD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_RTS_THRESHOLD, - pConfig->RTSThreshold) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_RTS_THRESHOLD to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_RTS_THRESHOLD, + config->RTSThreshold) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_RTS_THRESHOLD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_11D_ENABLED, - pConfig->Is11dSupportEnabled) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_11D_ENABLED to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_11D_ENABLED, + config->Is11dSupportEnabled) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_11D_ENABLED to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_DFS_MASTER_ENABLED, - pConfig->enableDFSMasterCap) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DFS_MASTER_ENABLED, + config->enableDFSMasterCap) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Failure: Could not set value for WNI_CFG_DFS_MASTER_ENABLED"); + status = false; + hdd_err("Failure: Couldn't set value for WNI_CFG_DFS_MASTER_ENABLED"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_HEART_BEAT_THRESHOLD, - pConfig->HeartbeatThresh24) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_HEART_BEAT_THRESHOLD to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HEART_BEAT_THRESHOLD, + config->HeartbeatThresh24) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_HEART_BEAT_THRESHOLD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, - pConfig->apDataAvailPollPeriodInMs) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD, + config->apDataAvailPollPeriodInMs) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_ENABLE_MC_ADDR_LIST, - pConfig->fEnableMCAddrList) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ENABLE_MC_ADDR_LIST to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ENABLE_MC_ADDR_LIST, + config->fEnableMCAddrList) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_ENABLE_MC_ADDR_LIST to CFG"); } #ifdef WLAN_SOFTAP_VSTA_FEATURE - if (pConfig->fEnableVSTASupport) { - sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, &val); + if (config->fEnableVSTASupport) { + sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_ASSOC_STA_LIMIT, &val); if (val <= WNI_CFG_ASSOC_STA_LIMIT_STADEF) val = WNI_CFG_ASSOC_STA_LIMIT_STAMAX; } else { - val = pConfig->maxNumberOfPeers; + val = config->maxNumberOfPeers; } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, val) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ASSOC_STA_LIMIT, val) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ASSOC_STA_LIMIT to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_ASSOC_STA_LIMIT to CFG"); } #endif - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION, - pConfig->enableLpwrImgTransition) + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION, + config->enableLpwrImgTransition) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ENABLE_LPWR_IMG_TRANSITION to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_ENABLE_LPWR_IMG_TRANSITION to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, - pConfig->enableMCCAdaptiveScheduler) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, + config->enableMCCAdaptiveScheduler) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP, - pConfig->disableLDPCWithTxbfAP) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP, + config->disableLDPCWithTxbfAP) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ZERO, - pConfig->retryLimitZero) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_ZERO to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ZERO, + config->retryLimitZero) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_DYNAMIC_THRESHOLD_ZERO to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ONE, - pConfig->retryLimitOne) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_ONE to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ONE, + config->retryLimitOne) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_DYNAMIC_THRESHOLD_ONE to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_TWO, - pConfig->retryLimitTwo) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_TWO to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_TWO, + config->retryLimitTwo) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_DYNAMIC_THRESHOLD_TWO to CFG"); } - if (sme_cfg_set_int - (pHddCtx->hHal, WNI_CFG_MAX_MEDIUM_TIME, - pConfig->cfgMaxMediumTime) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_MAX_MEDIUM_TIME to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MAX_MEDIUM_TIME, + config->cfgMaxMediumTime) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_MAX_MEDIUM_TIME to CFG"); } #ifdef FEATURE_WLAN_TDLS - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK, - pConfig->fTDLSUapsdMask) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK to CFG"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK, + config->fTDLSUapsdMask) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_BUF_STA_ENABLED, - pConfig->fEnableTDLSBufferSta) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_BUF_STA_ENABLED, + config->fEnableTDLSBufferSta) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_PUAPSD_INACT_TIME, - pConfig->fTDLSPuapsdInactivityTimer) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_PUAPSD_INACT_TIME, + config->fTDLSPuapsdInactivityTimer) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_PUAPSD_INACT_TIME to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_PUAPSD_INACT_TIME to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_RX_FRAME_THRESHOLD, - pConfig->fTDLSRxFrameThreshold) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_RX_FRAME_THRESHOLD, + config->fTDLSRxFrameThreshold) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_RX_FRAME_THRESHOLD to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_RX_FRAME_THRESHOLD to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED, - pConfig->fEnableTDLSOffChannel) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED, + config->fEnableTDLSOffChannel) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_WMM_MODE_ENABLED, - pConfig->fEnableTDLSWmmMode) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TDLS_WMM_MODE_ENABLED, + config->fEnableTDLSWmmMode) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TDLS_WMM_MODE_ENABLED to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_TDLS_WMM_MODE_ENABLED to CFG"); } #endif - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ENABLE_ADAPT_RX_DRAIN, - pConfig->fEnableAdaptRxDrain) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ENABLE_ADAPT_RX_DRAIN, + config->fEnableAdaptRxDrain) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ENABLE_ADAPT_RX_DRAIN to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_ENABLE_ADAPT_RX_DRAIN to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ANTENNA_DIVESITY, - pConfig->antennaDiversity) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_ANTENNA_DIVESITY, + config->antennaDiversity) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_ANTENNA_DIVESITY to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_ANTENNA_DIVESITY to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DEFAULT_RATE_INDEX_24GHZ, - pConfig->defaultRateIndex24Ghz) == + config->defaultRateIndex24Ghz) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DEFAULT_RATE_INDEX_24GHZ to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_DEFAULT_RATE_INDEX_24GHZ to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL, - pConfig->debugP2pRemainOnChannel) == + config->debugP2pRemainOnChannel) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL to CFG"); } #ifdef WLAN_FEATURE_11W - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, - pConfig->pmfSaQueryMaxRetries) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, + config->pmfSaQueryMaxRetries) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_SA_QUERY_MAX_RETRIES to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_SA_QUERY_MAX_RETRIES to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, - pConfig->pmfSaQueryRetryInterval) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, + config->pmfSaQueryRetryInterval) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_SA_QUERY_RETRY_INTERVAL to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_SA_QUERY_RETRY_INTERVAL to CFG"); } #endif - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_ATIM_WIN_SIZE, - pConfig->ibssATIMWinSize) == + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_IBSS_ATIM_WIN_SIZE, + config->ibssATIMWinSize) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CFG"); + status = false; + hdd_err("Couldn't pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CFG"); } - if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TGT_GTX_USR_CFG, - pConfig->tgt_gtx_usr_cfg) == QDF_STATUS_E_FAILURE) { - fStatus = false; - hddLog(LOGE, - "Could not pass on WNI_CFG_TGT_GTX_USR_CFG to CCM"); + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TGT_GTX_USR_CFG, + config->tgt_gtx_usr_cfg) == QDF_STATUS_E_FAILURE) { + status = false; + hdd_err("Couldn't pass on WNI_CFG_TGT_GTX_USR_CFG to CCM"); } - return fStatus; + return status; } #ifdef FEATURE_WLAN_SCAN_PNO /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cd6a4348403e..d7e2dd46a402 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7167,7 +7167,7 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx) } /* Apply the cfg.ini to cfg.dat */ - if (!hdd_update_config_dat(hdd_ctx)) { + if (!hdd_update_config_cfg(hdd_ctx)) { hdd_alert("config update failed"); ret = -EINVAL; goto out; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 45b11d137e48..7074de2d6bd2 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -5075,7 +5075,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, phddctx->config->nChannelBondingMode5GHz = smeconfig.csrConfig.channelBondingMode5GHz; phddctx->config->vhtChannelWidth = vhtchanwidth; - if (hdd_update_config_dat(phddctx) == false) { + if (hdd_update_config_cfg(phddctx) == false) { hdd_err("could not update config_dat"); return -EIO; } -- cgit v1.2.3 From 5c39016d5931447db6379a1a056b9e089c60a3fc Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 26 Sep 2016 15:07:05 -0700 Subject: qcacld-3.0: Update CFG after taking intersection of INI & hw caps Current driver is updating HT & VHT RX LDPC cap in CFG based on INI only which is not correct. Take the intersection of INI items and hw caps for HT & VHT RX LDPC and update the CFG accordingly. Change-Id: Ibef165b61c2242d8fec6da7f7a2ce3e8d5c5aa11 CRs-Fixed: 1069659 --- core/hdd/src/wlan_hdd_cfg.c | 52 ++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index dcef23ecfb4b..ec449eea9923 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6172,46 +6172,31 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, */ static bool hdd_update_ht_cap_in_cfg(hdd_context_t *hdd_ctx) { - bool status = true; - uint32_t val; + uint32_t val32; uint16_t val16; - struct hdd_config *config = hdd_ctx->config; + bool status = true; tSirMacHTCapabilityInfo *ht_cap_info; if (sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, - &val) == - QDF_STATUS_E_FAILURE) { - status = false; - hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); - } - if (config->ShortGI20MhzEnable) - val |= HT_CAPS_SHORT_GI20; - else - val &= ~(HT_CAPS_SHORT_GI20); - - if (config->ShortGI40MhzEnable) - val |= HT_CAPS_SHORT_GI40; - else - val &= ~(HT_CAPS_SHORT_GI40); - - if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, - val) == + &val32) == QDF_STATUS_E_FAILURE) { status = false; - hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); + hdd_err("Could not get WNI_CFG_HT_CAP_INFO"); } - sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val); - val16 = (uint16_t) val; + val16 = (uint16_t) val32; ht_cap_info = (tSirMacHTCapabilityInfo *) &val16; - ht_cap_info->rxSTBC = config->enableRxSTBC; - ht_cap_info->advCodingCap = config->enableRxLDPC; - val = val16; - if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, val) - == QDF_STATUS_E_FAILURE) { + ht_cap_info->advCodingCap &= hdd_ctx->config->enableRxLDPC; + ht_cap_info->rxSTBC = QDF_MIN(ht_cap_info->rxSTBC, + hdd_ctx->config->enableRxSTBC); + ht_cap_info->txSTBC &= hdd_ctx->config->enableTxSTBC; + ht_cap_info->shortGI20MHz &= hdd_ctx->config->ShortGI20MhzEnable; + ht_cap_info->shortGI40MHz &= hdd_ctx->config->ShortGI40MhzEnable; + val32 = val16; + if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, val32) == + QDF_STATUS_E_FAILURE) { status = false; - hdd_err("Couldn't pass on WNI_CFG_HT_CAP_INFO to CFG"); + hdd_err("Could not set WNI_CFG_HT_CAP_INFO"); } - return status; } @@ -6310,8 +6295,13 @@ static bool hdd_update_vht_cap_in_cfg(hdd_context_t *hdd_ctx) hdd_err("Couldn't pass on WNI_CFG_VHT_TXSTBC to CFG"); } + if (sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, &val) == + QDF_STATUS_E_FAILURE) { + status &= false; + hdd_err("Could not get WNI_CFG_VHT_LDPC_CODING_CAP"); + } if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP, - config->enableRxLDPC) == QDF_STATUS_E_FAILURE) { + config->enableRxLDPC & val) == QDF_STATUS_E_FAILURE) { status = false; hdd_err("Couldn't pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG"); } -- cgit v1.2.3 From 499d364340883c2480e1c892d301852781798441 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 26 Sep 2016 16:46:03 -0700 Subject: qcacld-3.0: Fix dwell-time when 2G-SAP is active and DBS is supported Old generation of projects, which had only one MAC, are restricted to use 28ms of fix active and passive dwell time when SAP session is active but with new generation of projects, which can have two MACs, are permitted to use longer active and passive dwell time when SAP session is active on 2G band and DBS is supported. Change-Id: I2638d9b7a3677c3f0b329ed8109d01baa2cffd68 CRs-Fixed: 1071353 --- core/cds/inc/cds_concurrency.h | 1 + core/cds/src/cds_concurrency.c | 30 ++++++++++++++++++++++++++++++ core/wma/src/wma_scan_roam.c | 11 ++++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index a8a6a3dcd46b..1604c977f425 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -693,6 +693,7 @@ void cds_decr_session_set_pcl(enum tQDF_ADAPTER_MODE mode, uint8_t session_id); QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks); QDF_STATUS cds_deinit_policy_mgr(void); +uint8_t cds_get_channel(enum cds_con_mode mode, uint32_t *vdev_id); QDF_STATUS cds_get_pcl(enum cds_con_mode mode, uint8_t *pcl_channels, uint32_t *len, uint8_t *pcl_weight, uint32_t weight_len); diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 601e7f999408..6e7d95790568 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -4950,6 +4950,36 @@ bool cds_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, return status; } +/** + * cds_get_channel() - provide channel number of given mode and vdevid + * @mode: given CDS mode + * @vdev_id: pointer to vdev_id + * + * This API will provide channel number of matching mode and vdevid. + * If vdev_id is NULL then it will match only mode + * If vdev_id is not NULL the it will match both mode and vdev_id + * + * Return: channel number + */ +uint8_t cds_get_channel(enum cds_con_mode mode, uint32_t *vdev_id) +{ + uint32_t idx = 0; + + if (mode >= CDS_MAX_NUM_OF_MODE) { + cds_err("incorrect mode"); + return 0; + } + + for (idx = 0; idx < MAX_NUMBER_OF_CONC_CONNECTIONS; idx++) { + if ((conc_connection_list[idx].mode == mode) && + (!vdev_id || (*vdev_id == + conc_connection_list[idx].vdev_id)) + && conc_connection_list[idx].in_use) + return conc_connection_list[idx].chan; + } + return 0; +} + /** * cds_get_pcl() - provides the preferred channel list for * new connection diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 9bca3f3ce651..96d6fde1c490 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -415,14 +415,19 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, if (wma_is_sap_active(wma_handle)) { /* P2P/STA scan while SoftAP is sending beacons. * Max duration of CTS2self is 32 ms, which limits the - * dwell time. + * dwell time. If DBS is supported and if SAP is on 2G channel + * then keep passive dwell time default. */ cmd->dwell_time_active = QDF_MIN(scan_req->maxChannelTime, (WMA_CTS_DURATION_MS_MAX - WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME)); - cmd->dwell_time_passive = - cmd->dwell_time_active; + if (!wma_is_hw_dbs_capable() || + (wma_is_hw_dbs_capable() && + CDS_IS_CHANNEL_5GHZ( + cds_get_channel(CDS_SAP_MODE, NULL)))) { + cmd->dwell_time_passive = cmd->dwell_time_active; + } cmd->burst_duration = 0; } -- cgit v1.2.3 From 727ffac40b6f71d4393f9c73934ebcf1f4d0542e Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 27 Sep 2016 09:24:49 -0700 Subject: Release 5.1.0.28J Release 5.1.0.28J Change-Id: I24dc5796f1be474c13cc81c5650690477375b1e8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 35c3154b76c2..eb3b1c4e879d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28I" +#define QWLAN_VERSIONSTR "5.1.0.28J" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 6563461fa71120d7bf4d40baaa3228f2396fd3d3 Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Thu, 18 Aug 2016 13:24:32 +0530 Subject: qcacld-3.0: Implement vendor command for ACS policy qcacld-2.0 to qcacld-3.0 propagation Add support for vendor command which informs the driver about the ACS policy. QCA_NL80211_VENDOR_SUBCMD_ACS_POLICY is used to inform driver about ACS policies. QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE attribute tells if DFS channel should be enabled or disabled in ACS. QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL attribute provides channel number to SAP module to skip ACS and use this channel as operating channel. Change-Id: I1ba69ed8fdf1c56a90e857054c725b830293d6bf CRs-Fixed: 997433 --- core/hdd/inc/wlan_hdd_main.h | 12 ++++ core/hdd/src/wlan_hdd_cfg80211.c | 129 ++++++++++++++++++++++++++++++++++++++- core/hdd/src/wlan_hdd_cfg80211.h | 34 +++++++++++ core/hdd/src/wlan_hdd_hostapd.c | 12 ++++ core/hdd/src/wlan_hdd_main.c | 25 ++++++++ core/sap/inc/sap_api.h | 15 +++++ core/sap/src/sap_ch_select.c | 7 ++- core/sap/src/sap_internal.h | 1 + core/sap/src/sap_module.c | 2 + 9 files changed, 234 insertions(+), 3 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index e0dfae71a240..3c3954f69764 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1224,6 +1224,16 @@ enum driver_modules_status { DRIVER_MODULES_CLOSED }; +/** + * struct acs_dfs_policy - Define ACS policies + * @acs_dfs_mode: Dfs mode enabled/disabled. + * @acs_channel: pre defined channel to avoid ACS. + */ +struct acs_dfs_policy { + enum dfs_mode acs_dfs_mode; + uint8_t acs_channel; +}; + /** Adapter structure definition */ struct hdd_context_s { @@ -1495,6 +1505,7 @@ struct hdd_context_s { bool stop_modules_in_progress; bool start_modules_in_progress; bool update_mac_addr_to_fw; + struct acs_dfs_policy acs_policy; }; /*--------------------------------------------------------------------------- @@ -1848,4 +1859,5 @@ static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg, #endif void hdd_wlan_update_target_info(hdd_context_t *hdd_ctx, void *context); +enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode); #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 837b9a090427..d45d371a37bd 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -74,6 +74,8 @@ #include "wlan_hdd_nan.h" #include #include "wlan_logging_sock_svc.h" +#include "sap_api.h" + #ifdef FEATURE_WLAN_EXTSCAN #include "wlan_hdd_ext_scan.h" @@ -142,6 +144,11 @@ #define HDD_CHANNEL_14 14 +#define IS_DFS_MODE_VALID(mode) ((mode >= DFS_MODE_NONE && \ + mode <= DFS_MODE_DEPRIORITIZE)) +#define IS_CHANNEL_VALID(channel) ((channel >= 0 && channel < 15) \ + || (channel >= 36 && channel <= 184)) + #define MAX_TXPOWER_SCALE 4 #define CDS_MAX_FEATURE_SET 8 @@ -1330,7 +1337,10 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter) int status; sap_config = &adapter->sessionCtx.ap.sapConfig; - sap_config->channel = AUTO_CHANNEL_SELECT; + if (hdd_ctx->acs_policy.acs_channel) + sap_config->channel = hdd_ctx->acs_policy.acs_channel; + else + sap_config->channel = AUTO_CHANNEL_SELECT; status = wlan_hdd_sap_cfg_dfs_override(adapter); if (status < 0) { @@ -6790,6 +6800,115 @@ wlan_hdd_sap_config_policy[QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_CHANNEL] = {.type = NLA_U8 }, }; +static const struct nla_policy +wlan_hdd_set_acs_dfs_config_policy[QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX + 1] = { + [QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_HINT] = {.type = NLA_U8 }, +}; + +/** + * __wlan_hdd_cfg80211_acs_dfs_mode() - set ACS DFS mode and channel + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Length of @data + * + * This function parses the incoming NL vendor command data attributes and + * updates the SAP context about channel_hint and DFS mode. + * If channel_hint is set, SAP will choose that channel + * as operating channel. + * + * If DFS mode is enabled, driver will include DFS channels + * in ACS else driver will skip DFS channels. + * + * Return: 0 on success, negative errno on failure + */ +static int +__wlan_hdd_cfg80211_acs_dfs_mode(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX + 1]; + int ret; + struct acs_dfs_policy *acs_policy; + int mode = DFS_MODE_NONE; + int channel_hint = 0; + + ENTER_DEV(wdev->netdev); + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EINVAL; + } + + ret = wlan_hdd_validate_context(hdd_ctx); + if (0 != ret) + return ret; + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX, + data, data_len, + wlan_hdd_set_acs_dfs_config_policy)) { + hdd_err("invalid attr"); + return -EINVAL; + } + + acs_policy = &hdd_ctx->acs_policy; + /* + * SCM sends this attribute to restrict SAP from choosing + * DFS channels from ACS. + */ + if (tb[QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE]) + mode = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE]); + + if (!IS_DFS_MODE_VALID(mode)) { + hdd_err("attr acs dfs mode is not valid"); + return -EINVAL; + } + acs_policy->acs_dfs_mode = mode; + + /* + * SCM sends this attribute to provide an active channel, + * to skip redundant ACS between drivers, and save driver start up time + */ + if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_HINT]) + channel_hint = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_HINT]); + + if (!IS_CHANNEL_VALID(channel_hint)) { + hdd_err("acs channel is not valid"); + return -EINVAL; + } + acs_policy->acs_channel = channel_hint; + + return 0; +} + +/** + * wlan_hdd_cfg80211_acs_dfs_mode() - Wrapper to set ACS DFS mode + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * This function parses the incoming NL vendor command data attributes and + * updates the SAP context about channel_hint and DFS mode. + * + * Return: 0 on success; errno on failure + */ +static int wlan_hdd_cfg80211_acs_dfs_mode(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_acs_dfs_mode(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + /** * __wlan_hdd_cfg80211_sap_configuration_set() - ask driver to restart SAP if * SAP is on unsafe channel. @@ -7816,6 +7935,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_bpf_offload }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_ACS_POLICY, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_acs_dfs_mode + }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 8910c89ff5e5..d7a08553be80 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -419,6 +419,7 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE = 109, /* Tx power scaling in db subcommands */ QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB = 115, + QCA_NL80211_VENDOR_SUBCMD_ACS_POLICY = 116, QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118, QCA_NL80211_VENDOR_SUBCMD_TSF = 119, QCA_NL80211_VENDOR_SUBCMD_WISA = 120, @@ -2754,6 +2755,39 @@ enum qca_vendor_attr_txpower_scale_decr_db { QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_AFTER_LAST - 1 }; +/** + * enum dfs_mode - state of DFS mode + * @DFS_MODE_NONE: DFS mode attribute is none + * @DFS_MODE_ENABLE: DFS mode is enabled + * @DFS_MODE_DISABLE: DFS mode is disabled + * @DFS_MODE_DEPRIORITIZE: Deprioritize DFS channels in scanning + */ +enum dfs_mode { + DFS_MODE_NONE, + DFS_MODE_ENABLE, + DFS_MODE_DISABLE, + DFS_MODE_DEPRIORITIZE +}; + +/** + * enum qca_wlan_vendor_attr_acs_config - Config params for ACS + * @QCA_WLAN_VENDOR_ATTR_ACS_MODE_INVALID: Invalid + * @QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE: Dfs mode for ACS + * QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_HINT: channel_hint for ACS + * QCA_WLAN_VENDOR_ATTR_ACS_DFS_AFTER_LAST: after_last + * QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX: max attribute + */ +enum qca_wlan_vendor_attr_acs_config { + QCA_WLAN_VENDOR_ATTR_ACS_MODE_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_ACS_DFS_MODE, + QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_HINT, + + QCA_WLAN_VENDOR_ATTR_ACS_DFS_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX = + QCA_WLAN_VENDOR_ATTR_ACS_DFS_AFTER_LAST - 1, + +}; + /** * enum qca_wlan_vendor_attr_sap_config - config params for sap configuration * @QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_INVALID: invalid diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 40403ff3d8c8..2d427064e918 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5595,6 +5595,7 @@ QDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter) int ret; enum tQDF_ADAPTER_MODE mode; uint32_t session_id = CSR_SESSION_ID_INVALID; + enum dfs_mode acs_dfs_mode; ENTER(); @@ -5605,6 +5606,11 @@ QDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter) } pAdapter->sessionCtx.ap.sapContext = sapContext; + pAdapter->sessionCtx.ap.sapConfig.channel = + pHddCtx->acs_policy.acs_channel; + acs_dfs_mode = pHddCtx->acs_policy.acs_dfs_mode; + pAdapter->sessionCtx.ap.sapConfig.acs_dfs_mode = + wlan_hdd_get_dfs_mode(acs_dfs_mode); if (pAdapter->device_mode == QDF_P2P_GO_MODE) { mode = QDF_P2P_GO_MODE; @@ -6921,6 +6927,8 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, bool MFPCapable = false; bool MFPRequired = false; uint16_t prev_rsn_length = 0; + enum dfs_mode mode; + ENTER(); if (cds_is_connection_in_progress()) { @@ -6952,6 +6960,10 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, pConfig->enOverLapCh = iniConfig->gEnableOverLapCh; pConfig->dtim_period = pBeacon->dtim_period; + if (pHddCtx->acs_policy.acs_channel) + pConfig->channel = pHddCtx->acs_policy.acs_channel; + mode = pHddCtx->acs_policy.acs_dfs_mode; + pConfig->acs_dfs_mode = wlan_hdd_get_dfs_mode(mode); hdd_info("****pConfig->dtim_period=%d***", pConfig->dtim_period); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d7e2dd46a402..d51d9a44bcdb 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9194,6 +9194,31 @@ int hdd_update_config(hdd_context_t *hdd_ctx) return ret; } +/** + * wlan_hdd_get_dfs_mode() - get ACS DFS mode + * @mode : cfg80211 DFS mode + * + * Return: return SAP ACS DFS mode else return ACS_DFS_MODE_NONE + */ +enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode) +{ + switch (mode) { + case DFS_MODE_ENABLE: + return ACS_DFS_MODE_ENABLE; + break; + case DFS_MODE_DISABLE: + return ACS_DFS_MODE_DISABLE; + break; + case DFS_MODE_DEPRIORITIZE: + return ACS_DFS_MODE_DEPRIORITIZE; + break; + default: + hdd_err("ACS dfs mode is NONE"); + return ACS_DFS_MODE_NONE; + } +} + + /* Register the module init/exit functions */ module_init(hdd_module_init); module_exit(hdd_module_exit); diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 60b97cca6da2..d9f06b8bf7c3 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -508,6 +508,20 @@ enum vendor_ie_access_policy { ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT, }; +/* + * enum sap_acs_dfs_mode- state of DFS mode + * @ACS_DFS_MODE_NONE: DFS mode attribute is not valid + * @ACS_DFS_MODE_ENABLE: DFS mode is enabled + * @ACS_DFS_MODE_DISABLE: DFS mode is disabled + * @ACS_DFS_MODE_DEPRIORITIZE: Deprioritize DFS channels in scanning + */ +enum sap_acs_dfs_mode { + ACS_DFS_MODE_NONE, + ACS_DFS_MODE_ENABLE, + ACS_DFS_MODE_DISABLE, + ACS_DFS_MODE_DEPRIORITIZE +}; + typedef struct sap_Config { tSap_SSIDInfo_t SSIDinfo; eCsrPhyMode SapHw_mode; /* Wireless Mode */ @@ -577,6 +591,7 @@ typedef struct sap_Config { uint8_t ampdu_size; tSirMacRateSet supp_rate_set; tSirMacRateSet extended_rate_set; + enum sap_acs_dfs_mode acs_dfs_mode; } tsap_Config_t; #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 0f488b99bdfa..b4a54dd5adab 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -586,7 +586,8 @@ bool sap_chan_sel_init(tHalHandle halHandle, #endif sme_cfg_get_int(halHandle, WNI_CFG_DFS_MASTER_ENABLED, &dfs_master_cap_enabled); - if (dfs_master_cap_enabled == 0) + if (dfs_master_cap_enabled == 0 || + ACS_DFS_MODE_DISABLE == pSapCtx->dfs_mode) include_dfs_ch = false; /* Fill the channel number in the spectrum in the operating freq band */ @@ -1949,7 +1950,6 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal, if ((ch_type == CHANNEL_STATE_DISABLE) || (ch_type == CHANNEL_STATE_INVALID)) continue; - if ((!dfs_master_cap_enabled) && (CHANNEL_STATE_DFS == ch_type)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, @@ -1957,6 +1957,9 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal, __func__, safe_channels[i].channelNumber); continue; } + if ((sap_ctx->dfs_mode == ACS_DFS_MODE_DISABLE) && + (CHANNEL_STATE_DFS == ch_type)) + continue; if (safe_channels[i].isSafe == true) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index dc52e2fe304c..22608eff91cc 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -270,6 +270,7 @@ typedef struct sSapContext { uint8_t beacon_tx_rate; tSirMacRateSet supp_rate_set; tSirMacRateSet extended_rate_set; + enum sap_acs_dfs_mode dfs_mode; } *ptSapContext; /*---------------------------------------------------------------------------- diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 653871ecacf8..457fcf9ecf47 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -647,6 +647,7 @@ wlansap_set_scan_acs_channel_params(tsap_Config_t *pconfig, /* Channel selection is auto or configured */ psap_ctx->channel = pconfig->channel; + psap_ctx->dfs_mode = pconfig->acs_dfs_mode; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH psap_ctx->cc_switch_mode = pconfig->cc_switch_mode; #endif @@ -810,6 +811,7 @@ QDF_STATUS wlansap_start_bss(void *pCtx, /* pwextCtx */ /* Channel selection is auto or configured */ pSapCtx->channel = pConfig->channel; + pSapCtx->dfs_mode = pConfig->acs_dfs_mode; pSapCtx->ch_params.ch_width = pConfig->ch_params.ch_width; pSapCtx->ch_params.center_freq_seg0 = pConfig->ch_params.center_freq_seg0; -- cgit v1.2.3 From 21ba257842c663c11a89a0c25c444c48febe426c Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Sat, 3 Sep 2016 16:40:10 +0530 Subject: qcacld-3.0: Implement vendor command for STA ROAM POLICY qcacld-2.0 to qcacld-3.0 propagation Add support for vendor command which informs the driver about sta roam policies about dfs mode and unsafe channels. QCA_NL80211_VENDOR_SUBCMD_STA_CONNECT_ROAM_POLICY sends QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE & QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHAN attributes to driver to skip scan channels for station connection or roaming. If QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE is disabled, station will skip dfs channels in scanning. If QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHAN is disabled, station will skip unsafe channel in scanning. Change-Id: I33dfa174d218a2f39fec3ffc240dad793b72b14b CRs-Fixed: 999169 --- core/hdd/src/wlan_hdd_cfg.c | 3 + core/hdd/src/wlan_hdd_cfg80211.c | 141 ++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.h | 22 ++++ core/sme/inc/csr_api.h | 25 ++++ core/sme/inc/csr_internal.h | 1 + core/sme/inc/csr_neighbor_roam.h | 2 + core/sme/inc/sme_api.h | 4 + core/sme/src/common/sme_api.c | 54 +++++++++ core/sme/src/csr/csr_api_roam.c | 254 +++++++++++++++++++++++++++++++++++---- core/sme/src/csr/csr_api_scan.c | 39 ++++++ 10 files changed, 522 insertions(+), 23 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index ec449eea9923..5bb4ad0cae1e 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -7137,6 +7137,9 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) pConfig->edca_bk_aifs; smeConfig->csrConfig.edca_be_aifs = pConfig->edca_be_aifs; + smeConfig->csrConfig.sta_roam_policy_params.dfs_mode = + CSR_STA_ROAM_POLICY_DFS_ENABLED; + smeConfig->csrConfig.sta_roam_policy_params.skip_unsafe_channels = 0; status = sme_update_config(pHddCtx->hHal, smeConfig); if (!QDF_IS_STATUS_SUCCESS(status)) { diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d45d371a37bd..2e96af93d74d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -75,6 +75,8 @@ #include #include "wlan_logging_sock_svc.h" #include "sap_api.h" +#include "csr_api.h" + #ifdef FEATURE_WLAN_EXTSCAN @@ -6909,6 +6911,137 @@ static int wlan_hdd_cfg80211_acs_dfs_mode(struct wiphy *wiphy, return ret; } +/** + * wlan_hdd_get_sta_roam_dfs_mode() - get sta roam dfs mode policy + * @mode : cfg80211 dfs mode + * + * Return: return csr sta roam dfs mode else return NONE + */ +static enum sta_roam_policy_dfs_mode wlan_hdd_get_sta_roam_dfs_mode( + enum dfs_mode mode) +{ + switch (mode) { + case DFS_MODE_ENABLE: + return CSR_STA_ROAM_POLICY_DFS_ENABLED; + break; + case DFS_MODE_DISABLE: + return CSR_STA_ROAM_POLICY_DFS_DISABLED; + break; + case DFS_MODE_DEPRIORITIZE: + return CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE; + break; + default: + hdd_err("STA Roam policy dfs mode is NONE"); + return CSR_STA_ROAM_POLICY_NONE; + } +} + +static const struct nla_policy +wlan_hdd_set_sta_roam_config_policy[ +QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX + 1] = { + [QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL] = {.type = NLA_U8 }, +}; + +/** + * __wlan_hdd_cfg80211_sta_roam_policy() - Set params to restrict scan channels + * for station connection or roaming. + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Length of @data + * + * __wlan_hdd_cfg80211_sta_roam_policy will decide if DFS channels or unsafe + * channels needs to be skipped in scanning or not. + * If dfs_mode is disabled, driver will not scan DFS channels. + * If skip_unsafe_channels is set, driver will skip unsafe channels + * in Scanning. + * + * Return: 0 on success, negative errno on failure + */ +static int +__wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + struct net_device *dev = wdev->netdev; + hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb[ + QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX + 1]; + int ret; + enum sta_roam_policy_dfs_mode sta_roam_dfs_mode; + enum dfs_mode mode = DFS_MODE_NONE; + bool skip_unsafe_channels = false; + QDF_STATUS status; + + ENTER_DEV(dev); + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EINVAL; + } + + ret = wlan_hdd_validate_context(hdd_ctx); + if (0 != ret) + return ret; + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX, + data, data_len, + wlan_hdd_set_sta_roam_config_policy)) { + hdd_err("invalid attr"); + return -EINVAL; + } + if (tb[QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE]) + mode = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE]); + if (!IS_DFS_MODE_VALID(mode)) { + hdd_err("attr sta roam dfs mode policy is not valid"); + return -EINVAL; + } + + sta_roam_dfs_mode = wlan_hdd_get_sta_roam_dfs_mode(mode); + + if (tb[QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL]) + skip_unsafe_channels = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL]); + + status = sme_update_sta_roam_policy(hdd_ctx->hHal, sta_roam_dfs_mode, + skip_unsafe_channels, adapter->sessionId); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("sme_update_sta_roam_policy (err=%d)", status); + return -EINVAL; + } + return 0; +} + +/** + * wlan_hdd_cfg80211_sta_roam_policy() - Wrapper to restrict scan channels, + * connection and roaming for station. + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * __wlan_hdd_cfg80211_sta_roam_policy will decide if DFS channels or unsafe + * channels needs to be skipped in scanning or not. + * If dfs_mode is disabled, driver will not scan DFS channels. + * If skip_unsafe_channels is set, driver will skip unsafe channels + * in Scanning. + * Return: 0 on success; errno on failure + */ +static int wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_sta_roam_policy(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + /** * __wlan_hdd_cfg80211_sap_configuration_set() - ask driver to restart SAP if * SAP is on unsafe channel. @@ -7943,6 +8076,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_acs_dfs_mode }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_STA_CONNECT_ROAM_POLICY, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_sta_roam_policy + }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index d7a08553be80..2a930e3c912b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -420,6 +420,7 @@ enum qca_nl80211_vendor_subcmds { /* Tx power scaling in db subcommands */ QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB = 115, QCA_NL80211_VENDOR_SUBCMD_ACS_POLICY = 116, + QCA_NL80211_VENDOR_SUBCMD_STA_CONNECT_ROAM_POLICY = 117, QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118, QCA_NL80211_VENDOR_SUBCMD_TSF = 119, QCA_NL80211_VENDOR_SUBCMD_WISA = 120, @@ -2788,6 +2789,27 @@ enum qca_wlan_vendor_attr_acs_config { }; +/** + * enum qca_wlan_vendor_attr_sta_connect_roam_policy_config - + * config params for sta roam policy + * @QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_INVALID: Invalid + * @QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE: If sta should skip Dfs channels + * @QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL: + * If sta should skip unsafe channels or not in scanning + * @QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_LAST: + * @QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX: max attribute + */ +enum qca_wlan_vendor_attr_sta_connect_roam_policy_config { + QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_STA_DFS_MODE, + QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL, + + QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX = + QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_AFTER_LAST - 1, +}; + + /** * enum qca_wlan_vendor_attr_sap_config - config params for sap configuration * @QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_INVALID: invalid diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index c68f20546ab7..b5752db35700 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1060,6 +1060,30 @@ typedef struct tagCsrNeighborRoamConfigParams { int32_t nhi_rssi_scan_rssi_ub; } tCsrNeighborRoamConfigParams; +/** + * enum sta_roam_policy_dfs_mode - state of DFS mode for STA ROME policy + * @CSR_STA_ROAM_POLICY_NONE: DFS mode attribute is not valid + * @CSR_STA_ROAM_POLICY_DFS_ENABLED: DFS mode is enabled + * @CSR_STA_ROAM_POLICY_DFS_DISABLED: DFS mode is disabled + * @CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE: Deprioritize DFS channels in scanning + */ +enum sta_roam_policy_dfs_mode { + CSR_STA_ROAM_POLICY_NONE, + CSR_STA_ROAM_POLICY_DFS_ENABLED, + CSR_STA_ROAM_POLICY_DFS_DISABLED, + CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE +}; + +/** + * struct csr_sta_roam_policy_params - sta roam policy params for station + * @dfs_mode: tell is DFS channels needs to be skipped while scanning + * @skip_unsafe_channels: tells if unsafe channels needs to be skip in scanning + */ +struct csr_sta_roam_policy_params { + enum sta_roam_policy_dfs_mode dfs_mode; + bool skip_unsafe_channels; +}; + typedef struct tagCsrConfigParam { uint32_t FragmentationThreshold; /* keep this uint32_t. This gets converted to ePhyChannelBondState */ @@ -1280,6 +1304,7 @@ typedef struct tagCsrConfigParam { bool enable_fatal_event; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; + struct csr_sta_roam_policy_params sta_roam_policy_params; } tCsrConfigParam; /* Tush */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 909d7802c3eb..c625867472e4 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -666,6 +666,7 @@ typedef struct tagCsrConfig { bool enable_fatal_event; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; + struct csr_sta_roam_policy_params sta_roam_policy; } tCsrConfig; typedef struct tagCsrChannelPowerInfo { diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index 582d0572e13b..59564a17c86d 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -322,6 +322,8 @@ void csr_roam_reset_roam_params(tpAniSirGlobal mac_ptr); #define REASON_ROAM_SCAN_HI_RSSI_DELAY_CHANGED 32 #define REASON_ROAM_SCAN_HI_RSSI_UB_CHANGED 33 #define REASON_CONNECT_IES_CHANGED 34 +#define REASON_ROAM_SCAN_STA_ROAM_POLICY_CHANGED 35 + #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) QDF_STATUS csr_roam_offload_scan(tpAniSirGlobal pMac, uint8_t sessionId, diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 7b915abd7f8e..5abc5fdf59db 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1253,4 +1253,8 @@ QDF_STATUS sme_update_access_policy_vendor_ie(tHalHandle hal, uint8_t session_id, uint8_t *vendor_ie, int access_policy); +QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal, + enum sta_roam_policy_dfs_mode dfs_mode, + bool skip_unsafe_channels, + uint8_t session_id); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 4c087976da68..5ea16ecb662d 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -60,6 +60,7 @@ #include "wma.h" #include "sch_api.h" #include "sme_nan_datapath.h" +#include "csr_api.h" extern tSirRetStatus u_mac_post_ctrl_msg(void *pSirGlobal, tSirMbMsg *pMb); @@ -16459,3 +16460,56 @@ void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode, tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); csr_get_vdev_type_nss(mac_ctx, dev_mode, nss_2g, nss_5g); } + +/** + * sme_update_sta_roam_policy() - update sta roam policy for + * unsafe and DFS channels. + * @hal_handle: hal handle for getting global mac struct + * @dfs_mode: dfs mode which tell if dfs channel needs to be + * skipped or not + * @skip_unsafe_channels: Param to tell if driver needs to + * skip unsafe channels or not. + * @param session_id: sme_session_id + * + * sme_update_sta_roam_policy update sta rome policies to csr + * this function will call csrUpdateChannelList as well + * to include/exclude DFS channels and unsafe channels. + * + * Return: eHAL_STATUS_SUCCESS or non-zero on failure. + */ +QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal_handle, + enum sta_roam_policy_dfs_mode dfs_mode, + bool skip_unsafe_channels, + uint8_t session_id) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle); + QDF_STATUS status = QDF_STATUS_SUCCESS; + tSmeConfigParams sme_config; + + if (!mac_ctx) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL, + "%s: mac_ctx is null", __func__); + return QDF_STATUS_E_FAILURE; + } + qdf_mem_zero(&sme_config, sizeof(sme_config)); + sme_get_config_param(hal_handle, &sme_config); + + sme_config.csrConfig.sta_roam_policy_params.dfs_mode = + dfs_mode; + sme_config.csrConfig.sta_roam_policy_params.skip_unsafe_channels = + skip_unsafe_channels; + + sme_update_config(hal_handle, &sme_config); + + status = csr_update_channel_list(mac_ctx); + if (QDF_STATUS_SUCCESS != status) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("failed to update the supported channel list")); + } + if (mac_ctx->roam.configParam.isRoamOffloadScanEnabled) + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_SCAN_STA_ROAM_POLICY_CHANGED); + + return status; +} diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 9b9207374642..b7b068de0337 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -56,6 +56,7 @@ #include "wma.h" #include "cds_concurrency.h" #include "sme_nan_datapath.h" +#include "pld_common.h" #define MAX_PWR_FCC_CHAN_12 8 #define MAX_PWR_FCC_CHAN_13 2 @@ -658,6 +659,21 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac) cds_msg_t msg; uint8_t i, j, social_channel[MAX_SOCIAL_CHANNELS] = { 1, 6, 11 }; uint8_t channel_state; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + uint8_t channel; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); if (CSR_IS_5G_BAND_ONLY(pMac)) { for (i = 0; i < MAX_SOCIAL_CHANNELS; i++) { @@ -683,17 +699,45 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac) /* Scan is not performed on DSRC channels*/ if (pScan->base_channels.channelList[i] >= CDS_MIN_11P_CHANNEL) continue; + channel = pScan->base_channels.channelList[i]; channel_state = cds_get_channel_state( pScan->base_channels.channelList[i]); if ((CHANNEL_STATE_ENABLE == channel_state) || pMac->scan.fEnableDFSChnlScan) { + if ((pMac->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED) && + (channel_state == CHANNEL_STATE_DFS)) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("skip dfs channel %d"), + channel); + continue; + } + if (pMac->roam.configParam.sta_roam_policy. + skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == channel) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + channel); + continue; + } + } pChanList->chanParam[num_channel].chanId = pScan->base_channels.channelList[i]; pChanList->chanParam[num_channel].pwr = csr_find_channel_pwr(pScan->defaultPowerTable, - pChanList->chanParam[num_channel].chanId); + pChanList->chanParam[num_channel].chanId); if (pScan->fcc_constraint) { if (12 == pChanList->chanParam[num_channel].chanId) { @@ -1756,18 +1800,56 @@ csr_fetch_ch_lst_from_received_list(tpAniSirGlobal mac_ctx, uint8_t i = 0; uint8_t num_channels = 0; uint8_t *ch_lst = NULL; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return; + } + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); if (curr_ch_lst_info->numOfChannels == 0) return; ch_lst = curr_ch_lst_info->ChannelList; for (i = 0; i < curr_ch_lst_info->numOfChannels; i++) { - if (((mac_ctx->roam.configParam.allowDFSChannelRoam - != CSR_ROAMING_DFS_CHANNEL_DISABLED) || - (!CDS_IS_DFS_CH(*ch_lst))) && *ch_lst) { - req_buf->ConnectedNetwork.ChannelCache[num_channels++] = - *ch_lst; + if ((!mac_ctx->roam.configParam.allowDFSChannelRoam || + (mac_ctx->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED)) && + (CDS_IS_DFS_CH(*ch_lst))) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("ignoring dfs channel %d"), *ch_lst); + ch_lst++; + continue; } + + if (mac_ctx->roam.configParam.sta_roam_policy. + skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == *ch_lst) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + *ch_lst); + ch_lst++; + continue; + } + } + req_buf->ConnectedNetwork.ChannelCache[num_channels++] = + *ch_lst; ch_lst++; } req_buf->ConnectedNetwork.ChannelCount = num_channels; @@ -2430,6 +2512,10 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.enable_fatal_event = pParam->enable_fatal_event; + pMac->roam.configParam.sta_roam_policy.dfs_mode = + pParam->sta_roam_policy_params.dfs_mode; + pMac->roam.configParam.sta_roam_policy.skip_unsafe_channels = + pParam->sta_roam_policy_params.skip_unsafe_channels; } return status; @@ -2635,6 +2721,10 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->edca_be_aifs = pMac->roam.configParam.edca_be_aifs; pParam->enable_fatal_event = pMac->roam.configParam.enable_fatal_event; + pParam->sta_roam_policy_params.dfs_mode = + pMac->roam.configParam.sta_roam_policy.dfs_mode; + pParam->sta_roam_policy_params.skip_unsafe_channels = + pMac->roam.configParam.sta_roam_policy.skip_unsafe_channels; return QDF_STATUS_SUCCESS; } @@ -16802,6 +16892,21 @@ csr_fetch_ch_lst_from_ini(tpAniSirGlobal mac_ctx, uint8_t i = 0; uint8_t num_channels = 0; uint8_t *ch_lst = roam_info->cfgParams.channelInfo.ChannelList; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); + /* * The INI channels need to be filtered with respect to the current band * that is supported. @@ -16819,15 +16924,39 @@ csr_fetch_ch_lst_from_ini(tpAniSirGlobal mac_ctx, if (!csr_check_band_channel_match(band, *ch_lst)) continue; /* Allow DFS channels only if the DFS roaming is enabled */ - if (((mac_ctx->roam.configParam.allowDFSChannelRoam != - CSR_ROAMING_DFS_CHANNEL_DISABLED) - || (!CDS_IS_DFS_CH(*ch_lst))) - && csr_roam_is_channel_valid(mac_ctx, *ch_lst) - && *ch_lst && (num_channels < SIR_ROAM_MAX_CHANNELS)) { - req_buf->ConnectedNetwork.ChannelCache[num_channels++] = - *ch_lst; + if ((!mac_ctx->roam.configParam.allowDFSChannelRoam || + (mac_ctx->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED)) && + (CDS_IS_DFS_CH(*ch_lst))) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("ignoring dfs channel %d"), *ch_lst); + ch_lst++; + continue; + } + + if (mac_ctx->roam.configParam.sta_roam_policy. + skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == *ch_lst) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + *ch_lst); + ch_lst++; + continue; + } } + req_buf->ConnectedNetwork.ChannelCache[num_channels++] = + *ch_lst; ch_lst++; + } req_buf->ConnectedNetwork.ChannelCount = num_channels; req_buf->ChannelCacheType = CHANNEL_LIST_STATIC; @@ -16857,18 +16986,56 @@ csr_fetch_ch_lst_from_occupied_lst(tpAniSirGlobal mac_ctx, uint8_t num_channels = 0; uint8_t *ch_lst = mac_ctx->scan.occupiedChannels[session_id].channelList; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return; + } + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, "Num of channels before filtering=%d", mac_ctx->scan.occupiedChannels[session_id].numChannels); + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); for (i = 0; i < mac_ctx->scan.occupiedChannels[session_id].numChannels; i++) { - if (((mac_ctx->roam.configParam.allowDFSChannelRoam != - CSR_ROAMING_DFS_CHANNEL_DISABLED) - || (!CDS_IS_DFS_CH(*ch_lst))) - && *ch_lst && (num_channels < SIR_ROAM_MAX_CHANNELS)) { - req_buf->ConnectedNetwork.ChannelCache[num_channels++] = - *ch_lst; + if ((!mac_ctx->roam.configParam.allowDFSChannelRoam || + (mac_ctx->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED)) && + (CDS_IS_DFS_CH(*ch_lst))) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("ignoring dfs channel %d"), *ch_lst); + ch_lst++; + continue; } + + if (mac_ctx->roam.configParam.sta_roam_policy. + skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == *ch_lst) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + *ch_lst); + ch_lst++; + continue; + } + } + req_buf->ConnectedNetwork.ChannelCache[num_channels++] = + *ch_lst; if (*ch_lst) QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, "DFSRoam=%d, ChnlState=%d, Chnl=%d, num_ch=%d", @@ -16912,6 +17079,20 @@ csr_fetch_valid_ch_lst(tpAniSirGlobal mac_ctx, uint32_t host_channels = 0; uint8_t *ch_lst = NULL; uint8_t i = 0, num_channels = 0; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); host_channels = sizeof(mac_ctx->roam.validChannelList); status = csr_get_cfg_valid_channels(mac_ctx, @@ -16925,11 +17106,38 @@ csr_fetch_valid_ch_lst(tpAniSirGlobal mac_ctx, ch_lst = mac_ctx->roam.validChannelList; mac_ctx->roam.numValidChannels = host_channels; for (i = 0; i < mac_ctx->roam.numValidChannels; i++) { - if (((mac_ctx->roam.configParam.allowDFSChannelRoam - != CSR_ROAMING_DFS_CHANNEL_DISABLED) || - (!CDS_IS_DFS_CH(*ch_lst))) && *ch_lst) { - req_buf->ValidChannelList[num_channels++] = *ch_lst; + ch_lst++; + if ((!mac_ctx->roam.configParam.allowDFSChannelRoam || + (mac_ctx->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED)) && + (CDS_IS_DFS_CH(*ch_lst))) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("ignoring dfs channel %d"), *ch_lst); + ch_lst++; + continue; + } + + if (mac_ctx->roam.configParam. + sta_roam_policy.skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == *ch_lst) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + *ch_lst); + ch_lst++; + continue; + } } + req_buf->ConnectedNetwork.ChannelCache[num_channels++] = + *ch_lst; ch_lst++; } req_buf->ValidChannelCount = num_channels; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index b33ccace5a31..994c2bca2b8b 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -53,6 +53,7 @@ #include "cds_concurrency.h" #include "wlan_hdd_main.h" +#include "pld_common.h" #define MIN_CHN_TIME_TO_FIND_GO 100 #define MAX_CHN_TIME_TO_FIND_GO 100 @@ -5363,6 +5364,23 @@ static void csr_scan_copy_request_valid_channels_only(tpAniSirGlobal mac_ctx, { uint32_t index = 0; uint32_t new_index = 0; + uint16_t unsafe_chan[NUM_CHANNELS]; + uint16_t unsafe_chan_cnt = 0; + uint16_t cnt = 0; + bool is_unsafe_chan; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return; + } + pld_get_wlan_unsafe_channel(qdf_ctx->dev, unsafe_chan, + &unsafe_chan_cnt, + sizeof(unsafe_chan)); + + if (mac_ctx->roam.configParam.sta_roam_policy.dfs_mode == + CSR_STA_ROAM_POLICY_DFS_DISABLED) + skip_dfs_chnl = true; for (index = 0; index < src_req->ChannelInfo.numOfChannels; index++) { /* Allow scan on valid channels only. @@ -5395,6 +5413,27 @@ static void csr_scan_copy_request_valid_channels_only(tpAniSirGlobal mac_ctx, [index]); continue; } + if (mac_ctx->roam.configParam. + sta_roam_policy.skip_unsafe_channels && + unsafe_chan_cnt) { + is_unsafe_chan = false; + for (cnt = 0; cnt < unsafe_chan_cnt; cnt++) { + if (unsafe_chan[cnt] == + src_req->ChannelInfo. + ChannelList[index]) { + is_unsafe_chan = true; + break; + } + } + if (is_unsafe_chan) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO, + FL("ignoring unsafe channel %d"), + src_req->ChannelInfo. + ChannelList[index]); + continue; + } + } dst_req->ChannelInfo.ChannelList[new_index] = src_req->ChannelInfo.ChannelList[index]; -- cgit v1.2.3 From 467dde4b12aafc11fd57c1d400257461236eb19e Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Thu, 8 Sep 2016 18:44:22 +0530 Subject: qcacld-3.0: Implement vendor command to avoid freq in SAP qcacld-2.0 to qcacld-3.0 propagation Add support for vendor command which ask the driver to restart the SAP if SAP is on unsafe channel. QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY is used to send driver to restart SAP device if SAP is on any unsafe channels. Upon receiving this command, driver will restart the SAP device if SAP is operating on any of one the unsafe channels. Change-Id: I187a6e0c9f3eaa96c740e50c332a7aba5796dc74 CRs-Fixed: 998048 --- core/hdd/inc/wlan_hdd_main.h | 3 + core/hdd/src/wlan_hdd_cfg80211.c | 99 +++++++++++++++++++++++++++- core/hdd/src/wlan_hdd_main.c | 137 +++++++++++++++++++++------------------ 3 files changed, 174 insertions(+), 65 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 3c3954f69764..b91fa4485477 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1860,4 +1860,7 @@ static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg, void hdd_wlan_update_target_info(hdd_context_t *hdd_ctx, void *context); enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode); + +void hdd_ch_avoid_cb(void *hdd_context, void *indi_param); +void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctx); #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2e96af93d74d..568c7b7e30be 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -76,7 +76,7 @@ #include "wlan_logging_sock_svc.h" #include "sap_api.h" #include "csr_api.h" - +#include "pld_common.h" #ifdef FEATURE_WLAN_EXTSCAN @@ -7042,6 +7042,93 @@ static int wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy, return ret; } +#ifdef FEATURE_WLAN_CH_AVOID +/** + * __wlan_hdd_cfg80211_avoid_freq() - ask driver to restart SAP if SAP + * is on unsafe channel. + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * wlan_hdd_cfg80211_avoid_freq do restart the sap if sap is already + * on any of unsafe channels. + * If sap is on any of unsafe channel, hdd_unsafe_channel_restart_sap + * will send WLAN_SVC_LTE_COEX_IND indication to userspace to restart. + * + * Return: 0 on success; errno on failure + */ +static int +__wlan_hdd_cfg80211_avoid_freq(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + int ret; + uint16_t unsafe_channel_count; + int unsafe_channel_index; + qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + ENTER_DEV(wdev->netdev); + + if (!qdf_ctx) { + cds_err("qdf_ctx is NULL"); + return -EINVAL; + } + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EINVAL; + } + + ret = wlan_hdd_validate_context(hdd_ctx); + if (0 != ret) + return ret; + pld_get_wlan_unsafe_channel(qdf_ctx->dev, hdd_ctx->unsafe_channel_list, + &(hdd_ctx->unsafe_channel_count), + sizeof(hdd_ctx->unsafe_channel_list)); + + unsafe_channel_count = QDF_MIN((uint16_t)hdd_ctx->unsafe_channel_count, + (uint16_t)NUM_CHANNELS); + for (unsafe_channel_index = 0; + unsafe_channel_index < unsafe_channel_count; + unsafe_channel_index++) { + hdd_info("Channel %d is not safe", + hdd_ctx->unsafe_channel_list[unsafe_channel_index]); + } + hdd_unsafe_channel_restart_sap(hdd_ctx); + return 0; +} + +/** + * wlan_hdd_cfg80211_avoid_freq() - ask driver to restart SAP if SAP + * is on unsafe channel. + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * wlan_hdd_cfg80211_avoid_freq do restart the sap if sap is already + * on any of unsafe channels. + * If sap is on any of unsafe channel, hdd_unsafe_channel_restart_sap + * will send WLAN_SVC_LTE_COEX_IND indication to userspace to restart. + * + * Return: 0 on success; errno on failure + */ +static int wlan_hdd_cfg80211_avoid_freq(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_avoid_freq(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + +#endif /** * __wlan_hdd_cfg80211_sap_configuration_set() - ask driver to restart SAP if * SAP is on unsafe channel. @@ -8084,6 +8171,16 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_sta_roam_policy }, +#ifdef FEATURE_WLAN_CH_AVOID + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_avoid_freq + }, +#endif { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d51d9a44bcdb..9e8ea73bb8b3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5711,7 +5711,78 @@ void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) cds_change_sap_channel_with_csa(adapter, hdd_ap_ctx); } +/** + * hdd_unsafe_channel_restart_sap() - restart sap if sap is on unsafe channel + * @hdd_ctx: hdd context pointer + * + * hdd_unsafe_channel_restart_sap check all unsafe channel list + * and if ACS is enabled, driver will ask userspace to restart the + * sap. User space on LTE coex indication restart driver. + * + * Return - none + */ +void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctxt) +{ + QDF_STATUS status; + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + hdd_adapter_t *adapter_temp; + uint32_t i; + bool found = false; + uint8_t restart_chan; + + status = hdd_get_front_adapter(hdd_ctxt, &adapter_node); + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + adapter_temp = adapter_node->pAdapter; + + if (!adapter_temp) { + hdd_err("adapter is NULL, moving to next one"); + goto next_adapater; + } + + if (!((adapter_temp->device_mode == QDF_SAP_MODE) && + (adapter_temp->sessionCtx.ap.sapConfig.acs_cfg.acs_mode))) { + hdd_info("skip device mode:%d acs:%d", + adapter_temp->device_mode, + adapter_temp->sessionCtx.ap.sapConfig. + acs_cfg.acs_mode); + goto next_adapater; + } + + found = false; + for (i = 0; i < hdd_ctxt->unsafe_channel_count; i++) { + if (cds_chan_to_freq( + adapter_temp->sessionCtx.ap.operatingChannel) == + hdd_ctxt->unsafe_channel_list[i]) { + found = true; + hdd_info("operating ch:%d is unsafe", + adapter_temp->sessionCtx.ap.operatingChannel); + break; + } + } + + if (!found) { + hdd_info("ch:%d is safe. no need to change channel", + adapter_temp->sessionCtx.ap.operatingChannel); + goto next_adapater; + } + restart_chan = + hdd_get_safe_channel_from_pcl_and_acs_range( + adapter_temp); + if (!restart_chan) { + hdd_alert("fail to restart SAP"); + } else { + hdd_info("sending coex indication"); + wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index, + WLAN_SVC_LTE_COEX_IND, NULL, 0); + hdd_restart_sap(adapter_temp, restart_chan); + } + +next_adapater: + status = hdd_get_next_adapter(hdd_ctxt, adapter_node, &next); + adapter_node = next; + } +} /** * hdd_ch_avoid_cb() - Avoid notified channels from FW handler * @adapter: HDD adapter pointer @@ -5723,7 +5794,7 @@ void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) * * Return: None */ -static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) +void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) { hdd_context_t *hdd_ctxt; tSirChAvoidIndType *ch_avoid_indi; @@ -5735,11 +5806,6 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) v_CONTEXT_t cds_context; tHddAvoidFreqList hdd_avoid_freq_list; uint32_t i; - QDF_STATUS status; - hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; - hdd_adapter_t *adapter_temp; - uint8_t restart_chan; - bool found = false; /* Basic sanity */ if (!hdd_context || !indi_param) { @@ -5866,64 +5932,7 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) hdd_info("no unsafe channels - not restarting SAP"); return; } - - /* No channel change is done for fixed channel SAP. - * Loop through all ACS SAP interfaces and change the channels for - * the ones operating on unsafe channels. - */ - status = hdd_get_front_adapter(hdd_ctxt, &adapter_node); - while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { - adapter_temp = adapter_node->pAdapter; - - if (!adapter_temp) { - hdd_err("adapter is NULL, moving to next one"); - goto next_adapater; - } - - if (!((adapter_temp->device_mode == QDF_SAP_MODE) && - (adapter_temp->sessionCtx.ap.sapConfig.acs_cfg.acs_mode))) { - hdd_info("skip device mode:%d acs:%d", - adapter_temp->device_mode, - adapter_temp->sessionCtx.ap.sapConfig. - acs_cfg.acs_mode); - goto next_adapater; - } - - found = false; - for (i = 0; i < hdd_ctxt->unsafe_channel_count; i++) { - if (cds_chan_to_freq( - adapter_temp->sessionCtx.ap.operatingChannel) == - hdd_ctxt->unsafe_channel_list[i]) { - found = true; - hdd_info("operating ch:%d is unsafe", - adapter_temp->sessionCtx.ap.operatingChannel); - break; - } - } - - if (!found) { - hdd_info("ch:%d is safe. no need to change channel", - adapter_temp->sessionCtx.ap.operatingChannel); - goto next_adapater; - } - - restart_chan = - hdd_get_safe_channel_from_pcl_and_acs_range( - adapter_temp); - if (!restart_chan) { - hdd_alert("fail to restart SAP"); - } else { - hdd_info("sending coex indication"); - wlan_hdd_send_svc_nlink_msg - (hdd_ctxt->radio_index, - WLAN_SVC_LTE_COEX_IND, NULL, 0); - hdd_restart_sap(adapter_temp, restart_chan); - } - -next_adapater: - status = hdd_get_next_adapter(hdd_ctxt, adapter_node, &next); - adapter_node = next; - } + hdd_unsafe_channel_restart_sap(hdd_ctxt); return; } -- cgit v1.2.3 From 8fba6693aaef3d86f0016ef9ad491a590597b955 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Mon, 26 Sep 2016 16:34:29 -0700 Subject: qcacld-3.0: Enable gExtScanEnable by default INI support to enable/disable extscan is added recently and by default it is disabled. Make it enable by default. Change-Id: I4cd10915aa0d99db233bf8813e15abfc49539594 CRs-Fixed: 1071385 --- core/hdd/inc/wlan_hdd_cfg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index ba1e3d5f56b6..6dde98b0af33 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2881,14 +2881,14 @@ enum dot11p_mode { #ifdef FEATURE_WLAN_EXTSCAN /* - * This ini is added to control the enabling of extscan feature outside of code - * To enable , gExtScanEnable=1 need to be declared in ini file. - * Otherwise, Extscan feature will remain disabled. + * This ini is added to control the enabling of extscan feature outside of code. + * By default extscan feature will be enabled, to disable extscan add + * gExtScanEnable=0 in ini file. */ #define CFG_EXTSCAN_ALLOWED_NAME "gExtScanEnable" #define CFG_EXTSCAN_ALLOWED_MIN (0) #define CFG_EXTSCAN_ALLOWED_MAX (1) -#define CFG_EXTSCAN_ALLOWED_DEF (0) +#define CFG_EXTSCAN_ALLOWED_DEF (1) #define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_NAME "gExtScanPassiveMaxChannelTime" #define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_MIN (0) -- cgit v1.2.3 From 2cafbf03843fd28e09d3701fe705b297c4f9390a Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 29 Sep 2016 19:22:49 -0700 Subject: Release 5.1.0.28K Release 5.1.0.28K Change-Id: Ida143b9dae3ed0bd12c29626899df302fd4668f4 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index eb3b1c4e879d..297fff3d3527 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28J" +#define QWLAN_VERSIONSTR "5.1.0.28K" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 7d51b1d1fd0e1a9ca02da691b77329f731cc1203 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Wed, 21 Sep 2016 19:11:20 +0530 Subject: qcacld-3.0: Reject same con_mode change request from the user In the present implementation driver directly switches to con_mode requested by user eventhough it is in the same mode as requested by the user. Also, con_mode_handler relies on the station adapter to switch between modes, if current con mode is other than STA mode then handler returns failure, without processing con mode change. In con mode handler add check if user trigger con mode is same as the current con mode, as driver is already in same mode and get valid adapter context based on con mode. Change-Id: If7ee95f7ce5c2e6f85c1245bdf4cdfa3d0f16d53 CRs-Fixed: 1069408 --- core/hdd/src/wlan_hdd_main.c | 78 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9e8ea73bb8b3..62bdc8a946ef 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8968,15 +8968,59 @@ static int fwpath_changed_handler(const char *kmessage, struct kernel_param *kp) return param_set_copystring(kmessage, kp); } +/** + * is_con_mode_valid() check con mode is valid or not + * @mode: global con mode + * + * Return: TRUE on success FALSE on failure + */ +static bool is_con_mode_valid(enum tQDF_GLOBAL_CON_MODE mode) +{ + switch (mode) { + case QDF_GLOBAL_MONITOR_MODE: + case QDF_GLOBAL_FTM_MODE: + case QDF_GLOBAL_EPPING_MODE: + return true; + default: + return false; + } +} + +/** + * hdd_get_adpter_mode() - returns adapter mode based on global con mode + * @mode: global con mode + * + * Return: adapter mode + */ +static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( + enum tQDF_GLOBAL_CON_MODE mode) +{ + + switch (mode) { + case QDF_GLOBAL_MISSION_MODE: + return QDF_STA_MODE; + case QDF_GLOBAL_MONITOR_MODE: + return QDF_MONITOR_MODE; + case QDF_GLOBAL_FTM_MODE: + return QDF_MONITOR_MODE; + case QDF_GLOBAL_EPPING_MODE: + return QDF_EPPING_MODE; + case QDF_GLOBAL_QVIT_MODE: + return QDF_QVIT_MODE; + default: + return QDF_MAX_NO_OF_MODE; + } +} /** * con_mode_handler() - Handles module param con_mode change + * @kmessage: con mode name on which driver to be bring up + * @kp: The associated kernel parameter * - * Handler function for module param con_mode when it is changed by userspace - * Dynamically linked - do nothing - * Statically linked - exit and init driver, as in rmmod and insmod + * This function is invoked when user updates con mode using sys entry, + * to initialize and bring-up driver in that specific mode. * - * Return - + * Return - 0 on success and failure code on failure */ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) { @@ -8984,6 +9028,8 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) hdd_context_t *hdd_ctx; hdd_adapter_t *adapter; qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + enum tQDF_GLOBAL_CON_MODE curr_mode; + enum tQDF_ADAPTER_MODE adapter_mode; QDF_STATUS status; hdd_info("con_mode handler: %s", kmessage); @@ -9000,15 +9046,32 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) return -EINVAL; } + if (!(is_con_mode_valid(con_mode))) { + hdd_err("invlaid con_mode %d", con_mode); + return -EINVAL; + } + curr_mode = hdd_get_conparam(); + if (curr_mode == con_mode) { + hdd_err("curr mode: %d is same as user triggered mode %d", + curr_mode, con_mode); + return 0; + } + + adapter_mode = hdd_get_adpter_mode(curr_mode); + if (adapter_mode == QDF_MAX_NO_OF_MODE) { + hdd_err("invalid adapter"); + return -EINVAL; + } + ret = hdd_wlan_stop_modules(hdd_ctx, false); if (ret) { hdd_err("Stop wlan modules failed"); return -EINVAL; } - adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE); + adapter = hdd_get_adapter(hdd_ctx, adapter_mode); if (!adapter) { - hdd_err("Failed to get station adapter"); + hdd_err("Failed to get adapter, mode: %d", curr_mode); return -EINVAL; } @@ -9035,9 +9098,6 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) } hdd_info("epping mode successfully enabled"); return 0; - } else { - hdd_info("Con mode not supported"); - return -EINVAL; } ret = hdd_wlan_start_modules(hdd_ctx, adapter, false); -- cgit v1.2.3 From cfd09e495fa2720eeafdb36f1e4cd23049aa2f95 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 29 Sep 2016 20:13:06 -0700 Subject: Release 5.1.0.28L Release 5.1.0.28L Change-Id: I28a3bd264ff928bffac46e2e7a7e2dbb95104212 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 297fff3d3527..1d247c4e69c1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28K" +#define QWLAN_VERSIONSTR "5.1.0.28L" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From a410c5a9c2bdb087766d80215de607cdc0b35412 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Mon, 19 Sep 2016 14:22:33 -0700 Subject: qcacld-3.0: Send self HT/VHT caps per band IE at hdd_init_station_mode In function lim_send_ht_vht_ie per band HE/VHT IE being sent to firmware are being populated as per hardware mode (DBS/Non-DBS). Change that to absolute self HT/VHT capability. Change-Id: I3e74ffb89fcdc2903ecaa3c1bb3e4aeffd4f8f35 CRs-Fixed: 1069032 --- core/hdd/src/wlan_hdd_main.c | 1 + core/mac/inc/sir_api.h | 14 ++ core/mac/inc/wni_api.h | 1 + core/mac/src/pe/lim/lim_process_message_queue.c | 1 + core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 5 - core/mac/src/pe/lim/lim_process_sme_req_messages.c | 33 ++++ core/mac/src/pe/lim/lim_send_management_frames.c | 4 + core/mac/src/pe/lim/lim_utils.c | 177 +++++++-------------- core/mac/src/pe/lim/lim_utils.h | 13 +- core/mac/src/sys/legacy/src/utils/src/parser_api.c | 8 +- core/sme/inc/sme_api.h | 2 + core/sme/src/common/sme_api.c | 33 +++- 12 files changed, 154 insertions(+), 138 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 62bdc8a946ef..ee901e69c39c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2620,6 +2620,7 @@ QDF_STATUS hdd_init_station_mode(hdd_adapter_t *adapter) goto error_sme_open; } + sme_set_vdev_ies_per_band(hdd_ctx->hHal, adapter->sessionId); /* Register wireless extensions */ qdf_ret_status = hdd_register_wext(pWlanDev); if (QDF_STATUS_SUCCESS != qdf_ret_status) { diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 26ce1d4dfcb3..905187b460a1 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -4794,6 +4794,20 @@ struct sir_ipa_offload_enable_disable { uint32_t enable; }; +/** + * struct sir_set_vdev_ies_per_band + * @msg_type: message type + * @len: message length + * @vdev_id: vdev id + * + * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND. + */ +struct sir_set_vdev_ies_per_band { + uint16_t msg_type; + uint16_t len; + uint32_t vdev_id; +}; + /** * struct sir_set_ht_vht_cfg - ht, vht IE config * @msg_type: message type diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index c46cb56a85f8..0e30f298e8d9 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -249,6 +249,7 @@ enum eWniMsgTypes { eWNI_SME_TSF_EVENT, eWNI_SME_MON_INIT_SESSION, eWNI_SME_PDEV_SET_HT_VHT_IE, + eWNI_SME_SET_VDEV_IES_PER_BAND, eWNI_SME_NDP_INITIATOR_REQ, eWNI_SME_NDP_INITIATOR_RSP, eWNI_SME_NDP_NEW_PEER_IND, diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 2f0c3f443371..607b42acf9f7 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1381,6 +1381,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) } break; case eWNI_SME_PDEV_SET_HT_VHT_IE: + case eWNI_SME_SET_VDEV_IES_PER_BAND: case eWNI_SME_SYS_READY_IND: case eWNI_SME_JOIN_REQ: case eWNI_SME_REASSOC_REQ: diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index cdc49061fe9c..6f61dce88657 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -2483,11 +2483,6 @@ lim_process_sta_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx, goto end; } - if (lim_send_ht_vht_ie(mac_ctx, session_entry) != - QDF_STATUS_SUCCESS) - lim_log(mac_ctx, LOGE, - FL("Unable to send HT/VHT Cap to FW")); - /* Set MLME state */ session_entry->limMlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE, diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 006aaba04ca6..ab01850993b3 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4961,6 +4961,35 @@ static void lim_set_pdev_vht_ie(tpAniSirGlobal mac_ctx, uint8_t pdev_id, } } +/** + * lim_process_set_vdev_ies_per_band() - process the set vdev IE req + * @mac_ctx: Pointer to Global MAC structure + * @msg_buf: Pointer to the SME message buffer + * + * This function is called by limProcessMessageQueue(). This function sets the + * VDEV IEs to the FW. + * + * Return: None + */ +static void lim_process_set_vdev_ies_per_band(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{ + struct sir_set_vdev_ies_per_band *p_msg = + (struct sir_set_vdev_ies_per_band *)msg_buf; + + if (NULL == p_msg) { + lim_log(mac_ctx, LOGE, FL("NULL p_msg")); + return; + } + + lim_log(mac_ctx, LOG1, FL("rcvd set vdev ie per band req vdev_id = %d"), + p_msg->vdev_id); + /* intentionally using NULL here so that self capabilty are sent */ + if (lim_send_ies_per_band(mac_ctx, NULL, p_msg->vdev_id) != + QDF_STATUS_SUCCESS) + lim_log(mac_ctx, LOGE, FL("Unable to send HT/VHT Cap to FW")); +} + /** * lim_process_set_pdev_IEs() - process the set pdev IE req * @mac_ctx: Pointer to Global MAC structure @@ -5285,6 +5314,10 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) break; case eWNI_SME_PDEV_SET_HT_VHT_IE: lim_process_set_pdev_IEs(pMac, pMsgBuf); + break; + case eWNI_SME_SET_VDEV_IES_PER_BAND: + lim_process_set_vdev_ies_per_band(pMac, pMsgBuf); + break; case eWNI_SME_NDP_END_REQ: case eWNI_SME_NDP_INITIATOR_REQ: case eWNI_SME_NDP_RESPONDER_REQ: diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 0643ddcd6463..93408fc9f590 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1781,6 +1781,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, mac_ctx->lim.htCapabilityPresentInBeacon) { lim_log(mac_ctx, LOG1, FL("Populate HT Caps in Assoc Request")); populate_dot11f_ht_caps(mac_ctx, pe_session, &frm->HTCaps); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, + &frm->HTCaps, sizeof(frm->HTCaps)); } lim_log(mac_ctx, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, short GI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), @@ -1795,6 +1797,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session->vhtCapabilityPresentInBeacon) { lim_log(mac_ctx, LOG1, FL("Populate VHT IEs in Assoc Request")); populate_dot11f_vht_caps(mac_ctx, pe_session, &frm->VHTCaps); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, + &frm->VHTCaps, sizeof(frm->VHTCaps)); vht_enabled = true; if (pe_session->enableHtSmps && !pe_session->supported_nss_1x1) { diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index ad5c53a7d0e6..1d8edcdb4e26 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6498,136 +6498,79 @@ QDF_STATUS lim_send_ie(tpAniSirGlobal mac_ctx, uint32_t sme_session_id, } /** - * lim_populate_ht_caps_from_hw_caps() - gets HTCAPs IE from session, then - * updates, HTCAPs 16 bit from hw caps - * @mac_ctx: global MAC context - * @session: pe session - * @ht_caps: HTCAPs struct to populate - * @hw_caps: hw caps - * - * This funciton sends the IE data to WMA. - * - * Return: status of operation - */ -QDF_STATUS lim_populate_ht_caps_from_hw_caps(tpAniSirGlobal mac_ctx, - tpPESession session, - tDot11fIEHTCaps *ht_caps, - uint32_t hw_caps) -{ - tSirRetStatus status; - - if (!mac_ctx) { - QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, - FL("mac_ctx is NULL")); - return QDF_STATUS_E_INVAL; - } - - /* following functions that use session can take NULL */ - status = populate_dot11f_ht_caps(mac_ctx, session, ht_caps); - if (eSIR_SUCCESS != status) { - lim_log(mac_ctx, LOGE, FL("Failed to populate ht cap IE")); - return QDF_STATUS_E_FAILURE; - } - - ht_caps->rxSTBC = !!(hw_caps & WMI_HT_CAP_RX_STBC); - ht_caps->txSTBC = !!(hw_caps & WMI_HT_CAP_TX_STBC); - ht_caps->advCodingCap = !!(hw_caps & WMI_HT_CAP_RX_LDPC); - ht_caps->shortGI20MHz = !!(hw_caps & WMI_HT_CAP_HT20_SGI); - ht_caps->shortGI40MHz = !!(hw_caps & WMI_HT_CAP_HT40_SGI); - return QDF_STATUS_SUCCESS; -} - -/** - * lim_populate_vht_caps_from_hw_caps() - gets VHTCAPs IE from session, then - * updates, HTCAPs 16 bit from hw caps - * @mac_ctx: global MAC context - * @session: pe session - * @vht_caps: VHTCAPs struct to populate - * @hw_caps: hw caps + * lim_get_rx_ldpc() - gets ldpc setting for given channel(band) + * @mac_ctx: global mac context + * @ch: channel for which ldpc setting is required * - * This funciton sends the IE data to WMA. - * - * Return: status of operation + * Return: true if enabled and false otherwise */ -QDF_STATUS lim_populate_vht_caps_from_hw_caps(tpAniSirGlobal mac_ctx, - tpPESession session, - tDot11fIEVHTCaps *vht_caps, - uint32_t hw_caps) +static inline bool lim_get_rx_ldpc(tpAniSirGlobal mac_ctx, uint8_t ch) { - uint8_t *ie_buff = (uint8_t *)vht_caps; - tSirRetStatus status; - - if (!mac_ctx) { - QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, - FL("mac_ctx is NULL")); - return QDF_STATUS_E_INVAL; - } - - /* following functions that use session can take NULL */ - status = populate_dot11f_vht_caps(mac_ctx, session, vht_caps); - if (eSIR_SUCCESS != status) { - lim_log(mac_ctx, LOGE, FL("Failed to populate vht cap IE")); - return QDF_STATUS_E_FAILURE; - } - - *((uint32_t *)(ie_buff + 1)) = hw_caps; - return QDF_STATUS_SUCCESS; + if (mac_ctx->roam.configParam.rxLdpcEnable && + wma_is_rx_ldpc_supported_for_channel(CDS_CHANNEL_NUM(ch))) + return true; + else + return false; } /** - * lim_send_ht_vht_ie() - gets ht and vht capability and send to firmware via + * lim_send_ies_per_band() - gets ht and vht capability and send to firmware via * wma - * updates, HTCAPs 16 bit from hw caps - * @session: pe session + * @mac_ctx: global mac context + * @session: pe session. This can be NULL. In that case self cap will be sent + * @vdev_id: vdev for which IE is targeted * * This funciton gets ht and vht capability and send to firmware via wma * * Return: status of operation */ -QDF_STATUS lim_send_ht_vht_ie(tpAniSirGlobal mac_ctx, tpPESession session) +QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, + tpPESession session, + uint8_t vdev_id) { - uint8_t *ie_buff; - tDot11fIEHTCaps ht_caps; - tDot11fIEVHTCaps vht_caps; - struct wma_caps_per_phy caps_2g; - struct wma_caps_per_phy caps_5g; - - if (wma_is_dbs_enable()) { - wma_get_caps_for_phyidx_hwmode(&caps_2g, HW_MODE_DBS, - CDS_BAND_2GHZ); - wma_get_caps_for_phyidx_hwmode(&caps_5g, HW_MODE_DBS, - CDS_BAND_5GHZ); - } else { - wma_get_caps_for_phyidx_hwmode(&caps_2g, HW_MODE_DBS_NONE, - CDS_BAND_2GHZ); - wma_get_caps_for_phyidx_hwmode(&caps_5g, HW_MODE_DBS_NONE, - CDS_BAND_5GHZ); - } - lim_log(mac_ctx, LOG1, - FL("HT Caps: 2G: 0x%X, 5G: 0x%X, VHT Caps: 2G: 0x%X, 5G: 0x%X"), - caps_2g.ht_2g, caps_5g.ht_5g, caps_2g.vht_2g, caps_5g.vht_5g); - - ie_buff = (uint8_t *)&ht_caps; - lim_populate_ht_caps_from_hw_caps(mac_ctx, session, - &ht_caps, caps_2g.ht_2g); - lim_send_ie(mac_ctx, session->smeSessionId, DOT11F_EID_HTCAPS, - CDS_BAND_2GHZ, ie_buff + 1, DOT11F_IE_HTCAPS_MIN_LEN); - - lim_populate_ht_caps_from_hw_caps(mac_ctx, session, - &ht_caps, caps_5g.ht_5g); - lim_send_ie(mac_ctx, session->smeSessionId, DOT11F_EID_HTCAPS, - CDS_BAND_5GHZ, ie_buff + 1, DOT11F_IE_HTCAPS_MIN_LEN); - - ie_buff = (uint8_t *)&vht_caps; - lim_populate_vht_caps_from_hw_caps(mac_ctx, session, - &vht_caps, caps_2g.vht_2g); - lim_send_ie(mac_ctx, session->smeSessionId, DOT11F_EID_VHTCAPS, - CDS_BAND_2GHZ, ie_buff + 1, DOT11F_IE_VHTCAPS_MAX_LEN); - - lim_populate_vht_caps_from_hw_caps(mac_ctx, session, - &vht_caps, caps_5g.vht_5g); - lim_send_ie(mac_ctx, session->smeSessionId, DOT11F_EID_VHTCAPS, - CDS_BAND_5GHZ, ie_buff + 1, DOT11F_IE_VHTCAPS_MAX_LEN); + uint8_t ht_caps[DOT11F_IE_HTCAPS_MIN_LEN + 2] = {0}; + uint8_t vht_caps[DOT11F_IE_VHTCAPS_MAX_LEN + 2] = {0}; + tHtCaps *p_ht_cap = (tHtCaps *)ht_caps; + tSirMacVHTCapabilityInfo *p_vht_cap = + (tSirMacVHTCapabilityInfo *)vht_caps; + + /* + * Note: Do not use Dot11f VHT structure, since 1 byte present flag in + * it is causing weird padding errors. Instead use Sir Mac VHT struct + * to send IE to wma. + */ + ht_caps[0] = DOT11F_EID_HTCAPS; + ht_caps[1] = DOT11F_IE_HTCAPS_MIN_LEN; + lim_set_ht_caps(mac_ctx, session, ht_caps, + DOT11F_IE_HTCAPS_MIN_LEN + 2); + /* Get LDPC and over write for 2G */ + p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); + lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, + CDS_BAND_2GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); + /* + * Get LDPC and over write for 5G - using channel 64 because it + * is available in all reg domains. + */ + p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64); + lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, + CDS_BAND_5GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); + + vht_caps[0] = DOT11F_EID_VHTCAPS; + vht_caps[1] = DOT11F_IE_VHTCAPS_MAX_LEN; + /* Get LDPC and over write for 2G */ + lim_set_vht_caps(mac_ctx, session, vht_caps, + DOT11F_IE_VHTCAPS_MIN_LEN + 2); + p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); + lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, + CDS_BAND_2GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); + + /* + * Get LDPC and over write for 5G - using channel 64 because it + * is available in all reg domains. + */ + p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64); + lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, + CDS_BAND_5GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); return QDF_STATUS_SUCCESS; } diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 572d35b91ee6..6c26d923518f 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -574,17 +574,8 @@ void lim_check_and_reset_protection_params(tpAniSirGlobal mac_ctx); QDF_STATUS lim_send_ext_cap_ie(tpAniSirGlobal mac_ctx, uint32_t session_id, tDot11fIEExtCap *extracted_extcap, bool merge); -QDF_STATUS lim_populate_vht_caps_from_hw_caps(tpAniSirGlobal mac_ctx, - tpPESession session, - tDot11fIEVHTCaps *vht_caps, - uint32_t hw_caps); - -QDF_STATUS lim_populate_ht_caps_from_hw_caps(tpAniSirGlobal mac_ctx, - tpPESession session, - tDot11fIEHTCaps *ht_caps, - uint32_t hw_caps); - -QDF_STATUS lim_send_ht_vht_ie(tpAniSirGlobal mac_ctx, tpPESession session); +QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, + tpPESession session, uint8_t vdev_id); tSirRetStatus lim_strip_extcap_ie(tpAniSirGlobal mac_ctx, uint8_t *addn_ie, uint16_t *addn_ielen, uint8_t *extracted_extcap); diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index fed09ba1a848..360c76a1df92 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -882,18 +882,18 @@ void lim_log_vht_cap(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pDot11f) lim_log(pMac, LOG1, FL("vhtLinkAdaptCap (2): %d"), pDot11f->vhtLinkAdaptCap); lim_log(pMac, LOG1, FL("rxAntPattern (1): %d"), - pDot11f->vhtLinkAdaptCap); + pDot11f->rxAntPattern); lim_log(pMac, LOG1, FL("txAntPattern (1): %d"), - pDot11f->vhtLinkAdaptCap); + pDot11f->txAntPattern); lim_log(pMac, LOG1, FL("reserved1 (2): %d"), pDot11f->reserved1); lim_log(pMac, LOG1, FL("rxMCSMap (16): %d"), pDot11f->rxMCSMap); lim_log(pMac, LOG1, FL("rxHighSupDataRate (13): %d"), pDot11f->rxHighSupDataRate); - lim_log(pMac, LOG1, FL("reserve (3): %d"), pDot11f->reserved2); + lim_log(pMac, LOG1, FL("reserved2(3): %d"), pDot11f->reserved2); lim_log(pMac, LOG1, FL("txMCSMap (16): %d"), pDot11f->txMCSMap); lim_log(pMac, LOG1, FL("txSupDataRate (13): %d"), pDot11f->txSupDataRate); - lim_log(pMac, LOG1, FL("reserv (3): %d"), pDot11f->reserved3); + lim_log(pMac, LOG1, FL("reserved3 (3): %d"), pDot11f->reserved3); #endif /* DUMP_MGMT_CNTNTS */ } diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 5abc5fdf59db..c82450b98fd9 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1226,6 +1226,8 @@ uint32_t sme_get_wni_dot11_mode(tHalHandle hal); QDF_STATUS sme_create_mon_session(tHalHandle hal_handle, uint8_t *bssid); QDF_STATUS sme_set_adaptive_dwelltime_config(tHalHandle hal, struct adaptive_dwelltime_params *dwelltime_params); + +void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id); void sme_set_pdev_ht_vht_ies(tHalHandle hHal, bool enable2x2); void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 5ea16ecb662d..0af0db1425ac 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16268,6 +16268,38 @@ QDF_STATUS sme_set_adaptive_dwelltime_config(tHalHandle hal, } return status; } + +/** + * sme_set_vdev_ies_per_band() - sends the per band IEs to vdev + * @hal: Pointer to HAL + * @vdev_id: vdev_id for which IE is targeted + * + * Return: None + */ +void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id) +{ + tpAniSirGlobal p_mac = PMAC_STRUCT(hal); + struct sir_set_vdev_ies_per_band *p_msg; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + p_msg = qdf_mem_malloc(sizeof(*p_msg)); + if (NULL == p_msg) { + sms_log(p_mac, LOGE, FL("mem alloc failed for sme msg")); + return; + } + + p_msg->vdev_id = vdev_id; + p_msg->msg_type = eWNI_SME_SET_VDEV_IES_PER_BAND; + p_msg->len = sizeof(*p_msg); + sms_log(p_mac, LOG1, + FL("sending eWNI_SME_SET_VDEV_IES_PER_BAND: vdev_id: %d "), + vdev_id); + status = cds_send_mb_message_to_mac(p_msg); + if (QDF_STATUS_SUCCESS != status) + sms_log(p_mac, LOGE, + FL("Send eWNI_SME_SET_VDEV_IES_PER_BAND fail")); +} + /** * sme_set_pdev_ht_vht_ies() - sends the set pdev IE req * @hal: Pointer to HAL @@ -16325,7 +16357,6 @@ void sme_set_pdev_ht_vht_ies(tHalHandle hal, bool enable2x2) if (QDF_STATUS_SUCCESS != status) { sms_log(mac_ctx, LOGE, FL( "Send SME_PDEV_SET_HT_VHT_IE fail")); - qdf_mem_free(ht_vht_cfg); } sme_release_global_lock(&mac_ctx->sme); } -- cgit v1.2.3 From 5387b81ed97ec2fc8c343ab2738bab916487e462 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 29 Sep 2016 21:03:37 -0700 Subject: Release 5.1.0.28M Release 5.1.0.28M Change-Id: I0b7c92495155593c3439eb07711e2355214a808d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1d247c4e69c1..9097e05ba9d9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28L" +#define QWLAN_VERSIONSTR "5.1.0.28M" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 8cc23b0d9a75d6f2d7693bfea28b4c6d9bf84f51 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 14 Jul 2016 12:22:56 -0700 Subject: qcacld-3.0: Update host DBS policy manager in roaming operations Firmware DBS mode is updated during firmware based roaming. Same change is reflected in the host policy manager. Process hw_mode TLV in roam sync indication event. Update cds concurrency policy after roaming. Handle exceptions for ROAM_ABORT and HO_FAIL conditions. Change-Id: I826c6766f73441256e5946d3167966e645f23430 CRs-Fixed: 1044336 --- core/cds/inc/cds_concurrency.h | 13 +++--- core/cds/src/cds_concurrency.c | 39 +++++++++------- core/hdd/src/wlan_hdd_assoc.c | 32 +++++++------ core/hdd/src/wlan_hdd_hostapd.c | 25 ---------- core/mac/inc/sir_api.h | 11 +++-- core/sme/inc/csr_api.h | 4 +- core/sme/src/csr/csr_api_roam.c | 33 +++++++++++-- core/wma/inc/wma_api.h | 5 ++ core/wma/src/wma_main.c | 101 ++++++++++++++++++++++++---------------- core/wma/src/wma_scan_roam.c | 24 ++++++++-- 10 files changed, 172 insertions(+), 115 deletions(-) diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index 1604c977f425..efe9f70622e0 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -635,13 +635,10 @@ static inline void cds_force_sap_on_scc(eCsrRoamResult roam_result, #endif /* FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -void cds_check_concurrent_intf_and_restart_sap( - hdd_station_ctx_t *hdd_sta_ctx, - hdd_adapter_t *adapter); +void cds_check_concurrent_intf_and_restart_sap(hdd_adapter_t *adapter); #else static inline void cds_check_concurrent_intf_and_restart_sap( - hdd_station_ctx_t *hdd_sta_ctx, - hdd_adapter_t *adapter) + hdd_adapter_t *adapter) { } @@ -798,7 +795,7 @@ QDF_STATUS qdf_wait_for_connection_update(void); QDF_STATUS qdf_reset_connection_update(void); QDF_STATUS qdf_set_connection_update(void); QDF_STATUS qdf_init_connection_update(void); -QDF_STATUS cds_stop_start_opportunistic_timer(void); +QDF_STATUS cds_restart_opportunistic_timer(bool check_state); QDF_STATUS cds_modify_sap_pcl_based_on_mandatory_channel(uint8_t *pcl_list_org, uint8_t *weight_list_org, uint32_t *pcl_len_org); @@ -833,4 +830,8 @@ bool cds_is_hw_mode_change_after_vdev_up(void); void cds_dump_connection_status_info(void); uint32_t cds_mode_specific_connection_count(enum cds_con_mode mode, uint32_t *list); +void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, + uint32_t new_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct sir_vdev_mac_map *vdev_mac_map); #endif /* __CDS_CONCURRENCY_H */ diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 6e7d95790568..946dc819b45a 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2512,10 +2512,10 @@ static void cds_pdev_set_hw_mode_cb(uint32_t status, * * Return: None */ -static void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, - uint32_t new_hw_mode_index, - uint32_t num_vdev_mac_entries, - struct sir_vdev_mac_map *vdev_mac_map) +void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, + uint32_t new_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct sir_vdev_mac_map *vdev_mac_map) { QDF_STATUS status; struct sir_hw_mode_params hw_mode; @@ -6275,14 +6275,11 @@ QDF_STATUS cds_next_actions(uint32_t session_id, return status; } /** - * if already in DBS no need to request DBS or if already in - * non dbs no need request for non dbs again. Might be needed + * if already in DBS no need to request DBS. Might be needed * to extend the logic when multiple dbs HW mode is available */ if ((((CDS_DBS_DOWNGRADE == action) || (CDS_DBS == action)) - && hw_mode.dbs_cap) || - (((CDS_SINGLE_MAC_UPGRADE == action) || - (CDS_SINGLE_MAC == action)) && !hw_mode.dbs_cap)) { + && hw_mode.dbs_cap)) { cds_err("driver is already in %s mode, no further action needed", (hw_mode.dbs_cap) ? "dbs" : "non dbs"); return QDF_STATUS_E_ALREADY; @@ -7043,17 +7040,18 @@ static void cds_check_sta_ap_concurrent_ch_intf(void *data) } } + /** * cds_check_concurrent_intf_and_restart_sap() - Check concurrent change intf - * @hdd_sta_ctx: Pointer to HDD STA context + * @adapter: Pointer to HDD adapter * * Checks the concurrent change interface and restarts SAP * Return: None */ -void cds_check_concurrent_intf_and_restart_sap(hdd_station_ctx_t *hdd_sta_ctx, - hdd_adapter_t *adapter) +void cds_check_concurrent_intf_and_restart_sap(hdd_adapter_t *adapter) { hdd_context_t *hdd_ctx; + hdd_station_ctx_t *hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -8199,13 +8197,17 @@ enum cds_conc_next_action cds_get_current_pref_hw_mode(void) } /** - * cds_stop_start_opportunistic_timer() - Start and stop the opportunistic timer + * cds_restart_opportunistic_timer() - Restarts opportunistic timer + * @check_state: check timer state if this flag is set, else restart + * irrespective of state * - * Stops and starts the opportunistic timer for DBS_OPPORTUNISTIC_TIME seconds + * Restarts opportunistic timer for DBS_OPPORTUNISTIC_TIME seconds. + * Check if current state is RUNNING if check_state is set, else + * restart the timer irrespective of state. * * Return: QDF_STATUS */ -QDF_STATUS cds_stop_start_opportunistic_timer(void) +QDF_STATUS cds_restart_opportunistic_timer(bool check_state) { QDF_STATUS status = QDF_STATUS_E_FAILURE; p_cds_contextType cds_ctx; @@ -8216,6 +8218,11 @@ QDF_STATUS cds_stop_start_opportunistic_timer(void) return status; } + if (check_state && + QDF_TIMER_STATE_RUNNING != + cds_ctx->dbs_opportunistic_timer.state) + return status; + qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer); status = qdf_mc_timer_start( @@ -8852,7 +8859,7 @@ QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id) * as well. */ if (action == CDS_SINGLE_MAC_UPGRADE) { - qdf_status = cds_stop_start_opportunistic_timer(); + qdf_status = cds_restart_opportunistic_timer(false); if (QDF_IS_STATUS_SUCCESS(qdf_status)) cds_info("opportunistic timer for MCC upgrade"); goto done; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 93a7529b856e..0c40894ec775 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -2482,8 +2482,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, #endif hdd_info("check for SAP restart"); - cds_check_concurrent_intf_and_restart_sap(pHddStaCtx, - pAdapter); + cds_check_concurrent_intf_and_restart_sap(pAdapter); DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD, pAdapter->sessionId, @@ -4738,19 +4737,6 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, FL("hdd_ReassocScenario set to: %d, due to eCSR_ROAM_FT_START, session: %d"), pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); break; - case eCSR_ROAM_DISABLE_QUEUES: - hdd_info("Disabling queues"); - wlan_hdd_netif_queue_control(pAdapter, - WLAN_NETIF_TX_DISABLE, - WLAN_CONTROL_PATH); - break; - case eCSR_ROAM_ENABLE_QUEUES: - hdd_info("Enabling queues"); - wlan_hdd_netif_queue_control(pAdapter, - WLAN_WAKE_ALL_NETIF_QUEUE, - WLAN_CONTROL_PATH); - break; - case eCSR_ROAM_SHOULD_ROAM: /* notify apps that we can't pass traffic anymore */ hddLog(LOG1, FL("Disabling queues")); @@ -5034,6 +5020,22 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, hdd_ndp_event_handler(pAdapter, pRoamInfo, roamId, roamStatus, roamResult); break; + case eCSR_ROAM_START: + hdd_info("Process ROAM_START from firmware"); + wlan_hdd_netif_queue_control(pAdapter, + WLAN_NETIF_TX_DISABLE, + WLAN_CONTROL_PATH); + cds_set_connection_in_progress(true); + cds_restart_opportunistic_timer(true); + break; + case eCSR_ROAM_ABORT: + hdd_info("Firmware aborted roaming operation, previous connection is still valid"); + wlan_hdd_netif_queue_control(pAdapter, + WLAN_WAKE_ALL_NETIF_QUEUE, + WLAN_CONTROL_PATH); + cds_set_connection_in_progress(false); + break; + default: break; } diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 2d427064e918..2a680486c1f0 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6075,37 +6075,12 @@ int wlan_hdd_set_channel(struct wiphy *wiphy, case NL80211_CHAN_HT20: case NL80211_CHAN_NO_HT: smeConfig.csrConfig.obssEnabled = false; - if (channel <= 14) - smeConfig.csrConfig. - channelBondingMode24GHz = - eCSR_INI_SINGLE_CHANNEL_CENTERED; - else - smeConfig.csrConfig. - channelBondingMode5GHz = - eCSR_INI_SINGLE_CHANNEL_CENTERED; sap_config->sec_ch = 0; break; - case NL80211_CHAN_HT40MINUS: - if (channel <= 14) - smeConfig.csrConfig. - channelBondingMode24GHz = - eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; - else - smeConfig.csrConfig. - channelBondingMode5GHz = - eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; sap_config->sec_ch = sap_config->channel - 4; break; case NL80211_CHAN_HT40PLUS: - if (channel <= 14) - smeConfig.csrConfig. - channelBondingMode24GHz = - eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; - else - smeConfig.csrConfig. - channelBondingMode5GHz = - eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; sap_config->sec_ch = sap_config->channel + 4; break; default: diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 905187b460a1..2e478fb7af8f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -193,14 +193,16 @@ typedef enum { * enum sir_roam_op_code - Operation to be done by the callback. * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming. * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming. - * @SIR_ROAMING_TX_QUEUE_DISABLE: Disable the network queues while roaming. - * @SIR_ROAMING_TX_QUEUE_ENABLE: Enable back the n/w queues in case roam fails. + * @SIR_ROAMING_START: Firmware started roaming operation + * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected. + * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete. */ enum sir_roam_op_code { SIR_ROAM_SYNCH_PROPAGATION = 1, SIR_ROAMING_DEREGISTER_STA, - SIR_ROAMING_TX_QUEUE_DISABLE, - SIR_ROAMING_TX_QUEUE_ENABLE, + SIR_ROAMING_START, + SIR_ROAMING_ABORT, + SIR_ROAM_SYNCH_COMPLETE, }; /** * Module ID definitions. @@ -4153,6 +4155,7 @@ typedef struct sSirSmeRoamOffloadSynchInd { void *add_bss_params; tpSirSmeJoinRsp join_rsp; uint16_t aid; + struct sir_hw_mode_trans_ind hw_mode_trans_ind; } roam_offload_synch_ind; #ifdef WLAN_FEATURE_ROAM_OFFLOAD diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index b5752db35700..5467b645ca4f 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -505,11 +505,11 @@ typedef enum { /* Channel sw update notification */ eCSR_ROAM_DFS_CHAN_SW_NOTIFY, eCSR_ROAM_EXT_CHG_CHNL_IND, - eCSR_ROAM_DISABLE_QUEUES, - eCSR_ROAM_ENABLE_QUEUES, eCSR_ROAM_STA_CHANNEL_SWITCH, eCSR_ROAM_NDP_STATUS_UPDATE, eCSR_ROAM_UPDATE_SCAN_RESULT, + eCSR_ROAM_START, + eCSR_ROAM_ABORT, } eRoamCmdStatus; /* comment inside indicates what roaming callback gets */ diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index b7b068de0337..2be95a2bc3b2 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -18778,6 +18778,7 @@ void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf) sessionId); return; } + cds_set_connection_in_progress(false); csr_roam_synch_clean_up(pMac, sessionId); csr_roaming_report_diag_event(pMac, NULL, eCSR_REASON_ROAM_HO_FAIL); @@ -19501,18 +19502,41 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, eCSR_ROAM_FT_START, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); return; - case SIR_ROAMING_TX_QUEUE_DISABLE: + case SIR_ROAMING_START: csr_roam_call_callback(mac_ctx, session_id, NULL, 0, - eCSR_ROAM_DISABLE_QUEUES, eSIR_SME_SUCCESS); + eCSR_ROAM_START, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); return; - case SIR_ROAMING_TX_QUEUE_ENABLE: + case SIR_ROAMING_ABORT: csr_roam_call_callback(mac_ctx, session_id, NULL, 0, - eCSR_ROAM_ENABLE_QUEUES, eSIR_SME_SUCCESS); + eCSR_ROAM_ABORT, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); return; case SIR_ROAM_SYNCH_PROPAGATION: break; + case SIR_ROAM_SYNCH_COMPLETE: + /* + * Following operations need to be done once roam sync + * completion is sent to FW, hence called here: + * 1) Firmware has already updated DBS policy. Update connection + * table in the host driver. + * 2) Force SCC switch if needed + * 3) Set connection in progress = false + */ + /* first update connection info from wma interface */ + cds_update_connection_info(session_id); + /* then update remaining parameters from roam sync ctx */ + sms_log(mac_ctx, LOGE, FL("Update DBS hw mode")); + cds_hw_mode_transition_cb( + roam_synch_data->hw_mode_trans_ind.old_hw_mode_index, + roam_synch_data->hw_mode_trans_ind.new_hw_mode_index, + roam_synch_data->hw_mode_trans_ind.num_vdev_mac_entries, + roam_synch_data->hw_mode_trans_ind.vdev_mac_map); + cds_set_connection_in_progress(false); + session->roam_synch_in_progress = false; + cds_check_concurrent_intf_and_restart_sap(session->pContext); + sme_release_global_lock(&mac_ctx->sme); + return; default: sms_log(mac_ctx, LOGE, FL("LFR3: callback reason %d"), reason); sme_release_global_lock(&mac_ctx->sme); @@ -19737,6 +19761,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, ("NO CSR_IS_WAIT_FOR_KEY -> csr_roam_link_up")); csr_roam_link_up(mac_ctx, conn_profile->bssid); } + session->fRoaming = false; session->roam_synch_in_progress = false; qdf_mem_free(roam_info->pbFrames); diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index a63db28d3d8e..d2bb1098c54d 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -296,4 +296,9 @@ bool wma_is_p2p_lo_capable(void); QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params); QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id); QDF_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *wake_lock_stats); + +void wma_process_pdev_hw_mode_trans_ind(void *wma, + wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param, + wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, + struct sir_hw_mode_trans_ind *hw_mode_trans_ind); #endif diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 7c74c570e82a..7a46b314380f 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2488,6 +2488,66 @@ fail: return QDF_STATUS_E_FAILURE; } +/** + * wma_process_pdev_hw_mode_trans_ind() - Process HW mode transition info + * + * @handle: WMA handle + * @fixed_param: Event fixed parameters + * @vdev_mac_entry - vdev mac entry + * @hw_mode_trans_ind - Buffer to store parsed information + * + * Parses fixed_param, vdev_mac_entry and fills in the information into + * hw_mode_trans_ind and wma + * + * Return: None + */ +void wma_process_pdev_hw_mode_trans_ind(void *handle, + wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param, + wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, + struct sir_hw_mode_trans_ind *hw_mode_trans_ind) +{ + uint32_t i; + tp_wma_handle wma = (tp_wma_handle) handle; + + hw_mode_trans_ind->old_hw_mode_index = fixed_param->old_hw_mode_index; + hw_mode_trans_ind->new_hw_mode_index = fixed_param->new_hw_mode_index; + hw_mode_trans_ind->num_vdev_mac_entries = + fixed_param->num_vdev_mac_entries; + WMA_LOGI("%s: old_hw_mode_index:%d new_hw_mode_index:%d entries=%d", + __func__, fixed_param->old_hw_mode_index, + fixed_param->new_hw_mode_index, + fixed_param->num_vdev_mac_entries); + + /* Store the vdev-mac map in WMA and send to policy manager */ + for (i = 0; i < fixed_param->num_vdev_mac_entries; i++) { + uint32_t vdev_id, mac_id, pdev_id; + vdev_id = vdev_mac_entry[i].vdev_id; + pdev_id = vdev_mac_entry[i].pdev_id; + + if (pdev_id == WMI_PDEV_ID_SOC) { + WMA_LOGE("%s: soc level id received for mac id)", + __func__); + QDF_BUG(0); + return; + } + + mac_id = WMA_PDEV_TO_MAC_MAP(vdev_mac_entry[i].pdev_id); + + WMA_LOGI("%s: vdev_id:%d mac_id:%d", + __func__, vdev_id, mac_id); + + hw_mode_trans_ind->vdev_mac_map[i].vdev_id = vdev_id; + hw_mode_trans_ind->vdev_mac_map[i].mac_id = mac_id; + wma_update_intf_hw_mode_params(vdev_id, mac_id, + fixed_param->new_hw_mode_index); + } + wma->old_hw_mode_index = fixed_param->old_hw_mode_index; + wma->new_hw_mode_index = fixed_param->new_hw_mode_index; + + WMA_LOGI("%s: Updated: old_hw_mode_index:%d new_hw_mode_index:%d", + __func__, wma->old_hw_mode_index, wma->new_hw_mode_index); +} + /** * wma_pdev_hw_mode_transition_evt_handler() - HW mode transition evt handler * @handle: WMI handle @@ -2505,7 +2565,6 @@ static int wma_pdev_hw_mode_transition_evt_handler(void *handle, uint8_t *event, uint32_t len) { - uint32_t i; WMI_PDEV_HW_MODE_TRANSITION_EVENTID_param_tlvs *param_buf; wmi_pdev_hw_mode_transition_event_fixed_param *wmi_event; wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry; @@ -2532,46 +2591,10 @@ static int wma_pdev_hw_mode_transition_evt_handler(void *handle, } wmi_event = param_buf->fixed_param; - hw_mode_trans_ind->old_hw_mode_index = wmi_event->old_hw_mode_index; - hw_mode_trans_ind->new_hw_mode_index = wmi_event->new_hw_mode_index; - hw_mode_trans_ind->num_vdev_mac_entries = - wmi_event->num_vdev_mac_entries; - WMA_LOGI("%s: old_hw_mode_index:%d new_hw_mode_index:%d entries=%d", - __func__, wmi_event->old_hw_mode_index, - wmi_event->new_hw_mode_index, wmi_event->num_vdev_mac_entries); - vdev_mac_entry = param_buf->wmi_pdev_set_hw_mode_response_vdev_mac_mapping; - - /* Store the vdev-mac map in WMA and prepare to send to HDD */ - for (i = 0; i < wmi_event->num_vdev_mac_entries; i++) { - uint32_t vdev_id, mac_id, pdev_id; - vdev_id = vdev_mac_entry[i].vdev_id; - pdev_id = vdev_mac_entry[i].pdev_id; - - if (pdev_id == WMI_PDEV_ID_SOC) { - WMA_LOGE("%s: soc level id received for mac id)", - __func__); - QDF_BUG(0); - return QDF_STATUS_E_FAILURE; - } - - mac_id = WMA_PDEV_TO_MAC_MAP(vdev_mac_entry[i].pdev_id); - - WMA_LOGI("%s: vdev_id:%d mac_id:%d", - __func__, vdev_id, mac_id); - - hw_mode_trans_ind->vdev_mac_map[i].vdev_id = vdev_id; - hw_mode_trans_ind->vdev_mac_map[i].mac_id = mac_id; - wma_update_intf_hw_mode_params(vdev_id, mac_id, - wmi_event->new_hw_mode_index); - } - wma->old_hw_mode_index = wmi_event->old_hw_mode_index; - wma->new_hw_mode_index = wmi_event->new_hw_mode_index; - - WMA_LOGI("%s: Updated: old_hw_mode_index:%d new_hw_mode_index:%d", - __func__, wma->old_hw_mode_index, wma->new_hw_mode_index); - + wma_process_pdev_hw_mode_trans_ind(wma, wmi_event, vdev_mac_entry, + hw_mode_trans_ind); /* Pass the message to PE */ wma_send_msg(wma, SIR_HAL_PDEV_HW_MODE_TRANS_IND, (void *) hw_mode_trans_ind, 0); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 96d6fde1c490..11ee61b69cf4 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2155,6 +2155,13 @@ void wma_fill_roam_synch_buffer(tp_wma_handle wma, QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, key->replay_counter, SIR_REPLAY_CTR_LEN); } + if (param_buf->hw_mode_transition_fixed_param) + wma_process_pdev_hw_mode_trans_ind(wma, + param_buf->hw_mode_transition_fixed_param, + param_buf->wmi_pdev_set_hw_mode_response_vdev_mac_mapping, + &roam_synch_ind_ptr->hw_mode_trans_ind); + else + WMA_LOGD(FL("hw_mode transition fixed param is NULL")); } /** @@ -2284,8 +2291,7 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, } qdf_mem_zero(roam_synch_ind_ptr, len); wma_fill_roam_synch_buffer(wma, roam_synch_ind_ptr, param_buf); - - /* 24 byte MAC header and 12 byte to ssid IE */ + /* 24 byte MAC header and 12 byte to ssid IE */ if (roam_synch_ind_ptr->beaconProbeRespLength > (SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET)) { ie_len = roam_synch_ind_ptr->beaconProbeRespLength - @@ -2308,6 +2314,16 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_PROPAGATION); wma_process_roam_synch_complete(wma, synch_event->vdev_id); + + /* update freq and channel width */ + wma->interfaces[synch_event->vdev_id].mhz = + roam_synch_ind_ptr->chan_freq; + if (roam_synch_ind_ptr->join_rsp) + wma->interfaces[synch_event->vdev_id].chan_width = + roam_synch_ind_ptr->join_rsp->vht_channel_width; + + wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, + roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_COMPLETE); wma->interfaces[synch_event->vdev_id].roam_synch_delay = qdf_get_system_timestamp() - roam_synch_received; WMA_LOGD("LFR3: roam_synch_delay:%d", @@ -5789,9 +5805,9 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, return -ENOMEM; } if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) - op_code = SIR_ROAMING_TX_QUEUE_DISABLE; + op_code = SIR_ROAMING_START; if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) - op_code = SIR_ROAMING_TX_QUEUE_ENABLE; + op_code = SIR_ROAMING_ABORT; roam_synch_data->roamedVdevId = wmi_event->vdev_id; wma_handle->csr_roam_synch_cb( (tpAniSirGlobal)wma_handle->mac_context, -- cgit v1.2.3 From 1e74c220de1148f4722a4fe4a169239750c7136e Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 29 Sep 2016 21:52:25 -0700 Subject: Release 5.1.0.28N Release 5.1.0.28N Change-Id: I24f1df691bef136a9e031eaae630637f4cec929e CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 9097e05ba9d9..941c85af1742 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28M" +#define QWLAN_VERSIONSTR "5.1.0.28N" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 4cc97a9b18a48207be0abc2c0886bd281c976bf3 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Wed, 14 Sep 2016 23:13:07 +0530 Subject: qcacld-3.0: set global context to NULL only when all the cleanup is completed In cds_deint, cds global context is set to NULL and then cleanup handlers of memory/timer/nbuf manager's are invoked. During the cleanup these handlers use QDF_TRACE to print the cleanup information which internally tries to get the global context resulting in not clean unload of driver. To migitate the issue set global context to NULL once the clean up of all handlers is completed cleanly. Change-Id: Ic58962dfd543020d79cabd7b646e483c4f7961f2 CRs-Fixed: 1067340 --- core/cds/src/cds_api.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index e37e9c729f25..a493dc34c55f 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -117,14 +117,13 @@ void cds_deinit(void) if (gp_cds_context == NULL) return; + qdf_mc_timer_manager_exit(); + qdf_mem_exit(); + gp_cds_context->qdf_ctx = NULL; gp_cds_context = NULL; qdf_mem_zero(&g_cds_context, sizeof(g_cds_context)); - - qdf_mc_timer_manager_exit(); - qdf_mem_exit(); - return; } -- cgit v1.2.3 From ca346b4819011bcb5087e1eb36533451b2157578 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 29 Sep 2016 22:42:14 -0700 Subject: Release 5.1.0.28O Release 5.1.0.28O Change-Id: I094b9f5a31137eecaea360e65c80cc9143254afc CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 941c85af1742..8ea4e283d82d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28N" +#define QWLAN_VERSIONSTR "5.1.0.28O" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 353be2f00dcd3a43e2df91cd16c34fd59f8ec238 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Tue, 27 Sep 2016 15:01:41 +0530 Subject: qcacld-3.0: Invoke LFR3 roaming on reception of prev_bssid in connect When supplicant issues connect with prev_bssid set, it expects the driver to do reassociation instead of disconnect and connect. This fix checks if prev_bssid is set and bssid/bssid_hint, channel/ channel_hint parameters are present in connect and if yes, invokes LFR3 roaming. Change-Id: I8d4d29086a205563061bb155a1298de91839cbec CRs-Fixed: 1071581 --- core/hdd/src/wlan_hdd_cfg80211.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 568c7b7e30be..4ecc1c880ff0 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11969,8 +11969,8 @@ disconnected: * @req: Pointer to the structure cfg_connect_params receieved from user space * @status: out variable for status of reassoc request * - * This function will start reassociation if bssid hint, channel hint and - * previous bssid parameters are present in the connect request + * This function will start reassociation if prev_bssid is set and bssid/ + * bssid_hint, channel/channel_hint parameters are present in connect request. * * Return: true if connect was for ReAssociation, false otherwise */ @@ -11980,13 +11980,24 @@ static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, int *status) { bool reassoc = false; - if (req->bssid_hint && req->channel_hint && req->prev_bssid) { + const uint8_t *bssid = NULL; + uint16_t channel = 0; + + if (req->bssid) + bssid = req->bssid; + else if (req->bssid_hint) + bssid = req->bssid_hint; + + if (req->channel) + channel = req->channel->hw_value; + else if (req->channel_hint) + channel = req->channel_hint->hw_value; + + if (bssid && channel && req->prev_bssid) { reassoc = true; hdd_info(FL("REASSOC Attempt on channel %d to "MAC_ADDRESS_STR), - req->channel_hint->hw_value, - MAC_ADDR_ARRAY(req->bssid_hint)); - *status = hdd_reassoc(adapter, req->bssid_hint, - req->channel_hint->hw_value, + channel, MAC_ADDR_ARRAY(bssid)); + *status = hdd_reassoc(adapter, bssid, channel, CONNECT_CMD_USERSPACE); hdd_debug("hdd_reassoc: status: %d", *status); } -- cgit v1.2.3 From 07ec8f6edae26b37a1c11ada6227fe91c262e318 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Tue, 27 Sep 2016 21:51:01 +0530 Subject: qcacld-3.0: wait for driver recovery to complete before driver unload As part driver shutdown cds recovery inprogress is set and it is cleared once the driver recovery is completed. In the case of the SAP ssr network manager tries to unload/reload once the network queues/carrier is turned off. In the module exit the driver is unregistering the driver ops because of which platform driver is not able to invoke the re-init of the driver and re-init completed flag is never set. Once the driver unregisters with platform driver it invokes the remove function in which driver is waiting infinitely for the reinit to complete. To mitigate the issue wait for driver recovery to complete before starting the driver unload. Change-Id: I1879f7dc4b09d3eef6475252f6209339351c5737 CRs-Fixed: 1072677 --- core/hdd/inc/wlan_hdd_main.h | 3 +++ core/hdd/src/wlan_hdd_driver_ops.c | 5 ----- core/hdd/src/wlan_hdd_main.c | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index b91fa4485477..76be402b99a8 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -156,6 +156,9 @@ #define MAX_CFG_STRING_LEN 255 +/* SSR Retry Count */ +#define HDD_MOD_EXIT_SSR_MAX_RETRIES 75 + #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] /** Mac Address string **/ #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index b42be5634d69..3a8a06dc156a 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -417,11 +417,6 @@ static void wlan_hdd_remove(struct device *dev) pr_info("%s: Removing driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR); - /* Wait for recovery to complete */ - while (cds_is_driver_recovering()) { - hdd_alert("Recovery in progress; wait here!!!"); - msleep(1000); - } cds_set_driver_loaded(false); cds_set_unload_in_progress(true); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ee901e69c39c..5049f1394b1b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8765,6 +8765,28 @@ out: return ret; } +/** + * hdd_wait_for_recovery_completion() - Wait for cds recovery completion + * + * Block the unloading of the driver until the cds recovery is completed + * + * Return: None + */ +static void hdd_wait_for_recovery_completion(void) +{ + int retry = 0; + + /* Wait for recovery to complete */ + while (cds_is_driver_recovering()) { + hdd_alert("Recovery in progress; wait here!!!"); + msleep(1000); + if (retry++ == HDD_MOD_EXIT_SSR_MAX_RETRIES) { + hdd_alert("SSR never completed, fatal error"); + QDF_BUG(0); + } + } +} + /** * __hdd_module_exit - Module exit helper * @@ -8775,6 +8797,8 @@ static void __hdd_module_exit(void) pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR); + hdd_wait_for_recovery_completion(); + wlan_hdd_unregister_driver(); qdf_wake_lock_destroy(&wlan_wake_lock); -- cgit v1.2.3 From c665784a69e5b009fb13bb929272b6702ec57ea7 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 30 Sep 2016 00:20:49 -0700 Subject: Release 5.1.0.28P Release 5.1.0.28P Change-Id: I42e06f4cc6c96243f5481fd298ca7dc2e639ba70 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8ea4e283d82d..29dda6c13d16 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28O" +#define QWLAN_VERSIONSTR "5.1.0.28P" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 49fb4d74b6b304af77ec0aaa6d9283cf5eac1343 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Wed, 21 Sep 2016 16:56:32 +0530 Subject: Revert "qcacld-3.0: Store events in pktlog buffer when Pktlog is enabled by default in INI" This reverts commit Id0b7dd6b4573147eef9b80b57bc78284e52807ec. This change is not required anymore as now vendor related pktlog enable/disable command will be handled via flag in wifi start log structure. Change-Id: I82f32d3d8021361e92d67a53624a1d5d027fd9b8 CRs-Fixed: 1072584 --- core/utils/pktlog/include/pktlog_ac.h | 1 - core/utils/pktlog/linux_ac.c | 9 ++------- core/utils/pktlog/pktlog_ac.c | 15 +-------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/core/utils/pktlog/include/pktlog_ac.h b/core/utils/pktlog/include/pktlog_ac.h index cd45f6987aae..9d213e0c76bb 100644 --- a/core/utils/pktlog/include/pktlog_ac.h +++ b/core/utils/pktlog/include/pktlog_ac.h @@ -104,7 +104,6 @@ struct ol_pktlog_dev_t { uint32_t htc_err_cnt; uint8_t htc_endpoint; void *htc_pdev; - bool enable_flag; }; #define PKTLOG_SYSCTL_SIZE 14 diff --git a/core/utils/pktlog/linux_ac.c b/core/utils/pktlog/linux_ac.c index c312b5903487..b92de81f683d 100644 --- a/core/utils/pktlog/linux_ac.c +++ b/core/utils/pktlog/linux_ac.c @@ -230,13 +230,9 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos) ret = QDF_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); if (ret == 0) - /* - * enable/disable pktlog through sysfs should be counted - * as user_triggered = 1. - */ ret = pl_dev->pl_funcs->pktlog_enable( (struct hif_opaque_softc *)scn, enable, - cds_is_packet_log_enabled(), 1); + cds_is_packet_log_enabled(), 0); else printk(PKTLOG_TAG "%s:proc_dointvec failed\n", __func__); @@ -444,7 +440,6 @@ static int pktlog_attach(struct hif_opaque_softc *scn) * might be good to move to pktlog_init */ /* pl_dev->tgt_pktlog_alloced = false; */ - pl_dev->enable_flag = false; pl_info_lnx->proc_entry = NULL; pl_info_lnx->sysctl_header = NULL; @@ -514,7 +509,7 @@ static void pktlog_detach(struct hif_opaque_softc *scn) ASSERT(0); return; } - pl_dev->enable_flag = false; + pl_info = pl_dev->pl_info; remove_proc_entry(WLANDEV_BASENAME, g_pktlog_pde); pktlog_sysctl_unregister(pl_dev); diff --git a/core/utils/pktlog/pktlog_ac.c b/core/utils/pktlog/pktlog_ac.c index d3055e134485..db6284871bc4 100644 --- a/core/utils/pktlog/pktlog_ac.c +++ b/core/utils/pktlog/pktlog_ac.c @@ -311,7 +311,6 @@ int pktlog_disable(struct hif_opaque_softc *scn) return -EFAULT; pl_dev = txrx_pdev->pl_dev; - pl_dev->enable_flag = false; pl_info = pl_dev->pl_info; if (pktlog_wma_post_msg(0, WMI_PDEV_PKTLOG_DISABLE_CMDID, 0, 0)) { @@ -356,7 +355,6 @@ void pktlog_init(struct hif_opaque_softc *scn) pl_info->pktlen = 0; pl_info->start_time_thruput = 0; pl_info->start_time_per = 0; - pdev_txrx_handle->pl_dev->enable_flag = false; PKTLOG_TX_SUBSCRIBER.callback = pktlog_callback; PKTLOG_RX_SUBSCRIBER.callback = pktlog_callback; @@ -398,17 +396,6 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, if (!pl_info) return 0; - /* - * Do not send the pktlog disable command in case when pktlog - * is enabled from INI during init, SO make enable_flag as false. - * send the pktlog disable command only after when user will triggere - * iwpriv pktlog enable command or enable through pktlog conf tool or - * vendor will send pktlog enable command. - */ - if (ini_triggered == 1 && user_triggered == 0 && log_state != 0) - pl_dev->enable_flag = false; - else if (log_state != 0) - pl_dev->enable_flag = true; if (!pl_dev->tgt_pktlog_alloced) { if (pl_info->buf == NULL) { @@ -455,7 +442,7 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, printk("Device cannot be enabled, %s\n", __func__); return -1; } - } else if (pl_dev->enable_flag) { + } else { pl_dev->pl_funcs->pktlog_disable(scn); } -- cgit v1.2.3 From 4acb30a8d3181155e73397807ab6bb21d2d3a5c7 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Thu, 22 Sep 2016 20:07:53 +0530 Subject: qcacld-3.0: Add new index in SME AC type Since AC/UP table is 4 entries long and linux AC queue has 5 entries, packets coming for new queue are going out of bound. Add changes to add one more index in SME AC type to handle this. Change-Id: Ifaeb6f2c68177887759c3582dd7bc6ff56673d7d CRs-Fixed: 1064813 --- core/hdd/src/wlan_hdd_tx_rx.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 317f9939e76d..918973a91cee 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -62,14 +62,22 @@ #include "wlan_hdd_nan_datapath.h" #include "pld_common.h" -const uint8_t hdd_wmm_ac_to_highest_up[] = { - SME_QOS_WMM_UP_RESV, - SME_QOS_WMM_UP_EE, - SME_QOS_WMM_UP_VI, - SME_QOS_WMM_UP_NC +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +/* + * Mapping Linux AC interpretation to SME AC. + * Host has 5 tx queues, 4 flow-controlled queues for regular traffic and + * one non-flow-controlled queue for high priority control traffic(EOPOL, DHCP). + * The fifth queue is mapped to AC_VO to allow for proper prioritization. + */ +const uint8_t hdd_qdisc_ac_to_tl_ac[] = { + SME_AC_VO, + SME_AC_VI, + SME_AC_BE, + SME_AC_BK, + SME_AC_VO, }; -/* Mapping Linux AC interpretation to SME AC. */ +#else const uint8_t hdd_qdisc_ac_to_tl_ac[] = { SME_AC_VO, SME_AC_VI, @@ -77,6 +85,8 @@ const uint8_t hdd_qdisc_ac_to_tl_ac[] = { SME_AC_BK, }; +#endif + #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL /** * hdd_tx_resume_timer_expired_handler() - TX Q resume timer handler -- cgit v1.2.3 From 347e3fd4fd4751ff28da3196a4557eed9e3d4a1c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 30 Sep 2016 02:02:34 -0700 Subject: Release 5.1.0.28Q Release 5.1.0.28Q Change-Id: I1b11b8272f1e2a368bc1626cd71f207bf84e5604 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 29dda6c13d16..0efe4e5ab1ad 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28P" +#define QWLAN_VERSIONSTR "5.1.0.28Q" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 9afc501027aa871c4f714c57626b1f8da2c99a00 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 13:56:27 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "start" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "start" logic such that the actual implementation is in the lpass feature file. Change-Id: Idc7ed03abd35616d2a7bfa4a74aaec9898f9dc8e CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 22 ++++++++++++++++++++-- core/hdd/src/wlan_hdd_lpass.h | 23 ++++++++++++++--------- core/hdd/src/wlan_hdd_main.c | 5 +---- core/hdd/src/wlan_hdd_power.c | 5 +---- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 193016a7ab5e..d53663b418ea 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -196,8 +196,9 @@ void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, * * Return: none */ -void wlan_hdd_send_version_pkg(uint32_t fw_version, - uint32_t chip_id, const char *chip_name) +static void wlan_hdd_send_version_pkg(uint32_t fw_version, + uint32_t chip_id, + const char *chip_name) { int ret = 0; struct wlan_version_data data; @@ -259,3 +260,20 @@ void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) if (!scan_intf_found) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } + +/** + * hdd_lpass_notify_start() - Notify LPASS of driver start + * @hdd_ctx: The global HDD context + * + * This function is used to notify the LPASS feature that the wlan + * driver has (re-)started. + * + * Return: none + */ +void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) +{ + wlan_hdd_send_all_scan_intf_info(hdd_ctx); + wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version, + hdd_ctx->target_hw_version, + hdd_ctx->target_hw_name); +} diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 2fb5d70c7792..3d6d9b2fbf5b 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -28,13 +28,24 @@ #if !defined(WLAN_HDD_LPASS_H) #define WLAN_HDD_LPASS_H +struct hdd_context_s; + #ifdef WLAN_FEATURE_LPSS void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, uint8_t is_on, uint8_t is_connected); -void wlan_hdd_send_version_pkg(uint32_t fw_version, - uint32_t chip_id, const char *chip_name); void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx); + +/** + * hdd_lpass_notify_start() - Notify LPASS of driver start + * @hdd_ctx: The global HDD context + * + * This function is used to notify the LPASS feature that the wlan + * driver has (re-)started. + * + * Return: none + */ +void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); #else static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, @@ -43,17 +54,11 @@ static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, return; } -static inline void wlan_hdd_send_version_pkg(uint32_t fw_version, - uint32_t chip_id, - const char *chip_name) -{ - return; -} - static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) { return; } +static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { } #endif #endif /* WLAN_HDD_LPASS_H */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 5049f1394b1b..699a5f62d2e8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7738,10 +7738,7 @@ int hdd_wlan_startup(struct device *dev) hdd_bus_bw_compute_cbk, (void *)hdd_ctx); #endif - wlan_hdd_send_all_scan_intf_info(hdd_ctx); - wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version, - hdd_ctx->target_hw_version, - hdd_ctx->target_hw_name); + hdd_lpass_notify_start(hdd_ctx); if (hdd_ctx->rps) hdd_set_rps_cpu_mask(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 9e5826085f7b..24832518008a 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1555,10 +1555,7 @@ QDF_STATUS hdd_wlan_re_init(void) goto err_cds_disable; } - wlan_hdd_send_all_scan_intf_info(pHddCtx); - wlan_hdd_send_version_pkg(pHddCtx->target_fw_version, - pHddCtx->target_hw_version, - pHddCtx->target_hw_name); + hdd_lpass_notify_start(pHddCtx); qdf_status = wlansap_global_init(); if (QDF_IS_STATUS_ERROR(qdf_status)) goto err_cds_disable; -- cgit v1.2.3 From f7f66f0baf07c0427d97ece8e072c2872f9c6d8a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 14:50:11 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "stop" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "stop" logic such that the actual implementation is in the lpass feature file. Change-Id: I53bd57e2687e0d6fa2cb11bd34e19ee7eedb7969 CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 14 ++++++++++++++ core/hdd/src/wlan_hdd_lpass.h | 12 ++++++++++++ core/hdd/src/wlan_hdd_main.c | 2 +- core/hdd/src/wlan_hdd_power.c | 2 +- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index d53663b418ea..19502908be38 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -277,3 +277,17 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) hdd_ctx->target_hw_version, hdd_ctx->target_hw_name); } + +/** + * hdd_lpass_notify_stop() - Notify LPASS of driver stop + * @hdd_ctx: The global HDD context + * + * This function is used to notify the LPASS feature that the wlan + * driver has stopped + * + * Return: none + */ +void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) +{ + wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); +} diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 3d6d9b2fbf5b..3f9a7976b465 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -46,6 +46,17 @@ void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx); * Return: none */ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); + +/** + * hdd_lpass_notify_stop() - Notify LPASS of driver stop + * @hdd_ctx: The global HDD context + * + * This function is used to notify the LPASS feature that the wlan + * driver has stopped. + * + * Return: none + */ +void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); #else static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, @@ -59,6 +70,7 @@ static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) return; } static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { } +static inline void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { } #endif #endif /* WLAN_HDD_LPASS_H */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 699a5f62d2e8..78084a780c6a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4685,7 +4685,7 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx) wiphy_unregister(wiphy); wlan_hdd_cfg80211_deinit(wiphy); - wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); + hdd_lpass_notify_stop(hdd_ctx); hdd_exit_netlink_services(hdd_ctx); mutex_destroy(&hdd_ctx->iface_change_lock); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 24832518008a..a93ef0422b49 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1469,7 +1469,7 @@ QDF_STATUS hdd_wlan_shutdown(void) wlansap_global_deinit(); hdd_wlan_stop_modules(pHddCtx, true); - wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); + hdd_lpass_notify_stop(pHddCtx); hdd_alert("WLAN driver shutdown complete"); return QDF_STATUS_SUCCESS; -- cgit v1.2.3 From 2ae6f714b0aaa9676d41074bffd6c08696a5dbb9 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 15:08:48 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "interface mode change" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "interface mode change" logic such that the actual implementation is in the lpass feature file. Change-Id: I7be1719f6b0f4ed69d60dbb1c50dab63ca3d768a CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_lpass.c | 20 +++++++++++++++++++- core/hdd/src/wlan_hdd_lpass.h | 16 +++++++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 4ecc1c880ff0..42add2736949 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9268,7 +9268,7 @@ done: /* Set bitmask based on updated value */ cds_set_concurrency_mode(pAdapter->device_mode); - wlan_hdd_send_all_scan_intf_info(pHddCtx); + hdd_lpass_notify_mode_change(pAdapter); EXIT(); return 0; diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 19502908be38..4564430bb6c1 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -229,7 +229,7 @@ static void wlan_hdd_send_version_pkg(uint32_t fw_version, * * Return: none */ -void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) +static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) { hdd_adapter_t *adapter = NULL; hdd_adapter_list_node_t *node = NULL, *next = NULL; @@ -261,6 +261,24 @@ void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change + * @adapter: The adapter whose mode was changed + * + * This function is used to notify the LPASS feature that an adapter + * had its mode changed. + * + * Return: none + */ +/* implementation note: when one changes we notify them all */ +void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) +{ + struct hdd_context_s *hdd_ctx; + + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + wlan_hdd_send_all_scan_intf_info(hdd_ctx); +} + /** * hdd_lpass_notify_start() - Notify LPASS of driver start * @hdd_ctx: The global HDD context diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 3f9a7976b465..098063529ef2 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -29,12 +29,23 @@ #define WLAN_HDD_LPASS_H struct hdd_context_s; +struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, uint8_t is_on, uint8_t is_connected); -void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx); + +/** + * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change + * @adapter: The adapter whose mode was changed + * + * This function is used to notify the LPASS feature that an adapter + * had its mode changed. + * + * Return: none + */ +void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter); /** * hdd_lpass_notify_start() - Notify LPASS of driver start @@ -65,9 +76,8 @@ static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, return; } -static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx) +static inline void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) { - return; } static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { } static inline void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { } -- cgit v1.2.3 From cef59bbc3b5d2c3d379703bbc7f3a204e1c5b15b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 15:28:47 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "disconnect" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "disconnect" logic such that the actual implementation is in the lpass feature file. Change-Id: I7250582c8e0ba7423babfd6acfd23ff492d05037 CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_assoc.c | 5 +---- core/hdd/src/wlan_hdd_lpass.c | 18 ++++++++++++++++++ core/hdd/src/wlan_hdd_lpass.h | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 0c40894ec775..048cb47f333d 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1392,10 +1392,7 @@ static void hdd_send_association_event(struct net_device *dev, NULL, pAdapter->device_mode); } -#ifdef WLAN_FEATURE_LPSS - pAdapter->rssi_send = false; - wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 0); -#endif + hdd_lpass_notify_disconnect(pAdapter); #ifdef FEATURE_WLAN_TDLS hdd_info("Disassoc: Check and enable or disable TDLS state "); if ((pAdapter->device_mode == QDF_STA_MODE || diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 4564430bb6c1..9ece01e39e11 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -261,6 +261,24 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has disconnected. + * + * Return: none + */ +void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) +{ + struct hdd_station_ctx *sta_ctx; + + adapter->rssi_send = false; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 0); +} + /** * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change * @adapter: The adapter whose mode was changed diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 098063529ef2..480544af45e5 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -36,6 +36,17 @@ void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, hdd_station_ctx_t *sta_ctx, uint8_t is_on, uint8_t is_connected); +/** + * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has disconnected. + * + * Return: none + */ +void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter); + /** * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change * @adapter: The adapter whose mode was changed @@ -76,6 +87,9 @@ static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, return; } +static inline void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) +{ +} static inline void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) { } -- cgit v1.2.3 From 7139669405bdf794479cf199ad95c37d74bfc8d0 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 15:41:52 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "connect" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "connect" logic such that the actual implementation is in the lpass feature file. Change-Id: Iac7bb28cbf6c1b361cf95f1eccba507cca0d5ad3 CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 32 +++++++++++++++++++++++++++++--- core/hdd/src/wlan_hdd_lpass.h | 19 +++++++++++-------- core/hdd/src/wlan_hdd_stats.c | 14 +++++++------- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 9ece01e39e11..79bae7dfb649 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -160,9 +160,9 @@ static int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data, * * Return: none */ -void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, - hdd_station_ctx_t *sta_ctx, - uint8_t is_on, uint8_t is_connected) +static void wlan_hdd_send_status_pkg(struct hdd_adapter_s *adapter, + struct hdd_station_ctx *sta_ctx, + uint8_t is_on, uint8_t is_connected) { int ret = 0; struct wlan_status_data data; @@ -261,6 +261,32 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_notify_connect() - Notify LPASS of interface connect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has connected. + * + * Return: none + */ +void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) +{ + struct hdd_station_ctx *sta_ctx; + + /* only send once per connection */ + if (adapter->rssi_send) + return; + + /* don't send if driver is unloading */ + if (cds_is_driver_unloading()) + return; + + adapter->rssi_send = true; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 1); +} + /** * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect * @adapter: The adapter that connected diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 480544af45e5..043f305945fa 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -32,9 +32,16 @@ struct hdd_context_s; struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS -void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, - hdd_station_ctx_t *sta_ctx, - uint8_t is_on, uint8_t is_connected); +/** + * hdd_lpass_notify_connect() - Notify LPASS of interface connect + * @adapter: The adapter that connected + * + * This function is used to notify the LPASS feature that an adapter + * has connected. + * + * Return: none + */ +void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter); /** * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect @@ -80,13 +87,9 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); #else -static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter, - hdd_station_ctx_t *sta_ctx, - uint8_t is_on, uint8_t is_connected) +static inline void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) { - return; } - static inline void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) { } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 1531f1c1b0e9..1e786fbc9b83 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1700,13 +1700,13 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); #endif -#ifdef WLAN_FEATURE_LPSS - if (!pAdapter->rssi_send) { - pAdapter->rssi_send = true; - if (cds_is_driver_unloading()) - wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 1); - } -#endif + /* + * we notify connect to lpass here instead of during actual + * connect processing because rssi info is not accurate during + * actual connection. lpass will ensure the notification is + * only processed once per association. + */ + hdd_lpass_notify_connect(pAdapter); wlan_hdd_get_station_stats(pAdapter); rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags; -- cgit v1.2.3 From 9078bdcb27cf34d98c4028e36e7e23dab22ffc45 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 17:18:11 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "populate CDS config" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "populate CDS config" logic such that the actual implementation is in the lpass feature file. Change-Id: I3dada0d446a994862f70392f8ebf5911bda583da CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_ftm.c | 19 +++---------------- core/hdd/src/wlan_hdd_lpass.c | 16 ++++++++++++++++ core/hdd/src/wlan_hdd_lpass.h | 19 +++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 2 +- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index 54b90366af87..da03cf0548ca 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -48,6 +48,7 @@ #include "i_cds_packet.h" #include "cds_reg_service.h" #include "wlan_hdd_main.h" +#include "wlan_hdd_lpass.h" #include "qwlan_version.h" #include "wma_types.h" #include "cfg_api.h" @@ -56,7 +57,6 @@ #include "bmi.h" #include "ol_fw.h" #include "wlan_hdd_cfg80211.h" -#include "wlan_hdd_main.h" #include "hif.h" #endif @@ -114,18 +114,6 @@ static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len) return QDF_STATUS_SUCCESS; } -#ifdef WLAN_FEATURE_LPSS -static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, - hdd_context_t *hdd_ctx) -{ - cds_cfg->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; -} -#else -static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, - hdd_context_t *hdd_ctx) -{ } -#endif - /** * hdd_update_cds_config_ftm() - API to update cds configuration parameters * for FTM mode. @@ -138,17 +126,16 @@ int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx) { struct cds_config_info *cds_cfg; - cds_cfg = qdf_mem_malloc(sizeof(struct cds_config_info)); + cds_cfg = qdf_mem_malloc(sizeof(*cds_cfg)); if (!cds_cfg) { hdd_err("failed to allocate cds config"); return -ENOMEM; } - qdf_mem_zero(cds_cfg, sizeof(struct cds_config_info)); cds_cfg->driver_type = eDRIVER_TYPE_MFG; cds_cfg->powersave_offload_enabled = hdd_ctx->config->enablePowersaveOffload; - hdd_is_lpass_supported(cds_cfg, hdd_ctx); + hdd_lpass_populate_cds_config(cds_cfg, hdd_ctx); /* UMA is supported in hardware for performing the * frame translation 802.11 <-> 802.3 */ diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 79bae7dfb649..75d8c88f8422 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -261,6 +261,22 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_populate_cds_config() - Populate LPASS configuration + * @cds_config: CDS configuration to populate with lpass info + * @hdd_ctx: HDD global context which contains lpass information + * + * This function seeds the CDS configuration structure with + * lpass-specific information gleaned from the HDD context. + * + * Return: none + */ +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx) +{ + cds_config->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; +} + /** * hdd_lpass_notify_connect() - Notify LPASS of interface connect * @adapter: The adapter that connected diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 043f305945fa..72e47988baa5 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -28,10 +28,24 @@ #if !defined(WLAN_HDD_LPASS_H) #define WLAN_HDD_LPASS_H +struct cds_config_info; struct hdd_context_s; struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS +/** + * hdd_lpass_populate_cds_config() - Populate LPASS configuration + * @cds_config: CDS configuration to populate with lpass info + * @hdd_ctx: HDD global context which contains lpass information + * + * This function seeds the CDS configuration structure with + * lpass-specific information gleaned from the HDD context. + * + * Return: none + */ +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx); + /** * hdd_lpass_notify_connect() - Notify LPASS of interface connect * @adapter: The adapter that connected @@ -87,6 +101,11 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); #else +static inline +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx) +{ +} static inline void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) { } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 78084a780c6a..41ae952854e6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6745,7 +6745,7 @@ int hdd_update_cds_config(hdd_context_t *hdd_ctx) hdd_ra_populate_cds_config(cds_cfg, hdd_ctx); hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx); hdd_nan_populate_cds_config(cds_cfg, hdd_ctx); - + hdd_lpass_populate_cds_config(cds_cfg, hdd_ctx); cds_init_ini_config(cds_cfg); return 0; } -- cgit v1.2.3 From b8bf907c73ed0e0990079874c39e206b57b1408b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 17:39:27 -0700 Subject: qcacld-3.0: Refactor HDD "is lpass supported?" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "is lpass supported?" logic such that the actual implementation is in the lpass feature file. Change-Id: If54961eebc97951985770cdad813d6fbbc3953f9 CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 12 ++++++++++++ core/hdd/src/wlan_hdd_lpass.h | 14 ++++++++++++++ core/hdd/src/wlan_hdd_main.c | 14 +------------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 75d8c88f8422..6f750629f6b4 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -369,3 +369,15 @@ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); } + +/** + * hdd_lpass_is_supported() - Is lpass feature supported? + * @hdd_ctx: The global HDD context + * + * Return: true if feature is enabled and supported by firmware, false + * if the feature is not enabled or not supported by firmware. + */ +bool hdd_lpass_is_supported(struct hdd_context_s *hdd_ctx) +{ + return hdd_ctx->config->enable_lpass_support; +} diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 72e47988baa5..fd88036faa01 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -100,6 +100,16 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); * Return: none */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); + +/** + * hdd_lpass_is_supported() - Is lpass feature supported? + * @hdd_ctx: The global HDD context + * + * Return: true if feature is enabled and supported by firmware, false + * if the feature is not enabled or not supported by firmware. + */ +bool hdd_lpass_is_supported(struct hdd_context_s *hdd_ctx); + #else static inline void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, @@ -117,6 +127,10 @@ static inline void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) } static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { } static inline void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { } +static inline bool hdd_lpass_is_supported(struct hdd_context_s *hdd_ctx) +{ + return false; +} #endif #endif /* WLAN_HDD_LPASS_H */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 41ae952854e6..52caf0188b2a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9156,18 +9156,6 @@ void hdd_set_conparam(uint32_t con_param) curr_con_mode = con_param; } -#ifdef WLAN_FEATURE_LPSS -static inline bool hdd_is_lpass_supported(hdd_context_t *hdd_ctx) -{ - return hdd_ctx->config->enable_lpass_support; -} -#else -static inline bool hdd_is_lpass_supported(hdd_context_t *hdd_ctx) -{ - return false; -} -#endif - /** * hdd_clean_up_pre_cac_interface() - Clean up the pre cac interface * @hdd_ctx: HDD context @@ -9219,7 +9207,7 @@ static void hdd_update_ol_config(hdd_context_t *hdd_ctx) cfg.enable_uart_print = hdd_ctx->config->enablefwprint; cfg.enable_fw_log = hdd_ctx->config->enable_fw_log; cfg.enable_ramdump_collection = hdd_ctx->config->is_ramdump_enabled; - cfg.enable_lpass_support = hdd_is_lpass_supported(hdd_ctx); + cfg.enable_lpass_support = hdd_lpass_is_supported(hdd_ctx); ol_init_ini_config(ol_ctx, &cfg); } -- cgit v1.2.3 From c875e24d7edb3f1663d70f6be5644427ac81814f Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 23 Sep 2016 18:12:34 -0700 Subject: qcacld-3.0: Refactor HDD LPASS "target config" logic Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "target config" logic such that the actual implementation is in the lpass feature file. Change-Id: I2fb40fc2d0276bfad9f79f340895b7d23c8a9d5d CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 16 ++++++++++++++++ core/hdd/src/wlan_hdd_lpass.h | 18 ++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 8 +------- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 6f750629f6b4..d55b8e9e4e01 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -261,6 +261,22 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_target_config() - Handle LPASS target configuration + * @hdd_ctx: HDD global context where lpass information is stored + * @target_config: Target configuration containing lpass info + * + * This function updates the HDD context with lpass-specific + * information provided by the target. + * + * Return: none + */ +void hdd_lpass_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config) +{ + hdd_ctx->lpss_support = target_config->lpss_support; +} + /** * hdd_lpass_populate_cds_config() - Populate LPASS configuration * @cds_config: CDS configuration to populate with lpass info diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index fd88036faa01..8ecc3e782df2 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -29,10 +29,24 @@ #define WLAN_HDD_LPASS_H struct cds_config_info; +struct wma_tgt_cfg; struct hdd_context_s; struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS +/** + * hdd_lpass_target_config() - Handle LPASS target configuration + * @hdd_ctx: HDD global context where lpass information is stored + * @target_config: Target configuration containing lpass info + * + * This function updates the HDD context with lpass-specific + * information provided by the target. + * + * Return: none + */ +void hdd_lpass_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config); + /** * hdd_lpass_populate_cds_config() - Populate LPASS configuration * @cds_config: CDS configuration to populate with lpass info @@ -111,6 +125,10 @@ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); bool hdd_lpass_is_supported(struct hdd_context_s *hdd_ctx); #else +static inline void hdd_lpass_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config) +{ +} static inline void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, struct hdd_context_s *hdd_ctx) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 52caf0188b2a..4808bfd08e0d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -40,9 +40,6 @@ #include #include #include -#ifdef WLAN_FEATURE_LPSS -#include -#endif #include #include #include @@ -1448,10 +1445,7 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->max_intf_count = cfg->max_intf_count; -#ifdef WLAN_FEATURE_LPSS - hdd_ctx->lpss_support = cfg->lpss_support; -#endif - + hdd_lpass_target_config(hdd_ctx, cfg); hdd_wlan_set_egap_support(hdd_ctx, cfg); hdd_ctx->ap_arpns_support = cfg->ap_arpns_support; -- cgit v1.2.3 From 67904df7b5c0065f3c7159afe8fbd5a923050d3a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 27 Sep 2016 15:15:51 -0700 Subject: qcacld-3.0: Cleanup HDD LPASS documentation The recent set of "Refactor HDD LPASS" changes introduced a new set of public APIs. Currently these APIs have documentation entries in both the header file and in the source file. This will result in redundant entries when documentation is generated from the files. Since public APIs should document their interface and not their implementation, remove the documentaton entries in the source file, leaving just the ones in the header file. Change-Id: Idcd4c35d74dc79b0a8440b03084420f4b40ebae5 CRs-Fixed: 1070700 --- core/hdd/src/wlan_hdd_lpass.c | 74 +++++++++++-------------------------------- 1 file changed, 18 insertions(+), 56 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index d55b8e9e4e01..09cac5689c6f 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -261,15 +261,9 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } -/** +/* * hdd_lpass_target_config() - Handle LPASS target configuration - * @hdd_ctx: HDD global context where lpass information is stored - * @target_config: Target configuration containing lpass info - * - * This function updates the HDD context with lpass-specific - * information provided by the target. - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_target_config(struct hdd_context_s *hdd_ctx, struct wma_tgt_cfg *target_config) @@ -277,15 +271,9 @@ void hdd_lpass_target_config(struct hdd_context_s *hdd_ctx, hdd_ctx->lpss_support = target_config->lpss_support; } -/** +/* * hdd_lpass_populate_cds_config() - Populate LPASS configuration - * @cds_config: CDS configuration to populate with lpass info - * @hdd_ctx: HDD global context which contains lpass information - * - * This function seeds the CDS configuration structure with - * lpass-specific information gleaned from the HDD context. - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, struct hdd_context_s *hdd_ctx) @@ -293,14 +281,9 @@ void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, cds_config->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; } -/** +/* * hdd_lpass_notify_connect() - Notify LPASS of interface connect - * @adapter: The adapter that connected - * - * This function is used to notify the LPASS feature that an adapter - * has connected. - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) { @@ -319,14 +302,9 @@ void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 1); } -/** +/* * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect - * @adapter: The adapter that connected - * - * This function is used to notify the LPASS feature that an adapter - * has disconnected. - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) { @@ -337,16 +315,13 @@ void hdd_lpass_notify_disconnect(struct hdd_adapter_s *adapter) wlan_hdd_send_status_pkg(adapter, sta_ctx, 1, 0); } -/** +/* * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change - * @adapter: The adapter whose mode was changed - * - * This function is used to notify the LPASS feature that an adapter - * had its mode changed. + * (public function documented in wlan_hdd_lpass.h) * - * Return: none + * implementation note: when one interfaces changes we notify the + * state of all of the interfaces. */ -/* implementation note: when one changes we notify them all */ void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) { struct hdd_context_s *hdd_ctx; @@ -355,14 +330,9 @@ void hdd_lpass_notify_mode_change(struct hdd_adapter_s *adapter) wlan_hdd_send_all_scan_intf_info(hdd_ctx); } -/** +/* * hdd_lpass_notify_start() - Notify LPASS of driver start - * @hdd_ctx: The global HDD context - * - * This function is used to notify the LPASS feature that the wlan - * driver has (re-)started. - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { @@ -372,26 +342,18 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) hdd_ctx->target_hw_name); } -/** +/* * hdd_lpass_notify_stop() - Notify LPASS of driver stop - * @hdd_ctx: The global HDD context - * - * This function is used to notify the LPASS feature that the wlan - * driver has stopped - * - * Return: none + * (public function documented in wlan_hdd_lpass.h) */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx) { wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); } -/** +/* * hdd_lpass_is_supported() - Is lpass feature supported? - * @hdd_ctx: The global HDD context - * - * Return: true if feature is enabled and supported by firmware, false - * if the feature is not enabled or not supported by firmware. + * (public function documented in wlan_hdd_lpass.h) */ bool hdd_lpass_is_supported(struct hdd_context_s *hdd_ctx) { -- cgit v1.2.3 From a7e5eed8ffde5c2e17d50bb18e7040a8172e6533 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 28 Sep 2016 15:19:13 -0700 Subject: qcacld-3.0: Polish HDD Green AP implementation In qcacld-3.0 an attempt is being made to converge on a common set of methods for each feature. Update HDD Green AP feature to align with "__" naming. In addition relocate the embedded documentation of all public functions from the .c file to the .h file since it is the interface that should be documented and not the implementation. Change-Id: Id6478f80a85b9e7d6abd1949a136c3c8357d49e9 CRs-Fixed: 1072396 --- core/hdd/src/wlan_hdd_green_ap.c | 187 ++++++++++++++++++--------------------- core/hdd/src/wlan_hdd_green_ap.h | 89 +++++++++++++++---- core/hdd/src/wlan_hdd_hostapd.c | 8 +- core/hdd/src/wlan_hdd_main.c | 6 +- 4 files changed, 166 insertions(+), 124 deletions(-) diff --git a/core/hdd/src/wlan_hdd_green_ap.c b/core/hdd/src/wlan_hdd_green_ap.c index 2bae7fba0b72..1dccc70ae1c6 100644 --- a/core/hdd/src/wlan_hdd_green_ap.c +++ b/core/hdd/src/wlan_hdd_green_ap.c @@ -97,16 +97,16 @@ struct hdd_green_ap_ctx { }; /** - * hdd_wlan_green_ap_update() - update the current State and Event + * hdd_green_ap_update() - update the current State and Event * @hdd_ctx: Global HDD context * @state: New state * @event: New event * * Return: none */ -static void hdd_wlan_green_ap_update(struct hdd_context_s *hdd_ctx, - enum hdd_green_ap_ps_state state, - enum hdd_green_ap_event event) +static void hdd_green_ap_update(struct hdd_context_s *hdd_ctx, + enum hdd_green_ap_ps_state state, + enum hdd_green_ap_event event) { struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx; @@ -115,14 +115,13 @@ static void hdd_wlan_green_ap_update(struct hdd_context_s *hdd_ctx, } /** - * hdd_wlan_green_ap_enable() - Send Green AP configuration to firmware + * hdd_green_ap_enable() - Send Green AP configuration to firmware * @adapter: Adapter upon which Green AP is being configured * @enable: Flag which indicates if Green AP is being enabled or disabled * * Return: 0 upon success, non-zero upon failure */ -static int hdd_wlan_green_ap_enable(hdd_adapter_t *adapter, - uint8_t enable) +static int hdd_green_ap_enable(hdd_adapter_t *adapter, uint8_t enable) { int ret; @@ -136,14 +135,14 @@ static int hdd_wlan_green_ap_enable(hdd_adapter_t *adapter, } /** - * hdd_wlan_green_ap_mc() - Green AP state machine + * hdd_green_ap_mc() - Green AP state machine * @hdd_ctx: HDD global context * @event: New event being processed * * Return: none */ -static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx, - enum hdd_green_ap_event event) +static void hdd_green_ap_mc(struct hdd_context_s *hdd_ctx, + enum hdd_green_ap_event event) { struct hdd_green_ap_ctx *green_ap; hdd_adapter_t *adapter; @@ -187,9 +186,9 @@ static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx, /* Confirm that power save is enabled before doing state transitions */ if (!green_ap->ps_enable) { hdd_notice("Green-AP is disabled"); - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_IDLE_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_IDLE_STATE, + GREEN_AP_PS_WAIT_EVENT); goto done; } @@ -202,16 +201,16 @@ static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx, /* handle the green ap ps state */ switch (green_ap->ps_state) { case GREEN_AP_PS_IDLE_STATE: - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_OFF_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_OFF_STATE, + GREEN_AP_PS_WAIT_EVENT); break; case GREEN_AP_PS_OFF_STATE: if (!green_ap->num_nodes) { - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_WAIT_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_WAIT_STATE, + GREEN_AP_PS_WAIT_EVENT); qdf_mc_timer_start(&green_ap->ps_timer, green_ap->ps_delay_time); } @@ -219,44 +218,44 @@ static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx, case GREEN_AP_PS_WAIT_STATE: if (!green_ap->num_nodes) { - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_ON_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_ON_STATE, + GREEN_AP_PS_WAIT_EVENT); - hdd_wlan_green_ap_enable(adapter, 1); + hdd_green_ap_enable(adapter, 1); if (green_ap->ps_on_time) { - hdd_wlan_green_ap_update(hdd_ctx, - 0, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + 0, + GREEN_AP_PS_WAIT_EVENT); qdf_mc_timer_start(&green_ap->ps_timer, green_ap->ps_on_time); } } else { - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_OFF_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_OFF_STATE, + GREEN_AP_PS_WAIT_EVENT); } break; case GREEN_AP_PS_ON_STATE: if (green_ap->num_nodes) { - if (hdd_wlan_green_ap_enable(adapter, 0)) { + if (hdd_green_ap_enable(adapter, 0)) { hdd_err("FAILED TO SET GREEN-AP mode"); goto done; } - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_OFF_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_OFF_STATE, + GREEN_AP_PS_WAIT_EVENT); } else if ((green_ap->ps_event == GREEN_AP_PS_WAIT_EVENT) && (green_ap->ps_on_time)) { /* ps_on_time timeout, switch to ps off */ - hdd_wlan_green_ap_update(hdd_ctx, - GREEN_AP_PS_WAIT_STATE, - GREEN_AP_PS_ON_EVENT); + hdd_green_ap_update(hdd_ctx, + GREEN_AP_PS_WAIT_STATE, + GREEN_AP_PS_ON_EVENT); - if (hdd_wlan_green_ap_enable(adapter, 0)) { + if (hdd_green_ap_enable(adapter, 0)) { hdd_err("FAILED TO SET GREEN-AP mode"); goto done; } @@ -268,8 +267,8 @@ static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx, default: hdd_err("invalid state %d", green_ap->ps_state); - hdd_wlan_green_ap_update(hdd_ctx, GREEN_AP_PS_OFF_STATE, - GREEN_AP_PS_WAIT_EVENT); + hdd_green_ap_update(hdd_ctx, GREEN_AP_PS_OFF_STATE, + GREEN_AP_PS_WAIT_EVENT); break; } @@ -278,12 +277,12 @@ done: } /** - * hdd_wlan_green_ap_timer_fn() - Green AP Timer handler + * hdd_green_ap_timer_fn() - Green AP Timer handler * @ctx: Global HDD context * * Return: none */ -static void hdd_wlan_green_ap_timer_fn(void *ctx) +static void hdd_green_ap_timer_fn(void *ctx) { struct hdd_context_s *hdd_ctx = ctx; struct hdd_green_ap_ctx *green_ap; @@ -293,16 +292,16 @@ static void hdd_wlan_green_ap_timer_fn(void *ctx) green_ap = hdd_ctx->green_ap_ctx; if (green_ap) - hdd_wlan_green_ap_mc(hdd_ctx, green_ap->ps_event); + hdd_green_ap_mc(hdd_ctx, green_ap->ps_event); } /** - * hdd_wlan_green_ap_attach() - Attach Green AP context to HDD context + * hdd_green_ap_attach() - Attach Green AP context to HDD context * @hdd_ctx: Global HDD contect * * Return: QDF_STATUS_SUCCESS on success, otherwise QDF_STATUS_E_** error */ -static QDF_STATUS hdd_wlan_green_ap_attach(struct hdd_context_s *hdd_ctx) +static QDF_STATUS hdd_green_ap_attach(struct hdd_context_s *hdd_ctx) { struct hdd_green_ap_ctx *green_ap; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -325,7 +324,7 @@ static QDF_STATUS hdd_wlan_green_ap_attach(struct hdd_context_s *hdd_ctx) qdf_mc_timer_init(&green_ap->ps_timer, QDF_TIMER_TYPE_SW, - hdd_wlan_green_ap_timer_fn, hdd_ctx); + hdd_green_ap_timer_fn, hdd_ctx); error: hdd_ctx->green_ap_ctx = green_ap; @@ -335,12 +334,12 @@ error: } /** - * hdd_wlan_green_ap_deattach() - Detach Green AP context from HDD context + * hdd_green_ap_deattach() - Detach Green AP context from HDD context * @hdd_ctx: Global HDD contect * * Return: QDF_STATUS_SUCCESS on success, otherwise QDF_STATUS_E_** error */ -static QDF_STATUS hdd_wlan_green_ap_deattach(struct hdd_context_s *hdd_ctx) +static QDF_STATUS hdd_green_ap_deattach(struct hdd_context_s *hdd_ctx) { struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -373,37 +372,31 @@ done: return status; } -/** - * hdd_wlan_green_ap_init() - Initialize Green AP feature - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_init() - Initialize Green AP feature + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_init(struct hdd_context_s *hdd_ctx) { - if (!QDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_attach(hdd_ctx))) + if (!QDF_IS_STATUS_SUCCESS(hdd_green_ap_attach(hdd_ctx))) hdd_err("Failed to allocate Green-AP resource"); } -/** - * hdd_wlan_green_ap_deinit() - De-initialize Green AP feature - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_deinit() - De-initialize Green AP feature + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_deinit(struct hdd_context_s *hdd_ctx) { - if (!QDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_deattach(hdd_ctx))) + if (!QDF_IS_STATUS_SUCCESS(hdd_green_ap_deattach(hdd_ctx))) hdd_err("Cannot deallocate Green-AP resource"); } -/** - * hdd_wlan_green_ap_start_bss() - Notify Green AP of Start BSS event - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_start_bss() - Notify Green AP of Start BSS event + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_start_bss(struct hdd_context_s *hdd_ctx) { struct hdd_config *cfg = hdd_ctx->config; @@ -420,7 +413,7 @@ void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx) cfg->egap_wait_time, cfg->egap_feature_flag)) { /* EGAP is enabled, disable host GAP */ - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); goto exit; } /* fall through, if send_egap_conf_params() failed, @@ -430,9 +423,9 @@ void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx) if (!(QDF_STA_MASK & hdd_ctx->concurrency_mode) && cfg->enable2x2 && cfg->enableGreenAP) { - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_START_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_PS_START_EVENT); } else { - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); hdd_notice("Green-AP: is disabled, due to sta_concurrency: %d, enable2x2: %d, enableGreenAP: %d", QDF_STA_MASK & hdd_ctx->concurrency_mode, cfg->enable2x2, cfg->enableGreenAP); @@ -441,50 +434,44 @@ exit: return; } -/** - * hdd_wlan_green_ap_stop_bss() - Notify Green AP of Stop BSS event - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_stop_bss() - Notify Green AP of Stop BSS event + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_stop_bss(struct hdd_context_s *hdd_ctx) { - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT); } -/** - * hdd_wlan_green_ap_add_sta() - Notify Green AP of Add Station event - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_add_sta() - Notify Green AP of Add Station event + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_add_sta(struct hdd_context_s *hdd_ctx) { - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_ADD_STA_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_ADD_STA_EVENT); } -/** - * hdd_wlan_green_ap_del_sta() - Notify Green AP of Delete Station event - * @hdd_ctx: HDD global context - * - * Return: none +/* + * hdd_green_ap_del_sta() - Notify Green AP of Delete Station event + * (public function documented in wlan_hdd_green_ap.h) */ -void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx) +void hdd_green_ap_del_sta(struct hdd_context_s *hdd_ctx) { - hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_DEL_STA_EVENT); + hdd_green_ap_mc(hdd_ctx, GREEN_AP_DEL_STA_EVENT); } -/** - * hdd_wlan_set_egap_support() - helper function to set egap support flag - * @hdd_ctx: pointer to hdd context - * @param: pointer to target configuration +/* + * hdd_green_ap_target_config() - Handle Green AP target configuration + * (public function documented in wlan_hdd_green_ap.h) * - * Return: None + * Implementation notes: + * Target indicates whether or not Enhanced Green AP (EGAP) is supported */ -void hdd_wlan_set_egap_support(hdd_context_t *hdd_ctx, void *param) +void hdd_green_ap_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config) { - struct wma_tgt_cfg *cfg = (struct wma_tgt_cfg *) param; + struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx; - if (hdd_ctx && cfg) - hdd_ctx->green_ap_ctx->egap_support = cfg->egap_support; + green_ap->egap_support = target_config->egap_support; } diff --git a/core/hdd/src/wlan_hdd_green_ap.h b/core/hdd/src/wlan_hdd_green_ap.h index a688ba0222b4..f57d1bc1eb85 100644 --- a/core/hdd/src/wlan_hdd_green_ap.h +++ b/core/hdd/src/wlan_hdd_green_ap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,24 +35,79 @@ */ struct hdd_context_s; +struct wma_tgt_cfg; #ifdef FEATURE_GREEN_AP -void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx); -void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx); -void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx); -void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx); -void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx); -void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx); -void hdd_wlan_set_egap_support(struct hdd_context_s *hdd_ctx, void *param); -#else -static inline void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx) {} -static inline void hdd_wlan_set_egap_support(struct hdd_context_s *hdd_ctx, - void *param) {} +/** + * hdd_green_ap_init() - Initialize Green AP feature + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_init(struct hdd_context_s *hdd_ctx); + +/** + * hdd_green_ap_deinit() - De-initialize Green AP feature + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_deinit(struct hdd_context_s *hdd_ctx); +/** + * hdd_green_ap_start_bss() - Notify Green AP of Start BSS event + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_start_bss(struct hdd_context_s *hdd_ctx); + +/** + * hdd_green_ap_stop_bss() - Notify Green AP of Stop BSS event + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_stop_bss(struct hdd_context_s *hdd_ctx); + +/** + * hdd_green_ap_add_sta() - Notify Green AP of Add Station event + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_add_sta(struct hdd_context_s *hdd_ctx); + +/** + * hdd_green_ap_del_sta() - Notify Green AP of Delete Station event + * @hdd_ctx: HDD global context + * + * Return: none + */ +void hdd_green_ap_del_sta(struct hdd_context_s *hdd_ctx); + +/** + * hdd_green_ap_target_config() - Handle Green AP target configuration + * @hdd_ctx: HDD global context where Green AP information is stored + * @target_config: Target configuration containing Green AP info + * + * This function updates the HDD context with Green AP-specific + * information provided by the target. + * + * Return: none + */ +void hdd_green_ap_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config); +#else +static inline void hdd_green_ap_init(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_deinit(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_start_bss(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_stop_bss(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_add_sta(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_del_sta(struct hdd_context_s *hdd_ctx) {} +static inline void hdd_green_ap_target_config(struct hdd_context_s *hdd_ctx, + struct wma_tgt_cfg *target_config) +{ +} #endif /* FEATURE_GREEN_AP */ #endif /* __WLAN_HDD_GREEN_AP_H */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 2a680486c1f0..85cf180b76a7 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1108,7 +1108,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, operatingChannel); pHostapdState->bssState = BSS_START; - hdd_wlan_green_ap_start_bss(pHddCtx); + hdd_green_ap_start_bss(pHddCtx); /* Set default key index */ QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, @@ -1205,7 +1205,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_hostapd_channel_allow_suspend(pHostapdAdapter, pHddApCtx->operatingChannel); - hdd_wlan_green_ap_stop_bss(pHddCtx); + hdd_green_ap_stop_bss(pHddCtx); /* Free up Channel List incase if it is set */ sap_cleanup_channel_list( @@ -1560,7 +1560,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, chan_info, pHostapdAdapter->device_mode); } - hdd_wlan_green_ap_add_sta(pHddCtx); + hdd_green_ap_add_sta(pHddCtx); break; case eSAP_STA_DISASSOC_EVENT: @@ -1684,7 +1684,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_stop_bus_bw_compute_timer(pHostapdAdapter); } #endif - hdd_wlan_green_ap_del_sta(pHddCtx); + hdd_green_ap_del_sta(pHddCtx); break; case eSAP_WPS_PBC_PROBE_REQ_EVENT: diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4808bfd08e0d..d91259794eb6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1446,7 +1446,7 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->max_intf_count = cfg->max_intf_count; hdd_lpass_target_config(hdd_ctx, cfg); - hdd_wlan_set_egap_support(hdd_ctx, cfg); + hdd_green_ap_target_config(hdd_ctx, cfg); hdd_ctx->ap_arpns_support = cfg->ap_arpns_support; hdd_update_tgt_services(hdd_ctx, &cfg->services); @@ -4663,7 +4663,7 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx) * that requires pMac access after this. */ - hdd_wlan_green_ap_deinit(hdd_ctx); + hdd_green_ap_deinit(hdd_ctx); hdd_close_all_adapters(hdd_ctx, false); @@ -7656,7 +7656,7 @@ int hdd_wlan_startup(struct device *dev) if (ret) goto err_hdd_free_context; - hdd_wlan_green_ap_init(hdd_ctx); + hdd_green_ap_init(hdd_ctx); ret = hdd_wlan_start_modules(hdd_ctx, adapter, false); if (ret) { -- cgit v1.2.3 From 467c791c54d16a16622909e1e80d06d1da6a3570 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 30 Sep 2016 04:53:14 -0700 Subject: Release 5.1.0.28R Release 5.1.0.28R Change-Id: I76116a3cc336ab4a63346d74233851e67958a4ba CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 0efe4e5ab1ad..494ae112642e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28Q" +#define QWLAN_VERSIONSTR "5.1.0.28R" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From ebda0f2713d653da33b0d51952f83761fa085165 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Mon, 29 Aug 2016 16:05:23 +0530 Subject: qcacld-3.0: Control chan avoidance indication through vendor command qcacld-2.0 to qcacld-3.0 propagation Provide mechanism to user to enable or disable channel avoidance indication through vendor command and also control this mechanism using "gOptimizeCAevent" ini parameter. By default "gOPtimizeCAevent" ini parameter is disabled. Ini param controls the CA events based on the mode. If ini is enabled(1) then firmware will send CA events only in SAP/GO mode and it will not send any CA events in STA mode. If ini is disabled CA events are sent to host in all the modes. a. gOptimizeCAevent = 1 - When host sends ioctl(enable), FW will send "ONE" CA indication to host(though it is duplicate). - When host sends ioctl(disable), FW doesnot perform any action. - Whenever any change in CA and WLAN is SAP/P2P-GO mode, FW will send CA ind to host regardless of the ioctl status. b. gOptimizeCAevent = 0 - FW will ignore ioctl request if received. - CxM behavior will be as per the current implementation. Change-Id: I9bd81b03b97a60bb81e550068742b2fc0b776ebb CRs-Fixed: 903249 --- core/hdd/inc/wlan_hdd_cfg.h | 6 ++++++ core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_cfg.c | 7 +++++++ core/hdd/src/wlan_hdd_cfg80211.c | 9 ++++++++ core/hdd/src/wlan_hdd_cfg80211.h | 2 ++ core/hdd/src/wlan_hdd_main.c | 39 +++++++++++++++++++++++++++++++++++ core/mac/src/include/sir_params.h | 1 + core/sme/inc/sme_api.h | 2 ++ core/sme/src/common/sme_api.c | 29 ++++++++++++++++++++++++++ core/wma/inc/wma.h | 3 +++ core/wma/inc/wma_types.h | 2 ++ core/wma/src/wma_features.c | 43 +++++++++++++++++++++++++++++++++++++++ core/wma/src/wma_main.c | 3 +++ 13 files changed, 148 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 6dde98b0af33..5e34ee250f81 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3482,6 +3482,11 @@ enum dot11p_mode { #define CFG_SIFS_BURST_DURATION_MAX (12) #define CFG_SIFS_BURST_DURATION_DEFAULT (8) +/* Optimize channel avoidance indication comming from firmware */ +#define CFG_OPTIMIZE_CA_EVENT_NAME "goptimize_chan_avoid_event" +#define CFG_OPTIMIZE_CA_EVENT_DISABLE (0) +#define CFG_OPTIMIZE_CA_EVENT_ENABLE (1) +#define CFG_OPTIMIZE_CA_EVENT_DEFAULT (0) /*--------------------------------------------------------------------------- Type declarations @@ -4140,6 +4145,7 @@ struct hdd_config { bool multicast_replay_filter; /* parameter for indicating sifs burst duration to fw */ uint8_t sifs_burst_duration; + bool goptimize_chan_avoid_event; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 76be402b99a8..d649737380ff 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1866,4 +1866,6 @@ enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode); void hdd_ch_avoid_cb(void *hdd_context, void *indi_param); void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctx); +int hdd_enable_disable_ca_event(hdd_context_t *hddctx, + uint8_t set_value); #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 5bb4ad0cae1e..e28f70dfaa3e 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3970,6 +3970,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_SIFS_BURST_DURATION_DEFAULT, CFG_SIFS_BURST_DURATION_MIN, CFG_SIFS_BURST_DURATION_MAX), + REG_VARIABLE(CFG_OPTIMIZE_CA_EVENT_NAME, WLAN_PARAM_Integer, + struct hdd_config, goptimize_chan_avoid_event, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OPTIMIZE_CA_EVENT_DEFAULT, + CFG_OPTIMIZE_CA_EVENT_DISABLE, + CFG_OPTIMIZE_CA_EVENT_ENABLE), }; /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 42add2736949..e17753c2ec29 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3868,6 +3868,7 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR] = {.type = NLA_U16 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME] = {.type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND] = {.type = NLA_U8 }, }; @@ -3898,6 +3899,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, u32 modulated_dtim; u16 stats_avg_factor; u32 guard_time; + uint8_t set_value; u32 ftm_capab; QDF_STATUS status; int attr_len; @@ -4023,6 +4025,13 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, } } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND]) { + set_value = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND]); + hdd_info("set_value: %d", set_value); + ret_val = hdd_enable_disable_ca_event(hdd_ctx, set_value); + } + return ret_val; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 2a930e3c912b..c7ec0ce1a771 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2341,6 +2341,8 @@ enum qca_wlan_vendor_config { QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR, QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME, QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT, + QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS, + QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND, /* Attribute used to set scan default IEs to the driver. * * These IEs can be used by scan operations that will be initiated by diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d91259794eb6..c058df7c2544 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7765,6 +7765,13 @@ int hdd_wlan_startup(struct device *dev) qdf_mc_timer_start(&hdd_ctx->iface_change_timer, hdd_ctx->config->iface_change_wait_time * 5000); + + if (hdd_ctx->config->goptimize_chan_avoid_event) { + status = sme_enable_disable_chanavoidind_event( + hdd_ctx->hHal, 0); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("Failed to disable Chan Avoidance Indication"); + } goto success; err_debugfs_exit: @@ -9291,6 +9298,38 @@ enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode) } } +/** + * hdd_enable_disable_ca_event() - enable/disable channel avoidance event + * @hddctx: pointer to hdd context + * @set_value: enable/disable + * + * When Host sends vendor command enable, FW will send *ONE* CA ind to + * Host(even though it is duplicate). When Host send vendor command + * disable,FW doesn't perform any action. Whenever any change in + * CA *and* WLAN is in SAP/P2P-GO mode, FW sends CA ind to host. + * + * return - 0 on success, appropriate error values on failure. + */ +int hdd_enable_disable_ca_event(hdd_context_t *hddctx, uint8_t set_value) +{ + QDF_STATUS status; + + if (0 != wlan_hdd_validate_context(hddctx)) { + return -EAGAIN; + } + + if (!hddctx->config->goptimize_chan_avoid_event) { + hdd_warn("goptimize_chan_avoid_event ini param disabled"); + return -EINVAL; + } + + status = sme_enable_disable_chanavoidind_event(hddctx->hHal, set_value); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Failed to send chan avoid command to SME"); + return -EINVAL; + } + return 0; +} /* Register the module init/exit functions */ module_init(hdd_module_init); diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index ad58fab5470b..903f3a6e9500 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -630,6 +630,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_NDP_END_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 357) #define SIR_HAL_UPDATE_WEP_DEFAULT_KEY (SIR_HAL_ITC_MSG_TYPES_BEGIN + 358) +#define SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 360) #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index c82450b98fd9..9e0e659691a5 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1259,4 +1259,6 @@ QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal, enum sta_roam_policy_dfs_mode dfs_mode, bool skip_unsafe_channels, uint8_t session_id); +QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal, + uint8_t set_value); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 0af0db1425ac..44c132c10e89 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16541,6 +16541,35 @@ QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal_handle, csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_SCAN_STA_ROAM_POLICY_CHANGED); + return status; +} + +/** + * sme_enable_disable_chanavoidind_event - configure ca event ind + * @hal: handler to hal + * @set_value: enable/disable + * + * function to enable/disable chan avoidance indication + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal, + uint8_t set_value) +{ + QDF_STATUS status; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + cds_msg_t msg; + + sms_log(mac_ctx, LOG1, FL("set_value: %d"), set_value); + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_STATUS_SUCCESS == status) { + qdf_mem_zero(&msg, sizeof(cds_msg_t)); + msg.type = WMA_SEND_FREQ_RANGE_CONTROL_IND; + msg.bodyval = set_value; + status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg); + sme_release_global_lock(&mac_ctx->sme); + return status; + } return status; } diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index b82ba1f1738d..08792473b103 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -2213,3 +2213,6 @@ WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width, QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle, struct oem_data_req *oem_req); #endif + +QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle, + uint8_t val); diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 247744e10fb2..e0fe6e4eb35a 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -473,6 +473,8 @@ #define WMA_SET_PDEV_IE_REQ SIR_HAL_SET_PDEV_IE_REQ #define WMA_UPDATE_WEP_DEFAULT_KEY SIR_HAL_UPDATE_WEP_DEFAULT_KEY +#define WMA_SEND_FREQ_RANGE_CONTROL_IND SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND + /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 53b7762ddef0..b40be6ec7825 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -8175,3 +8175,46 @@ void wma_process_fw_test_cmd(WMA_HANDLE handle, return; } } + +/** + * wma_enable_disable_caevent_ind() - Issue WMI command to enable or + * disable ca event indication + * @wma: wma handler + * @val: boolean value true or false + * + * Return: QDF_STATUS + */ +QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma, uint8_t val) +{ + WMI_CHAN_AVOID_RPT_ALLOW_CMD_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint8_t *buf_ptr; + uint32_t len; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE(FL("WMA is closed, can not issue set/clear CA")); + return QDF_STATUS_E_INVAL; + } + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wma->wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE(FL("wmi_buf_alloc failed")); + return QDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + cmd = (WMI_CHAN_AVOID_RPT_ALLOW_CMD_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_WMI_CHAN_AVOID_RPT_ALLOW_CMD_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + WMI_CHAN_AVOID_RPT_ALLOW_CMD_fixed_param)); + cmd->rpt_allow = val; + if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, + WMI_CHAN_AVOID_RPT_ALLOW_CMDID)) { + WMA_LOGE(FL("Failed to send enable/disable CA event command")); + wmi_buf_free(wmi_buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 7a46b314380f..b4559cf27472 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6294,6 +6294,9 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) (struct wep_update_default_key_idx *)msg->bodyptr); qdf_mem_free(msg->bodyptr); break; + case WMA_SEND_FREQ_RANGE_CONTROL_IND: + wma_enable_disable_caevent_ind(wma_handle, msg->bodyval); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ -- cgit v1.2.3 From 705fa39ffbc9d9a5a297192334305ec3e8d3d46c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 22 Sep 2016 19:41:43 -0700 Subject: qcacld-3.0: Restore the wmi_channel_width definition Restore the wmi_channel_width enum as it is being used in FW Change-Id: I05ad89d4bb3486fdab4a71b8252ec9b5c0c7395b CRs-Fixed: 1071442 --- target/inc/wmi_unified.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index c6bc385515d8..d4546fe65add 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -4636,6 +4636,17 @@ typedef enum { WMI_MESH_STATS = 6, } wmi_link_iface_type; +/* channel operating width */ +typedef enum { + WMI_CHAN_WIDTH_20 = 0, + WMI_CHAN_WIDTH_40 = 1, + WMI_CHAN_WIDTH_80 = 2, + WMI_CHAN_WIDTH_160 = 3, + WMI_CHAN_WIDTH_80P80 = 4, + WMI_CHAN_WIDTH_5 = 5, + WMI_CHAN_WIDTH_10 = 6, +} wmi_channel_width; + /*Clear stats*/ typedef struct { A_UINT32 tlv_header; -- cgit v1.2.3 From 73fce8f09aef397f1ea6267f1426607aa22111d0 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 29 Sep 2016 13:27:15 -0700 Subject: qcacld-3.0: Abort suspend if RRM scan is pending Currently RRM scan state is not being tracked, leading to possible suspend attempts while RRM scan is pending. Set scan state information to prevent suspend while RRM scan is pending. Change-Id: I1d688f137961b4cb09d13764761c8d22709c3a43 CRs-Fixed: 1072598 --- core/wma/src/wma_scan_roam.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 11ee61b69cf4..cdbecb59d00c 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -99,6 +99,35 @@ enum extscan_report_events_type { #define WMA_EXTSCAN_CYCLE_WAKE_LOCK_DURATION (5 * 1000) /* in msec */ #endif +/** + * wma_set_scan_info() - set scan info in wma handle + * @wma_handle: wma handle + * @scan_id: scan id + * @vdev_id: vdev id + * + * Return: none + */ +static inline void wma_set_scan_info(tp_wma_handle wma_handle, + uint32_t scan_id, + uint32_t vdev_id) +{ + wma_handle->interfaces[vdev_id].scan_info.scan_id = scan_id; +} + +/** + * wma_reset_scan_info() - reset scan info from wma handle + * @wma_handle: wma handle + * @vdev_id: vdev id + * + * Return: none + */ +static inline void wma_reset_scan_info(tp_wma_handle wma_handle, + uint8_t vdev_id) +{ + qdf_mem_zero((void *)&(wma_handle->interfaces[vdev_id].scan_info), + sizeof(wma_handle->interfaces[vdev_id].scan_info)); +} + /** * wma_set_p2p_scan_info() - set p2p scan info in wma handle * @wma_handle: wma handle @@ -530,6 +559,8 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle, goto error1; } + wma_set_scan_info(wma_handle, cmd.scan_id, cmd.vdev_id); + if (scan_req->p2pScanType == P2P_SCAN_TYPE_LISTEN) wma_set_p2p_scan_info(wma_handle, cmd.scan_id, cmd.vdev_id, P2P_SCAN_TYPE_LISTEN); @@ -5638,6 +5669,12 @@ int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, scan_event->requestor = wmi_event->requestor; scan_event->chanFreq = wmi_event->channel_freq; + if (scan_event->scanId == + wma_handle->interfaces[vdev_id].scan_info.scan_id) { + if (scan_event->event == SIR_SCAN_EVENT_COMPLETED) + wma_reset_scan_info(wma_handle, vdev_id); + } + if (scan_event->scanId == wma_handle->interfaces[vdev_id].p2p_scan_info.scan_id) { scan_event->p2pScanType = P2P_SCAN_TYPE_LISTEN; -- cgit v1.2.3 From 9cee77f3ec27920e4f5471467cfcdfe18e24290a Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 22 Jun 2016 21:47:52 +0530 Subject: qcacld-3.0: Trigger Auth req(OPEN) when SHARED times out qcacld-2.0 to qcacld-3.0 propagation When the OPEN/SHARED WEP is configured, the current implementation will start Auth request with SHARED and if it fails, triggers Auth request with OPEN. This change will trigger the OPEN Auth requests when the timeout happens (no Auth response received for previous attempt i.e.AUTH req SHARED case). Some APs don't respond to Shared Auth if they support only Open. To interoperate with this kind of APs try Open Auth if Auth timeout happens with Shared Auth. Git-commit: 368b3a4eb4b4067bfff88d3dbd21371af3bb23a8 Change-Id: I28b9186b9dc238640fd7655c9ac73e8aa89aec54 CRs-Fixed: 984341 --- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 6f61dce88657..9082aecadb68 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -531,7 +531,7 @@ void lim_process_mlm_auth_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg) return; } - if (((tLimMlmAuthCnf *) msg)->resultCode == eSIR_SME_SUCCESS) { + if (auth_cnf->resultCode == eSIR_SME_SUCCESS) { if (session_entry->limSmeState == eLIM_SME_WT_AUTH_STATE) { lim_send_mlm_assoc_req(mac_ctx, session_entry); } else { @@ -568,9 +568,10 @@ void lim_process_mlm_auth_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg) } if ((auth_type == eSIR_AUTO_SWITCH) && - (((tLimMlmAuthCnf *) msg)->authType == eSIR_SHARED_KEY) - && (eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS == - ((tLimMlmAuthCnf *) msg)->protStatusCode)) { + (auth_cnf->authType == eSIR_SHARED_KEY) && + ((eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS == + auth_cnf->protStatusCode) || + (auth_cnf->resultCode == eSIR_SME_AUTH_TIMEOUT_RESULT_CODE))) { /* * When shared authentication fails with reason * code "13" and authType set to 'auto switch', @@ -634,8 +635,8 @@ void lim_process_mlm_auth_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg) * auth failure to Host. */ lim_handle_sme_join_result(mac_ctx, - ((tLimMlmAuthCnf *)msg)->resultCode, - ((tLimMlmAuthCnf *)msg)->protStatusCode, + auth_cnf->resultCode, + auth_cnf->protStatusCode, session_entry); } else { /* -- cgit v1.2.3 From cd94ec62e09c1e48da2b186996fc6f8daf5c37bf Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Thu, 29 Sep 2016 20:20:05 +0530 Subject: =?UTF-8?q?qcacld-3.0:=20CL=201647956=20=E2=80=93=20update=20fw=20?= =?UTF-8?q?common=20interface=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Propagation from qcacld-2.0 to qcacld-3.0. WMI CSA support for 5 MHz + 10 MHz Change-Id: Id9c2e5f4cd343e6cdf1ce3ff38a70a0c22da9b94 CRs-Fixed: 865207 --- target/inc/wmi_unified.h | 30 ++++++++++++++++++++++++++++++ target/inc/wmi_version.h | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index d4546fe65add..6f3284888901 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -3519,11 +3519,40 @@ typedef struct { A_UINT32 enable_cmd; } wmi_vdev_spectral_enable_cmd_fixed_param; +/* information sub element id for QSBW, expected value is 0x02 */ +#define WMI_CSA_EVENT_QSBW_ISE_ID_MASK 0x000000FF +/* length of QSBW ISE data, expected value is 0x02 */ +#define WMI_CSA_EVENT_QSBW_ISE_LEN_MASK 0x0000FF00 +/* capabilities, 0x01 for 5MHz, 0x02 for 10MHz, 0x01|0x2 for both + * (see WMI_CSA_EVENT_QSBW_ISE bitmask defs) + */ +#define WMI_CSA_EVENT_QSBW_ISE_CAP_MASK 0x00FF0000 +/* notification from AP, 0x01 for 5MHz, 0x02 for 10MHz + * (see WMI_CSA_EVENT_QSBW_ISE bitmask defs) + */ +#define WMI_CSA_EVENT_QSBW_ISE_NOTIF_MASK 0xFF000000 + +#define WMI_CSA_EVENT_QSBW_ISE_ID 0x02 +#define WMI_CSA_EVENT_QSBW_ISE_LEN 0x02 + +#define WMI_CSA_EVENT_QSBW_ISE_5M_BITMASK 0x01 +#define WMI_CSA_EVENT_QSBW_ISE_10M_BITMASK 0x02 + +#define WMI_CSA_EVENT_QSBW_ISE_CAP_5M(qsbw_ise) \ + (((qsbw_ise) >> 16) & WMI_CSA_EVENT_QSBW_ISE_5M_BITMASK) +#define WMI_CSA_EVENT_QSBW_ISE_CAP_10M(qsbw_ise) \ + (((qsbw_ise) >> 16) & WMI_CSA_EVENT_QSBW_ISE_10M_BITMASK) +#define WMI_CSA_EVENT_QSBW_ISE_NOTIF_5M(qsbw_ise) \ + (((qsbw_ise) >> 24) & WMI_CSA_EVENT_QSBW_ISE_5M_BITMASK) +#define WMI_CSA_EVENT_QSBW_ISE_NOTIF_10M(qsbw_ise) \ + (((qsbw_ise) >> 24) & WMI_CSA_EVENT_QSBW_ISE_10M_BITMASK) + typedef enum { WMI_CSA_IE_PRESENT = 0x00000001, WMI_XCSA_IE_PRESENT = 0x00000002, WMI_WBW_IE_PRESENT = 0x00000004, WMI_CSWARP_IE_PRESENT = 0x00000008, + WMI_QSBW_ISE_PRESENT = 0x00000010, } WMI_CSA_EVENT_IES_PRESENT_FLAG; /* wmi CSA receive event from beacon frame */ @@ -3541,6 +3570,7 @@ typedef struct { A_UINT32 wb_ie[2]; A_UINT32 cswarp_ie; A_UINT32 ies_present_flag; /* WMI_CSA_EVENT_IES_PRESENT_FLAG */ + A_UINT32 qsbw_ise; } wmi_csa_event_fixed_param; typedef enum { diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 4146ab4e0bcb..628ef1a9a820 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 298 +#define __WMI_REVISION_ 299 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work -- cgit v1.2.3 From fa2b2d18b014955b9a72fbe672fc7a5ccd5d3ca6 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Thu, 29 Sep 2016 20:33:43 +0530 Subject: =?UTF-8?q?qcacld-3.0:=20CL=201649677=20=E2=80=93=20update=20fw=20?= =?UTF-8?q?common=20interface=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Propagation from qcacld-2.0 to qcacld-3.0. WMI config parameters to tune the WLAN/BT OCS intervals during BT Inquiry Change-Id: I7b4965607a611ba64b5b245afd532af1ba97f99b CRs-Fixed: 865207 --- target/inc/wmi_unified.h | 28 ++++++++++++++++++++++------ target/inc/wmi_version.h | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 6f3284888901..56b618431784 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -16927,17 +16927,33 @@ typedef struct { typedef enum wmi_coex_config_type { /* config interval (arg1 BT, arg2 WLAN) for P2P + PAGE */ - WMI_COEX_CONFIG_PAGE_P2P_TDM = 1, + WMI_COEX_CONFIG_PAGE_P2P_TDM = 1, /* config interval (arg1 BT, arg2 WLAN) for STA + PAGE */ - WMI_COEX_CONFIG_PAGE_STA_TDM = 2, + WMI_COEX_CONFIG_PAGE_STA_TDM = 2, /* config interval (arg1 BT, arg2 WLAN) for SAP + PAGE */ - WMI_COEX_CONFIG_PAGE_SAP_TDM = 3, + WMI_COEX_CONFIG_PAGE_SAP_TDM = 3, /* config during WLAN connection */ - WMI_COEX_CONFIG_DURING_WLAN_CONN = 4, + WMI_COEX_CONFIG_DURING_WLAN_CONN = 4, /* config to enable/disable BTC */ - WMI_COEX_CONFIG_BTC_ENABLE = 5, + WMI_COEX_CONFIG_BTC_ENABLE = 5, /* config of COEX debug setting */ - WMI_COEX_CONFIG_COEX_DBG = 6, + WMI_COEX_CONFIG_COEX_DBG = 6, + /* + * config interval (ms units) (arg1 BT, arg2 WLAN) + * for P2P + STA + PAGE + */ + WMI_COEX_CONFIG_PAGE_P2P_STA_TDM = 7, + /* config interval (ms units) (arg1 BT, arg2 WLAN) for P2P + INQUIRY */ + WMI_COEX_CONFIG_INQUIRY_P2P_TDM = 8, + /* config interval (ms units) (arg1 BT, arg2 WLAN) for STA + INQUIRY */ + WMI_COEX_CONFIG_INQUIRY_STA_TDM = 9, + /* config interval (ms units) (arg1 BT, arg2 WLAN) for SAP + INQUIRY */ + WMI_COEX_CONFIG_INQUIRY_SAP_TDM = 10, + /* + * config interval (ms units) (arg1 BT, arg2 WLAN) for P2P + STA + + * INQUIRY + */ + WMI_COEX_CONFIG_INQUIRY_P2P_STA_TDM = 11, } WMI_COEX_CONFIG_TYPE; typedef struct { diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 628ef1a9a820..f0d6a194305d 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 299 +#define __WMI_REVISION_ 300 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work -- cgit v1.2.3 From 1ab0a3db60f0bb8e6c35b2a5e317f9e2d2d06476 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Thu, 29 Sep 2016 18:58:45 +0530 Subject: qcacld-3.0: Fix memory leak when SSR is triggered qcacld-2.0 to qcacld-3.0 propagation. Packets are not freed from cache buffer and causes memory leak in SSR case. Flush cache RX frame queue to avoid this memory leak. Change-Id: Idd9edde6fdb3b9ff3ecbe7d8139f9a66468b70af CRs-Fixed: 1051019 --- core/cds/inc/cds_api.h | 7 +++++++ core/cds/src/cds_api.c | 16 ++++++++++++++++ core/hdd/src/wlan_hdd_power.c | 3 +++ 3 files changed, 26 insertions(+) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 5f5487711488..140a453a11af 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -206,6 +206,13 @@ QDF_STATUS cds_enable(v_CONTEXT_t cds_context); QDF_STATUS cds_disable(v_CONTEXT_t cds_context); +/** + * cds_flush_cache_rx_queue() - flush cache rx queue frame + * + * Return: None + */ +void cds_flush_cache_rx_queue(void); + QDF_STATUS cds_close(v_CONTEXT_t cds_context); QDF_STATUS cds_shutdown(v_CONTEXT_t cds_context); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index a493dc34c55f..bcc146f1e1d4 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -817,6 +817,22 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context) return QDF_STATUS_SUCCESS; } +void cds_flush_cache_rx_queue(void) +{ + uint8_t sta_id; + struct ol_txrx_peer_t *peer; + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); + + for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) { + peer = ol_txrx_peer_find_by_local_id(pdev, sta_id); + if (!peer) + continue; + ol_txrx_flush_rx_frames(peer, 1); + } + return; +} + + /** * cds_get_context() - get context data area * diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index a93ef0422b49..809c4924bc3b 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1448,6 +1448,9 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_cleanup_scan_queue(pHddCtx); hdd_reset_all_adapters(pHddCtx); + /* Flush cached rx frame queue */ + cds_flush_cache_rx_queue(); + /* De-register the HDD callbacks */ hdd_deregister_cb(pHddCtx); hdd_ipa_uc_ssr_deinit(); -- cgit v1.2.3 From 478730010a2190ae8a0f7575904c3f580fc79dab Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Fri, 9 Sep 2016 13:46:09 +0530 Subject: qcacld-3.0: Add support to get bus message size qcacld-2.0 to qcacld-3.0 propagation This commit allows the upper layers to query driver for max message size between the host & firmware using vendor command. Change-Id: I21db90c854e6105f00c27dec9389f2cafd4f6508 CRs-Fixed: 965244 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_cfg80211.c | 90 ++++++++++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.h | 17 ++++++++ core/hdd/src/wlan_hdd_main.c | 2 + core/wma/inc/wma_tgt_cfg.h | 1 + core/wma/src/wma_main.c | 4 ++ 6 files changed, 115 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index d649737380ff..82ffec3376fe 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1509,6 +1509,7 @@ struct hdd_context_s { bool start_modules_in_progress; bool update_mac_addr_to_fw; struct acs_dfs_policy acs_policy; + uint16_t wmi_max_len; }; /*--------------------------------------------------------------------------- diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e17753c2ec29..434f9a366fdc 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -7513,6 +7513,88 @@ static int wlan_hdd_cfg80211_get_wakelock_stats(struct wiphy *wiphy, return ret; } +/** + * __wlan_hdd_cfg80211_get_bus_size() - Get WMI Bus size + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * This function reads wmi max bus size and fill in the skb with + * NL attributes and send up the NL event. + * Return: 0 on success; errno on failure + */ +static int +__wlan_hdd_cfg80211_get_bus_size(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + int ret_val; + struct sk_buff *skb; + uint32_t nl_buf_len; + + ENTER(); + + ret_val = wlan_hdd_validate_context(hdd_ctx); + if (ret_val) + return ret_val; + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EINVAL; + } + + hdd_info("WMI Max Bus size: %d", hdd_ctx->wmi_max_len); + + nl_buf_len = NLMSG_HDRLEN; + nl_buf_len += (sizeof(hdd_ctx->wmi_max_len) + NLA_HDRLEN); + + skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len); + if (!skb) { + hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); + return -ENOMEM; + } + + if (nla_put_u16(skb, QCA_WLAN_VENDOR_ATTR_DRV_INFO_BUS_SIZE, + hdd_ctx->wmi_max_len)) { + hdd_err("nla put failure"); + goto nla_put_failure; + } + + cfg80211_vendor_cmd_reply(skb); + + EXIT(); + + return 0; + +nla_put_failure: + kfree_skb(skb); + return -EINVAL; +} + +/** + * wlan_hdd_cfg80211_get_bus_size() - SSR Wrapper to Get Bus size + * @wiphy: wiphy structure pointer + * @wdev: Wireless device structure pointer + * @data: Pointer to the data received + * @data_len: Length of @data + * + * Return: 0 on success; errno on failure + */ +static int wlan_hdd_cfg80211_get_bus_size(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_bus_size(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + /** *__wlan_hdd_cfg80211_setband() - set band * @wiphy: Pointer to wireless phy @@ -8243,6 +8325,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_get_wakelock_stats }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_get_bus_size + }, { .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SETBAND, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index c7ec0ce1a771..f735f8ebb1de 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -383,6 +383,7 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD = 82, QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83, + QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE = 84, QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85, @@ -2875,6 +2876,22 @@ enum qca_wlan_vendor_attr_p2p_listen_offload { QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST - 1 }; +/** + * enum qca_wlan_vendor_drv_info - WLAN driver info + * @QCA_WLAN_VENDOR_ATTR_DRV_INFO_INVALID: Invalid + * @QCA_WLAN_VENDOR_ATTR_DRV_INFO_BUS_SIZE: Maximum Message size info + * between Firmware & Host. + */ +enum qca_wlan_vendor_drv_info { + QCA_WLAN_VENDOR_ATTR_DRV_INFO_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_DRV_INFO_BUS_SIZE, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_DRV_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST - 1, +}; + struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c058df7c2544..8b85b66e8820 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1482,6 +1482,8 @@ void hdd_update_tgt_cfg(void *context, void *param) if (hdd_ctx->bpf_enabled) hdd_ctx->config->maxWoWFilters = WMA_STA_WOW_DEFAULT_PTRN_MAX; + hdd_ctx->wmi_max_len = cfg->wmi_max_len; + /* Configure NAN datapath features */ hdd_nan_datapath_target_config(hdd_ctx, cfg); } diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index b49e69cd5955..7e9b68837142 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -175,5 +175,6 @@ struct wma_tgt_cfg { bool nan_datapath_enabled; #endif bool sub_20_support; + uint16_t wmi_max_len; }; #endif /* WMA_TGT_CFG_H */ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index b4559cf27472..939bd532673f 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -82,6 +82,8 @@ #define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */ +#define WMI_TLV_HEADROOM 128 + static uint32_t g_fw_wlan_feat_caps; /** @@ -4043,6 +4045,8 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) wma_update_ra_rate_limit(wma_handle, &tgt_cfg); tgt_cfg.fine_time_measurement_cap = wma_handle->fine_time_measurement_cap; + tgt_cfg.wmi_max_len = wmi_get_max_msg_len(wma_handle->wmi_handle) + - WMI_TLV_HEADROOM; wma_setup_egap_support(&tgt_cfg, wma_handle); wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg); -- cgit v1.2.3 From 7a65740e470c3e3ccd80940dd7b5aee1743ce8a3 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Wed, 7 Sep 2016 20:59:18 +0530 Subject: qcacld-3.0: Unregister wext interface, on STA interface down Host registers wext handlers, during STA interface UP. But not unregistering during interface down, lending user to issue iwpriv commands though interface is down. Unregister wext interface, by initializing wireless_handlers to NULL during interface down. Change-Id: I839d733595672c8c43e5a085ea5f1e97d98c4c31 CRs-Fixed: 1064023 --- core/hdd/src/wlan_hdd_main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8b85b66e8820..56452b1cc757 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2742,10 +2742,21 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * Return: None. */ void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, - hdd_adapter_t *adapter) + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); + if (adapter->dev) { + if (rtnl_held) + adapter->dev->wireless_handlers = NULL; + else { + rtnl_lock(); + adapter->dev->wireless_handlers = NULL; + rtnl_unlock(); + } + } + if (test_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags)) { hdd_deinit_tx_rx(adapter); clear_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags); @@ -2798,7 +2809,7 @@ void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, case QDF_P2P_CLIENT_MODE: case QDF_P2P_DEVICE_MODE: { - hdd_station_adapter_deinit(hdd_ctx, adapter); + hdd_station_adapter_deinit(hdd_ctx, adapter, rtnl_held); break; } -- cgit v1.2.3 From 5f0ff7223866ac01be220d10f4fe6cc83dfdb31e Mon Sep 17 00:00:00 2001 From: Orhan K AKYILDIZ Date: Wed, 28 Sep 2016 19:06:50 -0700 Subject: qcacld-3.0: Fix multiple adapter LRO flush issue A new adapter overwrite previous adapter information for LRO flush callback, causing LRO packets for that adapter not being flushed and sit in the LRO manager queues. LRO flush now walks through the adapter list and flushes for every LRO-enabled adapter. Change-Id: I4c882a6521759c1c8fa05b9d9be4134feabd08aa CRs-Fixed: 1072471 --- core/hdd/src/wlan_hdd_lro.c | 47 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index b1fe8f078d52..dde5d9e4fc01 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -442,20 +442,47 @@ void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, void hdd_lro_flush(void *data) { hdd_adapter_t *adapter = (hdd_adapter_t *)data; - struct hdd_lro_s *hdd_lro = &adapter->lro_info; + struct hdd_lro_s *hdd_lro; + struct hdd_context_s *ctx; + QDF_STATUS status; + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; int i; - qdf_spin_lock_bh(&hdd_lro->lro_mgr_arr_access_lock); - for (i = 0; i < adapter->lro_info.lro_mgr->max_desc; i++) { - if (adapter->lro_info.lro_mgr->lro_arr[i].active) { - hdd_lro_desc_free( - &adapter->lro_info.lro_mgr->lro_arr[i], - (void *)adapter); - lro_flush_desc(adapter->lro_info.lro_mgr, - &adapter->lro_info.lro_mgr->lro_arr[i]); + /* + * There is a more comprehensive solution that refactors + * lro_mgr in the adapter into multiple instances, that + * will replace this solution. The following is an interim + * fix. + */ + + /* Loop over all adapters and flush them all */ + ctx = (struct hdd_context_s *)cds_get_context(QDF_MODULE_ID_HDD); + if (unlikely(ctx == NULL)) { + hdd_err("%s: cannot get hdd_ctx. Flushing failed", __func__); + return; + } + + status = hdd_get_front_adapter(ctx, &adapter_node); + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + adapter = adapter_node->pAdapter; + hdd_lro = &adapter->lro_info; + if (adapter->dev->features & NETIF_F_LRO) { + qdf_spin_lock_bh(&hdd_lro->lro_mgr_arr_access_lock); + for (i = 0; i < hdd_lro->lro_mgr->max_desc; i++) { + if (hdd_lro->lro_mgr->lro_arr[i].active) { + hdd_lro_desc_free( + &hdd_lro->lro_mgr->lro_arr[i], + (void *)adapter); + lro_flush_desc( + hdd_lro->lro_mgr, + &hdd_lro->lro_mgr->lro_arr[i]); + } + } + qdf_spin_unlock_bh(&hdd_lro->lro_mgr_arr_access_lock); } + status = hdd_get_next_adapter(ctx, adapter_node, &next); + adapter_node = next; } - qdf_spin_unlock_bh(&hdd_lro->lro_mgr_arr_access_lock); } /** -- cgit v1.2.3 From 806fa4c2a73d5d576ac4233810318d0a1e6e08cf Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 3 Oct 2016 14:24:05 -0700 Subject: Release 5.1.0.28S Release 5.1.0.28S Change-Id: I0f3661f2783d1b48500f1876926398f0c7760d09 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 494ae112642e..51b08e119770 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28R" +#define QWLAN_VERSIONSTR "5.1.0.28S" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From ada729259f9fe56486ef247c590701206a61ee3e Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Thu, 29 Sep 2016 19:31:21 -0700 Subject: qcacld-3.0: clear sme open session event In failure scenario sme session id is getting reset but sme open session flag is not cleared. Due to this scan rejected from host. Clear the sme open session event in sme close failure/timeout scenario. Change-Id: I2cb91120947c38a25df508c376f0e1377717458f CRs-Fixed: 1072820 --- core/hdd/src/wlan_hdd_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 56452b1cc757..69d164663f4e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3417,8 +3417,12 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, &adapter->session_close_comp_var, msecs_to_jiffies (WLAN_WAIT_TIME_SESSIONOPENCLOSE)); - if (!rc) + if (!rc) { hdd_err("failure waiting for session_close_comp_var"); + if (adapter->device_mode == QDF_NDI_MODE) + hdd_ndp_session_end_handler(adapter); + clear_bit(SME_SESSION_OPENED, &adapter->event_flags); + } } } -- cgit v1.2.3 From def4fddd4fcb1e6b9b18255f1c9c1760340ac44a Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 3 Oct 2016 16:17:02 -0700 Subject: Release 5.1.0.28T Release 5.1.0.28T Change-Id: I4b57f8e660477f0496a8460f624ad6ac0ccae737 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 51b08e119770..2a739abcee25 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28S" +#define QWLAN_VERSIONSTR "5.1.0.28T" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 155748e7b6eab46c1bebcf75cd540c4dc5461769 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Sat, 1 Oct 2016 13:20:20 +0530 Subject: qcacld-3.0: Fix memory leak issue qcacld-2.0 to qcacld-3.0 propagation Memory should be allocated to radar_event only when radar phy event needs to be sent to WMA layer. Add changes to fix memory leak. CRs-Fixed: 1065466 Change-Id: Ia3e93ddd47913956c27487472b6a70eb68d63fd9 --- core/wma/src/wma_features.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index b40be6ec7825..84f2f6650c0b 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -7534,12 +7534,6 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, WMA_LOGE("%s:DFS- Invalid WMA handle", __func__); return -ENOENT; } - radar_event = (struct wma_dfs_radar_indication *) - qdf_mem_malloc(sizeof(struct wma_dfs_radar_indication)); - if (radar_event == NULL) { - WMA_LOGE("%s:DFS- Invalid radar_event", __func__); - return -ENOMEM; - } /* * Do not post multiple Radar events on the same channel. @@ -7552,6 +7546,12 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, if ((ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan)) || (pmac->sap.SapDfsInfo.disable_dfs_ch_switch == true)) { + radar_event = (struct wma_dfs_radar_indication *) + qdf_mem_malloc(sizeof(struct wma_dfs_radar_indication)); + if (radar_event == NULL) { + WMA_LOGE(FL("Failed to allocate memory for radar_event")); + return -ENOMEM; + } wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee; /* Indicate the radar event to HDD to stop the netif Tx queues */ wma_radar_event.chan_freq = ichan->ic_freq; -- cgit v1.2.3 From 6213c01b1b27a3255e217a9997aaeb9376bbcce8 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Fri, 2 Sep 2016 19:39:09 +0530 Subject: qcacld-3.0: Enable/disable qpower dynamically qcacld-2.0 to qcacld-3.0 propagation Add changes to support qpower dynamically using vendor command. CRs-Fixed: 1054217 Change-Id: Ibc9456c2edc4f385f637cb9e45e3f51a6a911121 --- core/hdd/inc/wlan_hdd_power.h | 3 +++ core/hdd/src/wlan_hdd_cfg80211.c | 9 +++++++- core/hdd/src/wlan_hdd_cfg80211.h | 4 ++++ core/hdd/src/wlan_hdd_power.c | 45 ++++++++++++++++++++++++++++++++++++ core/sme/inc/sme_power_save_api.h | 2 +- core/sme/src/common/sme_power_save.c | 2 +- core/wma/inc/wma_api.h | 2 +- core/wma/src/wma_power.c | 23 ++++++++++++++++++ 8 files changed, 86 insertions(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index 19536f88bd26..e173d4f517db 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -189,6 +189,9 @@ int wlan_hdd_ipv4_changed(struct notifier_block *nb, int wlan_hdd_ipv6_changed(struct notifier_block *nb, unsigned long data, void *arg); +int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, + uint8_t qpower); + #ifdef FEATURE_WLAN_DIAG_SUPPORT void hdd_wlan_suspend_resume_event(uint8_t state); #else diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 434f9a366fdc..4d438f93273d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3871,7 +3871,6 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND] = {.type = NLA_U8 }, }; - /** * __wlan_hdd_cfg80211_wifi_configuration_set() - Wifi configuration * vendor command @@ -3901,6 +3900,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, u32 guard_time; uint8_t set_value; u32 ftm_capab; + uint8_t qpower; QDF_STATUS status; int attr_len; int access_policy = 0; @@ -3949,6 +3949,13 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, ret_val = -EPERM; } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER]) { + qpower = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER]); + if (hdd_set_qpower_config(hdd_ctx, adapter, qpower) != 0) + ret_val = -EINVAL; + } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]) { stats_avg_factor = nla_get_u16( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]); diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index f735f8ebb1de..7355b4bea69d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2333,6 +2333,8 @@ enum qca_access_policy { * with access policy * @QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX: interface index for vdev specific * parameters + * @QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER: Unsigned 8bit length attribute to update + * power save config to turn off/on qpower * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config */ @@ -2381,6 +2383,8 @@ enum qca_wlan_vendor_config { * not specified, the configurations are attributed to the respective * wiphy. */ QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX, + /* Unsigned 8-bit, for setting qpower dynamically */ + QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25, /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 809c4924bc3b..7e82be6f9ae7 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2304,3 +2304,48 @@ int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, return ret; } + +/** + * hdd_set_qpower_config() - set qpower config to firmware + * @adapter: HDD adapter + * @qpower: new qpower config value + * + * Return: 0 on success; Errno on failure + */ +int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, + uint8_t qpower) +{ + QDF_STATUS qdf_status; + int status; + bool is_timer_running; + + if (!hddctx->config->enablePowersaveOffload) { + hdd_err("qpower is disabled in configuration"); + return -EINVAL; + } + if (qpower > PS_DUTY_CYCLING_QPOWER || + qpower < PS_LEGACY_NODEEPSLEEP) { + hdd_err("invalid qpower value=%d", qpower); + return -EINVAL; + } + hdd_info("updating qpower value=%d to wma", qpower); + qdf_status = wma_set_powersave_config(qpower); + if (qdf_status != QDF_STATUS_SUCCESS) { + hdd_err("failed to update qpower %d", + qdf_status); + return -EINVAL; + } + is_timer_running = sme_is_auto_ps_timer_running( + WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId); + if (!is_timer_running) { + status = wlan_hdd_set_powersave(adapter, true, 0); + + if (status != 0) { + hdd_err("failed to put device in power save mode %d", + status); + return -EINVAL; + } + } + return 0; +} diff --git a/core/sme/inc/sme_power_save_api.h b/core/sme/inc/sme_power_save_api.h index 77e2934e8a52..9cfd859bcd9f 100644 --- a/core/sme/inc/sme_power_save_api.h +++ b/core/sme/inc/sme_power_save_api.h @@ -96,7 +96,7 @@ static inline void sme_set_pno_channel_prediction(void *request_buf, {} #endif -QDF_STATUS sme_is_auto_ps_timer_running(tHalHandle hal_ctx, +bool sme_is_auto_ps_timer_running(tHalHandle hal_ctx, uint32_t session_id); #endif /* #if !defined(__SME_POWER_SAVE_API_H) */ diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index db484af101cc..8de99d434323 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -1136,7 +1136,7 @@ QDF_STATUS sme_ps_close_per_session(tHalHandle hal_ctx, uint32_t session_id) return qdf_status; } -QDF_STATUS sme_is_auto_ps_timer_running(tHalHandle hal_ctx, +bool sme_is_auto_ps_timer_running(tHalHandle hal_ctx, uint32_t session_id) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index d2bb1098c54d..951048c535b0 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -296,9 +296,9 @@ bool wma_is_p2p_lo_capable(void); QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params); QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id); QDF_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *wake_lock_stats); - void wma_process_pdev_hw_mode_trans_ind(void *wma, wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param, wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, struct sir_hw_mode_trans_ind *hw_mode_trans_ind); +QDF_STATUS wma_set_powersave_config(uint8_t val); #endif diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index afda4ddbfd13..acf4eac4fb67 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -969,6 +969,29 @@ void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req) } } +/** + * wma_set_powersave_config() - update power save config in wma + * @val: new power save value + * + * This function update qpower value in wma layer + * + * Return: QDF_STATUS_SUCCESS on success, error number otherwise + */ +QDF_STATUS wma_set_powersave_config(uint8_t val) +{ + tp_wma_handle wma_handle; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return QDF_STATUS_E_INVAL; + } + wma_handle->powersave_mode = val; + + return QDF_STATUS_SUCCESS; +} + /** * wma_enable_uapsd_mode() - enable uapsd mode in fw * @wma: wma handle -- cgit v1.2.3 From 85df7c7d2f2720a60301789549ae61ebf8cbefd0 Mon Sep 17 00:00:00 2001 From: Sriram Madhvapathi Date: Fri, 30 Sep 2016 11:35:28 +0530 Subject: qcacld-3.0: Correct the IBSS tx rate information qcacld-2.0 to qcacld-3.0 propagation GETIBSSPEERINFO(ALL) fetches IBSS peer information which includes tx rate. However, only lower 3 bytes of txRate field is relevant. Mask out irrelevant fields when passing tx rate info to the user. Change-Id: Ice0199b84899e7452bf64353c744118f109d9c14 CRs-Fixed: 1050973 --- core/hdd/src/wlan_hdd_ioctl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 91b0ebef9027..6745015e1a81 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -5058,6 +5058,11 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, tx_rate = pHddStaCtx->ibss_peer_info.peerInfoParams[idx]. txRate; + /* + * Only lower 3 bytes are rate info. Mask of the MSByte + */ + tx_rate &= 0x00FFFFFF; + rssi = pHddStaCtx->ibss_peer_info.peerInfoParams[idx]. rssi; @@ -5175,6 +5180,8 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, if (QDF_STATUS_SUCCESS == status) { uint32_t txRate = pHddStaCtx->ibss_peer_info.peerInfoParams[0].txRate; + /* Only lower 3 bytes are rate info. Mask of the MSByte */ + txRate &= 0x00FFFFFF; length = scnprintf(extra, sizeof(extra), "%d %d", (int)txRate, -- cgit v1.2.3 From b106ae5c99d730cc698b76ba1bbdabd6f40dd1d4 Mon Sep 17 00:00:00 2001 From: Deepak Dhamdhere Date: Wed, 10 Aug 2016 20:55:30 +0530 Subject: qcacld-3.0: Update default scan IE's to FW As part of MBO(Multiband Operations), host driver need to supply the default scan IEs to firmware at wifi init time using existing VDEV SET IE command. FW uses these Scan IE's in subsequent scans, .i.e. FW initiated Probe Requests. As part of this fix, receive default scan IE's from supplicant, update extended capability IE with FTM values(if ext cap IE is present), send down the scan IE's buffer to FW which would be used for subsequent FW initiated scans. Change-Id: Ia23459078d93a30c9a1715e391023ee0a1de93ee CRs-Fixed: 1039969 --- core/hdd/src/wlan_hdd_cfg80211.c | 22 ++++ core/mac/inc/sir_api.h | 28 +++++ core/mac/inc/wni_api.h | 1 + core/mac/src/pe/lim/lim_process_message_queue.c | 129 ++++++++++++++++++++++++ core/sme/inc/sme_api.h | 2 + core/sme/src/common/sme_api.c | 34 +++++++ core/wma/src/wma_features.c | 9 +- 7 files changed, 224 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 4d438f93273d..16209c795854 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3906,6 +3906,9 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, int access_policy = 0; char vendor_ie[SIR_MAC_MAX_IE_LENGTH + 2]; bool vendor_ie_present = false, access_policy_present = false; + uint16_t scan_ie_len = 0; + uint8_t *scan_ie; + ENTER_DEV(dev); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { @@ -4039,6 +4042,25 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, ret_val = hdd_enable_disable_ca_event(hdd_ctx, set_value); } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES]) { + scan_ie_len = nla_len( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES]); + hdd_info("Received default scan IE of len %d session %d device mode %d", + scan_ie_len, adapter->sessionId, + adapter->device_mode); + if (scan_ie_len && (scan_ie_len <= MAX_DEFAULT_SCAN_IE_LEN)) { + scan_ie = (uint8_t *) nla_data(tb + [QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES]); + if (adapter->device_mode == QDF_STA_MODE) { + status = sme_set_default_scan_ie(hdd_ctx->hHal, + adapter->sessionId, scan_ie, + scan_ie_len); + if (QDF_STATUS_SUCCESS != status) + ret_val = -EPERM; + } + } else + ret_val = -EPERM; + } return ret_val; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 2e478fb7af8f..585ddeb8d81f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -5361,6 +5361,34 @@ struct fw_dump_rsp { uint32_t dump_complete; }; +/** + * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added + * by default to the probe request + */ +#define DEFAULT_SCAN_IE_ID 256 + + /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */ +#define MAX_DEFAULT_SCAN_IE_LEN 1024 + + /* Extended Capabilities IE header(IE Id + IE Length) length */ +#define EXT_CAP_IE_HDR_LEN 2 + +/** + * struct hdd_default_scan_ie - HDD default scan IE structure + * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE + * @length: length of the struct hdd_default_scan_ie + * @session_id: Session Id + * @ie_len: Default scan IE length + * @ie_data: Pointer to default scan IE data + */ +struct hdd_default_scan_ie { + uint16_t message_type; + uint16_t length; + uint16_t session_id; + uint16_t ie_len; + uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN]; +}; + /** * struct vdev_ie_info - IE info * @vdev_id - vdev for which the IE is being sent diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 0e30f298e8d9..43c0c75c4eef 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -264,6 +264,7 @@ enum eWniMsgTypes { eWNI_SME_REGISTER_P2P_ACK_CB, eWNI_SME_SEND_DISASSOC_FRAME, eWNI_SME_UPDATE_ACCESS_POLICY_VENDOR_IE, + eWNI_SME_DEFAULT_SCAN_IE, eWNI_SME_MSG_TYPES_END }; diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 607b42acf9f7..4b2fe9dda9c9 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -241,6 +241,130 @@ static void lim_process_set_antenna_resp(tpAniSirGlobal mac, void *body) return; } +/** + * lim_update_default_scan_ies() - Update Extended capabilities IE(if present) + * with capabilities of Fine Time measurements(FTM) if set in driver + * + * @mac_ctx: Pointer to Global MAC structure + * @ie_data: Default Scan IE data + * @local_ie_buf: Local Scan IE data + * @local_ie_len: Pointer to length of @ie_data + * + * Return: eSIR_SUCCESS on success, eSIR_FAILURE otherwise + */ +tSirRetStatus lim_update_default_scan_ies(tpAniSirGlobal mac_ctx, + uint8_t *ie_data, uint8_t *local_ie_buf, uint16_t *local_ie_len) +{ + uint32_t dot11mode; + bool vht_enabled = false; + tDot11fIEExtCap default_scan_ext_cap = {0}, driver_ext_cap = {0}; + uint8_t ext_cap_ie_hdr[EXT_CAP_IE_HDR_LEN] = { + DOT11F_EID_EXTCAP, DOT11F_IE_EXTCAP_MAX_LEN}; + tSirRetStatus status; + + status = lim_strip_extcap_update_struct(mac_ctx, ie_data, + local_ie_len, &default_scan_ext_cap); + if (eSIR_SUCCESS != status || + (((*local_ie_len) + EXT_CAP_IE_HDR_LEN + + DOT11F_IE_EXTCAP_MAX_LEN) > MAX_DEFAULT_SCAN_IE_LEN)) { + lim_log(mac_ctx, LOGE, FL("Strip ext cap fails(%d)"), status); + return eSIR_FAILURE; + } + + qdf_mem_copy(local_ie_buf, ie_data, (*local_ie_len)); + qdf_mem_copy(local_ie_buf + (*local_ie_len), + ext_cap_ie_hdr, EXT_CAP_IE_HDR_LEN); + (*local_ie_len) += EXT_CAP_IE_HDR_LEN; + + wlan_cfg_get_int(mac_ctx, WNI_CFG_DOT11_MODE, &dot11mode); + if (IS_DOT11_MODE_VHT(dot11mode)) + vht_enabled = true; + + status = populate_dot11f_ext_cap(mac_ctx, vht_enabled, + &driver_ext_cap, NULL); + if (eSIR_SUCCESS != status) { + lim_log(mac_ctx, LOGE, FL("Update ext cap fails")); + qdf_mem_copy(local_ie_buf + (*local_ie_len), + default_scan_ext_cap.bytes, + DOT11F_IE_EXTCAP_MAX_LEN); + (*local_ie_len) += DOT11F_IE_EXTCAP_MAX_LEN; + return eSIR_SUCCESS; + } + lim_merge_extcap_struct(&driver_ext_cap, &default_scan_ext_cap); + + qdf_mem_copy(local_ie_buf + (*local_ie_len), + driver_ext_cap.bytes, DOT11F_IE_EXTCAP_MAX_LEN); + (*local_ie_len) += DOT11F_IE_EXTCAP_MAX_LEN; + return eSIR_SUCCESS; +} + +/** + * lim_process_set_default_scan_ie_request() - Process the Set default + * Scan IE request from HDD. + * @mac_ctx: Pointer to Global MAC structure + * @msg_buf: Pointer to incoming data + * + * This function receives the default scan IEs and updates the ext cap IE + * (if present) with FTM capabilities and pass the Scan IEs to WMA. + * + * Return: None + */ +static void lim_process_set_default_scan_ie_request(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{ + struct hdd_default_scan_ie *set_ie_params; + struct vdev_ie_info *wma_ie_params; + uint8_t *local_ie_buf; + uint16_t local_ie_len; + tSirMsgQ msg_q; + tSirRetStatus ret_code; + + if (!msg_buf) { + lim_log(mac_ctx, LOGE, FL("msg_buf is NULL")); + return; + } + + set_ie_params = (struct hdd_default_scan_ie *) msg_buf; + local_ie_len = set_ie_params->ie_len; + + local_ie_buf = qdf_mem_malloc(MAX_DEFAULT_SCAN_IE_LEN); + if (!local_ie_buf) { + lim_log(mac_ctx, LOGE, + FL("Scan IE Update fails due to malloc failure")); + return; + } + + if (lim_update_default_scan_ies(mac_ctx, + (uint8_t *)set_ie_params->ie_data, + local_ie_buf, &local_ie_len)) { + lim_log(mac_ctx, LOGE, FL("Update default scan IEs fails")); + goto scan_ie_send_fail; + } + + wma_ie_params = qdf_mem_malloc(sizeof(*wma_ie_params) + local_ie_len); + if (!wma_ie_params) { + lim_log(mac_ctx, LOGE, FL("fail to alloc wma_ie_params")); + goto scan_ie_send_fail; + } + wma_ie_params->vdev_id = set_ie_params->session_id; + wma_ie_params->ie_id = DEFAULT_SCAN_IE_ID; + wma_ie_params->length = local_ie_len; + wma_ie_params->data = (uint8_t *)(wma_ie_params) + + sizeof(*wma_ie_params); + qdf_mem_copy(wma_ie_params->data, local_ie_buf, local_ie_len); + + msg_q.type = WMA_SET_IE_INFO; + msg_q.bodyptr = wma_ie_params; + msg_q.bodyval = 0; + ret_code = wma_post_ctrl_msg(mac_ctx, &msg_q); + if (eSIR_SUCCESS != ret_code) { + lim_log(mac_ctx, LOGE, FL("fail to send WMA_SET_IE_INFO")); + qdf_mem_free(wma_ie_params); + } +scan_ie_send_fail: + qdf_mem_free(local_ie_buf); +} + /** * lim_process_hw_mode_trans_ind() - Process set HW mode transition indication * @mac: Global MAC pointer @@ -1895,6 +2019,11 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) qdf_mem_free((void *)msg->bodyptr); msg->bodyptr = NULL; break; + case eWNI_SME_DEFAULT_SCAN_IE: + lim_process_set_default_scan_ie_request(mac_ctx, msg->bodyptr); + qdf_mem_free((void *)msg->bodyptr); + msg->bodyptr = NULL; + break; default: qdf_mem_free((void *)msg->bodyptr); msg->bodyptr = NULL; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 9e0e659691a5..810a35d987f9 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1261,4 +1261,6 @@ QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal, uint8_t session_id); QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal, uint8_t set_value); +QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id, + uint8_t *ie_data, uint16_t ie_len); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 44c132c10e89..9eb816c34755 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16570,6 +16570,40 @@ QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal, sme_release_global_lock(&mac_ctx->sme); return status; } + return status; +} +/* + * sme_set_default_scan_ie() - API to send default scan IE to LIM + * @hal: reference to the HAL + * @session_id: current session ID + * @ie_data: Pointer to Scan IE data + * @ie_len: Length of @ie_data + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id, + uint8_t *ie_data, uint16_t ie_len) +{ + QDF_STATUS status; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + struct hdd_default_scan_ie *set_ie_params; + + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + set_ie_params = qdf_mem_malloc(sizeof(*set_ie_params)); + if (!set_ie_params) + status = QDF_STATUS_E_NOMEM; + else { + set_ie_params->message_type = eWNI_SME_DEFAULT_SCAN_IE; + set_ie_params->length = sizeof(*set_ie_params); + set_ie_params->session_id = session_id; + set_ie_params->ie_len = ie_len; + qdf_mem_copy(set_ie_params->ie_data, ie_data, ie_len); + status = cds_send_mb_message_to_mac(set_ie_params); + } + sme_release_global_lock(&mac_ctx->sme); + } + sms_log(mac_ctx, LOG1, FL("Set default scan IE status %d"), status); return status; } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 84f2f6650c0b..9a823e8c7932 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -100,6 +100,13 @@ (1 << WOW_DISASSOC_RECVD_EVENT) |\ (1 << WOW_HTT_EVENT))\ +/** + * WMA_SET_VDEV_IE_SOURCE_HOST - Flag to identify the source of VDEV SET IE + * command. The value is 0x0 for the VDEV SET IE WMI commands from mobile + * MCL platform. + */ +#define WMA_SET_VDEV_IE_SOURCE_HOST 0x0 + static const uint8_t arp_ptrn[] = {0x08, 0x06}; static const uint8_t arp_mask[] = {0xff, 0xff}; static const uint8_t ns_ptrn[] = {0x86, 0xDD}; @@ -7730,6 +7737,7 @@ QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma, cmd.length = ie_info->length; cmd.band = ie_info->band; cmd.data = ie_info->data; + cmd.ie_source = WMA_SET_VDEV_IE_SOURCE_HOST; WMA_LOGD(FL("ie_id: %d, band: %d, len: %d"), ie_info->ie_id, ie_info->band, ie_info->length); @@ -7739,7 +7747,6 @@ QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma, ret = wmi_unified_process_set_ie_info_cmd(wma->wmi_handle, &cmd); - return ret; } -- cgit v1.2.3 From 4ea106ed874cba1d0fdde2acd7a36eaed5556e08 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Fri, 5 Aug 2016 20:34:46 +0530 Subject: qcacld-3.0: Update scan request IEs with default scan IEs As part of MBO(Multiband Operations), supplicant provides default scan IEs per adapter to driver at init time which is passed to FW for future use of the IEs in FW initiated scans. However Host driver also need to save default scan IE's to use the same in driver initiated scans. For example LOWI scans request may not have MBO IE and then in that case we need to copy the MBO IE from default IE and send it in the scan request to firmware. The fix implements the following: 1) Save default scan IEs per adapter in host driver when received. 2) Compare/Update IEs in cfg80211 scan request with default scan IEs. Change-Id: I94278637ee03807104fcf85db544c6be22ec6adf CRs-Fixed: 1039969 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/inc/wlan_hdd_wext.h | 2 ++ core/hdd/src/wlan_hdd_cfg80211.c | 34 ++++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 6 ++++ core/hdd/src/wlan_hdd_scan.c | 67 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 82ffec3376fe..109cd03a0cb8 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -799,6 +799,8 @@ typedef struct hdd_scaninfo_s { /* Additional IE for scan */ tSirAddie scanAddIE; + uint8_t *default_scan_ies; + uint8_t default_scan_ies_len; /* Scan mode */ tSirScanType scan_mode; diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index eee4f440f022..8829dfa07b78 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -291,6 +291,8 @@ typedef struct ccp_freq_chan_map_s { wlan_hdd_get_vendor_oui_ie_ptr(WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE, ie, ie_len) #endif +#define wlan_hdd_get_mbo_ie_ptr(ie, ie_len) \ + wlan_hdd_get_vendor_oui_ie_ptr(MBO_OUI_TYPE, MBO_OUI_TYPE_SIZE, ie, ie_len) /* * Defines for fw_test command */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 16209c795854..f60551c32523 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3871,6 +3871,35 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND] = {.type = NLA_U8 }, }; +/** + * wlan_hdd_save_default_scan_ies() - API to store the default scan IEs + * + * @adapter: Pointer to HDD adapter + * @ie_data: Pointer to Scan IEs buffer + * @ie_len: Length of Scan IEs + * + * Return: 0 on success; error number otherwise + */ +static int wlan_hdd_save_default_scan_ies(hdd_adapter_t *adapter, + uint8_t *ie_data, uint8_t ie_len) +{ + hdd_scaninfo_t *scan_info = NULL; + scan_info = &adapter->scan_info; + + if (scan_info->default_scan_ies) { + qdf_mem_free(scan_info->default_scan_ies); + scan_info->default_scan_ies = NULL; + } + + scan_info->default_scan_ies = qdf_mem_malloc(ie_len); + if (!scan_info->default_scan_ies) + return -ENOMEM; + + memcpy(scan_info->default_scan_ies, ie_data, ie_len); + scan_info->default_scan_ies_len = ie_len; + return 0; +} + /** * __wlan_hdd_cfg80211_wifi_configuration_set() - Wifi configuration * vendor command @@ -4051,6 +4080,11 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (scan_ie_len && (scan_ie_len <= MAX_DEFAULT_SCAN_IE_LEN)) { scan_ie = (uint8_t *) nla_data(tb [QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES]); + + if (wlan_hdd_save_default_scan_ies(adapter, scan_ie, + scan_ie_len)) + hdd_err("Failed to save default scan IEs"); + if (adapter->device_mode == QDF_STA_MODE) { status = sme_set_default_scan_ie(hdd_ctx->hHal, adapter->sessionId, scan_ie, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 69d164663f4e..65d40ea06b84 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2841,6 +2841,12 @@ void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, } hdd_debugfs_exit(adapter); + + if (adapter->scan_info.default_scan_ies) { + qdf_mem_free(adapter->scan_info.default_scan_ies); + adapter->scan_info.default_scan_ies = NULL; + } + /* * The adapter is marked as closed. When hdd_wlan_exit() call returns, * the driver is almost closed and cannot handle either control diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index e05610d09846..e063008d9091 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1284,6 +1284,59 @@ static inline void wlan_hdd_copy_bssid_scan_request(tCsrScanRequest *scan_req, } #endif +/* + * wlan_hdd_update_scan_ies() - API to update the scan IEs of scan request + * with already stored default scan IEs + * + * @adapter: Pointer to HDD adapter + * @scan_info: Pointer to scan info in HDD adapter + * @scan_ie: Pointer to scan IE in scan request + * @scan_ie_len: Pointer to scan IE length in scan request + * + * Return: 0 on success; error number otherwise + */ +static int wlan_hdd_update_scan_ies(hdd_adapter_t *adapter, + hdd_scaninfo_t *scan_info, uint8_t *scan_ie, + uint8_t *scan_ie_len) +{ + uint8_t rem_len = scan_info->default_scan_ies_len; + uint8_t *temp_ie = scan_info->default_scan_ies; + uint8_t *current_ie; + uint8_t elem_id; + uint16_t elem_len; + + if (!scan_info->default_scan_ies_len || !scan_info->default_scan_ies) + return -EINVAL; + + while (rem_len >= 2) { + current_ie = temp_ie; + elem_id = *temp_ie++; + elem_len = *temp_ie++; + rem_len -= 2; + + switch (elem_id) { + case DOT11F_EID_EXTCAP: + if (!wlan_hdd_cfg80211_get_ie_ptr(scan_ie, *scan_ie_len, + DOT11F_EID_EXTCAP)) { + qdf_mem_copy(scan_ie + (*scan_ie_len), + current_ie, elem_len + 2); + (*scan_ie_len) += (elem_len + 2); + } + break; + case DOT11F_EID_WPA: + if (!wlan_hdd_get_mbo_ie_ptr(scan_ie, *scan_ie_len)) { + qdf_mem_copy(scan_ie + (*scan_ie_len), + current_ie, elem_len + 2); + (*scan_ie_len) += (elem_len + 2); + } + break; + } + temp_ie += elem_len; + rem_len -= elem_len; + } + return 0; +} + /** * __wlan_hdd_cfg80211_scan() - API to process cfg80211 scan request * @wiphy: Pointer to wiphy @@ -1545,6 +1598,11 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, request->ie_len); pScanInfo->scanAddIE.length = request->ie_len; + if (wlan_hdd_update_scan_ies(pAdapter, pScanInfo, + pScanInfo->scanAddIE.addIEdata, + (uint8_t *)&pScanInfo->scanAddIE.length)) + hdd_err("Update scan IEs with default Scan IEs failed"); + if ((QDF_STA_MODE == pAdapter->device_mode) || (QDF_P2P_CLIENT_MODE == pAdapter->device_mode) || (QDF_P2P_DEVICE_MODE == pAdapter->device_mode) @@ -1606,6 +1664,15 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, } } + } else { + if (pScanInfo->default_scan_ies && + pScanInfo->default_scan_ies_len) { + qdf_mem_copy(pScanInfo->scanAddIE.addIEdata, + pScanInfo->default_scan_ies, + pScanInfo->default_scan_ies_len); + pScanInfo->scanAddIE.length = + pScanInfo->default_scan_ies_len; + } } /* acquire the wakelock to avoid the apps suspend during the scan. To -- cgit v1.2.3 From 01741825858d3b5209e381736ef8bcb96655ffc8 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Tue, 30 Aug 2016 18:26:19 +0530 Subject: qcacld-3.0: Route RSO commands to WMA through LIM layer qcacld-2.0 to qcacld-3.0 propagation. Presently the Roam Scan Offload commands(Start/Restart/Stop etc) are all sent directly from CSR to WMA. This fix reroutes these commands to LIM and then to WMA. In LIM, ext cap IE present in assoc IE buffer of RSO command is updated with FTM[Fine Time Measurement] capabilities if set in host driver Change-Id: I86c3b93570a38329cbc6a8a31017ece172164732 CRs-fixed: 1009486 --- core/mac/inc/sir_api.h | 2 + core/mac/inc/wni_api.h | 1 + core/mac/src/pe/include/lim_api.h | 3 +- core/mac/src/pe/lim/lim_api.c | 55 ++++++++++++++++++++++ core/mac/src/pe/lim/lim_process_message_queue.c | 5 +- core/mac/src/pe/lim/lim_process_sme_req_messages.c | 53 +++++++++++++++++++++ core/sme/src/csr/csr_api_roam.c | 36 ++++++++++---- core/sme/src/csr/csr_neighbor_roam.c | 5 +- 8 files changed, 145 insertions(+), 15 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 585ddeb8d81f..90eb956de52f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2991,6 +2991,8 @@ struct roam_ext_params { }; typedef struct sSirRoamOffloadScanReq { + uint16_t message_type; + uint16_t length; bool RoamScanOffloadEnabled; bool MAWCEnabled; int8_t LookupThreshold; diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 43c0c75c4eef..264ca2e110e2 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -265,6 +265,7 @@ enum eWniMsgTypes { eWNI_SME_SEND_DISASSOC_FRAME, eWNI_SME_UPDATE_ACCESS_POLICY_VENDOR_IE, eWNI_SME_DEFAULT_SCAN_IE, + eWNI_SME_ROAM_SCAN_OFFLOAD_REQ, eWNI_SME_MSG_TYPES_END }; diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 68b5a8e85fe5..9e77bcc44fce 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -274,6 +274,7 @@ static inline void lim_fill_join_rsp_ht_caps(tpPESession session, tpSirSmeJoinRsp rsp) {} #endif - +QDF_STATUS lim_update_ext_cap_ie(tpAniSirGlobal mac_ctx, + uint8_t *ie_data, uint8_t *local_ie_buf, uint16_t *local_ie_len); /************************************************************/ #endif /* __LIM_API_H */ diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index c2d6f88c11d5..a1e05650a5c5 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -2184,3 +2184,58 @@ void lim_mon_init_session(tpAniSirGlobal mac_ptr, } psession_entry->vhtCapability = 1; } + +/** + * lim_update_ext_cap_ie() - Update Extended capabilities IE(if present) + * with capabilities of Fine Time measurements(FTM) if set in driver + * + * @mac_ctx: Pointer to Global MAC structure + * @ie_data: Default Scan IE data + * @local_ie_buf: Local Scan IE data + * @local_ie_len: Pointer to length of @ie_data + * + * Return: QDF_STATUS + */ +QDF_STATUS lim_update_ext_cap_ie(tpAniSirGlobal mac_ctx, + uint8_t *ie_data, uint8_t *local_ie_buf, uint16_t *local_ie_len) +{ + uint32_t dot11mode; + bool vht_enabled = false; + tDot11fIEExtCap default_scan_ext_cap = {0}, driver_ext_cap = {0}; + uint8_t ext_cap_ie_hdr[EXT_CAP_IE_HDR_LEN] = {0x7f, 0x9}; + tSirRetStatus status; + + status = lim_strip_extcap_update_struct(mac_ctx, ie_data, + local_ie_len, &default_scan_ext_cap); + if (eSIR_SUCCESS != status) { + lim_log(mac_ctx, LOGE, FL("Strip ext cap fails(%d)"), status); + return QDF_STATUS_E_FAILURE; + } + + qdf_mem_copy(local_ie_buf, ie_data, (*local_ie_len)); + qdf_mem_copy(local_ie_buf + (*local_ie_len), + ext_cap_ie_hdr, EXT_CAP_IE_HDR_LEN); + (*local_ie_len) += EXT_CAP_IE_HDR_LEN; + + wlan_cfg_get_int(mac_ctx, WNI_CFG_DOT11_MODE, &dot11mode); + if (IS_DOT11_MODE_VHT(dot11mode)) + vht_enabled = true; + + status = populate_dot11f_ext_cap(mac_ctx, vht_enabled, + &driver_ext_cap, NULL); + if (eSIR_SUCCESS != status) { + lim_log(mac_ctx, LOGE, FL("Failed(%d) to create ext cap IE. Use default value instead"), + status); + qdf_mem_copy(local_ie_buf + (*local_ie_len), + default_scan_ext_cap.bytes, + DOT11F_IE_EXTCAP_MAX_LEN); + (*local_ie_len) += DOT11F_IE_EXTCAP_MAX_LEN; + return QDF_STATUS_SUCCESS; + } + lim_merge_extcap_struct(&driver_ext_cap, &default_scan_ext_cap); + + qdf_mem_copy(local_ie_buf + (*local_ie_len), + driver_ext_cap.bytes, DOT11F_IE_EXTCAP_MAX_LEN); + (*local_ie_len) += DOT11F_IE_EXTCAP_MAX_LEN; + return QDF_STATUS_SUCCESS; +} diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 4b2fe9dda9c9..da2898f34181 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -334,10 +334,10 @@ static void lim_process_set_default_scan_ie_request(tpAniSirGlobal mac_ctx, return; } - if (lim_update_default_scan_ies(mac_ctx, + if (lim_update_ext_cap_ie(mac_ctx, (uint8_t *)set_ie_params->ie_data, local_ie_buf, &local_ie_len)) { - lim_log(mac_ctx, LOGE, FL("Update default scan IEs fails")); + lim_log(mac_ctx, LOGE, FL("Update ext cap IEs fails")); goto scan_ie_send_fail; } @@ -1542,6 +1542,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) #endif /* FEATURE_WLAN_ESE */ case eWNI_SME_REGISTER_MGMT_FRAME_CB: case eWNI_SME_EXT_CHANGE_CHANNEL: + case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ: case eWNI_SME_NDP_INITIATOR_REQ: case eWNI_SME_NDP_RESPONDER_REQ: case eWNI_SME_NDP_END_REQ: diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index ab01850993b3..9aea67ee0370 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4144,6 +4144,55 @@ lim_send_vdev_restart(tpAniSirGlobal pMac, } } +/** + * __lim_process_roam_scan_offload_req() - Process Roam scan offload from csr + * @mac_ctx: Pointer to Global MAC structure + * @msg_buf: Pointer to SME message buffer + * + * Return: None + */ +static void __lim_process_roam_scan_offload_req(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{ + tpPESession pe_session; + tSirMsgQ wma_msg; + tSirRetStatus status; + tSirRoamOffloadScanReq *req_buffer; + uint16_t local_ie_len; + uint8_t *local_ie_buf; + + req_buffer = (tSirRoamOffloadScanReq *)msg_buf; + pe_session = pe_find_session_by_sme_session_id(mac_ctx, + req_buffer->sessionId); + + local_ie_buf = qdf_mem_malloc(MAX_DEFAULT_SCAN_IE_LEN); + if (!local_ie_buf) { + lim_log(mac_ctx, LOGE, FL("Mem Alloc failed for local_ie_buf")); + return; + } + + local_ie_len = req_buffer->assoc_ie.length; + /* Update ext cap IE if present */ + if (local_ie_len && + !lim_update_ext_cap_ie(mac_ctx, req_buffer->assoc_ie.addIEdata, + local_ie_buf, &local_ie_len)) { + req_buffer->assoc_ie.length = local_ie_len; + qdf_mem_copy(req_buffer->assoc_ie.addIEdata, local_ie_buf, + local_ie_len); + } + qdf_mem_free(local_ie_buf); + + wma_msg.type = WMA_ROAM_SCAN_OFFLOAD_REQ; + wma_msg.bodyptr = req_buffer; + + status = wma_post_ctrl_msg(mac_ctx, &wma_msg); + if (eSIR_SUCCESS != status) { + lim_log(mac_ctx, LOGE, + FL("Posting WMA_ROAM_SCAN_OFFLOAD_REQ failed")); + qdf_mem_free(req_buffer); + } +} + static void __lim_process_sme_hide_ssid(tpAniSirGlobal pMac, uint32_t *pMsgBuf) { tpSirUpdateParams pUpdateParams; @@ -5213,6 +5262,10 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) case eWNI_SME_HIDE_SSID_REQ: __lim_process_sme_hide_ssid(pMac, pMsgBuf); break; + case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ: + __lim_process_roam_scan_offload_req(pMac, pMsgBuf); + bufConsumed = false; + break; case eWNI_SME_UPDATE_APWPSIE_REQ: __lim_process_sme_update_apwpsi_es(pMac, pMsgBuf); break; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 2be95a2bc3b2..3ab5f2697e58 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -17487,6 +17487,29 @@ bool csr_is_RSO_cmd_allowed(tpAniSirGlobal mac_ctx, uint8_t command, return ret_val; } +/* + * csr_roam_send_rso_cmd() - API to send RSO command to PE + * @mac_ctx: Pointer to global MAC structure + * @session_id: Session ID + * @request_buf: Pointer to tSirRoamOffloadScanReq + * + * Return: QDF_STATUS + */ +QDF_STATUS csr_roam_send_rso_cmd(tpAniSirGlobal mac_ctx, uint8_t session_id, + tSirRoamOffloadScanReq *request_buf) +{ + QDF_STATUS status; + request_buf->message_type = eWNI_SME_ROAM_SCAN_OFFLOAD_REQ; + request_buf->length = sizeof(*request_buf); + + status = cds_send_mb_message_to_mac(request_buf); + if (QDF_STATUS_SUCCESS != status) { + sms_log(mac_ctx, LOGE, FL("Send RSO from CSR failed")); + return status; + } + return QDF_STATUS_SUCCESS; +} + /** * csr_append_assoc_ies() - Append specific IE to assoc IE's buffer * @mac_ctx: Pointer to global mac context @@ -17599,7 +17622,6 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, uint8_t command, uint8_t reason) { uint8_t *state = NULL; - cds_msg_t msg; tSirRoamOffloadScanReq *req_buf; QDF_STATUS status = QDF_STATUS_SUCCESS; tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id); @@ -17790,17 +17812,11 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, csr_update_driver_assoc_ies(mac_ctx, session, req_buf); } - msg.type = WMA_ROAM_SCAN_OFFLOAD_REQ; - msg.reserved = 0; - msg.bodyptr = req_buf; - MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_TX_WMA_MSG, - session_id, msg.type)); - if (!QDF_IS_STATUS_SUCCESS - (cds_mq_post_message(QDF_MODULE_ID_WMA, &msg))) { + if (!QDF_IS_STATUS_SUCCESS( + csr_roam_send_rso_cmd(mac_ctx, session_id, req_buf))) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "%s: Not able to post message to WMA", + "%s: Not able to post message to PE", __func__); - qdf_mem_free(req_buf); return QDF_STATUS_E_FAILURE; } else { if (ROAM_SCAN_OFFLOAD_START == command) diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 5a04fcedb69c..e2444c4c25b5 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -1743,8 +1743,9 @@ QDF_STATUS csr_neighbor_roam_proceed_with_handoff_req(tpAniSirGlobal pMac, pNeighborRoamInfo->neighborRoamState) || (!pNeighborRoamInfo->uOsRequestedHandoff)) { sms_log(pMac, LOGE, - FL - ("Received in not CONNECTED state or uOsRequestedHandoff is not set. Ignore it")); + FL("Received in not CONNECTED state(%d) or uOsRequestedHandoff(%d) is not set. Ignore it"), + pNeighborRoamInfo->neighborRoamState, + pNeighborRoamInfo->uOsRequestedHandoff); status = QDF_STATUS_E_FAILURE; } else { /* Let's go ahead with handoff */ -- cgit v1.2.3 From 7231c5f049505c202777119f983dc98a0fba83f4 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 28 Sep 2016 12:42:33 +0530 Subject: qcacld-3.0: Implement a generic API to set session param from HDD Currently, in host driver, ssid hide which is a session specific parameter is set on reception of corresponding iwpriv command. Driver would need to handle similar cases of setting session specific parameter from HDD[ need this for setting ignore assoc disallowed parameter for MBO]. Modify the ssid hide API's to generic so that the same API can be used for setting any session specific paramater in future. Change-Id: I29c62ff4a6f6d9ed1ff4a0f31a82727eb623bfd4 CRs-Fixed: 1072081 --- core/hdd/src/wlan_hdd_hostapd.c | 10 +-- core/mac/inc/sir_api.h | 27 +++++-- core/mac/inc/wni_api.h | 2 +- core/mac/src/pe/lim/lim_process_message_queue.c | 2 +- core/mac/src/pe/lim/lim_process_sme_req_messages.c | 90 ++++++++++++++-------- core/mac/src/sys/legacy/src/utils/src/mac_trace.c | 2 +- core/sme/inc/sme_api.h | 13 ++++ core/sme/src/common/sme_api.c | 58 ++++++-------- 8 files changed, 125 insertions(+), 79 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 85cf180b76a7..de59d24f7863 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2553,13 +2553,13 @@ static __iw_softap_setparam(struct net_device *dev, case QCSAP_PARAM_HIDE_SSID: { - QDF_STATUS status = QDF_STATUS_SUCCESS; - status = - sme_hide_ssid(hHal, pHostapdAdapter->sessionId, - set_value); + QDF_STATUS status; + status = sme_update_session_param(hHal, + pHostapdAdapter->sessionId, + SIR_PARAM_SSID_HIDDEN, set_value); if (QDF_STATUS_SUCCESS != status) { hdd_err("QCSAP_PARAM_HIDE_SSID failed"); - return status; + return -EIO; } break; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 90eb956de52f..ed3a56846ed5 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2502,12 +2502,29 @@ typedef struct sSirUpdateAPWPSIEsReq { tSirAPWPSIEs APWPSIEs; } tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq; -typedef struct sSirUpdateParams { - uint16_t messageType; +/* + * enum sir_update_session_param_type - session param type + * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter + */ +enum sir_update_session_param_type { + SIR_PARAM_SSID_HIDDEN, +}; + +/* + * struct sir_update_session_param + * @message_type: SME message type + * @length: size of struct sir_update_session_param + * @session_id: Session ID + * @param_type: parameter to be updated + * @param_val: Parameter value to update + */ +struct sir_update_session_param { + uint16_t message_type; uint16_t length; - uint8_t sessionId; /* Session ID */ - uint8_t ssidHidden; /* Hide SSID */ -} tSirUpdateParams, *tpSirUpdateParams; + uint8_t session_id; + uint32_t param_type; + uint32_t param_val; +}; /** * struct sir_create_session - Used for creating session in monitor mode diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 264ca2e110e2..09f6cdb9a044 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -98,7 +98,7 @@ enum eWniMsgTypes { eWNI_SME_WPS_PBC_PROBE_REQ_IND, eWNI_SME_SET_APWPARSNIEs_REQ, eWNI_SME_UPPER_LAYER_ASSOC_CNF, - eWNI_SME_HIDE_SSID_REQ, + eWNI_SME_SESSION_UPDATE_PARAM, eWNI_SME_CHNG_MCC_BEACON_INTERVAL, eWNI_SME_REMAIN_ON_CHANNEL_REQ, eWNI_SME_REMAIN_ON_CHN_RSP, diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index da2898f34181..4f69616afeee 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1521,7 +1521,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) case eWNI_SME_GET_ASSOC_STAS_REQ: case eWNI_SME_TKIP_CNTR_MEAS_REQ: case eWNI_SME_UPDATE_APWPSIE_REQ: - case eWNI_SME_HIDE_SSID_REQ: + case eWNI_SME_SESSION_UPDATE_PARAM: case eWNI_SME_GET_WPSPBC_SESSION_REQ: case eWNI_SME_SET_APWPARSNIEs_REQ: case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 9aea67ee0370..131ce4237ff8 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4193,46 +4193,76 @@ static void __lim_process_roam_scan_offload_req(tpAniSirGlobal mac_ctx, } } -static void __lim_process_sme_hide_ssid(tpAniSirGlobal pMac, uint32_t *pMsgBuf) +/* + * lim_handle_update_ssid_hidden() - Processes SSID hidden update + * @mac_ctx: Pointer to global mac context + * @session: Pointer to PE session + * @ssid_hidden: SSID hidden value to set; 0 - Broadcast SSID, + * 1 - Disable broadcast SSID + * + * Return: None + */ +static void lim_handle_update_ssid_hidden(tpAniSirGlobal mac_ctx, + tpPESession session, uint8_t ssid_hidden) { - tpSirUpdateParams pUpdateParams; - tpPESession psessionEntry; + lim_log(mac_ctx, LOG1, FL("received HIDE_SSID message")); + if (ssid_hidden != session->ssidHidden) + session->ssidHidden = ssid_hidden; + else { + lim_log(mac_ctx, LOG1, FL("Same config already present!")); + return; + } - PELOG1(lim_log(pMac, LOG1, FL("received HIDE_SSID message"));); + /* Send vdev restart */ + lim_send_vdev_restart(mac_ctx, session, session->smeSessionId); - if (pMsgBuf == NULL) { - lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL")); + /* Update beacon */ + sch_set_fixed_beacon_fields(mac_ctx, session); + lim_send_beacon_ind(mac_ctx, session); + + return; +} + +/** + * __lim_process_sme_session_update - process SME session update msg + * + * @mac_ctx: Pointer to global mac context + * @msg_buf: Pointer to the received message buffer + * + * Return: None + */ +static void __lim_process_sme_session_update(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{ + struct sir_update_session_param *msg; + tpPESession session; + + if (!msg_buf) { + lim_log(mac_ctx, LOGE, FL("Buffer is Pointing to NULL")); return; } - pUpdateParams = (tpSirUpdateParams) pMsgBuf; + msg = (struct sir_update_session_param *) msg_buf; - psessionEntry = pe_find_session_by_sme_session_id(pMac, - pUpdateParams->sessionId); - if (psessionEntry == NULL) { - lim_log(pMac, LOGW, + session = pe_find_session_by_sme_session_id(mac_ctx, msg->session_id); + if (!session) { + lim_log(mac_ctx, LOGW, "Session does not exist for given sessionId %d", - pUpdateParams->sessionId); + msg->session_id); return; } - if (psessionEntry->ssidHidden != pUpdateParams->ssidHidden) { - /* Update the session entry */ - psessionEntry->ssidHidden = pUpdateParams->ssidHidden; - } else { - lim_log(pMac, LOG1, FL("Same config already present!")); - return; + lim_log(mac_ctx, LOG1, FL("received SME Session update for %d val %d"), + msg->param_type, msg->param_val); + switch (msg->param_type) { + case SIR_PARAM_SSID_HIDDEN: + lim_handle_update_ssid_hidden(mac_ctx, session, msg->param_val); + break; + default: + lim_log(mac_ctx, LOGE, FL("Unknown session param")); + break; } - - /* Send vdev restart */ - lim_send_vdev_restart(pMac, psessionEntry, pUpdateParams->sessionId); - - /* Update beacon */ - sch_set_fixed_beacon_fields(pMac, psessionEntry); - lim_send_beacon_ind(pMac, psessionEntry); - - return; -} /*** end __lim_process_sme_hide_ssid(tpAniSirGlobal pMac, uint32_t *pMsgBuf) ***/ +} static void __lim_process_sme_set_wparsni_es(tpAniSirGlobal pMac, uint32_t *pMsgBuf) { @@ -5259,8 +5289,8 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) lim_process_tkip_counter_measures(pMac, pMsgBuf); break; - case eWNI_SME_HIDE_SSID_REQ: - __lim_process_sme_hide_ssid(pMac, pMsgBuf); + case eWNI_SME_SESSION_UPDATE_PARAM: + __lim_process_sme_session_update(pMac, pMsgBuf); break; case eWNI_SME_ROAM_SCAN_OFFLOAD_REQ: __lim_process_roam_scan_offload_req(pMac, pMsgBuf); diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index bd6bf38e9f12..064b17423e52 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -275,7 +275,7 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_WPS_PBC_PROBE_REQ_IND); CASE_RETURN_STRING(eWNI_SME_SET_APWPARSNIEs_REQ); CASE_RETURN_STRING(eWNI_SME_UPPER_LAYER_ASSOC_CNF); - CASE_RETURN_STRING(eWNI_SME_HIDE_SSID_REQ); + CASE_RETURN_STRING(eWNI_SME_SESSION_UPDATE_PARAM); CASE_RETURN_STRING(eWNI_SME_CHNG_MCC_BEACON_INTERVAL); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHANNEL_REQ); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RSP); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 810a35d987f9..9afb984a9d78 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1263,4 +1263,17 @@ QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal, uint8_t set_value); QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id, uint8_t *ie_data, uint16_t ie_len); +/** + * sme_update_session_param() - API to update PE session param + * @hal: HAL handle for device + * @session_id: Session ID + * @param_type: Param type to be updated + * @param_val: Param value to be update + * + * Note: this setting will not persist over reboots. + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_update_session_param(tHalHandle hal, uint8_t session_id, + uint32_t param_type, uint32_t param_val); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 9eb816c34755..20e9db12667b 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -8361,55 +8361,41 @@ QDF_STATUS sme_set_tx_power(tHalHandle hHal, uint8_t sessionId, return QDF_STATUS_SUCCESS; } -/* --------------------------------------------------------------------------- - - \fn sme_hide_ssid - - \brief hide/show SSID dynamically. Note: this setting will - not persist over reboots. - - \param hHal - \param sessionId - \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID - \- return QDF_STATUS - - -------------------------------------------------------------------------------*/ -QDF_STATUS sme_hide_ssid(tHalHandle hHal, uint8_t sessionId, uint8_t ssidHidden) +QDF_STATUS sme_update_session_param(tHalHandle hal, uint8_t session_id, + uint32_t param_type, uint32_t param_val) { QDF_STATUS status = QDF_STATUS_SUCCESS; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); uint16_t len; - status = sme_acquire_global_lock(&pMac->sme); + status = sme_acquire_global_lock(&mac_ctx->sme); if (QDF_IS_STATUS_SUCCESS(status)) { - tpSirUpdateParams pMsg; - tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); + struct sir_update_session_param *msg; + tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id); - if (!pSession) { - sms_log(pMac, LOGE, FL(" session %d not found "), - sessionId); - sme_release_global_lock(&pMac->sme); - return QDF_STATUS_E_FAILURE; + if (!session) { + sms_log(mac_ctx, LOGE, FL("session %d not found"), + session_id); + sme_release_global_lock(&mac_ctx->sme); + return status; } - if (!pSession->sessionActive) + if (!session->sessionActive) QDF_ASSERT(0); - /* Create the message and send to lim */ - len = sizeof(tSirUpdateParams); - pMsg = qdf_mem_malloc(len); - if (NULL == pMsg) + len = sizeof(*msg); + msg = qdf_mem_malloc(len); + if (!msg) status = QDF_STATUS_E_NOMEM; else { - qdf_mem_set(pMsg, sizeof(tSirUpdateParams), 0); - pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; - pMsg->length = len; - /* Data starts from here */ - pMsg->sessionId = sessionId; - pMsg->ssidHidden = ssidHidden; - status = cds_send_mb_message_to_mac(pMsg); + msg->message_type = eWNI_SME_SESSION_UPDATE_PARAM; + msg->length = len; + msg->session_id = session_id; + msg->param_type = param_type; + msg->param_val = param_val; + status = cds_send_mb_message_to_mac(msg); } - sme_release_global_lock(&pMac->sme); + sme_release_global_lock(&mac_ctx->sme); } return status; } -- cgit v1.2.3 From eefe348b6946cbe5f51a9a627de693f85439cbb9 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Wed, 21 Sep 2016 18:12:59 +0530 Subject: qcacld-3.0: Store pktlog events when pktlog is enabled by default in INI Host should not honor any vendor pktlog disable command if NO vendor pktlog enable command is sent previously. Currently, vendor sends pktlog disable command without sending enable command during init and because pktlog is enabled in ini by default, Host sends the pktlog disable command to firmware which is not as expected. To fix this, host uses reserved flag in wifi_start_log to distinguish vendor command from iwpriv or pktlog conf tool command and vendor disable pktlog command will be sent to firmware only when vendor pktlog enable commands is sent previously. Moreover, pktlog INI enable by default and Pktlog buffer size are now controlled using a macro FEATURE_PKTLOG depending on build variant. For production/user build, pktlog is default disable and buffer size is 1 MB, whereas for dev build, pktlog is default enable and buffer size is 10 MB. Change-Id: If64cd522e91cbe9a6d94d8626eb758282fcfd1bd CRs-Fixed: 1072584 --- Kbuild | 5 +++++ core/hdd/inc/wlan_hdd_cfg.h | 6 ++++++ core/hdd/src/wlan_hdd_cfg80211.c | 4 ++-- core/hdd/src/wlan_hdd_main.c | 10 +++++++++- core/mac/inc/sir_api.h | 4 ++-- core/sme/src/common/sme_api.c | 2 +- core/utils/pktlog/include/pktlog_ac.h | 8 +++++--- core/utils/pktlog/include/pktlog_ac_i.h | 6 +++++- core/utils/pktlog/linux_ac.c | 11 ++++++++++- core/utils/pktlog/pktlog_ac.c | 18 +++++++++++++++++- core/wma/src/wma_main.c | 6 ++++-- 11 files changed, 66 insertions(+), 14 deletions(-) diff --git a/Kbuild b/Kbuild index bb06e84311eb..3fc0b7227418 100644 --- a/Kbuild +++ b/Kbuild @@ -65,6 +65,7 @@ ifeq ($(KERNEL_BUILD), 0) # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT # config. ifneq ($(TARGET_BUILD_VARIANT),user) + CONFIG_FEATURE_PKTLOG := y ifeq ($(CONFIG_SLUB_DEBUG_ON),y) CONFIG_FEATURE_DP_TRACE := y else @@ -1114,6 +1115,10 @@ ifeq ($(CONFIG_WLAN_FASTPATH), y) CDEFINES += -DWLAN_FEATURE_FASTPATH endif +ifeq ($(CONFIG_FEATURE_PKTLOG), y) +CDEFINES += -DFEATURE_PKTLOG +endif + ifeq ($(CONFIG_FEATURE_DP_TRACE), y) CDEFINES += -DFEATURE_DP_TRACE endif diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 5e34ee250f81..bd3017f9b3a1 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1246,7 +1246,13 @@ typedef enum { #define CFG_ENABLE_PACKET_LOG "gEnablePacketLog" #define CFG_ENABLE_PACKET_LOG_MIN (0) #define CFG_ENABLE_PACKET_LOG_MAX (1) +#ifdef FEATURE_PKTLOG #define CFG_ENABLE_PACKET_LOG_DEFAULT (1) +#else +#define CFG_ENABLE_PACKET_LOG_DEFAULT (0) +#endif + + /* gFwDebugLogType takes values from enum dbglog_process_t, * make default value as DBGLOG_PROCESS_NET_RAW to give the diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f60551c32523..c534a7dd8e39 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4203,9 +4203,9 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy, hdd_err("attr flag failed"); return -EINVAL; } - start_log.flag = nla_get_u32( + start_log.is_iwpriv_command = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]); - hdd_info("flag=%d", start_log.flag); + hdd_info("is_iwpriv_command =%d", start_log.is_iwpriv_command); cds_set_ring_log_level(start_log.ring_id, start_log.verbose_level); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 65d40ea06b84..33f9cfc6a96d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6913,7 +6913,15 @@ int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable, enable ? WLAN_LOG_LEVEL_ACTIVE : WLAN_LOG_LEVEL_OFF; start_log.ini_triggered = cds_is_packet_log_enabled(); start_log.user_triggered = user_triggered; - + /* + * Use "is_iwpriv_command" flag to distinguish iwpriv command from other + * commands. Host uses this flag to decide whether to send pktlog + * disable command to fw without sending pktlog enable command + * previously. For eg, If vendor sends pktlog disable command without + * sending pktlog enable command, then host discards the packet + * but for iwpriv command, host will send it to fw. + */ + start_log.is_iwpriv_command = 1; status = sme_wifi_start_logger(hdd_ctx->hHal, start_log); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("sme_wifi_start_logger failed(err=%d)", status); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index ed3a56846ed5..43b6ccd0d892 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3219,14 +3219,14 @@ typedef struct { * @name: Attribute which indicates the type of logging like per packet * statistics, connectivity etc. * @verbose_level: Verbose level which can be 0,1,2,3 - * @flag: Flag field for future use + * @is_iwpriv_command: Set 1 for iwpriv command * @ini_triggered: triggered using ini * @user_triggered: triggered by user */ struct sir_wifi_start_log { uint32_t ring_id; uint32_t verbose_level; - uint32_t flag; + uint32_t is_iwpriv_command; bool ini_triggered; uint8_t user_triggered; }; diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 20e9db12667b..1a04362b8549 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -14672,7 +14672,7 @@ QDF_STATUS sme_wifi_start_logger(tHalHandle hal, qdf_mem_zero(req_msg, len); req_msg->verbose_level = start_log.verbose_level; - req_msg->flag = start_log.flag; + req_msg->is_iwpriv_command = start_log.is_iwpriv_command; req_msg->ring_id = start_log.ring_id; req_msg->ini_triggered = start_log.ini_triggered; req_msg->user_triggered = start_log.user_triggered; diff --git a/core/utils/pktlog/include/pktlog_ac.h b/core/utils/pktlog/include/pktlog_ac.h index 9d213e0c76bb..a7fcf493a98b 100644 --- a/core/utils/pktlog/include/pktlog_ac.h +++ b/core/utils/pktlog/include/pktlog_ac.h @@ -72,7 +72,8 @@ wdi_pktlog_unsubscribe(struct ol_txrx_pdev_t *txrx_pdev, uint32_t log_state); struct ol_pl_arch_dep_funcs { void (*pktlog_init)(struct hif_opaque_softc *scn); int (*pktlog_enable)(struct hif_opaque_softc *scn, int32_t log_state, - bool ini, uint8_t user); + bool ini, uint8_t user, + uint32_t is_iwpriv_command); int (*pktlog_setsize)(struct hif_opaque_softc *scn, int32_t log_state); int (*pktlog_disable)(struct hif_opaque_softc *scn); }; @@ -104,6 +105,7 @@ struct ol_pktlog_dev_t { uint32_t htc_err_cnt; uint8_t htc_endpoint; void *htc_pdev; + bool vendor_cmd_send; }; #define PKTLOG_SYSCTL_SIZE 14 @@ -131,7 +133,7 @@ void pktlog_callback(void *pdev, enum WDI_EVENT event, void *log_data); void pktlog_init(struct hif_opaque_softc *scn); int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, - bool, uint8_t); + bool, uint8_t, uint32_t); int pktlog_setsize(struct hif_opaque_softc *scn, int32_t log_state); int pktlog_disable(struct hif_opaque_softc *scn); int pktlogmod_init(void *context); @@ -161,7 +163,7 @@ static inline void pktlog_init(struct hif_opaque_softc *scn) return; } static int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, - bool ini, uint8_t user) + bool ini, uint8_t user, uint32_t is_iwpriv_command) { return 0; } diff --git a/core/utils/pktlog/include/pktlog_ac_i.h b/core/utils/pktlog/include/pktlog_ac_i.h index 78fd0ebd26f3..15b83d35ce8b 100644 --- a/core/utils/pktlog/include/pktlog_ac_i.h +++ b/core/utils/pktlog/include/pktlog_ac_i.h @@ -32,7 +32,11 @@ #include #include -#define PKTLOG_DEFAULT_BUFSIZE (1024 * 1024) +#ifdef FEATURE_PKTLOG +#define PKTLOG_DEFAULT_BUFSIZE (10 * 1024 * 1024) /* 10MB */ +#else +#define PKTLOG_DEFAULT_BUFSIZE (1 * 1024 * 1024) /* 1MB */ +#endif #define PKTLOG_DEFAULT_SACK_THR 3 #define PKTLOG_DEFAULT_TAIL_LENGTH 100 #define PKTLOG_DEFAULT_THRUPUT_THRESH (64 * 1024) diff --git a/core/utils/pktlog/linux_ac.c b/core/utils/pktlog/linux_ac.c index b92de81f683d..f885d6672038 100644 --- a/core/utils/pktlog/linux_ac.c +++ b/core/utils/pktlog/linux_ac.c @@ -232,7 +232,7 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos) if (ret == 0) ret = pl_dev->pl_funcs->pktlog_enable( (struct hif_opaque_softc *)scn, enable, - cds_is_packet_log_enabled(), 0); + cds_is_packet_log_enabled(), 0, 1); else printk(PKTLOG_TAG "%s:proc_dointvec failed\n", __func__); @@ -440,6 +440,7 @@ static int pktlog_attach(struct hif_opaque_softc *scn) * might be good to move to pktlog_init */ /* pl_dev->tgt_pktlog_alloced = false; */ + pl_dev->vendor_cmd_send = false; pl_info_lnx->proc_entry = NULL; pl_info_lnx->sysctl_header = NULL; @@ -848,6 +849,14 @@ pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos) if (log_buf == NULL) return 0; + if (pl_info->log_state) { + /* Read is not allowed when write is going on + * When issuing cat command, ensure to send + * pktlog disable command first. + */ + return -EINVAL; + } + if (*ppos == 0 && pl_info->log_state) { pl_info->saved_state = pl_info->log_state; pl_info->log_state = 0; diff --git a/core/utils/pktlog/pktlog_ac.c b/core/utils/pktlog/pktlog_ac.c index db6284871bc4..dc7d0927fcb6 100644 --- a/core/utils/pktlog/pktlog_ac.c +++ b/core/utils/pktlog/pktlog_ac.c @@ -355,6 +355,7 @@ void pktlog_init(struct hif_opaque_softc *scn) pl_info->pktlen = 0; pl_info->start_time_thruput = 0; pl_info->start_time_per = 0; + pdev_txrx_handle->pl_dev->vendor_cmd_send = false; PKTLOG_TX_SUBSCRIBER.callback = pktlog_callback; PKTLOG_RX_SUBSCRIBER.callback = pktlog_callback; @@ -365,7 +366,8 @@ void pktlog_init(struct hif_opaque_softc *scn) } int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, - bool ini_triggered, uint8_t user_triggered) + bool ini_triggered, uint8_t user_triggered, + uint32_t is_iwpriv_command) { struct ol_pktlog_dev_t *pl_dev; struct ath_pktlog_info *pl_info; @@ -397,6 +399,15 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, if (!pl_info) return 0; + /* is_iwpriv_command : 0 indicates its a vendor command + * log_state: 0 indicates pktlog disable command + * vendor_cmd_send flag; false means no vendor pktlog enable + * command was sent previously + */ + if (is_iwpriv_command == 0 && log_state == 0 && + pl_dev->vendor_cmd_send == false) + return 0; + if (!pl_dev->tgt_pktlog_alloced) { if (pl_info->buf == NULL) { error = pktlog_alloc_buf(scn); @@ -442,8 +453,13 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, printk("Device cannot be enabled, %s\n", __func__); return -1; } + + if (is_iwpriv_command == 0) + pl_dev->vendor_cmd_send = true; } else { pl_dev->pl_funcs->pktlog_disable(scn); + if (is_iwpriv_command == 0) + pl_dev->vendor_cmd_send = false; } pl_info->log_state = log_state; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 939bd532673f..35cf0b88b049 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5441,11 +5441,13 @@ void wma_set_wifi_start_packet_stats(void *wma_handle, if (start_log->verbose_level == WLAN_LOG_LEVEL_ACTIVE) { pktlog_enable(scn, log_state, start_log->ini_triggered, - start_log->user_triggered); + start_log->user_triggered, + start_log->is_iwpriv_command); WMA_LOGI("%s: Enabling per packet stats", __func__); } else { pktlog_enable(scn, 0, start_log->ini_triggered, - start_log->user_triggered); + start_log->user_triggered, + start_log->is_iwpriv_command); WMA_LOGI("%s: Disabling per packet stats", __func__); } } -- cgit v1.2.3 From 29df362726711974a43d3cb1346672a59b93f39b Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Tue, 16 Aug 2016 19:15:16 +0530 Subject: qcacld-3.0: Add ini control to honor power constraint qcacld-2.0 to qcacld-3.0 propagation Add changes to honor power constraint based on ini. Also, enhance logging for power sent to fw. Change-Id: Iefd497d76076527ca4c388cade46644a88a51932 CRs-Fixed: 1016876 --- core/hdd/inc/wlan_hdd_cfg.h | 7 ++ core/hdd/src/wlan_hdd_cfg.c | 11 ++++ core/mac/src/pe/lim/lim_process_sme_req_messages.c | 8 +-- core/mac/src/pe/lim/lim_prop_exts_utils.c | 56 ++++++++++++---- core/mac/src/pe/sch/sch_beacon_process.c | 74 ++++++++++++++-------- core/sme/inc/csr_api.h | 1 + core/sme/inc/csr_internal.h | 1 + core/sme/src/csr/csr_api_roam.c | 4 ++ core/wma/src/wma_dev_if.c | 3 + core/wma/src/wma_power.c | 4 +- core/wma/src/wma_scan_roam.c | 2 +- 11 files changed, 123 insertions(+), 48 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index bd3017f9b3a1..146f5955bb65 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -515,6 +515,12 @@ typedef enum { /* Not to use CFG default because if no registry setting, this is ignored by SME. */ #define CFG_MAX_TX_POWER_DEFAULT WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX +/* This ini controls driver to honor/dishonor power constraint from AP */ +#define CFG_TX_POWER_CTRL_NAME "gAllowTPCfromAP" +#define CFG_TX_POWER_CTRL_DEFAULT (1) +#define CFG_TX_POWER_CTRL_MIN (0) +#define CFG_TX_POWER_CTRL_MAX (1) + #define CFG_LOW_GAIN_OVERRIDE_NAME "gLowGainOverride" #define CFG_LOW_GAIN_OVERRIDE_MIN WNI_CFG_LOW_GAIN_OVERRIDE_STAMIN #define CFG_LOW_GAIN_OVERRIDE_MAX WNI_CFG_LOW_GAIN_OVERRIDE_STAMAX @@ -3550,6 +3556,7 @@ struct hdd_config { uint32_t goLinkMonitorPeriod; uint32_t nBeaconInterval; uint8_t nTxPowerCap; /* In dBm */ + bool allow_tpc_from_ap; bool fIsLowGainOverride; uint8_t disablePacketFilter; bool fRrmEnable; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index e28f70dfaa3e..f04be9d50f7a 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -836,6 +836,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_MAX_TX_POWER_MIN, CFG_MAX_TX_POWER_MAX), + REG_VARIABLE(CFG_TX_POWER_CTRL_NAME, WLAN_PARAM_Integer, + struct hdd_config, allow_tpc_from_ap, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_POWER_CTRL_DEFAULT, + CFG_TX_POWER_CTRL_MIN, + CFG_TX_POWER_CTRL_MAX), + REG_VARIABLE(CFG_LOW_GAIN_OVERRIDE_NAME, WLAN_PARAM_Integer, struct hdd_config, fIsLowGainOverride, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -4951,6 +4958,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) "Name = [gTxPowerCap] Value = [%u] dBm ", pHddCtx->config->nTxPowerCap); #endif + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, + "Name = [gAllowTPCfromAP] Value = [%u] ", + pHddCtx->config->allow_tpc_from_ap); QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, "Name = [FastRoamEnabled] Value = [%u] ", pHddCtx->config->isFastRoamIniFeatureEnabled); @@ -6921,6 +6931,7 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.cbChoice = 0; smeConfig->csrConfig.eBand = pConfig->nBandCapability; smeConfig->csrConfig.nTxPowerCap = pConfig->nTxPowerCap; + smeConfig->csrConfig.allow_tpc_from_ap = pConfig->allow_tpc_from_ap; smeConfig->csrConfig.fEnableBypass11d = pConfig->enableBypass11d; smeConfig->csrConfig.fEnableDFSChnlScan = pConfig->enableDFSChnlScan; smeConfig->csrConfig.nRoamPrefer5GHz = pConfig->nRoamPrefer5GHz; diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 131ce4237ff8..347198956135 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1934,16 +1934,12 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) session->htConfig.ht_tx_stbc = 0; } -#ifdef FEATURE_WLAN_ESE session->maxTxPower = lim_get_max_tx_power(reg_max, local_power_constraint, mac_ctx->roam.configParam.nTxPowerCap); -#else - session->maxTxPower = - QDF_MIN(reg_max, (local_power_constraint)); -#endif + lim_log(mac_ctx, LOG1, - FL("Reg max = %d, local power con = %d, max tx = %d"), + FL("Reg max %d local power con %d max tx pwr %d"), reg_max, local_power_constraint, session->maxTxPower); if (session->gLimCurrentBssUapsd) { diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index b5a14336e07a..26aa7ca55e9f 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -56,6 +56,38 @@ #include "wma.h" #define LIM_GET_NOISE_MAX_TRY 5 + +/** + * get_local_power_constraint_probe_response() - extracts local constraint + * from probe response + * @beacon_struct: beacon structure + * @local_constraint: local constraint pointer + * @session: A pointer to session entry. + * + * Return: None + */ +#ifdef FEATURE_WLAN_ESE +static void get_local_power_constraint_probe_response( + tpSirProbeRespBeacon beacon_struct, + int8_t *local_constraint, + tpPESession session) +{ + if (beacon_struct->eseTxPwr.present) + *local_constraint = + beacon_struct->eseTxPwr.power_limit; + session->is_ese_version_ie_present = + beacon_struct->is_ese_ver_ie_present; +} +#else +static void get_local_power_constraint_probe_response( + tpSirProbeRespBeacon beacon_struct, + int8_t *local_constraint, + tpPESession session) +{ + +} +#endif + /** * lim_extract_ap_capability() - extract AP's HCF/WME/WSM capability * @mac_ctx: Pointer to Global MAC structure @@ -289,20 +321,16 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, /* Extract the UAPSD flag from WMM Parameter element */ if (beacon_struct->wmeEdcaPresent) *uapsd = beacon_struct->edcaParams.qosInfo.uapsd; -#if defined FEATURE_WLAN_ESE - /* If there is Power Constraint Element specifically, - * adapt to it. Hence there is else condition check - * for this if statement. - */ - if (beacon_struct->eseTxPwr.present) - *local_constraint = beacon_struct->eseTxPwr.power_limit; - session->is_ese_version_ie_present = - beacon_struct->is_ese_ver_ie_present; -#endif - if (beacon_struct->powerConstraintPresent) { - *local_constraint -= - beacon_struct->localPowerConstraint. - localPowerConstraints; + + if (mac_ctx->roam.configParam.allow_tpc_from_ap) { + if (beacon_struct->powerConstraintPresent) { + *local_constraint -= + beacon_struct->localPowerConstraint. + localPowerConstraints; + } else { + get_local_power_constraint_probe_response( + beacon_struct, local_constraint, session); + } } session->country_info_present = false; /* Initializing before first use */ diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index af1fc51ce010..9fa411a2be14 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -671,6 +671,31 @@ sch_bcn_process_sta_ibss(tpAniSirGlobal mac_ctx, return; } +/** + * get_local_power_constraint_beacon() - extracts local constraint + * from beacon + * @bcn: beacon structure + * @local_constraint: local constraint pointer + * + * Return: None + */ +#ifdef FEATURE_WLAN_ESE +static void get_local_power_constraint_beacon( + tpSchBeaconStruct bcn, + int8_t *local_constraint) +{ + if (bcn->eseTxPwr.present) + *local_constraint = bcn->eseTxPwr.power_limit; +} +#else +static void get_local_power_constraint_beacon( + tpSchBeaconStruct bcn, + int8_t *local_constraint) +{ + +} +#endif + /* * __sch_beacon_process_for_session() - Process the received beacon frame when * station is not scanning and corresponding session is found @@ -715,12 +740,11 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, tpPESession session) { - int8_t localRRMConstraint = 0; uint8_t bssIdx = 0; tUpdateBeaconParams beaconParams; uint8_t sendProbeReq = false; tpSirMacMgmtHdr pMh = WMA_GET_RX_MAC_HEADER(rx_pkt_info); - int8_t regMax = 0, maxTxPower = 0; + int8_t regMax = 0, maxTxPower = 0, local_constraint; qdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; @@ -765,35 +789,35 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, regMax = cfg_get_regulatory_max_transmit_power(mac_ctx, session->currentOperChannel); - if (mac_ctx->rrm.rrmPEContext.rrmEnable - && bcn->powerConstraintPresent) - localRRMConstraint = - bcn->localPowerConstraint.localPowerConstraints; - else - localRRMConstraint = 0; - maxTxPower = lim_get_max_tx_power(regMax, regMax - localRRMConstraint, - mac_ctx->roam.configParam.nTxPowerCap); + local_constraint = regMax; -#if defined FEATURE_WLAN_ESE - if (session->isESEconnection) { - int8_t localESEConstraint = 0; - if (bcn->eseTxPwr.present) { - localESEConstraint = bcn->eseTxPwr.power_limit; - maxTxPower = lim_get_max_tx_power(maxTxPower, - localESEConstraint, - mac_ctx->roam.configParam.nTxPowerCap); - } - sch_log(mac_ctx, LOG1, - FL("RegMax = %d, localEseCons = %d, MaxTx = %d"), - regMax, localESEConstraint, maxTxPower); + if (mac_ctx->roam.configParam.allow_tpc_from_ap) { + get_local_power_constraint_beacon(bcn, &local_constraint); + sch_log(mac_ctx, LOG1, "ESE localPowerConstraint = %d,", + local_constraint); + + if (mac_ctx->rrm.rrmPEContext.rrmEnable && + bcn->powerConstraintPresent) { + local_constraint = regMax; + local_constraint -= + bcn->localPowerConstraint.localPowerConstraints; + sch_log(mac_ctx, LOG1, "localPowerConstraint = %d,", + local_constraint); + } } -#endif + + maxTxPower = lim_get_max_tx_power(regMax, local_constraint, + mac_ctx->roam.configParam.nTxPowerCap); + + sch_log(mac_ctx, LOG1, "RegMax = %d, MaxTx pwr = %d", + regMax, maxTxPower); + /* If maxTxPower is increased or decreased */ if (maxTxPower != session->maxTxPower) { sch_log(mac_ctx, LOG1, - FL("Local power constraint change..updating new maxTx power %d to HAL"), - maxTxPower); + FL("Local power constraint change, Updating new maxTx power %d from old pwr %d"), + maxTxPower, session->maxTxPower); if (lim_send_set_max_tx_power_req(mac_ctx, maxTxPower, session) == eSIR_SUCCESS) session->maxTxPower = maxTxPower; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 5467b645ca4f..9795904f2b91 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1168,6 +1168,7 @@ typedef struct tagCsrConfigParam { * default setting. */ uint8_t nTxPowerCap; + bool allow_tpc_from_ap; /* stats request frequency from PE while in full power */ uint32_t statsReqPeriodicity; /* stats request frequency from PE while in power save */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index c625867472e4..23c7a05c60a2 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -567,6 +567,7 @@ typedef struct tagCsrConfig { * value & 11d. If 11d is disable, the lesser of this & default setting. */ uint8_t nTxPowerCap; + bool allow_tpc_from_ap; uint32_t statsReqPeriodicity; /* stats req freq while in fullpower */ uint32_t statsReqPeriodicityInPS;/* stats req freq while in powersave */ uint32_t dtimPeriod; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 3ab5f2697e58..bb63955efbcc 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1398,6 +1398,7 @@ static void init_config_param(tpAniSirGlobal pMac) CSR_NUM_P2P_CHAN_COMBINED_CONC; #endif pMac->roam.configParam.nTxPowerCap = CSR_MAX_TX_POWER; + pMac->roam.configParam.allow_tpc_from_ap = true; pMac->roam.configParam.statsReqPeriodicity = CSR_MIN_GLOBAL_STAT_QUERY_PERIOD; pMac->roam.configParam.statsReqPeriodicityInPS = @@ -2277,6 +2278,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->statsReqPeriodicityInPS; /* Assign this before calling csr_init11d_info */ pMac->roam.configParam.nTxPowerCap = pParam->nTxPowerCap; + pMac->roam.configParam.allow_tpc_from_ap = + pParam->allow_tpc_from_ap; if (csr_is11d_supported(pMac)) { status = csr_init11d_info(pMac, &pParam->Csr11dinfo); } else { @@ -2579,6 +2582,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->vccRssiThreshold = cfg_params->vccRssiThreshold; pParam->vccUlMacLossThreshold = cfg_params->vccUlMacLossThreshold; pParam->nTxPowerCap = cfg_params->nTxPowerCap; + pParam->allow_tpc_from_ap = cfg_params->allow_tpc_from_ap; pParam->statsReqPeriodicity = cfg_params->statsReqPeriodicity; pParam->statsReqPeriodicityInPS = cfg_params->statsReqPeriodicityInPS; pParam->addTSWhenACMIsOff = cfg_params->addTSWhenACMIsOff; diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 4a9426bf692d..c83f797c449d 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -2704,6 +2704,9 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id, WMA_LOGW("Setting Tx power limit to 0"); } + WMA_LOGI("Set maxTx pwr [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + maxTxPower); + ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, WMI_VDEV_PARAM_TX_PWRLIMIT, maxTxPower); diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index acf4eac4fb67..db0ba9243088 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -397,7 +397,7 @@ void wma_set_tx_power(WMA_HANDLE handle, if (wma_handle->interfaces[vdev_id].tx_power != tx_pwr_params->power) { /* tx_power changed, Push the tx_power to FW */ - WMA_LOGW("%s: Set TX power limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + WMA_LOGI("%s: Set TX pwr limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", __func__, tx_pwr_params->power); ret = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id, @@ -464,7 +464,7 @@ void wma_set_max_tx_power(WMA_HANDLE handle, ret = QDF_STATUS_SUCCESS; goto end; } - WMA_LOGW("Set MAX TX power limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + WMA_LOGI("Set MAX TX pwr limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", wma_handle->interfaces[vdev_id].max_tx_power); ret = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id, WMI_VDEV_PARAM_TX_PWRLIMIT, diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index cdbecb59d00c..3418f1d19d95 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -740,7 +740,7 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle, WMI_SET_CHANNEL_REG_POWER(tchan_info, chan_list->chanParam[i].pwr); - WMA_LOGD("Channel TX power[%d] = %u: %d", i, tchan_info->mhz, + WMA_LOGI("Channel TX power[%d] = %u: %d", i, tchan_info->mhz, chan_list->chanParam[i].pwr); /*TODO: Set WMI_SET_CHANNEL_MIN_POWER */ /*TODO: Set WMI_SET_CHANNEL_ANTENNA_MAX */ -- cgit v1.2.3 From d5ed3ef2ba942bbfa5852cf38fef5a6114afd500 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 3 Oct 2016 17:12:41 -0700 Subject: Release 5.1.0.28U Release 5.1.0.28U Change-Id: I9f385c843c80aaa9d662b2823fa8f935d4956e85 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2a739abcee25..9ce7e7ee3e5c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28T" +#define QWLAN_VERSIONSTR "5.1.0.28U" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 9c323a8cebc3d57c364433e7cdd7b1c9c9f48424 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Fri, 23 Sep 2016 09:27:11 -0700 Subject: qcacld-3.0: Fix check for identifying P2P action frame Fix check for identifying P2P action frame by calling the helper routine wlan_hdd_is_type_p2p_action(). Currently incoming frame buffer is checked against only for Public action category and not for P2P OUI. Without this any Public action frame could be incorrectly tagged as Provisionaly Discovery Request or Go Negotiation Request. Change-Id: Id55feec06072e2ca6ad780e51c49cd19662b4d8e CRs-Fixed: 1071200 --- core/hdd/src/wlan_hdd_p2p.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 8f4d5f3d7583..662660da8b76 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1568,14 +1568,13 @@ send_frame: if ((QDF_STA_MODE == pAdapter->device_mode) || (QDF_P2P_CLIENT_MODE == pAdapter->device_mode) || - (QDF_P2P_DEVICE_MODE == pAdapter->device_mode) - ) { + (QDF_P2P_DEVICE_MODE == pAdapter->device_mode)) { uint8_t sessionId = pAdapter->sessionId; if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION) && - (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == - WLAN_HDD_PUBLIC_ACTION_FRAME)) { + wlan_hdd_is_type_p2p_action(&buf + [WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET])) { actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; hddLog(LOG1, "Tx Action Frame %u", actionFrmType); -- cgit v1.2.3 From ea8f5e05391732c8a683508df1e3827999dcef9c Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Tue, 27 Sep 2016 14:56:57 -0700 Subject: qcacld-3.0: Fix compilation error on disabling FEATURE_NAPI When FEATURE_NAPI is disabled there is a compilation error. Fix the compilation error by adding appropriate function defintion. Change-Id: If77ad5d8a5a6edc189159d0e9d6d92edd2856052 CRs-Fixed: 1072777 --- core/hdd/inc/wlan_hdd_napi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_napi.h b/core/hdd/inc/wlan_hdd_napi.h index 460af7e878e4..1ad0ef9bec04 100644 --- a/core/hdd/inc/wlan_hdd_napi.h +++ b/core/hdd/inc/wlan_hdd_napi.h @@ -93,8 +93,8 @@ static inline int hdd_napi_event(enum qca_napi_event event, void *data) return 0; } static inline struct qca_napi_data *hdd_napi_get_all(void) { return NULL; } -static inline int hdd_napi_apply_throughput_policy(struct hdd_context_s *, - uint64_t, uint64_t) +static inline int hdd_napi_apply_throughput_policy(void *hdd_ctx, + uint64_t tx_packets, uint64_t rx_packets) { return 0; } -- cgit v1.2.3 From 62b9b759755744bdbfcdb44ed80b14ab6568e903 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 3 Oct 2016 19:09:31 -0700 Subject: Release 5.1.0.28V Release 5.1.0.28V Change-Id: I5864ef22deeba159d40cd96b14d61c696280a720 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 9ce7e7ee3e5c..dcb7517802eb 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28U" +#define QWLAN_VERSIONSTR "5.1.0.28V" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 281e7ec8ed2211d42e4dfbcb1352b89a72fa83a8 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Mon, 26 Sep 2016 14:46:35 -0700 Subject: qcacld-3.0: Remove gRoamingTime There is a desire to remove unnecessary items from the default version of WCNSS_qcom_cfg.ini that is shipped to customers. Currently the default value within wlan_hdd_cfg.h is: define CFG_ROAMING_TIME_DEFAULT (10) gRoamingTime is set to zero in WCNSS_qcom_cfg.ini to always complete/cancel roaming operation. As part of this WCNSS_qcom_cfg.ini cleanup remove gRoamingTime and related code. Change-Id: I1f7833b2ae4794ceac8d4e3826fa26417b54eae4 CRs-Fixed: 1071268 --- core/hdd/inc/wlan_hdd_cfg.h | 7 --- core/hdd/src/wlan_hdd_cfg.c | 8 --- core/sme/inc/csr_api.h | 2 - core/sme/inc/csr_internal.h | 3 -- core/sme/src/csr/csr_api_roam.c | 106 +------------------------------------- core/sme/src/csr/csr_inside_api.h | 1 - 6 files changed, 1 insertion(+), 126 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 146f5955bb65..9cfeeb3cf36a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -396,12 +396,6 @@ typedef enum { #define CFG_BEACON_INTERVAL_MAX WNI_CFG_BEACON_INTERVAL_STAMAX #define CFG_BEACON_INTERVAL_DEFAULT WNI_CFG_BEACON_INTERVAL_STADEF -/* Additional Handoff related Parameters */ -#define CFG_ROAMING_TIME_NAME "gRoamingTime" -#define CFG_ROAMING_TIME_MIN (0) -#define CFG_ROAMING_TIME_MAX (4294967UL) -#define CFG_ROAMING_TIME_DEFAULT (10) - #define CFG_VCC_RSSI_TRIGGER_NAME "gVccRssiTrigger" #define CFG_VCC_RSSI_TRIGGER_MIN (0) #define CFG_VCC_RSSI_TRIGGER_MAX (80) @@ -3587,7 +3581,6 @@ struct hdd_config { int32_t nhi_rssi_scan_rssi_ub; /* Additional Handoff params */ - uint32_t nRoamingTime; uint16_t nVccRssiTrigger; uint32_t nVccUlMacLossThreshold; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index f04be9d50f7a..f3519ef35a21 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -687,13 +687,6 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_BEACON_INTERVAL_MIN, CFG_BEACON_INTERVAL_MAX), - REG_VARIABLE(CFG_ROAMING_TIME_NAME, WLAN_PARAM_Integer, - struct hdd_config, nRoamingTime, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_ROAMING_TIME_DEFAULT, - CFG_ROAMING_TIME_MIN, - CFG_ROAMING_TIME_MAX), - REG_VARIABLE(CFG_VCC_RSSI_TRIGGER_NAME, WLAN_PARAM_Integer, struct hdd_config, nVccRssiTrigger, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -6866,7 +6859,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.vccRssiThreshold = pConfig->nVccRssiTrigger; smeConfig->csrConfig.vccUlMacLossThreshold = pConfig->nVccUlMacLossThreshold; - smeConfig->csrConfig.nRoamingTime = pConfig->nRoamingTime; smeConfig->csrConfig.nInitialDwellTime = pConfig->nInitialDwellTime; smeConfig->csrConfig.initial_scan_no_dfs_chnl = pConfig->initial_scan_no_dfs_chnl; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 9795904f2b91..07e9874784d9 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1119,8 +1119,6 @@ typedef struct tagCsrConfigParam { uint32_t scanAgeTimeCNPS; /* scan res aging time threshold when Connect-Power-Save, in sec */ uint32_t scanAgeTimeCPS; - /* In sec, CSR'll try this long before gives up. 0 means no roaming */ - uint32_t nRoamingTime; /* to set the RSSI difference for each category */ uint8_t bCatRssiOffset; /* to set MCC Enable/Disable mode */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 23c7a05c60a2..dd9dffafea2c 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -525,8 +525,6 @@ typedef struct tagCsrConfig { uint32_t BssPreferValue[CSR_NUM_RSSI_CAT]; int RSSICat[CSR_NUM_RSSI_CAT]; uint8_t bCatRssiOffset; /* to set RSSI difference for each category */ - /* In secs, CSR'll try this long before gives up, 0 means no roaming */ - uint32_t nRoamingTime; /* * Whether to limit the channels to the ones set in Csr11dInfo. * If true, the opertaional channels are limited to the default channel @@ -948,7 +946,6 @@ typedef struct tagCsrRoamSession { uint8_t *pAddIEScan; uint32_t nAddIEAssocLength; /* the byte count for pAddIeAssocIE */ uint8_t *pAddIEAssoc; - uint32_t roamingStartTime; /* in units of 10ms */ tCsrTimerInfo roamingTimerInfo; eCsrRoamingReason roamingReason; bool fCancelRoaming; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index bb63955efbcc..58d0c0812b9d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1372,7 +1372,6 @@ static void init_config_param(tpAniSirGlobal pMac) } csr_assign_rssi_for_category(pMac, CSR_BEST_RSSI_VALUE, CSR_DEFAULT_RSSI_DB_GAP); - pMac->roam.configParam.nRoamingTime = CSR_DEFAULT_ROAMING_TIME; pMac->roam.configParam.fSupplicantCountryCodeHasPriority = false; pMac->roam.configParam.nActiveMaxChnTime = CSR_ACTIVE_MAX_CHANNEL_TIME; pMac->roam.configParam.nActiveMinChnTime = CSR_ACTIVE_MIN_CHANNEL_TIME; @@ -2265,7 +2264,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, csr_assign_rssi_for_category(pMac, pMac->first_scan_bucket_threshold, pParam->bCatRssiOffset); - pMac->roam.configParam.nRoamingTime = pParam->nRoamingTime; pMac->roam.configParam.fSupplicantCountryCodeHasPriority = pParam->fSupplicantCountryCodeHasPriority; pMac->roam.configParam.vccRssiThreshold = @@ -2576,7 +2574,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->scanAgeTimeCNPS = cfg_params->scanAgeTimeCNPS; pParam->scanAgeTimeCPS = cfg_params->scanAgeTimeCPS; pParam->bCatRssiOffset = cfg_params->bCatRssiOffset; - pParam->nRoamingTime = cfg_params->nRoamingTime; pParam->fSupplicantCountryCodeHasPriority = cfg_params->fSupplicantCountryCodeHasPriority; pParam->vccRssiThreshold = cfg_params->vccRssiThreshold; @@ -11393,10 +11390,6 @@ bool csr_roam_complete_roaming(tpAniSirGlobal pMac, uint32_t sessionId, bool fForce, eCsrRoamResult roamResult) { bool fCompleted = true; - uint32_t roamTime = - (uint32_t) (pMac->roam.configParam.nRoamingTime * - QDF_TICKS_PER_SECOND); - uint32_t curTime = (uint32_t) qdf_mc_timer_get_system_ticks(); tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); if (!pSession) { sms_log(pMac, LOGE, FL(" session %d not found "), sessionId); @@ -11404,7 +11397,6 @@ bool csr_roam_complete_roaming(tpAniSirGlobal pMac, uint32_t sessionId, } /* Check whether time is up */ if (pSession->fCancelRoaming || fForce || - ((curTime - pSession->roamingStartTime) > roamTime) || eCsrReassocRoaming == pSession->roamingReason || eCsrDynamicRoaming == pSession->roamingReason) { sms_log(pMac, LOGW, FL(" indicates roaming completion")); @@ -11682,7 +11674,6 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, tSirSmeDeauthInd *pDeauthIndMsg = NULL; tSirSmeDisassocInd *pDisassocIndMsg = NULL; eCsrRoamResult result = eCSR_ROAM_RESULT_LOSTLINK; - tCsrRoamInfo *pRoamInfo = NULL; tCsrRoamInfo roamInfo; bool fToRoam; tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); @@ -11774,50 +11765,7 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, (eWNI_SME_DEAUTH_IND == type) ? eCsrLostlinkRoamingDeauth : eCsrLostlinkRoamingDisassoc); - if (pMac->roam.configParam.nRoamingTime) { - status = csr_roam_start_roaming(pMac, sessionId, - (eWNI_SME_DEAUTH_IND == type) ? - eCsrLostlinkRoamingDeauth : - eCsrLostlinkRoamingDisassoc); - if (QDF_IS_STATUS_SUCCESS(status)) { - qdf_mem_set(&roamInfo, sizeof(tCsrRoamInfo), 0); - /* For IBSS, we need to give some more info to HDD */ - if (csr_is_bss_type_ibss - (pSession->connectedProfile.BSSType)) { - roamInfo.u.pConnectedProfile = - &pSession->connectedProfile; - roamInfo.statusCode = - (tSirResultCodes) pSession-> - roamingStatusCode; - roamInfo.reasonCode = - pSession->joinFailStatusCode. - reasonCode; - } else { - roamInfo.reasonCode = - eCsrRoamReasonSmeIssuedForLostLink; - } - pRoamInfo = &roamInfo; - pSession->roamingReason = - (eWNI_SME_DEAUTH_IND == - type) ? eCsrLostlinkRoamingDeauth : - eCsrLostlinkRoamingDisassoc; - pSession->roamingStartTime = - (uint32_t) qdf_mc_timer_get_system_ticks(); - csr_roam_call_callback(pMac, sessionId, pRoamInfo, - 0, eCSR_ROAM_ROAMING_START, - eCSR_ROAM_RESULT_LOSTLINK); - } else { - sms_log(pMac, LOGW, - " %s Fail to start roaming, status = %d", - __func__, status); - fToRoam = false; - } - } else { - /* We are told not to roam, indicate lostlink */ - fToRoam = false; - } - } - if (!fToRoam) { + /* Tell HDD about the lost link */ if (!CSR_IS_INFRA_AP(&pSession->connectedProfile)) { /* Don't call csr_roam_call_callback for GO/SoftAp case as this indication @@ -11833,58 +11781,6 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, return status; } -QDF_STATUS csr_roam_lost_link_afterhandoff_failure(tpAniSirGlobal pMac, - uint32_t sessionId) -{ - QDF_STATUS status = QDF_STATUS_SUCCESS; - tListElem *pEntry = NULL; - tSmeCmd *pCommand = NULL; - tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); - - if (!pSession) { - sms_log(pMac, LOGE, FL(" session %d not found "), sessionId); - return QDF_STATUS_E_FAILURE; - } - - pSession->fCancelRoaming = false; - /* Only remove the connected BSS in infrastructure mode */ - csr_roam_remove_connected_bss_from_scan_cache(pMac, - &pSession->connectedProfile); - if (pMac->roam.configParam.nRoamingTime) { - status = csr_roam_start_roaming(pMac, sessionId, - pSession->roamingReason); - if (QDF_IS_STATUS_SUCCESS(status)) { - /* - * before starting the lost link logic release - * the roam command for handoff - */ - pEntry = - csr_ll_peek_head(&pMac->sme.smeCmdActiveList, - LL_ACCESS_LOCK); - if (pEntry) { - pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); - } - if (pCommand) { - if ((eSmeCommandRoam == pCommand->command) && - (eCsrSmeIssuedAssocToSimilarAP == - pCommand->u.roamCmd.roamReason)) { - if (csr_ll_remove_entry - (&pMac->sme.smeCmdActiveList, - pEntry, LL_ACCESS_LOCK)) { - csr_release_command_roam(pMac, - pCommand); - } - } - } - sms_log(pMac, LOGW, "Lost link roaming started ..."); - } - } else { - /* We are told not to roam, indicate lostlink */ - status = QDF_STATUS_E_FAILURE; - } - - return status; -} void csr_roam_wm_status_change_complete(tpAniSirGlobal pMac) { diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 0593c7c83214..b8ee71bc58f5 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -90,7 +90,6 @@ #define CSR_BSS_CAP_VALUE_WMM 1 #define CSR_BSS_CAP_VALUE_UAPSD 1 #define CSR_BSS_CAP_VALUE_5GHZ 2 -#define CSR_DEFAULT_ROAMING_TIME 10 /* 10 seconds */ #define CSR_ROAMING_DFS_CHANNEL_DISABLED (0) #define CSR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL (1) -- cgit v1.2.3 From b491af8d70635e55659ce6f9f952c519fe0ec34c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 11:14:27 -0700 Subject: Release 5.1.0.28W Release 5.1.0.28W Change-Id: I84725199df4259aee0b103c4b8266a9f10a29a01 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index dcb7517802eb..98fb8a6d95b9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28V" +#define QWLAN_VERSIONSTR "5.1.0.28W" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From a6300253f022197bee27e1d62eb4671a90ba404d Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 28 Sep 2016 15:58:55 -0700 Subject: qcacld-3.0: Enable Green AP feature on msmcobalt Currently the Green AP feature is only enabled on mobile router platforms. Enable it on the msmcobalt platform as well. Change-Id: Ib5000b2201cc2c7bd88e3d322b186afcdb0a72e3 CRs-Fixed: 1072412 --- Kbuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kbuild b/Kbuild index 3fc0b7227418..90b5a8e59cd7 100644 --- a/Kbuild +++ b/Kbuild @@ -99,6 +99,9 @@ ifeq ($(KERNEL_BUILD), 0) ifeq ($(CONFIG_MOBILE_ROUTER), y) CONFIG_QCACLD_FEATURE_GREEN_AP := y endif + ifeq ($(CONFIG_ARCH_MSMCOBALT), y) + CONFIG_QCACLD_FEATURE_GREEN_AP := y + endif #Flag to enable Fast Transition (11r) feature CONFIG_QCOM_VOWIFI_11R := y -- cgit v1.2.3 From 9cc0ed982af46919370bada9c02f7be5360e5a69 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 29 Sep 2016 12:11:42 -0700 Subject: qcacld-3.0: Correctly report 20 MHz bandwidth in Linux 4.x Linux kernel 4.0 introduced a new way for drivers to report bandwidth information to userspace. Prior to this rate information was indicated by setting an appropriate BW flag in the struct rate_info flags field, and 20MHz bandwidth was assumed if no flag was set. Linux 4.0 introduced a new bw field to struct rate_info, and the driver was updated to set this field in all cases where previously a bandwidth-specific flag had been set. Unfortunately in the 20 MHz bandwidth case the driver was not previously setting a bandwidth-specific flag, and hence in the current case it is not setting the bw field. This manifests itself in the following warning emitted by the kernel when the device is associated to an Access Point with a 20MHz bandwidth: WARNING: at kernel/msm-4.4/net/wireless/util.c:1137 Modules linked in: wlan(O) PC is at cfg80211_calculate_bitrate+0xdc/0x1f0 LR is at nl80211_put_sta_rate+0x64/0x1dc Fix this issue by initializing the rate_info bw field to 20 MHz prior to calculating the bandwidth. If the bandwidth is anything other than 20 MHz then this default value will later be overwritten. Change-Id: I734b05e0e41c7a859939372fe4d8a3668a08c668 CRs-Fixed: 1072803 --- core/hdd/src/wlan_hdd_stats.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 1e786fbc9b83..662aa3a2f5b8 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1736,6 +1736,11 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, (int)pCfg->linkSpeedRssiLow, (int)rate_flags, (int)pAdapter->hdd_stats.ClassA_stat.mcs_index); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS) + /* assume basic BW. anything else will override this later */ + sinfo->txrate.bw = RATE_INFO_BW_20; +#endif + if (eHDD_LINK_SPEED_REPORT_ACTUAL != pCfg->reportMaxLinkSpeed) { /* we do not want to necessarily report the current speed */ if (eHDD_LINK_SPEED_REPORT_MAX == pCfg->reportMaxLinkSpeed) { -- cgit v1.2.3 From 62e91469ab90ae644a035d014392c39802d06cd7 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 12:07:04 -0700 Subject: Release 5.1.0.28X Release 5.1.0.28X Change-Id: I0524f3c0226d70ae28384e2c3e85043805d9201f CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 98fb8a6d95b9..4e4da084b5c0 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "W" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28W" +#define QWLAN_VERSIONSTR "5.1.0.28X" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From d7cc07998351d9e6a4056722320cd7690ce5e2ce Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Tue, 28 Jun 2016 18:54:12 +0530 Subject: qcacld-3.0: Add changes for DISA certification Add changes to parse DISA parameters received from user space and pass them to firmware for firmware to encrypt data and send back to driver. Also, add changes to print encrypted data received from firmware. Change-Id: Ic6928a93f799c47518fbbad96564062f595287dd CRs-Fixed: 1064970 --- Kbuild | 11 + Kconfig | 4 + core/hdd/src/wlan_hdd_cfg80211.c | 14 +- core/hdd/src/wlan_hdd_cfg80211.h | 41 ++++ core/hdd/src/wlan_hdd_disa.c | 496 ++++++++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_disa.h | 70 ++++++ core/hdd/src/wlan_hdd_main.c | 5 +- core/mac/inc/sir_api.h | 14 ++ core/mac/src/include/sir_params.h | 1 + core/sme/inc/sme_api.h | 40 +++ core/sme/inc/sme_internal.h | 2 + core/sme/src/common/sme_api.c | 131 ++++++++++ core/wma/inc/wma.h | 3 + core/wma/inc/wma_api.h | 2 + core/wma/inc/wma_internal.h | 3 + core/wma/inc/wma_types.h | 1 + core/wma/src/wma_features.c | 105 ++++++++ core/wma/src/wma_main.c | 8 + 18 files changed, 948 insertions(+), 3 deletions(-) create mode 100644 core/hdd/src/wlan_hdd_disa.c create mode 100644 core/hdd/src/wlan_hdd_disa.h diff --git a/Kbuild b/Kbuild index 90b5a8e59cd7..c6ea5d2042d8 100644 --- a/Kbuild +++ b/Kbuild @@ -159,6 +159,9 @@ ifneq ($(CONFIG_ROME_IF),sdio) #Flag to enable memdump feature CONFIG_WLAN_FEATURE_MEMDUMP := n + #Flag to enable DISA + CONFIG_WLAN_FEATURE_DISA := y + #Flag to enable Fast Path feature CONFIG_WLAN_FASTPATH := y @@ -420,6 +423,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y) HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_memdump.o endif +ifeq ($(CONFIG_WLAN_FEATURE_DISA),y) +HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_disa.o +endif + ifeq ($(CONFIG_LFR_SUBNET_DETECTION), y) HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_subnet_detect.o endif @@ -1545,6 +1552,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y) CDEFINES += -DWLAN_FEATURE_MEMDUMP endif +ifeq ($(CONFIG_WLAN_FEATURE_DISA),y) +CDEFINES += -DWLAN_FEATURE_DISA +endif + ifeq ($(CONFIG_LFR_SUBNET_DETECTION), y) CDEFINES += -DFEATURE_LFR_SUBNET_DETECTION endif diff --git a/Kconfig b/Kconfig index bac7403f532d..da483769e7f5 100644 --- a/Kconfig +++ b/Kconfig @@ -132,4 +132,8 @@ config FEATURE_DP_TRACE bool "Enable data path trace feature" default n +config WLAN_FEATURE_DISA + bool "Enable DISA certification feature" + default n + endif # QCA_CLD_WLAN diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c534a7dd8e39..ce3e7907bb88 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -98,6 +98,7 @@ #include #include "wlan_hdd_lpass.h" #include "wlan_hdd_nan_datapath.h" +#include "wlan_hdd_disa.h" #define g_mode_rates_size (12) #define a_mode_rates_size (8) @@ -8410,7 +8411,18 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_set_fast_roaming - } + }, +#ifdef WLAN_FEATURE_DISA + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = + QCA_NL80211_VENDOR_SUBCMD_ENCRYPTION_TEST, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_encrypt_decrypt_msg + }, +#endif }; /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 7355b4bea69d..80dbc428c50b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -429,6 +429,9 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START = 122, QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP = 123, QCA_NL80211_VENDOR_SUBCMD_SAP_CONDITIONAL_CHAN_SWITCH = 124, + + /* Encrypt/Decrypt command */ + QCA_NL80211_VENDOR_SUBCMD_ENCRYPTION_TEST = 137, }; /** @@ -2896,6 +2899,44 @@ enum qca_wlan_vendor_drv_info { QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST - 1, }; +/** + * enum qca_wlan_vendor_attr_encryption_test - Attributes to + * validate encryption engine + * + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_NEEDS_DECRYPTION: Flag attribute. + * This will be included if the request is for decryption; if not included, + * the request is treated as a request for encryption by default. + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_CIPHER: Unsigned 32-bit value + * indicating the key cipher suite. Takes same values as + * NL80211_ATTR_KEY_CIPHER. + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_KEYID: Unsigned 8-bit value + * Key Id to be used for encryption + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_TK: Array of 8-bit values. + * Key (TK) to be used for encryption/decryption + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_PN: Array of 8-bit values. + * Packet number to be specified for encryption/decryption + * 6 bytes for TKIP/CCMP/GCMP. + * @QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA: Array of 8-bit values + * representing the 802.11 packet (header + payload + FCS) that + * needs to be encrypted/decrypted. + * Encrypted/decrypted response from the driver will also be sent + * to userspace with the same attribute. + */ +enum qca_wlan_vendor_attr_encryption_test { + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_NEEDS_DECRYPTION, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_CIPHER, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_KEYID, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_TK, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_PN, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX = + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_AFTER_LAST - 1 +}; + struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo); diff --git a/core/hdd/src/wlan_hdd_disa.c b/core/hdd/src/wlan_hdd_disa.c new file mode 100644 index 000000000000..a4153fc5f1db --- /dev/null +++ b/core/hdd/src/wlan_hdd_disa.c @@ -0,0 +1,496 @@ +/* + * Copyright (c) 2016 The Linux Foundation. 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 + * 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. + */ + +/** + * DOC : wlan_hdd_disa.c + * + * WLAN Host Device Driver file for DISA certification + * + */ + +#include "wlan_hdd_disa.h" +#include "sme_api.h" + +#define ENCRYPT_DECRYPT_CONTEXT_MAGIC 0x4475354 +#define WLAN_WAIT_TIME_ENCRYPT_DECRYPT 1000 + + +/** + * hdd_encrypt_decrypt_msg_context - hdd encrypt/decrypt message context + * + * @magic: magic number + * @completion: Completion variable for encrypt/decrypt message + * @response_event: encrypt/decrypt message request wait event + */ +struct hdd_encrypt_decrypt_msg_context { + unsigned int magic; + struct completion completion; + struct sir_encrypt_decrypt_rsp_params response; +}; +static struct hdd_encrypt_decrypt_msg_context encrypt_decrypt_msg_context; + +/** + * hdd_encrypt_decrypt_msg_cb () - sends encrypt/decrypt data to user space + * @encrypt_decrypt_rsp_params: encrypt/decrypt response parameters + * + * Return: none + */ +static void hdd_encrypt_decrypt_msg_cb(void *hdd_context, + struct sir_encrypt_decrypt_rsp_params *encrypt_decrypt_rsp_params) +{ + hdd_context_t *hdd_ctx = hdd_context; + int ret; + struct hdd_encrypt_decrypt_msg_context *context; + + ENTER(); + + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return; + + if (!encrypt_decrypt_rsp_params) { + hdd_err("rsp params is NULL"); + return; + } + + print_hex_dump(KERN_INFO, "Data in hdd_encrypt_decrypt_msg_cb: ", + DUMP_PREFIX_NONE, 16, 1, + encrypt_decrypt_rsp_params->data, + encrypt_decrypt_rsp_params->data_length, 0); + + hdd_err("vdev_id %d,status %d data_length %d", + encrypt_decrypt_rsp_params->vdev_id, + encrypt_decrypt_rsp_params->status, + encrypt_decrypt_rsp_params->data_length); + + spin_lock(&hdd_context_lock); + + context = &encrypt_decrypt_msg_context; + /* The caller presumably timed out so there is nothing we can do */ + if (context->magic != ENCRYPT_DECRYPT_CONTEXT_MAGIC) { + spin_unlock(&hdd_context_lock); + return; + } + + /* context is valid so caller is still waiting */ + context->response = *encrypt_decrypt_rsp_params; + + if (encrypt_decrypt_rsp_params->data_length) { + context->response.data = + qdf_mem_malloc(sizeof(uint8_t) * + encrypt_decrypt_rsp_params->data_length); + if (context->response.data == NULL) { + hdd_err("cdf_mem_alloc failed for data"); + spin_unlock(&hdd_context_lock); + return; + } + qdf_mem_copy(context->response.data, + encrypt_decrypt_rsp_params->data, + encrypt_decrypt_rsp_params->data_length); + } + + /* + * Indicate to calling thread that + * response data is available + */ + context->magic = 0; + + complete(&context->completion); + + spin_unlock(&hdd_context_lock); + + + EXIT(); +} + + +/** + * hdd_encrypt_decrypt_msg_cb () - sends encrypt/decrypt data to user space + * @encrypt_decrypt_rsp_params: encrypt/decrypt response parameters + * + * Return: none + */ +static int hdd_post_encrypt_decrypt_msg_rsp(hdd_context_t *hdd_ctx, + struct sir_encrypt_decrypt_rsp_params *encrypt_decrypt_rsp_params) +{ + struct sk_buff *skb; + uint32_t nl_buf_len; + + ENTER(); + + nl_buf_len = encrypt_decrypt_rsp_params->data_length + NLA_HDRLEN; + + skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len); + if (!skb) { + hdd_err(FL("cfg80211_vendor_cmd_alloc_reply_skb failed")); + return -ENOMEM; + } + + if (encrypt_decrypt_rsp_params->data_length) { + if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA, + encrypt_decrypt_rsp_params->data_length, + encrypt_decrypt_rsp_params->data)) { + hdd_err(FL("put fail")); + goto nla_put_failure; + } + } + + cfg80211_vendor_cmd_reply(skb); + EXIT(); + return 0; + +nla_put_failure: + kfree_skb(skb); + return -EINVAL; +} + +/** + * hdd_fill_encrypt_decrypt_params () - parses data from user space + * and fills encrypt/decrypt parameters + * @encrypt_decrypt_params: encrypt/decrypt request parameters + * @adapter : adapter context + * @data: Pointer to data + * @data_len: Data length + * + Return: 0 on success, negative errno on failure + */ +static int hdd_fill_encrypt_decrypt_params(struct encrypt_decrypt_req_params + *encrypt_decrypt_params, + hdd_adapter_t *adapter, + const void *data, + int data_len) +{ + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX + 1]; + uint8_t len, mac_hdr_len; + uint8_t *tmp; + uint8_t fc[2]; + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX, + data, data_len, NULL)) { + hdd_err("Invalid ATTR"); + return -EINVAL; + } + + encrypt_decrypt_params->vdev_id = adapter->sessionId; + hdd_err("vdev_id : %d", encrypt_decrypt_params->vdev_id); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_NEEDS_DECRYPTION]) { + hdd_err("attr flag NEEDS_DECRYPTION not present"); + encrypt_decrypt_params->key_flag = WMI_ENCRYPT; + } else { + hdd_err("attr flag NEEDS_DECRYPTION present"); + encrypt_decrypt_params->key_flag = WMI_DECRYPT; + } + hdd_err("Key flag : %d", encrypt_decrypt_params->key_flag); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_KEYID]) { + hdd_err("attr key id failed"); + return -EINVAL; + } + encrypt_decrypt_params->key_idx = nla_get_u8(tb + [QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_KEYID]); + hdd_err("Key Idx : %d", encrypt_decrypt_params->key_idx); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_CIPHER]) { + hdd_err("attr Cipher failed"); + return -EINVAL; + } + encrypt_decrypt_params->key_cipher = nla_get_u32(tb + [QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_CIPHER]); + hdd_err("key_cipher : %d", encrypt_decrypt_params->key_cipher); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_TK]) { + hdd_err("attr TK failed"); + return -EINVAL; + } + encrypt_decrypt_params->key_len = + nla_len(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_TK]); + if (!encrypt_decrypt_params->key_len) { + hdd_err("Invalid TK length"); + return -EINVAL; + } + hdd_err("Key len : %d", encrypt_decrypt_params->key_len); + + if (encrypt_decrypt_params->key_len > SIR_MAC_MAX_KEY_LENGTH) + encrypt_decrypt_params->key_len = SIR_MAC_MAX_KEY_LENGTH; + + tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_TK]); + + qdf_mem_copy(encrypt_decrypt_params->key_data, tmp, + encrypt_decrypt_params->key_len); + + print_hex_dump(KERN_INFO, "Key : ", DUMP_PREFIX_NONE, 16, 1, + &encrypt_decrypt_params->key_data, + encrypt_decrypt_params->key_len, 0); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_PN]) { + hdd_err("attr PN failed"); + return -EINVAL; + } + len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_PN]); + if (!len) { + hdd_err("Invalid PN length"); + return -EINVAL; + } + + tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_PN]); + + qdf_mem_copy(encrypt_decrypt_params->pn, tmp, len); + + print_hex_dump(KERN_INFO, "PN received : ", DUMP_PREFIX_NONE, 16, 1, + &encrypt_decrypt_params->pn, len, 0); + + if (!tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA]) { + hdd_err("attr header failed"); + return -EINVAL; + } + len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA]); + if (!len) { + hdd_err("Invalid header and payload length"); + return -EINVAL; + } + + hdd_err("Header and Payload length %d ", len); + + tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_DATA]); + + print_hex_dump(KERN_INFO, "Header and Payload received: ", + DUMP_PREFIX_NONE, 16, 1, + tmp, len, 0); + + mac_hdr_len = MIN_MAC_HEADER_LEN; + + /* + * Check to find out address 4. Address 4 is present if ToDS and FromDS + * are 1 and data representation is little endian. + */ + fc[1] = *tmp; + fc[0] = *(tmp + 1); + if ((fc[0] & 0x03) == 0x03) { + hdd_err("Address 4 is present"); + mac_hdr_len += IEEE80211_ADDR_LEN; + } + + /* + * Check to find out Qos control field. Qos control field is present + * if msb of subtype field is 1 and data representation is + * little endian. + */ + if (fc[1] & 0x80) { + hdd_err("Qos control is present"); + mac_hdr_len += QOS_CONTROL_LEN; + } + + hdd_err("mac_hdr_len %d", mac_hdr_len); + + qdf_mem_copy(encrypt_decrypt_params->mac_header, + tmp, mac_hdr_len); + + print_hex_dump(KERN_INFO, "Header received in request: ", + DUMP_PREFIX_NONE, 16, 1, + encrypt_decrypt_params->mac_header, + mac_hdr_len, 0); + + encrypt_decrypt_params->data_len = + len - mac_hdr_len; + + hdd_err("Payload length : %d", encrypt_decrypt_params->data_len); + + if (encrypt_decrypt_params->data_len) { + encrypt_decrypt_params->data = + qdf_mem_malloc(sizeof(uint8_t) * + encrypt_decrypt_params->data_len); + + if (encrypt_decrypt_params->data == NULL) { + hdd_err("cdf_mem_alloc failed for data"); + return -ENOMEM; + } + + qdf_mem_copy(encrypt_decrypt_params->data, + tmp + mac_hdr_len, + encrypt_decrypt_params->data_len); + + print_hex_dump(KERN_INFO, "Data received in request: ", + DUMP_PREFIX_NONE, 16, 1, + encrypt_decrypt_params->data, + encrypt_decrypt_params->data_len, 0); + } + + return 0; +} + +/** + * hdd_encrypt_decrypt_msg () - process encrypt/decrypt message + * @adapter : adapter context + * @hdd_ctx: hdd context + * @data: Pointer to data + * @data_len: Data length + * + Return: 0 on success, negative errno on failure + */ +static int hdd_encrypt_decrypt_msg(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + const void *data, + int data_len) +{ + struct encrypt_decrypt_req_params encrypt_decrypt_params = {0}; + QDF_STATUS qdf_status; + int ret; + struct hdd_encrypt_decrypt_msg_context *context; + unsigned long rc; + + ret = hdd_fill_encrypt_decrypt_params(&encrypt_decrypt_params, + adapter, data, data_len); + if (ret) + return ret; + + spin_lock(&hdd_context_lock); + context = &encrypt_decrypt_msg_context; + context->magic = ENCRYPT_DECRYPT_CONTEXT_MAGIC; + INIT_COMPLETION(context->completion); + spin_unlock(&hdd_context_lock); + + qdf_status = sme_encrypt_decrypt_msg(hdd_ctx->hHal, + &encrypt_decrypt_params); + + qdf_mem_free(encrypt_decrypt_params.data); + + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + hdd_err("Unable to post encrypt/decrypt message"); + return -EINVAL; + } + + rc = wait_for_completion_timeout(&context->completion, + msecs_to_jiffies(WLAN_WAIT_TIME_ENCRYPT_DECRYPT)); + + spin_lock(&hdd_context_lock); + if (!rc && (context->magic == + ENCRYPT_DECRYPT_CONTEXT_MAGIC)) { + hdd_err("Target response timed out"); + context->magic = 0; + spin_unlock(&hdd_context_lock); + return -ETIMEDOUT; + } + + spin_unlock(&hdd_context_lock); + ret = hdd_post_encrypt_decrypt_msg_rsp(hdd_ctx, + &encrypt_decrypt_msg_context.response); + if (ret) + hdd_err("Failed to post encrypt/decrypt message response"); + + qdf_mem_free(encrypt_decrypt_msg_context.response.data); + + EXIT(); + return ret; +} + +/** + * hdd_encrypt_decrypt_init () - exposes encrypt/decrypt initialization + * functionality + * @hdd_ctx: hdd context + * + Return: 0 on success, negative errno on failure + */ +int hdd_encrypt_decrypt_init(hdd_context_t *hdd_ctx) +{ + QDF_STATUS status; + + init_completion(&encrypt_decrypt_msg_context.completion); + + status = sme_encrypt_decrypt_msg_register_callback(hdd_ctx->hHal, + hdd_encrypt_decrypt_msg_cb); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("encrypt/decrypt callback failed %d", status); + return -EINVAL; + } + return 0; +} + +/** + * hdd_encrypt_decrypt_deinit () - exposes encrypt/decrypt deinitialization + * functionality + * @hdd_ctx: hdd context + * + Return: 0 on success, negative errno on failure + */ +int hdd_encrypt_decrypt_deinit(hdd_context_t *hdd_ctx) +{ + QDF_STATUS status; + + status = sme_encrypt_decrypt_msg_deregister_callback(hdd_ctx->hHal); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("De-register encrypt/decrypt callback failed: %d", + status); + return 0; +} + +/** + * __wlan_hdd_cfg80211_encrypt_decrypt_msg () - Encrypt/Decrypt msg + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Return: 0 on success, negative errno on failure + */ +static int __wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct net_device *dev = wdev->netdev; + hdd_adapter_t *adapter = NULL; + int ret; + + ENTER_DEV(dev); + + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return ret; + + adapter = WLAN_HDD_GET_PRIV_PTR(dev); + + ret = hdd_encrypt_decrypt_msg(adapter, hdd_ctx, data, data_len); + + return ret; +} + +/** + * wlan_hdd_cfg80211_encrypt_decrypt_msg () - Encrypt/Decrypt msg + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Return: 0 on success, negative errno on failure + */ +int wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_encrypt_decrypt_msg(wiphy, wdev, + data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} diff --git a/core/hdd/src/wlan_hdd_disa.h b/core/hdd/src/wlan_hdd_disa.h new file mode 100644 index 000000000000..b35c02c5dbbe --- /dev/null +++ b/core/hdd/src/wlan_hdd_disa.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2016 The Linux Foundation. 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 + * 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. + */ + +#ifndef _WLAN_HDD_DISA_H +#define _WLAN_HDD_DISA_H + +#include "wlan_hdd_main.h" +#include "sir_api.h" + +#ifdef WLAN_FEATURE_DISA +/** + * hdd_encrypt_decrypt_init () - exposes encrypt/decrypt initialization + * functionality + * @hdd_ctx: hdd context + * + Return: 0 on success, negative errno on failure + */ +int hdd_encrypt_decrypt_init(hdd_context_t *hdd_ctx); + +/** + * hdd_encrypt_decrypt_deinit () - exposes encrypt/decrypt deinitialization + * functionality + * @hdd_ctx: hdd context + * + Return: 0 on success, negative errno on failure + */ +int hdd_encrypt_decrypt_deinit(hdd_context_t *hdd_ctx); +#else +static inline int hdd_encrypt_decrypt_init(hdd_context_t *hdd_ctx) +{ + return -ENOTSUPP; +} +static inline int hdd_encrypt_decrypt_deinit(hdd_context_t *hdd_ctx) +{ + return -ENOTSUPP; +} +#endif + +#ifdef WLAN_FEATURE_DISA +/** + * wlan_hdd_cfg80211_encrypt_decrypt_msg () - Encrypt/Decrypt msg + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Return: 0 on success, negative errno on failure + */ +int wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len); +#endif + +#endif diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 33f9cfc6a96d..9aeee9107f74 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -107,6 +107,7 @@ #include "wlan_hdd_lpass.h" #include "nan_api.h" #include +#include "wlan_hdd_disa.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -4695,8 +4696,7 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx) /* Free up RoC request queue and flush workqueue */ cds_flush_work(&hdd_ctx->roc_req_work); - - + hdd_encrypt_decrypt_deinit(hdd_ctx); wlansap_global_deinit(); wlan_hdd_deinit_tx_rx_histogram(hdd_ctx); wiphy_unregister(wiphy); @@ -7781,6 +7781,7 @@ int hdd_wlan_startup(struct device *dev) goto err_debugfs_exit; memdump_init(); + hdd_encrypt_decrypt_init(hdd_ctx); if (hdd_ctx->config->fIsImpsEnabled) hdd_set_idle_ps_config(hdd_ctx, true); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 43b6ccd0d892..0fdac5c0c888 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -6536,4 +6536,18 @@ struct sme_update_access_policy_vendor_ie { uint8_t access_policy; }; +/** + * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params + * @vdev_id: vdev id + * @status: status + * @data_length: data length + * @data: data pointer + */ +struct sir_encrypt_decrypt_rsp_params { + uint32_t vdev_id; + int32_t status; + uint32_t data_length; + uint8_t *data; +}; + #endif /* __SIR_API_H */ diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index 903f3a6e9500..2b71b5143209 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -633,6 +633,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 360) #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) +#define SIR_HAL_ENCRYPT_DECRYPT_MSG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 9afb984a9d78..15f845510ef9 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1276,4 +1276,44 @@ QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id, */ QDF_STATUS sme_update_session_param(tHalHandle hal, uint8_t session_id, uint32_t param_type, uint32_t param_val); + +/** + * sme_encrypt_decrypt_msg_register_callback() - Registers + * encrypt/decrypt message callback + * + * @hal - MAC global handle + * @callback_routine - callback routine from HDD + * + * This API is invoked by HDD to register its callback in SME + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_encrypt_decrypt_msg_register_callback(tHalHandle hal, + void (*encrypt_decrypt_cb)(void *hdd_context, + struct sir_encrypt_decrypt_rsp_params + *encrypt_decrypt_rsp_params)); + +/** + * sme_encrypt_decrypt_msg_deregister_callback() - Registers + * encrypt/decrypt message callback + * + * @h_hal - MAC global handle + * @callback_routine - callback routine from HDD + * + * This API is invoked by HDD to de-register its callback in SME + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal); + +/** + * sme_encrypt_decrypt_msg() - handles encrypt/decrypt mesaage + * @hal: HAL handle + * @encrypt_decrypt_params: struct to set encryption/decryption params. + * + * Return: QDF_STATUS enumeration. + */ +QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, + struct encrypt_decrypt_req_params *encrypt_decrypt_params); + #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h index 51c135ec235c..0afada7cdf73 100644 --- a/core/sme/inc/sme_internal.h +++ b/core/sme/inc/sme_internal.h @@ -244,6 +244,8 @@ typedef struct tagSmeStruct { p2p_lo_callback p2p_lo_event_callback; void *p2p_lo_event_context; sme_send_oem_data_rsp_msg oem_data_rsp_callback; + void (*encrypt_decrypt_cb)(void *, + struct sir_encrypt_decrypt_rsp_params *); } tSmeStruct, *tpSmeStruct; #endif /* #if !defined( __SMEINTERNAL_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 1a04362b8549..2983525148fc 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16593,3 +16593,134 @@ QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id, sms_log(mac_ctx, LOG1, FL("Set default scan IE status %d"), status); return status; } + +/** + * sme_encrypt_decrypt_msg() - handles encrypt/decrypt mesaage + * @hal: HAL handle + * @encrypt_decrypt_params: struct to set encryption/decryption params. + * + * Return: QDF_STATUS enumeration. + */ +QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, + struct encrypt_decrypt_req_params *encrypt_decrypt_params) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + cds_msg_t cds_msg; + struct encrypt_decrypt_req_params *params; + uint8_t *ptr; + + ptr = qdf_mem_malloc(sizeof(*params) + + encrypt_decrypt_params->data_len); + if (ptr == NULL) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Failed to alloc memory for encrypt/decrypt params")); + return QDF_STATUS_E_NOMEM; + } + + params = (struct encrypt_decrypt_req_params *)ptr; + + *params = *encrypt_decrypt_params; + + if (params->data_len) { + params->data = ptr + sizeof(*params); + + qdf_mem_copy(params->data, encrypt_decrypt_params->data, + params->data_len); + } + + status = sme_acquire_global_lock(&mac_ctx->sme); + if (status == QDF_STATUS_SUCCESS) { + /* Serialize the req through MC thread */ + cds_msg.bodyptr = params; + cds_msg.type = WMA_ENCRYPT_DECRYPT_MSG; + status = cds_mq_post_message(QDF_MODULE_ID_WMA, &cds_msg); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Post encrypt/decrypt msg fail")); + status = QDF_STATUS_E_FAILURE; + qdf_mem_free(params); + } + sme_release_global_lock(&mac_ctx->sme); + } else { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("sme_acquire_global_lock failed")); + qdf_mem_free(params); + } + return status; + +} + +/** + * sme_encrypt_decrypt_msg_register_callback() - Registers + * encrypt/decrypt message callback + * + * @hal - MAC global handle + * @callback_routine - callback routine from HDD + * + * This API is invoked by HDD to register its callback in SME + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_encrypt_decrypt_msg_register_callback(tHalHandle hal, + void (*encrypt_decrypt_cb)(void *hdd_context, + struct sir_encrypt_decrypt_rsp_params + *encrypt_decrypt_rsp_params)) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac; + + if (!hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return QDF_STATUS_E_INVAL; + } + + mac = PMAC_STRUCT(hal); + + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + mac->sme.encrypt_decrypt_cb = encrypt_decrypt_cb; + sme_release_global_lock(&mac->sme); + } else { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("sme_acquire_global_lock failed")); + } + return status; +} + +/** + * sme_encrypt_decrypt_msg_deregister_callback() - Registers + * encrypt/decrypt message callback + * + * @h_hal - MAC global handle + * @callback_routine - callback routine from HDD + * + * This API is invoked by HDD to de-register its callback in SME + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return QDF_STATUS_E_INVAL; + } + + mac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + mac->sme.encrypt_decrypt_cb = NULL; + sme_release_global_lock(&mac->sme); + } else { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("sme_acquire_global_lock failed")); + } + return status; +} diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 08792473b103..f22aea6dac5d 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -415,6 +415,9 @@ static const t_probeTime_dwellTime }; typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo); +typedef void (*encrypt_decrypt_cb)(struct sir_encrypt_decrypt_rsp_params + *encrypt_decrypt_rsp_params); + /** * enum t_wma_drv_type - wma driver type diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 951048c535b0..dcd121e37fdb 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -301,4 +301,6 @@ void wma_process_pdev_hw_mode_trans_ind(void *wma, wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, struct sir_hw_mode_trans_ind *hw_mode_trans_ind); QDF_STATUS wma_set_powersave_config(uint8_t val); +QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma, + struct encrypt_decrypt_req_params *encrypt_decrypt_params); #endif diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index dadac756d645..f35044e57d4a 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1214,4 +1214,7 @@ QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle, struct sir_mac_pwr_dbg_cmd * sir_pwr_dbg_params); +int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data, + uint32_t data_len); + #endif diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index e0fe6e4eb35a..89f06c9db0b5 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -474,6 +474,7 @@ #define WMA_SET_PDEV_IE_REQ SIR_HAL_SET_PDEV_IE_REQ #define WMA_UPDATE_WEP_DEFAULT_KEY SIR_HAL_UPDATE_WEP_DEFAULT_KEY #define WMA_SEND_FREQ_RANGE_CONTROL_IND SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND +#define WMA_ENCRYPT_DECRYPT_MSG SIR_HAL_ENCRYPT_DECRYPT_MSG /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 9a823e8c7932..7850fa73b903 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -8225,3 +8225,108 @@ QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma, uint8_t val) return QDF_STATUS_SUCCESS; } + +/** + * wma_encrypt_decrypt_msg() - + * @encrypt_decrypt_params: encryption/decryption params + * @data_len: data length + * @encrypt_decrypt_cb: encrypt/decrypt callback + * + * This function sends WMI command to check encryption/decryption engine. + * + * Return: QDF_STATUS enumeration + */ +QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE handle, + struct encrypt_decrypt_req_params *encrypt_decrypt_params) +{ + int ret; + tp_wma_handle wma = (tp_wma_handle) handle; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE("%s: WMA is closed, can not issue encrypt/decrypt msg", + __func__); + return QDF_STATUS_E_INVAL; + } + + if (encrypt_decrypt_params == NULL) { + WMA_LOGE("%s: encrypt/decrypt ptr NULL", + __func__); + return QDF_STATUS_E_INVAL; + } + + ret = wmi_unified_encrypt_decrypt_send_cmd(wma->wmi_handle, + encrypt_decrypt_params); + + return ret; +} + +/** + * wma_encrypt_decrypt_msg_handler() - handle encrypt/decrypt data + * indicated by FW + * @handle: wma context + * @data: event buffer + * @data len: length of event buffer + * + * Return: 0 on success + */ +int wma_encrypt_decrypt_msg_handler(void *handle, uint8_t *data, + uint32_t data_len) +{ + WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID_param_tlvs *param_buf; + wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param *data_event; + struct sir_encrypt_decrypt_rsp_params encrypt_decrypt_rsp_params; + tp_wma_handle wma = handle; + u_int8_t *buf_ptr; + tpAniSirGlobal pmac; + + if (data == NULL) { + WMA_LOGE("%s: invalid pointer", __func__); + return -EINVAL; + } + + if (wma == NULL) { + WMA_LOGE("%s: wma context is NULL", __func__); + return -EINVAL; + } + + WMA_LOGE("%s: received WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID ", + __func__); + + pmac = (tpAniSirGlobal)cds_get_context(QDF_MODULE_ID_PE); + + if (!pmac) { + WMA_LOGE("%s: Invalid pmac", __func__); + return -EINVAL; + } + if (!pmac->sme.encrypt_decrypt_cb) { + WMA_LOGE("%s: Callback not registered", __func__); + return -EINVAL; + } + + param_buf = + (WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID_param_tlvs *)data; + if (!param_buf) { + WMA_LOGE("%s: Invalid response data buf", __func__); + return -EINVAL; + } + + data_event = param_buf->fixed_param; + + encrypt_decrypt_rsp_params.vdev_id = data_event->vdev_id; + encrypt_decrypt_rsp_params.status = data_event->status; + encrypt_decrypt_rsp_params.data_length = data_event->data_length; + + if (encrypt_decrypt_rsp_params.data_length) { + buf_ptr = + (uint8_t *)data_event + + sizeof( + wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param) + + WMI_TLV_HDR_SIZE; + + encrypt_decrypt_rsp_params.data = buf_ptr; + } + + pmac->sme.encrypt_decrypt_cb(pmac->hHdd, &encrypt_decrypt_rsp_params); + + return 0; +} diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 35cf0b88b049..00f1735cc44e 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2147,6 +2147,10 @@ QDF_STATUS wma_open(void *cds_context, WMI_BPF_CAPABILIY_INFO_EVENTID, wma_get_bpf_caps_event_handler, WMA_RX_SERIALIZER_CTX); + wmi_unified_register_event_handler(wma_handle->wmi_handle, + WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID, + wma_encrypt_decrypt_msg_handler, + WMA_RX_SERIALIZER_CTX); wma_ndp_register_all_event_handlers(wma_handle); return QDF_STATUS_SUCCESS; @@ -6303,6 +6307,10 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) case WMA_SEND_FREQ_RANGE_CONTROL_IND: wma_enable_disable_caevent_ind(wma_handle, msg->bodyval); break; + case WMA_ENCRYPT_DECRYPT_MSG: + wma_encrypt_decrypt_msg(wma_handle, msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ -- cgit v1.2.3 From c1485fdaebdc4bb3401c00deef8ec2cc3102438c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 12:40:53 -0700 Subject: Release 5.1.0.28Y Release 5.1.0.28Y Change-Id: Ifb088de83a4b42476391763c5bfadf988cc62570 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4e4da084b5c0..28987f264018 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28X" +#define QWLAN_VERSIONSTR "5.1.0.28Y" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 88de6fb76545dd295d7683f4716ca98fb13f7f61 Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Fri, 23 Sep 2016 17:08:44 -0700 Subject: qcacld-3.0: Fix call to duplicate vdev detach Null pointer dereference due to duplicate vdev detach call. Vdev detach is triggered as part of the delete self sta but in failure scenario del bss request timeout handler also called the vdev detach which triggered NULL pointer dereference in OL layer. -Fix the del bss request timeout handler by adding more condition checks specific to P2P as the changes are related to P2P. -Remove vdev stop from the vdev start timeout handler. Change-Id: Ibe848c89823efbb10f7dcc193157189106ba238b CRs-Fixed: 1070817 --- core/wma/src/wma_dev_if.c | 55 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 49 deletions(-) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index c83f797c449d..d3d479e8f427 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -424,6 +424,7 @@ void wma_vdev_detach_callback(void *ctx) return; } param = (struct del_sta_self_params *) iface->del_staself_req; + iface->del_staself_req = NULL; WMA_LOGE("%s: sending eWNI_SME_DEL_STA_SELF_RSP for vdev %d", __func__, param->session_id); if (!WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap, @@ -1483,7 +1484,9 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info, 0); } - if (iface->del_staself_req) { + if ((iface->del_staself_req != NULL) && + (iface->type == WMI_VDEV_TYPE_AP) && + (iface->sub_type == WMI_UNIFIED_VDEV_SUBTYPE_P2P_GO)) { WMA_LOGA("scheduling defered deletion (vdev id %x)", resp_event->vdev_id); wma_vdev_detach(wma, iface->del_staself_req, 1); @@ -2520,60 +2523,14 @@ void wma_vdev_resp_timer(void *data) qdf_mem_zero(iface, sizeof(*iface)); } else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) { tpAddBssParams params = (tpAddBssParams) tgt_req->user_data; - tDeleteBssParams *del_bss_params = - qdf_mem_malloc(sizeof(tDeleteBssParams)); - if (NULL == del_bss_params) { - WMA_LOGE("Failed to allocate memory for del_bss_params"); - peer = ol_txrx_find_peer_by_addr(pdev, params->bssId, - &peer_id); - goto error0; - } - - del_bss_params->status = params->status = - QDF_STATUS_FW_MSG_TIMEDOUT; - del_bss_params->sessionId = params->sessionId; - del_bss_params->bssIdx = params->bssIdx; - qdf_mem_copy(del_bss_params->bssid, params->bssId, - sizeof(tSirMacAddr)); WMA_LOGA("%s: WMA_ADD_BSS_REQ timedout", __func__); - peer = ol_txrx_find_peer_by_addr(pdev, params->bssId, &peer_id); - if (!peer) { - WMA_LOGP("%s: Failed to find peer %pM", __func__, - params->bssId); - } - msg = wma_fill_vdev_req(wma, tgt_req->vdev_id, WMA_DELETE_BSS_REQ, - WMA_TARGET_REQ_TYPE_VDEV_STOP, - del_bss_params, - WMA_VDEV_STOP_REQUEST_TIMEOUT); - if (!msg) { - WMA_LOGP("%s: Failed to fill vdev request for vdev_id %d", - __func__, tgt_req->vdev_id); - goto error0; - } - WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (WDA_ADD_BSS_REQ timedout)", - __func__, tgt_req->vdev_id); - ol_txrx_vdev_pause(wma->interfaces[tgt_req->vdev_id].handle, - OL_TXQ_PAUSE_REASON_VDEV_STOP); - wma->interfaces[tgt_req->vdev_id].pause_bitmap |= - (1 << PAUSE_TYPE_HOST); - if (wmi_unified_vdev_stop_send - (wma->wmi_handle, tgt_req->vdev_id)) { - WMA_LOGP("%s: %d Failed to send vdev stop", __func__, - __LINE__); - wma_remove_vdev_req(wma, tgt_req->vdev_id, - WMA_TARGET_REQ_TYPE_VDEV_STOP); - goto error0; - } WMA_LOGI("%s: bssid %pM vdev_id %d", __func__, params->bssId, tgt_req->vdev_id); wma_send_msg(wma, WMA_ADD_BSS_RSP, (void *)params, 0); + QDF_ASSERT(0); goto free_tgt_req; -error0: - if (peer) - wma_remove_peer(wma, params->bssId, - tgt_req->vdev_id, peer, false); - wma_send_msg(wma, WMA_ADD_BSS_RSP, (void *)params, 0); + } else if (tgt_req->msg_type == WMA_OCB_SET_CONFIG_CMD) { struct wma_txrx_node *iface; -- cgit v1.2.3 From f19292b1722ba73e19bb7a2201ba941ac6f3a4b7 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 13:14:40 -0700 Subject: Release 5.1.0.28Z Release 5.1.0.28Z Change-Id: I5c8c3ffe8ace5505359d4537f832d0a56cefe221 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 28987f264018..deb68a969eac 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "5.1.0.28Y" +#define QWLAN_VERSIONSTR "5.1.0.28Z" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From e87005ca56beecddf464f4d7b79b2fde0133ce69 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Tue, 23 Aug 2016 16:57:30 -0700 Subject: qcacld-3.0: Fix incorrect log levels in CFG INI Reduce the level of non error logs to notice. CRs-Fixed: 936397 Change-Id: Ia433e9ec2b9bae151591e1d9db95dfbdbe527281 --- core/hdd/src/wlan_hdd_cfg.c | 92 +++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 50 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index f3519ef35a21..4a21c6cbf385 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -5471,78 +5471,70 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, "Name = [gP2PListenDeferInterval] Value = [%u]", pHddCtx->config->p2p_listen_defer_interval); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [is_ps_enabled] value = [%d]", - pHddCtx->config->is_ps_enabled); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [tso_enable] value = [%d]", + hdd_notice("Name = [is_ps_enabled] value = [%d]", + pHddCtx->config->is_ps_enabled); + hdd_notice("Name = [tso_enable] value = [%d]", pHddCtx->config->tso_enable); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [LROEnable] value = [%d]", + hdd_notice("Name = [LROEnable] value = [%d]", pHddCtx->config->lro_enable); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [active_mode_offload] value = [%d]", + hdd_notice("Name = [active_mode_offload] value = [%d]", pHddCtx->config->active_mode_offload); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [gfine_time_meas_cap] value = [%u]", + hdd_notice("Name = [gfine_time_meas_cap] value = [%u]", pHddCtx->config->fine_time_meas_cap); #ifdef WLAN_FEATURE_FASTPATH QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, "Name = [fastpath_enable] Value = [%u]", pHddCtx->config->fastpath_enable); #endif - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [max_scan_count] value = [%d]", + hdd_notice("Name = [max_scan_count] value = [%d]", pHddCtx->config->max_scan_count); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [%s] value = [%d]", + hdd_notice("Name = [%s] value = [%d]", CFG_RX_MODE_NAME, pHddCtx->config->rx_mode); QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, "Name = [%s] Value = [%u]", CFG_CE_CLASSIFY_ENABLE_NAME, pHddCtx->config->ce_classify_enabled); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Name = [%s] value = [%u]", + hdd_notice("Name = [%s] value = [%u]", CFG_DUAL_MAC_FEATURE_DISABLE, pHddCtx->config->dual_mac_feature_disable); #ifdef FEATURE_WLAN_SCAN_PNO - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_PNO_CHANNEL_PREDICTION_NAME, - pHddCtx->config->pno_channel_prediction); - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_TOP_K_NUM_OF_CHANNELS_NAME, - pHddCtx->config->top_k_num_of_channels); - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_STATIONARY_THRESHOLD_NAME, - pHddCtx->config->stationary_thresh); - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_NAME, - pHddCtx->config->channel_prediction_full_scan); - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_NAME, - pHddCtx->config->pnoscan_adaptive_dwell_mode); + hdd_notice("Name = [%s] Value = [%u]", + CFG_PNO_CHANNEL_PREDICTION_NAME, + pHddCtx->config->pno_channel_prediction); + hdd_notice("Name = [%s] Value = [%u]", + CFG_TOP_K_NUM_OF_CHANNELS_NAME, + pHddCtx->config->top_k_num_of_channels); + hdd_notice("Name = [%s] Value = [%u]", + CFG_STATIONARY_THRESHOLD_NAME, + pHddCtx->config->stationary_thresh); + hdd_notice("Name = [%s] Value = [%u]", + CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_NAME, + pHddCtx->config->channel_prediction_full_scan); + hdd_notice("Name = [%s] Value = [%u]", + CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_NAME, + pHddCtx->config->pnoscan_adaptive_dwell_mode); #endif - hddLog(LOGE, "Name = [%s] Value = [%d]", - CFG_EARLY_STOP_SCAN_ENABLE, - pHddCtx->config->early_stop_scan_enable); - hddLog(LOGE, "Name = [%s] Value = [%d]", - CFG_EARLY_STOP_SCAN_MIN_THRESHOLD, - pHddCtx->config->early_stop_scan_min_threshold); - hddLog(LOGE, "Name = [%s] Value = [%d]", - CFG_EARLY_STOP_SCAN_MAX_THRESHOLD, - pHddCtx->config->early_stop_scan_max_threshold); - hddLog(LOGE, "Name = [%s] Value = [%d]", - CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME, - pHddCtx->config->first_scan_bucket_threshold); - hddLog(LOGE, "Name = [%s] Value = [%u]", - CFG_HT_MPDU_DENSITY_NAME, - pHddCtx->config->ht_mpdu_density); + hdd_notice("Name = [%s] Value = [%d]", + CFG_EARLY_STOP_SCAN_ENABLE, + pHddCtx->config->early_stop_scan_enable); + hdd_notice("Name = [%s] Value = [%d]", + CFG_EARLY_STOP_SCAN_MIN_THRESHOLD, + pHddCtx->config->early_stop_scan_min_threshold); + hdd_notice("Name = [%s] Value = [%d]", + CFG_EARLY_STOP_SCAN_MAX_THRESHOLD, + pHddCtx->config->early_stop_scan_max_threshold); + hdd_notice("Name = [%s] Value = [%d]", + CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME, + pHddCtx->config->first_scan_bucket_threshold); + hdd_notice("Name = [%s] Value = [%u]", + CFG_HT_MPDU_DENSITY_NAME, + pHddCtx->config->ht_mpdu_density); #ifdef FEATURE_LFR_SUBNET_DETECTION - hddLog(LOGE, "Name = [%s] Value = [%d]", - CFG_ENABLE_LFR_SUBNET_DETECTION, - pHddCtx->config->enable_lfr_subnet_detection); + hdd_notice("Name = [%s] Value = [%d]", + CFG_ENABLE_LFR_SUBNET_DETECTION, + pHddCtx->config->enable_lfr_subnet_detection); #endif hdd_info("Name = [%s] Value = [%u]", CFG_ROAM_DENSE_TRAFFIC_THRESHOLD, -- cgit v1.2.3 From dfb6f852b99b2b24f521dade2b0198be5757d60f Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Fri, 19 Aug 2016 17:25:29 -0700 Subject: qcacld-3.0: Fix HDD logging API in wlan_hdd_p2p Use only HDD logging API to prevent check patch errors CRs-Fixed: 937681 Change-Id: I76b11c6783d123c727de4e88e46f9360ba54b0bd --- core/hdd/src/wlan_hdd_p2p.c | 335 +++++++++++++++++--------------------------- 1 file changed, 125 insertions(+), 210 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 662660da8b76..193a0d26d926 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -178,13 +178,11 @@ QDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx, if (pRemainChanCtx == NULL) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOGW, - "%s: No Rem on channel pending for which Rsp is received", - __func__); + hdd_warn("No Rem on channel pending for which Rsp is received"); return QDF_STATUS_SUCCESS; } - hddLog(LOG1, "Received remain on channel rsp"); + hdd_notice("Received remain on channel rsp"); qdf_mc_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer); qdf_mc_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer); @@ -271,7 +269,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) mutex_lock(&cfgState->remain_on_chan_ctx_lock); if (cfgState->remain_on_chan_ctx != NULL) { - hddLog(LOGE, "Cancel Existing Remain on Channel"); + hdd_err("Cancel Existing Remain on Channel"); if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer)) @@ -282,17 +280,13 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) if (pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress == true) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOGE, - "ROC timer cancellation in progress," - " wait for completion"); + hdd_err("ROC timer cancellation in progress wait for completion"); rc = wait_for_completion_timeout(&pAdapter-> cancel_rem_on_chan_var, msecs_to_jiffies (WAIT_CANCEL_REM_CHAN)); if (!rc) { - hddLog(LOGE, - "%s:wait on cancel_rem_on_chan_var timed out", - __func__); + hdd_err("wait on cancel_rem_on_chan_var timed out"); } return; } @@ -308,9 +302,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) msecs_to_jiffies (WAIT_REM_CHAN_READY)); if (!rc) { - hddLog(LOGE, - "%s: timeout waiting for remain on channel ready indication", - __func__); + hdd_err("timeout waiting for remain on channel ready indication"); cds_flush_logs(WLAN_LOG_TYPE_FATAL, WLAN_LOG_INDICATOR_HOST_DRIVER, WLAN_LOG_REASON_HDD_TIME_OUT, @@ -345,9 +337,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) (WAIT_CANCEL_REM_CHAN)); if (!rc) { - hddLog(LOGE, - "%s: timeout waiting for cancel remain on channel ready" - " indication", __func__); + hdd_err("timeout waiting for cancel remain on channel ready indication"); } hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); } else @@ -368,8 +358,7 @@ int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter) wlan_hdd_cancel_existing_remain_on_channel (pAdapter); } else { - hddLog(LOG1, - "Cannot Cancel Existing Remain on Channel"); + hdd_notice("Cannot Cancel Existing Remain on Channel"); status = -EBUSY; } } @@ -391,9 +380,7 @@ void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter) unsigned long rc; hdd_cfg80211_state_t *cfg_state = WLAN_HDD_GET_CFG_STATE_PTR(adapter); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: ROC completion is not received.!!!", - __func__); + hdd_err("ROC completion is not received !!!"); mutex_lock(&cfg_state->remain_on_chan_ctx_lock); roc_ctx = cfg_state->remain_on_chan_ctx; @@ -429,10 +416,7 @@ wait: msecs_to_jiffies (WAIT_CANCEL_REM_CHAN)); if (!rc) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Timeout occurred while waiting for RoC Cancellation", - __func__); + hdd_err("Timeout occurred while waiting for RoC Cancellation"); mutex_lock(&cfg_state->remain_on_chan_ctx_lock); roc_ctx = cfg_state->remain_on_chan_ctx; if (roc_ctx != NULL) { @@ -463,9 +447,8 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter) mutex_lock(&cfgState->remain_on_chan_ctx_lock); while (pAdapter->is_roc_inprogress) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: ROC in progress for session %d!!!", - __func__, pAdapter->sessionId); + hdd_err("ROC in progress for session %d!!!", + pAdapter->sessionId); msleep(500); if (retry++ > 3) { wlan_hdd_cancel_pending_roc(pAdapter); @@ -497,19 +480,19 @@ void wlan_hdd_remain_on_chan_timeout(void *data) if (NULL == pRemainChanCtx) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOGE, "%s: No Remain on channel is pending", __func__); + hdd_err("No Remain on channel is pending"); return; } if (true == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOGE, FL("Cancellation already in progress")); + hdd_err("Cancellation already in progress"); return; } pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = true; mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOG1, "%s: Cancel Remain on Channel on timeout", __func__); + hdd_notice("Cancel Remain on Channel on timeout"); if ((QDF_STA_MODE == pAdapter->device_mode) || (QDF_P2P_CLIENT_MODE == pAdapter->device_mode) || @@ -546,8 +529,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, mutex_lock(&cfgState->remain_on_chan_ctx_lock); if (pAdapter->is_roc_inprogress == true) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("remain on channel request is in execution")); + hdd_err("remain on channel request is in execution"); return -EBUSY; } @@ -562,8 +544,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, QDF_TIMER_TYPE_SW, wlan_hdd_remain_on_chan_timeout, pAdapter); if (qdf_status != QDF_STATUS_SUCCESS) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("Not able to initialize remain_on_chan timer")); + hdd_err("Not able to initialize remain_on_chan timer"); mutex_lock(&cfgState->remain_on_chan_ctx_lock); cfgState->remain_on_chan_ctx = NULL; pAdapter->is_roc_inprogress = false; @@ -608,7 +589,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, (pRemainChanCtx->rem_on_chan_request == REMAIN_ON_CHANNEL_REQUEST) ? true : false, &pRemainChanCtx->scan_id)) { - hddLog(LOGE, FL("sme_remain_on_channel failed")); + hdd_err("sme_remain_on_channel failed"); mutex_lock(&cfgState->remain_on_chan_ctx_lock); cfgState->remain_on_chan_ctx = NULL; pAdapter->is_roc_inprogress = false; @@ -628,8 +609,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, (SIR_MAC_MGMT_FRAME << 2) | (SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0)) - hddLog(LOGE, - FL("sme_register_mgmt_frame failed")); + hdd_err("sme_register_mgmt_frame failed"); } } else if ((QDF_SAP_MODE == pAdapter->device_mode) || @@ -640,7 +620,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, pRemainChanCtx->chan.hw_value, duration, wlan_hdd_remain_on_channel_callback, pAdapter, &pRemainChanCtx->scan_id)) { - hddLog(LOGE, FL("wlansap_remain_on_channel failed")); + hdd_err("wlansap_remain_on_channel failed"); mutex_lock(&cfgState->remain_on_chan_ctx_lock); cfgState->remain_on_chan_ctx = NULL; pAdapter->is_roc_inprogress = false; @@ -656,8 +636,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), (SIR_MAC_MGMT_FRAME << 2) | (SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - FL("wlansap_register_mgmt_frame return fail")); + hdd_err("wlansap_register_mgmt_frame return fail"); wlansap_cancel_remain_on_channel( WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), pRemainChanCtx->scan_id); @@ -691,7 +670,7 @@ static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter, hdd_roc_req = qdf_mem_malloc(sizeof(*hdd_roc_req)); if (NULL == hdd_roc_req) { - hddLog(LOGP, FL("malloc failed for roc req context")); + hdd_alert("malloc failed for roc req context"); return -ENOMEM; } @@ -705,7 +684,7 @@ static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter, qdf_spin_unlock(&hdd_ctx->hdd_roc_req_q_lock); if (QDF_STATUS_SUCCESS != status) { - hddLog(LOGP, FL("Not able to enqueue RoC Req context")); + hdd_alert("Not able to enqueue RoC Req context"); qdf_mem_free(hdd_roc_req); return -EINVAL; } @@ -785,8 +764,7 @@ void wlan_hdd_roc_request_dequeue(struct work_struct *work) hdd_roc_req->pAdapter, hdd_roc_req->pRemainChanCtx); if (ret == -EBUSY) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("dropping RoC request")); + hdd_err("dropping RoC request"); wlan_hdd_indicate_roc_drop(hdd_roc_req->pAdapter, hdd_roc_req->pRemainChanCtx); qdf_mem_free(hdd_roc_req->pRemainChanCtx); @@ -813,25 +791,22 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, ENTER(); - hddLog(LOG1, FL("Device_mode %s(%d)"), - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode); - hddLog(LOG1, - "chan(hw_val)0x%x chan(centerfreq) %d, duration %d", - chan->hw_value, chan->center_freq, duration); + hdd_notice("Device_mode %s(%d)", + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode); + hdd_info("chan(hw_val)0x%x chan(centerfreq) %d, duration %d", + chan->hw_value, chan->center_freq, duration); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) return ret; if (cds_is_connection_in_progress()) { - hddLog(LOGE, FL("Connection is in progress")); + hdd_err("Connection is in progress"); isBusy = true; } pRemainChanCtx = qdf_mem_malloc(sizeof(hdd_remain_on_chan_ctx_t)); if (NULL == pRemainChanCtx) { - hddLog(QDF_TRACE_LEVEL_FATAL, - "%s: Not able to allocate memory for Channel context", - __func__); + hdd_alert("Not able to allocate memory for Channel context"); return -ENOMEM; } @@ -864,7 +839,7 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, schedule_delayed_work(&pHddCtx->roc_req_work, msecs_to_jiffies( pHddCtx->config->p2p_listen_defer_interval)); - hddLog(LOG1, "Defer interval is %hu, pAdapter %p", + hdd_info("Defer interval is %hu, pAdapter %p", pHddCtx->config->p2p_listen_defer_interval, pAdapter); return 0; @@ -928,7 +903,7 @@ int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, return ret; if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return -EINVAL; } @@ -968,11 +943,11 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, QDF_STATUS status; if (NULL == pAdapter) { - hddLog(LOGE, FL("pAdapter is NULL")); + hdd_err("pAdapter is NULL"); return; } cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); - hddLog(LOG1, "Ready on chan ind %d", scan_id); + hdd_notice("Ready on chan ind %d", scan_id); pAdapter->start_roc_ts = qdf_mc_timer_get_system_time(); mutex_lock(&cfgState->remain_on_chan_ctx_lock); @@ -986,7 +961,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( &pRemainChanCtx->hdd_remain_on_chan_timer)) { - hddLog(LOGE, "Timer Started before ready event!!!"); + hdd_err("Timer Started before ready event!!!"); qdf_mc_timer_stop(&pRemainChanCtx-> hdd_remain_on_chan_timer); } @@ -996,8 +971,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, (pRemainChanCtx->duration + COMPLETE_EVENT_PROPOGATE_TIME)); if (status != QDF_STATUS_SUCCESS) { - hddLog(LOGE, "%s: Remain on Channel timer start failed", - __func__); + hdd_err("Remain on Channel timer start failed"); } if (REMAIN_ON_CHANNEL_REQUEST == @@ -1016,9 +990,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, } /* Check for cached action frame */ if (pRemainChanCtx->action_pkt_buff.frame_length != 0) { - hddLog(LOGE, - "%s: Sent cached action frame to supplicant", - __func__); + hdd_err("Sent cached action frame to supplicant"); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, pRemainChanCtx->action_pkt_buff.freq, 0, @@ -1048,8 +1020,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, } complete(&pAdapter->rem_on_chan_ready_event); } else { - hddLog(LOGW, "%s: No Pending Remain on channel Request", - __func__); + hdd_warn("No Pending Remain on channel Request"); } mutex_unlock(&cfgState->remain_on_chan_ctx_lock); return; @@ -1073,7 +1044,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, ENTER(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return -EINVAL; } @@ -1105,9 +1076,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, if ((cfgState->remain_on_chan_ctx == NULL) || (cfgState->remain_on_chan_ctx->cookie != cookie)) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOGE, - "%s: No Remain on channel pending with specified cookie value", - __func__); + hdd_err("No Remain on channel pending with specified cookie value"); return -EINVAL; } @@ -1117,17 +1086,13 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, if (true == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog(LOG1, - FL("ROC timer cancellation in progress," - " wait for completion")); + hdd_notice("ROC timer cancellation in progress, wait for completion"); rc = wait_for_completion_timeout(&pAdapter-> cancel_rem_on_chan_var, msecs_to_jiffies (WAIT_CANCEL_REM_CHAN)); if (!rc) { - hddLog(LOGE, - "%s:wait on cancel_rem_on_chan_var timed out", - __func__); + hdd_err("wait on cancel_rem_on_chan_var timed out"); } return 0; } else @@ -1141,9 +1106,7 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, rc = wait_for_completion_timeout(&pAdapter->rem_on_chan_ready_event, msecs_to_jiffies(WAIT_REM_CHAN_READY)); if (!rc) { - hddLog(LOGE, - "%s: timeout waiting for remain on channel ready indication", - __func__); + hdd_err("timeout waiting for remain on channel ready indication"); if (cds_is_driver_recovering()) { hdd_err("Recovery in Progress. State: 0x%x Ignore!!!", @@ -1177,18 +1140,16 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, pRemainChanCtx->scan_id); } else { - hddLog(LOGE, FL("Invalid device_mode %s(%d)"), - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode); + hdd_err("Invalid device_mode %s(%d)", + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode); return -EIO; } rc = wait_for_completion_timeout(&pAdapter->cancel_rem_on_chan_var, msecs_to_jiffies (WAIT_CANCEL_REM_CHAN)); if (!rc) { - hddLog(LOGE, - "%s:wait on cancel_rem_on_chan_var timed out ", - __func__); + hdd_err("wait on cancel_rem_on_chan_var timed out"); } hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); EXIT(); @@ -1235,7 +1196,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, ENTER(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return -EINVAL; } @@ -1247,13 +1208,13 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, if (0 != status) return status; - hddLog(LOG1, FL("Device_mode %s(%d) type: %d, wait: %d, offchan: %d, category: %d, actionId: %d"), - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode, type, wait, offchan, - buf[WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET + - WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET], - buf[WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET + - WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET]); + hdd_notice("Device_mode %s(%d) type: %d, wait: %d, offchan: %d, category: %d, actionId: %d", + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode, type, wait, offchan, + buf[WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET + + WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET], + buf[WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET + + WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET]); #ifdef WLAN_FEATURE_P2P_DEBUG if ((type == SIR_MAC_MGMT_FRAME) && @@ -1262,13 +1223,12 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, [WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET])) { actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; if (actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "[P2P] unknown[%d] ---> OTA to " MAC_ADDRESS_STR, - actionFrmType, - MAC_ADDR_ARRAY(&buf - [WLAN_HDD_80211_FRM_DA_OFFSET])); + hdd_err("[P2P] unknown[%d] ---> OTA to " MAC_ADDRESS_STR, + actionFrmType, + MAC_ADDR_ARRAY(&buf + [WLAN_HDD_80211_FRM_DA_OFFSET])); } else { - hddLog(QDF_TRACE_LEVEL_ERROR, "[P2P] %s ---> OTA to " + hdd_err("[P2P] %s ---> OTA to " MAC_ADDRESS_STR, p2p_action_frame_type[actionFrmType], MAC_ADDR_ARRAY(&buf @@ -1276,16 +1236,13 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, if ((actionFrmType == WLAN_HDD_PROV_DIS_REQ) && (global_p2p_connection_status == P2P_NOT_ACTIVE)) { global_p2p_connection_status = P2P_GO_NEG_PROCESS; - hddLog(LOGE, "[P2P State]Inactive state to " - "GO negotiation progress state"); + hdd_err("[P2P State]Inactive state to GO negotiation progress state"); } else if ((actionFrmType == WLAN_HDD_GO_NEG_CNF) && (global_p2p_connection_status == P2P_GO_NEG_PROCESS)) { global_p2p_connection_status = P2P_GO_NEG_COMPLETED; - hddLog(LOGE, - "[P2P State]GO nego progress to GO nego" - " completed state"); + hdd_err("[P2P State]GO nego progress to GO nego completed state"); } } } @@ -1345,10 +1302,9 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, memcpy(&dstMac, &buf[WLAN_HDD_80211_FRM_DA_OFFSET], ETH_ALEN); - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: Deauth/Disassoc received for STA:" - MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(dstMac)); + hdd_info("Deauth/Disassoc received for STA:" + MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(dstMac)); goto err_rem_channel; } } @@ -1356,22 +1312,18 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, if (NULL != cfgState->buf) { if (!noack) { - hddLog(LOGE, - "(%s):Previous P2P Action frame packet pending", - __func__); + hdd_err("Previous P2P Action frame packet pending"); hdd_cleanup_actionframe(pAdapter->pHddCtx, pAdapter); } else { - hddLog(LOGE, - "(%s):Pending Action frame packet return EBUSY", - __func__); + hdd_err("Pending Action frame packet return EBUSY"); return -EBUSY; } } if (subType == SIR_MAC_MGMT_ACTION) { - hddLog(LOG1, "Action frame tx request : %s", - hdd_get_action_string(buf - [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); + hdd_notice("Action frame tx request : %s", + hdd_get_action_string(buf + [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); } if (pAdapter->device_mode == QDF_SAP_MODE) { @@ -1390,8 +1342,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, home_ch)) { /* if adapter is already on requested ch, no need for ROC */ wait = 0; - hddLog(LOG1, - FL("Adapter already on requested ch. No ROC needed")); + hdd_notice("Adapter already on requested ch. No ROC needed"); goto send_frame; } @@ -1451,9 +1402,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, hdd_remain_on_chan_timer, wait); if (status != QDF_STATUS_SUCCESS) { - hddLog(LOGE, - "%s: Remain on Channel timer start failed", - __func__); + hdd_err("Remain on Channel timer start failed"); } mutex_unlock(&cfgState-> remain_on_chan_ctx_lock); @@ -1464,17 +1413,14 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, true) { mutex_unlock(&cfgState-> remain_on_chan_ctx_lock); - hddLog(QDF_TRACE_LEVEL_INFO, - "action frame tx: waiting for completion of ROC "); + hdd_info("action frame tx: waiting for completion of ROC "); rc = wait_for_completion_timeout (&pAdapter->cancel_rem_on_chan_var, msecs_to_jiffies (WAIT_CANCEL_REM_CHAN)); if (!rc) { - hddLog(LOGE, - "%s:wait on cancel_rem_on_chan_var timed out", - __func__); + hdd_err("wait on cancel_rem_on_chan_var timed out"); } } else @@ -1487,7 +1433,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, if ((cfgState->remain_on_chan_ctx != NULL) && (cfgState->current_freq == chan->center_freq) ) { - hddLog(LOG1, "action frame: extending the wait time"); + hdd_notice("action frame: extending the wait time"); extendedWait = (uint16_t) wait; goto send_frame; } @@ -1514,7 +1460,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, msecs_to_jiffies (WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX)); if (!rc) { - hddLog(LOGE, "wait on offchannel_tx_event timed out"); + hdd_err("wait on offchannel_tx_event timed out"); goto err_rem_channel; } } else if (offchan) { @@ -1577,17 +1523,15 @@ send_frame: [WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET])) { actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; - hddLog(LOG1, "Tx Action Frame %u", actionFrmType); + hdd_notice("Tx Action Frame %u", actionFrmType); if (actionFrmType == WLAN_HDD_PROV_DIS_REQ) { cfgState->actionFrmState = HDD_PD_REQ_ACK_PENDING; - hddLog(LOG1, "%s: HDD_PD_REQ_ACK_PENDING", - __func__); + hdd_notice("HDD_PD_REQ_ACK_PENDING"); } else if (actionFrmType == WLAN_HDD_GO_NEG_REQ) { cfgState->actionFrmState = HDD_GO_NEG_REQ_ACK_PENDING; - hddLog(LOG1, "%s: HDD_GO_NEG_REQ_ACK_PENDING", - __func__); + hdd_notice("HDD_GO_NEG_REQ_ACK_PENDING"); } } @@ -1595,8 +1539,7 @@ send_frame: sme_send_action(WLAN_HDD_GET_HAL_CTX(pAdapter), sessionId, buf, len, extendedWait, noack, current_freq)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: sme_send_action returned fail", __func__); + hdd_err("sme_send_action returned fail"); goto err; } } else if (QDF_SAP_MODE == pAdapter->device_mode || @@ -1604,8 +1547,7 @@ send_frame: if (QDF_STATUS_SUCCESS != wlansap_send_action(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), buf, len, 0, current_freq)) { - hddLog(LOGE, - FL("wlansap_send_action returned fail")); + hdd_err("wlansap_send_action returned fail"); goto err; } } @@ -1785,21 +1727,18 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) param = strnchr(command, strlen(command), ' '); if (param == NULL) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: strnchr failed to find delimeter", __func__); + hdd_err("strnchr failed to find delimeter"); return -EINVAL; } param++; ret = sscanf(param, "%d %d %d", &count, &interval, &duration); if (ret != 3) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: P2P_SET GO NoA: fail to read params, ret=%d", - __func__, ret); + hdd_err("P2P_SET GO NoA: fail to read params, ret=%d", + ret); return -EINVAL; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: P2P_SET GO NoA: count=%d interval=%d duration=%d", - __func__, count, interval, duration); + hdd_info("P2P_SET GO NoA: count=%d interval=%d duration=%d", + count, interval, duration); duration = MS_TO_TU_MUS(duration); /* PS Selection * Periodic NoA (2) @@ -1820,10 +1759,9 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) NoA.count = count; NoA.sessionid = pAdapter->sessionId; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d " + hdd_info("P2P_PS_ATTR:oppPS %d ctWindow %d duration %d " "interval %d count %d single noa duration %d " - "PsSelection %x", __func__, NoA.opp_ps, + "PsSelection %x", NoA.opp_ps, NoA.ctWindow, NoA.duration, NoA.interval, NoA.count, NoA.single_noa_duration, NoA.psSelection); @@ -2010,7 +1948,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, ENTER(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return ERR_PTR(-EINVAL); } @@ -2031,10 +1969,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, && QDF_P2P_GO_MODE != session_type && QDF_P2P_CLIENT_MODE != session_type && QDF_STA_MODE != session_type) { - hddLog(LOGE, - "%s: Interface type %d already exists. " - "Two interfaces of same type are not supported currently.", - __func__, type); + hdd_err("Interface type %d already exists. Two interfaces of same type are not supported currently.", + type); return ERR_PTR(-EINVAL); } @@ -2046,8 +1982,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, if (scan_info->mScanPending) { hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId, eCSR_SCAN_ABORT_DEFAULT); - hddLog(LOG1, - FL("Abort Scan while adding virtual interface")); + hdd_notice("Abort Scan while adding virtual interface"); } } @@ -2077,8 +2012,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, } if (NULL == pAdapter) { - hddLog(QDF_TRACE_LEVEL_ERROR, "%s: hdd_open_adapter failed", - __func__); + hdd_err("hdd_open_adapter failed"); return ERR_PTR(-ENOSPC); } @@ -2177,16 +2111,16 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) ENTER(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return -EINVAL; } MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_DEL_VIRTUAL_INTF, pVirtAdapter->sessionId, pVirtAdapter->device_mode)); - hddLog(LOG1, FL("Device_mode %s(%d)"), - hdd_device_mode_to_string(pVirtAdapter->device_mode), - pVirtAdapter->device_mode); + hdd_notice("Device_mode %s(%d)", + hdd_device_mode_to_string(pVirtAdapter->device_mode), + pVirtAdapter->device_mode); status = wlan_hdd_validate_context(pHddCtx); @@ -2290,22 +2224,22 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL; hdd_context_t *pHddCtx; - hddLog(QDF_TRACE_LEVEL_INFO, "%s: Frame Type = %d Frame Length = %d", - __func__, frameType, nFrameLength); + hdd_info("Frame Type = %d Frame Length = %d", + frameType, nFrameLength); if (NULL == pAdapter) { - hddLog(LOGE, FL("pAdapter is NULL")); + hdd_err("pAdapter is NULL"); return; } pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if (0 == nFrameLength) { - hddLog(LOGE, FL("Frame Length is Invalid ZERO")); + hdd_err("Frame Length is Invalid ZERO"); return; } if (NULL == pbFrames) { - hddLog(LOGE, FL("pbFrames is NULL")); + hdd_err("pbFrames is NULL"); return; } @@ -2324,25 +2258,23 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, * frame with BCST as destination, * we are dropping action frame */ - hddLog(LOGP, - "pAdapter for action frame is NULL Macaddr = " - MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(&pbFrames - [WLAN_HDD_80211_FRM_DA_OFFSET])); - hddLog(LOGP, - FL("Frame Type = %d Frame Length = %d subType = %d"), + hdd_alert("pAdapter for action frame is NULL Macaddr = " + MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(&pbFrames + [WLAN_HDD_80211_FRM_DA_OFFSET])); + hdd_alert("Frame Type = %d Frame Length = %d subType = %d", frameType, nFrameLength, subType); return; } } if (NULL == pAdapter->dev) { - hddLog(LOGE, FL("pAdapter->dev is NULL")); + hdd_err("pAdapter->dev is NULL"); return; } if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { - hddLog(LOGE, FL("pAdapter has invalid magic")); + hdd_err("pAdapter has invalid magic"); return; } @@ -2373,8 +2305,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, actionFrmType = pbFrames [WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; - hddLog(LOG1, "Rx Action Frame %u", - actionFrmType); + hdd_info("Rx Action Frame %u", + actionFrmType); wlan_hdd_p2p_action_debug(actionFrmType, macFrom); @@ -2391,8 +2323,7 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, WLAN_HDD_DEV_DIS_REQ || actionFrmType == WLAN_HDD_PROV_DIS_REQ) { - hddLog(LOG1, - "Extend RoC timer on reception of Action Frame"); + hdd_notice("Extend RoC timer on reception of Action Frame"); if ((actionFrmType == WLAN_HDD_GO_NEG_REQ) @@ -2419,15 +2350,10 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, extend_time); if (status != QDF_STATUS_SUCCESS) { - hddLog - (LOGE, - "%s: Remain on Channel timer start failed", - __func__); + hdd_err("Remain on Channel timer start failed"); } } else { - hddLog(LOG1, - "%s: Rcvd action frame after timer expired", - __func__); + hdd_notice("Rcvd action frame after timer expired"); } } else { /* Buffer Packet */ @@ -2453,15 +2379,9 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, frame_ptr, pbFrames, nFrameLength); - hddLog(LOGE, - "%s:" - "Action Pkt Cached successfully !!!", - __func__); + hdd_err("Action Pkt Cached successfully !!!"); } else { - hddLog(LOGE, - "%s:" - "Frames are pending. dropping frame !!!", - __func__); + hdd_err("Frames are pending. dropping frame !!!"); } mutex_unlock(&cfgState-> remain_on_chan_ctx_lock); @@ -2478,9 +2398,7 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, || ((actionFrmType == WLAN_HDD_GO_NEG_RESP) && (cfgState->actionFrmState == HDD_GO_NEG_REQ_ACK_PENDING))) { - hddLog(LOG1, - "%s: ACK_PENDING and But received RESP for Action frame ", - __func__); + hdd_notice("ACK_PENDING and But received RESP for Action frame "); cfgState->is_go_neg_ack_received = 1; hdd_send_action_cnf(pAdapter, true); } @@ -2492,8 +2410,7 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, u8 *mac = &pbFrames [WLAN_HDD_80211_PEER_ADDR_OFFSET]; - hddLog(LOG1, - "[TDLS] TDLS Discovery Response," + hdd_notice("[TDLS] TDLS Discovery Response," MAC_ADDRESS_STR " RSSI[%d] <--- OTA", MAC_ADDR_ARRAY(mac), rxRssi); @@ -2513,13 +2430,11 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, actionFrmType = pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1]; if (actionFrmType >= MAX_TDLS_ACTION_FRAME_TYPE) { - hddLog(LOG1, - "[TDLS] unknown[%d] <--- OTA", - actionFrmType); + hdd_notice("[TDLS] unknown[%d] <--- OTA", + actionFrmType); } else { - hddLog(LOG1, - "[TDLS] %s <--- OTA", - tdls_action_frame_type[actionFrmType]); + hdd_notice("[TDLS] %s <--- OTA", + tdls_action_frame_type[actionFrmType]); } cds_tdls_tx_rx_mgmt_event(SIR_MAC_ACTION_TDLS, SIR_MAC_ACTION_RX, SIR_MAC_MGMT_ACTION, @@ -2537,8 +2452,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, } } /* Indicate Frame Over Normal Interface */ - hddLog(LOG1, FL("Indicate Frame over NL80211 sessionid : %d, idx :%d"), - pAdapter->sessionId, pAdapter->dev->ifindex); + hdd_notice("Indicate Frame over NL80211 sessionid : %d, idx :%d", + pAdapter->sessionId, pAdapter->dev->ifindex); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, -- cgit v1.2.3 From 987ce39054cf972c8b7180827e665c712dd1fa36 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 13:45:01 -0700 Subject: Release 5.1.0.29 Release 5.1.0.29 Change-Id: I46dfb5811ffd936ad573818cbbbfd71340cc99f1 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index deb68a969eac..d339c20c1225 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 28 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.28Z" +#define QWLAN_VERSIONSTR "5.1.0.29" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 2359ca00da6e08598743615cb237f9754d35a2ba Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Wed, 21 Sep 2016 16:57:28 -0700 Subject: qcacld-3.0: Fix free_pool referencing in hdd_lro_desc_find list_empty api does not work correctly on copied list head. Need to point to the original free_pool memory so that the spinlocking and list management apis work as expected on the original memory. Change-Id: I631466d156c83f70cb6ea06eec0e361081f294cc CRs-Fixed: 1070258 --- core/hdd/src/wlan_hdd_lro.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index dde5d9e4fc01..857d2c154a7a 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -214,7 +214,7 @@ static int hdd_lro_desc_find(hdd_adapter_t *adapter, struct hdd_lro_desc_table *lro_hash_table; struct list_head *ptr; struct hdd_lro_desc_entry *entry; - struct hdd_lro_desc_pool free_pool; + struct hdd_lro_desc_pool *free_pool; struct hdd_lro_desc_info *desc_info = &adapter->lro_info.lro_desc_info; *lro_desc = NULL; @@ -245,24 +245,19 @@ static int hdd_lro_desc_find(hdd_adapter_t *adapter, qdf_spin_unlock_bh(&desc_info->lro_hash_lock); /* no existing flow found, a new LRO desc needs to be allocated */ - free_pool = adapter->lro_info.lro_desc_info.lro_desc_pool; - qdf_spin_lock_bh(&free_pool.lro_pool_lock); + free_pool = &adapter->lro_info.lro_desc_info.lro_desc_pool; + qdf_spin_lock_bh(&free_pool->lro_pool_lock); entry = list_first_entry_or_null( - &free_pool.lro_free_list_head, + &free_pool->lro_free_list_head, struct hdd_lro_desc_entry, lro_node); if (NULL == entry) { hdd_err("Could not allocate LRO desc!"); - qdf_spin_unlock_bh(&free_pool.lro_pool_lock); + qdf_spin_unlock_bh(&free_pool->lro_pool_lock); return -ENOMEM; } - if (list_empty(&entry->lro_node)) { - hdd_err("Reached max supported lro_desc range\n"); - return -EINVAL; - } - list_del_init(&entry->lro_node); - qdf_spin_unlock_bh(&free_pool.lro_pool_lock); + qdf_spin_unlock_bh(&free_pool->lro_pool_lock); if (NULL == entry->lro_desc) { hdd_err("entry->lro_desc is NULL!\n"); -- cgit v1.2.3 From abaf6736eb9f8a61bf0e35a54be67bb33c97b8d3 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Tue, 27 Sep 2016 22:50:40 -0700 Subject: qcacld-3.0: Reset skb->cb when forwarding intrabss packets skb->cb has different meaning for rx & tx packets. Reset the cb to avoid mis-interpretation of the data that leads to eratic misbehavior the least of which is failure to forward packets. Change-Id: I5d1396c70cd93d165aa825c4408ad46d082693f3 CRs-Fixed: 1065769 --- core/dp/txrx/ol_rx_fwd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/dp/txrx/ol_rx_fwd.c b/core/dp/txrx/ol_rx_fwd.c index 65af905ee306..31ca346de900 100644 --- a/core/dp/txrx/ol_rx_fwd.c +++ b/core/dp/txrx/ol_rx_fwd.c @@ -132,6 +132,10 @@ static inline void ol_rx_fwd_to_tx(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t msdu) rx_desc)); } + /* Clear the msdu control block as it will be re-interpreted */ + qdf_mem_set(msdu->cb, sizeof(msdu->cb), 0); + /* update any cb field expected by OL_TX_SEND */ + msdu = OL_TX_SEND(vdev, msdu); if (msdu) { -- cgit v1.2.3 From 66cc5ab7654a1ae890ee93d1b4e2e639cf88581b Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 15:44:08 -0700 Subject: Release 5.1.0.29A Release 5.1.0.29A Change-Id: I71e10aca878e8e98c7db25e006b60af02b331cc3 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d339c20c1225..c3c98cddb620 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29" +#define QWLAN_VERSIONSTR "5.1.0.29A" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 5c9146d3cf371b8a3be7b84adf73bdf252f16568 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Fri, 23 Sep 2016 13:07:57 +0530 Subject: qcacld-3.0: Fix double mem free while using cds_send_mb_message_to_mac cds_send_mb_message_to_mac function frees the input memory buffer irrespective of the success/failure of the message posting to the MAC message queue. This changes fixes the cases where the input buffer is attempted to be freed for fail case of cds_send_mb_message_to_mac Change-Id: I920822bf0ee268adb1312eed20de53450802fdc8 CRs-Fixed: 1070461 --- core/sme/src/csr/csr_api_scan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 994c2bca2b8b..a0f7a7efdc96 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -6854,7 +6854,6 @@ static void csr_send_scan_abort(tpAniSirGlobal mac_ctx, scan_id, session_id); status = cds_send_mb_message_to_mac(msg); if (!QDF_IS_STATUS_SUCCESS(status)) { - qdf_mem_free(msg); sms_log(mac_ctx, LOGE, FL("Failed to send abort scan.scan_id %d session %d"), scan_id, session_id); @@ -7378,7 +7377,6 @@ void csr_scan_active_list_timeout_handle(void *userData) if (!QDF_IS_STATUS_SUCCESS(status)) { sms_log(mac_ctx, LOGE, FL(" Failed to post message to LIM")); - qdf_mem_free(msg); } csr_save_scan_results(mac_ctx, scan_cmd->u.scanCmd.reason, scan_cmd->sessionId); -- cgit v1.2.3 From 5667e8d78720340870d8c17d0729bda510046261 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 18:29:17 -0700 Subject: Release 5.1.0.29B Release 5.1.0.29B Change-Id: I86c15dd3f5aac7a57f68ffb77bb4b5d1d7c77e84 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c3c98cddb620..af35285819c4 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_EXTRA "B" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29A" +#define QWLAN_VERSIONSTR "5.1.0.29B" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 9f4048fff7d0e1a9283d9d29fd0fe623bcd10a7a Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Fri, 30 Sep 2016 15:06:57 +0530 Subject: qcacld-3.0: During con mode change stop netif queues If user triggers con_mode change, while data transmissions are happening, there is possibility of device crash, as data queues are not stopped during con_mode change. In con_mode handler, stop data queues before stopping modules. Change-Id: I348d0da707ea4b706edfcd396adee32502180e3e CRs-Fixed: 1070008 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_main.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 109cd03a0cb8..577f1f9d84e0 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1553,6 +1553,7 @@ QDF_STATUS hdd_close_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, bool rtnl_held); QDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx, bool rtnl_held); QDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx); +void hdd_deinit_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held); QDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx); QDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx); hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9aeee9107f74..356c86841843 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1827,6 +1827,10 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, hdd_alert("adapter is Null"); goto close; } + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("in ftm mode, no need to configure cds modules"); + break; + } if (hdd_configure_cds(hdd_ctx, adapter)) { hdd_err("Failed to Enable cds modules"); goto close; @@ -3615,6 +3619,32 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, return QDF_STATUS_SUCCESS; } +/** + * hdd_deinit_all_adapters - deinit all adapters + * @hdd_ctx: HDD context + * @rtnl_held: True if RTNL lock held + * + */ +void hdd_deinit_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held) +{ + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + QDF_STATUS status; + hdd_adapter_t *adapter; + + ENTER(); + + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + adapter = adapter_node->pAdapter; + hdd_deinit_adapter(hdd_ctx, adapter, rtnl_held); + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; + } + + EXIT(); +} + QDF_STATUS hdd_stop_all_adapters(hdd_context_t *hdd_ctx) { hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL; @@ -9057,7 +9087,7 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( case QDF_GLOBAL_MONITOR_MODE: return QDF_MONITOR_MODE; case QDF_GLOBAL_FTM_MODE: - return QDF_MONITOR_MODE; + return QDF_FTM_MODE; case QDF_GLOBAL_EPPING_MODE: return QDF_EPPING_MODE; case QDF_GLOBAL_QVIT_MODE: @@ -9118,6 +9148,9 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) return -EINVAL; } + hdd_stop_all_adapters(hdd_ctx); + hdd_deinit_all_adapters(hdd_ctx, false); + ret = hdd_wlan_stop_modules(hdd_ctx, false); if (ret) { hdd_err("Stop wlan modules failed"); -- cgit v1.2.3 From dc802ae8e123cb3482ccc64594532ceac5830309 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 18:58:41 -0700 Subject: Release 5.1.0.29C Release 5.1.0.29C Change-Id: Ied83d163ac0172c248fcdbb567da97562707cb7a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index af35285819c4..5417fcdda15e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29B" +#define QWLAN_VERSIONSTR "5.1.0.29C" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 7f42b5f1d7dbf4ae602df4baa9d2054ca2d2bf11 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Fri, 16 Sep 2016 20:23:53 +0530 Subject: qcacld-3.0: Add OUI type(0x10) to HS2.0 IE frame parser Add OUI type(0x10) to HS2.0 IE frame parser. In current implementation without OUI type being set, the first IE with WFA OUI is parsed as HS2.0 IE, even though the OUI type is not 0x10. Change-Id: I63d97fc100f419c09bc22d1747f434fb9a5c3b06 CRs-Fixed: 1067816 --- core/mac/src/cfg/cfgUtil/dot11f.frms | 3 +-- core/mac/src/include/dot11f.h | 5 ++-- core/mac/src/sys/legacy/src/utils/src/dot11f.c | 37 +++++++++++--------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index e204e7ff9731..80509932738c 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -1861,9 +1861,8 @@ IE Vendor3IE (EID_VENDOR_SPECIFIC) OUI (0x00, 0x16, 0x32) { } -IE hs20vendor_ie (EID_VENDOR_SPECIFIC) OUI (0x50, 0x6F, 0x9A) +IE hs20vendor_ie (EID_VENDOR_SPECIFIC) OUI (0x50, 0x6F, 0x9A, 0x10) { - type, 1; /* hotspot_configurations */ { dgaf_dis: 1; diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 8e8c7ada1105..006fd880785d 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -35,7 +35,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Aug 29 23:01:24 2016 from the following file(s): + * Mon Sep 19 14:42:34 2016 from the following file(s): * * dot11f.frms * @@ -7441,10 +7441,9 @@ uint32_t dot11f_get_packed_ie_ext_chan_switch_ann( }; /* End extern "C". */ #endif /* C++ */ -/* EID 221 (0xdd) {OUI 0x50, 0x6f, 0x9a} */ +/* EID 221 (0xdd) {OUI 0x50, 0x6f, 0x9a, 0x10} */ typedef struct sDot11fIEhs20vendor_ie { uint8_t present; - uint8_t type; uint8_t dgaf_dis:1; uint8_t hs_id_present:2; uint8_t reserved:1; diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 9b7206c3fe68..d5068aae9b91 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -25,7 +25,7 @@ * to the Linux Foundation. */ - /* +/* * \file dot11f.c * * \brief Structures, functions & definitions for @@ -33,7 +33,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Aug 29 23:01:24 2016 from the following file(s): + * Mon Sep 19 14:42:34 2016 from the following file(s): * * dot11f.frms * @@ -5849,9 +5849,6 @@ uint32_t dot11f_unpack_ie_hs20vendor_ie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - pDst->type = *pBuf; - pBuf += 1; - ielen -= (uint8_t)1; tmp68__ = *pBuf; pBuf += 1; ielen -= 1; @@ -6217,8 +6214,8 @@ static const tIEDefn IES_AssocRequest[] = { 3, DOT11F_EID_VENDOR2_IE, 0, }, { offsetof(tDot11fAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },}; uint32_t dot11f_unpack_assoc_request(tpAniSirGlobal pCtx, @@ -6578,8 +6575,8 @@ static const tIEDefn IES_Beacon[] = { 3, DOT11F_EID_VENDOR3IE, 0, }, { offsetof(tDot11fBeacon, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, { offsetof(tDot11fBeacon, ChannelSwitchWrapper), offsetof(tDot11fIEChannelSwitchWrapper, present), 0, "ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper, @@ -6779,8 +6776,8 @@ static const tIEDefn IES_Beacon2[] = { 3, DOT11F_EID_VENDOR3IE, 0, }, { offsetof(tDot11fBeacon2, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, { offsetof(tDot11fBeacon2, ChannelSwitchWrapper), offsetof(tDot11fIEChannelSwitchWrapper, present), 0, "ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper, @@ -6976,8 +6973,8 @@ static const tIEDefn IES_BeaconIEs[] = { 3, DOT11F_EID_VENDOR3IE, 0, }, { offsetof(tDot11fBeaconIEs, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, { offsetof(tDot11fBeaconIEs, ChannelSwitchWrapper), offsetof(tDot11fIEChannelSwitchWrapper, present), 0, "ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper, @@ -7585,8 +7582,8 @@ static const tIEDefn IES_ProbeResponse[] = { 3, DOT11F_EID_VENDOR3IE, 0, }, { offsetof(tDot11fProbeResponse, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, { offsetof(tDot11fProbeResponse, ChannelSwitchWrapper), offsetof(tDot11fIEChannelSwitchWrapper, present), 0, "ChannelSwitchWrapper", 0, 2, 14, SigIeChannelSwitchWrapper, @@ -7840,8 +7837,8 @@ static const tIEDefn IES_ReAssocRequest[] = { 3, DOT11F_EID_VENDOR2_IE, 0, }, { offsetof(tDot11fReAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", - 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 0, 0}, - 3, DOT11F_EID_HS20VENDOR_IE, 0, }, + 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, + 4, DOT11F_EID_HS20VENDOR_IE, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },}; uint32_t dot11f_unpack_re_assoc_request(tpAniSirGlobal pCtx, @@ -11438,7 +11435,6 @@ uint32_t dot11f_get_packed_ie_hs20vendor_ie(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; (void)pCtx; while (pIe->present) { - *pnNeeded += 1; *pnNeeded += 1; if (pIe->hs_id_present) { switch (pIe->hs_id_present) { @@ -20282,9 +20278,8 @@ uint32_t dot11f_pack_ie_hs20vendor_ie(tpAniSirGlobal pCtx, ++pBuf; ++(*pnConsumed); *pBuf = 0x9a; ++pBuf; ++(*pnConsumed); - *pBuf = pSrc->type; - *pnConsumed += 1; - pBuf += 1; + *pBuf = 0x10; + ++pBuf; ++(*pnConsumed); tmp138__ = 0U; tmp138__ |= (pSrc->dgaf_dis << 0); tmp138__ |= (pSrc->hs_id_present << 1); -- cgit v1.2.3 From a11edcba429ca04609326fac62237da597f9ee5a Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 7 Sep 2016 18:49:14 +0530 Subject: qcacld-3.0: Enable kernel specific WiFiSON changes default from 4.7.0 kernel Enable driver changes dependent on kernel flags CFG80211_SCAN_BSSID and CFG80211_CONNECT_PREV_BSSID default for linux kernels starting from version 4.7.0 as the dependent kernel changes are present from this version. Change-Id: I0ee25eb11c75c688becbf61b4424bd0bae28bd3a CRs-Fixed: 1064018 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- core/hdd/src/wlan_hdd_scan.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ce3e7907bb88..1da11ee297d6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12148,7 +12148,8 @@ disconnected: * * Return: true if connect was for ReAssociation, false otherwise */ -#ifdef CFG80211_CONNECT_PREV_BSSID +#if defined(CFG80211_CONNECT_PREV_BSSID) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, struct cfg80211_connect_params *req, int *status) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index e063008d9091..20c53b3c3c97 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1271,7 +1271,8 @@ static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work) * * Return: None */ -#ifdef CFG80211_SCAN_BSSID +#if defined(CFG80211_SCAN_BSSID) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) static inline void wlan_hdd_copy_bssid_scan_request(tCsrScanRequest *scan_req, struct cfg80211_scan_request *request) { -- cgit v1.2.3 From 49275561ed49d93097a7f300608dc270e010e005 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 13 Sep 2016 12:35:22 +0530 Subject: qcacld-3.0: Ignore beacon miss if CSA is in progress qcacld-2.0 to qcacld-3.0 propagation In case if CSA is in progress and beacon missed is received the session is disconnected. Now if STA tries to connect to new AP and at the same time CSA timer expires then tries to switch channel. As old session is deleted this switch channel fails as channel info is invalid. This also leads to LIM state change and thus the roam command is not removed from active command list. To fix this: - Ignore beacon miss if CSA is in progress - In CSA timer add check to ensure that channel change is for current session. Change-Id: Icbb80394e4870ccae19782ee17e37465020e93f9 CRs-Fixed: 1060378 --- core/mac/src/pe/lim/lim_link_monitoring_algo.c | 10 +++++++++- core/mac/src/pe/lim/lim_utils.c | 27 +++++++++++++++++++------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index 923d9a2d4ffd..9d7b9fe9d936 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -457,7 +457,15 @@ void lim_handle_heart_beat_failure(tpAniSirGlobal mac_ctx, if (!mac_ctx->sys.gSysEnableLinkMonitorMode) return; - /* Beacon frame not received within heartbeat timeout. */ + /* Ignore HB if channel switch is in progress */ + if (session->gLimSpecMgmt.dot11hChanSwState == + eLIM_11H_CHANSW_RUNNING) { + lim_log(mac_ctx, LOGE, + FL("Ignore Heartbeat failure as Channel switch is in progress")); + session->pmmOffloadInfo.bcnmiss = false; + return; + } + /* Beacon frame not received within heartbeat timeout. */ lim_log(mac_ctx, LOGW, FL("Heartbeat Failure")); mac_ctx->lim.gLimHBfailureCntInLinkEstState++; diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 1d8edcdb4e26..420f7c4e30aa 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2013,17 +2013,23 @@ void lim_process_channel_switch_timeout(tpAniSirGlobal pMac) psessionEntry = pe_find_session_by_session_id(pMac, pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId); if (psessionEntry == NULL) { - lim_log(pMac, LOGP, + lim_log(pMac, LOGE, FL("Session Does not exist for given sessionID")); return; } if (!LIM_IS_STA_ROLE(psessionEntry)) { - PELOGW(lim_log - (pMac, LOGW, + lim_log(pMac, LOGW, "Channel switch can be done only in STA role, Current Role = %d", GET_LIM_SYSTEM_ROLE(psessionEntry)); - ) + return; + } + + if (psessionEntry->gLimSpecMgmt.dot11hChanSwState != + eLIM_11H_CHANSW_RUNNING) { + lim_log(pMac, LOGW, + FL("Channel switch timer should not have been running in state %d"), + psessionEntry->gLimSpecMgmt.dot11hChanSwState); return; } @@ -2048,15 +2054,22 @@ void lim_process_channel_switch_timeout(tpAniSirGlobal pMac) return; } - /* If the channel-list that AP is asking us to switch is invalid, + /* + * 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 !!! */ - lim_tear_down_link_with_ap(pMac, + if ((psessionEntry->limMlmState == + eLIM_MLM_LINK_ESTABLISHED_STATE) && + (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && + (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) { + lim_log(pMac, LOGE, FL("Invalid channel! Disconnect")); + lim_tear_down_link_with_ap(pMac, pMac->lim.limTimers. gLimChannelSwitchTimer.sessionId, eSIR_MAC_UNSPEC_FAILURE_REASON); - return; + return; + } } lim_covert_channel_scan_type(pMac, psessionEntry->currentOperChannel, false); -- cgit v1.2.3 From c50055ab900d996e38ae3b9369610e31deb7f14a Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 27 Apr 2016 17:00:33 +0530 Subject: qcacld-3.0: If MCC is disabled do not roam to an AP which cause MCC qcacld-2.0 to qcacld-3.0 propagation Even though MCC is disabled by gEnableMCCMode ini, driver try to roam to APs which may cause MCC but as MCC is disable the roaming fails eventually in CSR while trying to connect to the new profile. Driver creates a preauth session which is not deleted upon failure. The session sme state is eLIM_SME_WT_REASSOC_STATE and thus fresh scan required is set to false and cached scan result are returned. Do not add the APs which cause MCC scenario, in preauth candidate list if MCC is disabled. Change-Id: Iae2a887e1fa34f89f340bd7392d757e1add97a16 CRs-Fixed: 992672 --- core/sme/src/csr/csr_host_scan_roam.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index 9f56f7c303fe..fcbd0400ac49 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -203,6 +203,25 @@ void csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, "SKIP-currently associated AP"); continue; } + + /* + * Continue if MCC is disabled in INI and if AP + * will create MCC + */ + if (cds_concurrent_open_sessions_running() && + !mac_ctx->roam.configParam.fenableMCCMode) { + uint8_t conc_channel; + + conc_channel = + csr_get_concurrent_operation_channel(mac_ctx); + if (conc_channel && + (conc_channel != + scan_result->BssDescriptor.channelId)) { + sms_log(mac_ctx, LOG1, FL("MCC not supported so Ignore AP on channel %d"), + scan_result->BssDescriptor.channelId); + continue; + } + } /* * In case of reassoc requested by upper layer, look * for exact match of bssid & channel. csr cache might -- cgit v1.2.3 From 2194de20cef945a2da49c688ebd1b2a66a8ae284 Mon Sep 17 00:00:00 2001 From: "Masti, Narayanraddi" Date: Tue, 20 Sep 2016 16:34:02 +0530 Subject: qcacld-3.0: Register event in wma to track TDLS connection qcacld-2.0 to qcacld-3.0 propagation TDLS connection will teardown in host on receiving teardown event from Firmware. But if host is in WOW mode then host will not receive teardown event from FW. To fix this issue add TDLS connection tracker event changes in WMA. Change-Id: I3a305e95410d2884b41e9e4183ed4eeabd733f9d CRs-Fixed: 991993 --- core/wma/src/wma_features.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 7850fa73b903..a9a485bf554e 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -90,7 +90,8 @@ (1 << WOW_RA_MATCH_EVENT) |\ (1 << WOW_NLO_DETECTED_EVENT) |\ (1 << WOW_EXTSCAN_EVENT)) |\ - (1 << WOW_OEM_RESPONSE_EVENT)\ + (1 << WOW_OEM_RESPONSE_EVENT)|\ + (1 << WOW_TDLS_CONN_TRACKER_EVENT)\ #define WMA_WOW_SAP_WAKE_UP_EVENTS ((1 << WOW_PROBE_REQ_WPS_IE_EVENT) |\ (1 << WOW_PATTERN_MATCH_EVENT) |\ -- cgit v1.2.3 From 336e16e392395884b640282d4a51c31ec0a5d0fc Mon Sep 17 00:00:00 2001 From: Sreelakshmi Konamki Date: Wed, 7 Sep 2016 14:35:22 +0530 Subject: qcacld-3.0: Fix to update proper session_entry in lim_process_messages() qcacld-2.0 to qcacld-3.0 propagation In lim_process_messages(), few SME messages updates 'session_entry' using SME session id. Host driver should not use SME session id in PE. Fix to update 'session_entry' using pe_find_session_by_bssid(). Change-Id: Icebf4604d5a3a825afc6b1d3540bd228488ce267 CRs-Fixed: 1020643 --- core/mac/inc/sir_api.h | 1 + core/mac/src/pe/lim/lim_process_message_queue.c | 8 ++++++-- core/sme/src/csr/csr_api_roam.c | 5 ++++- core/sme/src/csr/csr_neighbor_roam.c | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 0fdac5c0c888..362275c14bd3 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3577,6 +3577,7 @@ typedef struct sSirActiveModeSetBcnFilterReq { uint16_t messageType; uint16_t length; uint8_t seesionId; + struct qdf_mac_addr bssid; } tSirSetActiveModeSetBncFilterReq, *tpSirSetActiveModeSetBncFilterReq; /* Reset AP Caps Changed */ diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 4f69616afeee..37b326b6e863 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1349,6 +1349,8 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) tTdlsLinkEstablishParams *tdls_link_params = NULL; #endif tSirMbMsgP2p *p2p_msg = NULL; + tSirSetActiveModeSetBncFilterReq *bcn_filter_req = NULL; + if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) { qdf_mem_free(msg->bodyptr); msg->bodyptr = NULL; @@ -1857,8 +1859,10 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) msg->bodyptr = NULL; break; case eWNI_SME_SET_BCN_FILTER_REQ: - session_id = (uint8_t) msg->bodyval; - session_entry = &mac_ctx->lim.gpSession[session_id]; + bcn_filter_req = + (tSirSetActiveModeSetBncFilterReq *) msg->bodyptr; + session_entry = pe_find_session_by_bssid(mac_ctx, + bcn_filter_req->bssid.bytes, &session_id); if ((session_entry != NULL) && (lim_send_beacon_filter_info(mac_ctx, session_entry) != eSIR_SUCCESS)) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 58d0c0812b9d..ad3768c3b13e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -11183,8 +11183,11 @@ csr_roam_chk_lnk_set_ctx_rsp(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr) pMsg = qdf_mem_malloc( sizeof(tSirSetActiveModeSetBncFilterReq)); pMsg->messageType = eWNI_SME_SET_BCN_FILTER_REQ; - pMsg->length = sizeof(uint8_t); + pMsg->length = sizeof(tSirSetActiveModeSetBncFilterReq); pMsg->seesionId = sessionId; + qdf_copy_macaddr(&pMsg->bssid, + &session->connectedProfile.bssid); + status = cds_send_mb_message_to_mac(pMsg); /* * OBSS SCAN Indication will be sent to Firmware diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index e2444c4c25b5..535171b7f3f6 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -1133,8 +1133,10 @@ QDF_STATUS csr_neighbor_roam_indicate_connect( return QDF_STATUS_E_NOMEM; } msg->messageType = eWNI_SME_SET_BCN_FILTER_REQ; - msg->length = sizeof(uint8_t); + msg->length = sizeof(tSirSetActiveModeSetBncFilterReq); msg->seesionId = session_id; + qdf_copy_macaddr(&msg->bssid, + &session->connectedProfile.bssid); status = cds_send_mb_message_to_mac(msg); qdf_copy_macaddr(&roamInfo.peerMac, &session->connectedProfile.bssid); -- cgit v1.2.3 From 80f4a8dad8cfa605e4e9c97a5eeea55f6ac57ee7 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 22 Sep 2016 16:54:35 +0530 Subject: qcacld-3.0: Correct IEs in beacon filter API qcacld-2.0 to qcacld-3.0 propagation IE's numbers are not set correctly in beacon filter API. Add changes to correct this. Change-Id: Ib489b0fc7bc1f0a2b7414f59ed325deecb65bb8e CRs-Fixed: 1030084 --- core/hdd/src/wlan_hdd_assoc.c | 2 +- core/wma/src/wma_features.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 048cb47f333d..312349735478 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -364,7 +364,7 @@ static int hdd_add_beacon_filter(hdd_adapter_t *adapter) hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); for (i = 0; i < ARRAY_SIZE(beacon_filter_table); i++) - qdf_set_bit((beacon_filter_table[i] - 1), + qdf_set_bit((beacon_filter_table[i]), (unsigned long int *)ie_map); status = sme_add_beacon_filter(hdd_ctx->hHal, diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index a9a485bf554e..72f19099c716 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1132,7 +1132,6 @@ QDF_STATUS wma_add_beacon_filter(WMA_HANDLE handle, wmi_buf_free(wmi_buf); return QDF_STATUS_E_FAILURE; } - WMA_LOGD("added beacon filter = %d", ret); return QDF_STATUS_SUCCESS; } @@ -1180,7 +1179,6 @@ QDF_STATUS wma_remove_beacon_filter(WMA_HANDLE handle, wmi_buf_free(buf); return QDF_STATUS_E_FAILURE; } - WMA_LOGD("removed beacon filter = %d", ret); return QDF_STATUS_SUCCESS; } -- cgit v1.2.3 From 139c330d9500dcd6dcea9a1ac62054c236a674ee Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 22 Sep 2016 16:48:12 +0530 Subject: qcacld-3.0: Cancel Remain on channel command before stop ap qcacld-2.0 to qcacld-3.0 propagation If P2P-GO stop comes during ROC, it may cause WLANSAP_StopBss API to fail. ROC is stuck as firmware is running Gscan which is higher priority than p2p ROC scan prioirty. This causes ROC command to be stuck in the active list for 10 seconds and will eventually cause a crash in FW when host will try to add self peer since older peer is still present in the FW with same mac address Add change to increase the priority of P2P scan and cancel ROC before calling stop AP API. CRs-Fixed: 1065161 Change-Id: I3a62234596c8c2acc0155b483847b9adc159d757 --- core/hdd/src/wlan_hdd_hostapd.c | 1 + core/wma/src/wma_scan_roam.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index de59d24f7863..46459b386cf0 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7546,6 +7546,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, } hdd_cleanup_actionframe(pHddCtx, pAdapter); + wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter); mutex_lock(&pHddCtx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags)) { diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 3418f1d19d95..1bba4b8718dd 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -566,6 +566,9 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle, cmd.vdev_id, P2P_SCAN_TYPE_LISTEN); WMA_LOGI("scan_id 0x%x, vdev_id %d, p2pScanType %d, msg_type 0x%x", cmd.scan_id, cmd.vdev_id, scan_req->p2pScanType, msg_type); + + if (scan_req->p2pScanType) + cmd.scan_priority = WMI_SCAN_PRIORITY_MEDIUM; /* * Cache vdev_id and scan_id because cmd is freed after calling * wmi_unified_cmd_send cmd. WMI internally frees cmd buffer after -- cgit v1.2.3 From a72a9430737c84e1d9ab455a46b0c2f391857b72 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 20:55:43 -0700 Subject: Release 5.1.0.29D Release 5.1.0.29D Change-Id: I7b9b8ae7116ec104039f8e9b75b2d9a978bcd361 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5417fcdda15e..e894a3b8d42f 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "C" +#define QWLAN_VERSION_EXTRA "D" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29C" +#define QWLAN_VERSIONSTR "5.1.0.29D" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 4bbf40a0eb38711ab44ced57e3c036e56a955ca1 Mon Sep 17 00:00:00 2001 From: "Sen, Devendra" Date: Thu, 29 Sep 2016 17:42:25 +0530 Subject: qcacld-3.0: Fix TDLS peer QoS capability in transport layer qcacld-2.0 to qcacld-3.0 propagation In __wlan_hdd_cfg80211_tdls_oper, since IS_ADVANCE_TDLS_ENABLE is disabled, the tdlsLinkEstablishParams does not get populated with correct QoS capability of the peer. The transport layer is then configured with this wrong capability. This results in all packets, independent of TID, enqueued into BE queue. Fix this by getting the QoS capability from hddTdlsPeer_t. Change-Id: Iafbd416026c9a0e4b05654ec810b0e0f3546beba CRs-Fixed: 1010915 --- core/hdd/src/wlan_hdd_tdls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 77a560d04979..6204e72aee8b 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -4499,7 +4499,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, pAdapter, peer, pTdlsPeer->staId, pTdlsPeer->signature, - tdlsLinkEstablishParams.qos); + pTdlsPeer->qos); if (QDF_STATUS_SUCCESS == status) { uint8_t i; -- cgit v1.2.3 From 3ccc85043943ccce2509c8f0cf94d8b11543bdfb Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 22:29:59 -0700 Subject: Release 5.1.0.29E Release 5.1.0.29E Change-Id: Ic6282439799d7322837636c9855d8fad73caa870 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e894a3b8d42f..3232ea9d4fe9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "D" +#define QWLAN_VERSION_EXTRA "E" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29D" +#define QWLAN_VERSIONSTR "5.1.0.29E" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 58f0e27b2b55cadf8e0290b53e79ff4fdb6af076 Mon Sep 17 00:00:00 2001 From: Sriram Madhvapathi Date: Mon, 3 Oct 2016 11:47:51 +0530 Subject: qcacld-3.0: Fix IBSS peer info handling when no peers are connected qcacld-2.0 to qcacld-3.0 propagation wma_ibss_peer_info_event_handler returns error when peer_info is NULL. However, peer_info can be NULL in case num_peers connected is 0. Handle this case in hdd_get_ibss_peer_info_cb so that callers of GETIBSSPEERINFOALL do not see stale results after all connected peers have left the IBSS. Also, log the errors for enabling debug and reset the ibss_peer_info statistics. Change-Id: I913748bf11f9362e5faaaf29c26fc39fda85f4a9 CRs-Fixed: 1007555 --- core/hdd/src/wlan_hdd_ioctl.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 6745015e1a81..fcc2f5e0e7b6 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -446,21 +446,24 @@ hdd_get_ibss_peer_info_cb(void *pUserData, pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); if (NULL != pPeerInfo && QDF_STATUS_SUCCESS == pPeerInfo->status) { /* validate number of peers */ - if (pPeerInfo->numPeers < SIR_MAX_NUM_STA_IN_IBSS) { - pStaCtx->ibss_peer_info.status = pPeerInfo->status; - pStaCtx->ibss_peer_info.numPeers = pPeerInfo->numPeers; - - for (i = 0; i < pPeerInfo->numPeers; i++) { - pStaCtx->ibss_peer_info.peerInfoParams[i] = - pPeerInfo->peerInfoParams[i]; - } - hdd_info("Peer Info copied in HDD"); - } else { - hdd_info("Number of peers %d returned is more than limit %d", + if (pPeerInfo->numPeers > SIR_MAX_NUM_STA_IN_IBSS) { + hdd_warn("Limiting num_peers %u to %u", pPeerInfo->numPeers, SIR_MAX_NUM_STA_IN_IBSS); + pPeerInfo->numPeers = SIR_MAX_NUM_STA_IN_IBSS; } + pStaCtx->ibss_peer_info.status = pPeerInfo->status; + pStaCtx->ibss_peer_info.numPeers = pPeerInfo->numPeers; + + for (i = 0; i < pPeerInfo->numPeers; i++) + pStaCtx->ibss_peer_info.peerInfoParams[i] = + pPeerInfo->peerInfoParams[i]; } else { - hdd_info("peerInfo returned is NULL"); + hdd_err("peerInfo %s: status %u, numPeers %u", + pPeerInfo ? "valid" : "null", + pPeerInfo ? pPeerInfo->status : QDF_STATUS_E_FAILURE, + pPeerInfo ? pPeerInfo->numPeers : 0); + pStaCtx->ibss_peer_info.numPeers = 0; + pStaCtx->ibss_peer_info.status = QDF_STATUS_E_FAILURE; } complete(&adapter->ibss_peer_info_comp); -- cgit v1.2.3 From 518c5d7979f0427b34fe99982b36486073ffd3ae Mon Sep 17 00:00:00 2001 From: Vidyullatha Kanchanapally Date: Fri, 30 Sep 2016 11:04:16 +0530 Subject: qcacld-3.0: Append EC IE and Interworking IE to beacon qcacld-2.0 to qcacld-3.0 propagation Supplicant is sending Extended capabilities (EC) IE and Interworking IE as part of beacon IEs to the driver but the driver is not looking for these IEs when populating the beacon. To fix this append the EC IE and Interworking IE to the beacon template. Change-Id: I6e19bfacb6f83526ce80d59cf43c23c6e2a77233 CRs-Fixed: 964594 --- core/hdd/src/wlan_hdd_hostapd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 46459b386cf0..3f20e4e160af 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6437,6 +6437,13 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, WLAN_EID_VHT_TX_POWER_ENVELOPE); + /* Extract and add the extended capabilities and interworking IE */ + wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, + WLAN_EID_EXT_CAPABILITY); + + wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, + WLAN_EID_INTERWORKING); + if (0 != wlan_hdd_add_ie(adapter, genie, &total_ielen, WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE)) { hdd_err("Adding WPS IE failed"); -- cgit v1.2.3 From 87b224f183bdbfb51c4ce63ee90caae64739b09b Mon Sep 17 00:00:00 2001 From: Vidyullatha Kanchanapally Date: Tue, 24 May 2016 15:49:44 +0530 Subject: qcacld-3.0: Get operating channel only when connected or bss started qcacld-2.0 to qcacld-3.0 propagation wlan_hdd_mgmt_tx can be called in not-connected state in case of station mode. Here the operating channel is fetched from the connected info without actually checking whether the sta interface is connected or not and hence can lead to making a wrong decision whether or not to request ROC. Fix the above issue by fetching the operating channel only in connected state. In not-connected state driver always goes for requesting a ROC. Add similar check in case of soft ap and P2P-GO to get operating channel only when the bss is started. Change-Id: I91571f3b6a4f68487afcddd3152f469ff502eb6b CRs-Fixed: 957469 --- core/hdd/src/wlan_hdd_p2p.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 193a0d26d926..ea3df68c7a47 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1326,14 +1326,18 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET])); } - if (pAdapter->device_mode == QDF_SAP_MODE) { + if ((pAdapter->device_mode == QDF_SAP_MODE) && + (test_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags))) { home_ch = pAdapter->sessionCtx.ap.operatingChannel; - } else if (pAdapter->device_mode == QDF_STA_MODE) { + } else if ((pAdapter->device_mode == QDF_STA_MODE) && + (pAdapter->sessionCtx.station.conn_info.connState == + eConnectionState_Associated)) { home_ch = pAdapter->sessionCtx.station.conn_info.operationChannel; } else { goAdapter = hdd_get_adapter(pAdapter->pHddCtx, QDF_P2P_GO_MODE); - if (goAdapter) + if (goAdapter && + (test_bit(SOFTAP_BSS_STARTED, &goAdapter->event_flags))) home_ch = goAdapter->sessionCtx.ap.operatingChannel; } -- cgit v1.2.3 From 4d8acdd6939ce6111c9796bfde5ec43e46ec7a78 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 4 Oct 2016 23:00:48 -0700 Subject: Release 5.1.0.29F Release 5.1.0.29F Change-Id: I9d8ff53b4fc51fcebe1d6f721c0f2060d1865f18 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 3232ea9d4fe9..f19220e8ef3f 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29E" +#define QWLAN_VERSIONSTR "5.1.0.29F" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From af61ccdcb1dee6ff07e929175863a5d3ea829e9c Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Wed, 28 Sep 2016 18:20:08 +0530 Subject: qcacld-3.0: Fix wrong use of Runtime get API inplace of Runtime put Wrong use of runtime get results in mismatch in runtime pm usage count. Hence fix it by calling runtime put API instead of get API. Change-Id: I89dfcd2d1ad980df47f2244c9fcac5a68ac27d71 CRs-Fixed: 1072520 --- core/dp/htt/htt_t2h.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index 9cfd7b71f703..c7863a618613 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -165,7 +165,7 @@ void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, switch (msg_type) { case HTT_T2H_MSG_TYPE_VERSION_CONF: { - htc_pm_runtime_get(pdev->htc_pdev); + htc_pm_runtime_put(pdev->htc_pdev); pdev->tgt_ver.major = HTT_VER_CONF_MAJOR_GET(*msg_word); pdev->tgt_ver.minor = HTT_VER_CONF_MINOR_GET(*msg_word); qdf_print -- cgit v1.2.3 From 86d3824fbd88191953b123338f4332b79b92ef7b Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 00:34:13 -0700 Subject: Release 5.1.0.29G Release 5.1.0.29G Change-Id: I6efe93cc37529f9834f73f45a04bd806263baa04 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index f19220e8ef3f..59ed1488b61f 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "G" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29F" +#define QWLAN_VERSIONSTR "5.1.0.29G" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From 5d0a83e23ce4442746f6c6319a7143b29ebb908a Mon Sep 17 00:00:00 2001 From: Vidyullatha Kanchanapally Date: Tue, 24 May 2016 16:20:53 +0530 Subject: qcacld-3.0: Buffer delTs if an addTs is buffered qcacld-2.0 to qcacld-3.0 propagation Currently when an addTs is buffered for processing in SME and a delTs for the corresponding addTs is issued, the delTs is getting dropped since the addTs has not yet been processed. Fix this by buffering the delTs command if a corresponding flow is not found. Change-Id: Ib759ee7f2a5d4c089d5362f93568fb4dd6eda8cf CRs-Fixed: 1008956 --- core/hdd/src/wlan_hdd_wmm.c | 3 ++- core/sme/inc/sme_qos_api.h | 3 ++- core/sme/src/qos/sme_qos.c | 32 ++++++++++++++++++++++++++++---- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index f7beedff0de7..53e0086cca19 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -2270,7 +2270,8 @@ hdd_wlan_wmm_status_e hdd_wmm_delts(hdd_adapter_t *pAdapter, uint32_t handle) #ifndef WLAN_MDM_CODE_REDUCTION_OPT smeStatus = - sme_qos_release_req(WLAN_HDD_GET_HAL_CTX(pAdapter), qosFlowId); + sme_qos_release_req(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, qosFlowId); hdd_info("SME flow %d released, SME status %d", qosFlowId, smeStatus); diff --git a/core/sme/inc/sme_qos_api.h b/core/sme/inc/sme_qos_api.h index 7b98504b5e81..9ffb46053a96 100644 --- a/core/sme/inc/sme_qos_api.h +++ b/core/sme/inc/sme_qos_api.h @@ -240,7 +240,8 @@ sme_QosStatusType sme_qos_setup_req(tHalHandle hHal, uint32_t sessionId, sme_QosWmmUpType UPType, uint32_t *pQosFlowID); sme_QosStatusType sme_qos_modify_req(tHalHandle hHal, sme_QosWmmTspecInfo *pQoSInfo, uint32_t QosFlowID); -sme_QosStatusType sme_qos_release_req(tHalHandle hHal, uint32_t QosFlowID); +sme_QosStatusType sme_qos_release_req(tHalHandle hHal, uint8_t session_id, + uint32_t QosFlowID); bool sme_qos_is_ts_info_ack_policy_valid(tpAniSirGlobal pMac, sme_QosWmmTspecInfo *pQoSInfo, uint8_t sessionId); void sme_qos_update_hand_off(uint8_t sessionId, bool updateHandOff); diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index 641943e38f76..5eaa248c031a 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -379,6 +379,7 @@ sme_QosStatusType sme_qos_internal_modify_req(tpAniSirGlobal pMac, uint32_t QosFlowID, bool buffered_cmd); sme_QosStatusType sme_qos_internal_release_req(tpAniSirGlobal pMac, + uint8_t session_id, uint32_t QosFlowID, bool buffered_cmd); sme_QosStatusType sme_qos_setup(tpAniSirGlobal pMac, @@ -745,6 +746,7 @@ sme_QosStatusType sme_qos_modify_req(tHalHandle hHal, * releasing a QoS flow running on a particular AC. * * @hHal: The handle returned by mac_open. + * @session_id: session_id returned by sme_open_session. * @QosFlowID: Identification per flow running on each AC generated by SME * It is only meaningful if the QoS setup for the flow is successful * @@ -754,7 +756,8 @@ sme_QosStatusType sme_qos_modify_req(tHalHandle hHal, * * Return: QDF_STATUS_SUCCESS - Release is successful. */ -sme_QosStatusType sme_qos_release_req(tHalHandle hHal, uint32_t QosFlowID) +sme_QosStatusType sme_qos_release_req(tHalHandle hHal, uint8_t session_id, + uint32_t QosFlowID) { QDF_STATUS lock_status = QDF_STATUS_E_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -769,7 +772,8 @@ sme_QosStatusType sme_qos_release_req(tHalHandle hHal, uint32_t QosFlowID) return SME_QOS_STATUS_RELEASE_FAILURE_RSP; } /* Call the internal function for QoS release, adding a layer of abstraction */ - status = sme_qos_internal_release_req(pMac, QosFlowID, false); + status = sme_qos_internal_release_req(pMac, session_id, QosFlowID, + false); sme_release_global_lock(&pMac->sme); QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_HIGH, "%s: %d: QoS Release return status on Flow %d is %d", @@ -1997,6 +2001,7 @@ sme_QosStatusType sme_qos_internal_modify_req(tpAniSirGlobal pMac, /** * sme_qos_internal_release_req() - release QOS flow on a particular AC * @pMac: Pointer to the global MAC parameter structure. + * @sessionId: sessionId returned by sme_open_session. * @QosFlowID: Identification per flow running on each AC generated by SME * It is only meaningful if the QoS setup for the flow is successful * @@ -2006,6 +2011,7 @@ sme_QosStatusType sme_qos_internal_modify_req(tpAniSirGlobal pMac, * Return: QDF_STATUS_SUCCESS - Release is successful. */ sme_QosStatusType sme_qos_internal_release_req(tpAniSirGlobal pMac, + uint8_t sessionId, uint32_t QosFlowID, bool buffered_cmd) { @@ -2022,7 +2028,6 @@ sme_QosStatusType sme_qos_internal_release_req(tpAniSirGlobal pMac, sme_QosCmdInfo cmd; tCsrRoamModifyProfileFields modifyProfileFields; bool deltsIssued = false; - uint8_t sessionId; QDF_STATUS hstatus; bool biDirectionalFlowsPresent = false; bool uplinkFlowsPresent = false; @@ -2044,6 +2049,23 @@ sme_QosStatusType sme_qos_internal_release_req(tpAniSirGlobal pMac, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "%s: %d: no match found for flowID = %d", __func__, __LINE__, QosFlowID); + + pSession = &sme_qos_cb.sessionInfo[sessionId]; + if (!buffered_cmd && + !csr_ll_is_list_empty(&pSession->bufferedCommandList, + false)) { + cmd.command = SME_QOS_RELEASE_REQ; + cmd.pMac = pMac; + cmd.sessionId = sessionId; + cmd.u.releaseCmdInfo.QosFlowID = QosFlowID; + hstatus = sme_qos_buffer_cmd(&cmd, buffered_cmd); + if (QDF_IS_STATUS_SUCCESS(hstatus)) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_INFO_HIGH, + "%s:%d: Buffered release request for flow = %d", + __func__, __LINE__, QosFlowID); + } + } return SME_QOS_STATUS_RELEASE_INVALID_PARAMS_RSP; } /* find the AC */ @@ -6409,6 +6431,7 @@ static QDF_STATUS sme_qos_process_buffered_cmd(uint8_t session_id) break; case SME_QOS_RELEASE_REQ: hdd_status = sme_qos_internal_release_req(qos_cmd->pMac, + qos_cmd->sessionId, qos_cmd->u.releaseCmdInfo.QosFlowID, true); if (SME_QOS_STATUS_RELEASE_FAILURE_RSP == hdd_status) { @@ -6721,7 +6744,8 @@ QDF_STATUS sme_qos_del_ts_ind_fnp(tpAniSirGlobal pMac, tListElem *pEntry) } /* Call the internal function for QoS release, adding a layer of abstraction */ status = - sme_qos_internal_release_req(pMac, flow_info->QosFlowID, false); + sme_qos_internal_release_req(pMac, flow_info->sessionId, + flow_info->QosFlowID, false); sme_release_global_lock(&pMac->sme); QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_HIGH, "%s: %d: QoS Release return status on Flow %d is %d", -- cgit v1.2.3 From a6b5859c3bb12504b6560150e6b1210ffbb809f1 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 03:13:24 -0700 Subject: Release 5.1.0.29H Release 5.1.0.29H Change-Id: I2003527c690cf8217aa9a1b9decc6dc8f90c3e09 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 59ed1488b61f..b24ea3f39103 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29G" +#define QWLAN_VERSIONSTR "5.1.0.29H" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From f2136bb225a530f18af7a010a8b5ab85a930b9d1 Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Wed, 28 Sep 2016 18:30:44 +0530 Subject: qcacld-3.0: Enable Runtime PM after first interface is up Enable Runtime PM after first interface is up and disable it when the last interface goes down. The current logic is enabling runtime pm too early, causing crashes. Change-Id: I486409bd8375de327b724fc16ab32b4907c1c093 CRs-Fixed: 1072520 --- core/hdd/src/wlan_hdd_driver_ops.c | 4 ---- core/hdd/src/wlan_hdd_main.c | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 3a8a06dc156a..a20fcb7b7836 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -266,8 +266,6 @@ int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, } } - hif_enable_power_management(hif_ctx, cds_is_packet_log_enabled()); - return 0; err_hif_close: @@ -287,8 +285,6 @@ void hdd_hif_close(void *hif_ctx) if (hif_ctx == NULL) return; - hif_disable_power_management(hif_ctx); - hif_disable(hif_ctx, HIF_DISABLE_TYPE_REMOVE); hdd_napi_destroy(true); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 356c86841843..82be6b96f3f3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1706,6 +1706,44 @@ err_start_adapter: return -EINVAL; } +/** + * hdd_enable_power_management() - API to Enable Power Management + * + * API invokes Bus Interface Layer power management functionality + * + * Return: None + */ +static void hdd_enable_power_management(void) +{ + void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + + if (!hif_ctx) { + hdd_err("Bus Interface Context is Invalid"); + return; + } + + hif_enable_power_management(hif_ctx, cds_is_packet_log_enabled()); +} + +/** + * hdd_disable_power_management() - API to disable Power Management + * + * API disable Bus Interface Layer Power management functionality + * + * Return: None + */ +static void hdd_disable_power_management(void) +{ + void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + + if (!hif_ctx) { + hdd_err("Bus Interface Context is Invalid"); + return; + } + + hif_disable_power_management(hif_ctx); +} + /** * hdd_wlan_start_modules() - Single driver state machine for starting modules * @hdd_ctx: HDD context @@ -1835,6 +1873,7 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, hdd_err("Failed to Enable cds modules"); goto close; } + hdd_enable_power_management(); hdd_info("Driver Modules Successfully Enabled"); hdd_ctx->driver_status = DRIVER_MODULES_ENABLED; break; @@ -7601,6 +7640,7 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown) hdd_info("Modules already closed"); goto done; case DRIVER_MODULES_ENABLED: + hdd_disable_power_management(); if (hdd_deconfigure_cds(hdd_ctx)) { hdd_alert("Failed to de-configure CDS"); QDF_ASSERT(0); -- cgit v1.2.3 From 87499b66d73aff293932a265b955d56cda22ac61 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 03:59:07 -0700 Subject: Release 5.1.0.29I Release 5.1.0.29I Change-Id: I810890166547a413bfbdfa053417e2bb5ddfafc2 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b24ea3f39103..d0bc87ae03fc 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29H" +#define QWLAN_VERSIONSTR "5.1.0.29I" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3 From ca198b5eb5a328091f6dc17e3f4725742f66de30 Mon Sep 17 00:00:00 2001 From: Arun Khandavalli Date: Tue, 26 Apr 2016 20:53:35 +0530 Subject: qcacld-3.0: Allocate memory for set_offload and program at once qcacld-2.0 to qcacld-3.0 propagation Presently, in BPF set_offload structure and the filter program are allocated separately. In certain error paths the program is not freed correctly because of which there can be memory leaks. Have a single allocation for the set_offload and program to avoid any memory leaks. Change-Id: I097d3408cc89c26e015fd6aee8668f53e8f64cf7 CRs-Fixed: 1006522 --- core/sme/src/common/sme_api.c | 17 ++++------------- core/wma/src/wma_features.c | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 2983525148fc..57c167a44b1f 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16064,7 +16064,8 @@ QDF_STATUS sme_set_bpf_instructions(tHalHandle hal, cds_msg_t cds_msg; struct sir_bpf_set_offload *set_offload; - set_offload = qdf_mem_malloc(sizeof(*set_offload)); + set_offload = qdf_mem_malloc(sizeof(*set_offload) + + req->current_length); if (NULL == set_offload) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, @@ -16078,14 +16079,8 @@ QDF_STATUS sme_set_bpf_instructions(tHalHandle hal, set_offload->total_length = req->total_length; set_offload->current_length = req->current_length; if (set_offload->total_length) { - set_offload->program = qdf_mem_malloc(sizeof(uint8_t) * - req->current_length); - if (NULL == set_offload->program) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("Failed to alloc instruction memory")); - qdf_mem_free(set_offload); - return QDF_STATUS_E_NOMEM; - } + set_offload->program = ((uint8_t *)set_offload) + + sizeof(*set_offload); qdf_mem_copy(set_offload->program, req->program, set_offload->current_length); } @@ -16100,16 +16095,12 @@ QDF_STATUS sme_set_bpf_instructions(tHalHandle hal, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, FL("Post BPF set offload msg fail")); status = QDF_STATUS_E_FAILURE; - if (set_offload->total_length) - qdf_mem_free(set_offload->program); qdf_mem_free(set_offload); } sme_release_global_lock(&mac_ctx->sme); } else { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, FL("sme_acquire_global_lock failed")); - if (set_offload->total_length) - qdf_mem_free(set_offload->program); qdf_mem_free(set_offload); } return status; diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 72f19099c716..567ed6e7abe4 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -7907,7 +7907,6 @@ QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma, buf_ptr += WMI_TLV_HDR_SIZE; qdf_mem_copy(buf_ptr, bpf_set_offload->program, bpf_set_offload->current_length); - qdf_mem_free(bpf_set_offload->program); } if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, -- cgit v1.2.3 From 0a4bd746b2f4deb406e785669b940dce21c6ca47 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 07:48:05 -0700 Subject: Release 5.1.0.29J Release 5.1.0.29J Change-Id: If9de5595f4d45a7fb38b34d608e953fea7f1aa8f CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d0bc87ae03fc..7e897c074a79 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29I" +#define QWLAN_VERSIONSTR "5.1.0.29J" #endif /* QWLAN_VERSION_H */ -- cgit v1.2.3