ath: move regulatory info into shared common structure
This moves the shared regulatory structure into the common structure. We will use this ongoing for common data. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
4c48381786
commit
608b88cb34
@@ -2641,6 +2641,7 @@ static int ar9170_read_eeprom(struct ar9170 *ar)
|
||||
{
|
||||
#define RW 8 /* number of words to read at once */
|
||||
#define RB (sizeof(u32) * RW)
|
||||
struct ath_regulatory *regulatory = &ar->common.regulatory;
|
||||
u8 *eeprom = (void *)&ar->eeprom;
|
||||
u8 *addr = ar->eeprom.mac_address;
|
||||
__le32 offsets[RW];
|
||||
@@ -2707,8 +2708,8 @@ static int ar9170_read_eeprom(struct ar9170 *ar)
|
||||
else
|
||||
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]);
|
||||
regulatory->current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]);
|
||||
regulatory->current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]);
|
||||
|
||||
/* second part of wiphy init */
|
||||
SET_IEEE80211_PERM_ADDR(ar->hw, addr);
|
||||
@@ -2722,11 +2723,12 @@ static int ar9170_reg_notifier(struct wiphy *wiphy,
|
||||
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
|
||||
struct ar9170 *ar = hw->priv;
|
||||
|
||||
return ath_reg_notifier_apply(wiphy, request, &ar->regulatory);
|
||||
return ath_reg_notifier_apply(wiphy, request, &ar->common.regulatory);
|
||||
}
|
||||
|
||||
int ar9170_register(struct ar9170 *ar, struct device *pdev)
|
||||
{
|
||||
struct ath_regulatory *regulatory = &ar->common.regulatory;
|
||||
int err;
|
||||
|
||||
/* try to read EEPROM, init MAC addr */
|
||||
@@ -2734,7 +2736,7 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
|
||||
if (err)
|
||||
goto err_out;
|
||||
|
||||
err = ath_regd_init(&ar->regulatory, ar->hw->wiphy,
|
||||
err = ath_regd_init(regulatory, ar->hw->wiphy,
|
||||
ar9170_reg_notifier);
|
||||
if (err)
|
||||
goto err_out;
|
||||
@@ -2743,8 +2745,8 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
|
||||
if (err)
|
||||
goto err_out;
|
||||
|
||||
if (!ath_is_world_regd(&ar->regulatory))
|
||||
regulatory_hint(ar->hw->wiphy, ar->regulatory.alpha2);
|
||||
if (!ath_is_world_regd(regulatory))
|
||||
regulatory_hint(ar->hw->wiphy, regulatory->alpha2);
|
||||
|
||||
err = ar9170_init_leds(ar);
|
||||
if (err)
|
||||
|
Reference in New Issue
Block a user