rfkill: set kernel WiFi rfkill state to cached state on startup

Like we do when the user sets the Wireless Enabled property at
runtime, ensure the kernel's softblock state is synced with the
user's WiFi enable preference at startup.  This helps compensate
for BIOSes that don't save rfkill state over reboots and ensures
consistency of between startup and runtime Wireless Enabled
property behavior.

Suggested by John G.
This commit is contained in:
Dan Williams 2013-02-06 12:59:50 -06:00
parent 1bbcd696a4
commit 240f47c892

View file

@ -165,6 +165,8 @@ static GSList * remove_one_device (NMManager *manager,
NMDevice *device,
gboolean quitting);
static void rfkill_change_wifi (const char *desc, gboolean enabled);
#define SSD_POKE_INTERVAL 120
#define ORIGDEV_TAG "originating-device"
@ -4156,6 +4158,12 @@ nm_manager_new (NMSettings *settings,
G_CALLBACK (bluez_manager_bdaddr_removed_cb),
singleton);
/* Force kernel WiFi rfkill state to follow NM saved wifi state in case
* the BIOS doesn't save rfkill state, and to be consistent with user
* changes to the WirelessEnabled property which toggles kernel rfkill.
*/
rfkill_change_wifi (priv->radio_states[RFKILL_TYPE_WLAN].desc, initial_wifi_enabled);
return singleton;
}