diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-03-30 22:30:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:37 -0400 |
commit | 1878f77e13b9d720b78c4f818b94bfd4a7f596e5 (patch) | |
tree | 94d1a41d588676865ddd78cdfb6e32e91c82e688 /drivers/net/wireless/ar9170/main.c | |
parent | f769c36bd71ebe8d7a5f83764f0428d36ebced35 (diff) |
Make ar9170 use common ath reg code
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ar9170/main.c')
-rw-r--r-- | drivers/net/wireless/ar9170/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/ar9170/main.c b/drivers/net/wireless/ar9170/main.c index 5f55754d968f..8de0ff9f580b 100644 --- a/drivers/net/wireless/ar9170/main.c +++ b/drivers/net/wireless/ar9170/main.c | |||
@@ -1620,12 +1620,24 @@ static int ar9170_read_eeprom(struct ar9170 *ar) | |||
1620 | else | 1620 | else |
1621 | ar->hw->channel_change_time = 80 * 1000; | 1621 | ar->hw->channel_change_time = 80 * 1000; |
1622 | 1622 | ||
1623 | ar->regulatory.current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]); | ||
1624 | ar->regulatory.current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]); | ||
1625 | |||
1623 | /* second part of wiphy init */ | 1626 | /* second part of wiphy init */ |
1624 | SET_IEEE80211_PERM_ADDR(ar->hw, addr); | 1627 | SET_IEEE80211_PERM_ADDR(ar->hw, addr); |
1625 | 1628 | ||
1626 | return bands ? 0 : -EINVAL; | 1629 | return bands ? 0 : -EINVAL; |
1627 | } | 1630 | } |
1628 | 1631 | ||
1632 | static int ar9170_reg_notifier(struct wiphy *wiphy, | ||
1633 | struct regulatory_request *request) | ||
1634 | { | ||
1635 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
1636 | struct ar9170 *ar = hw->priv; | ||
1637 | |||
1638 | return ath_reg_notifier_apply(wiphy, request, &ar->regulatory); | ||
1639 | } | ||
1640 | |||
1629 | int ar9170_register(struct ar9170 *ar, struct device *pdev) | 1641 | int ar9170_register(struct ar9170 *ar, struct device *pdev) |
1630 | { | 1642 | { |
1631 | int err; | 1643 | int err; |
@@ -1635,10 +1647,16 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev) | |||
1635 | if (err) | 1647 | if (err) |
1636 | goto err_out; | 1648 | goto err_out; |
1637 | 1649 | ||
1650 | err = ath_regd_init(&ar->regulatory, ar->hw->wiphy, | ||
1651 | ar9170_reg_notifier); | ||
1652 | |||
1638 | err = ieee80211_register_hw(ar->hw); | 1653 | err = ieee80211_register_hw(ar->hw); |
1639 | if (err) | 1654 | if (err) |
1640 | goto err_out; | 1655 | goto err_out; |
1641 | 1656 | ||
1657 | if (!ath_is_world_regd(&ar->regulatory)) | ||
1658 | regulatory_hint(ar->hw->wiphy, ar->regulatory.alpha2); | ||
1659 | |||
1642 | err = ar9170_init_leds(ar); | 1660 | err = ar9170_init_leds(ar); |
1643 | if (err) | 1661 | if (err) |
1644 | goto err_unreg; | 1662 | goto err_unreg; |