diff options
Diffstat (limited to 'src/wifi/wifi-utils-nl80211.c')
| -rw-r--r-- | src/wifi/wifi-utils-nl80211.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wifi/wifi-utils-nl80211.c b/src/wifi/wifi-utils-nl80211.c index eb2534a22c..0a5f79698a 100644 --- a/src/wifi/wifi-utils-nl80211.c +++ b/src/wifi/wifi-utils-nl80211.c @@ -635,8 +635,8 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg) } } + /* Find number of supported frequencies */ info->num_freqs = 0; - nla_for_each_nested (nl_band, tb[NL80211_ATTR_WIPHY_BANDS], rem_band) { if (nla_parse_nested (tb_band, NL80211_BAND_ATTR_MAX, nl_band, NULL) < 0) @@ -654,8 +654,8 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg) } } + /* Read supported frequencies */ info->freqs = g_malloc0 (sizeof(guint32) * info->num_freqs); - freq_idx = 0; nla_for_each_nested (nl_band, tb[NL80211_ATTR_WIPHY_BANDS], rem_band) { if (nla_parse_nested (tb_band, NL80211_BAND_ATTR_MAX, nl_band, @@ -672,10 +672,17 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg) info->freqs[freq_idx] = nla_get_u32 (tb_freq[NL80211_FREQUENCY_ATTR_FREQ]); + + if (info->freqs[freq_idx] > 2400 && info->freqs[freq_idx] < 2500) + info->caps |= NM_WIFI_DEVICE_CAP_FREQ_2GHZ; + if (info->freqs[freq_idx] > 4900 && info->freqs[freq_idx] < 6000) + info->caps |= NM_WIFI_DEVICE_CAP_FREQ_5GHZ; + freq_idx++; } } + /* Read security/encryption support */ if (tb[NL80211_ATTR_CIPHER_SUITES]) { int num; int i; |
