wifi: log ipw killswitch changes

This commit is contained in:
Dan Williams 2010-04-07 14:55:29 -07:00
parent df04e3f66c
commit 71bdbf9c25

View file

@ -269,6 +269,7 @@ nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self)
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
char *contents = NULL;
RfKillState state = RFKILL_UNBLOCKED;
const char *str_state = NULL;
if ( priv->ipw_rfkill_path
&& g_file_get_contents (priv->ipw_rfkill_path, &contents, NULL, NULL)) {
@ -282,16 +283,23 @@ nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self)
switch (contents[0]) {
case '1':
state = RFKILL_SOFT_BLOCKED;
str_state = "soft-blocked";
break;
case '2':
case '3':
state = RFKILL_HARD_BLOCKED;
str_state = "hard-blocked";
break;
case '0':
str_state = "unblocked";
default:
break;
}
g_free (contents);
nm_log_dbg (LOGD_RFKILL, "(%s): ipw rfkill state '%s'",
nm_device_get_iface (NM_DEVICE (self)),
str_state ? str_state : "(unknown)");
}
return state;