Commit 69d8597e authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo

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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 89d32c90
...@@ -477,14 +477,14 @@ static void _rtl_fill_usb_tx_desc(u8 *txdesc) ...@@ -477,14 +477,14 @@ static void _rtl_fill_usb_tx_desc(u8 *txdesc)
*/ */
static void _rtl_tx_desc_checksum(u8 *txdesc) static void _rtl_tx_desc_checksum(u8 *txdesc)
{ {
u16 *ptr = (u16 *)txdesc; __le16 *ptr = (__le16 *)txdesc;
u16 checksum = 0; u16 checksum = 0;
u32 index; u32 index;
/* Clear first */ /* Clear first */
SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0);
for (index = 0; index < 16; index++) 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); SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment