{"CCMP", N_("CCMP"), 6}, /* 5 */
{"AP", N_("AP"), 6}, /* 6 */
{"ADHOC", N_("ADHOC"), 6}, /* 7 */
+ {"2GHZ", N_("2GHZ"), 10}, /* 8 */
+ {"5GHZ", N_("5GHZ"), 10}, /* 9 */
{NULL, NULL, 0}
};
-#define NMC_FIELDS_DEV_SHOW_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP,AP,ADHOC"
+#define NMC_FIELDS_DEV_SHOW_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP,AP,ADHOC,2GHZ,5GHZ"
#define NMC_FIELDS_DEV_SHOW_WIFI_PROP_COMMON "NAME,WEP,WPA,WPA2,TKIP,CCMP,AP,ADHOC"
/* Available fields for 'device show' - wimax properties part */
set_val_strc (arr, 5, (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) ? _("yes") : _("no"));
set_val_strc (arr, 6, (wcaps & NM_WIFI_DEVICE_CAP_AP) ? _("yes") : _("no"));
set_val_strc (arr, 7, (wcaps & NM_WIFI_DEVICE_CAP_ADHOC) ? _("yes") : _("no"));
+ set_val_strc (arr, 8, !(wcaps & NM_WIFI_DEVICE_CAP_FREQ_VALID) ? _("unknown") :
+ ((wcaps & NM_WIFI_DEVICE_CAP_FREQ_2GHZ) ? _("yes") : _("no")));
+ set_val_strc (arr, 9, !(wcaps & NM_WIFI_DEVICE_CAP_FREQ_VALID) ? _("unknown") :
+ ((wcaps & NM_WIFI_DEVICE_CAP_FREQ_5GHZ) ? _("yes") : _("no")));
g_ptr_array_add (nmc->output_data, arr);
print_data (nmc); /* Print all data */
<tp:flag suffix="ADHOC" value="0x80">
<tp:docstring>The device supports Ad-Hoc mode.</tp:docstring>
</tp:flag>
+ <tp:flag suffix="FREQ_VALID" value="0x100">
+ <tp:docstring>
+ The device properly reports information about supported
+ frequencies and thus both NM_802_11_DEVICE_CAP_FREQ_2GHZ and
+ NM_802_11_DEVICE_CAP_FREQ_5GHZ are valid.
+ </tp:docstring>
+ </tp:flag>
+ <tp:flag suffix="FREQ_2GHZ" value="0x200">
+ <tp:docstring>
+ The device supports 2.4GHz frequencies.
+ </tp:docstring>
+ </tp:flag>
+ <tp:flag suffix="FREQ_5GHZ" value="0x400">
+ <tp:docstring>
+ The device supports 5GHz frequencies.
+ </tp:docstring>
+ </tp:flag>
</tp:flags>
</interface>
</node>
* @NM_WIFI_DEVICE_CAP_RSN: device supports WPA2/RSN authentication
* @NM_WIFI_DEVICE_CAP_AP: device supports Access Point mode
* @NM_WIFI_DEVICE_CAP_ADHOC: device supports Ad-Hoc mode
+ * @NM_WIFI_DEVICE_CAP_FREQ_VALID: device reports frequency capabilities
+ * @NM_WIFI_DEVICE_CAP_FREQ_2GHZ: device supports 2.4GHz frequencies
+ * @NM_WIFI_DEVICE_CAP_FREQ_5GHZ: device supports 5GHz frequencies
*
* 802.11 specific device encryption and authentication capabilities.
*
NM_WIFI_DEVICE_CAP_WPA = 0x00000010,
NM_WIFI_DEVICE_CAP_RSN = 0x00000020,
NM_WIFI_DEVICE_CAP_AP = 0x00000040,
- NM_WIFI_DEVICE_CAP_ADHOC = 0x00000080
+ NM_WIFI_DEVICE_CAP_ADHOC = 0x00000080,
+ NM_WIFI_DEVICE_CAP_FREQ_VALID = 0x00000100,
+ NM_WIFI_DEVICE_CAP_FREQ_2GHZ = 0x00000200,
+ NM_WIFI_DEVICE_CAP_FREQ_5GHZ = 0x00000400,
} NMDeviceWifiCapabilities;
* @NM_WIFI_DEVICE_CAP_RSN: device supports WPA2/RSN authentication
* @NM_WIFI_DEVICE_CAP_AP: device supports Access Point mode
* @NM_WIFI_DEVICE_CAP_ADHOC: device supports Ad-Hoc mode
+ * @NM_WIFI_DEVICE_CAP_FREQ_VALID: device reports frequency capabilities
+ * @NM_WIFI_DEVICE_CAP_FREQ_2GHZ: device supports 2.4GHz frequencies
+ * @NM_WIFI_DEVICE_CAP_FREQ_5GHZ: device supports 5GHz frequencies
*
* 802.11 specific device encryption and authentication capabilities.
*
NM_WIFI_DEVICE_CAP_WPA = 0x00000010,
NM_WIFI_DEVICE_CAP_RSN = 0x00000020,
NM_WIFI_DEVICE_CAP_AP = 0x00000040,
- NM_WIFI_DEVICE_CAP_ADHOC = 0x00000080
+ NM_WIFI_DEVICE_CAP_ADHOC = 0x00000080,
+ NM_WIFI_DEVICE_CAP_FREQ_VALID = 0x00000100,
+ NM_WIFI_DEVICE_CAP_FREQ_2GHZ = 0x00000200,
+ NM_WIFI_DEVICE_CAP_FREQ_5GHZ = 0x00000400,
} NMDeviceWifiCapabilities;
}
}
+ /* Find number of supported frequencies */
info->num_freqs = 0;
nla_for_each_nested (nl_band, tb[NL80211_ATTR_WIPHY_BANDS], rem_band) {
}
}
+ /* Read supported frequencies */
info->freqs = g_malloc0 (sizeof (guint32) * info->num_freqs);
freq_idx = 0;
info->freqs[freq_idx] =
nla_get_u32 (tb_freq[NL80211_FREQUENCY_ATTR_FREQ]);
+
+ info->caps |= NM_WIFI_DEVICE_CAP_FREQ_VALID;
+
+ 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;
guint32 response_len = 0;
struct iw_range_with_scan_capa *scan_capa_range;
int i;
+ gboolean freq_valid = FALSE, has_5ghz = FALSE, has_2ghz = FALSE;
wext = wifi_data_new (iface, ifindex, sizeof (*wext));
wext->parent.get_mode = wifi_wext_get_mode;
wext->max_qual.updated = range.max_qual.updated;
wext->num_freqs = MIN (range.num_frequency, IW_MAX_FREQUENCIES);
- for (i = 0; i < wext->num_freqs; i++)
+ for (i = 0; i < wext->num_freqs; i++) {
wext->freqs[i] = iw_freq_to_uint32 (&range.freq[i]);
+ freq_valid = TRUE;
+ if (wext->freqs[i] > 2400 && wext->freqs[i] < 2500)
+ has_2ghz = TRUE;
+ else if (wext->freqs[i] > 4900 && wext->freqs[i] < 6000)
+ has_5ghz = TRUE;
+ }
/* Check for scanning capability; cards that can't scan are not supported */
if (check_scan && (wext_can_scan (wext) == FALSE)) {
}
wext->parent.caps = wext_get_caps (wext, &range);
+ if (freq_valid)
+ wext->parent.caps |= NM_WIFI_DEVICE_CAP_FREQ_VALID;
+ if (has_2ghz)
+ wext->parent.caps |= NM_WIFI_DEVICE_CAP_FREQ_2GHZ;
+ if (has_5ghz)
+ wext->parent.caps |= NM_WIFI_DEVICE_CAP_FREQ_5GHZ;
nm_log_info (LOGD_HW | LOGD_WIFI,
"(%s): using WEXT for WiFi device control",
/* Returns frequency in MHz */
guint32 wifi_utils_get_freq (WifiData *data);
-/* Return the first supported frequency in the zero-terminated list */
+/* Return the first supported frequency in the zero-terminated list.
+ * Frequencies are specified in MHz. */
guint32 wifi_utils_find_freq (WifiData *data, const guint32 *freqs);
/* Caller must free returned byte array */