diff options
| author | Michael Biebl <biebl@debian.org> | 2015-07-14 19:38:58 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-07-14 19:38:58 +0200 |
| commit | 50a58f0fabd8a34c1b6108a107e08abe3c1ccd24 (patch) | |
| tree | 6790165f39daee79e2b6c6617483320613493367 /src/devices/nm-device-generic.c | |
| parent | f408e27bccfacf347605a8d98649975a68f38a17 (diff) | |
Imported Upstream version 1.0.4 upstream/1.0.4
Diffstat (limited to 'src/devices/nm-device-generic.c')
| -rw-r--r-- | src/devices/nm-device-generic.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/devices/nm-device-generic.c b/src/devices/nm-device-generic.c index f103ef83..5841d834 100644 --- a/src/devices/nm-device-generic.c +++ b/src/devices/nm-device-generic.c @@ -45,15 +45,23 @@ enum { LAST_PROP }; -static guint32 +static NMDeviceCapabilities get_generic_capabilities (NMDevice *dev) { - if (nm_platform_link_supports_carrier_detect (nm_device_get_ifindex (dev))) + if (nm_platform_link_supports_carrier_detect (NM_PLATFORM_GET, nm_device_get_ifindex (dev))) return NM_DEVICE_CAP_CARRIER_DETECT; else return NM_DEVICE_CAP_NONE; } +static const char * +get_type_description (NMDevice *device) +{ + if (NM_DEVICE_GENERIC_GET_PRIVATE (device)->type_description) + return NM_DEVICE_GENERIC_GET_PRIVATE (device)->type_description; + return NM_DEVICE_CLASS (nm_device_generic_parent_class)->get_type_description (device); +} + static gboolean check_connection_compatible (NMDevice *device, NMConnection *connection) { @@ -117,7 +125,7 @@ constructed (GObject *object) int ifindex = nm_device_get_ip_ifindex (NM_DEVICE (self)); if (ifindex != 0) - priv->type_description = g_strdup (nm_platform_link_get_type_name (ifindex)); + priv->type_description = g_strdup (nm_platform_link_get_type_name (NM_PLATFORM_GET, ifindex)); } G_OBJECT_CLASS (nm_device_generic_parent_class)->constructed (object); @@ -184,6 +192,7 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass) object_class->set_property = set_property; parent_class->get_generic_capabilities = get_generic_capabilities; + parent_class->get_type_description = get_type_description; parent_class->check_connection_compatible = check_connection_compatible; parent_class->update_connection = update_connection; |