aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-11-11 16:15:29 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:51:46 -0500
commita2f73b6c5db3c272d87eaebb5bed355d75a0f25f (patch)
tree1cf299d0c5b2287afe742430d7e15cb3c1d43b4f /include/net
parentca91dc97b8a0ffd05721806654eaff2cf13ba5cb (diff)
cfg80211: move regulatory flags to their own variable
We'll expand this later, this will make it easier to classify and review what things are related to regulatory or not. Coccinelle only missed 4 hits, which I had to do manually, supplying the SmPL in case of merge conflicts. @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +e->regulatory_flags |= REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags & REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags |= REGULATORY_STRICT_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_STRICT_REGULATORY +e->regulatory_flags |= REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags & REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ expression e; @@ -e->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +e->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS Generated-by: Coccinelle SmPL Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Peter Senna Tschudin <peter.senna@gmail.com> Cc: Mihir Shete <smihir@qti.qualcomm.com> Cc: Henri Bahini <hbahini@qca.qualcomm.com> Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [fix up whitespace damage, overly long lines] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h33
-rw-r--r--include/net/regulatory.h59
2 files changed, 52 insertions, 40 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 968f2ad40ccd..bacc5033f0b6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2437,29 +2437,6 @@ struct cfg80211_ops {
2437/** 2437/**
2438 * enum wiphy_flags - wiphy capability flags 2438 * enum wiphy_flags - wiphy capability flags
2439 * 2439 *
2440 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
2441 * has its own custom regulatory domain and cannot identify the
2442 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
2443 * we will disregard the first regulatory hint (when the
2444 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
2445 * wiphy_apply_custom_regulatory() should have this flag set
2446 * or the regulatory core will set it for wiphy.
2447 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
2448 * ignore regulatory domain settings until it gets its own regulatory
2449 * domain via its regulatory_hint() unless the regulatory hint is
2450 * from a country IE. After its gets its own regulatory domain it will
2451 * only allow further regulatory domain settings to further enhance
2452 * compliance. For example if channel 13 and 14 are disabled by this
2453 * regulatory domain no user regulatory domain can enable these channels
2454 * at a later time. This can be used for devices which do not have
2455 * calibration information guaranteed for frequencies or settings
2456 * outside of its regulatory domain. If used in combination with
2457 * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
2458 * will be followed.
2459 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
2460 * that passive scan flags and beaconing flags may not be lifted by
2461 * cfg80211 due to regulatory beacon hints. For more information on beacon
2462 * hints read the documenation for regulatory_hint_found_beacon()
2463 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 2440 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
2464 * wiphy at all 2441 * wiphy at all
2465 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 2442 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
@@ -2498,9 +2475,9 @@ struct cfg80211_ops {
2498 * beaconing mode (AP, IBSS, Mesh, ...). 2475 * beaconing mode (AP, IBSS, Mesh, ...).
2499 */ 2476 */
2500enum wiphy_flags { 2477enum wiphy_flags {
2501 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2478 /* use hole at 0 */
2502 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 2479 /* use hole at 1 */
2503 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 2480 /* use hole at 2 */
2504 WIPHY_FLAG_NETNS_OK = BIT(3), 2481 WIPHY_FLAG_NETNS_OK = BIT(3),
2505 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 2482 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
2506 WIPHY_FLAG_4ADDR_AP = BIT(5), 2483 WIPHY_FLAG_4ADDR_AP = BIT(5),
@@ -2722,6 +2699,8 @@ struct wiphy_coalesce_support {
2722 * @software_iftypes: bitmask of software interface types, these are not 2699 * @software_iftypes: bitmask of software interface types, these are not
2723 * subject to any restrictions since they are purely managed in SW. 2700 * subject to any restrictions since they are purely managed in SW.
2724 * @flags: wiphy flags, see &enum wiphy_flags 2701 * @flags: wiphy flags, see &enum wiphy_flags
2702 * @regulatory_flags: wiphy regulatory flags, see
2703 * &enum ieee80211_regulatory_flags
2725 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2704 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2726 * @bss_priv_size: each BSS struct has private data allocated with it, 2705 * @bss_priv_size: each BSS struct has private data allocated with it,
2727 * this variable determines its size 2706 * this variable determines its size
@@ -2810,7 +2789,7 @@ struct wiphy {
2810 2789
2811 u16 max_acl_mac_addrs; 2790 u16 max_acl_mac_addrs;
2812 2791
2813 u32 flags, features; 2792 u32 flags, regulatory_flags, features;
2814 2793
2815 u32 ap_sme_capa; 2794 u32 ap_sme_capa;
2816 2795
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed590d64a..a6a20e2a54c4 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -38,17 +38,17 @@ enum environment_cap {
38 * 38 *
39 * @rcu_head: RCU head struct used to free the request 39 * @rcu_head: RCU head struct used to free the request
40 * @wiphy_idx: this is set if this request's initiator is 40 * @wiphy_idx: this is set if this request's initiator is
41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This 41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
42 * can be used by the wireless core to deal with conflicts 42 * can be used by the wireless core to deal with conflicts
43 * and potentially inform users of which devices specifically 43 * and potentially inform users of which devices specifically
44 * cased the conflicts. 44 * cased the conflicts.
45 * @initiator: indicates who sent this request, could be any of 45 * @initiator: indicates who sent this request, could be any of
46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) 46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested 47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
48 * regulatory domain. We have a few special codes: 48 * regulatory domain. We have a few special codes:
49 * 00 - World regulatory domain 49 * 00 - World regulatory domain
50 * 99 - built by driver but a specific alpha2 cannot be determined 50 * 99 - built by driver but a specific alpha2 cannot be determined
51 * 98 - result of an intersection between two regulatory domains 51 * 98 - result of an intersection between two regulatory domains
52 * 97 - regulatory domain has not yet been configured 52 * 97 - regulatory domain has not yet been configured
53 * @dfs_region: If CRDA responded with a regulatory domain that requires 53 * @dfs_region: If CRDA responded with a regulatory domain that requires
54 * DFS master operation on a known DFS region (NL80211_DFS_*), 54 * DFS master operation on a known DFS region (NL80211_DFS_*),
@@ -59,8 +59,8 @@ enum environment_cap {
59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* 59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
60 * types. 60 * types.
61 * @intersect: indicates whether the wireless core should intersect 61 * @intersect: indicates whether the wireless core should intersect
62 * the requested regulatory domain with the presently set regulatory 62 * the requested regulatory domain with the presently set regulatory
63 * domain. 63 * domain.
64 * @processed: indicates whether or not this requests has already been 64 * @processed: indicates whether or not this requests has already been
65 * processed. When the last request is processed it means that the 65 * processed. When the last request is processed it means that the
66 * currently regulatory domain set on cfg80211 is updated from 66 * currently regulatory domain set on cfg80211 is updated from
@@ -68,9 +68,9 @@ enum environment_cap {
68 * the last request is not yet processed we must yield until it 68 * the last request is not yet processed we must yield until it
69 * is processed before processing any new requests. 69 * is processed before processing any new requests.
70 * @country_ie_checksum: checksum of the last processed and accepted 70 * @country_ie_checksum: checksum of the last processed and accepted
71 * country IE 71 * country IE
72 * @country_ie_env: lets us know if the AP is telling us we are outdoor, 72 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
73 * indoor, or if it doesn't matter 73 * indoor, or if it doesn't matter
74 * @list: used to insert into the reg_requests_list linked list 74 * @list: used to insert into the reg_requests_list linked list
75 */ 75 */
76struct regulatory_request { 76struct regulatory_request {
@@ -86,6 +86,39 @@ struct regulatory_request {
86 struct list_head list; 86 struct list_head list;
87}; 87};
88 88
89/**
90 * enum ieee80211_regulatory_flags - device regulatory flags
91 *
92 * @REGULATORY_CUSTOM_REG: tells us the driver for this device
93 * has its own custom regulatory domain and cannot identify the
94 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
95 * we will disregard the first regulatory hint (when the
96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
97 * wiphy_apply_custom_regulatory() should have this flag set
98 * or the regulatory core will set it for the wiphy.
99 * @REGULATORY_STRICT_REG: tells us the driver for this device will
100 * ignore regulatory domain settings until it gets its own regulatory
101 * domain via its regulatory_hint() unless the regulatory hint is
102 * from a country IE. After its gets its own regulatory domain it will
103 * only allow further regulatory domain settings to further enhance
104 * compliance. For example if channel 13 and 14 are disabled by this
105 * regulatory domain no user regulatory domain can enable these channels
106 * at a later time. This can be used for devices which do not have
107 * calibration information guaranteed for frequencies or settings
108 * outside of its regulatory domain. If used in combination with
109 * REGULATORY_FLAG_CUSTOM_REG the inspected country IE power settings
110 * will be followed.
111 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
112 * ensure that passive scan flags and beaconing flags may not be lifted by
113 * cfg80211 due to regulatory beacon hints. For more information on beacon
114 * hints read the documenation for regulatory_hint_found_beacon()
115 */
116enum ieee80211_regulatory_flags {
117 REGULATORY_CUSTOM_REG = BIT(0),
118 REGULATORY_STRICT_REG = BIT(1),
119 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
120};
121
89struct ieee80211_freq_range { 122struct ieee80211_freq_range {
90 u32 start_freq_khz; 123 u32 start_freq_khz;
91 u32 end_freq_khz; 124 u32 end_freq_khz;