aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ieee80211.h6
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c22
-rw-r--r--net/ieee80211/ieee80211_rx.c2
-rw-r--r--net/ieee80211/ieee80211_tx.c14
4 files changed, 22 insertions, 22 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index d8ae48439f12..285b2adfa648 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -677,7 +677,7 @@ struct ieee80211_probe_request {
677 677
678struct ieee80211_probe_response { 678struct ieee80211_probe_response {
679 struct ieee80211_hdr_3addr header; 679 struct ieee80211_hdr_3addr header;
680 u32 time_stamp[2]; 680 __le32 time_stamp[2];
681 __le16 beacon_interval; 681 __le16 beacon_interval;
682 __le16 capability; 682 __le16 capability;
683 /* SSID, supported rates, FH params, DS params, 683 /* SSID, supported rates, FH params, DS params,
@@ -718,8 +718,8 @@ struct ieee80211_txb {
718 u8 encrypted; 718 u8 encrypted;
719 u8 rts_included; 719 u8 rts_included;
720 u8 reserved; 720 u8 reserved;
721 __le16 frag_size; 721 u16 frag_size;
722 __le16 payload_size; 722 u16 payload_size;
723 struct sk_buff *fragments[0]; 723 struct sk_buff *fragments[0];
724}; 724};
725 725
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index 8e146949fc6f..bba0152e2d71 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -189,7 +189,7 @@ static inline u16 Mk16(u8 hi, u8 lo)
189 return lo | (((u16) hi) << 8); 189 return lo | (((u16) hi) << 8);
190} 190}
191 191
192static inline u16 Mk16_le(u16 * v) 192static inline u16 Mk16_le(__le16 * v)
193{ 193{
194 return le16_to_cpu(*v); 194 return le16_to_cpu(*v);
195} 195}
@@ -275,15 +275,15 @@ static void tkip_mixing_phase2(u8 * WEPSeed, const u8 * TK, const u16 * TTAK,
275 PPK[5] = TTAK[4] + IV16; 275 PPK[5] = TTAK[4] + IV16;
276 276
277 /* Step 2 - 96-bit bijective mixing using S-box */ 277 /* Step 2 - 96-bit bijective mixing using S-box */
278 PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) & TK[0])); 278 PPK[0] += _S_(PPK[5] ^ Mk16_le((__le16 *) & TK[0]));
279 PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) & TK[2])); 279 PPK[1] += _S_(PPK[0] ^ Mk16_le((__le16 *) & TK[2]));
280 PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) & TK[4])); 280 PPK[2] += _S_(PPK[1] ^ Mk16_le((__le16 *) & TK[4]));
281 PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) & TK[6])); 281 PPK[3] += _S_(PPK[2] ^ Mk16_le((__le16 *) & TK[6]));
282 PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) & TK[8])); 282 PPK[4] += _S_(PPK[3] ^ Mk16_le((__le16 *) & TK[8]));
283 PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) & TK[10])); 283 PPK[5] += _S_(PPK[4] ^ Mk16_le((__le16 *) & TK[10]));
284 284
285 PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) & TK[12])); 285 PPK[0] += RotR1(PPK[5] ^ Mk16_le((__le16 *) & TK[12]));
286 PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) & TK[14])); 286 PPK[1] += RotR1(PPK[0] ^ Mk16_le((__le16 *) & TK[14]));
287 PPK[2] += RotR1(PPK[1]); 287 PPK[2] += RotR1(PPK[1]);
288 PPK[3] += RotR1(PPK[2]); 288 PPK[3] += RotR1(PPK[2]);
289 PPK[4] += RotR1(PPK[3]); 289 PPK[4] += RotR1(PPK[3]);
@@ -294,7 +294,7 @@ static void tkip_mixing_phase2(u8 * WEPSeed, const u8 * TK, const u16 * TTAK,
294 WEPSeed[0] = Hi8(IV16); 294 WEPSeed[0] = Hi8(IV16);
295 WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F; 295 WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F;
296 WEPSeed[2] = Lo8(IV16); 296 WEPSeed[2] = Lo8(IV16);
297 WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((u16 *) & TK[0])) >> 1); 297 WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((__le16 *) & TK[0])) >> 1);
298 298
299#ifdef __BIG_ENDIAN 299#ifdef __BIG_ENDIAN
300 { 300 {
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 0a18edbdfcb5..6a9c07f9b10f 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -754,7 +754,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
754 memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); 754 memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN);
755 memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); 755 memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN);
756 } else { 756 } else {
757 u16 len; 757 __be16 len;
758 /* Leave Ethernet header part of hdr and full payload */ 758 /* Leave Ethernet header part of hdr and full payload */
759 skb_pull(skb, hdrlen); 759 skb_pull(skb, hdrlen);
760 len = htons(skb->len); 760 len = htons(skb->len);
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index 6d06f1385e28..d8b02603cbe5 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -126,7 +126,7 @@ payload of each frame is reduced to 492 bytes.
126static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; 126static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
127static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; 127static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
128 128
129static int ieee80211_copy_snap(u8 * data, u16 h_proto) 129static int ieee80211_copy_snap(u8 * data, __be16 h_proto)
130{ 130{
131 struct ieee80211_snap_hdr *snap; 131 struct ieee80211_snap_hdr *snap;
132 u8 *oui; 132 u8 *oui;
@@ -136,7 +136,7 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto)
136 snap->ssap = 0xaa; 136 snap->ssap = 0xaa;
137 snap->ctrl = 0x03; 137 snap->ctrl = 0x03;
138 138
139 if (h_proto == 0x8137 || h_proto == 0x80f3) 139 if (h_proto == htons(ETH_P_AARP) || h_proto == htons(ETH_P_IPX))
140 oui = P802_1H_OUI; 140 oui = P802_1H_OUI;
141 else 141 else
142 oui = RFC1042_OUI; 142 oui = RFC1042_OUI;
@@ -144,7 +144,6 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto)
144 snap->oui[1] = oui[1]; 144 snap->oui[1] = oui[1];
145 snap->oui[2] = oui[2]; 145 snap->oui[2] = oui[2];
146 146
147 h_proto = htons(h_proto);
148 memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16)); 147 memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16));
149 148
150 return SNAP_SIZE + sizeof(u16); 149 return SNAP_SIZE + sizeof(u16);
@@ -261,7 +260,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
261 rts_required; 260 rts_required;
262 unsigned long flags; 261 unsigned long flags;
263 struct net_device_stats *stats = &ieee->stats; 262 struct net_device_stats *stats = &ieee->stats;
264 int ether_type, encrypt, host_encrypt, host_encrypt_msdu, host_build_iv; 263 int encrypt, host_encrypt, host_encrypt_msdu, host_build_iv;
264 __be16 ether_type;
265 int bytes, fc, hdr_len; 265 int bytes, fc, hdr_len;
266 struct sk_buff *skb_frag; 266 struct sk_buff *skb_frag;
267 struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */ 267 struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */
@@ -292,11 +292,11 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
292 goto success; 292 goto success;
293 } 293 }
294 294
295 ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); 295 ether_type = ((struct ethhdr *)skb->data)->h_proto;
296 296
297 crypt = ieee->crypt[ieee->tx_keyidx]; 297 crypt = ieee->crypt[ieee->tx_keyidx];
298 298
299 encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && 299 encrypt = !(ether_type == htons(ETH_P_PAE) && ieee->ieee802_1x) &&
300 ieee->sec.encrypt; 300 ieee->sec.encrypt;
301 301
302 host_encrypt = ieee->host_encrypt && encrypt && crypt; 302 host_encrypt = ieee->host_encrypt && encrypt && crypt;
@@ -304,7 +304,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
304 host_build_iv = ieee->host_build_iv && encrypt && crypt; 304 host_build_iv = ieee->host_build_iv && encrypt && crypt;
305 305
306 if (!encrypt && ieee->ieee802_1x && 306 if (!encrypt && ieee->ieee802_1x &&
307 ieee->drop_unencrypted && ether_type != ETH_P_PAE) { 307 ieee->drop_unencrypted && ether_type != htons(ETH_P_PAE)) {
308 stats->tx_dropped++; 308 stats->tx_dropped++;
309 goto success; 309 goto success;
310 } 310 }