diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-08-17 21:07:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:36:03 -0400 |
commit | 608b88cb34b0e70a538ee1fc334cc833ef691836 (patch) | |
tree | 6d2a363cea722241581306964da6cff8724b407a /drivers/net/wireless/ath/ar9170/main.c | |
parent | 4c48381786159ba3f3d8a33d967aeb049341a220 (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/ath/ar9170/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c index 6a9462e4fd87..d30f33d4d41b 100644 --- a/drivers/net/wireless/ath/ar9170/main.c +++ b/drivers/net/wireless/ath/ar9170/main.c | |||
@@ -2641,6 +2641,7 @@ static int ar9170_read_eeprom(struct ar9170 *ar) | |||
2641 | { | 2641 | { |
2642 | #define RW 8 /* number of words to read at once */ | 2642 | #define RW 8 /* number of words to read at once */ |
2643 | #define RB (sizeof(u32) * RW) | 2643 | #define RB (sizeof(u32) * RW) |
2644 | struct ath_regulatory *regulatory = &ar->common.regulatory; | ||
2644 | u8 *eeprom = (void *)&ar->eeprom; | 2645 | u8 *eeprom = (void *)&ar->eeprom; |
2645 | u8 *addr = ar->eeprom.mac_address; | 2646 | u8 *addr = ar->eeprom.mac_address; |
2646 | __le32 offsets[RW]; | 2647 | __le32 offsets[RW]; |
@@ -2707,8 +2708,8 @@ static int ar9170_read_eeprom(struct ar9170 *ar) | |||
2707 | else | 2708 | else |
2708 | ar->hw->channel_change_time = 80 * 1000; | 2709 | ar->hw->channel_change_time = 80 * 1000; |
2709 | 2710 | ||
2710 | ar->regulatory.current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]); | 2711 | regulatory->current_rd = le16_to_cpu(ar->eeprom.reg_domain[0]); |
2711 | ar->regulatory.current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]); | 2712 | regulatory->current_rd_ext = le16_to_cpu(ar->eeprom.reg_domain[1]); |
2712 | 2713 | ||
2713 | /* second part of wiphy init */ | 2714 | /* second part of wiphy init */ |
2714 | SET_IEEE80211_PERM_ADDR(ar->hw, addr); | 2715 | SET_IEEE80211_PERM_ADDR(ar->hw, addr); |
@@ -2722,11 +2723,12 @@ static int ar9170_reg_notifier(struct wiphy *wiphy, | |||
2722 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | 2723 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
2723 | struct ar9170 *ar = hw->priv; | 2724 | struct ar9170 *ar = hw->priv; |
2724 | 2725 | ||
2725 | return ath_reg_notifier_apply(wiphy, request, &ar->regulatory); | 2726 | return ath_reg_notifier_apply(wiphy, request, &ar->common.regulatory); |
2726 | } | 2727 | } |
2727 | 2728 | ||
2728 | int ar9170_register(struct ar9170 *ar, struct device *pdev) | 2729 | int ar9170_register(struct ar9170 *ar, struct device *pdev) |
2729 | { | 2730 | { |
2731 | struct ath_regulatory *regulatory = &ar->common.regulatory; | ||
2730 | int err; | 2732 | int err; |
2731 | 2733 | ||
2732 | /* try to read EEPROM, init MAC addr */ | 2734 | /* try to read EEPROM, init MAC addr */ |
@@ -2734,7 +2736,7 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev) | |||
2734 | if (err) | 2736 | if (err) |
2735 | goto err_out; | 2737 | goto err_out; |
2736 | 2738 | ||
2737 | err = ath_regd_init(&ar->regulatory, ar->hw->wiphy, | 2739 | err = ath_regd_init(regulatory, ar->hw->wiphy, |
2738 | ar9170_reg_notifier); | 2740 | ar9170_reg_notifier); |
2739 | if (err) | 2741 | if (err) |
2740 | goto err_out; | 2742 | goto err_out; |
@@ -2743,8 +2745,8 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev) | |||
2743 | if (err) | 2745 | if (err) |
2744 | goto err_out; | 2746 | goto err_out; |
2745 | 2747 | ||
2746 | if (!ath_is_world_regd(&ar->regulatory)) | 2748 | if (!ath_is_world_regd(regulatory)) |
2747 | regulatory_hint(ar->hw->wiphy, ar->regulatory.alpha2); | 2749 | regulatory_hint(ar->hw->wiphy, regulatory->alpha2); |
2748 | 2750 | ||
2749 | err = ar9170_init_leds(ar); | 2751 | err = ar9170_init_leds(ar); |
2750 | if (err) | 2752 | if (err) |