提交 1878f77e 编写于 作者: C Christian Lamparter 提交者: John W. Linville

Make ar9170 use common ath reg code

Signed-off-by: NChristian Lamparter <chunkeey@web.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 f769c36b
...@@ -2,6 +2,7 @@ config AR9170_USB ...@@ -2,6 +2,7 @@ config AR9170_USB
tristate "Atheros AR9170 802.11n USB support" tristate "Atheros AR9170 802.11n USB support"
depends on USB && MAC80211 && WLAN_80211 && EXPERIMENTAL depends on USB && MAC80211 && WLAN_80211 && EXPERIMENTAL
select FW_LOADER select FW_LOADER
select ATH_COMMON
help help
This is a driver for the Atheros "otus" 802.11n USB devices. This is a driver for the Atheros "otus" 802.11n USB devices.
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include "eeprom.h" #include "eeprom.h"
#include "hw.h" #include "hw.h"
#include "../ath/regd.h"
#define PAYLOAD_MAX (AR9170_MAX_CMD_LEN/4 - 1) #define PAYLOAD_MAX (AR9170_MAX_CMD_LEN/4 - 1)
enum ar9170_bw { enum ar9170_bw {
...@@ -151,6 +153,7 @@ struct ar9170 { ...@@ -151,6 +153,7 @@ struct ar9170 {
/* EEPROM */ /* EEPROM */
struct ar9170_eeprom eeprom; struct ar9170_eeprom eeprom;
struct ath_regulatory regulatory;
/* global tx status for unregistered Stations. */ /* global tx status for unregistered Stations. */
struct sk_buff_head global_tx_status; struct sk_buff_head global_tx_status;
......
...@@ -1620,12 +1620,24 @@ static int ar9170_read_eeprom(struct ar9170 *ar) ...@@ -1620,12 +1620,24 @@ static int ar9170_read_eeprom(struct ar9170 *ar)
else else
ar->hw->channel_change_time = 80 * 1000; ar->hw->channel_change_time = 80 * 1000;
ar->regulatory.current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]);
ar->regulatory.current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]);
/* second part of wiphy init */ /* second part of wiphy init */
SET_IEEE80211_PERM_ADDR(ar->hw, addr); SET_IEEE80211_PERM_ADDR(ar->hw, addr);
return bands ? 0 : -EINVAL; return bands ? 0 : -EINVAL;
} }
static int ar9170_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct ar9170 *ar = hw->priv;
return ath_reg_notifier_apply(wiphy, request, &ar->regulatory);
}
int ar9170_register(struct ar9170 *ar, struct device *pdev) int ar9170_register(struct ar9170 *ar, struct device *pdev)
{ {
int err; int err;
...@@ -1635,10 +1647,16 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev) ...@@ -1635,10 +1647,16 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
if (err) if (err)
goto err_out; goto err_out;
err = ath_regd_init(&ar->regulatory, ar->hw->wiphy,
ar9170_reg_notifier);
err = ieee80211_register_hw(ar->hw); err = ieee80211_register_hw(ar->hw);
if (err) if (err)
goto err_out; goto err_out;
if (!ath_is_world_regd(&ar->regulatory))
regulatory_hint(ar->hw->wiphy, ar->regulatory.alpha2);
err = ar9170_init_leds(ar); err = ar9170_init_leds(ar);
if (err) if (err)
goto err_unreg; goto err_unreg;
......
config ATH_COMMON config ATH_COMMON
tristate "Atheros Wireless Cards Shared Support" tristate "Atheros Wireless Cards Shared Support"
depends on ATH5K || ATH9K depends on ATH5K || ATH9K || AR9170_USB
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册