brcmsmac: don't start device when RfKill is engaged
authorPiotr Haber <phaber@broadcom.com>
Wed, 19 Sep 2012 20:21:15 +0000 (22:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Sep 2012 19:02:06 +0000 (15:02 -0400)
This patch fixes a bug when device is being started
while RfKill switch is engaged, leading to hang
due to partial initialization of hardware.

Tested-by: <dragonn@op.pl>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

index 718da8d6d6583f1e148e9f927cbf912322007a0b..a744ea5a95599797023a0040401ab1816855f77f 100644 (file)
@@ -304,7 +304,10 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
        wl->mute_tx = true;
 
        if (!wl->pub->up)
-               err = brcms_up(wl);
+               if (!blocked)
+                       err = brcms_up(wl);
+               else
+                       err = -ERFKILL;
        else
                err = -ENODEV;
        spin_unlock_bh(&wl->lock);