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

Commit 4415d58c authored by Timothy Redaelli's avatar Timothy Redaelli Committed by Kalle Valo
Browse files

ath9k: fix DFS detector synchronization



some userspace programs (e.g. hostapd) need to set the regulatory domain
before selecting the operating channel. Synchronize DFS detector regardless of
the value of ah->curchan, to avoid situations where wireless scan can't be done
on some 5GHz sub-bands, because dfs_region is constantly UNSET.

Acked-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarTimothy Redaelli <tredaelli@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 44f98a93
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -257,6 +257,11 @@ static void ath9k_reg_notifier(struct wiphy *wiphy,


	ath_reg_notifier_apply(wiphy, request, reg);
	ath_reg_notifier_apply(wiphy, request, reg);


	/* synchronize DFS detector if regulatory domain changed */
	if (sc->dfs_detector != NULL)
		sc->dfs_detector->set_dfs_domain(sc->dfs_detector,
						 request->dfs_region);

	/* Set tx power */
	/* Set tx power */
	if (!ah->curchan)
	if (!ah->curchan)
		return;
		return;
@@ -267,10 +272,6 @@ static void ath9k_reg_notifier(struct wiphy *wiphy,
	ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower,
	ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower,
			       sc->cur_chan->txpower,
			       sc->cur_chan->txpower,
			       &sc->cur_chan->cur_txpower);
			       &sc->cur_chan->cur_txpower);
	/* synchronize DFS detector if regulatory domain changed */
	if (sc->dfs_detector != NULL)
		sc->dfs_detector->set_dfs_domain(sc->dfs_detector,
						 request->dfs_region);
	ath9k_ps_restore(sc);
	ath9k_ps_restore(sc);
}
}