diff mbox

[1/2] nl80211/cfg80211: Set VHT Operating mode

Message ID 1385994534-13383-1-git-send-email-marek.kwaczynski@tieto.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Marek Kwaczynski Dec. 2, 2013, 2:28 p.m. UTC
This attribuite is needed for setting Operating Mode Notification
in AP mode from User Space. This functionality is required when
User Space received Assoc Reqeust contains VHT Operation Mode
Notification element.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
---
 include/net/cfg80211.h       |    4 ++++
 include/uapi/linux/nl80211.h |    6 ++++++
 net/wireless/nl80211.c       |    7 +++++++
 3 files changed, 17 insertions(+)
diff mbox

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46c..0b66d91 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -748,6 +748,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
+ * @vht_opmode: operating mode field
+ * @vht_opmode_used: information if operating mode field is used
  */
 struct station_parameters {
 	const u8 *supported_rates;
@@ -771,6 +773,8 @@  struct station_parameters {
 	u8 supported_channels_len;
 	const u8 *supported_oper_classes;
 	u8 supported_oper_classes_len;
+	u8 vht_opmode;
+	bool vht_opmode_used;
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e98..0240e7d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1508,6 +1508,10 @@  enum nl80211_commands {
  *	to react to radar events, e.g. initiate a channel switch or leave the
  *	IBSS network.
  *
+ * @NL80211_ATTR_VHT_OPMODE: Operating mode field from Operating Mode
+ *	Notification Element based on association request when used with
+ *	NL80211_CMD_NEW_STATION
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1824,6 +1828,8 @@  enum nl80211_attrs {
 
 	NL80211_ATTR_HANDLE_DFS,
 
+	NL80211_ATTR_VHT_OPMODE,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a7f4e79..ddd1f71 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -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_VHT_OPMODE] = { .type = NLA_U8 },
 };
 
 /* policy for the key attributes */
@@ -4125,6 +4126,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_VHT_OPMODE]) {
+		params.vht_opmode_used = true;
+		params.vht_opmode =
+			nla_get_u8(info->attrs[NL80211_ATTR_VHT_OPMODE]);
+	}
+
 	if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) {
 		params.plink_action =
 			nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);