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 | |
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')
-rw-r--r-- | drivers/net/wireless/ar9170/Kconfig | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ar9170/ar9170.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ar9170/main.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/Kconfig | 2 |
4 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/wireless/ar9170/Kconfig b/drivers/net/wireless/ar9170/Kconfig index de4281fda129..b99e3263ee6d 100644 --- a/drivers/net/wireless/ar9170/Kconfig +++ b/drivers/net/wireless/ar9170/Kconfig | |||
@@ -2,6 +2,7 @@ config AR9170_USB | |||
2 | tristate "Atheros AR9170 802.11n USB support" | 2 | tristate "Atheros AR9170 802.11n USB support" |
3 | depends on USB && MAC80211 && WLAN_80211 && EXPERIMENTAL | 3 | depends on USB && MAC80211 && WLAN_80211 && EXPERIMENTAL |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | select ATH_COMMON | ||
5 | help | 6 | help |
6 | This is a driver for the Atheros "otus" 802.11n USB devices. | 7 | This is a driver for the Atheros "otus" 802.11n USB devices. |
7 | 8 | ||
diff --git a/drivers/net/wireless/ar9170/ar9170.h b/drivers/net/wireless/ar9170/ar9170.h index f4fb2e94aea0..87c19859ba70 100644 --- a/drivers/net/wireless/ar9170/ar9170.h +++ b/drivers/net/wireless/ar9170/ar9170.h | |||
@@ -48,6 +48,8 @@ | |||
48 | #include "eeprom.h" | 48 | #include "eeprom.h" |
49 | #include "hw.h" | 49 | #include "hw.h" |
50 | 50 | ||
51 | #include "../ath/regd.h" | ||
52 | |||
51 | #define PAYLOAD_MAX (AR9170_MAX_CMD_LEN/4 - 1) | 53 | #define PAYLOAD_MAX (AR9170_MAX_CMD_LEN/4 - 1) |
52 | 54 | ||
53 | enum ar9170_bw { | 55 | enum ar9170_bw { |
@@ -151,6 +153,7 @@ struct ar9170 { | |||
151 | 153 | ||
152 | /* EEPROM */ | 154 | /* EEPROM */ |
153 | struct ar9170_eeprom eeprom; | 155 | struct ar9170_eeprom eeprom; |
156 | struct ath_regulatory regulatory; | ||
154 | 157 | ||
155 | /* global tx status for unregistered Stations. */ | 158 | /* global tx status for unregistered Stations. */ |
156 | struct sk_buff_head global_tx_status; | 159 | struct sk_buff_head global_tx_status; |
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; |
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig index c2873a24baae..76517a45a212 100644 --- a/drivers/net/wireless/ath/Kconfig +++ b/drivers/net/wireless/ath/Kconfig | |||
@@ -1,4 +1,4 @@ | |||
1 | config ATH_COMMON | 1 | config ATH_COMMON |
2 | tristate "Atheros Wireless Cards Shared Support" | 2 | tristate "Atheros Wireless Cards Shared Support" |
3 | depends on ATH5K || ATH9K | 3 | depends on ATH5K || ATH9K || AR9170_USB |
4 | 4 | ||