rtlwifi: Fix endian error in extracting packet type
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sat, 2 Nov 2013 19:28:35 +0000 (14:28 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 3 Jan 2014 04:33:19 +0000 (04:33 +0000)
commit8e1028cb190c079976dd2dd8af63142ba28fc532
tree9df28cc9d45647df44d3fd60fcc8d60a505fe5b1
parentd0086d127275aa318344fff8d92984af5335fba9
rtlwifi: Fix endian error in extracting packet type

commit 0c5d63f0ab6728f05ddefa25aff55e31297f95e6 upstream.

All of the rtlwifi drivers have an error in the routine that tests if
the data is "special". If it is, the subsequant transmission will be
at the lowest rate to enhance reliability. The 16-bit quantity is
big-endian, but was being extracted in native CPU mode. One of the
effects of this bug is to inhibit association under some conditions
as the TX rate is too high.

Based on suggestions by Joe Perches, the entire routine is rewritten.

One of the local headers contained duplicates of some of the ETH_P_XXX
definitions. These are deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust context; use rtl_lps_leave()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/rtlwifi/base.c
drivers/net/wireless/rtlwifi/wifi.h