Ver Fonte

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
Sachin Ahuja há 3 anos atrás
pai
commit
b2a3da872d
1 ficheiros alterados com 17 adições e 0 exclusões
  1. 17 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 17 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -425,6 +425,21 @@ static void hdd_init_6ghz(struct hdd_context *hdd_ctx)
 	struct ieee80211_channel *chlist = hdd_channels_6_ghz;
 	uint32_t num = ARRAY_SIZE(hdd_channels_6_ghz);
 	uint16_t base_freq;
+	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);
 	base_freq = wlan_reg_min_6ghz_chan_freq();
@@ -438,6 +453,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)