qcacld-3.0: Update phymode before starting SAP and STA

Check phymode to verify it is allowed for the current country
before starting SAP or connecting STA.

Change-Id: Ica5e70bbd421c4dc18a34545f63e436bc482fc46
CRs-fixed: 2658294
This commit is contained in:
Lincoln Tran 2020-03-19 16:04:10 -07:00 committed by nshrivas
parent ffd5db1bb9
commit 745f9e7d1f
3 changed files with 15 additions and 0 deletions

View File

@ -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))) {

View File

@ -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)

View File

@ -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 */