From e4a3805e29bd1876e9b80836696267901a5e6260 Mon Sep 17 00:00:00 2001 From: Hisham Date: Wed, 16 Nov 2016 17:11:08 -0200 Subject: [PATCH] Unblock RF kill switch in some laptops. Some laptops have a hardware button for enabling/disabling wifi (which is sometimes a soft-key) and this button may get "stuck" in an off position depending on driver initialization. Running `rfkill unblock all` unblocks the wifi radio kill switch and enables the other operations to work. --- src/gobonet_backend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gobonet_backend.c b/src/gobonet_backend.c index a8e963b..ab6362d 100644 --- a/src/gobonet_backend.c +++ b/src/gobonet_backend.c @@ -82,6 +82,7 @@ static int const ifconfig(char const *const interface, char const *const mode) { static int const disconnect(char const *const interface) { if (ifconfig(interface, NULL) != 0) return 1; + run(GOBONET_RFKILL, "unblock", "all", NULL); char const *const wpa_supplicant = base_name(GOBONET_WPA_SUPPLICANT); char const *const dhcpcd = base_name(GOBONET_DHCPCD); if ((!wpa_supplicant) || (!dhcpcd)) { @@ -101,6 +102,7 @@ static int const connect(char const *const config, char const *const interface) } static int const scan() { + run(GOBONET_RFKILL, "unblock", "all", NULL); return run(GOBONET_IWLIST, "scan", NULL); }