Skip to content

Commit

Permalink
Unblock RF kill switch in some laptops.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hishamhm committed Nov 16, 2016
1 parent ffcbdc0 commit e4a3805
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gobonet_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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);
}

Expand Down

0 comments on commit e4a3805

Please sign in to comment.