[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1394543114-6700-3-git-send-email-rostislav.lisovy@fel.cvut.cz>
Date: Tue, 11 Mar 2014 14:05:11 +0100
From: Rostislav Lisovy <lisovy@...il.com>
To: Johannes Berg <johannes@...solutions.net>,
"John W. Linville" <linville@...driver.com>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Michal Sojka <sojkam1@....cvut.cz>, s.sander@...dsys.de,
jan-niklas.meier@...kswagen.de,
Rostislav Lisovy <rostislav.lisovy@....cvut.cz>
Subject: [PATCH 2/5] nl80211: Support for 5/10 MHz channels when reporting BW restrictions
If the 'split wiphy dump' is enabled report the extra attributes
(if present) describing the bandwidth restrictions.
If the 'split wiphy dump' is not enabled completely omit those
channels that have flags set to either IEEE80211_CHAN_NO_10MHZ
or IEEE80211_CHAN_NO_20MHZ thus preventing breaking of old
user-space tools.
Signed-off-by: Rostislav Lisovy <rostislav.lisovy@....cvut.cz>
---
net/wireless/nl80211.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4fe2e6e..c62c572 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -563,6 +563,13 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
struct ieee80211_channel *chan,
bool large)
{
+ /* Some channels must be completely excluded from the
+ * list to protect old user-space tools from breaking
+ */
+ if (!large && chan->flags &
+ (IEEE80211_CHAN_NO_10MHZ | IEEE80211_CHAN_NO_20MHZ))
+ return 0;
+
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_FREQ,
chan->center_freq))
goto nla_put_failure;
@@ -606,6 +613,12 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
if ((chan->flags & IEEE80211_CHAN_NO_160MHZ) &&
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ))
goto nla_put_failure;
+ if ((chan->flags & IEEE80211_CHAN_NO_20MHZ) &&
+ nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_20MHZ))
+ goto nla_put_failure;
+ if ((chan->flags & IEEE80211_CHAN_NO_10MHZ) &&
+ nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_10MHZ))
+ goto nla_put_failure;
}
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
--
1.8.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists