aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-01-22 18:05:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:17 -0500
commit716f9392e2b84cacc18cc11f7427cb98adeb1c3d (patch)
treef56a37fc79aa331b8f5b57a5038f1b4c93d8a578
parentd46e5b1d0c617a2a46353812d7f02115c17b5e72 (diff)
cfg80211: pass more detailed regulatory request information on reg_notifier()
Drivers may need more information than just who set the last regulatory domain, as such lets just pass the last regulatory_request receipt. To do this we need to move out to headers struct regulatory_request, and enum environment_cap. While at it lets add documentation for enum environment_cap. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/cfg80211.h45
-rw-r--r--include/net/wireless.h3
-rw-r--r--net/wireless/reg.c34
-rw-r--r--net/wireless/reg.h7
4 files changed, 48 insertions, 41 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f19c3e16366..dd1fd51638f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -357,6 +357,51 @@ enum reg_set_by {
357 REGDOM_SET_BY_COUNTRY_IE, 357 REGDOM_SET_BY_COUNTRY_IE,
358}; 358};
359 359
360/**
361 * enum environment_cap - Environment parsed from country IE
362 * @ENVIRON_ANY: indicates country IE applies to both indoor and
363 * outdoor operation.
364 * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
365 * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
366 */
367enum environment_cap {
368 ENVIRON_ANY,
369 ENVIRON_INDOOR,
370 ENVIRON_OUTDOOR,
371};
372
373/**
374 * struct regulatory_request - receipt of last regulatory request
375 *
376 * @wiphy: this is set if this request's initiator is
377 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
378 * can be used by the wireless core to deal with conflicts
379 * and potentially inform users of which devices specifically
380 * cased the conflicts.
381 * @initiator: indicates who sent this request, could be any of
382 * of those set in reg_set_by, %REGDOM_SET_BY_*
383 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
384 * regulatory domain. We have a few special codes:
385 * 00 - World regulatory domain
386 * 99 - built by driver but a specific alpha2 cannot be determined
387 * 98 - result of an intersection between two regulatory domains
388 * @intersect: indicates whether the wireless core should intersect
389 * the requested regulatory domain with the presently set regulatory
390 * domain.
391 * @country_ie_checksum: checksum of the last processed and accepted
392 * country IE
393 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
394 * indoor, or if it doesn't matter
395 */
396struct regulatory_request {
397 struct wiphy *wiphy;
398 enum reg_set_by initiator;
399 char alpha2[2];
400 bool intersect;
401 u32 country_ie_checksum;
402 enum environment_cap country_ie_env;
403};
404
360struct ieee80211_freq_range { 405struct ieee80211_freq_range {
361 u32 start_freq_khz; 406 u32 start_freq_khz;
362 u32 end_freq_khz; 407 u32 end_freq_khz;
diff --git a/include/net/wireless.h b/include/net/wireless.h
index c3f6e462ec2..9c19764a484 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -213,7 +213,8 @@ struct wiphy {
213 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 213 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
214 214
215 /* Lets us get back the wiphy on the callback */ 215 /* Lets us get back the wiphy on the callback */
216 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); 216 int (*reg_notifier)(struct wiphy *wiphy,
217 struct regulatory_request *request);
217 218
218 /* fields below are read-only, assigned by cfg80211 */ 219 /* fields below are read-only, assigned by cfg80211 */
219 220
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 81acb07f1d4..cad4daadba0 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -42,38 +42,6 @@
42#include "core.h" 42#include "core.h"
43#include "reg.h" 43#include "reg.h"
44 44
45/**
46 * struct regulatory_request - receipt of last regulatory request
47 *
48 * @wiphy: this is set if this request's initiator is
49 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
50 * can be used by the wireless core to deal with conflicts
51 * and potentially inform users of which devices specifically
52 * cased the conflicts.
53 * @initiator: indicates who sent this request, could be any of
54 * of those set in reg_set_by, %REGDOM_SET_BY_*
55 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
56 * regulatory domain. We have a few special codes:
57 * 00 - World regulatory domain
58 * 99 - built by driver but a specific alpha2 cannot be determined
59 * 98 - result of an intersection between two regulatory domains
60 * @intersect: indicates whether the wireless core should intersect
61 * the requested regulatory domain with the presently set regulatory
62 * domain.
63 * @country_ie_checksum: checksum of the last processed and accepted
64 * country IE
65 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
66 * indoor, or if it doesn't matter
67 */
68struct regulatory_request {
69 struct wiphy *wiphy;
70 enum reg_set_by initiator;
71 char alpha2[2];
72 bool intersect;
73 u32 country_ie_checksum;
74 enum environment_cap country_ie_env;
75};
76
77/* Receipt of information from last regulatory request */ 45/* Receipt of information from last regulatory request */
78static struct regulatory_request *last_request; 46static struct regulatory_request *last_request;
79 47
@@ -951,7 +919,7 @@ void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby)
951 handle_band(wiphy, band); 919 handle_band(wiphy, band);
952 } 920 }
953 if (wiphy->reg_notifier) 921 if (wiphy->reg_notifier)
954 wiphy->reg_notifier(wiphy, setby); 922 wiphy->reg_notifier(wiphy, last_request);
955} 923}
956 924
957static void handle_channel_custom(struct wiphy *wiphy, 925static void handle_channel_custom(struct wiphy *wiphy,
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index a76ea3ff7cd..eb1dd5bc9b2 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -11,13 +11,6 @@ void regulatory_exit(void);
11 11
12int set_regdom(const struct ieee80211_regdomain *rd); 12int set_regdom(const struct ieee80211_regdomain *rd);
13 13
14enum environment_cap {
15 ENVIRON_ANY,
16 ENVIRON_INDOOR,
17 ENVIRON_OUTDOOR,
18};
19
20
21/** 14/**
22 * __regulatory_hint - hint to the wireless core a regulatory domain 15 * __regulatory_hint - hint to the wireless core a regulatory domain
23 * @wiphy: if the hint comes from country information from an AP, this 16 * @wiphy: if the hint comes from country information from an AP, this