rtlwifi/rtl8192de: Fix media status register mask
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Mon, 23 Jun 2014 21:48:17 +0000 (23:48 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 25 Jun 2014 19:40:32 +0000 (15:40 -0400)
bt_msr & 0xfc will never match 0x3. Fix this by using a mask that actually matches the available types.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192de/hw.c
drivers/net/wireless/rtlwifi/rtl8192de/reg.h

index 2b08671004a0aa88b4c6ea270ebc4e7c8368aee6..280c3da42993dbd6154ba8c5ab9a6abbb5784d2d 100644 (file)
@@ -1128,7 +1128,7 @@ static int _rtl92de_set_media_status(struct ieee80211_hw *hw,
        }
        rtl_write_byte(rtlpriv, REG_CR + 2, bt_msr);
        rtlpriv->cfg->ops->led_control(hw, ledaction);
-       if ((bt_msr & 0xfc) == MSR_AP)
+       if ((bt_msr & MSR_MASK) == MSR_AP)
                rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00);
        else
                rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66);
index 7f29b8d765b37cf22e1a8cf362144d4229a2f583..315a298bab06a756525ef81ea14f66105e426f03 100644 (file)
 #define        MSR_ADHOC                       0x01
 #define        MSR_INFRA                       0x02
 #define        MSR_AP                          0x03
+#define        MSR_MASK                        0x03
 
 /* 6. Adaptive Control Registers  (Offset: 0x0160 - 0x01CF) */
 /* ----------------------------------------------------- */