summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-02-24 16:44:37 +0100
committerThomas Haller <thaller@redhat.com>2019-02-24 16:51:02 +0100
commitb8c895f6f023a9a85fe32973f0fd777e1f1024a4 (patch)
treed7373c6853444892bd58e7780efd497562ebc9a0
parent6c1c59d556756a7a1e76451e94c08297c160ed3b (diff)
downloadNetworkManager-th/wifi-p2p-type-description.tar.gz
libnm,core: fix device TYPE for Wi-Fi P2P devicesth/wifi-p2p-type-description
Don't use "wifip2p" for the type description. $ nmcli device DEVICE TYPE STATE CONNECTION wlan0 wifi connected x p2p-dev-wlan0 wifip2p disconnected --
-rw-r--r--libnm/nm-device-ovs-port.c1
-rw-r--r--libnm/nm-device-wifi-p2p.c7
-rw-r--r--src/devices/wifi/nm-device-wifi-p2p.c43
3 files changed, 34 insertions, 17 deletions
diff --git a/libnm/nm-device-ovs-port.c b/libnm/nm-device-ovs-port.c
index 39ecaee599..49cf11cc3c 100644
--- a/libnm/nm-device-ovs-port.c
+++ b/libnm/nm-device-ovs-port.c
@@ -75,6 +75,7 @@ get_type_description (NMDevice *device)
{
return "ovs-port";
}
+
static gboolean
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
{
diff --git a/libnm/nm-device-wifi-p2p.c b/libnm/nm-device-wifi-p2p.c
index 8124d7746c..013977389b 100644
--- a/libnm/nm-device-wifi-p2p.c
+++ b/libnm/nm-device-wifi-p2p.c
@@ -342,6 +342,12 @@ get_hw_address (NMDevice *device)
return nm_device_wifi_p2p_get_hw_address (NM_DEVICE_WIFI_P2P (device));
}
+static const char *
+get_type_description (NMDevice *device)
+{
+ return "wifi-p2p";
+}
+
/*****************************************************************************/
static void
@@ -426,6 +432,7 @@ nm_device_wifi_p2p_class_init (NMDeviceWifiP2PClass *wifi_class)
device_class->connection_compatible = connection_compatible;
device_class->get_setting_type = get_setting_type;
device_class->get_hw_address = get_hw_address;
+ device_class->get_type_description = get_type_description;
nm_object_class->init_dbus = init_dbus;
diff --git a/src/devices/wifi/nm-device-wifi-p2p.c b/src/devices/wifi/nm-device-wifi-p2p.c
index d68e84d141..a429539642 100644
--- a/src/devices/wifi/nm-device-wifi-p2p.c
+++ b/src/devices/wifi/nm-device-wifi-p2p.c
@@ -1154,6 +1154,14 @@ nm_device_wifi_p2p_remove (NMDeviceWifiP2P* self)
/*****************************************************************************/
+static const char *
+get_type_description (NMDevice *device)
+{
+ return "wifi-p2p";
+}
+
+/*****************************************************************************/
+
static const GDBusSignalInfo nm_signal_info_wifi_p2p_peer_added = NM_DEFINE_GDBUS_SIGNAL_INFO_INIT (
"PeerAdded",
.args = NM_DEFINE_GDBUS_ARG_INFOS (
@@ -1286,33 +1294,34 @@ nm_device_wifi_p2p_class_init (NMDeviceWifiP2PClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- object_class->constructed = constructed;
+ object_class->constructed = constructed;
object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
+ object_class->dispose = dispose;
+ object_class->finalize = finalize;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_wifi_p2p);
- device_class->connection_type_supported = NM_SETTING_WIFI_P2P_SETTING_NAME;
+ device_class->connection_type_supported = NM_SETTING_WIFI_P2P_SETTING_NAME;
device_class->connection_type_check_compatible = NM_SETTING_WIFI_P2P_SETTING_NAME;
- device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (NM_LINK_TYPE_WIFI_P2P);
+ device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (NM_LINK_TYPE_WIFI_P2P);
+ device_class->get_type_description = get_type_description;
/* Do we need compatibility checking or is the default good enough? */
- device_class->is_available = is_available;
- device_class->check_connection_compatible = check_connection_compatible;
- device_class->complete_connection = complete_connection;
+ device_class->is_available = is_available;
+ device_class->check_connection_compatible = check_connection_compatible;
+ device_class->complete_connection = complete_connection;
- device_class->act_stage1_prepare = act_stage1_prepare;
- device_class->act_stage2_config = act_stage2_config;
- device_class->get_configured_mtu = get_configured_mtu;
- device_class->get_auto_ip_config_method = get_auto_ip_config_method;
- device_class->act_stage3_ip4_config_start = act_stage3_ip4_config_start;
- device_class->act_stage3_ip6_config_start = act_stage3_ip6_config_start;
+ device_class->act_stage1_prepare = act_stage1_prepare;
+ device_class->act_stage2_config = act_stage2_config;
+ device_class->get_configured_mtu = get_configured_mtu;
+ device_class->get_auto_ip_config_method = get_auto_ip_config_method;
+ device_class->act_stage3_ip4_config_start = act_stage3_ip4_config_start;
+ device_class->act_stage3_ip6_config_start = act_stage3_ip6_config_start;
- device_class->deactivate = deactivate;
- device_class->unmanaged_on_quit = unmanaged_on_quit;
+ device_class->deactivate = deactivate;
+ device_class->unmanaged_on_quit = unmanaged_on_quit;
- device_class->state_changed = device_state_changed;
+ device_class->state_changed = device_state_changed;
obj_properties[PROP_PEERS] =
g_param_spec_boxed (NM_DEVICE_WIFI_P2P_PEERS, "", "",