summaryrefslogtreecommitdiff
path: root/iwinfo_nl80211.c
diff options
context:
space:
mode:
authorRobert Marko <robimarko@gmail.com>2019-03-13 19:19:19 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2019-03-21 16:28:39 +0100
commita8e827592338d7f10d93b4b93d04f367221465c2 (patch)
tree44bd51c1eecb423ff37c851b5c4ee13121b4b391 /iwinfo_nl80211.c
parentce1814baecca16fc3ba796de7bf9d06dce1f9a02 (diff)
downloadiwinfo-a8e827592338d7f10d93b4b93d04f367221465c2.tar.gz
iwinfo: Add support for 802.11ad
This patch adds support for identifying, calculating channels from frequency and vice versa as well as Lua hwmode for 802.11ad. Support has been added for channels 1-6. Signed-off-by: Robert Marko <robimarko@gmail.com> [Increase buffer size for hwmodes] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'iwinfo_nl80211.c')
-rw-r--r--iwinfo_nl80211.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 5154230..13c69e3 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -568,6 +568,8 @@ static int nl80211_freq2channel(int freq)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
+ else if(freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6)
+ return (freq - 56160) / 2160;
else
return (freq - 5000) / 5;
}
@@ -581,6 +583,10 @@ static int nl80211_channel2freq(int channel, const char *band)
else if (channel < 14)
return (channel * 5) + 2407;
}
+ else if ( strcmp(band, "ad") == 0)
+ {
+ return 56160 + 2160 * channel;
+ }
else
{
if (channel >= 182 && channel <= 196)
@@ -2800,6 +2806,10 @@ static int nl80211_get_modelist_cb(struct nl_msg *msg, void *arg)
}
}
}
+ else if (nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]) >= 56160)
+ {
+ m->hw |= IWINFO_80211_AD;
+ }
else if (!(m->hw & IWINFO_80211_AC))
{
m->hw |= IWINFO_80211_A;