From d68fd729dd6d39fee7dc2329585037f89df2dc23 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 22 Mar 2017 15:17:47 +0530 Subject: qcacld-3.0: Send Nss 1x1 for HT-STAs if hw is DBS capable If the device is DBS capable, then it may switch between 2x2 and 1x1 depending on the active session. If the reference device is non-VHT STA and is HT-STA, then the reference device may not be able to decode operating mode notification frame. Thus, there can be IOT issues. The fix is to associate with non-VHT STA that are HT STA with 1x1 Nss capability. Change-Id: Ic6c889f18a2e20bbde9e0d8228de65cffa5162b8 CRs-Fixed: 2023200 --- core/hdd/src/wlan_hdd_main.c | 22 ++++++++++++++++++++++ core/mac/inc/ani_global.h | 3 +++ core/mac/src/pe/lim/lim_send_management_frames.c | 4 ++++ core/sme/inc/sme_api.h | 1 + core/sme/src/common/sme_api.c | 15 +++++++++++++++ 5 files changed, 45 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 15c7cfbb243a..0d4e5c27c8e7 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -832,6 +832,26 @@ static void hdd_update_vdev_nss(hdd_context_t *hdd_ctx) cfg_ini->vdev_type_nss_5g, eCSR_BAND_5G); } +/** + * hdd_update_hw_dbs_capable() - sets the dbs capability of the device + * @hdd_ctx: HDD context + * + * Sets the DBS capability as per INI and firmware capability + * + * Return: None + */ +static void hdd_update_hw_dbs_capable(hdd_context_t *hdd_ctx) +{ + struct hdd_config *cfg_ini = hdd_ctx->config; + uint8_t hw_dbs_capable = 0; + + if ((!cfg_ini->dual_mac_feature_disable) + && wma_is_hw_dbs_capable()) + hw_dbs_capable = 1; + + sme_update_hw_dbs_capable(hdd_ctx->hHal, hw_dbs_capable); +} + static void hdd_update_tgt_ht_cap(hdd_context_t *hdd_ctx, struct wma_tgt_ht_cap *cfg) { @@ -1442,6 +1462,8 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_update_vdev_nss(hdd_ctx); + hdd_update_hw_dbs_capable(hdd_ctx); + hdd_ctx->config->fine_time_meas_cap &= cfg->fine_time_measurement_cap; hdd_ctx->fine_time_meas_cap_target = cfg->fine_time_measurement_cap; hdd_debug("fine_time_meas_cap: 0x%x", diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 6e28e95fc9d1..2342965c3aa6 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -956,6 +956,9 @@ typedef struct sAniSirGlobal { /* 802.11p enable */ bool enable_dot11p; + /* DBS capability based on INI and FW capability */ + uint8_t hw_dbs_capable; + /* Based on INI parameter */ uint32_t dual_mac_feature_disable; sir_mgmt_frame_ind_callback mgmt_frame_ind_cb; sir_p2p_ack_ind_callback p2p_ack_ind_cb; 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 a36da0d1aa41..07c92db36178 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1258,6 +1258,10 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx, populate_dot11f_vht_operation(mac_ctx, pe_session, &frm.VHTOperation); is_vht = true; + } else { + /* Advertise 1x1 if either is HT-STA */ + if (frm.HTCaps.present && mac_ctx->hw_dbs_capable) + frm.HTCaps.supportedMCSSet[1] = 0; } if (pe_session->vhtCapability && pe_session->vendor_vht_sap && diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 0fa7d2b9ffeb..0f55c4734d9b 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1298,6 +1298,7 @@ void sme_set_pdev_ht_vht_ies(tHalHandle hHal, bool enable2x2); void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss, uint32_t vdev_type_nss, eCsrBand band); +void sme_update_hw_dbs_capable(tHalHandle hal, uint8_t hw_dbs_capable); void sme_register_p2p_lo_event(tHalHandle hHal, void *context, p2p_lo_callback callback); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 486313396dbe..f2136b33016a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16644,6 +16644,21 @@ void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss, vdev_nss->tdls, vdev_nss->ocb); } +/** + * sme_update_hw_dbs_capable() - sets the HW DBS capability + * @hal: Pointer to HAL + * @hw_dbs_capable: HW DBS capability + * + * Sets HW DBS capability based on INI and fw capability. + * + * Return: None + */ +void sme_update_hw_dbs_capable(tHalHandle hal, uint8_t hw_dbs_capable) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + mac_ctx->hw_dbs_capable = hw_dbs_capable; +} + /** * sme_register_p2p_lo_event() - Register for the p2p lo event * @hHal: reference to the HAL -- cgit v1.2.3