aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jkmaline@cc.hut.fi>2005-08-14 22:08:43 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-14 23:07:30 -0400
commitc0f72ca8e4f1b459b5582c1c8dcaf7e53151f069 (patch)
tree4362f671ba43b48b73ac5378a1cb0954b407f09e
parent3ec0f4857df4c3dd0d0455ce5b2470b4be77fc77 (diff)
[PATCH] hostap: Replace hostap_ieee80211_hdr with ieee80211_hdr
Replace hostap-specific struct hostap_ieee80211_hdr with struct ieee80211_hdr from net/ieee80211.h. Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/wireless/hostap/hostap_80211.h11
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c60
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c36
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c99
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.h9
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c2
6 files changed, 98 insertions, 119 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211.h b/drivers/net/wireless/hostap/hostap_80211.h
index f3ad3445c72e..bf506f50d722 100644
--- a/drivers/net/wireless/hostap/hostap_80211.h
+++ b/drivers/net/wireless/hostap/hostap_80211.h
@@ -1,17 +1,6 @@
1#ifndef HOSTAP_80211_H 1#ifndef HOSTAP_80211_H
2#define HOSTAP_80211_H 2#define HOSTAP_80211_H
3 3
4struct hostap_ieee80211_hdr {
5 u16 frame_control;
6 u16 duration_id;
7 u8 addr1[6];
8 u8 addr2[6];
9 u8 addr3[6];
10 u16 seq_ctrl;
11 u8 addr4[6];
12} __attribute__ ((packed));
13
14
15struct hostap_ieee80211_mgmt { 4struct hostap_ieee80211_mgmt {
16 u16 frame_control; 5 u16 frame_control;
17 u16 duration; 6 u16 duration;
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index f4ca1e88f314..5363400a5da2 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -6,10 +6,10 @@
6void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, 6void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
7 struct hostap_80211_rx_status *rx_stats) 7 struct hostap_80211_rx_status *rx_stats)
8{ 8{
9 struct hostap_ieee80211_hdr *hdr; 9 struct ieee80211_hdr *hdr;
10 u16 fc; 10 u16 fc;
11 11
12 hdr = (struct hostap_ieee80211_hdr *) skb->data; 12 hdr = (struct ieee80211_hdr *) skb->data;
13 13
14 printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d " 14 printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d "
15 "jiffies=%ld\n", 15 "jiffies=%ld\n",
@@ -19,7 +19,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
19 if (skb->len < 2) 19 if (skb->len < 2)
20 return; 20 return;
21 21
22 fc = le16_to_cpu(hdr->frame_control); 22 fc = le16_to_cpu(hdr->frame_ctl);
23 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", 23 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
24 fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), 24 fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
25 fc & WLAN_FC_TODS ? " [ToDS]" : "", 25 fc & WLAN_FC_TODS ? " [ToDS]" : "",
@@ -31,7 +31,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
31 } 31 }
32 32
33 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 33 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
34 le16_to_cpu(hdr->seq_ctrl)); 34 le16_to_cpu(hdr->seq_ctl));
35 35
36 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, 36 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR,
37 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); 37 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3));
@@ -51,7 +51,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
51 int hdrlen, phdrlen, head_need, tail_need; 51 int hdrlen, phdrlen, head_need, tail_need;
52 u16 fc; 52 u16 fc;
53 int prism_header, ret; 53 int prism_header, ret;
54 struct hostap_ieee80211_hdr *hdr; 54 struct ieee80211_hdr *hdr;
55 55
56 iface = netdev_priv(dev); 56 iface = netdev_priv(dev);
57 local = iface->local; 57 local = iface->local;
@@ -70,8 +70,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
70 phdrlen = 0; 70 phdrlen = 0;
71 } 71 }
72 72
73 hdr = (struct hostap_ieee80211_hdr *) skb->data; 73 hdr = (struct ieee80211_hdr *) skb->data;
74 fc = le16_to_cpu(hdr->frame_control); 74 fc = le16_to_cpu(hdr->frame_ctl);
75 75
76 if (type == PRISM2_RX_MGMT && (fc & WLAN_FC_PVER)) { 76 if (type == PRISM2_RX_MGMT && (fc & WLAN_FC_PVER)) {
77 printk(KERN_DEBUG "%s: dropped management frame with header " 77 printk(KERN_DEBUG "%s: dropped management frame with header "
@@ -215,21 +215,21 @@ prism2_frag_cache_find(local_info_t *local, unsigned int seq,
215 215
216/* Called only as a tasklet (software IRQ) */ 216/* Called only as a tasklet (software IRQ) */
217static struct sk_buff * 217static struct sk_buff *
218prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr) 218prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr)
219{ 219{
220 struct sk_buff *skb = NULL; 220 struct sk_buff *skb = NULL;
221 u16 sc; 221 u16 sc;
222 unsigned int frag, seq; 222 unsigned int frag, seq;
223 struct prism2_frag_entry *entry; 223 struct prism2_frag_entry *entry;
224 224
225 sc = le16_to_cpu(hdr->seq_ctrl); 225 sc = le16_to_cpu(hdr->seq_ctl);
226 frag = WLAN_GET_SEQ_FRAG(sc); 226 frag = WLAN_GET_SEQ_FRAG(sc);
227 seq = WLAN_GET_SEQ_SEQ(sc) >> 4; 227 seq = WLAN_GET_SEQ_SEQ(sc) >> 4;
228 228
229 if (frag == 0) { 229 if (frag == 0) {
230 /* Reserve enough space to fit maximum frame length */ 230 /* Reserve enough space to fit maximum frame length */
231 skb = dev_alloc_skb(local->dev->mtu + 231 skb = dev_alloc_skb(local->dev->mtu +
232 sizeof(struct hostap_ieee80211_hdr) + 232 sizeof(struct ieee80211_hdr) +
233 8 /* LLC */ + 233 8 /* LLC */ +
234 2 /* alignment */ + 234 2 /* alignment */ +
235 8 /* WEP */ + ETH_ALEN /* WDS */); 235 8 /* WEP */ + ETH_ALEN /* WDS */);
@@ -267,13 +267,13 @@ prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr)
267 267
268/* Called only as a tasklet (software IRQ) */ 268/* Called only as a tasklet (software IRQ) */
269static int prism2_frag_cache_invalidate(local_info_t *local, 269static int prism2_frag_cache_invalidate(local_info_t *local,
270 struct hostap_ieee80211_hdr *hdr) 270 struct ieee80211_hdr *hdr)
271{ 271{
272 u16 sc; 272 u16 sc;
273 unsigned int seq; 273 unsigned int seq;
274 struct prism2_frag_entry *entry; 274 struct prism2_frag_entry *entry;
275 275
276 sc = le16_to_cpu(hdr->seq_ctrl); 276 sc = le16_to_cpu(hdr->seq_ctl);
277 seq = WLAN_GET_SEQ_SEQ(sc) >> 4; 277 seq = WLAN_GET_SEQ_SEQ(sc) >> 4;
278 278
279 entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); 279 entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1);
@@ -441,7 +441,7 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
441 u16 stype) 441 u16 stype)
442{ 442{
443 if (local->iw_mode == IW_MODE_MASTER) { 443 if (local->iw_mode == IW_MODE_MASTER) {
444 hostap_update_sta_ps(local, (struct hostap_ieee80211_hdr *) 444 hostap_update_sta_ps(local, (struct ieee80211_hdr *)
445 skb->data); 445 skb->data);
446 } 446 }
447 447
@@ -519,7 +519,7 @@ static inline struct net_device *prism2_rx_get_wds(local_info_t *local,
519 519
520 520
521static inline int 521static inline int
522hostap_rx_frame_wds(local_info_t *local, struct hostap_ieee80211_hdr *hdr, 522hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr *hdr,
523 u16 fc, struct net_device **wds) 523 u16 fc, struct net_device **wds)
524{ 524{
525 /* FIX: is this really supposed to accept WDS frames only in Master 525 /* FIX: is this really supposed to accept WDS frames only in Master
@@ -577,14 +577,14 @@ static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb)
577{ 577{
578 struct net_device *dev = local->dev; 578 struct net_device *dev = local->dev;
579 u16 fc, ethertype; 579 u16 fc, ethertype;
580 struct hostap_ieee80211_hdr *hdr; 580 struct ieee80211_hdr *hdr;
581 u8 *pos; 581 u8 *pos;
582 582
583 if (skb->len < 24) 583 if (skb->len < 24)
584 return 0; 584 return 0;
585 585
586 hdr = (struct hostap_ieee80211_hdr *) skb->data; 586 hdr = (struct ieee80211_hdr *) skb->data;
587 fc = le16_to_cpu(hdr->frame_control); 587 fc = le16_to_cpu(hdr->frame_ctl);
588 588
589 /* check that the frame is unicast frame to us */ 589 /* check that the frame is unicast frame to us */
590 if ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == WLAN_FC_TODS && 590 if ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == WLAN_FC_TODS &&
@@ -615,14 +615,14 @@ static inline int
615hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, 615hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
616 struct ieee80211_crypt_data *crypt) 616 struct ieee80211_crypt_data *crypt)
617{ 617{
618 struct hostap_ieee80211_hdr *hdr; 618 struct ieee80211_hdr *hdr;
619 int res, hdrlen; 619 int res, hdrlen;
620 620
621 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 621 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
622 return 0; 622 return 0;
623 623
624 hdr = (struct hostap_ieee80211_hdr *) skb->data; 624 hdr = (struct ieee80211_hdr *) skb->data;
625 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); 625 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
626 626
627 if (local->tkip_countermeasures && 627 if (local->tkip_countermeasures &&
628 strcmp(crypt->ops->name, "TKIP") == 0) { 628 strcmp(crypt->ops->name, "TKIP") == 0) {
@@ -654,14 +654,14 @@ static inline int
654hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb, 654hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
655 int keyidx, struct ieee80211_crypt_data *crypt) 655 int keyidx, struct ieee80211_crypt_data *crypt)
656{ 656{
657 struct hostap_ieee80211_hdr *hdr; 657 struct ieee80211_hdr *hdr;
658 int res, hdrlen; 658 int res, hdrlen;
659 659
660 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 660 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
661 return 0; 661 return 0;
662 662
663 hdr = (struct hostap_ieee80211_hdr *) skb->data; 663 hdr = (struct ieee80211_hdr *) skb->data;
664 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); 664 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
665 665
666 atomic_inc(&crypt->refcnt); 666 atomic_inc(&crypt->refcnt);
667 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); 667 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
@@ -685,7 +685,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
685{ 685{
686 struct hostap_interface *iface; 686 struct hostap_interface *iface;
687 local_info_t *local; 687 local_info_t *local;
688 struct hostap_ieee80211_hdr *hdr; 688 struct ieee80211_hdr *hdr;
689 size_t hdrlen; 689 size_t hdrlen;
690 u16 fc, type, stype, sc; 690 u16 fc, type, stype, sc;
691 struct net_device *wds = NULL; 691 struct net_device *wds = NULL;
@@ -712,16 +712,16 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
712 dev = local->ddev; 712 dev = local->ddev;
713 iface = netdev_priv(dev); 713 iface = netdev_priv(dev);
714 714
715 hdr = (struct hostap_ieee80211_hdr *) skb->data; 715 hdr = (struct ieee80211_hdr *) skb->data;
716 stats = hostap_get_stats(dev); 716 stats = hostap_get_stats(dev);
717 717
718 if (skb->len < 10) 718 if (skb->len < 10)
719 goto rx_dropped; 719 goto rx_dropped;
720 720
721 fc = le16_to_cpu(hdr->frame_control); 721 fc = le16_to_cpu(hdr->frame_ctl);
722 type = HOSTAP_FC_GET_TYPE(fc); 722 type = HOSTAP_FC_GET_TYPE(fc);
723 stype = HOSTAP_FC_GET_STYPE(fc); 723 stype = HOSTAP_FC_GET_STYPE(fc);
724 sc = le16_to_cpu(hdr->seq_ctrl); 724 sc = le16_to_cpu(hdr->seq_ctl);
725 frag = WLAN_GET_SEQ_FRAG(sc); 725 frag = WLAN_GET_SEQ_FRAG(sc);
726 hdrlen = hostap_80211_get_hdrlen(fc); 726 hdrlen = hostap_80211_get_hdrlen(fc);
727 727
@@ -883,7 +883,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
883 if (local->host_decrypt && (fc & WLAN_FC_ISWEP) && 883 if (local->host_decrypt && (fc & WLAN_FC_ISWEP) &&
884 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 884 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
885 goto rx_dropped; 885 goto rx_dropped;
886 hdr = (struct hostap_ieee80211_hdr *) skb->data; 886 hdr = (struct ieee80211_hdr *) skb->data;
887 887
888 /* skb: hdr + (possibly fragmented) plaintext payload */ 888 /* skb: hdr + (possibly fragmented) plaintext payload */
889 889
@@ -935,7 +935,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
935 /* this was the last fragment and the frame will be 935 /* this was the last fragment and the frame will be
936 * delivered, so remove skb from fragment cache */ 936 * delivered, so remove skb from fragment cache */
937 skb = frag_skb; 937 skb = frag_skb;
938 hdr = (struct hostap_ieee80211_hdr *) skb->data; 938 hdr = (struct ieee80211_hdr *) skb->data;
939 prism2_frag_cache_invalidate(local, hdr); 939 prism2_frag_cache_invalidate(local, hdr);
940 } 940 }
941 941
@@ -946,7 +946,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
946 hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt)) 946 hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt))
947 goto rx_dropped; 947 goto rx_dropped;
948 948
949 hdr = (struct hostap_ieee80211_hdr *) skb->data; 949 hdr = (struct ieee80211_hdr *) skb->data;
950 if (crypt && !(fc & WLAN_FC_ISWEP) && !local->open_wep) { 950 if (crypt && !(fc & WLAN_FC_ISWEP) && !local->open_wep) {
951 if (local->ieee_802_1x && 951 if (local->ieee_802_1x &&
952 hostap_is_eapol_frame(local, skb)) { 952 hostap_is_eapol_frame(local, skb)) {
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index cfb3ecc783fa..2b38a5230992 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -1,9 +1,9 @@
1void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) 1void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
2{ 2{
3 struct hostap_ieee80211_hdr *hdr; 3 struct ieee80211_hdr *hdr;
4 u16 fc; 4 u16 fc;
5 5
6 hdr = (struct hostap_ieee80211_hdr *) skb->data; 6 hdr = (struct ieee80211_hdr *) skb->data;
7 7
8 printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n", 8 printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n",
9 name, skb->len, jiffies); 9 name, skb->len, jiffies);
@@ -11,7 +11,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
11 if (skb->len < 2) 11 if (skb->len < 2)
12 return; 12 return;
13 13
14 fc = le16_to_cpu(hdr->frame_control); 14 fc = le16_to_cpu(hdr->frame_ctl);
15 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", 15 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
16 fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), 16 fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
17 fc & WLAN_FC_TODS ? " [ToDS]" : "", 17 fc & WLAN_FC_TODS ? " [ToDS]" : "",
@@ -23,7 +23,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
23 } 23 }
24 24
25 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 25 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
26 le16_to_cpu(hdr->seq_ctrl)); 26 le16_to_cpu(hdr->seq_ctl));
27 27
28 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, 28 printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR,
29 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); 29 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3));
@@ -41,7 +41,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
41 struct hostap_interface *iface; 41 struct hostap_interface *iface;
42 local_info_t *local; 42 local_info_t *local;
43 int need_headroom, need_tailroom = 0; 43 int need_headroom, need_tailroom = 0;
44 struct hostap_ieee80211_hdr hdr; 44 struct ieee80211_hdr hdr;
45 u16 fc, ethertype = 0; 45 u16 fc, ethertype = 0;
46 enum { 46 enum {
47 WDS_NO = 0, WDS_OWN_FRAME, WDS_COMPLIANT_FRAME 47 WDS_NO = 0, WDS_OWN_FRAME, WDS_COMPLIANT_FRAME
@@ -180,7 +180,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
180 memcpy(&hdr.addr3, local->bssid, ETH_ALEN); 180 memcpy(&hdr.addr3, local->bssid, ETH_ALEN);
181 } 181 }
182 182
183 hdr.frame_control = cpu_to_le16(fc); 183 hdr.frame_ctl = cpu_to_le16(fc);
184 184
185 skb_pull(skb, skip_header_bytes); 185 skb_pull(skb, skip_header_bytes);
186 need_headroom = local->func->need_tx_headroom + hdr_len + encaps_len; 186 need_headroom = local->func->need_tx_headroom + hdr_len + encaps_len;
@@ -244,7 +244,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
244 struct hostap_interface *iface; 244 struct hostap_interface *iface;
245 local_info_t *local; 245 local_info_t *local;
246 struct hostap_skb_tx_data *meta; 246 struct hostap_skb_tx_data *meta;
247 struct hostap_ieee80211_hdr *hdr; 247 struct ieee80211_hdr *hdr;
248 u16 fc; 248 u16 fc;
249 249
250 iface = netdev_priv(dev); 250 iface = netdev_priv(dev);
@@ -266,8 +266,8 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
266 meta->iface = iface; 266 meta->iface = iface;
267 267
268 if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) { 268 if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) {
269 hdr = (struct hostap_ieee80211_hdr *) skb->data; 269 hdr = (struct ieee80211_hdr *) skb->data;
270 fc = le16_to_cpu(hdr->frame_control); 270 fc = le16_to_cpu(hdr->frame_ctl);
271 if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && 271 if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
272 HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) { 272 HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) {
273 u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN + 273 u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN +
@@ -289,7 +289,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
289{ 289{
290 struct hostap_interface *iface; 290 struct hostap_interface *iface;
291 local_info_t *local; 291 local_info_t *local;
292 struct hostap_ieee80211_hdr *hdr; 292 struct ieee80211_hdr *hdr;
293 u16 fc; 293 u16 fc;
294 int hdr_len, res; 294 int hdr_len, res;
295 295
@@ -303,7 +303,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
303 303
304 if (local->tkip_countermeasures && 304 if (local->tkip_countermeasures &&
305 crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) { 305 crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) {
306 hdr = (struct hostap_ieee80211_hdr *) skb->data; 306 hdr = (struct ieee80211_hdr *) skb->data;
307 if (net_ratelimit()) { 307 if (net_ratelimit()) {
308 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 308 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
309 "TX packet to " MACSTR "\n", 309 "TX packet to " MACSTR "\n",
@@ -325,8 +325,8 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
325 return NULL; 325 return NULL;
326 } 326 }
327 327
328 hdr = (struct hostap_ieee80211_hdr *) skb->data; 328 hdr = (struct ieee80211_hdr *) skb->data;
329 fc = le16_to_cpu(hdr->frame_control); 329 fc = le16_to_cpu(hdr->frame_ctl);
330 hdr_len = hostap_80211_get_hdrlen(fc); 330 hdr_len = hostap_80211_get_hdrlen(fc);
331 331
332 /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so 332 /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so
@@ -360,7 +360,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
360 ap_tx_ret tx_ret; 360 ap_tx_ret tx_ret;
361 struct hostap_skb_tx_data *meta; 361 struct hostap_skb_tx_data *meta;
362 int no_encrypt = 0; 362 int no_encrypt = 0;
363 struct hostap_ieee80211_hdr *hdr; 363 struct ieee80211_hdr *hdr;
364 364
365 iface = netdev_priv(dev); 365 iface = netdev_priv(dev);
366 local = iface->local; 366 local = iface->local;
@@ -403,8 +403,8 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
403 tx_ret = hostap_handle_sta_tx(local, &tx); 403 tx_ret = hostap_handle_sta_tx(local, &tx);
404 skb = tx.skb; 404 skb = tx.skb;
405 meta = (struct hostap_skb_tx_data *) skb->cb; 405 meta = (struct hostap_skb_tx_data *) skb->cb;
406 hdr = (struct hostap_ieee80211_hdr *) skb->data; 406 hdr = (struct ieee80211_hdr *) skb->data;
407 fc = le16_to_cpu(hdr->frame_control); 407 fc = le16_to_cpu(hdr->frame_ctl);
408 switch (tx_ret) { 408 switch (tx_ret) {
409 case AP_TX_CONTINUE: 409 case AP_TX_CONTINUE:
410 break; 410 break;
@@ -445,7 +445,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
445 445
446 /* remove special version from the frame header */ 446 /* remove special version from the frame header */
447 fc &= ~WLAN_FC_PVER; 447 fc &= ~WLAN_FC_PVER;
448 hdr->frame_control = cpu_to_le16(fc); 448 hdr->frame_ctl = cpu_to_le16(fc);
449 } 449 }
450 450
451 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) { 451 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) {
@@ -467,7 +467,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
467 /* Add ISWEP flag both for firmware and host based encryption 467 /* Add ISWEP flag both for firmware and host based encryption
468 */ 468 */
469 fc |= WLAN_FC_ISWEP; 469 fc |= WLAN_FC_ISWEP;
470 hdr->frame_control = cpu_to_le16(fc); 470 hdr->frame_ctl = cpu_to_le16(fc);
471 } else if (local->drop_unencrypted && 471 } else if (local->drop_unencrypted &&
472 HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && 472 HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
473 meta->ethertype != ETH_P_PAE) { 473 meta->ethertype != ETH_P_PAE) {
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 550855a91509..5cd8d23c30ee 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -590,22 +590,22 @@ static void hostap_ap_tx_cb(struct sk_buff *skb, int ok, void *data)
590{ 590{
591 struct ap_data *ap = data; 591 struct ap_data *ap = data;
592 u16 fc; 592 u16 fc;
593 struct hostap_ieee80211_hdr *hdr; 593 struct ieee80211_hdr *hdr;
594 594
595 if (!ap->local->hostapd || !ap->local->apdev) { 595 if (!ap->local->hostapd || !ap->local->apdev) {
596 dev_kfree_skb(skb); 596 dev_kfree_skb(skb);
597 return; 597 return;
598 } 598 }
599 599
600 hdr = (struct hostap_ieee80211_hdr *) skb->data; 600 hdr = (struct ieee80211_hdr *) skb->data;
601 fc = le16_to_cpu(hdr->frame_control); 601 fc = le16_to_cpu(hdr->frame_ctl);
602 602
603 /* Pass the TX callback frame to the hostapd; use 802.11 header version 603 /* Pass the TX callback frame to the hostapd; use 802.11 header version
604 * 1 to indicate failure (no ACK) and 2 success (frame ACKed) */ 604 * 1 to indicate failure (no ACK) and 2 success (frame ACKed) */
605 605
606 fc &= ~WLAN_FC_PVER; 606 fc &= ~WLAN_FC_PVER;
607 fc |= ok ? BIT(1) : BIT(0); 607 fc |= ok ? BIT(1) : BIT(0);
608 hdr->frame_control = cpu_to_le16(fc); 608 hdr->frame_ctl = cpu_to_le16(fc);
609 609
610 skb->dev = ap->local->apdev; 610 skb->dev = ap->local->apdev;
611 skb_pull(skb, hostap_80211_get_hdrlen(fc)); 611 skb_pull(skb, hostap_80211_get_hdrlen(fc));
@@ -622,7 +622,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
622{ 622{
623 struct ap_data *ap = data; 623 struct ap_data *ap = data;
624 struct net_device *dev = ap->local->dev; 624 struct net_device *dev = ap->local->dev;
625 struct hostap_ieee80211_hdr *hdr; 625 struct ieee80211_hdr *hdr;
626 u16 fc, *pos, auth_alg, auth_transaction, status; 626 u16 fc, *pos, auth_alg, auth_transaction, status;
627 struct sta_info *sta = NULL; 627 struct sta_info *sta = NULL;
628 char *txt = NULL; 628 char *txt = NULL;
@@ -632,8 +632,8 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
632 return; 632 return;
633 } 633 }
634 634
635 hdr = (struct hostap_ieee80211_hdr *) skb->data; 635 hdr = (struct ieee80211_hdr *) skb->data;
636 fc = le16_to_cpu(hdr->frame_control); 636 fc = le16_to_cpu(hdr->frame_ctl);
637 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || 637 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT ||
638 HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_AUTH || 638 HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_AUTH ||
639 skb->len < IEEE80211_MGMT_HDR_LEN + 6) { 639 skb->len < IEEE80211_MGMT_HDR_LEN + 6) {
@@ -691,7 +691,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
691{ 691{
692 struct ap_data *ap = data; 692 struct ap_data *ap = data;
693 struct net_device *dev = ap->local->dev; 693 struct net_device *dev = ap->local->dev;
694 struct hostap_ieee80211_hdr *hdr; 694 struct ieee80211_hdr *hdr;
695 u16 fc, *pos, status; 695 u16 fc, *pos, status;
696 struct sta_info *sta = NULL; 696 struct sta_info *sta = NULL;
697 char *txt = NULL; 697 char *txt = NULL;
@@ -701,8 +701,8 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
701 return; 701 return;
702 } 702 }
703 703
704 hdr = (struct hostap_ieee80211_hdr *) skb->data; 704 hdr = (struct ieee80211_hdr *) skb->data;
705 fc = le16_to_cpu(hdr->frame_control); 705 fc = le16_to_cpu(hdr->frame_ctl);
706 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || 706 if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT ||
707 (HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_ASSOC_RESP && 707 (HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_ASSOC_RESP &&
708 HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_REASSOC_RESP) || 708 HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_REASSOC_RESP) ||
@@ -756,12 +756,12 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
756static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data) 756static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
757{ 757{
758 struct ap_data *ap = data; 758 struct ap_data *ap = data;
759 struct hostap_ieee80211_hdr *hdr; 759 struct ieee80211_hdr *hdr;
760 struct sta_info *sta; 760 struct sta_info *sta;
761 761
762 if (skb->len < 24) 762 if (skb->len < 24)
763 goto fail; 763 goto fail;
764 hdr = (struct hostap_ieee80211_hdr *) skb->data; 764 hdr = (struct ieee80211_hdr *) skb->data;
765 if (ok) { 765 if (ok) {
766 spin_lock(&ap->sta_table_lock); 766 spin_lock(&ap->sta_table_lock);
767 sta = ap_get_sta(ap, hdr->addr1); 767 sta = ap_get_sta(ap, hdr->addr1);
@@ -917,7 +917,7 @@ static void prism2_send_mgmt(struct net_device *dev,
917{ 917{
918 struct hostap_interface *iface; 918 struct hostap_interface *iface;
919 local_info_t *local; 919 local_info_t *local;
920 struct hostap_ieee80211_hdr *hdr; 920 struct ieee80211_hdr *hdr;
921 u16 fc; 921 u16 fc;
922 struct sk_buff *skb; 922 struct sk_buff *skb;
923 struct hostap_skb_tx_data *meta; 923 struct hostap_skb_tx_data *meta;
@@ -943,7 +943,7 @@ static void prism2_send_mgmt(struct net_device *dev,
943 943
944 fc = (type << 2) | (subtype << 4); 944 fc = (type << 2) | (subtype << 4);
945 hdrlen = hostap_80211_get_hdrlen(fc); 945 hdrlen = hostap_80211_get_hdrlen(fc);
946 hdr = (struct hostap_ieee80211_hdr *) skb_put(skb, hdrlen); 946 hdr = (struct ieee80211_hdr *) skb_put(skb, hdrlen);
947 if (body) 947 if (body)
948 memcpy(skb_put(skb, body_len), body, body_len); 948 memcpy(skb_put(skb, body_len), body, body_len);
949 949
@@ -967,7 +967,7 @@ static void prism2_send_mgmt(struct net_device *dev,
967 memcpy(hdr->addr3, dev->dev_addr, ETH_ALEN); /* BSSID */ 967 memcpy(hdr->addr3, dev->dev_addr, ETH_ALEN); /* BSSID */
968 } 968 }
969 969
970 hdr->frame_control = cpu_to_le16(fc); 970 hdr->frame_ctl = cpu_to_le16(fc);
971 971
972 meta = (struct hostap_skb_tx_data *) skb->cb; 972 meta = (struct hostap_skb_tx_data *) skb->cb;
973 memset(meta, 0, sizeof(*meta)); 973 memset(meta, 0, sizeof(*meta));
@@ -1284,8 +1284,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1284 struct hostap_80211_rx_status *rx_stats) 1284 struct hostap_80211_rx_status *rx_stats)
1285{ 1285{
1286 struct net_device *dev = local->dev; 1286 struct net_device *dev = local->dev;
1287 struct hostap_ieee80211_hdr *hdr = 1287 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1288 (struct hostap_ieee80211_hdr *) skb->data;
1289 size_t hdrlen; 1288 size_t hdrlen;
1290 struct ap_data *ap = local->ap; 1289 struct ap_data *ap = local->ap;
1291 char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL; 1290 char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL;
@@ -1298,7 +1297,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1298 1297
1299 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1298 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1300 1299
1301 fc = le16_to_cpu(hdr->frame_control); 1300 fc = le16_to_cpu(hdr->frame_ctl);
1302 hdrlen = hostap_80211_get_hdrlen(fc); 1301 hdrlen = hostap_80211_get_hdrlen(fc);
1303 1302
1304 if (len < 6) { 1303 if (len < 6) {
@@ -1498,8 +1497,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1498 struct hostap_80211_rx_status *rx_stats, int reassoc) 1497 struct hostap_80211_rx_status *rx_stats, int reassoc)
1499{ 1498{
1500 struct net_device *dev = local->dev; 1499 struct net_device *dev = local->dev;
1501 struct hostap_ieee80211_hdr *hdr = 1500 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1502 (struct hostap_ieee80211_hdr *) skb->data;
1503 char body[12], *p, *lpos; 1501 char body[12], *p, *lpos;
1504 int len, left; 1502 int len, left;
1505 u16 *pos; 1503 u16 *pos;
@@ -1706,8 +1704,7 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1706 struct hostap_80211_rx_status *rx_stats) 1704 struct hostap_80211_rx_status *rx_stats)
1707{ 1705{
1708 struct net_device *dev = local->dev; 1706 struct net_device *dev = local->dev;
1709 struct hostap_ieee80211_hdr *hdr = 1707 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1710 (struct hostap_ieee80211_hdr *) skb->data;
1711 char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN); 1708 char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN);
1712 int len; 1709 int len;
1713 u16 reason_code, *pos; 1710 u16 reason_code, *pos;
@@ -1748,8 +1745,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1748 struct hostap_80211_rx_status *rx_stats) 1745 struct hostap_80211_rx_status *rx_stats)
1749{ 1746{
1750 struct net_device *dev = local->dev; 1747 struct net_device *dev = local->dev;
1751 struct hostap_ieee80211_hdr *hdr = 1748 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1752 (struct hostap_ieee80211_hdr *) skb->data;
1753 char *body = skb->data + IEEE80211_MGMT_HDR_LEN; 1749 char *body = skb->data + IEEE80211_MGMT_HDR_LEN;
1754 int len; 1750 int len;
1755 u16 reason_code, *pos; 1751 u16 reason_code, *pos;
@@ -1787,7 +1783,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1787 1783
1788/* Called only as a scheduled task for pending AP frames. */ 1784/* Called only as a scheduled task for pending AP frames. */
1789static void ap_handle_data_nullfunc(local_info_t *local, 1785static void ap_handle_data_nullfunc(local_info_t *local,
1790 struct hostap_ieee80211_hdr *hdr) 1786 struct ieee80211_hdr *hdr)
1791{ 1787{
1792 struct net_device *dev = local->dev; 1788 struct net_device *dev = local->dev;
1793 1789
@@ -1804,7 +1800,7 @@ static void ap_handle_data_nullfunc(local_info_t *local,
1804 1800
1805/* Called only as a scheduled task for pending AP frames. */ 1801/* Called only as a scheduled task for pending AP frames. */
1806static void ap_handle_dropped_data(local_info_t *local, 1802static void ap_handle_dropped_data(local_info_t *local,
1807 struct hostap_ieee80211_hdr *hdr) 1803 struct ieee80211_hdr *hdr)
1808{ 1804{
1809 struct net_device *dev = local->dev; 1805 struct net_device *dev = local->dev;
1810 struct sta_info *sta; 1806 struct sta_info *sta;
@@ -1863,7 +1859,7 @@ static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta,
1863 1859
1864/* Called only as a scheduled task for pending AP frames. */ 1860/* Called only as a scheduled task for pending AP frames. */
1865static void handle_pspoll(local_info_t *local, 1861static void handle_pspoll(local_info_t *local,
1866 struct hostap_ieee80211_hdr *hdr, 1862 struct ieee80211_hdr *hdr,
1867 struct hostap_80211_rx_status *rx_stats) 1863 struct hostap_80211_rx_status *rx_stats)
1868{ 1864{
1869 struct net_device *dev = local->dev; 1865 struct net_device *dev = local->dev;
@@ -1874,7 +1870,7 @@ static void handle_pspoll(local_info_t *local,
1874 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MACSTR ", TA=" MACSTR 1870 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MACSTR ", TA=" MACSTR
1875 " PWRMGT=%d\n", 1871 " PWRMGT=%d\n",
1876 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), 1872 MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
1877 !!(le16_to_cpu(hdr->frame_control) & WLAN_FC_PWRMGT)); 1873 !!(le16_to_cpu(hdr->frame_ctl) & WLAN_FC_PWRMGT));
1878 1874
1879 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1875 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
1880 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MACSTR 1876 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MACSTR
@@ -1982,8 +1978,7 @@ static void handle_wds_oper_queue(void *data)
1982static void handle_beacon(local_info_t *local, struct sk_buff *skb, 1978static void handle_beacon(local_info_t *local, struct sk_buff *skb,
1983 struct hostap_80211_rx_status *rx_stats) 1979 struct hostap_80211_rx_status *rx_stats)
1984{ 1980{
1985 struct hostap_ieee80211_hdr *hdr = 1981 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1986 (struct hostap_ieee80211_hdr *) skb->data;
1987 char *body = skb->data + IEEE80211_MGMT_HDR_LEN; 1982 char *body = skb->data + IEEE80211_MGMT_HDR_LEN;
1988 int len, left; 1983 int len, left;
1989 u16 *pos, beacon_int, capability; 1984 u16 *pos, beacon_int, capability;
@@ -2141,12 +2136,12 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2141 struct net_device *dev = local->dev; 2136 struct net_device *dev = local->dev;
2142#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2137#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
2143 u16 fc, type, stype; 2138 u16 fc, type, stype;
2144 struct hostap_ieee80211_hdr *hdr; 2139 struct ieee80211_hdr *hdr;
2145 2140
2146 /* FIX: should give skb->len to handler functions and check that the 2141 /* FIX: should give skb->len to handler functions and check that the
2147 * buffer is long enough */ 2142 * buffer is long enough */
2148 hdr = (struct hostap_ieee80211_hdr *) skb->data; 2143 hdr = (struct ieee80211_hdr *) skb->data;
2149 fc = le16_to_cpu(hdr->frame_control); 2144 fc = le16_to_cpu(hdr->frame_ctl);
2150 type = HOSTAP_FC_GET_TYPE(fc); 2145 type = HOSTAP_FC_GET_TYPE(fc);
2151 stype = HOSTAP_FC_GET_STYPE(fc); 2146 stype = HOSTAP_FC_GET_STYPE(fc);
2152 2147
@@ -2259,7 +2254,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb,
2259 struct hostap_interface *iface; 2254 struct hostap_interface *iface;
2260 local_info_t *local; 2255 local_info_t *local;
2261 u16 fc; 2256 u16 fc;
2262 struct hostap_ieee80211_hdr *hdr; 2257 struct ieee80211_hdr *hdr;
2263 2258
2264 iface = netdev_priv(dev); 2259 iface = netdev_priv(dev);
2265 local = iface->local; 2260 local = iface->local;
@@ -2269,8 +2264,8 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb,
2269 2264
2270 local->stats.rx_packets++; 2265 local->stats.rx_packets++;
2271 2266
2272 hdr = (struct hostap_ieee80211_hdr *) skb->data; 2267 hdr = (struct ieee80211_hdr *) skb->data;
2273 fc = le16_to_cpu(hdr->frame_control); 2268 fc = le16_to_cpu(hdr->frame_ctl);
2274 2269
2275 if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && 2270 if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL &&
2276 HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT && 2271 HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
@@ -2290,7 +2285,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb,
2290static void schedule_packet_send(local_info_t *local, struct sta_info *sta) 2285static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2291{ 2286{
2292 struct sk_buff *skb; 2287 struct sk_buff *skb;
2293 struct hostap_ieee80211_hdr *hdr; 2288 struct ieee80211_hdr *hdr;
2294 struct hostap_80211_rx_status rx_stats; 2289 struct hostap_80211_rx_status rx_stats;
2295 2290
2296 if (skb_queue_empty(&sta->tx_buf)) 2291 if (skb_queue_empty(&sta->tx_buf))
@@ -2303,10 +2298,10 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2303 return; 2298 return;
2304 } 2299 }
2305 2300
2306 hdr = (struct hostap_ieee80211_hdr *) skb_put(skb, 16); 2301 hdr = (struct ieee80211_hdr *) skb_put(skb, 16);
2307 2302
2308 /* Generate a fake pspoll frame to start packet delivery */ 2303 /* Generate a fake pspoll frame to start packet delivery */
2309 hdr->frame_control = __constant_cpu_to_le16( 2304 hdr->frame_ctl = __constant_cpu_to_le16(
2310 (WLAN_FC_TYPE_CTRL << 2) | (WLAN_FC_STYPE_PSPOLL << 4)); 2305 (WLAN_FC_TYPE_CTRL << 2) | (WLAN_FC_STYPE_PSPOLL << 4));
2311 memcpy(hdr->addr1, local->dev->dev_addr, ETH_ALEN); 2306 memcpy(hdr->addr1, local->dev->dev_addr, ETH_ALEN);
2312 memcpy(hdr->addr2, sta->addr, ETH_ALEN); 2307 memcpy(hdr->addr2, sta->addr, ETH_ALEN);
@@ -2686,7 +2681,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2686 struct sta_info *sta = NULL; 2681 struct sta_info *sta = NULL;
2687 struct sk_buff *skb = tx->skb; 2682 struct sk_buff *skb = tx->skb;
2688 int set_tim, ret; 2683 int set_tim, ret;
2689 struct hostap_ieee80211_hdr *hdr; 2684 struct ieee80211_hdr *hdr;
2690 struct hostap_skb_tx_data *meta; 2685 struct hostap_skb_tx_data *meta;
2691 2686
2692 meta = (struct hostap_skb_tx_data *) skb->cb; 2687 meta = (struct hostap_skb_tx_data *) skb->cb;
@@ -2695,7 +2690,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2695 meta->iface->type == HOSTAP_INTERFACE_STA) 2690 meta->iface->type == HOSTAP_INTERFACE_STA)
2696 goto out; 2691 goto out;
2697 2692
2698 hdr = (struct hostap_ieee80211_hdr *) skb->data; 2693 hdr = (struct ieee80211_hdr *) skb->data;
2699 2694
2700 if (hdr->addr1[0] & 0x01) { 2695 if (hdr->addr1[0] & 0x01) {
2701 /* broadcast/multicast frame - no AP related processing */ 2696 /* broadcast/multicast frame - no AP related processing */
@@ -2748,7 +2743,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2748 2743
2749 if (meta->flags & HOSTAP_TX_FLAGS_ADD_MOREDATA) { 2744 if (meta->flags & HOSTAP_TX_FLAGS_ADD_MOREDATA) {
2750 /* indicate to STA that more frames follow */ 2745 /* indicate to STA that more frames follow */
2751 hdr->frame_control |= __constant_cpu_to_le16(WLAN_FC_MOREDATA); 2746 hdr->frame_ctl |= __constant_cpu_to_le16(WLAN_FC_MOREDATA);
2752 } 2747 }
2753 2748
2754 if (meta->flags & HOSTAP_TX_FLAGS_BUFFERED_FRAME) { 2749 if (meta->flags & HOSTAP_TX_FLAGS_BUFFERED_FRAME) {
@@ -2821,10 +2816,10 @@ void hostap_handle_sta_release(void *ptr)
2821void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb) 2816void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2822{ 2817{
2823 struct sta_info *sta; 2818 struct sta_info *sta;
2824 struct hostap_ieee80211_hdr *hdr; 2819 struct ieee80211_hdr *hdr;
2825 struct hostap_skb_tx_data *meta; 2820 struct hostap_skb_tx_data *meta;
2826 2821
2827 hdr = (struct hostap_ieee80211_hdr *) skb->data; 2822 hdr = (struct ieee80211_hdr *) skb->data;
2828 meta = (struct hostap_skb_tx_data *) skb->cb; 2823 meta = (struct hostap_skb_tx_data *) skb->cb;
2829 2824
2830 spin_lock(&local->ap->sta_table_lock); 2825 spin_lock(&local->ap->sta_table_lock);
@@ -2890,8 +2885,8 @@ static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta,
2890 2885
2891 2886
2892/* Called only as a tasklet (software IRQ). Called for each RX frame to update 2887/* Called only as a tasklet (software IRQ). Called for each RX frame to update
2893 * STA power saving state. pwrmgt is a flag from 802.11 frame_control field. */ 2888 * STA power saving state. pwrmgt is a flag from 802.11 frame_ctl field. */
2894int hostap_update_sta_ps(local_info_t *local, struct hostap_ieee80211_hdr *hdr) 2889int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr)
2895{ 2890{
2896 struct sta_info *sta; 2891 struct sta_info *sta;
2897 u16 fc; 2892 u16 fc;
@@ -2905,7 +2900,7 @@ int hostap_update_sta_ps(local_info_t *local, struct hostap_ieee80211_hdr *hdr)
2905 if (!sta) 2900 if (!sta)
2906 return -1; 2901 return -1;
2907 2902
2908 fc = le16_to_cpu(hdr->frame_control); 2903 fc = le16_to_cpu(hdr->frame_ctl);
2909 hostap_update_sta_ps2(local, sta, fc & WLAN_FC_PWRMGT, 2904 hostap_update_sta_ps2(local, sta, fc & WLAN_FC_PWRMGT,
2910 HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc)); 2905 HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc));
2911 2906
@@ -2924,14 +2919,14 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2924 int ret; 2919 int ret;
2925 struct sta_info *sta; 2920 struct sta_info *sta;
2926 u16 fc, type, stype; 2921 u16 fc, type, stype;
2927 struct hostap_ieee80211_hdr *hdr; 2922 struct ieee80211_hdr *hdr;
2928 2923
2929 if (local->ap == NULL) 2924 if (local->ap == NULL)
2930 return AP_RX_CONTINUE; 2925 return AP_RX_CONTINUE;
2931 2926
2932 hdr = (struct hostap_ieee80211_hdr *) skb->data; 2927 hdr = (struct ieee80211_hdr *) skb->data;
2933 2928
2934 fc = le16_to_cpu(hdr->frame_control); 2929 fc = le16_to_cpu(hdr->frame_ctl);
2935 type = HOSTAP_FC_GET_TYPE(fc); 2930 type = HOSTAP_FC_GET_TYPE(fc);
2936 stype = HOSTAP_FC_GET_STYPE(fc); 2931 stype = HOSTAP_FC_GET_STYPE(fc);
2937 2932
@@ -3057,7 +3052,7 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3057 3052
3058/* Called only as a tasklet (software IRQ) */ 3053/* Called only as a tasklet (software IRQ) */
3059int hostap_handle_sta_crypto(local_info_t *local, 3054int hostap_handle_sta_crypto(local_info_t *local,
3060 struct hostap_ieee80211_hdr *hdr, 3055 struct ieee80211_hdr *hdr,
3061 struct ieee80211_crypt_data **crypt, 3056 struct ieee80211_crypt_data **crypt,
3062 void **sta_ptr) 3057 void **sta_ptr)
3063{ 3058{
@@ -3159,7 +3154,7 @@ int hostap_add_sta(struct ap_data *ap, u8 *sta_addr)
3159 3154
3160/* Called only as a tasklet (software IRQ) */ 3155/* Called only as a tasklet (software IRQ) */
3161int hostap_update_rx_stats(struct ap_data *ap, 3156int hostap_update_rx_stats(struct ap_data *ap,
3162 struct hostap_ieee80211_hdr *hdr, 3157 struct ieee80211_hdr *hdr,
3163 struct hostap_80211_rx_status *rx_stats) 3158 struct hostap_80211_rx_status *rx_stats)
3164{ 3159{
3165 struct sta_info *sta; 3160 struct sta_info *sta;
diff --git a/drivers/net/wireless/hostap/hostap_ap.h b/drivers/net/wireless/hostap/hostap_ap.h
index 512abc2c83a3..816a52bcea8f 100644
--- a/drivers/net/wireless/hostap/hostap_ap.h
+++ b/drivers/net/wireless/hostap/hostap_ap.h
@@ -233,8 +233,7 @@ struct hostap_tx_data {
233ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx); 233ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx);
234void hostap_handle_sta_release(void *ptr); 234void hostap_handle_sta_release(void *ptr);
235void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb); 235void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb);
236int hostap_update_sta_ps(local_info_t *local, 236int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr);
237 struct hostap_ieee80211_hdr *hdr);
238typedef enum { 237typedef enum {
239 AP_RX_CONTINUE, AP_RX_DROP, AP_RX_EXIT, AP_RX_CONTINUE_NOT_AUTHORIZED 238 AP_RX_CONTINUE, AP_RX_DROP, AP_RX_EXIT, AP_RX_CONTINUE_NOT_AUTHORIZED
240} ap_rx_ret; 239} ap_rx_ret;
@@ -242,15 +241,13 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
242 struct sk_buff *skb, 241 struct sk_buff *skb,
243 struct hostap_80211_rx_status *rx_stats, 242 struct hostap_80211_rx_status *rx_stats,
244 int wds); 243 int wds);
245int hostap_handle_sta_crypto(local_info_t *local, 244int hostap_handle_sta_crypto(local_info_t *local, struct ieee80211_hdr *hdr,
246 struct hostap_ieee80211_hdr *hdr,
247 struct ieee80211_crypt_data **crypt, 245 struct ieee80211_crypt_data **crypt,
248 void **sta_ptr); 246 void **sta_ptr);
249int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr); 247int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr);
250int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr); 248int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr);
251int hostap_add_sta(struct ap_data *ap, u8 *sta_addr); 249int hostap_add_sta(struct ap_data *ap, u8 *sta_addr);
252int hostap_update_rx_stats(struct ap_data *ap, 250int hostap_update_rx_stats(struct ap_data *ap, struct ieee80211_hdr *hdr,
253 struct hostap_ieee80211_hdr *hdr,
254 struct hostap_80211_rx_status *rx_stats); 251 struct hostap_80211_rx_status *rx_stats);
255void hostap_update_rates(local_info_t *local); 252void hostap_update_rates(local_info_t *local);
256void hostap_add_wds_links(local_info_t *local); 253void hostap_add_wds_links(local_info_t *local);
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 30c215106714..03c81b824242 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -1817,7 +1817,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
1817 struct hostap_interface *iface; 1817 struct hostap_interface *iface;
1818 local_info_t *local; 1818 local_info_t *local;
1819 struct hfa384x_tx_frame txdesc; 1819 struct hfa384x_tx_frame txdesc;
1820 struct hostap_ieee80211_hdr *hdr;
1821 struct hostap_skb_tx_data *meta; 1820 struct hostap_skb_tx_data *meta;
1822 int hdr_len, data_len, idx, res, ret = -1; 1821 int hdr_len, data_len, idx, res, ret = -1;
1823 u16 tx_control, fc; 1822 u16 tx_control, fc;
@@ -1826,7 +1825,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
1826 local = iface->local; 1825 local = iface->local;
1827 1826
1828 meta = (struct hostap_skb_tx_data *) skb->cb; 1827 meta = (struct hostap_skb_tx_data *) skb->cb;
1829 hdr = (struct hostap_ieee80211_hdr *) skb->data;
1830 1828
1831 prism2_callback(local, PRISM2_CALLBACK_TX_START); 1829 prism2_callback(local, PRISM2_CALLBACK_TX_START);
1832 1830