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>
This commit is contained in:
Johannes Berg 2009-05-11 21:57:56 +03:00 committed by John W. Linville
parent 0e46724a48
commit eccb8e8f0c
4 changed files with 80 additions and 53 deletions

View file

@ -25,6 +25,8 @@
*
*/
#include <linux/types.h>
/**
* DOC: Station handling
*
@ -380,7 +382,7 @@ enum nl80211_commands {
*
* @NL80211_ATTR_STA_AID: Association ID for the station (u16)
* @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
* &enum nl80211_sta_flags.
* &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
* @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
* IEEE 802.11 7.3.1.6 (u16).
* @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
@ -499,6 +501,9 @@ enum nl80211_commands {
* this attribute can be used
* with %NL80211_CMD_ASSOCIATE request
*
* @NL80211_ATTR_STA_FLAGS2: Attribute containing a
* &struct nl80211_sta_flag_update.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@ -603,6 +608,8 @@ enum nl80211_attrs {
NL80211_ATTR_USE_MFP,
NL80211_ATTR_STA_FLAGS2,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@ -691,6 +698,18 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
};
/**
* struct nl80211_sta_flag_update - station flags mask/set
* @mask: mask of station flags to set
* @set: which values to set them to
*
* Both mask and set contain bits as per &enum nl80211_sta_flags.
*/
struct nl80211_sta_flag_update {
__u32 mask;
__u32 set;
} __attribute__((packed));
/**
* enum nl80211_rate_info - bitrate information
*