aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-05-11 14:57:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-13 15:44:35 -0400
commiteccb8e8f0c3af47aeb6dbe4012eb8d4fc888767a (patch)
tree3705a833e4a5efb08beb2bfc4175775171e74295 /include
parent0e46724a48fcc3bac1fecea413d20af64a75844f (diff)
nl80211: improve station flags handling
It is currently not possible to modify station flags, but that capability would be very useful. This patch introduces a new nl80211 attribute that contains a set/mask for station flags, and updates the internal API (and mac80211) to mirror that. The new attribute is parsed before falling back to the old so that userspace can specify both (if it can) to work on all kernels. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h21
-rw-r--r--include/net/cfg80211.h28
2 files changed, 25 insertions, 24 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 58c4ee1822d3..aeefccfac0e1 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -25,6 +25,8 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/types.h>
29
28/** 30/**
29 * DOC: Station handling 31 * DOC: Station handling
30 * 32 *
@@ -380,7 +382,7 @@ enum nl80211_commands {
380 * 382 *
381 * @NL80211_ATTR_STA_AID: Association ID for the station (u16) 383 * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
382 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of 384 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
383 * &enum nl80211_sta_flags. 385 * &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
384 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by 386 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
385 * IEEE 802.11 7.3.1.6 (u16). 387 * IEEE 802.11 7.3.1.6 (u16).
386 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported 388 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
@@ -499,6 +501,9 @@ enum nl80211_commands {
499 * this attribute can be used 501 * this attribute can be used
500 * with %NL80211_CMD_ASSOCIATE request 502 * with %NL80211_CMD_ASSOCIATE request
501 * 503 *
504 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
505 * &struct nl80211_sta_flag_update.
506 *
502 * @NL80211_ATTR_MAX: highest attribute number currently defined 507 * @NL80211_ATTR_MAX: highest attribute number currently defined
503 * @__NL80211_ATTR_AFTER_LAST: internal use 508 * @__NL80211_ATTR_AFTER_LAST: internal use
504 */ 509 */
@@ -603,6 +608,8 @@ enum nl80211_attrs {
603 608
604 NL80211_ATTR_USE_MFP, 609 NL80211_ATTR_USE_MFP,
605 610
611 NL80211_ATTR_STA_FLAGS2,
612
606 /* add attributes here, update the policy in nl80211.c */ 613 /* add attributes here, update the policy in nl80211.c */
607 614
608 __NL80211_ATTR_AFTER_LAST, 615 __NL80211_ATTR_AFTER_LAST,
@@ -692,6 +699,18 @@ enum nl80211_sta_flags {
692}; 699};
693 700
694/** 701/**
702 * struct nl80211_sta_flag_update - station flags mask/set
703 * @mask: mask of station flags to set
704 * @set: which values to set them to
705 *
706 * Both mask and set contain bits as per &enum nl80211_sta_flags.
707 */
708struct nl80211_sta_flag_update {
709 __u32 mask;
710 __u32 set;
711} __attribute__((packed));
712
713/**
695 * enum nl80211_rate_info - bitrate information 714 * enum nl80211_rate_info - bitrate information
696 * 715 *
697 * These attribute types are used with %NL80211_STA_INFO_TXRATE 716 * These attribute types are used with %NL80211_STA_INFO_TXRATE
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e69e6c66dd16..0dae6b382940 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -252,27 +252,6 @@ struct beacon_parameters {
252}; 252};
253 253
254/** 254/**
255 * enum station_flags - station flags
256 *
257 * Station capability flags. Note that these must be the bits
258 * according to the nl80211 flags.
259 *
260 * @STATION_FLAG_CHANGED: station flags were changed
261 * @STATION_FLAG_AUTHORIZED: station is authorized to send frames (802.1X)
262 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
263 * with short preambles
264 * @STATION_FLAG_WME: station is WME/QoS capable
265 * @STATION_FLAG_MFP: station uses management frame protection
266 */
267enum station_flags {
268 STATION_FLAG_CHANGED = 1<<0,
269 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
270 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
271 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
272 STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP,
273};
274
275/**
276 * enum plink_action - actions to perform in mesh peers 255 * enum plink_action - actions to perform in mesh peers
277 * 256 *
278 * @PLINK_ACTION_INVALID: action 0 is reserved 257 * @PLINK_ACTION_INVALID: action 0 is reserved
@@ -294,14 +273,17 @@ enum plink_actions {
294 * @supported_rates: supported rates in IEEE 802.11 format 273 * @supported_rates: supported rates in IEEE 802.11 format
295 * (or NULL for no change) 274 * (or NULL for no change)
296 * @supported_rates_len: number of supported rates 275 * @supported_rates_len: number of supported rates
297 * @station_flags: station flags (see &enum station_flags) 276 * @sta_flags_mask: station flags that changed
277 * (bitmask of BIT(NL80211_STA_FLAG_...))
278 * @sta_flags_set: station flags values
279 * (bitmask of BIT(NL80211_STA_FLAG_...))
298 * @listen_interval: listen interval or -1 for no change 280 * @listen_interval: listen interval or -1 for no change
299 * @aid: AID or zero for no change 281 * @aid: AID or zero for no change
300 */ 282 */
301struct station_parameters { 283struct station_parameters {
302 u8 *supported_rates; 284 u8 *supported_rates;
303 struct net_device *vlan; 285 struct net_device *vlan;
304 u32 station_flags; 286 u32 sta_flags_mask, sta_flags_set;
305 int listen_interval; 287 int listen_interval;
306 u16 aid; 288 u16 aid;
307 u8 supported_rates_len; 289 u8 supported_rates_len;