iwinfo: don't report AC capabilities on 2GHz-only interfaces
If a 802.11ac capable chip is in 2GHz-only mode, the hwmode reported should be 802.11bgn. Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
This commit is contained in:
parent
c9fd399316
commit
40f2844fad
1 changed files with 8 additions and 7 deletions
|
@ -2383,13 +2383,6 @@ static int nl80211_get_hwmodelist_cb(struct nl_msg *msg, void *arg)
|
||||||
if (caps > 0)
|
if (caps > 0)
|
||||||
*modes |= IWINFO_80211_N;
|
*modes |= IWINFO_80211_N;
|
||||||
|
|
||||||
if (bands[NL80211_BAND_ATTR_VHT_CAPA])
|
|
||||||
vht_caps = nla_get_u32(bands[NL80211_BAND_ATTR_VHT_CAPA]);
|
|
||||||
|
|
||||||
/* Treat any nonzero capability as 11ac */
|
|
||||||
if (vht_caps > 0)
|
|
||||||
*modes |= IWINFO_80211_AC;
|
|
||||||
|
|
||||||
nla_for_each_nested(freq, bands[NL80211_BAND_ATTR_FREQS],
|
nla_for_each_nested(freq, bands[NL80211_BAND_ATTR_FREQS],
|
||||||
freqs_remain)
|
freqs_remain)
|
||||||
{
|
{
|
||||||
|
@ -2404,6 +2397,14 @@ static int nl80211_get_hwmodelist_cb(struct nl_msg *msg, void *arg)
|
||||||
*modes |= IWINFO_80211_B;
|
*modes |= IWINFO_80211_B;
|
||||||
*modes |= IWINFO_80211_G;
|
*modes |= IWINFO_80211_G;
|
||||||
}
|
}
|
||||||
|
else if (bands[NL80211_BAND_ATTR_VHT_CAPA])
|
||||||
|
{
|
||||||
|
vht_caps = nla_get_u32(bands[NL80211_BAND_ATTR_VHT_CAPA]);
|
||||||
|
|
||||||
|
/* Treat any nonzero capability as 11ac */
|
||||||
|
if (vht_caps > 0)
|
||||||
|
*modes |= IWINFO_80211_AC;
|
||||||
|
}
|
||||||
else if (!(*modes & IWINFO_80211_AC))
|
else if (!(*modes & IWINFO_80211_AC))
|
||||||
{
|
{
|
||||||
*modes |= IWINFO_80211_A;
|
*modes |= IWINFO_80211_A;
|
||||||
|
|
Loading…
Add table
Reference in a new issue