From 63cbff08756cb63160f3092a20fb6a5f2bfce60c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Oct 2015 20:02:40 -0500 Subject: [PATCH] trivial: wifi/supplicant: change ApSupport to NMSupplicantFeature --- src/devices/wifi/nm-device-wifi.c | 4 ++-- .../nm-supplicant-interface.c | 12 +++++------ .../nm-supplicant-interface.h | 14 ++++++------- .../nm-supplicant-manager.c | 20 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 0eeb8459ce..3ba532dd6d 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -628,7 +628,7 @@ check_connection_compatible (NMDevice *device, NMConnection *connection) return FALSE; if (priv->sup_iface) { - if (nm_supplicant_interface_get_ap_support (priv->sup_iface) == AP_SUPPORT_NO) + if (nm_supplicant_interface_get_ap_support (priv->sup_iface) == NM_SUPPLICANT_FEATURE_NO) return FALSE; } } @@ -2213,7 +2213,7 @@ build_supplicant_config (NMDeviceWifi *self, /* Warn if AP mode may not be supported */ if ( g_strcmp0 (nm_setting_wireless_get_mode (s_wireless), NM_SETTING_WIRELESS_MODE_AP) == 0 - && nm_supplicant_interface_get_ap_support (priv->sup_iface) == AP_SUPPORT_UNKNOWN) { + && nm_supplicant_interface_get_ap_support (priv->sup_iface) == NM_SUPPLICANT_FEATURE_UNKNOWN) { _LOGW (LOGD_WIFI, "Supplicant may not support AP mode; connection may time out."); } diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 38eaabcb43..406449e35e 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -71,7 +71,7 @@ typedef struct { char * dev; gboolean is_wireless; gboolean has_credreq; /* Whether querying 802.1x credentials is supported */ - ApSupport ap_support; /* Lightweight AP mode support */ + NMSupplicantFeature ap_support; /* Lightweight AP mode support */ gboolean fast_supported; guint32 max_scan_ssids; guint32 ready_count; @@ -461,7 +461,7 @@ iface_check_netreply_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_ iface_check_ready (self); } -ApSupport +NMSupplicantFeature nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self) { return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->ap_support; @@ -469,7 +469,7 @@ nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self) void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self, - ApSupport ap_support) + NMSupplicantFeature ap_support) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); @@ -502,7 +502,7 @@ iface_check_ap_mode_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_d if (variant) { g_variant_get (variant, "(&s)", &data); if (strstr (data, "ProbeRequest")) - priv->ap_support = AP_SUPPORT_YES; + priv->ap_support = NM_SUPPLICANT_FEATURE_YES; } iface_check_ready (self); @@ -714,7 +714,7 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_ (GAsyncReadyCallback) iface_check_netreply_cb, self); - if (priv->ap_support == AP_SUPPORT_UNKNOWN) { + if (priv->ap_support == NM_SUPPLICANT_FEATURE_UNKNOWN) { /* If the global supplicant capabilities property is not present, we can * fall back to checking whether the ProbeRequest method is supported. If * neither of these works we have no way of determining if AP mode is @@ -1330,7 +1330,7 @@ NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname, gboolean is_wireless, gboolean fast_supported, - ApSupport ap_support, + NMSupplicantFeature ap_support, gboolean start_now) { NMSupplicantInterface *self; diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 79c88dabaa..46de7c6fd2 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -68,10 +68,10 @@ enum { #define NM_SUPPLICANT_INTERFACE_CREDENTIALS_REQUEST "credentials-request" typedef enum { - AP_SUPPORT_UNKNOWN = 0, /* Can't detect whether supported or not */ - AP_SUPPORT_NO = 1, /* AP mode definitely not supported */ - AP_SUPPORT_YES = 2, /* AP mode definitely supported */ -} ApSupport; + NM_SUPPLICANT_FEATURE_UNKNOWN = 0, /* Can't detect whether supported or not */ + NM_SUPPLICANT_FEATURE_NO = 1, /* Feature definitely not supported */ + NM_SUPPLICANT_FEATURE_YES = 2, /* Feature definitely supported */ +} NMSupplicantFeature; struct _NMSupplicantInterface { GObject parent; @@ -125,7 +125,7 @@ GType nm_supplicant_interface_get_type (void); NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname, gboolean is_wireless, gboolean fast_supported, - ApSupport ap_support, + NMSupplicantFeature ap_support, gboolean start_now); void nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self, @@ -163,9 +163,9 @@ gboolean nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self, const char *value, GError **error); -ApSupport nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self); +NMSupplicantFeature nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self); void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self, - ApSupport apmode); + NMSupplicantFeature apmode); #endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index 8afddeec7f..5fd1758438 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -39,11 +39,11 @@ typedef struct { GCancellable * cancellable; gboolean running; - GHashTable * ifaces; - gboolean fast_supported; - ApSupport ap_support; - guint die_count_reset_id; - guint die_count; + GHashTable * ifaces; + gboolean fast_supported; + NMSupplicantFeature ap_support; + guint die_count_reset_id; + guint die_count; } NMSupplicantManagerPrivate; /********************************************************************/ @@ -146,15 +146,15 @@ update_capabilities (NMSupplicantManager *self) * * dbus: Add global capabilities property */ - priv->ap_support = AP_SUPPORT_UNKNOWN; + priv->ap_support = NM_SUPPLICANT_FEATURE_UNKNOWN; value = g_dbus_proxy_get_cached_property (priv->proxy, "Capabilities"); if (value) { if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) { array = g_variant_get_strv (value, NULL); - priv->ap_support = AP_SUPPORT_NO; + priv->ap_support = NM_SUPPLICANT_FEATURE_NO; if (_nm_utils_string_in_list ("ap", array)) - priv->ap_support = AP_SUPPORT_YES; + priv->ap_support = NM_SUPPLICANT_FEATURE_YES; g_free (array); } g_variant_unref (value); @@ -166,8 +166,8 @@ update_capabilities (NMSupplicantManager *self) nm_supplicant_interface_set_ap_support (iface, priv->ap_support); nm_log_dbg (LOGD_SUPPLICANT, "AP mode is %ssupported", - (priv->ap_support == AP_SUPPORT_YES) ? "" : - (priv->ap_support == AP_SUPPORT_NO) ? "not " : "possibly "); + (priv->ap_support == NM_SUPPLICANT_FEATURE_YES) ? "" : + (priv->ap_support == NM_SUPPLICANT_FEATURE_NO) ? "not " : "possibly "); /* EAP-FAST */ priv->fast_supported = FALSE;