Commit b71b1e66 authored by Dan Williams's avatar Dan Williams

rfkill: fix mixed-up soft/hard kill states

parent 904e7f39
......@@ -2379,28 +2379,28 @@ void
nm_manager_start (NMManager *self)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
gboolean enabled;
gboolean we = FALSE;
switch (nm_udev_manager_get_rfkill_state (priv->udev_mgr)) {
case RFKILL_UNBLOCKED:
priv->wireless_enabled = TRUE;
we = TRUE;
priv->wireless_hw_enabled = TRUE;
break;
case RFKILL_SOFT_BLOCKED:
priv->wireless_enabled = FALSE;
we = FALSE;
priv->wireless_hw_enabled = TRUE;
break;
case RFKILL_HARD_BLOCKED:
priv->wireless_enabled = FALSE;
we = FALSE;
priv->wireless_hw_enabled = FALSE;
break;
default:
break;
}
enabled = (priv->wireless_enabled && priv->wireless_hw_enabled);
nm_info ("Wireless now %s by radio killswitch", enabled ? "enabled" : "disabled");
manager_set_wireless_enabled (self, enabled);
nm_info ("Wireless now %s by radio killswitch",
(priv->wireless_hw_enabled && we) ? "enabled" : "disabled");
manager_set_wireless_enabled (self, we);
system_unmanaged_devices_changed_cb (priv->sys_settings, NULL, self);
system_hostname_changed_cb (priv->sys_settings, NULL, self);
......
......@@ -129,11 +129,11 @@ sysfs_state_to_nm_state (gint sysfs_state)
{
switch (sysfs_state) {
case 0:
return RFKILL_HARD_BLOCKED;
return RFKILL_SOFT_BLOCKED;
case 1:
return RFKILL_UNBLOCKED;
case 2:
return RFKILL_SOFT_BLOCKED;
return RFKILL_HARD_BLOCKED;
default:
g_warning ("%s: Unhandled rfkill state %d", __func__, sysfs_state);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment