]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8821ae: fix invalid bit mask on MSR_AP check
authorLevente Kurusa <levex@linux.com>
Fri, 14 Feb 2014 21:50:23 +0000 (22:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Feb 2014 20:32:55 +0000 (12:32 -0800)
Since MSR_AP is 0x3, ANDing it with 0xFC will never be true.
Add a NOT operation to 0xFC so that we will AND with the last
three bits which will result in a possibility that the condition
will succeed.

Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8821ae/rtl8821ae/hw.c

index e8344be923444c8808f25ef132c9d0d181679f53..d3e9b93400bffd8c4b95ca880ca8e09f1fb0d633 100644 (file)
@@ -1623,7 +1623,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
 
        rtl_write_byte(rtlpriv, (MSR), bt_msr);
        rtlpriv->cfg->ops->led_control(hw, ledaction);
-       if ((bt_msr & 0xfc) == MSR_AP)
+       if ((bt_msr & ~0xfc) == MSR_AP)
                rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00);
        else
                rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66);