diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2017-01-19 23:28:07 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-01-20 13:06:09 +0300 |
commit | 69d8597e9fe5ca76da8ad18245d51af96cf8457a (patch) | |
tree | 8534838b3f14a4c0e71d062d1bb02e9dfd83375b /drivers/net/wireless/realtek/rtlwifi/rtl8192cu | |
parent | 89d32c9071aacdd7f631c36ff9c7d3403229d568 (diff) | |
download | linux-69d8597e9fe5ca76da8ad18245d51af96cf8457a.tar.xz |
rtlwifi: rtl8192cu: Calculate descriptor checksum correctly for BE
This driver requires a checksum for the descriptors so that the wifi
chip is assured that the USB transmission was correct. These entries
are little-endian, but the driver was always using cpu order in the
calculation. As a result, the driver failed on BE hardware.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/rtl8192cu')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c index 6da6e2acfbec..1611e42479d9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c @@ -477,14 +477,14 @@ static void _rtl_fill_usb_tx_desc(u8 *txdesc) */ static void _rtl_tx_desc_checksum(u8 *txdesc) { - u16 *ptr = (u16 *)txdesc; + __le16 *ptr = (__le16 *)txdesc; u16 checksum = 0; u32 index; /* Clear first */ SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); for (index = 0; index < 16; index++) - checksum = checksum ^ (*(ptr + index)); + checksum = checksum ^ le16_to_cpu(*(ptr + index)); SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum); } |