diff --git a/configs/default_defconfig b/configs/default_defconfig index 5fecb30bc6..2294282dd4 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -1303,3 +1303,6 @@ else CONFIG_DP_LEGACY_MODE_CSM_DEFAULT_DISABLE := 0 endif endif + +#Enable 11BE EHT +CONFIG_WLAN_FEATURE_11BE := n diff --git a/core/hdd/inc/wlan_hdd_eht.h b/core/hdd/inc/wlan_hdd_eht.h index 780acbe3b0..cf02cf38be 100644 --- a/core/hdd/inc/wlan_hdd_eht.h +++ b/core/hdd/inc/wlan_hdd_eht.h @@ -68,12 +68,34 @@ int hdd_update_eht_cap_in_cfg(struct hdd_context *hdd_ctx); */ void wlan_hdd_check_11be_support(struct hdd_beacon_data *beacon, struct sap_config *config); + +/** + * hdd_update_wiphy_eht_cap() - update the wiphy with eht capabilities + * @hdd_ctx: HDD context + * @cfg: WMA target configuration + * + * update wiphy with the eht capabilties. + * + * Return: None + */ +void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx, + struct wma_tgt_cfg *cfg); #else +static inline +void hdd_update_tgt_eht_cap(struct hdd_context *hdd_ctx, + struct wma_tgt_cfg *cfg) +{ +} static inline void wlan_hdd_check_11be_support(struct hdd_beacon_data *beacon, struct sap_config *config) { } +static inline +void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx, + struct wma_tgt_cfg *cfg) +{ +} #endif #endif /* if !defined(WLAN_HDD_EHT_H)*/ diff --git a/core/hdd/src/wlan_hdd_eht.c b/core/hdd/src/wlan_hdd_eht.c index cf8cfe78fd..7cb52f8c88 100644 --- a/core/hdd/src/wlan_hdd_eht.c +++ b/core/hdd/src/wlan_hdd_eht.c @@ -31,6 +31,121 @@ void hdd_update_tgt_eht_cap(struct hdd_context *hdd_ctx, struct wma_tgt_cfg *cfg) { + tDot11fIEeht_cap eht_cap_ini = {0}; + + ucfg_mlme_update_tgt_eht_cap(hdd_ctx->psoc, cfg); + sme_update_tgt_eht_cap(hdd_ctx->mac_handle, cfg, &eht_cap_ini); +} + +void wlan_hdd_check_11be_support(struct hdd_beacon_data *beacon, + struct sap_config *config) +{ + const uint8_t *ie; + + ie = wlan_get_ext_ie_ptr_from_ext_id(EHT_CAP_OUI_TYPE, EHT_CAP_OUI_SIZE, + beacon->tail, beacon->tail_len); + if (ie) + config->SapHw_mode = eCSR_DOT11_MODE_11be; +} + +static void +hdd_update_wiphy_eht_caps_6ghz(struct hdd_context *hdd_ctx, + struct wma_tgt_cfg *cfg) +{ + struct ieee80211_supported_band *band_6g = + hdd_ctx->wiphy->bands[HDD_NL80211_BAND_6GHZ]; + uint8_t *phy_info = + hdd_ctx->iftype_data_6g->eht_cap.eht_cap_elem.phy_cap_info; + uint8_t max_fw_bw = sme_get_vht_ch_width(); + + if (!band_6g || !phy_info) { + hdd_debug("6ghz not supported in wiphy"); + return; + } + + hdd_ctx->iftype_data_6g->types_mask = + (BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP)); + hdd_ctx->iftype_data_6g->eht_cap.has_eht = true; + hdd_ctx->iftype_data_6g->he_cap.has_he = true; + band_6g->n_iftype_data = 1; + + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) + phy_info[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G; + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) + phy_info[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) + phy_info[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; + + band_6g->iftype_data = hdd_ctx->iftype_data_6g; +} + +void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx, + struct wma_tgt_cfg *cfg) +{ + tDot11fIEeht_cap eht_cap_cfg; + struct ieee80211_supported_band *band_2g = + hdd_ctx->wiphy->bands[HDD_NL80211_BAND_2GHZ]; + struct ieee80211_supported_band *band_5g = + hdd_ctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; + QDF_STATUS status; + uint8_t *phy_info_5g = + hdd_ctx->iftype_data_5g->eht_cap.eht_cap_elem.phy_cap_info; + uint8_t max_fw_bw = sme_get_vht_ch_width(); + uint32_t channel_bonding_mode_2g; + uint8_t *phy_info_2g = + hdd_ctx->iftype_data_2g->eht_cap.eht_cap_elem.phy_cap_info; + + hdd_enter(); + + status = ucfg_mlme_cfg_get_eht_caps(hdd_ctx->psoc, &eht_cap_cfg); + + if (QDF_IS_STATUS_ERROR(status)) + return; + + if (band_2g) { + hdd_ctx->iftype_data_2g->types_mask = + (BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP)); + hdd_ctx->iftype_data_2g->eht_cap.has_eht = eht_cap_cfg.present; + hdd_ctx->iftype_data_2g->he_cap.has_he = true; + band_2g->n_iftype_data = 1; + band_2g->iftype_data = hdd_ctx->iftype_data_2g; + + ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc, + &channel_bonding_mode_2g); + if (channel_bonding_mode_2g) + phy_info_2g[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G; + qdf_mem_copy( + &hdd_ctx->iftype_data_2g->eht_cap.eht_cap_elem.mac_cap_info[0], + &cfg->eht_cap.eht_mac_cap, 6); + qdf_mem_copy( + &hdd_ctx->iftype_data_2g->eht_cap.eht_cap_elem.phy_cap_info[0], + &cfg->eht_cap.phy_cap_bytes, 11); + } + if (band_5g) { + hdd_ctx->iftype_data_5g->types_mask = + (BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP)); + hdd_ctx->iftype_data_5g->eht_cap.has_eht = eht_cap_cfg.present; + hdd_ctx->iftype_data_5g->he_cap.has_he = true; + band_5g->n_iftype_data = 1; + band_5g->iftype_data = hdd_ctx->iftype_data_5g; + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) + phy_info_5g[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G; + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) + phy_info_5g[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; + if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) + phy_info_5g[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; + } + + hdd_update_wiphy_eht_caps_6ghz(hdd_ctx, cfg); + + hdd_exit(); } void wlan_hdd_check_11be_support(struct hdd_beacon_data *beacon, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 256666c1c1..8154caf5fd 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -202,6 +202,7 @@ #include "wlan_hdd_bootup_marker.h" #include "wlan_hdd_bus_bandwidth.h" #include "wlan_hdd_medium_assess.h" +#include "wlan_hdd_eht.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -2556,6 +2557,8 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg) hdd_update_wiphy_he_cap(hdd_ctx); } hdd_update_tgt_twt_cap(hdd_ctx, cfg); + hdd_update_tgt_eht_cap(hdd_ctx, cfg); + hdd_update_wiphy_eht_cap(hdd_ctx, cfg); for (band = NSS_CHAINS_BAND_2GHZ; band < NSS_CHAINS_BAND_MAX; band++) { sme_modify_nss_chains_tgt_cfg(hdd_ctx->mac_handle,