diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 78b91ab597b4..94c01c7aa297 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -24264,6 +24264,8 @@ static int __wlan_hdd_cfg80211_set_bitrate_mask(struct wiphy *wiphy, uint8_t connected_band, nss, i; int bit_rate = -1; uint8_t rate_index; + struct hdd_context *hdd_ctx = wiphy_priv(wiphy); + uint8_t vdev_id; if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam() || QDF_GLOBAL_MONITOR_MODE == hdd_get_conparam()) { @@ -24275,6 +24277,12 @@ static int __wlan_hdd_cfg80211_set_bitrate_mask(struct wiphy *wiphy, if (errno) return errno; + errno = wlan_hdd_validate_context(hdd_ctx); + if (errno) + return errno; + + vdev_id = adapter->vdev_id; + connected_band = hdd_conn_get_connected_band(&adapter->session.station); switch (connected_band) { @@ -24331,8 +24339,24 @@ configure_fw: errno = wma_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_FIXED_RATE, bit_rate, VDEV_CMD); - if (errno) + if (errno) { hdd_err_rl("Failed to set firmware, errno %d", errno); + return errno; + } + + if (mask->control[band].gi & HDD_AUTO_RATE_SGI) + errno = sme_set_auto_rate_he_sgi(hdd_ctx->mac_handle, + adapter->vdev_id, + mask->control[band].gi); + else + errno = sme_update_ht_config(hdd_ctx->mac_handle, + adapter->vdev_id, + WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, + mask->control[band].gi); + + if (errno) + hdd_err("cfg set failed, value %d status %d", + mask->control[band].gi, errno); return errno; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 44f2ae6e137f..f14efd647eab 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1717,9 +1717,12 @@ static void hdd_update_wiphy_vhtcap(struct hdd_context *hdd_ctx) { struct ieee80211_supported_band *band_5g = hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]; + struct ieee80211_supported_band *band_2g = + hdd_ctx->wiphy->bands[NL80211_BAND_2GHZ]; QDF_STATUS status; uint8_t value = 0, value1 = 0; uint32_t value2; + bool is_vht_24ghz; if (!band_5g) { hdd_debug("5GHz band disabled, skipping capability population"); @@ -1746,7 +1749,9 @@ static void hdd_update_wiphy_vhtcap(struct hdd_context *hdd_ctx) ucfg_mlme_cfg_get_vht_tx_mcs_map(hdd_ctx->psoc, &value2); band_5g->vht_cap.vht_mcs.tx_mcs_map = value2; - + ucfg_mlme_get_vht_for_24ghz(hdd_ctx->psoc, &is_vht_24ghz); + if (is_vht_24ghz) + band_2g->vht_cap.vht_mcs.tx_mcs_map = value2; } static void hdd_update_tgt_ht_cap(struct hdd_context *hdd_ctx,