nl80211/cfg80211: Set Operating Mode Notification
authorMarek Kwaczynski <marek.kwaczynski@tieto.com>
Tue, 3 Dec 2013 09:04:59 +0000 (10:04 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Dec 2013 12:46:42 +0000 (13:46 +0100)
This attribute is needed for setting Operating Mode Notification
in AP mode from User Space. This functionality is required when
User Space received Assoc Request contains Operation Mode
Notification element.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
[fix typos, nl80211 documentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index e9abc7b536cdebb5434caae1cbd487378ad0dfe1..47290a4059aeeb3348ef169c5b41b999246ada5a 100644 (file)
@@ -747,6 +747,8 @@ enum station_parameters_apply_mask {
  * @supported_channels_len: number of supported channels
  * @supported_oper_classes: supported oper classes in IEEE 802.11 format
  * @supported_oper_classes_len: number of supported operating classes
+ * @opmode_notif: operating mode field from Operating Mode Notification
+ * @opmode_notif_used: information if operating mode field is used
  */
 struct station_parameters {
        const u8 *supported_rates;
@@ -770,6 +772,8 @@ struct station_parameters {
        u8 supported_channels_len;
        const u8 *supported_oper_classes;
        u8 supported_oper_classes_len;
+       u8 opmode_notif;
+       bool opmode_notif_used;
 };
 
 /**
index 129b7b08714848279f3638019892a4dc0e9e6d65..9a4d0e18251c9c3e00fd00dbc3a9936a21cd5ccf 100644 (file)
@@ -1520,6 +1520,10 @@ enum nl80211_commands {
  * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
  *     10 MHz channel bandwidth.
  *
+ * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
+ *     Notification Element based on association request when used with
+ *     %NL80211_CMD_NEW_STATION; u8 attribute.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1839,6 +1843,8 @@ enum nl80211_attrs {
        NL80211_ATTR_SUPPORT_5_MHZ,
        NL80211_ATTR_SUPPORT_10_MHZ,
 
+       NL80211_ATTR_OPMODE_NOTIF,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
index 95882a788b5be372515eefb452f9d2e0c2a41e2b..93e3356091ff9cfac5937ce633e1a2efffbfbd83 100644 (file)
@@ -357,6 +357,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
        [NL80211_ATTR_STA_SUPPORTED_CHANNELS] = { .type = NLA_BINARY },
        [NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] = { .type = NLA_BINARY },
        [NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
+       [NL80211_ATTR_OPMODE_NOTIF] = { .type = NLA_U8 },
 };
 
 /* policy for the key attributes */
@@ -4132,6 +4133,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
                params.vht_capa =
                        nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]);
 
+       if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) {
+               params.opmode_notif_used = true;
+               params.opmode_notif =
+                       nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]);
+       }
+
        if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) {
                params.plink_action =
                        nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);