From 22f05d45b79682beff687da39a13fa935b09968b Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Fri, 28 Jun 2019 18:33:43 -0700 Subject: [PATCH 1/5] qcacld-3.0: Advertise max BA buffer size in HE mode The default addba buffer size is set to 64 and HE supports 256 BA bitmap. Set addba response frame BA buffer size to max BA buffer size (256) in HE mode. Change-Id: I74db45874997cb3f3e758c89d7e95d72c27ee13f CRs-Fixed: 2481484 --- core/mac/src/pe/lim/lim_send_management_frames.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 b0975cbe887a..5485e2363f45 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -4736,7 +4736,10 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx, pe_err("refused addba req"); } frm.addba_param_set.tid = tid; - frm.addba_param_set.buff_size = SIR_MAC_BA_DEFAULT_BUFF_SIZE; + if (lim_is_session_he_capable(session)) + frm.addba_param_set.buff_size = MAX_BA_BUFF_SIZE; + else + frm.addba_param_set.buff_size = SIR_MAC_BA_DEFAULT_BUFF_SIZE; if (mac_ctx->usr_cfg_ba_buff_size) frm.addba_param_set.buff_size = mac_ctx->usr_cfg_ba_buff_size; From 7040d2b4e83a25eebede831d6c3a3d17cc8f4374 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Tue, 2 Jul 2019 18:02:54 +0530 Subject: [PATCH 2/5] qcacld-3.0: Remove redundant init and check in policy_mgr_skip_dfs_ch Remove redundant initialization for local variable dfs_master_capable and always pass check for skip_dfs_channel in policy_mgr_skip_dfs_ch. Change-Id: Icf3ca4e297a54646114d414f1d0bd8543e59ea37 CRs-Fixed: 2482890 --- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index e0bcc6dacbf2..f9dee88e23f7 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -340,7 +340,7 @@ static QDF_STATUS policy_mgr_skip_dfs_ch(struct wlan_objmgr_psoc *psoc, bool *skip_dfs_channel) { bool sta_sap_scc_on_dfs_chan; - bool dfs_master_capable = true; + bool dfs_master_capable; QDF_STATUS status; status = ucfg_mlme_get_dfs_master_capability(psoc, @@ -355,21 +355,19 @@ static QDF_STATUS policy_mgr_skip_dfs_ch(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("skip DFS ch for SAP/Go dfs master cap %d", dfs_master_capable); *skip_dfs_channel = true; + return QDF_STATUS_SUCCESS; } - if (!*skip_dfs_channel) { - sta_sap_scc_on_dfs_chan = - policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); - if ((policy_mgr_mode_specific_connection_count(psoc, - PM_STA_MODE, - NULL) > 0) && - !sta_sap_scc_on_dfs_chan) { - policy_mgr_debug("SAP/Go skips DFS ch if sta connects"); - *skip_dfs_channel = true; - } + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, + NULL) > 0) && + !sta_sap_scc_on_dfs_chan) { + policy_mgr_debug("SAP/Go skips DFS ch if sta connects"); + *skip_dfs_channel = true; } - return status; + return QDF_STATUS_SUCCESS; } /** From 2168aadfa4ac6f1cb0642dccf9bfddb6c87df325 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Wed, 12 Jun 2019 20:51:36 +0530 Subject: [PATCH 3/5] qcacld-3.0: Add support to configure avoid acs freq list Currently there is no ini support to configure frequencies which needs to be avoided for the acs channel list which may allow SAP to come up on a channel which is not preferred. For Example there are many legacy clients which supports 2.4GHz but don't support channel 12 and 13 (or does not have the capability to detect country change where channel 12 and 13 is valid). In that case, if SAP comes up on channel 12/13, those legacy clients won't be able to connect to AP. Hence, Add a feature flag and ini to configure the frequency list which can be avoided during acs. Change-Id: Id106b38228f837ba056eb916004dc012e919ddd2 CRs-Fixed: 2472004 --- Kbuild | 3 ++ components/mlme/core/src/wlan_mlme_main.c | 25 +++++++++ components/mlme/dispatcher/inc/cfg_mlme_reg.h | 36 ++++++++++++- .../dispatcher/inc/wlan_mlme_public_struct.h | 7 +++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 24 +++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 28 ++++++++++ configs/default_defconfig | 3 ++ configs/genoa.common | 3 ++ core/hdd/src/wlan_hdd_cfg80211.c | 52 +++++++++++++++++++ 9 files changed, 180 insertions(+), 1 deletion(-) diff --git a/Kbuild b/Kbuild index f85c14afc8e9..4996acece0c6 100644 --- a/Kbuild +++ b/Kbuild @@ -2618,6 +2618,9 @@ cppflags-$(CONFIG_HOST_OPCLASS) += -DHOST_OPCLASS #Flag to enable/disable TARGET_11D_SCAN cppflags-$(CONFIG_TARGET_11D_SCAN) += -DTARGET_11D_SCAN +#Flag to enable/disable avoid acs frequency list feature +cppflags-$(CONFIG_SAP_AVOID_ACS_FREQ_LIST) += -DSAP_AVOID_ACS_FREQ_LIST + #Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) cppflags-$(CONFIG_WLAN_DYNAMIC_CVM) += -DFEATURE_WLAN_DYNAMIC_CVM diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 0e42dbddffac..a97fa69fc275 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -2252,6 +2252,30 @@ static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc, } #endif +#ifdef SAP_AVOID_ACS_FREQ_LIST +static void mlme_init_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_reg *reg) +{ + qdf_size_t avoid_acs_freq_list_num = 0; + uint8_t i; + + qdf_uint16_array_parse(cfg_get(psoc, CFG_SAP_AVOID_ACS_FREQ_LIST), + reg->avoid_acs_freq_list, + CFG_VALID_CHANNEL_LIST_LEN, + &avoid_acs_freq_list_num); + reg->avoid_acs_freq_list_num = avoid_acs_freq_list_num; + + for (i = 0; i < avoid_acs_freq_list_num; i++) + mlme_legacy_debug("avoid_acs_freq %d", + reg->avoid_acs_freq_list[i]); +} +#else +static void mlme_init_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_reg *reg) +{ +} +#endif + static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_reg *reg) { @@ -2274,6 +2298,7 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, qdf_str_lcopy(reg->country_code, cfg_default(CFG_COUNTRY_CODE), sizeof(reg->country_code)); reg->country_code_len = (uint8_t)sizeof(reg->country_code); + mlme_init_acs_avoid_freq_list(psoc, reg); } static void diff --git a/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/components/mlme/dispatcher/inc/cfg_mlme_reg.h index f7972a130db5..502226923f23 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_reg.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -95,6 +95,39 @@ 0, \ "enable/disable ETSI SRD channels in master mode") +#ifdef SAP_AVOID_ACS_FREQ_LIST +#define SAP_AVOID_ACS_FREQ_LIST_DEFAULT "" + +/* + * + * sap_avoid_acs_freq_list - Avoid configured frequencies from acs + * @Default: No frequencies are configured, it means consider all + * the frequencies for acs + * + * This ini is to configure the frequencies which needs to be + * avoided during acs and sap will not come up on these channels + * Ex: sap_avoid_acs_freq_list=2412,2417,2422,2427,2467,2472 + * + * Related: Feature flag SAP_AVOID_ACS_FREQ_LIST + * + * Supported Feature: SAP + * + * Usage: External + * + * + */ + +#define CFG_SAP_AVOID_ACS_FREQ_LIST CFG_INI_STRING( \ + "sap_avoid_acs_freq_list", \ + 0, \ + CFG_VALID_CHANNEL_LIST_STRING_LEN, \ + SAP_AVOID_ACS_FREQ_LIST_DEFAULT, \ + "Avoid configured frequencies during acs") +#define CFG_SAP_AVOID_ACS_FREQ_LIST_ALL CFG(CFG_SAP_AVOID_ACS_FREQ_LIST) +#else +#define CFG_SAP_AVOID_ACS_FREQ_LIST_ALL +#endif + /* * * restart_beaconing_on_chan_avoid_event - control the beaconing entity to move @@ -217,6 +250,7 @@ CFG(CFG_INDOOR_CHANNEL_SUPPORT) \ CFG(CFG_SCAN_11D_INTERVAL) \ CFG(CFG_VALID_CHANNEL_LIST) \ - CFG(CFG_COUNTRY_CODE) + CFG(CFG_COUNTRY_CODE) \ + CFG_SAP_AVOID_ACS_FREQ_LIST_ALL #endif /* CFG_MLME_REG_H__ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 5c9cbe4f1143..ff076f710aff 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2038,6 +2038,9 @@ struct wlan_mlme_mwc { * @country_code: country code * @country_code_len: country code length * @enable_11d_in_world_mode: Whether to enable 11d scan in world mode or not + * @avoid_acs_freq_list: List of the frequencies which need to be avoided + * during acs + * @avoid_acs_freq_list_num: Number of the frequencies to be avoided during acs */ struct wlan_mlme_reg { uint32_t self_gen_frm_pwr; @@ -2051,6 +2054,10 @@ struct wlan_mlme_reg { uint8_t country_code[CFG_COUNTRY_CODE_LEN + 1]; uint8_t country_code_len; bool enable_11d_in_world_mode; +#ifdef SAP_AVOID_ACS_FREQ_LIST + uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; + uint8_t avoid_acs_freq_list_num; +#endif }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 0a9f6e5393f1..2b4fee3bb87f 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -3660,6 +3660,30 @@ QDF_STATUS ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, bool *value); +#ifdef SAP_AVOID_ACS_FREQ_LIST +/** + * ucfg_mlme_get_acs_avoid_freq_list - get acs avoid frequency list + * @psoc: pointer to psoc object + * @freq_list: Pointer to output freq list + * @freq_list_num: Pointer to the output number of frequencies filled + * in the freq_list + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, + uint16_t *freq_list, uint8_t *freq_list_num); + +#else +static inline QDF_STATUS +ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, + uint16_t *freq_list, uint8_t *freq_list_num) +{ + *freq_list_num = 0; + return QDF_STATUS_E_INVAL; +} +#endif + /** * ucfg_mlme_get_11d_in_world_mode - get whether 11d is enabled in world mode * in master mode diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 93d8a09aa0a9..fd4e376ac58f 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1414,6 +1414,34 @@ ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +#ifdef SAP_AVOID_ACS_FREQ_LIST +QDF_STATUS +ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc, + uint16_t *freq_list, uint8_t *freq_list_num) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + qdf_size_t avoid_acs_freq_list_num; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + qdf_uint16_array_parse( + cfg_default(CFG_SAP_AVOID_ACS_FREQ_LIST), + freq_list, CFG_VALID_CHANNEL_LIST_LEN, + &avoid_acs_freq_list_num); + *freq_list_num = avoid_acs_freq_list_num; + + mlme_legacy_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *freq_list_num = mlme_obj->cfg.reg.avoid_acs_freq_list_num; + qdf_mem_copy(freq_list, mlme_obj->cfg.reg.avoid_acs_freq_list, + *freq_list_num * sizeof(uint16_t)); + + return QDF_STATUS_SUCCESS; +} +#endif + QDF_STATUS ucfg_mlme_get_11d_in_world_mode(struct wlan_objmgr_psoc *psoc, bool *value) diff --git a/configs/default_defconfig b/configs/default_defconfig index b06dc789f162..0e9efa581ac2 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -656,6 +656,9 @@ CONFIG_LTE_COEX := y #Flag to enable/disable TARGET 11d scan CONFIG_TARGET_11D_SCAN := y +#Flag to enable/disable Avoid acs freq feature +CONFIG_SAP_AVOID_ACS_FREQ_LIST := y + #Flag to enable HOST OPCLASS feature CONFIG_HOST_OPCLASS := y diff --git a/configs/genoa.common b/configs/genoa.common index aa7f0aa814a3..e25b4d5c94e1 100644 --- a/configs/genoa.common +++ b/configs/genoa.common @@ -53,6 +53,9 @@ CONFIG_WLAN_DYNAMIC_CVM := n CONFIG_WLAN_WEXT_SUPPORT_ENABLE := y CONFIG_HOST_11D_SCAN := y +#Flag to enable/disable Avoid acs freq feature +CONFIG_SAP_AVOID_ACS_FREQ_LIST := n + ifeq ($(CONFIG_ARCH_MSM8996), y) CONFIG_CHANNEL_HOPPING_ALL_BANDS := y endif diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2f168d5b2e39..1753f1a69d2a 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2529,6 +2529,55 @@ int hdd_start_vendor_acs(struct hdd_adapter *adapter) return status; } +/** + * hdd_avoid_acs_channels() - Avoid acs channels + * @hdd_ctx: Pointer to the hdd context + * @sap_config: Sap config structure pointer + * + * This function avoids channels from the acs corresponding to + * the frequencies configured in the ini sap_avoid_acs_freq_list + * + * Return: None + */ + +#ifdef SAP_AVOID_ACS_FREQ_LIST +static void hdd_avoid_acs_channels(struct hdd_context *hdd_ctx, + struct sap_config *sap_config) +{ + int i, j, ch_cnt = 0; + uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN]; + uint8_t avoid_acs_freq_list_num; + + hdd_enter(); + + ucfg_mlme_get_acs_avoid_freq_list(hdd_ctx->psoc, + avoid_acs_freq_list, + &avoid_acs_freq_list_num); + + for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++) { + for (j = 0; j < avoid_acs_freq_list_num; j++) { + if (sap_config->acs_cfg.ch_list[i] == + wlan_reg_freq_to_chan( + hdd_ctx->pdev, + avoid_acs_freq_list[j])) { + hdd_debug("skip channel %d", + sap_config->acs_cfg.ch_list[i]); + break; + } + } + if (j == avoid_acs_freq_list_num) + sap_config->acs_cfg.ch_list[ch_cnt++] = + sap_config->acs_cfg.ch_list[i]; + } + sap_config->acs_cfg.ch_list_count = ch_cnt; +} +#else +static void hdd_avoid_acs_channels(struct hdd_context *hdd_ctx, + struct sap_config *sap_config) +{ +} +#endif + /** * __wlan_hdd_cfg80211_do_acs(): CFG80211 handler function for DO_ACS Vendor CMD * @wiphy: Linux wiphy struct pointer @@ -2762,6 +2811,9 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, } sap_config->acs_cfg.ch_list_count = ch_cnt; } + + hdd_avoid_acs_channels(hdd_ctx, sap_config); + hdd_debug("get pcl for DO_ACS vendor command"); pm_mode = From f87666798573dbb18151937bff61fbaff1189ce3 Mon Sep 17 00:00:00 2001 From: Varuneshwar Petlozu Date: Tue, 2 Jul 2019 15:50:42 +0530 Subject: [PATCH 4/5] qcacld-3.0: Add null check for qdf_ctx in hdd_configure_cds Currently in function hdd_configure_cds the driver is passing the pointer from cds_get_context to ucfg_ipa_uc_ol_init without any NULL check. This pointer later then gets dereferenced which can cause null pointer dereference. To solve this, added a null check before calling ucfg_ipa_uc_ol_init Change-Id: Ie0d8e103c9eeac76d285c4b3870c3c4ea9172dc6 CRs-Fixed: 2462711 --- core/hdd/src/wlan_hdd_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1ac789391323..cb809eeb0e50 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11181,6 +11181,7 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx) bool value; enum pmo_auto_pwr_detect_failure_mode auto_power_fail_mode; bool bval = false; + qdf_device_t qdf_ctx; mac_handle = hdd_ctx->mac_handle; @@ -11277,8 +11278,14 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx) * IPA module before configuring them to FW. Sequence required as crash * observed otherwise. */ - if (ucfg_ipa_uc_ol_init(hdd_ctx->pdev, - cds_get_context(QDF_MODULE_ID_QDF_DEVICE))) { + + qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + if (!qdf_ctx) { + hdd_err("QDF device context is NULL"); + goto out; + } + + if (ucfg_ipa_uc_ol_init(hdd_ctx->pdev, qdf_ctx)) { hdd_err("Failed to setup pipes"); goto out; } From 526f809415da03abf62861f073ff6de312af6c88 Mon Sep 17 00:00:00 2001 From: nshrivas Date: Wed, 3 Jul 2019 08:55:54 -0700 Subject: [PATCH 5/5] Release 5.2.0.138N Release 5.2.0.138N Change-Id: Ic6c1c8e4238afcf4806adf24fecc8cbaec1a4799 CRs-Fixed: 774533 --- 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 ca60229d97bc..e108ca129e11 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 138 -#define QWLAN_VERSIONSTR "5.2.0.138M" +#define QWLAN_VERSIONSTR "5.2.0.138N" #endif /* QWLAN_VERSION_H */