iw: Use NL80211_FREQUENCY_ATTR_NO_IR channel attribute
Align iw with the change in nl80211.h where NL80211_FREQUENCY_ATTR_NO_IBSS
and NL80211_FREQUENCY_ATTR_PASSIVE_SCAN were replaced by
NL80211_FREQUENCY_ATTR_NO_IR.
In case both NL80211_FREQUENCY_ATTR_NO_IR and __NL80211_FREQUENCY_ATTR_NO_IBSS
are set, assume that a new kernel is used and use the NO_IR notation,
otherwise use the previous notation.
This change requires nl80211.h with the new definitions
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
diff --git a/info.c b/info.c
index 7e61e88..b2eef15 100644
--- a/info.c
+++ b/info.c
@@ -74,8 +74,8 @@
static struct nla_policy freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
[NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
[NL80211_FREQUENCY_ATTR_DISABLED] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
+ [NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
+ [__NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
};
@@ -172,10 +172,16 @@
print_flag("disabled", &open);
goto next;
}
- if (tb_freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN])
- print_flag("passive scanning", &open);
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IBSS])
- print_flag("no IBSS", &open);
+
+ /* If both flags are set assume an new kernel */
+ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IR] && tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS]) {
+ print_flag("no IR", &open);
+ } else if (tb_freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN]) {
+ print_flag("passive scan", &open);
+ } else if (tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS]){
+ print_flag("no ibss", &open);
+ }
+
if (tb_freq[NL80211_FREQUENCY_ATTR_RADAR])
print_flag("radar detection", &open);
next: