From db5ea0d6db46be3be73effa7ce89165c2e38255b Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 22 Mar 2017 15:17:47 +0530 Subject: [PATCH] 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 +++ .../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 75f9a7a16f6c..868f8ff465a5 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -844,6 +844,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) { @@ -1468,6 +1488,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_info("fine_time_meas_cap: 0x%x", diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 26e85863b859..cedca6709a57 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -961,6 +961,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 d115236a2d55..6f47847b9b62 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1275,6 +1275,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 ca16edbd49f8..5c8b72654b67 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1252,6 +1252,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 b1a453a44a03..8a457fada9bb 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -15896,6 +15896,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