From 33c34e32287c3c8d3ab2eb4657e6014dd687c79f Mon Sep 17 00:00:00 2001 From: Nachiket Kukade Date: Fri, 7 Jul 2017 18:45:04 +0530 Subject: [PATCH] qcacld-3.0: Update missing vht capabilities in wiphy before registering Currently while registering wiphy, supported Beamformee STS Capability and Number of Sounding Dimensions are not updated in the vhtcap field. This results in hostapd failing to start if above two configurations are enabled in the conf file. Update missing vht capabilities in wiphy before registering. Change-Id: I8db376fe1f14fd5b722e67a5889addf4c2fb7f28 CRs-Fixed: 2062520 --- core/hdd/src/wlan_hdd_main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 27da64420da4..e213b4d54320 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -920,6 +920,36 @@ static void hdd_update_vdev_nss(hdd_context_t *hdd_ctx) cfg_ini->vdev_type_nss_5g, eCSR_BAND_5G); } +/** + * hdd_update_wiphy_vhtcap() - Updates wiphy vhtcap fields + * @hdd_ctx: HDD context + * + * Updates wiphy vhtcap fields + * + * Return: None + */ +static void hdd_update_wiphy_vhtcap(hdd_context_t *hdd_ctx) +{ + struct ieee80211_supported_band *band_5g = + hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ]; + uint32_t val; + + if (!band_5g) { + hdd_debug("5GHz band disabled, skipping capability population"); + return; + } + + val = hdd_ctx->config->txBFCsnValue; + band_5g->vht_cap.cap |= (val << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT); + + val = NUM_OF_SOUNDING_DIMENSIONS; + band_5g->vht_cap.cap |= + (val << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT); + + hdd_info("Updated wiphy vhtcap:0x%x, CSNAntSupp:%d, NumSoundDim:%d", + band_5g->vht_cap.cap, hdd_ctx->config->txBFCsnValue, val); +} + /** * hdd_update_hw_dbs_capable() - sets the dbs capability of the device * @hdd_ctx: HDD context @@ -1584,6 +1614,11 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_debug("Target BPF %d Host BPF %d 8ss fw support %d txBFCsnValue %d", cfg->bpf_enabled, hdd_ctx->config->bpf_packet_filter_enable, cfg->tx_bfee_8ss_enabled, hdd_ctx->config->txBFCsnValue); + + /* + * Update txBFCsnValue and NumSoundingDim values to vhtcap in wiphy + */ + hdd_update_wiphy_vhtcap(hdd_ctx); /* * If BPF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX * because we need atleast WMA_STA_WOW_DEFAULT_PTRN_MAX free slots to