aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c20
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:
709* Driver Initialization * 709* Driver Initialization *
710\***********************/ 710\***********************/
711 711
712static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
713{
714 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
715 struct ath5k_softc *sc = hw->priv;
716 struct ath_regulatory *reg = &sc->ah->ah_regulatory;
717
718 return ath_reg_notifier_apply(wiphy, request, reg);
719}
720
712static int 721static int
713ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) 722ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
714{ 723{
@@ -797,12 +806,23 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
797 memset(sc->bssidmask, 0xff, ETH_ALEN); 806 memset(sc->bssidmask, 0xff, ETH_ALEN);
798 ath5k_hw_set_bssid_mask(sc->ah, sc->bssidmask); 807 ath5k_hw_set_bssid_mask(sc->ah, sc->bssidmask);
799 808
809 ah->ah_regulatory.current_rd =
810 ah->ah_capabilities.cap_eeprom.ee_regdomain;
811 ret = ath_regd_init(&ah->ah_regulatory, hw->wiphy, ath5k_reg_notifier);
812 if (ret) {
813 ATH5K_ERR(sc, "can't initialize regulatory system\n");
814 goto err_queues;
815 }
816
800 ret = ieee80211_register_hw(hw); 817 ret = ieee80211_register_hw(hw);
801 if (ret) { 818 if (ret) {
802 ATH5K_ERR(sc, "can't register ieee80211 hw\n"); 819 ATH5K_ERR(sc, "can't register ieee80211 hw\n");
803 goto err_queues; 820 goto err_queues;
804 } 821 }
805 822
823 if (!ath_is_world_regd(&sc->ah->ah_regulatory))
824 regulatory_hint(hw->wiphy, sc->ah->ah_regulatory.alpha2);
825
806 ath5k_init_leds(sc); 826 ath5k_init_leds(sc);
807 827
808 return 0; 828 return 0;