diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-03-09 22:07:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-16 18:09:40 -0400 |
commit | 7db90f4a25bd4184f3d36dfa4f512f53b0448da7 (patch) | |
tree | 839b8103801cac9342763e1b62e84730a8050ccc /drivers/net/wireless | |
parent | 0fee54cab7d5ebc58fad8c6a0703c4ea016405e3 (diff) |
cfg80211: move enum reg_set_by to nl80211.h
We do this so we can later inform userspace who set the
regulatory domain and provide details of the request.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/regd.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/regd.h | 3 |
3 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 1d6b05c0d800..e9b3f365f099 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -1670,7 +1670,7 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1670 | } | 1670 | } |
1671 | wiphy_apply_custom_regulatory(hw->wiphy, regd); | 1671 | wiphy_apply_custom_regulatory(hw->wiphy, regd); |
1672 | ath9k_reg_apply_radar_flags(hw->wiphy); | 1672 | ath9k_reg_apply_radar_flags(hw->wiphy); |
1673 | ath9k_reg_apply_world_flags(hw->wiphy, REGDOM_SET_BY_DRIVER); | 1673 | ath9k_reg_apply_world_flags(hw->wiphy, NL80211_REGDOM_SET_BY_DRIVER); |
1674 | 1674 | ||
1675 | INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work); | 1675 | INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work); |
1676 | INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work); | 1676 | INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work); |
diff --git a/drivers/net/wireless/ath9k/regd.c b/drivers/net/wireless/ath9k/regd.c index ff0afc02f3ce..b8f9b6d6bec4 100644 --- a/drivers/net/wireless/ath9k/regd.c +++ b/drivers/net/wireless/ath9k/regd.c | |||
@@ -168,8 +168,9 @@ static bool ath9k_is_radar_freq(u16 center_freq) | |||
168 | * received a beacon on a channel we can enable active scan and | 168 | * received a beacon on a channel we can enable active scan and |
169 | * adhoc (or beaconing). | 169 | * adhoc (or beaconing). |
170 | */ | 170 | */ |
171 | static void ath9k_reg_apply_beaconing_flags(struct wiphy *wiphy, | 171 | static void ath9k_reg_apply_beaconing_flags( |
172 | enum reg_set_by setby) | 172 | struct wiphy *wiphy, |
173 | enum nl80211_reg_initiator initiator) | ||
173 | { | 174 | { |
174 | enum ieee80211_band band; | 175 | enum ieee80211_band band; |
175 | struct ieee80211_supported_band *sband; | 176 | struct ieee80211_supported_band *sband; |
@@ -194,7 +195,7 @@ static void ath9k_reg_apply_beaconing_flags(struct wiphy *wiphy, | |||
194 | (ch->flags & IEEE80211_CHAN_RADAR)) | 195 | (ch->flags & IEEE80211_CHAN_RADAR)) |
195 | continue; | 196 | continue; |
196 | 197 | ||
197 | if (setby == REGDOM_SET_BY_COUNTRY_IE) { | 198 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { |
198 | r = freq_reg_info(wiphy, ch->center_freq, | 199 | r = freq_reg_info(wiphy, ch->center_freq, |
199 | &bandwidth, ®_rule); | 200 | &bandwidth, ®_rule); |
200 | if (r) | 201 | if (r) |
@@ -226,8 +227,9 @@ static void ath9k_reg_apply_beaconing_flags(struct wiphy *wiphy, | |||
226 | } | 227 | } |
227 | 228 | ||
228 | /* Allows active scan scan on Ch 12 and 13 */ | 229 | /* Allows active scan scan on Ch 12 and 13 */ |
229 | static void ath9k_reg_apply_active_scan_flags(struct wiphy *wiphy, | 230 | static void ath9k_reg_apply_active_scan_flags( |
230 | enum reg_set_by setby) | 231 | struct wiphy *wiphy, |
232 | enum nl80211_reg_initiator initiator) | ||
231 | { | 233 | { |
232 | struct ieee80211_supported_band *sband; | 234 | struct ieee80211_supported_band *sband; |
233 | struct ieee80211_channel *ch; | 235 | struct ieee80211_channel *ch; |
@@ -241,7 +243,7 @@ static void ath9k_reg_apply_active_scan_flags(struct wiphy *wiphy, | |||
241 | * If no country IE has been received always enable active scan | 243 | * If no country IE has been received always enable active scan |
242 | * on these channels. This is only done for specific regulatory SKUs | 244 | * on these channels. This is only done for specific regulatory SKUs |
243 | */ | 245 | */ |
244 | if (setby != REGDOM_SET_BY_COUNTRY_IE) { | 246 | if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { |
245 | ch = &sband->channels[11]; /* CH 12 */ | 247 | ch = &sband->channels[11]; /* CH 12 */ |
246 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) | 248 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
247 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; | 249 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
@@ -308,7 +310,8 @@ void ath9k_reg_apply_radar_flags(struct wiphy *wiphy) | |||
308 | } | 310 | } |
309 | } | 311 | } |
310 | 312 | ||
311 | void ath9k_reg_apply_world_flags(struct wiphy *wiphy, enum reg_set_by setby) | 313 | void ath9k_reg_apply_world_flags(struct wiphy *wiphy, |
314 | enum nl80211_reg_initiator initiator) | ||
312 | { | 315 | { |
313 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | 316 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
314 | struct ath_wiphy *aphy = hw->priv; | 317 | struct ath_wiphy *aphy = hw->priv; |
@@ -320,11 +323,11 @@ void ath9k_reg_apply_world_flags(struct wiphy *wiphy, enum reg_set_by setby) | |||
320 | case 0x63: | 323 | case 0x63: |
321 | case 0x66: | 324 | case 0x66: |
322 | case 0x67: | 325 | case 0x67: |
323 | ath9k_reg_apply_beaconing_flags(wiphy, setby); | 326 | ath9k_reg_apply_beaconing_flags(wiphy, initiator); |
324 | break; | 327 | break; |
325 | case 0x68: | 328 | case 0x68: |
326 | ath9k_reg_apply_beaconing_flags(wiphy, setby); | 329 | ath9k_reg_apply_beaconing_flags(wiphy, initiator); |
327 | ath9k_reg_apply_active_scan_flags(wiphy, setby); | 330 | ath9k_reg_apply_active_scan_flags(wiphy, initiator); |
328 | break; | 331 | break; |
329 | } | 332 | } |
330 | return; | 333 | return; |
@@ -340,11 +343,11 @@ int ath9k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) | |||
340 | ath9k_reg_apply_radar_flags(wiphy); | 343 | ath9k_reg_apply_radar_flags(wiphy); |
341 | 344 | ||
342 | switch (request->initiator) { | 345 | switch (request->initiator) { |
343 | case REGDOM_SET_BY_DRIVER: | 346 | case NL80211_REGDOM_SET_BY_DRIVER: |
344 | case REGDOM_SET_BY_CORE: | 347 | case NL80211_REGDOM_SET_BY_CORE: |
345 | case REGDOM_SET_BY_USER: | 348 | case NL80211_REGDOM_SET_BY_USER: |
346 | break; | 349 | break; |
347 | case REGDOM_SET_BY_COUNTRY_IE: | 350 | case NL80211_REGDOM_SET_BY_COUNTRY_IE: |
348 | if (ath9k_is_world_regd(sc->sc_ah)) | 351 | if (ath9k_is_world_regd(sc->sc_ah)) |
349 | ath9k_reg_apply_world_flags(wiphy, request->initiator); | 352 | ath9k_reg_apply_world_flags(wiphy, request->initiator); |
350 | break; | 353 | break; |
diff --git a/drivers/net/wireless/ath9k/regd.h b/drivers/net/wireless/ath9k/regd.h index d48160d0c0e9..8f885f3bc8df 100644 --- a/drivers/net/wireless/ath9k/regd.h +++ b/drivers/net/wireless/ath9k/regd.h | |||
@@ -236,7 +236,8 @@ enum CountryCode { | |||
236 | bool ath9k_is_world_regd(struct ath_hw *ah); | 236 | bool ath9k_is_world_regd(struct ath_hw *ah); |
237 | const struct ieee80211_regdomain *ath9k_world_regdomain(struct ath_hw *ah); | 237 | const struct ieee80211_regdomain *ath9k_world_regdomain(struct ath_hw *ah); |
238 | const struct ieee80211_regdomain *ath9k_default_world_regdomain(void); | 238 | const struct ieee80211_regdomain *ath9k_default_world_regdomain(void); |
239 | void ath9k_reg_apply_world_flags(struct wiphy *wiphy, enum reg_set_by setby); | 239 | void ath9k_reg_apply_world_flags(struct wiphy *wiphy, |
240 | enum nl80211_reg_initiator initiator); | ||
240 | void ath9k_reg_apply_radar_flags(struct wiphy *wiphy); | 241 | void ath9k_reg_apply_radar_flags(struct wiphy *wiphy); |
241 | int ath9k_regd_init(struct ath_hw *ah); | 242 | int ath9k_regd_init(struct ath_hw *ah); |
242 | bool ath9k_regd_is_eeprom_valid(struct ath_hw *ah); | 243 | bool ath9k_regd_is_eeprom_valid(struct ath_hw *ah); |