Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc82e145 authored by Liangwei Dong's avatar Liangwei Dong Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Check channel bond mode for 2.4G ACS

If 2.4G 40MHz is disabled by channel bond mode ini -
gChannelBondingMode24GHz, override 2.4G ACS result
to 20Mhz channel width. Otherwise hostapd will
start ap failed on 40Mhz channel because the HE cap
has no 40Mhz bw supported.

Change-Id: I943621bf847491983f0654f7ae495fc970114575
CRs-Fixed: 2951620
parent fb014c56
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -3010,6 +3010,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
	bool go_force_11n_for_11ac = 0;
	bool go_11ac_override = 0;
	bool sap_11ac_override = 0;
	uint32_t channel_bonding_mode_2g;
	/* ***Note*** Donot set SME config related to ACS operation here because
	 * ACS operation is not synchronouse and ACS for Second AP may come when
@@ -3032,6 +3033,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
					     &sap_force_11n_for_11ac);
	ucfg_mlme_get_go_force_11n_for_11ac(hdd_ctx->psoc,
					    &go_force_11n_for_11ac);
	ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
					    &channel_bonding_mode_2g);
	if (!((adapter->device_mode == QDF_SAP_MODE) ||
	      (adapter->device_mode == QDF_P2P_GO_MODE))) {
@@ -3257,6 +3260,17 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
		if (sap_config->acs_cfg.ch_list_count == 1) {
			sap_config->acs_cfg.pri_ch_freq =
					      sap_config->acs_cfg.freq_list[0];
			if (sap_config->acs_cfg.pri_ch_freq <=
			    WLAN_REG_CH_TO_FREQ(CHAN_ENUM_2484) &&
			    sap_config->acs_cfg.ch_width >=
						CH_WIDTH_40MHZ &&
			    !channel_bonding_mode_2g) {
				sap_config->acs_cfg.ch_width = CH_WIDTH_20MHZ;
				hdd_debug("2.4ghz channel resetting BW to %d 2.4 cbmode %d",
					  sap_config->acs_cfg.ch_width,
					  channel_bonding_mode_2g);
			}
			wlan_sap_set_sap_ctx_acs_cfg(
				WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config);
			sap_config_acs_result(hdd_ctx->mac_handle,
@@ -3324,15 +3338,13 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
	if (sap_config->acs_cfg.end_ch_freq <=
	    WLAN_REG_CH_TO_FREQ(CHAN_ENUM_2484) &&
	    sap_config->acs_cfg.ch_width >= eHT_CHANNEL_WIDTH_40MHZ) {
		uint32_t channel_bonding_mode;
		ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
						    &channel_bonding_mode);
		sap_config->acs_cfg.ch_width = channel_bonding_mode ?
		sap_config->acs_cfg.ch_width = channel_bonding_mode_2g ?
			eHT_CHANNEL_WIDTH_40MHZ : eHT_CHANNEL_WIDTH_20MHZ;
		hdd_debug("Only 2.4ghz channels, resetting BW to %d 2.4 cbmode %d",
			  sap_config->acs_cfg.ch_width, channel_bonding_mode);
			  sap_config->acs_cfg.ch_width,
			  channel_bonding_mode_2g);
	}
	hdd_nofl_debug("ACS Config country %s ch_width %d hw_mode %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d band %d",