summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo/src/iwinfo_nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_nl80211.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_nl80211.c b/contrib/package/iwinfo/src/iwinfo_nl80211.c
index ff30e0e94..6b980235e 100644
--- a/contrib/package/iwinfo/src/iwinfo_nl80211.c
+++ b/contrib/package/iwinfo/src/iwinfo_nl80211.c
@@ -1319,9 +1319,6 @@ int nl80211_get_freqlist(const char *ifname, char *buf, int *len)
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
};
- if( !wext_get_freqlist(ifname, buf, len) )
- return 0;
-
req = nl80211_msg(ifname, NL80211_CMD_GET_WIPHY, 0);
if( req )
{
@@ -1340,9 +1337,18 @@ int nl80211_get_freqlist(const char *ifname, char *buf, int *len)
nla_parse(freqs, NL80211_FREQUENCY_ATTR_MAX,
nla_data(freq), nla_len(freq), freq_policy);
+ if( freqs[NL80211_FREQUENCY_ATTR_DISABLED] )
+ continue;
+
e->mhz = nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]);
e->channel = nl80211_freq2channel(e->mhz);
+ e->restricted = (
+ freqs[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] ||
+ freqs[NL80211_FREQUENCY_ATTR_NO_IBSS] ||
+ freqs[NL80211_FREQUENCY_ATTR_RADAR]
+ ) ? 1 : 0;
+
e++;
count++;
}