Browse Source

qcacld-3.0: Update wiphy channel info too for regdb non-offload case

Currently hdd_regulatory_init() only updates wiphy channel info
for regdb offload case, so when in regdb non-offload case, wiphy
channel info have been updated per host driver configuration in
reg_process_master_chan_list() during wlan boot up, but wiphy
channel orig_flags isn't updated to kernel side, and kernel side
still uses original reg rules to populate wiphy channel status.
It causes the result of iw list doesn't align with driver side.

Change-Id: If667dce6e23a8f3cea0432ab11875a3c5771855d
CRs-Fixed: 3280333
Qun Zhang 2 years ago
parent
commit
a94dbf3aac
1 changed files with 9 additions and 14 deletions
  1. 9 14
      core/hdd/src/wlan_hdd_regulatory.c

+ 9 - 14
core/hdd/src/wlan_hdd_regulatory.c

@@ -1923,7 +1923,6 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
 {
 	bool offload_enabled;
 	struct regulatory_channel *cur_chan_list;
-	enum country_src cc_src;
 	uint8_t alpha2[REG_ALPHA2_LEN + 1];
 	int ret;
 
@@ -1956,21 +1955,17 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
 	wiphy->reg_notifier = hdd_reg_notifier;
 	offload_enabled = ucfg_reg_is_regdb_offloaded(hdd_ctx->psoc);
 	hdd_debug("regulatory offload_enabled %d", offload_enabled);
-	if (offload_enabled) {
+	if (offload_enabled)
 		hdd_ctx->reg_offload = true;
-		ucfg_reg_get_current_chan_list(hdd_ctx->pdev,
-					       cur_chan_list);
-		hdd_regulatory_chanlist_dump(cur_chan_list);
-		fill_wiphy_band_channels(wiphy, cur_chan_list,
-					 NL80211_BAND_2GHZ);
-		fill_wiphy_band_channels(wiphy, cur_chan_list,
-					 NL80211_BAND_5GHZ);
-		fill_wiphy_6ghz_band_channels(wiphy, cur_chan_list);
-		cc_src = ucfg_reg_get_cc_and_src(hdd_ctx->psoc, alpha2);
-		qdf_mem_copy(hdd_ctx->reg.alpha2, alpha2, REG_ALPHA2_LEN + 1);
-	} else {
+	else
 		hdd_ctx->reg_offload = false;
-	}
+
+	ucfg_reg_get_current_chan_list(hdd_ctx->pdev, cur_chan_list);
+	hdd_regulatory_chanlist_dump(cur_chan_list);
+	fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_2GHZ);
+	fill_wiphy_band_channels(wiphy, cur_chan_list, NL80211_BAND_5GHZ);
+	fill_wiphy_6ghz_band_channels(wiphy, cur_chan_list);
+	qdf_mem_copy(hdd_ctx->reg.alpha2, alpha2, REG_ALPHA2_LEN + 1);
 
 	qdf_mem_free(cur_chan_list);
 	return 0;