diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-03-31 04:30:31 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 22:54:37 +0200 |
commit | f769c36bd71ebe8d7a5f83764f0428d36ebced35 (patch) | |
tree | 8aad786a4442e997f778d6fca9944d372f40faa5 /drivers/net/wireless/ath5k/base.c | |
parent | ath: move more setup code into ath_regd_init (diff) | |
download | linux-f769c36bd71ebe8d7a5f83764f0428d36ebced35.tar.xz linux-f769c36bd71ebe8d7a5f83764f0428d36ebced35.zip |
ath5k: use regulatory infrastructure
Make ath5k select the ath module and add in the hooks to make the
eeprom regulatory hint and reg notifier take effect.
Changes to attach.c
Changes-licensed-under: ISC
Changes to base.c
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index d8c60c53d953..ff6d4f839734 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c @@ -709,6 +709,15 @@ err_no_irq: * Driver Initialization * \***********************/ +static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) +{ + struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); + struct ath5k_softc *sc = hw->priv; + struct ath_regulatory *reg = &sc->ah->ah_regulatory; + + return ath_reg_notifier_apply(wiphy, request, reg); +} + static int ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) { @@ -797,12 +806,23 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) memset(sc->bssidmask, 0xff, ETH_ALEN); ath5k_hw_set_bssid_mask(sc->ah, sc->bssidmask); + ah->ah_regulatory.current_rd = + ah->ah_capabilities.cap_eeprom.ee_regdomain; + ret = ath_regd_init(&ah->ah_regulatory, hw->wiphy, ath5k_reg_notifier); + if (ret) { + ATH5K_ERR(sc, "can't initialize regulatory system\n"); + goto err_queues; + } + ret = ieee80211_register_hw(hw); if (ret) { ATH5K_ERR(sc, "can't register ieee80211 hw\n"); goto err_queues; } + if (!ath_is_world_regd(&sc->ah->ah_regulatory)) + regulatory_hint(hw->wiphy, sc->ah->ah_regulatory.alpha2); + ath5k_init_leds(sc); return 0; |