diff options
author | Aviya Erenfeld <aviya.erenfeld@intel.com> | 2016-07-05 08:23:08 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-07-06 08:46:04 -0400 |
commit | c6e6a0c8be575c830a97b1942dabeab70f423fe0 (patch) | |
tree | 01f16a0a2cadbb579fcf48392cb1b4940db6f661 /net/wireless | |
parent | f89e07d4cf2660a2956bc350a201398dda85284e (diff) |
nl80211: Add API to support VHT MU-MIMO air sniffer
add API to support VHT MU-MIMO air sniffer.
in MU-MIMO there are parallel frames on the air while the HW
has only one RX.
add the capability to sniff one of the MU-MIMO parallel frames by
giving the sniffer additional information so it'll know which
of the parallel frames it shall follow.
Add attribute - NL80211_ATTR_MU_MIMO_GROUP_DATA - for getting
a MU-MIMO groupID in order to monitor packets from that group
using VHT MU-MIMO.
And add attribute -NL80211_ATTR_MU_MIMO_FOLLOW_ADDR - for passing
MAC address to monitor mode.
that option will be used by VHT MU-MIMO air sniffer to follow a
station according to it's MAC address using VHT MU-MIMO.
Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 244d552d5647..447026f8cc76 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -405,6 +405,10 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
405 | [NL80211_ATTR_PBSS] = { .type = NLA_FLAG }, | 405 | [NL80211_ATTR_PBSS] = { .type = NLA_FLAG }, |
406 | [NL80211_ATTR_BSS_SELECT] = { .type = NLA_NESTED }, | 406 | [NL80211_ATTR_BSS_SELECT] = { .type = NLA_NESTED }, |
407 | [NL80211_ATTR_STA_SUPPORT_P2P_PS] = { .type = NLA_U8 }, | 407 | [NL80211_ATTR_STA_SUPPORT_P2P_PS] = { .type = NLA_U8 }, |
408 | [NL80211_ATTR_MU_MIMO_GROUP_DATA] = { | ||
409 | .len = VHT_MUMIMO_GROUPS_DATA_LEN | ||
410 | }, | ||
411 | [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = { .len = ETH_ALEN }, | ||
408 | }; | 412 | }; |
409 | 413 | ||
410 | /* policy for the key attributes */ | 414 | /* policy for the key attributes */ |
@@ -2695,6 +2699,38 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) | |||
2695 | change = true; | 2699 | change = true; |
2696 | } | 2700 | } |
2697 | 2701 | ||
2702 | if (info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]) { | ||
2703 | const u8 *mumimo_groups; | ||
2704 | u32 cap_flag = NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER; | ||
2705 | |||
2706 | if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag)) | ||
2707 | return -EOPNOTSUPP; | ||
2708 | |||
2709 | mumimo_groups = | ||
2710 | nla_data(info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]); | ||
2711 | |||
2712 | /* bits 0 and 63 are reserved and must be zero */ | ||
2713 | if ((mumimo_groups[0] & BIT(7)) || | ||
2714 | (mumimo_groups[VHT_MUMIMO_GROUPS_DATA_LEN - 1] & BIT(0))) | ||
2715 | return -EINVAL; | ||
2716 | |||
2717 | memcpy(params.vht_mumimo_groups, mumimo_groups, | ||
2718 | VHT_MUMIMO_GROUPS_DATA_LEN); | ||
2719 | change = true; | ||
2720 | } | ||
2721 | |||
2722 | if (info->attrs[NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR]) { | ||
2723 | u32 cap_flag = NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER; | ||
2724 | |||
2725 | if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag)) | ||
2726 | return -EOPNOTSUPP; | ||
2727 | |||
2728 | nla_memcpy(params.macaddr, | ||
2729 | info->attrs[NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR], | ||
2730 | ETH_ALEN); | ||
2731 | change = true; | ||
2732 | } | ||
2733 | |||
2698 | if (flags && (*flags & MONITOR_FLAG_ACTIVE) && | 2734 | if (flags && (*flags & MONITOR_FLAG_ACTIVE) && |
2699 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) | 2735 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) |
2700 | return -EOPNOTSUPP; | 2736 | return -EOPNOTSUPP; |