Message ID | 1394199475-5208-7-git-send-email-rostislav.lisovy@fel.cvut.cz (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Fri, 2014-03-07 at 14:37 +0100, Rostislav Lisovy wrote: > + 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; This is the part of the code that I was referring to before, you should skip these channels if (!large) to not break older tools with too much data. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 2014-03-07 at 15:29 +0100, Johannes Berg wrote: > This is the part of the code that I was referring to before, you > should > skip these channels if (!large) to not break older tools with too much > data. The whole channel (not only these attributes) should be excluded if the 'split wiphy info' is not supported? I thought that reporting these attributes only 'if (large)' is a safe solution (except the userspace will be lacking some information). Thanks; Rostislav -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 2014-03-07 at 18:31 +0100, Rostislav Lisovy wrote: > On Fri, 2014-03-07 at 15:29 +0100, Johannes Berg wrote: > > This is the part of the code that I was referring to before, you > > should > > skip these channels if (!large) to not break older tools with too much > > data. > > The whole channel (not only these attributes) should be excluded if the > 'split wiphy info' is not supported? I thought that reporting these > attributes only 'if (large)' is a safe solution (except the userspace > will be lacking some information). The issue is that if all those channels are included, the data is guaranteed to become too large, and nothing will be shown in those older tools at all. So it's safer to just skip those channels that the old tools won't be able to use anyway. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 48040cd..8b40a3a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -606,6 +606,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,
Signed-off-by: Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz> --- net/wireless/nl80211.c | 6 ++++++ 1 file changed, 6 insertions(+)