diff options
author | Thomas Haller <thaller@redhat.com> | 2016-09-12 12:17:17 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-09-12 18:03:47 +0200 |
commit | b122337353fb31b3837b5c252bac807a38a59aeb (patch) | |
tree | 6b0d600747141629249acc21b9f1ad12aa1b1ab7 | |
parent | 042f2b2e7e57b5630d823f6abdc77075e9c0a394 (diff) | |
download | NetworkManager-b122337353fb31b3837b5c252bac807a38a59aeb.tar.gz |
device: implement get_enabled() for NMDeviceWifi
The virtual function NMDevice:set_enabled() has two implementations:
NMDeviceModem and NMDeviceWifi. Likewise, the get_enabled() function
should also be implemented by those types.
The only caller of nm_device_get_enabled() is NMPolicy:schedule_activate_check().
It is correct to skip Wi-Fi devices based on their enabled state.
-rw-r--r-- | src/devices/wifi/nm-device-wifi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 14d4c84a0c..c7771addf8 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -2945,6 +2945,12 @@ device_state_changed (NMDevice *device, remove_all_aps (self); } +static gboolean +get_enabled (NMDevice *device) +{ + return NM_DEVICE_WIFI_GET_PRIVATE ((NMDeviceWifi *) device)->enabled; +} + static void set_enabled (NMDevice *device, gboolean enabled) { @@ -3138,6 +3144,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass) parent_class->check_connection_compatible = check_connection_compatible; parent_class->check_connection_available = check_connection_available; parent_class->complete_connection = complete_connection; + parent_class->get_enabled = get_enabled; parent_class->set_enabled = set_enabled; parent_class->act_stage1_prepare = act_stage1_prepare; |