mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 20:40:34 +01:00
wifi: check whether driver supports AP mode (nl80211 only)
For future use of wpa_supplicant's lightweight AP mode instead of using Ad-Hoc for hotspot stuff.
This commit is contained in:
parent
8faa032a27
commit
e9d998835b
3 changed files with 20 additions and 1 deletions
|
|
@ -141,6 +141,7 @@ typedef enum {
|
|||
* @NM_WIFI_DEVICE_CAP_CIPHER_CCMP: device supports AES/CCMP encryption
|
||||
* @NM_WIFI_DEVICE_CAP_WPA: device supports WPA1 authentication
|
||||
* @NM_WIFI_DEVICE_CAP_RSN: device supports WPA2/RSN authentication
|
||||
* @NM_WIFI_DEVICE_CAP_AP: device supports Access Point mode
|
||||
*
|
||||
* 802.11 specific device encryption and authentication capabilities.
|
||||
**/
|
||||
|
|
@ -152,7 +153,8 @@ typedef enum {
|
|||
NM_WIFI_DEVICE_CAP_CIPHER_TKIP = 0x00000004,
|
||||
NM_WIFI_DEVICE_CAP_CIPHER_CCMP = 0x00000008,
|
||||
NM_WIFI_DEVICE_CAP_WPA = 0x00000010,
|
||||
NM_WIFI_DEVICE_CAP_RSN = 0x00000020
|
||||
NM_WIFI_DEVICE_CAP_RSN = 0x00000020,
|
||||
NM_WIFI_DEVICE_CAP_AP = 0x00000040
|
||||
} NMDeviceWifiCapabilities;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -332,6 +332,11 @@ constructor (GType type,
|
|||
}
|
||||
priv->capabilities = wifi_utils_get_caps (priv->wifi_data);
|
||||
|
||||
if (priv->capabilities & NM_WIFI_DEVICE_CAP_AP) {
|
||||
nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): driver supports Access Point (AP) mode",
|
||||
nm_device_get_iface (NM_DEVICE (self)));
|
||||
}
|
||||
|
||||
/* Connect to the supplicant manager */
|
||||
priv->supplicant.mgr = nm_supplicant_manager_get ();
|
||||
g_assert (priv->supplicant.mgr);
|
||||
|
|
|
|||
|
|
@ -630,6 +630,18 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg)
|
|||
}
|
||||
}
|
||||
|
||||
if (tb[NL80211_ATTR_SUPPORTED_IFTYPES]) {
|
||||
struct nlattr *nl_mode;
|
||||
int i;
|
||||
|
||||
nla_for_each_nested (nl_mode, tb[NL80211_ATTR_SUPPORTED_IFTYPES], i) {
|
||||
if (nla_type (nl_mode) == NL80211_IFTYPE_AP) {
|
||||
info->caps |= NM_WIFI_DEVICE_CAP_AP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info->success = TRUE;
|
||||
|
||||
return NL_SKIP;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue