From 7665a50dabe42f652071d7a16e43d4bf46ef7c39 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Mon, 5 Aug 2019 14:24:20 +0530 Subject: [PATCH] qcacld-3.0: Extend force 1x1 ini Currently the driver checks whether the device supports antenna sharing, and if the AP is added in the OUI framework, then the driver modifies the nss value to 1 to avoid sending SMPS to the peer AP. Now suppose the device does not support Antenna sharing, but supports DBS and is helium HW, then going to DBS HW mode would result in peer sending a SMPS frame to the peer as the helium HW only has two antennas, and one is needed by each MAC now. Fix is to add a third param in force 1x1 ini which would decide the driver should consider the antenna sharing as mandatory or not. Change-Id: I3ae00fcbd642c7780952d66ccbf1208335fcb077 CRs-Fixed: 2496831 --- .../policy_mgr/inc/wlan_policy_mgr_cfg.h | 12 ++++++++---- .../policy_mgr/inc/wlan_policy_mgr_public_struct.h | 12 ++++++++++++ .../cmn_services/policy_mgr/src/wlan_policy_mgr_i.h | 2 +- core/sme/inc/csr_api.h | 2 +- core/sme/inc/csr_internal.h | 2 +- core/sme/src/csr/csr_api_roam.c | 13 +++++++++---- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h index 89727ac7d15b..6bf072a19f6f 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h @@ -415,11 +415,15 @@ CFG_INI_UINT("g_sta_sap_scc_on_dfs_chan", 0, 2, 0, CFG_VALUE_OR_DEFAULT, \ * * gForce1x1Exception - force 1x1 when connecting to certain peer * @Min: 0 - * @Max: 1 - * @Default: 0 + * @Max: 2 + * @Default: 2 * * This INI when enabled will force 1x1 connection with certain peer. - * + * The implementation for this ini would be as follows:- + * Value 0: Even if the AP is present in OUI, 1x1 will not be forced + * Value 1: If antenna sharing supported, then only do 1x1. + * Value 2: If AP present in OUI, force 1x1 connection. + * * Related: None * @@ -431,7 +435,7 @@ CFG_INI_UINT("g_sta_sap_scc_on_dfs_chan", 0, 2, 0, CFG_VALUE_OR_DEFAULT, \ */ #define CFG_FORCE_1X1_FEATURE \ -CFG_INI_UINT("gForce1x1Exception", 0, 1, 1, CFG_VALUE_OR_DEFAULT, \ +CFG_INI_UINT("gForce1x1Exception", 0, 1, 2, CFG_VALUE_OR_DEFAULT, \ "force 1x1 when connecting to certain peer") /* diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h index a1659bae5208..614ecc9f5662 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h @@ -138,6 +138,18 @@ enum hw_mode_mac_band_cap { HW_MODE_MAC_BAND_5G = WLAN_5G_CAPABILITY, }; +/** + * enum force_1x1_type - enum to specify the type of forced 1x1 ini provided. + * @FORCE_1X1_DISABLED: even if the AP is present in OUI, 1x1 will not be forced + * @FORCE_1X1_ENABLED_FOR_AS: If antenna sharing supported, then only do 1x1. + * @FORCE_1X1_ENABLED_FORCED: If AP present in OUI, force 1x1 connection. + */ +enum force_1x1_type { + FORCE_1X1_DISABLED, + FORCE_1X1_ENABLED_FOR_AS, + FORCE_1X1_ENABLED_FORCED, +}; + /** * enum policy_mgr_pcl_group_id - Identifies the pcl groups to be used * @POLICY_MGR_PCL_GROUP_ID1_ID2: Use weights of group1 and group2 diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h index 6195172012d9..5a1ee0ad7809 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h @@ -256,7 +256,7 @@ struct policy_mgr_cfg { uint8_t allow_mcc_go_diff_bi; uint8_t enable_overlap_chnl; uint8_t dual_mac_feature; - uint8_t is_force_1x1_enable; + enum force_1x1_type is_force_1x1_enable; uint8_t sta_sap_scc_on_dfs_chnl; uint8_t sta_sap_scc_on_lte_coex_chnl; uint8_t nan_sap_scc_on_lte_coex_chnl; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index be9ff0711b8b..9b19707f2648 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1025,7 +1025,7 @@ struct csr_config_params { struct csr_sta_roam_policy_params sta_roam_policy_params; bool enable_bcast_probe_rsp; bool is_fils_enabled; - bool is_force_1x1; + enum force_1x1_type is_force_1x1; uint8_t oce_feature_bitmap; uint32_t offload_11k_enable_bitmask; bool wep_tkip_in_he; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 36528c368586..f93ecc78234b 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -387,7 +387,7 @@ struct csr_config { struct csr_sta_roam_policy_params sta_roam_policy; bool enable_bcast_probe_rsp; bool is_fils_enabled; - bool is_force_1x1; + enum force_1x1_type is_force_1x1; uint8_t oce_feature_bitmap; uint32_t offload_11k_enable_bitmask; bool wep_tkip_in_he; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 52e11ab5b378..4688c273ac2e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15502,14 +15502,19 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, sme_debug("1x1 with 1 Chain AP"); } - if (mac->roam.configParam.is_force_1x1 && - mac->lteCoexAntShare && - is_vendor_ap_present) { + if (is_vendor_ap_present && + !policy_mgr_is_hw_dbs_2x2_capable(mac->psoc) && + ((mac->roam.configParam.is_force_1x1 == + FORCE_1X1_ENABLED_FOR_AS && mac->lteCoexAntShare) || + mac->roam.configParam.is_force_1x1 == + FORCE_1X1_ENABLED_FORCED)) { pSession->supported_nss_1x1 = true; pSession->vdev_nss = 1; pSession->nss = 1; pSession->nss_forced_1x1 = true; - sme_debug("For special ap, NSS: %d", pSession->nss); + sme_debug("For special ap, NSS: %d force 1x1 %d", + pSession->nss, + mac->roam.configParam.is_force_1x1); } csr_update_he_caps_mcs(mac->mlme_cfg, pSession);