diff options
author | James Ketrenos <jketreno@linux.intel.com> | 2005-09-21 12:54:36 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-21 23:02:30 -0400 |
commit | ee34af37c095482b9dba254b9cd7cb5e65e9a25e (patch) | |
tree | eed75aee11663053e658d839fb91bc8dfae56ecb /include | |
parent | e0d369d1d969fc9e4fd08a20f6dad04d369aceea (diff) |
[PATCH] ieee80211: Renamed ieee80211_hdr to ieee80211_hdr_3addr
tree e9c18b2c8e5ad446a4d213243c2dcf9fd1652a7b
parent 4e97ad6ae7084a4f741e94e76c41c68bc7c5a76a
author James Ketrenos <jketreno@linux.intel.com> 1124444315 -0500
committer James Ketrenos <jketreno@linux.intel.com> 1127312922 -0500
Renamed ieee80211_hdr to ieee80211_hdr_3addr and modified ieee80211_hdr
to just contain the frame_ctrl and duration_id.
Changed uses of ieee80211_hdr to ieee80211_hdr_4addr or
ieee80211_hdr_3addr based on what was expected for that portion of code.
NOTE: This requires changes to ipw2100, ipw2200, hostap, and atmel
drivers.
Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ieee80211.h | 117 |
1 files changed, 90 insertions, 27 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index dfc5d65cc6c1..ebe7e41e5eaf 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -33,33 +33,13 @@ | |||
33 | represents the 2304 bytes of real data, plus a possible 8 bytes of | 33 | represents the 2304 bytes of real data, plus a possible 8 bytes of |
34 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ | 34 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ |
35 | 35 | ||
36 | #define IEEE80211_HLEN 30 | ||
37 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
38 | |||
39 | struct ieee80211_hdr { | ||
40 | __le16 frame_ctl; | ||
41 | __le16 duration_id; | ||
42 | u8 addr1[ETH_ALEN]; | ||
43 | u8 addr2[ETH_ALEN]; | ||
44 | u8 addr3[ETH_ALEN]; | ||
45 | __le16 seq_ctl; | ||
46 | u8 addr4[ETH_ALEN]; | ||
47 | } __attribute__ ((packed)); | ||
48 | |||
49 | struct ieee80211_hdr_3addr { | ||
50 | __le16 frame_ctl; | ||
51 | __le16 duration_id; | ||
52 | u8 addr1[ETH_ALEN]; | ||
53 | u8 addr2[ETH_ALEN]; | ||
54 | u8 addr3[ETH_ALEN]; | ||
55 | __le16 seq_ctl; | ||
56 | } __attribute__ ((packed)); | ||
57 | |||
58 | #define IEEE80211_1ADDR_LEN 10 | 36 | #define IEEE80211_1ADDR_LEN 10 |
59 | #define IEEE80211_2ADDR_LEN 16 | 37 | #define IEEE80211_2ADDR_LEN 16 |
60 | #define IEEE80211_3ADDR_LEN 24 | 38 | #define IEEE80211_3ADDR_LEN 24 |
61 | #define IEEE80211_4ADDR_LEN 30 | 39 | #define IEEE80211_4ADDR_LEN 30 |
62 | #define IEEE80211_FCS_LEN 4 | 40 | #define IEEE80211_FCS_LEN 4 |
41 | #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) | ||
42 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
63 | 43 | ||
64 | #define MIN_FRAG_THRESHOLD 256U | 44 | #define MIN_FRAG_THRESHOLD 256U |
65 | #define MAX_FRAG_THRESHOLD 2346U | 45 | #define MAX_FRAG_THRESHOLD 2346U |
@@ -515,6 +495,51 @@ enum ieee80211_mfie { | |||
515 | MFIE_TYPE_GENERIC = 221, | 495 | MFIE_TYPE_GENERIC = 221, |
516 | }; | 496 | }; |
517 | 497 | ||
498 | /* Minimal header; can be used for passing 802.11 frames with sufficient | ||
499 | * information to determine what type of underlying data type is actually | ||
500 | * stored in the data. */ | ||
501 | struct ieee80211_hdr { | ||
502 | u16 frame_ctl; | ||
503 | u16 duration_id; | ||
504 | u8 payload[0]; | ||
505 | } __attribute__ ((packed)); | ||
506 | |||
507 | struct ieee80211_hdr_1addr { | ||
508 | u16 frame_ctl; | ||
509 | u16 duration_id; | ||
510 | u8 addr1[ETH_ALEN]; | ||
511 | u8 payload[0]; | ||
512 | } __attribute__ ((packed)); | ||
513 | |||
514 | struct ieee80211_hdr_2addr { | ||
515 | u16 frame_ctl; | ||
516 | u16 duration_id; | ||
517 | u8 addr1[ETH_ALEN]; | ||
518 | u8 addr2[ETH_ALEN]; | ||
519 | u8 payload[0]; | ||
520 | } __attribute__ ((packed)); | ||
521 | |||
522 | struct ieee80211_hdr_3addr { | ||
523 | u16 frame_ctl; | ||
524 | u16 duration_id; | ||
525 | u8 addr1[ETH_ALEN]; | ||
526 | u8 addr2[ETH_ALEN]; | ||
527 | u8 addr3[ETH_ALEN]; | ||
528 | u16 seq_ctl; | ||
529 | u8 payload[0]; | ||
530 | } __attribute__ ((packed)); | ||
531 | |||
532 | struct ieee80211_hdr_4addr { | ||
533 | u16 frame_ctl; | ||
534 | u16 duration_id; | ||
535 | u8 addr1[ETH_ALEN]; | ||
536 | u8 addr2[ETH_ALEN]; | ||
537 | u8 addr3[ETH_ALEN]; | ||
538 | u16 seq_ctl; | ||
539 | u8 addr4[ETH_ALEN]; | ||
540 | u8 payload[0]; | ||
541 | } __attribute__ ((packed)); | ||
542 | |||
518 | struct ieee80211_info_element { | 543 | struct ieee80211_info_element { |
519 | u8 id; | 544 | u8 id; |
520 | u8 len; | 545 | u8 len; |
@@ -538,7 +563,7 @@ struct ieee80211_info_element { | |||
538 | u16 status; | 563 | u16 status; |
539 | */ | 564 | */ |
540 | 565 | ||
541 | struct ieee80211_authentication { | 566 | struct ieee80211_auth { |
542 | struct ieee80211_hdr_3addr header; | 567 | struct ieee80211_hdr_3addr header; |
543 | __le16 algorithm; | 568 | __le16 algorithm; |
544 | __le16 transaction; | 569 | __le16 transaction; |
@@ -546,6 +571,17 @@ struct ieee80211_authentication { | |||
546 | struct ieee80211_info_element info_element[0]; | 571 | struct ieee80211_info_element info_element[0]; |
547 | } __attribute__ ((packed)); | 572 | } __attribute__ ((packed)); |
548 | 573 | ||
574 | struct ieee80211_disassoc { | ||
575 | struct ieee80211_hdr_3addr header; | ||
576 | u16 reason_code; | ||
577 | struct ieee80211_info_element info_element[0]; | ||
578 | } __attribute__ ((packed)); | ||
579 | |||
580 | struct ieee80211_probe_request { | ||
581 | struct ieee80211_hdr_3addr header; | ||
582 | struct ieee80211_info_element info_element[0]; | ||
583 | } __attribute__ ((packed)); | ||
584 | |||
549 | struct ieee80211_probe_response { | 585 | struct ieee80211_probe_response { |
550 | struct ieee80211_hdr_3addr header; | 586 | struct ieee80211_hdr_3addr header; |
551 | u32 time_stamp[2]; | 587 | u32 time_stamp[2]; |
@@ -554,14 +590,25 @@ struct ieee80211_probe_response { | |||
554 | struct ieee80211_info_element info_element[0]; | 590 | struct ieee80211_info_element info_element[0]; |
555 | } __attribute__ ((packed)); | 591 | } __attribute__ ((packed)); |
556 | 592 | ||
557 | struct ieee80211_assoc_request_frame { | 593 | /* Alias beacon for probe_response */ |
594 | #define ieee80211_beacon ieee80211_probe_response | ||
595 | |||
596 | struct ieee80211_assoc_request { | ||
597 | struct ieee80211_hdr_3addr header; | ||
598 | u16 capability; | ||
599 | u16 listen_interval; | ||
600 | struct ieee80211_info_element info_element[0]; | ||
601 | } __attribute__ ((packed)); | ||
602 | |||
603 | struct ieee80211_reassoc_request { | ||
604 | struct ieee80211_hdr_3addr header; | ||
558 | __le16 capability; | 605 | __le16 capability; |
559 | __le16 listen_interval; | 606 | __le16 listen_interval; |
560 | u8 current_ap[ETH_ALEN]; | 607 | u8 current_ap[ETH_ALEN]; |
561 | struct ieee80211_info_element info_element[0]; | 608 | struct ieee80211_info_element info_element[0]; |
562 | } __attribute__ ((packed)); | 609 | } __attribute__ ((packed)); |
563 | 610 | ||
564 | struct ieee80211_assoc_response_frame { | 611 | struct ieee80211_assoc_response { |
565 | struct ieee80211_hdr_3addr header; | 612 | struct ieee80211_hdr_3addr header; |
566 | __le16 capability; | 613 | __le16 capability; |
567 | __le16 status; | 614 | __le16 status; |
@@ -572,7 +619,8 @@ struct ieee80211_assoc_response_frame { | |||
572 | struct ieee80211_txb { | 619 | struct ieee80211_txb { |
573 | u8 nr_frags; | 620 | u8 nr_frags; |
574 | u8 encrypted; | 621 | u8 encrypted; |
575 | u16 reserved; | 622 | u8 rts_included; |
623 | u8 reserved; | ||
576 | u16 frag_size; | 624 | u16 frag_size; |
577 | u16 payload_size; | 625 | u16 payload_size; |
578 | struct sk_buff *fragments[0]; | 626 | struct sk_buff *fragments[0]; |
@@ -803,6 +851,21 @@ extern inline int ieee80211_get_hdrlen(u16 fc) | |||
803 | return hdrlen; | 851 | return hdrlen; |
804 | } | 852 | } |
805 | 853 | ||
854 | extern inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) | ||
855 | { | ||
856 | switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { | ||
857 | case IEEE80211_1ADDR_LEN: | ||
858 | return ((struct ieee80211_hdr_1addr *)hdr)->payload; | ||
859 | case IEEE80211_2ADDR_LEN: | ||
860 | return ((struct ieee80211_hdr_2addr *)hdr)->payload; | ||
861 | case IEEE80211_3ADDR_LEN: | ||
862 | return ((struct ieee80211_hdr_3addr *)hdr)->payload; | ||
863 | case IEEE80211_4ADDR_LEN: | ||
864 | return ((struct ieee80211_hdr_4addr *)hdr)->payload; | ||
865 | } | ||
866 | |||
867 | } | ||
868 | |||
806 | /* ieee80211.c */ | 869 | /* ieee80211.c */ |
807 | extern void free_ieee80211(struct net_device *dev); | 870 | extern void free_ieee80211(struct net_device *dev); |
808 | extern struct net_device *alloc_ieee80211(int sizeof_priv); | 871 | extern struct net_device *alloc_ieee80211(int sizeof_priv); |
@@ -817,7 +880,7 @@ extern void ieee80211_txb_free(struct ieee80211_txb *); | |||
817 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 880 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
818 | struct ieee80211_rx_stats *rx_stats); | 881 | struct ieee80211_rx_stats *rx_stats); |
819 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, | 882 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, |
820 | struct ieee80211_hdr *header, | 883 | struct ieee80211_hdr_4addr *header, |
821 | struct ieee80211_rx_stats *stats); | 884 | struct ieee80211_rx_stats *stats); |
822 | 885 | ||
823 | /* ieee80211_wx.c */ | 886 | /* ieee80211_wx.c */ |