Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hostap: convert usage of net/ieee80211.h to linux/ieee80211.h

So that net/ieee80211.h can be made private to ipw2x00 in a follow-up.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Dan Williams and committed by
John W. Linville
1ea893fd 4d8faf69

+163 -186
+1 -1
drivers/net/wireless/hostap/hostap.h
··· 31 31 void hostap_dump_tx_header(const char *name, 32 32 const struct hfa384x_tx_frame *tx); 33 33 extern const struct header_ops hostap_80211_ops; 34 - int hostap_80211_get_hdrlen(u16 fc); 34 + int hostap_80211_get_hdrlen(__le16 fc); 35 35 struct net_device_stats *hostap_get_stats(struct net_device *dev); 36 36 void hostap_setup_dev(struct net_device *dev, local_info_t *local, 37 37 int type);
+1 -1
drivers/net/wireless/hostap/hostap_80211.h
··· 2 2 #define HOSTAP_80211_H 3 3 4 4 #include <linux/types.h> 5 - #include <net/ieee80211.h> 5 + #include <linux/skbuff.h> 6 6 7 7 struct hostap_ieee80211_mgmt { 8 8 __le16 frame_control;
+44 -44
drivers/net/wireless/hostap/hostap_80211_rx.c
··· 1 1 #include <linux/etherdevice.h> 2 2 #include <net/lib80211.h> 3 + #include <linux/if_arp.h> 3 4 4 5 #include "hostap_80211.h" 5 6 #include "hostap.h" ··· 18 17 void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, 19 18 struct hostap_80211_rx_status *rx_stats) 20 19 { 21 - struct ieee80211_hdr_4addr *hdr; 20 + struct ieee80211_hdr *hdr; 22 21 u16 fc; 23 22 24 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 23 + hdr = (struct ieee80211_hdr *) skb->data; 25 24 26 25 printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d " 27 26 "jiffies=%ld\n", ··· 31 30 if (skb->len < 2) 32 31 return; 33 32 34 - fc = le16_to_cpu(hdr->frame_ctl); 33 + fc = le16_to_cpu(hdr->frame_control); 35 34 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", 36 - fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4, 35 + fc, (fc & IEEE80211_FCTL_FTYPE) >> 2, 36 + (fc & IEEE80211_FCTL_STYPE) >> 4, 37 37 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 38 38 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 39 39 ··· 44 42 } 45 43 46 44 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 47 - le16_to_cpu(hdr->seq_ctl)); 45 + le16_to_cpu(hdr->seq_ctrl)); 48 46 49 47 printk(KERN_DEBUG " A1=%pM", hdr->addr1); 50 48 printk(" A2=%pM", hdr->addr2); ··· 65 63 int hdrlen, phdrlen, head_need, tail_need; 66 64 u16 fc; 67 65 int prism_header, ret; 68 - struct ieee80211_hdr_4addr *fhdr; 66 + struct ieee80211_hdr *fhdr; 69 67 70 68 iface = netdev_priv(dev); 71 69 local = iface->local; ··· 86 84 phdrlen = 0; 87 85 } 88 86 89 - fhdr = (struct ieee80211_hdr_4addr *) skb->data; 90 - fc = le16_to_cpu(fhdr->frame_ctl); 87 + fhdr = (struct ieee80211_hdr *) skb->data; 88 + fc = le16_to_cpu(fhdr->frame_control); 91 89 92 90 if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) { 93 91 printk(KERN_DEBUG "%s: dropped management frame with header " ··· 96 94 return 0; 97 95 } 98 96 99 - hdrlen = hostap_80211_get_hdrlen(fc); 97 + hdrlen = hostap_80211_get_hdrlen(fhdr->frame_control); 100 98 101 99 /* check if there is enough room for extra data; if not, expand skb 102 100 * buffer to be large enough for the changes */ ··· 249 247 250 248 /* Called only as a tasklet (software IRQ) */ 251 249 static struct sk_buff * 252 - prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr_4addr *hdr) 250 + prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr) 253 251 { 254 252 struct sk_buff *skb = NULL; 255 253 u16 sc; 256 254 unsigned int frag, seq; 257 255 struct prism2_frag_entry *entry; 258 256 259 - sc = le16_to_cpu(hdr->seq_ctl); 260 - frag = WLAN_GET_SEQ_FRAG(sc); 261 - seq = WLAN_GET_SEQ_SEQ(sc) >> 4; 257 + sc = le16_to_cpu(hdr->seq_ctrl); 258 + frag = sc & IEEE80211_SCTL_FRAG; 259 + seq = (sc & IEEE80211_SCTL_SEQ) >> 4; 262 260 263 261 if (frag == 0) { 264 262 /* Reserve enough space to fit maximum frame length */ 265 263 skb = dev_alloc_skb(local->dev->mtu + 266 - sizeof(struct ieee80211_hdr_4addr) + 264 + sizeof(struct ieee80211_hdr) + 267 265 8 /* LLC */ + 268 266 2 /* alignment */ + 269 267 8 /* WEP */ + ETH_ALEN /* WDS */); ··· 301 299 302 300 /* Called only as a tasklet (software IRQ) */ 303 301 static int prism2_frag_cache_invalidate(local_info_t *local, 304 - struct ieee80211_hdr_4addr *hdr) 302 + struct ieee80211_hdr *hdr) 305 303 { 306 304 u16 sc; 307 305 unsigned int seq; 308 306 struct prism2_frag_entry *entry; 309 307 310 - sc = le16_to_cpu(hdr->seq_ctl); 311 - seq = WLAN_GET_SEQ_SEQ(sc) >> 4; 308 + sc = le16_to_cpu(hdr->seq_ctrl); 309 + seq = (sc & IEEE80211_SCTL_SEQ) >> 4; 312 310 313 311 entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); 314 312 ··· 474 472 struct hostap_80211_rx_status *rx_stats, u16 type, 475 473 u16 stype) 476 474 { 477 - if (local->iw_mode == IW_MODE_MASTER) { 478 - hostap_update_sta_ps(local, (struct ieee80211_hdr_4addr *) 479 - skb->data); 480 - } 475 + if (local->iw_mode == IW_MODE_MASTER) 476 + hostap_update_sta_ps(local, (struct ieee80211_hdr *) skb->data); 481 477 482 478 if (local->hostapd && type == IEEE80211_FTYPE_MGMT) { 483 479 if (stype == IEEE80211_STYPE_BEACON && ··· 552 552 553 553 554 554 static int 555 - hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, 556 - u16 fc, struct net_device **wds) 555 + hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr *hdr, u16 fc, 556 + struct net_device **wds) 557 557 { 558 558 /* FIX: is this really supposed to accept WDS frames only in Master 559 559 * mode? What about Repeater or Managed with WDS frames? */ ··· 611 611 { 612 612 struct net_device *dev = local->dev; 613 613 u16 fc, ethertype; 614 - struct ieee80211_hdr_4addr *hdr; 614 + struct ieee80211_hdr *hdr; 615 615 u8 *pos; 616 616 617 617 if (skb->len < 24) 618 618 return 0; 619 619 620 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 621 - fc = le16_to_cpu(hdr->frame_ctl); 620 + hdr = (struct ieee80211_hdr *) skb->data; 621 + fc = le16_to_cpu(hdr->frame_control); 622 622 623 623 /* check that the frame is unicast frame to us */ 624 624 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == ··· 651 651 hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, 652 652 struct lib80211_crypt_data *crypt) 653 653 { 654 - struct ieee80211_hdr_4addr *hdr; 654 + struct ieee80211_hdr *hdr; 655 655 int res, hdrlen; 656 656 657 657 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 658 658 return 0; 659 659 660 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 661 - hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 660 + hdr = (struct ieee80211_hdr *) skb->data; 661 + hdrlen = hostap_80211_get_hdrlen(hdr->frame_control); 662 662 663 663 if (local->tkip_countermeasures && 664 664 strcmp(crypt->ops->name, "TKIP") == 0) { ··· 689 689 hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb, 690 690 int keyidx, struct lib80211_crypt_data *crypt) 691 691 { 692 - struct ieee80211_hdr_4addr *hdr; 692 + struct ieee80211_hdr *hdr; 693 693 int res, hdrlen; 694 694 695 695 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 696 696 return 0; 697 697 698 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 699 - hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 698 + hdr = (struct ieee80211_hdr *) skb->data; 699 + hdrlen = hostap_80211_get_hdrlen(hdr->frame_control); 700 700 701 701 atomic_inc(&crypt->refcnt); 702 702 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); ··· 720 720 { 721 721 struct hostap_interface *iface; 722 722 local_info_t *local; 723 - struct ieee80211_hdr_4addr *hdr; 723 + struct ieee80211_hdr *hdr; 724 724 size_t hdrlen; 725 725 u16 fc, type, stype, sc; 726 726 struct net_device *wds = NULL; ··· 747 747 dev = local->ddev; 748 748 iface = netdev_priv(dev); 749 749 750 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 750 + hdr = (struct ieee80211_hdr *) skb->data; 751 751 stats = hostap_get_stats(dev); 752 752 753 753 if (skb->len < 10) 754 754 goto rx_dropped; 755 755 756 - fc = le16_to_cpu(hdr->frame_ctl); 757 - type = WLAN_FC_GET_TYPE(fc); 758 - stype = WLAN_FC_GET_STYPE(fc); 759 - sc = le16_to_cpu(hdr->seq_ctl); 760 - frag = WLAN_GET_SEQ_FRAG(sc); 761 - hdrlen = hostap_80211_get_hdrlen(fc); 756 + fc = le16_to_cpu(hdr->frame_control); 757 + type = fc & IEEE80211_FCTL_FTYPE; 758 + stype = fc & IEEE80211_FCTL_STYPE; 759 + sc = le16_to_cpu(hdr->seq_ctrl); 760 + frag = sc & IEEE80211_SCTL_FRAG; 761 + hdrlen = hostap_80211_get_hdrlen(hdr->frame_control); 762 762 763 763 /* Put this code here so that we avoid duplicating it in all 764 764 * Rx paths. - Jean II */ ··· 918 918 if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && 919 919 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 920 920 goto rx_dropped; 921 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 921 + hdr = (struct ieee80211_hdr *) skb->data; 922 922 923 923 /* skb: hdr + (possibly fragmented) plaintext payload */ 924 924 ··· 931 931 printk(KERN_DEBUG "%s: Rx cannot get skb from " 932 932 "fragment cache (morefrag=%d seq=%u frag=%u)\n", 933 933 dev->name, (fc & IEEE80211_FCTL_MOREFRAGS) != 0, 934 - WLAN_GET_SEQ_SEQ(sc) >> 4, frag); 934 + (sc & IEEE80211_SCTL_SEQ) >> 4, frag); 935 935 goto rx_dropped; 936 936 } 937 937 ··· 972 972 /* this was the last fragment and the frame will be 973 973 * delivered, so remove skb from fragment cache */ 974 974 skb = frag_skb; 975 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 975 + hdr = (struct ieee80211_hdr *) skb->data; 976 976 prism2_frag_cache_invalidate(local, hdr); 977 977 } 978 978 ··· 983 983 hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt)) 984 984 goto rx_dropped; 985 985 986 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 986 + hdr = (struct ieee80211_hdr *) skb->data; 987 987 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !local->open_wep) { 988 988 if (local->ieee_802_1x && 989 989 hostap_is_eapol_frame(local, skb)) {
+25 -26
drivers/net/wireless/hostap/hostap_80211_tx.c
··· 15 15 16 16 void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) 17 17 { 18 - struct ieee80211_hdr_4addr *hdr; 18 + struct ieee80211_hdr *hdr; 19 19 u16 fc; 20 20 21 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 21 + hdr = (struct ieee80211_hdr *) skb->data; 22 22 23 23 printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n", 24 24 name, skb->len, jiffies); ··· 26 26 if (skb->len < 2) 27 27 return; 28 28 29 - fc = le16_to_cpu(hdr->frame_ctl); 29 + fc = le16_to_cpu(hdr->frame_control); 30 30 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", 31 - fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4, 31 + fc, (fc & IEEE80211_FCTL_FTYPE) >> 2, 32 + (fc & IEEE80211_FCTL_STYPE) >> 4, 32 33 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 33 34 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 34 35 ··· 39 38 } 40 39 41 40 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 42 - le16_to_cpu(hdr->seq_ctl)); 41 + le16_to_cpu(hdr->seq_ctrl)); 43 42 44 43 printk(KERN_DEBUG " A1=%pM", hdr->addr1); 45 44 printk(" A2=%pM", hdr->addr2); ··· 58 57 struct hostap_interface *iface; 59 58 local_info_t *local; 60 59 int need_headroom, need_tailroom = 0; 61 - struct ieee80211_hdr_4addr hdr; 60 + struct ieee80211_hdr hdr; 62 61 u16 fc, ethertype = 0; 63 62 enum { 64 63 WDS_NO = 0, WDS_OWN_FRAME, WDS_COMPLIANT_FRAME ··· 202 201 memcpy(&hdr.addr3, local->bssid, ETH_ALEN); 203 202 } 204 203 205 - hdr.frame_ctl = cpu_to_le16(fc); 204 + hdr.frame_control = cpu_to_le16(fc); 206 205 207 206 skb_pull(skb, skip_header_bytes); 208 207 need_headroom = local->func->need_tx_headroom + hdr_len + encaps_len; ··· 266 265 struct hostap_interface *iface; 267 266 local_info_t *local; 268 267 struct hostap_skb_tx_data *meta; 269 - struct ieee80211_hdr_4addr *hdr; 268 + struct ieee80211_hdr *hdr; 270 269 u16 fc; 271 270 272 271 iface = netdev_priv(dev); ··· 288 287 meta->iface = iface; 289 288 290 289 if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) { 291 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 292 - fc = le16_to_cpu(hdr->frame_ctl); 293 - if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && 294 - WLAN_FC_GET_STYPE(fc) == IEEE80211_STYPE_DATA) { 290 + hdr = (struct ieee80211_hdr *) skb->data; 291 + fc = le16_to_cpu(hdr->frame_control); 292 + if (ieee80211_is_data(hdr->frame_control) && 293 + (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DATA) { 295 294 u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN + 296 295 sizeof(rfc1042_header)]; 297 296 meta->ethertype = (pos[0] << 8) | pos[1]; ··· 311 310 { 312 311 struct hostap_interface *iface; 313 312 local_info_t *local; 314 - struct ieee80211_hdr_4addr *hdr; 315 - u16 fc; 313 + struct ieee80211_hdr *hdr; 316 314 int prefix_len, postfix_len, hdr_len, res; 317 315 318 316 iface = netdev_priv(skb->dev); ··· 324 324 325 325 if (local->tkip_countermeasures && 326 326 strcmp(crypt->ops->name, "TKIP") == 0) { 327 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 327 + hdr = (struct ieee80211_hdr *) skb->data; 328 328 if (net_ratelimit()) { 329 329 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 330 330 "TX packet to %pM\n", ··· 349 349 return NULL; 350 350 } 351 351 352 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 353 - fc = le16_to_cpu(hdr->frame_ctl); 354 - hdr_len = hostap_80211_get_hdrlen(fc); 352 + hdr = (struct ieee80211_hdr *) skb->data; 353 + hdr_len = hostap_80211_get_hdrlen(hdr->frame_control); 355 354 356 355 /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so 357 356 * call both MSDU and MPDU encryption functions from here. */ ··· 383 384 ap_tx_ret tx_ret; 384 385 struct hostap_skb_tx_data *meta; 385 386 int no_encrypt = 0; 386 - struct ieee80211_hdr_4addr *hdr; 387 + struct ieee80211_hdr *hdr; 387 388 388 389 iface = netdev_priv(dev); 389 390 local = iface->local; ··· 426 427 tx_ret = hostap_handle_sta_tx(local, &tx); 427 428 skb = tx.skb; 428 429 meta = (struct hostap_skb_tx_data *) skb->cb; 429 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 430 - fc = le16_to_cpu(hdr->frame_ctl); 430 + hdr = (struct ieee80211_hdr *) skb->data; 431 + fc = le16_to_cpu(hdr->frame_control); 431 432 switch (tx_ret) { 432 433 case AP_TX_CONTINUE: 433 434 break; 434 435 case AP_TX_CONTINUE_NOT_AUTHORIZED: 435 436 if (local->ieee_802_1x && 436 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && 437 + ieee80211_is_data(hdr->frame_control) && 437 438 meta->ethertype != ETH_P_PAE && 438 439 !(meta->flags & HOSTAP_TX_FLAGS_WDS)) { 439 440 printk(KERN_DEBUG "%s: dropped frame to unauthorized " ··· 468 469 469 470 /* remove special version from the frame header */ 470 471 fc &= ~IEEE80211_FCTL_VERS; 471 - hdr->frame_ctl = cpu_to_le16(fc); 472 + hdr->frame_control = cpu_to_le16(fc); 472 473 } 473 474 474 - if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_DATA) { 475 + if (!ieee80211_is_data(hdr->frame_control)) { 475 476 no_encrypt = 1; 476 477 tx.crypt = NULL; 477 478 } ··· 492 493 /* Add ISWEP flag both for firmware and host based encryption 493 494 */ 494 495 fc |= IEEE80211_FCTL_PROTECTED; 495 - hdr->frame_ctl = cpu_to_le16(fc); 496 + hdr->frame_control = cpu_to_le16(fc); 496 497 } else if (local->drop_unencrypted && 497 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && 498 + ieee80211_is_data(hdr->frame_control) && 498 499 meta->ethertype != ETH_P_PAE) { 499 500 if (net_ratelimit()) { 500 501 printk(KERN_DEBUG "%s: dropped unencrypted TX data "
+64 -74
drivers/net/wireless/hostap/hostap_ap.c
··· 19 19 #include <linux/proc_fs.h> 20 20 #include <linux/delay.h> 21 21 #include <linux/random.h> 22 + #include <linux/if_arp.h> 22 23 23 24 #include "hostap_wlan.h" 24 25 #include "hostap.h" ··· 589 588 static void hostap_ap_tx_cb(struct sk_buff *skb, int ok, void *data) 590 589 { 591 590 struct ap_data *ap = data; 592 - u16 fc; 593 - struct ieee80211_hdr_4addr *hdr; 591 + struct ieee80211_hdr *hdr; 594 592 595 593 if (!ap->local->hostapd || !ap->local->apdev) { 596 594 dev_kfree_skb(skb); 597 595 return; 598 596 } 599 597 600 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 601 - fc = le16_to_cpu(hdr->frame_ctl); 602 - 603 598 /* Pass the TX callback frame to the hostapd; use 802.11 header version 604 599 * 1 to indicate failure (no ACK) and 2 success (frame ACKed) */ 605 600 606 - fc &= ~IEEE80211_FCTL_VERS; 607 - fc |= ok ? BIT(1) : BIT(0); 608 - hdr->frame_ctl = cpu_to_le16(fc); 601 + hdr = (struct ieee80211_hdr *) skb->data; 602 + hdr->frame_control &= cpu_to_le16(~IEEE80211_FCTL_VERS); 603 + hdr->frame_control |= cpu_to_le16(ok ? BIT(1) : BIT(0)); 609 604 610 605 skb->dev = ap->local->apdev; 611 - skb_pull(skb, hostap_80211_get_hdrlen(fc)); 606 + skb_pull(skb, hostap_80211_get_hdrlen(hdr->frame_control)); 612 607 skb->pkt_type = PACKET_OTHERHOST; 613 608 skb->protocol = cpu_to_be16(ETH_P_802_2); 614 609 memset(skb->cb, 0, sizeof(skb->cb)); ··· 618 621 { 619 622 struct ap_data *ap = data; 620 623 struct net_device *dev = ap->local->dev; 621 - struct ieee80211_hdr_4addr *hdr; 622 - u16 fc, auth_alg, auth_transaction, status; 624 + struct ieee80211_hdr *hdr; 625 + u16 auth_alg, auth_transaction, status; 623 626 __le16 *pos; 624 627 struct sta_info *sta = NULL; 625 628 char *txt = NULL; ··· 629 632 return; 630 633 } 631 634 632 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 633 - fc = le16_to_cpu(hdr->frame_ctl); 634 - if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT || 635 - WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_AUTH || 635 + hdr = (struct ieee80211_hdr *) skb->data; 636 + if (!ieee80211_is_auth(hdr->frame_control) || 636 637 skb->len < IEEE80211_MGMT_HDR_LEN + 6) { 637 638 printk(KERN_DEBUG "%s: hostap_ap_tx_cb_auth received invalid " 638 639 "frame\n", dev->name); ··· 686 691 { 687 692 struct ap_data *ap = data; 688 693 struct net_device *dev = ap->local->dev; 689 - struct ieee80211_hdr_4addr *hdr; 694 + struct ieee80211_hdr *hdr; 690 695 u16 fc, status; 691 696 __le16 *pos; 692 697 struct sta_info *sta = NULL; ··· 697 702 return; 698 703 } 699 704 700 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 701 - fc = le16_to_cpu(hdr->frame_ctl); 702 - if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT || 703 - (WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_ASSOC_RESP && 704 - WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_REASSOC_RESP) || 705 + hdr = (struct ieee80211_hdr *) skb->data; 706 + fc = le16_to_cpu(hdr->frame_control); 707 + if ((!ieee80211_is_assoc_resp(hdr->frame_control) && 708 + !ieee80211_is_reassoc_resp(hdr->frame_control)) || 705 709 skb->len < IEEE80211_MGMT_HDR_LEN + 4) { 706 710 printk(KERN_DEBUG "%s: hostap_ap_tx_cb_assoc received invalid " 707 711 "frame\n", dev->name); ··· 751 757 static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data) 752 758 { 753 759 struct ap_data *ap = data; 754 - struct ieee80211_hdr_4addr *hdr; 760 + struct ieee80211_hdr *hdr; 755 761 struct sta_info *sta; 756 762 757 763 if (skb->len < 24) 758 764 goto fail; 759 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 765 + hdr = (struct ieee80211_hdr *) skb->data; 760 766 if (ok) { 761 767 spin_lock(&ap->sta_table_lock); 762 768 sta = ap_get_sta(ap, hdr->addr1); ··· 911 917 { 912 918 struct hostap_interface *iface; 913 919 local_info_t *local; 914 - struct ieee80211_hdr_4addr *hdr; 920 + struct ieee80211_hdr *hdr; 915 921 u16 fc; 916 922 struct sk_buff *skb; 917 923 struct hostap_skb_tx_data *meta; ··· 936 942 } 937 943 938 944 fc = type_subtype; 939 - hdrlen = hostap_80211_get_hdrlen(fc); 940 - hdr = (struct ieee80211_hdr_4addr *) skb_put(skb, hdrlen); 945 + hdrlen = hostap_80211_get_hdrlen(cpu_to_le16(type_subtype)); 946 + hdr = (struct ieee80211_hdr *) skb_put(skb, hdrlen); 941 947 if (body) 942 948 memcpy(skb_put(skb, body_len), body, body_len); 943 949 ··· 948 954 949 955 950 956 memcpy(hdr->addr1, addr, ETH_ALEN); /* DA / RA */ 951 - if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) { 957 + if (ieee80211_is_data(hdr->frame_control)) { 952 958 fc |= IEEE80211_FCTL_FROMDS; 953 959 memcpy(hdr->addr2, dev->dev_addr, ETH_ALEN); /* BSSID */ 954 960 memcpy(hdr->addr3, dev->dev_addr, ETH_ALEN); /* SA */ 955 - } else if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_CTL) { 961 + } else if (ieee80211_is_ctl(hdr->frame_control)) { 956 962 /* control:ACK does not have addr2 or addr3 */ 957 963 memset(hdr->addr2, 0, ETH_ALEN); 958 964 memset(hdr->addr3, 0, ETH_ALEN); ··· 961 967 memcpy(hdr->addr3, dev->dev_addr, ETH_ALEN); /* BSSID */ 962 968 } 963 969 964 - hdr->frame_ctl = cpu_to_le16(fc); 970 + hdr->frame_control = cpu_to_le16(fc); 965 971 966 972 meta = (struct hostap_skb_tx_data *) skb->cb; 967 973 memset(meta, 0, sizeof(*meta)); ··· 1278 1284 struct hostap_80211_rx_status *rx_stats) 1279 1285 { 1280 1286 struct net_device *dev = local->dev; 1281 - struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; 1287 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1282 1288 size_t hdrlen; 1283 1289 struct ap_data *ap = local->ap; 1284 1290 char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL; 1285 1291 int len, olen; 1286 1292 u16 auth_alg, auth_transaction, status_code; 1287 1293 __le16 *pos; 1288 - u16 resp = WLAN_STATUS_SUCCESS, fc; 1294 + u16 resp = WLAN_STATUS_SUCCESS; 1289 1295 struct sta_info *sta = NULL; 1290 1296 struct lib80211_crypt_data *crypt; 1291 1297 char *txt = ""; 1292 1298 1293 1299 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1294 1300 1295 - fc = le16_to_cpu(hdr->frame_ctl); 1296 - hdrlen = hostap_80211_get_hdrlen(fc); 1301 + hdrlen = hostap_80211_get_hdrlen(hdr->frame_control); 1297 1302 1298 1303 if (len < 6) { 1299 1304 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " ··· 1428 1435 challenge == NULL || 1429 1436 memcmp(sta->u.sta.challenge, challenge, 1430 1437 WLAN_AUTH_CHALLENGE_LEN) != 0 || 1431 - !(fc & IEEE80211_FCTL_PROTECTED)) { 1438 + !ieee80211_has_protected(hdr->frame_control)) { 1432 1439 txt = "challenge response incorrect"; 1433 1440 resp = WLAN_STATUS_CHALLENGE_FAIL; 1434 1441 goto fail; ··· 1481 1488 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1482 1489 dev->name, hdr->addr2, 1483 1490 auth_alg, auth_transaction, status_code, len, 1484 - fc, resp, txt); 1491 + le16_to_cpu(hdr->frame_control), resp, txt); 1485 1492 } 1486 1493 } 1487 1494 ··· 1491 1498 struct hostap_80211_rx_status *rx_stats, int reassoc) 1492 1499 { 1493 1500 struct net_device *dev = local->dev; 1494 - struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; 1501 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1495 1502 char body[12], *p, *lpos; 1496 1503 int len, left; 1497 1504 __le16 *pos; ··· 1700 1707 struct hostap_80211_rx_status *rx_stats) 1701 1708 { 1702 1709 struct net_device *dev = local->dev; 1703 - struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; 1710 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1704 1711 char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN); 1705 1712 int len; 1706 1713 u16 reason_code; ··· 1742 1749 struct hostap_80211_rx_status *rx_stats) 1743 1750 { 1744 1751 struct net_device *dev = local->dev; 1745 - struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; 1752 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1746 1753 char *body = skb->data + IEEE80211_MGMT_HDR_LEN; 1747 1754 int len; 1748 1755 u16 reason_code; ··· 1781 1788 1782 1789 /* Called only as a scheduled task for pending AP frames. */ 1783 1790 static void ap_handle_data_nullfunc(local_info_t *local, 1784 - struct ieee80211_hdr_4addr *hdr) 1791 + struct ieee80211_hdr *hdr) 1785 1792 { 1786 1793 struct net_device *dev = local->dev; 1787 1794 ··· 1798 1805 1799 1806 /* Called only as a scheduled task for pending AP frames. */ 1800 1807 static void ap_handle_dropped_data(local_info_t *local, 1801 - struct ieee80211_hdr_4addr *hdr) 1808 + struct ieee80211_hdr *hdr) 1802 1809 { 1803 1810 struct net_device *dev = local->dev; 1804 1811 struct sta_info *sta; ··· 1856 1863 1857 1864 /* Called only as a scheduled task for pending AP frames. */ 1858 1865 static void handle_pspoll(local_info_t *local, 1859 - struct ieee80211_hdr_4addr *hdr, 1866 + struct ieee80211_hdr *hdr, 1860 1867 struct hostap_80211_rx_status *rx_stats) 1861 1868 { 1862 1869 struct net_device *dev = local->dev; ··· 1865 1872 struct sk_buff *skb; 1866 1873 1867 1874 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%pM, TA=%pM PWRMGT=%d\n", 1868 - hdr->addr1, hdr->addr2, 1869 - !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1875 + hdr->addr1, hdr->addr2, !!ieee80211_has_pm(hdr->frame_control)); 1870 1876 1871 1877 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1872 1878 PDEBUG(DEBUG_AP, ··· 1976 1984 static void handle_beacon(local_info_t *local, struct sk_buff *skb, 1977 1985 struct hostap_80211_rx_status *rx_stats) 1978 1986 { 1979 - struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; 1987 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1980 1988 char *body = skb->data + IEEE80211_MGMT_HDR_LEN; 1981 1989 int len, left; 1982 1990 u16 beacon_int, capability; ··· 2135 2143 struct net_device *dev = local->dev; 2136 2144 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2137 2145 u16 fc, type, stype; 2138 - struct ieee80211_hdr_4addr *hdr; 2146 + struct ieee80211_hdr *hdr; 2139 2147 2140 2148 /* FIX: should give skb->len to handler functions and check that the 2141 2149 * buffer is long enough */ 2142 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 2143 - fc = le16_to_cpu(hdr->frame_ctl); 2144 - type = WLAN_FC_GET_TYPE(fc); 2145 - stype = WLAN_FC_GET_STYPE(fc); 2150 + hdr = (struct ieee80211_hdr *) skb->data; 2151 + fc = le16_to_cpu(hdr->frame_control); 2152 + type = fc & IEEE80211_FCTL_FTYPE; 2153 + stype = fc & IEEE80211_FCTL_STYPE; 2146 2154 2147 2155 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 2148 2156 if (!local->hostapd && type == IEEE80211_FTYPE_DATA) { ··· 2254 2262 { 2255 2263 struct hostap_interface *iface; 2256 2264 local_info_t *local; 2257 - u16 fc; 2258 - struct ieee80211_hdr_4addr *hdr; 2265 + struct ieee80211_hdr *hdr; 2259 2266 2260 2267 iface = netdev_priv(dev); 2261 2268 local = iface->local; ··· 2264 2273 2265 2274 local->stats.rx_packets++; 2266 2275 2267 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 2268 - fc = le16_to_cpu(hdr->frame_ctl); 2276 + hdr = (struct ieee80211_hdr *) skb->data; 2269 2277 2270 2278 if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && 2271 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_MGMT && 2272 - WLAN_FC_GET_STYPE(fc) == IEEE80211_STYPE_BEACON) 2279 + ieee80211_is_beacon(hdr->frame_control)) 2273 2280 goto drop; 2274 2281 2275 2282 skb->protocol = cpu_to_be16(ETH_P_HOSTAP); ··· 2283 2294 static void schedule_packet_send(local_info_t *local, struct sta_info *sta) 2284 2295 { 2285 2296 struct sk_buff *skb; 2286 - struct ieee80211_hdr_4addr *hdr; 2297 + struct ieee80211_hdr *hdr; 2287 2298 struct hostap_80211_rx_status rx_stats; 2288 2299 2289 2300 if (skb_queue_empty(&sta->tx_buf)) ··· 2296 2307 return; 2297 2308 } 2298 2309 2299 - hdr = (struct ieee80211_hdr_4addr *) skb_put(skb, 16); 2310 + hdr = (struct ieee80211_hdr *) skb_put(skb, 16); 2300 2311 2301 2312 /* Generate a fake pspoll frame to start packet delivery */ 2302 - hdr->frame_ctl = cpu_to_le16( 2313 + hdr->frame_control = cpu_to_le16( 2303 2314 IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); 2304 2315 memcpy(hdr->addr1, local->dev->dev_addr, ETH_ALEN); 2305 2316 memcpy(hdr->addr2, sta->addr, ETH_ALEN); ··· 2678 2689 struct sta_info *sta = NULL; 2679 2690 struct sk_buff *skb = tx->skb; 2680 2691 int set_tim, ret; 2681 - struct ieee80211_hdr_4addr *hdr; 2692 + struct ieee80211_hdr *hdr; 2682 2693 struct hostap_skb_tx_data *meta; 2683 2694 2684 2695 meta = (struct hostap_skb_tx_data *) skb->cb; ··· 2687 2698 meta->iface->type == HOSTAP_INTERFACE_STA) 2688 2699 goto out; 2689 2700 2690 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 2701 + hdr = (struct ieee80211_hdr *) skb->data; 2691 2702 2692 2703 if (hdr->addr1[0] & 0x01) { 2693 2704 /* broadcast/multicast frame - no AP related processing */ ··· 2742 2753 2743 2754 if (meta->flags & HOSTAP_TX_FLAGS_ADD_MOREDATA) { 2744 2755 /* indicate to STA that more frames follow */ 2745 - hdr->frame_ctl |= 2756 + hdr->frame_control |= 2746 2757 cpu_to_le16(IEEE80211_FCTL_MOREDATA); 2747 2758 } 2748 2759 ··· 2817 2828 void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb) 2818 2829 { 2819 2830 struct sta_info *sta; 2820 - struct ieee80211_hdr_4addr *hdr; 2831 + struct ieee80211_hdr *hdr; 2821 2832 struct hostap_skb_tx_data *meta; 2822 2833 2823 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 2834 + hdr = (struct ieee80211_hdr *) skb->data; 2824 2835 meta = (struct hostap_skb_tx_data *) skb->cb; 2825 2836 2826 2837 spin_lock(&local->ap->sta_table_lock); ··· 2887 2898 2888 2899 2889 2900 /* Called only as a tasklet (software IRQ). Called for each RX frame to update 2890 - * STA power saving state. pwrmgt is a flag from 802.11 frame_ctl field. */ 2891 - int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr_4addr *hdr) 2901 + * STA power saving state. pwrmgt is a flag from 802.11 frame_control field. */ 2902 + int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr) 2892 2903 { 2893 2904 struct sta_info *sta; 2894 2905 u16 fc; ··· 2902 2913 if (!sta) 2903 2914 return -1; 2904 2915 2905 - fc = le16_to_cpu(hdr->frame_ctl); 2916 + fc = le16_to_cpu(hdr->frame_control); 2906 2917 hostap_update_sta_ps2(local, sta, fc & IEEE80211_FCTL_PM, 2907 - WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc)); 2918 + fc & IEEE80211_FCTL_FTYPE, 2919 + fc & IEEE80211_FCTL_STYPE); 2908 2920 2909 2921 atomic_dec(&sta->users); 2910 2922 return 0; ··· 2922 2932 int ret; 2923 2933 struct sta_info *sta; 2924 2934 u16 fc, type, stype; 2925 - struct ieee80211_hdr_4addr *hdr; 2935 + struct ieee80211_hdr *hdr; 2926 2936 2927 2937 if (local->ap == NULL) 2928 2938 return AP_RX_CONTINUE; 2929 2939 2930 - hdr = (struct ieee80211_hdr_4addr *) skb->data; 2940 + hdr = (struct ieee80211_hdr *) skb->data; 2931 2941 2932 - fc = le16_to_cpu(hdr->frame_ctl); 2933 - type = WLAN_FC_GET_TYPE(fc); 2934 - stype = WLAN_FC_GET_STYPE(fc); 2942 + fc = le16_to_cpu(hdr->frame_control); 2943 + type = fc & IEEE80211_FCTL_FTYPE; 2944 + stype = fc & IEEE80211_FCTL_STYPE; 2935 2945 2936 2946 spin_lock(&local->ap->sta_table_lock); 2937 2947 sta = ap_get_sta(local->ap, hdr->addr2); ··· 3054 3064 3055 3065 /* Called only as a tasklet (software IRQ) */ 3056 3066 int hostap_handle_sta_crypto(local_info_t *local, 3057 - struct ieee80211_hdr_4addr *hdr, 3067 + struct ieee80211_hdr *hdr, 3058 3068 struct lib80211_crypt_data **crypt, 3059 3069 void **sta_ptr) 3060 3070 { ··· 3156 3166 3157 3167 /* Called only as a tasklet (software IRQ) */ 3158 3168 int hostap_update_rx_stats(struct ap_data *ap, 3159 - struct ieee80211_hdr_4addr *hdr, 3169 + struct ieee80211_hdr *hdr, 3160 3170 struct hostap_80211_rx_status *rx_stats) 3161 3171 { 3162 3172 struct sta_info *sta;
+3 -3
drivers/net/wireless/hostap/hostap_ap.h
··· 235 235 ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx); 236 236 void hostap_handle_sta_release(void *ptr); 237 237 void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb); 238 - int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr_4addr *hdr); 238 + int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr); 239 239 typedef enum { 240 240 AP_RX_CONTINUE, AP_RX_DROP, AP_RX_EXIT, AP_RX_CONTINUE_NOT_AUTHORIZED 241 241 } ap_rx_ret; ··· 243 243 struct sk_buff *skb, 244 244 struct hostap_80211_rx_status *rx_stats, 245 245 int wds); 246 - int hostap_handle_sta_crypto(local_info_t *local, struct ieee80211_hdr_4addr *hdr, 246 + int hostap_handle_sta_crypto(local_info_t *local, struct ieee80211_hdr *hdr, 247 247 struct lib80211_crypt_data **crypt, 248 248 void **sta_ptr); 249 249 int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr); 250 250 int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr); 251 251 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr); 252 - int hostap_update_rx_stats(struct ap_data *ap, struct ieee80211_hdr_4addr *hdr, 252 + int hostap_update_rx_stats(struct ap_data *ap, struct ieee80211_hdr *hdr, 253 253 struct hostap_80211_rx_status *rx_stats); 254 254 void hostap_update_rates(local_info_t *local); 255 255 void hostap_add_wds_links(local_info_t *local);
+11 -13
drivers/net/wireless/hostap/hostap_hw.c
··· 46 46 #include <linux/rtnetlink.h> 47 47 #include <linux/wireless.h> 48 48 #include <net/iw_handler.h> 49 - #include <net/ieee80211.h> 50 49 #include <net/lib80211.h> 51 50 #include <asm/irq.h> 52 51 ··· 1839 1840 hdr_len = 24; 1840 1841 skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len); 1841 1842 fc = le16_to_cpu(txdesc.frame_control); 1842 - if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && 1843 - (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && 1843 + if (ieee80211_is_data(txdesc.frame_control) && 1844 + ieee80211_has_a4(txdesc.frame_control) && 1844 1845 skb->len >= 30) { 1845 1846 /* Addr4 */ 1846 1847 skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4, ··· 2081 2082 stats.rate = rxdesc->rate; 2082 2083 2083 2084 /* Convert Prism2 RX structure into IEEE 802.11 header */ 2084 - hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(rxdesc->frame_control)); 2085 + hdrlen = hostap_80211_get_hdrlen(rxdesc->frame_control); 2085 2086 if (hdrlen > rx_hdrlen) 2086 2087 hdrlen = rx_hdrlen; 2087 2088 ··· 2203 2204 return; 2204 2205 } 2205 2206 2206 - hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(txdesc->frame_control)); 2207 + hdrlen = hostap_80211_get_hdrlen(txdesc->frame_control); 2207 2208 len = le16_to_cpu(txdesc->data_len); 2208 2209 skb = dev_alloc_skb(hdrlen + len); 2209 2210 if (skb == NULL) { ··· 2314 2315 if (skb->len >= sizeof(*txdesc)) { 2315 2316 /* Convert Prism2 RX structure into IEEE 802.11 header 2316 2317 */ 2317 - u16 fc = le16_to_cpu(txdesc->frame_control); 2318 - int hdrlen = hostap_80211_get_hdrlen(fc); 2318 + int hdrlen = hostap_80211_get_hdrlen(txdesc->frame_control); 2319 2319 memmove(skb_pull(skb, sizeof(*txdesc) - hdrlen), 2320 2320 &txdesc->frame_control, hdrlen); 2321 2321 ··· 2392 2394 PDEBUG(DEBUG_EXTRA, " retry_count=%d tx_rate=%d fc=0x%04x " 2393 2395 "(%s%s%s::%d%s%s)\n", 2394 2396 txdesc.retry_count, txdesc.tx_rate, fc, 2395 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_MGMT ? "Mgmt" : "", 2396 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_CTL ? "Ctrl" : "", 2397 - WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA ? "Data" : "", 2398 - WLAN_FC_GET_STYPE(fc) >> 4, 2399 - fc & IEEE80211_FCTL_TODS ? " ToDS" : "", 2400 - fc & IEEE80211_FCTL_FROMDS ? " FromDS" : ""); 2397 + ieee80211_is_mgmt(txdesc.frame_control) ? "Mgmt" : "", 2398 + ieee80211_is_ctl(txdesc.frame_control) ? "Ctrl" : "", 2399 + ieee80211_is_data(txdesc.frame_control) ? "Data" : "", 2400 + (fc & IEEE80211_FCTL_STYPE) >> 4, 2401 + ieee80211_has_tods(txdesc.frame_control) ? " ToDS" : "", 2402 + ieee80211_has_fromds(txdesc.frame_control) ? " FromDS" : ""); 2401 2403 PDEBUG(DEBUG_EXTRA, " A1=%pM A2=%pM A3=%pM A4=%pM\n", 2402 2404 txdesc.addr1, txdesc.addr2, 2403 2405 txdesc.addr3, txdesc.addr4);
+1
drivers/net/wireless/hostap/hostap_info.c
··· 1 1 /* Host AP driver Info Frame processing (part of hostap.o module) */ 2 2 3 + #include <linux/if_arp.h> 3 4 #include "hostap_wlan.h" 4 5 #include "hostap.h" 5 6 #include "hostap_ap.h"
+1
drivers/net/wireless/hostap/hostap_ioctl.c
··· 2 2 3 3 #include <linux/types.h> 4 4 #include <linux/ethtool.h> 5 + #include <linux/if_arp.h> 5 6 #include <net/lib80211.h> 6 7 7 8 #include "hostap_wlan.h"
+12 -24
drivers/net/wireless/hostap/hostap_main.c
··· 26 26 #include <linux/etherdevice.h> 27 27 #include <net/net_namespace.h> 28 28 #include <net/iw_handler.h> 29 - #include <net/ieee80211.h> 30 29 #include <net/lib80211.h> 31 30 #include <asm/uaccess.h> 32 31 ··· 542 543 fc = __le16_to_cpu(rx->frame_control); 543 544 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " 544 545 "data_len=%d%s%s\n", 545 - fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4, 546 + fc, (fc & IEEE80211_FCTL_FTYPE) >> 2, 547 + (fc & IEEE80211_FCTL_STYPE) >> 4, 546 548 __le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl), 547 549 __le16_to_cpu(rx->data_len), 548 550 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", ··· 570 570 fc = __le16_to_cpu(tx->frame_control); 571 571 printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " 572 572 "data_len=%d%s%s\n", 573 - fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4, 573 + fc, (fc & IEEE80211_FCTL_FTYPE) >> 2, 574 + (fc & IEEE80211_FCTL_STYPE) >> 4, 574 575 __le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl), 575 576 __le16_to_cpu(tx->data_len), 576 577 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", ··· 594 593 } 595 594 596 595 597 - int hostap_80211_get_hdrlen(u16 fc) 596 + int hostap_80211_get_hdrlen(__le16 fc) 598 597 { 599 - int hdrlen = 24; 598 + if (ieee80211_is_data(fc) && ieee80211_has_a4 (fc)) 599 + return 30; /* Addr4 */ 600 + else if (ieee80211_is_cts(fc) || ieee80211_is_ack(fc)) 601 + return 10; 602 + else if (ieee80211_is_ctl(fc)) 603 + return 16; 600 604 601 - switch (WLAN_FC_GET_TYPE(fc)) { 602 - case IEEE80211_FTYPE_DATA: 603 - if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 604 - hdrlen = 30; /* Addr4 */ 605 - break; 606 - case IEEE80211_FTYPE_CTL: 607 - switch (WLAN_FC_GET_STYPE(fc)) { 608 - case IEEE80211_STYPE_CTS: 609 - case IEEE80211_STYPE_ACK: 610 - hdrlen = 10; 611 - break; 612 - default: 613 - hdrlen = 16; 614 - break; 615 - } 616 - break; 617 - } 618 - 619 - return hdrlen; 605 + return 24; 620 606 } 621 607 622 608