Return-path: Received: from nbd.name ([46.4.11.11]:59100 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758206Ab3E1LCC (ORCPT ); Tue, 28 May 2013 07:02:02 -0400 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v2 1/3] cfg80211: support an active monitor interface flag Date: Tue, 28 May 2013 13:01:52 +0200 Message-Id: <1369738914-34367-1-git-send-email-nbd@openwrt.org> (sfid-20130528_130206_348137_D1442E7F) Sender: linux-wireless-owner@vger.kernel.org List-ID: An active monitor interface is one that is used for communication (via injection). It is expected to ACK incoming unicast packets. This is useful for running various 802.11 testing utilities that associate to an AP via injection and manage the state in user space. Signed-off-by: Felix Fietkau --- include/net/cfg80211.h | 1 + include/uapi/linux/nl80211.h | 4 ++++ net/wireless/nl80211.c | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 26b5b69..489821f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -954,6 +954,7 @@ enum monitor_flags { MONITOR_FLAG_CONTROL = 1<wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) + return -EOPNOTSUPP; + if (change) err = cfg80211_change_iface(rdev, dev, ntype, flags, ¶ms); else @@ -2447,6 +2452,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ? info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, &flags); + + if (!err && (flags & NL80211_MNTR_FLAG_ACTIVE) && + !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) + return -EOPNOTSUPP; + wdev = rdev_add_virtual_intf(rdev, nla_data(info->attrs[NL80211_ATTR_IFNAME]), type, err ? NULL : &flags, ¶ms); -- 1.8.0.2