summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/cw1200/txrx.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2013-06-21 07:03:12 +0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-24 22:44:24 +0400
commit7258416c517c79b2ebb30b61d8c6807a04dc6b25 (patch)
tree6c547d02cdbc49bbc2ce8d3824d83cd14c71a15b /drivers/net/wireless/cw1200/txrx.c
parent5d9e3bc21c57d600b706a31454d5cf2f68c24f53 (diff)
downloadlinux-7258416c517c79b2ebb30b61d8c6807a04dc6b25.tar.xz
cw1200: Fix up a large pile of sparse warnings
Most of these relate to endianness problems, and are purely cosmetic. But a couple of them were legit -- listen interval parsing and some of the rate selection code would malfunction on BE systems. There's still one cosmetic warning remaining, in the (admittedly) ugly code in cw1200_spi.c. It's there because the hardware needs 16-bit SPI transfers, but many SPI controllers only operate 8 bits at a time. If there's a cleaner way of handling this, I'm all ears. Signed-off-by: Solomon Peachy <pizza@shaftnet.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/cw1200/txrx.c')
-rw-r--r--drivers/net/wireless/cw1200/txrx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c
index 44ca10cb0d39..5862c373d714 100644
--- a/drivers/net/wireless/cw1200/txrx.c
+++ b/drivers/net/wireless/cw1200/txrx.c
@@ -599,15 +599,15 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
} else if (ieee80211_is_data(t->hdr->frame_control)) {
/* Skip LLC SNAP header (+6) */
u8 *payload = &t->skb->data[t->hdrlen];
- u16 *ethertype = (u16 *)&payload[6];
- if (*ethertype == __be16_to_cpu(ETH_P_PAE))
+ __be16 *ethertype = (__be16 *)&payload[6];
+ if (be16_to_cpu(*ethertype) == ETH_P_PAE)
priority = WSM_EPTA_PRIORITY_EAPOL;
} else if (ieee80211_is_assoc_req(t->hdr->frame_control) ||
ieee80211_is_reassoc_req(t->hdr->frame_control)) {
struct ieee80211_mgmt *mgt_frame =
(struct ieee80211_mgmt *)t->hdr;
- if (mgt_frame->u.assoc_req.listen_interval <
+ if (le16_to_cpu(mgt_frame->u.assoc_req.listen_interval) <
priv->listen_interval) {
pr_debug("Modified Listen Interval to %d from %d\n",
priv->listen_interval,
@@ -615,8 +615,7 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
/* Replace listen interval derieved from
* the one read from SDD
*/
- mgt_frame->u.assoc_req.listen_interval =
- priv->listen_interval;
+ mgt_frame->u.assoc_req.listen_interval = cpu_to_le16(priv->listen_interval);
}
}