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

Commit 7bfb4667 authored by sheenam monga's avatar sheenam monga Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Check band caps before initializing wiphy band

Currently driver initializes the wiphy 6ghz band without
checking the band capability. If FW does not support 6Ghz
then wiphy register is failed as wiphy 6ghz band is initialized
by driver.

To fix this, initialize the wiphy 6ghz band only when host
driver and FW both supports 6Ghz band.

CRs-Fixed: 2968968
Change-Id: I28d660f515d16d0eb4245311b42c69308576ac62
parent 77aa021e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -421,6 +421,21 @@ static void hdd_init_6ghz(struct hdd_context *hdd_ctx)
	struct wiphy *wiphy = hdd_ctx->wiphy;
	struct ieee80211_channel *chlist = hdd_channels_6_ghz;
	uint32_t num = ARRAY_SIZE(hdd_channels_6_ghz);
	QDF_STATUS status;
	uint32_t band_capability;
	hdd_enter();
	status = ucfg_mlme_get_band_capability(hdd_ctx->psoc, &band_capability);
	if (QDF_IS_STATUS_ERROR(status)) {
		hdd_err("Failed to get MLME Band Capability");
		return;
	}
	if (!(band_capability & (BIT(REG_BAND_6G)))) {
		hdd_debug("6ghz band not enabled");
		return;
	}
	qdf_mem_zero(chlist, sizeof(*chlist) * num);
	for (i = 0; i < num; i++)
@@ -429,6 +444,8 @@ static void hdd_init_6ghz(struct hdd_context *hdd_ctx)
	wiphy->bands[HDD_NL80211_BAND_6GHZ] = &wlan_hdd_band_6_ghz;
	wiphy->bands[HDD_NL80211_BAND_6GHZ]->channels = chlist;
	wiphy->bands[HDD_NL80211_BAND_6GHZ]->n_channels = num;
	hdd_exit();
}
#else
static void hdd_init_6ghz(struct hdd_context *hdd_ctx)