rtlwifi: Download firmware as bytes rather than as dwords
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 19 Jan 2017 20:28:06 +0000 (14:28 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 20 Jan 2017 10:06:09 +0000 (12:06 +0200)
commit89d32c9071aacdd7f631c36ff9c7d3403229d568
tree740148bebbdd542127a607e5d79504de2fc1a2b2
parent9336d376edf131e00ef986741afc134b114cfc37
rtlwifi: Download firmware as bytes rather than as dwords

The firmware is read from disk as a little-endian byte string. The code
that loads the firmware into the device transfers it as 4-byte quantities.
The routines that write multi-byte quantities on BE hardware assume that
the data are in CPU order, and automatically do the conversion to the LE
order required by the device. As a result, the firmware is transmitted
incorrectly. Rather than do multiple byte swaps on the data, the download
routine is revised to transmit bytes rather than dwords. Although the
number of I/O operations is increased, the firmware is not often loaded.

All drivers have the same bug, and use essentially the same code to
download firmware. These routines have been moved into rtlwifi.

Some CamelCase variables have been renamed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/efuse.c
drivers/net/wireless/realtek/rtlwifi/efuse.h
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.h
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c