linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ath9k: fix custom regulatory call position
@ 2009-05-19 21:49 Luis R. Rodriguez
  2009-05-19 21:49 ` [PATCH 2/3] ath9k: set max default eirp to 20 dBm Luis R. Rodriguez
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Luis R. Rodriguez @ 2009-05-19 21:49 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless, Luis R. Rodriguez

ath_regd_init() needs to be called with the wiphy already
properly set with the bands. Without this the custom regulatory
settings were not taking effect, and the device would get
the default channel settings from ath9k_[25]ghz_chantable.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c161b75..7fab2d4 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1412,8 +1412,6 @@ static int ath_init(u16 devid, struct ath_softc *sc)
 	for (i = 0; i < sc->keymax; i++)
 		ath9k_hw_keyreset(ah, (u16) i);
 
-	error = ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
-			      ath9k_reg_notifier);
 	if (error)
 		goto bad;
 
@@ -1626,14 +1624,19 @@ int ath_attach(u16 devid, struct ath_softc *sc)
 	if (error != 0)
 		return error;
 
-	reg = &sc->sc_ah->regulatory;
-
 	/* get mac address from hardware and set in mac80211 */
 
 	SET_IEEE80211_PERM_ADDR(hw, sc->sc_ah->macaddr);
 
 	ath_set_hw_capab(sc, hw);
 
+        error = ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
+			      ath9k_reg_notifier);
+	if (error)
+		return error;
+
+	reg = &sc->sc_ah->regulatory;
+
 	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
 		setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
 		if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes))
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-20  1:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 21:49 [PATCH 1/3] ath9k: fix custom regulatory call position Luis R. Rodriguez
2009-05-19 21:49 ` [PATCH 2/3] ath9k: set max default eirp to 20 dBm Luis R. Rodriguez
2009-05-19 21:49 ` [PATCH 3/3] cfg80211: warn when wiphy_apply_custom_regulatory() does nothing Luis R. Rodriguez
2009-05-19 22:05 ` [PATCH 1/3] ath9k: fix custom regulatory call position Johannes Berg
2009-05-19 22:33 ` Bob Copeland
2009-05-19 22:42   ` Luis R. Rodriguez
2009-05-20  0:51     ` Bob Copeland
2009-05-20  1:25       ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).