aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-12-06 10:37:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-12-06 10:37:24 -0500
commitd86804cb70f93ca5e4c0fb13402962fbfb705c53 (patch)
treeca4e7da3541267ad909a2b73228406503e198ffa /include
parentd70f2cf520cf8c86c6b467fc5dcea524ec51dc2f (diff)
parente08fd975bf26aa8063cadd245817e042f570472d (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h8
-rw-r--r--include/net/cfg80211.h76
-rw-r--r--include/net/mac80211.h40
-rw-r--r--include/net/regulatory.h80
-rw-r--r--include/uapi/linux/nl80211.h47
5 files changed, 189 insertions, 62 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8c3b26a21574..776cbb80d098 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1411,8 +1411,12 @@ struct ieee80211_vht_operation {
1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700
1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13
1415#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 1415#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK \
1416 (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)
1417#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16
1418#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \
1419 (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT)
1416#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1420#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1417#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1421#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1418#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1422#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46cb1acf..e9abc7b536cd 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -91,9 +91,8 @@ enum ieee80211_band {
91 * Channel flags set by the regulatory control code. 91 * Channel flags set by the regulatory control code.
92 * 92 *
93 * @IEEE80211_CHAN_DISABLED: This channel is disabled. 93 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
94 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted 94 * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
95 * on this channel. 95 * sending probe requests or beaconing.
96 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
97 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. 96 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
98 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel 97 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
99 * is not permitted. 98 * is not permitted.
@@ -113,8 +112,8 @@ enum ieee80211_band {
113 */ 112 */
114enum ieee80211_channel_flags { 113enum ieee80211_channel_flags {
115 IEEE80211_CHAN_DISABLED = 1<<0, 114 IEEE80211_CHAN_DISABLED = 1<<0,
116 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 115 IEEE80211_CHAN_NO_IR = 1<<1,
117 IEEE80211_CHAN_NO_IBSS = 1<<2, 116 /* hole at 1<<2 */
118 IEEE80211_CHAN_RADAR = 1<<3, 117 IEEE80211_CHAN_RADAR = 1<<3,
119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 118 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 119 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
@@ -1945,6 +1944,29 @@ struct cfg80211_update_ft_ies_params {
1945}; 1944};
1946 1945
1947/** 1946/**
1947 * struct cfg80211_mgmt_tx_params - mgmt tx parameters
1948 *
1949 * This structure provides information needed to transmit a mgmt frame
1950 *
1951 * @chan: channel to use
1952 * @offchan: indicates wether off channel operation is required
1953 * @wait: duration for ROC
1954 * @buf: buffer to transmit
1955 * @len: buffer length
1956 * @no_cck: don't use cck rates for this frame
1957 * @dont_wait_for_ack: tells the low level not to wait for an ack
1958 */
1959struct cfg80211_mgmt_tx_params {
1960 struct ieee80211_channel *chan;
1961 bool offchan;
1962 unsigned int wait;
1963 const u8 *buf;
1964 size_t len;
1965 bool no_cck;
1966 bool dont_wait_for_ack;
1967};
1968
1969/**
1948 * struct cfg80211_ops - backend description for wireless configuration 1970 * struct cfg80211_ops - backend description for wireless configuration
1949 * 1971 *
1950 * This struct is registered by fullmac card drivers and/or wireless stacks 1972 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2342,9 +2364,8 @@ struct cfg80211_ops {
2342 u64 cookie); 2364 u64 cookie);
2343 2365
2344 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 2366 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
2345 struct ieee80211_channel *chan, bool offchan, 2367 struct cfg80211_mgmt_tx_params *params,
2346 unsigned int wait, const u8 *buf, size_t len, 2368 u64 *cookie);
2347 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
2348 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 2369 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
2349 struct wireless_dev *wdev, 2370 struct wireless_dev *wdev,
2350 u64 cookie); 2371 u64 cookie);
@@ -2438,27 +2459,6 @@ struct cfg80211_ops {
2438/** 2459/**
2439 * enum wiphy_flags - wiphy capability flags 2460 * enum wiphy_flags - wiphy capability flags
2440 * 2461 *
2441 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
2442 * has its own custom regulatory domain and cannot identify the
2443 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
2444 * we will disregard the first regulatory hint (when the
2445 * initiator is %REGDOM_SET_BY_CORE).
2446 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
2447 * ignore regulatory domain settings until it gets its own regulatory
2448 * domain via its regulatory_hint() unless the regulatory hint is
2449 * from a country IE. After its gets its own regulatory domain it will
2450 * only allow further regulatory domain settings to further enhance
2451 * compliance. For example if channel 13 and 14 are disabled by this
2452 * regulatory domain no user regulatory domain can enable these channels
2453 * at a later time. This can be used for devices which do not have
2454 * calibration information guaranteed for frequencies or settings
2455 * outside of its regulatory domain. If used in combination with
2456 * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
2457 * will be followed.
2458 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
2459 * that passive scan flags and beaconing flags may not be lifted by
2460 * cfg80211 due to regulatory beacon hints. For more information on beacon
2461 * hints read the documenation for regulatory_hint_found_beacon()
2462 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 2462 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
2463 * wiphy at all 2463 * wiphy at all
2464 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 2464 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
@@ -2497,9 +2497,9 @@ struct cfg80211_ops {
2497 * beaconing mode (AP, IBSS, Mesh, ...). 2497 * beaconing mode (AP, IBSS, Mesh, ...).
2498 */ 2498 */
2499enum wiphy_flags { 2499enum wiphy_flags {
2500 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2500 /* use hole at 0 */
2501 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 2501 /* use hole at 1 */
2502 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 2502 /* use hole at 2 */
2503 WIPHY_FLAG_NETNS_OK = BIT(3), 2503 WIPHY_FLAG_NETNS_OK = BIT(3),
2504 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 2504 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
2505 WIPHY_FLAG_4ADDR_AP = BIT(5), 2505 WIPHY_FLAG_4ADDR_AP = BIT(5),
@@ -2721,6 +2721,8 @@ struct wiphy_coalesce_support {
2721 * @software_iftypes: bitmask of software interface types, these are not 2721 * @software_iftypes: bitmask of software interface types, these are not
2722 * subject to any restrictions since they are purely managed in SW. 2722 * subject to any restrictions since they are purely managed in SW.
2723 * @flags: wiphy flags, see &enum wiphy_flags 2723 * @flags: wiphy flags, see &enum wiphy_flags
2724 * @regulatory_flags: wiphy regulatory flags, see
2725 * &enum ieee80211_regulatory_flags
2724 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2726 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2725 * @bss_priv_size: each BSS struct has private data allocated with it, 2727 * @bss_priv_size: each BSS struct has private data allocated with it,
2726 * this variable determines its size 2728 * this variable determines its size
@@ -2809,7 +2811,7 @@ struct wiphy {
2809 2811
2810 u16 max_acl_mac_addrs; 2812 u16 max_acl_mac_addrs;
2811 2813
2812 u32 flags, features; 2814 u32 flags, regulatory_flags, features;
2813 2815
2814 u32 ap_sme_capa; 2816 u32 ap_sme_capa;
2815 2817
@@ -3472,6 +3474,9 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3472 * custom regulatory domain will be trusted completely and as such previous 3474 * custom regulatory domain will be trusted completely and as such previous
3473 * default channel settings will be disregarded. If no rule is found for a 3475 * default channel settings will be disregarded. If no rule is found for a
3474 * channel on the regulatory domain the channel will be disabled. 3476 * channel on the regulatory domain the channel will be disabled.
3477 * Drivers using this for a wiphy should also set the wiphy flag
3478 * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy
3479 * that called this helper.
3475 */ 3480 */
3476void wiphy_apply_custom_regulatory(struct wiphy *wiphy, 3481void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3477 const struct ieee80211_regdomain *regd); 3482 const struct ieee80211_regdomain *regd);
@@ -4146,6 +4151,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4146/** 4151/**
4147 * cfg80211_cac_event - Channel availability check (CAC) event 4152 * cfg80211_cac_event - Channel availability check (CAC) event
4148 * @netdev: network device 4153 * @netdev: network device
4154 * @chandef: chandef for the current channel
4149 * @event: type of event 4155 * @event: type of event
4150 * @gfp: context flags 4156 * @gfp: context flags
4151 * 4157 *
@@ -4154,6 +4160,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4154 * also by full-MAC drivers. 4160 * also by full-MAC drivers.
4155 */ 4161 */
4156void cfg80211_cac_event(struct net_device *netdev, 4162void cfg80211_cac_event(struct net_device *netdev,
4163 const struct cfg80211_chan_def *chandef,
4157 enum nl80211_radar_event event, gfp_t gfp); 4164 enum nl80211_radar_event event, gfp_t gfp);
4158 4165
4159 4166
@@ -4279,7 +4286,8 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4279 * @dev: the device which switched channels 4286 * @dev: the device which switched channels
4280 * @chandef: the new channel definition 4287 * @chandef: the new channel definition
4281 * 4288 *
4282 * Acquires wdev_lock, so must only be called from sleepable driver context! 4289 * Caller must acquire wdev_lock, therefore must only be called from sleepable
4290 * driver context!
4283 */ 4291 */
4284void cfg80211_ch_switch_notify(struct net_device *dev, 4292void cfg80211_ch_switch_notify(struct net_device *dev,
4285 struct cfg80211_chan_def *chandef); 4293 struct cfg80211_chan_def *chandef);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7ceed99a05bc..3cd408b326de 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -154,12 +154,14 @@ struct ieee80211_low_level_stats {
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, 155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA 156 * this is used only with channel switching with CSA
157 * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed
157 */ 158 */
158enum ieee80211_chanctx_change { 159enum ieee80211_chanctx_change {
159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 160 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 161 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 162 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), 163 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
164 IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4),
163}; 165};
164 166
165/** 167/**
@@ -169,6 +171,7 @@ enum ieee80211_chanctx_change {
169 * that contains it is visible in mac80211 only. 171 * that contains it is visible in mac80211 only.
170 * 172 *
171 * @def: the channel definition 173 * @def: the channel definition
174 * @min_def: the minimum channel definition currently required.
172 * @rx_chains_static: The number of RX chains that must always be 175 * @rx_chains_static: The number of RX chains that must always be
173 * active on the channel to receive MIMO transmissions 176 * active on the channel to receive MIMO transmissions
174 * @rx_chains_dynamic: The number of RX chains that must be enabled 177 * @rx_chains_dynamic: The number of RX chains that must be enabled
@@ -180,6 +183,7 @@ enum ieee80211_chanctx_change {
180 */ 183 */
181struct ieee80211_chanctx_conf { 184struct ieee80211_chanctx_conf {
182 struct cfg80211_chan_def def; 185 struct cfg80211_chan_def def;
186 struct cfg80211_chan_def min_def;
183 187
184 u8 rx_chains_static, rx_chains_dynamic; 188 u8 rx_chains_static, rx_chains_dynamic;
185 189
@@ -1229,6 +1233,36 @@ struct ieee80211_key_conf {
1229}; 1233};
1230 1234
1231/** 1235/**
1236 * struct ieee80211_cipher_scheme - cipher scheme
1237 *
1238 * This structure contains a cipher scheme information defining
1239 * the secure packet crypto handling.
1240 *
1241 * @cipher: a cipher suite selector
1242 * @iftype: a cipher iftype bit mask indicating an allowed cipher usage
1243 * @hdr_len: a length of a security header used the cipher
1244 * @pn_len: a length of a packet number in the security header
1245 * @pn_off: an offset of pn from the beginning of the security header
1246 * @key_idx_off: an offset of key index byte in the security header
1247 * @key_idx_mask: a bit mask of key_idx bits
1248 * @key_idx_shift: a bit shift needed to get key_idx
1249 * key_idx value calculation:
1250 * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift
1251 * @mic_len: a mic length in bytes
1252 */
1253struct ieee80211_cipher_scheme {
1254 u32 cipher;
1255 u16 iftype;
1256 u8 hdr_len;
1257 u8 pn_len;
1258 u8 pn_off;
1259 u8 key_idx_off;
1260 u8 key_idx_mask;
1261 u8 key_idx_shift;
1262 u8 mic_len;
1263};
1264
1265/**
1232 * enum set_key_cmd - key command 1266 * enum set_key_cmd - key command
1233 * 1267 *
1234 * Used with the set_key() callback in &struct ieee80211_ops, this 1268 * Used with the set_key() callback in &struct ieee80211_ops, this
@@ -1636,6 +1670,10 @@ enum ieee80211_hw_flags {
1636 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may 1670 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
1637 * deliver to a WMM STA during any Service Period triggered by the WMM STA. 1671 * deliver to a WMM STA during any Service Period triggered by the WMM STA.
1638 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. 1672 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
1673 *
1674 * @n_cipher_schemes: a size of an array of cipher schemes definitions.
1675 * @cipher_schemes: a pointer to an array of cipher scheme definitions
1676 * supported by HW.
1639 */ 1677 */
1640struct ieee80211_hw { 1678struct ieee80211_hw {
1641 struct ieee80211_conf conf; 1679 struct ieee80211_conf conf;
@@ -1663,6 +1701,8 @@ struct ieee80211_hw {
1663 netdev_features_t netdev_features; 1701 netdev_features_t netdev_features;
1664 u8 uapsd_queues; 1702 u8 uapsd_queues;
1665 u8 uapsd_max_sp_len; 1703 u8 uapsd_max_sp_len;
1704 u8 n_cipher_schemes;
1705 const struct ieee80211_cipher_scheme *cipher_schemes;
1666}; 1706};
1667 1707
1668/** 1708/**
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed590d64a..c96a0b86f342 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 {
@@ -79,13 +79,63 @@ struct regulatory_request {
79 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
80 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
81 char alpha2[2]; 81 char alpha2[2];
82 u8 dfs_region; 82 enum nl80211_dfs_regions dfs_region;
83 bool intersect; 83 bool intersect;
84 bool processed; 84 bool processed;
85 enum environment_cap country_ie_env; 85 enum environment_cap country_ie_env;
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 that the wiphy for this device
100 * has regulatory domain that it wishes to be considered as the
101 * superset for regulatory rules. After this device gets its regulatory
102 * domain programmed further regulatory hints shall only be considered
103 * for this device to enhance regulatory compliance, forcing the
104 * device to only possibly use subsets of the original regulatory
105 * rules. For example if channel 13 and 14 are disabled by this
106 * device's regulatory domain no user specified regulatory hint which
107 * has these channels enabled would enable them for this wiphy,
108 * the device's original regulatory domain will be trusted as the
109 * base. You can program the superset of regulatory rules for this
110 * wiphy with regulatory_hint() for cards programmed with an
111 * ISO3166-alpha2 country code. wiphys that use regulatory_hint()
112 * will have their wiphy->regd programmed once the regulatory
113 * domain is set, and all other regulatory hints will be ignored
114 * until their own regulatory domain gets programmed.
115 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
116 * ensure that passive scan flags and beaconing flags may not be lifted by
117 * cfg80211 due to regulatory beacon hints. For more information on beacon
118 * hints read the documenation for regulatory_hint_found_beacon()
119 * @REGULATORY_COUNTRY_IE_FOLLOW_POWER: for devices that have a preference
120 * that even though they may have programmed their own custom power
121 * setting prior to wiphy registration, they want to ensure their channel
122 * power settings are updated for this connection with the power settings
123 * derived from the regulatory domain. The regulatory domain used will be
124 * based on the ISO3166-alpha2 from country IE provided through
125 * regulatory_hint_country_ie()
126 * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
127 * all country IE information processed by the regulatory core. This will
128 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
129 * be ignored.
130 */
131enum ieee80211_regulatory_flags {
132 REGULATORY_CUSTOM_REG = BIT(0),
133 REGULATORY_STRICT_REG = BIT(1),
134 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
135 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3),
136 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
137};
138
89struct ieee80211_freq_range { 139struct ieee80211_freq_range {
90 u32 start_freq_khz; 140 u32 start_freq_khz;
91 u32 end_freq_khz; 141 u32 end_freq_khz;
@@ -107,7 +157,7 @@ struct ieee80211_regdomain {
107 struct rcu_head rcu_head; 157 struct rcu_head rcu_head;
108 u32 n_reg_rules; 158 u32 n_reg_rules;
109 char alpha2[2]; 159 char alpha2[2];
110 u8 dfs_region; 160 enum nl80211_dfs_regions dfs_region;
111 struct ieee80211_reg_rule reg_rules[]; 161 struct ieee80211_reg_rule reg_rules[];
112}; 162};
113 163
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e9821e71..129b7b087148 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -581,7 +581,14 @@
581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and 581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with 582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
583 * %NL80211_TDLS_TEARDOWN). 583 * %NL80211_TDLS_TEARDOWN).
584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
585 * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
586 * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
587 * 802.11 management frames, while TDLS action codes (802.11-2012
588 * 8.5.13.1) will be encapsulated and sent as data frames. The currently
589 * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
590 * and the currently supported TDLS actions codes are given in
591 * &enum ieee80211_tdls_actioncode.
585 * 592 *
586 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 593 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
587 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to 594 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to
@@ -1508,6 +1515,11 @@ enum nl80211_commands {
1508 * to react to radar events, e.g. initiate a channel switch or leave the 1515 * to react to radar events, e.g. initiate a channel switch or leave the
1509 * IBSS network. 1516 * IBSS network.
1510 * 1517 *
1518 * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
1519 * 5 MHz channel bandwidth.
1520 * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
1521 * 10 MHz channel bandwidth.
1522 *
1511 * @NL80211_ATTR_MAX: highest attribute number currently defined 1523 * @NL80211_ATTR_MAX: highest attribute number currently defined
1512 * @__NL80211_ATTR_AFTER_LAST: internal use 1524 * @__NL80211_ATTR_AFTER_LAST: internal use
1513 */ 1525 */
@@ -1824,6 +1836,9 @@ enum nl80211_attrs {
1824 1836
1825 NL80211_ATTR_HANDLE_DFS, 1837 NL80211_ATTR_HANDLE_DFS,
1826 1838
1839 NL80211_ATTR_SUPPORT_5_MHZ,
1840 NL80211_ATTR_SUPPORT_10_MHZ,
1841
1827 /* add attributes here, update the policy in nl80211.c */ 1842 /* add attributes here, update the policy in nl80211.c */
1828 1843
1829 __NL80211_ATTR_AFTER_LAST, 1844 __NL80211_ATTR_AFTER_LAST,
@@ -2224,10 +2239,9 @@ enum nl80211_band_attr {
2224 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 2239 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
2225 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 2240 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
2226 * regulatory domain. 2241 * regulatory domain.
2227 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is 2242 * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
2228 * permitted on this channel in current regulatory domain. 2243 * are permitted on this channel, this includes sending probe
2229 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted 2244 * requests, or modes of operation that require beaconing.
2230 * on this channel in current regulatory domain.
2231 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory 2245 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
2232 * on this channel in current regulatory domain. 2246 * on this channel in current regulatory domain.
2233 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2247 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
@@ -2254,8 +2268,8 @@ enum nl80211_frequency_attr {
2254 __NL80211_FREQUENCY_ATTR_INVALID, 2268 __NL80211_FREQUENCY_ATTR_INVALID,
2255 NL80211_FREQUENCY_ATTR_FREQ, 2269 NL80211_FREQUENCY_ATTR_FREQ,
2256 NL80211_FREQUENCY_ATTR_DISABLED, 2270 NL80211_FREQUENCY_ATTR_DISABLED,
2257 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, 2271 NL80211_FREQUENCY_ATTR_NO_IR,
2258 NL80211_FREQUENCY_ATTR_NO_IBSS, 2272 __NL80211_FREQUENCY_ATTR_NO_IBSS,
2259 NL80211_FREQUENCY_ATTR_RADAR, 2273 NL80211_FREQUENCY_ATTR_RADAR,
2260 NL80211_FREQUENCY_ATTR_MAX_TX_POWER, 2274 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2261 NL80211_FREQUENCY_ATTR_DFS_STATE, 2275 NL80211_FREQUENCY_ATTR_DFS_STATE,
@@ -2271,6 +2285,9 @@ enum nl80211_frequency_attr {
2271}; 2285};
2272 2286
2273#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER 2287#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
2288#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
2289#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
2290#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
2274 2291
2275/** 2292/**
2276 * enum nl80211_bitrate_attr - bitrate attributes 2293 * enum nl80211_bitrate_attr - bitrate attributes
@@ -2413,8 +2430,9 @@ enum nl80211_sched_scan_match_attr {
2413 * @NL80211_RRF_DFS: DFS support is required to be used 2430 * @NL80211_RRF_DFS: DFS support is required to be used
2414 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links 2431 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
2415 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links 2432 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
2416 * @NL80211_RRF_PASSIVE_SCAN: passive scan is required 2433 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
2417 * @NL80211_RRF_NO_IBSS: no IBSS is allowed 2434 * this includes probe requests or modes of operation that require
2435 * beaconing.
2418 */ 2436 */
2419enum nl80211_reg_rule_flags { 2437enum nl80211_reg_rule_flags {
2420 NL80211_RRF_NO_OFDM = 1<<0, 2438 NL80211_RRF_NO_OFDM = 1<<0,
@@ -2424,10 +2442,17 @@ enum nl80211_reg_rule_flags {
2424 NL80211_RRF_DFS = 1<<4, 2442 NL80211_RRF_DFS = 1<<4,
2425 NL80211_RRF_PTP_ONLY = 1<<5, 2443 NL80211_RRF_PTP_ONLY = 1<<5,
2426 NL80211_RRF_PTMP_ONLY = 1<<6, 2444 NL80211_RRF_PTMP_ONLY = 1<<6,
2427 NL80211_RRF_PASSIVE_SCAN = 1<<7, 2445 NL80211_RRF_NO_IR = 1<<7,
2428 NL80211_RRF_NO_IBSS = 1<<8, 2446 __NL80211_RRF_NO_IBSS = 1<<8,
2429}; 2447};
2430 2448
2449#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
2450#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
2451#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
2452
2453/* For backport compatibility with older userspace */
2454#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
2455
2431/** 2456/**
2432 * enum nl80211_dfs_regions - regulatory DFS regions 2457 * enum nl80211_dfs_regions - regulatory DFS regions
2433 * 2458 *