]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rtlwifi: Fix alignment issues
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 28 Dec 2016 21:40:04 +0000 (15:40 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 30 Dec 2016 13:56:53 +0000 (15:56 +0200)
The addresses of Wlan NIC registers are natural alignment, but some
drivers have bugs. These are evident on platforms that need natural
alignment to access registers.  This change contains the following:
 1. Function _rtl8821ae_dbi_read() is used to read one byte from DBI,
    thus it should use rtl_read_byte().
 2. Register 0x4C7 of 8192ee is single byte.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c

index f731f962ccbb55a7c159e06efb5d2e09e6cc2239..b44244a8a22f7384a2272fe24d7f9c93241548d6 100644 (file)
@@ -1006,7 +1006,7 @@ static void _rtl92ee_hw_configure(struct ieee80211_hw *hw)
        rtl_write_word(rtlpriv, REG_SIFS_TRX, 0x100a);
 
        /* Note Data sheet don't define */
-       rtl_write_word(rtlpriv, 0x4C7, 0x80);
+       rtl_write_byte(rtlpriv, 0x4C7, 0x80);
 
        rtl_write_byte(rtlpriv, REG_RX_PKT_LIMIT, 0x20);
 
index a4e37e764563c71b01e0b89f034a2c4fdb39d971..4f83eee1ff75bc818e1f598491c112dfcf94a75a 100644 (file)
@@ -1127,7 +1127,7 @@ static u8 _rtl8821ae_dbi_read(struct rtl_priv *rtlpriv, u16 addr)
        }
        if (0 == tmp) {
                read_addr = REG_DBI_RDATA + addr % 4;
-               ret = rtl_read_word(rtlpriv, read_addr);
+               ret = rtl_read_byte(rtlpriv, read_addr);
        }
        return ret;
 }