diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 3522dd25e5..4755f304bf 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -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; diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index ffa83f71b8..dcdf440925 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -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); diff --git a/src/wifi-utils-nl80211.c b/src/wifi-utils-nl80211.c index ee2068001d..614abd35c6 100644 --- a/src/wifi-utils-nl80211.c +++ b/src/wifi-utils-nl80211.c @@ -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;