diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index fbbcab295e0e..273365b34fac 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -17667,6 +17667,7 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, uint8_t value = 0; struct wlan_objmgr_vdev *vdev; uint32_t channel_bonding_mode; + enum reg_phymode phy_mode; hdd_ctx = WLAN_HDD_GET_CTX(adapter); hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); @@ -17889,6 +17890,11 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, } } + phy_mode = wlan_reg_get_max_phymode(hdd_ctx->pdev, + REG_PHYMODE_MAX, + oper_freq); + roam_profile->phyMode = csr_convert_from_reg_phy_mode(phy_mode); + if ((policy_mgr_is_hw_dbs_capable(hdd_ctx->psoc) == true) && (false == wlan_hdd_handle_sap_sta_dfs_conc(adapter, roam_profile))) { diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 17e0da62e401..b4113474ded4 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5061,6 +5061,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, bool bval = false; bool enable_dfs_scan = true; struct s_ext_cap *p_ext_cap; + enum reg_phymode reg_phy_mode, updated_phy_mode; hdd_enter(); @@ -5556,6 +5557,13 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, config->SapHw_mode = eCSR_DOT11_MODE_11n; } + config->sap_orig_hw_mode = config->SapHw_mode; + reg_phy_mode = csr_convert_to_reg_phy_mode(config->SapHw_mode, + config->chan_freq); + updated_phy_mode = wlan_reg_get_max_phymode(hdd_ctx->pdev, reg_phy_mode, + config->chan_freq); + config->SapHw_mode = csr_convert_from_reg_phy_mode(updated_phy_mode); + qdf_mem_zero(sme_config, sizeof(*sme_config)); sme_get_config_param(mac_handle, sme_config); /* Override hostapd.conf wmm_enabled only for 11n and 11AC configs (IOT) diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 676ac49a4378..403835abd046 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -474,6 +474,7 @@ enum sap_acs_dfs_mode { struct sap_config { tSap_SSIDInfo_t SSIDinfo; + eCsrPhyMode sap_orig_hw_mode; /* Previous wireless Mode */ eCsrPhyMode SapHw_mode; /* Wireless Mode */ eSapMacAddrACL SapMacaddr_acl; struct qdf_mac_addr accept_mac[MAX_ACL_MAC_ADDRESS]; /* MAC filtering */