rtlwifi: Fix alignment issues
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 28 Dec 2016 21:40:04 +0000 (15:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:37:30 +0000 (06:37 +0100)
commit 40b368af4b750863b2cb66a3a9513241db2f0793 upstream.

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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c

index 5f14308e8eb35e9914724ce8b610e14497dccef7..b1601441991d8ca861e6631c413fdfd8ce6fc00c 100644 (file)
@@ -1003,7 +1003,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 bbb789f8990b10944d0a8eed60c7700af2a4121e..c2103e7a8132039067039dec3646dda6b5ca676c 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;
 }