diff options
author | Jiri Benc <jbenc@suse.cz> | 2005-05-24 09:10:18 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-27 22:43:30 -0400 |
commit | 286d974797705ae7ceedc846666ef98bdeee3646 (patch) | |
tree | 512275d067849ba49a41d1fe00b9954cb1fe38ee | |
parent | 76fe1b0e4c093f985c66a062c9c10370b4985796 (diff) |
[PATCH] ieee80211: cleanup
Cleanup of unused and duplicated constants and structures in the ieee80211
header.
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: Jirka Bohac <jbohac@suse.cz>
-rw-r--r-- | include/net/ieee80211.h | 40 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 4 |
2 files changed, 10 insertions, 34 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index b1bfaf1084f4..f1d9b9e9dec7 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -93,6 +93,8 @@ struct eapol { | |||
93 | u16 length; | 93 | u16 length; |
94 | } __attribute__ ((packed)); | 94 | } __attribute__ ((packed)); |
95 | 95 | ||
96 | #define IEEE80211_1ADDR_LEN 10 | ||
97 | #define IEEE80211_2ADDR_LEN 16 | ||
96 | #define IEEE80211_3ADDR_LEN 24 | 98 | #define IEEE80211_3ADDR_LEN 24 |
97 | #define IEEE80211_4ADDR_LEN 30 | 99 | #define IEEE80211_4ADDR_LEN 30 |
98 | #define IEEE80211_FCS_LEN 4 | 100 | #define IEEE80211_FCS_LEN 4 |
@@ -299,23 +301,6 @@ struct ieee80211_snap_hdr { | |||
299 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 | 301 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 |
300 | 302 | ||
301 | 303 | ||
302 | /* Information Element IDs */ | ||
303 | #define WLAN_EID_SSID 0 | ||
304 | #define WLAN_EID_SUPP_RATES 1 | ||
305 | #define WLAN_EID_FH_PARAMS 2 | ||
306 | #define WLAN_EID_DS_PARAMS 3 | ||
307 | #define WLAN_EID_CF_PARAMS 4 | ||
308 | #define WLAN_EID_TIM 5 | ||
309 | #define WLAN_EID_IBSS_PARAMS 6 | ||
310 | #define WLAN_EID_CHALLENGE 16 | ||
311 | #define WLAN_EID_RSN 48 | ||
312 | #define WLAN_EID_GENERIC 221 | ||
313 | |||
314 | #define IEEE80211_MGMT_HDR_LEN 24 | ||
315 | #define IEEE80211_DATA_HDR3_LEN 24 | ||
316 | #define IEEE80211_DATA_HDR4_LEN 30 | ||
317 | |||
318 | |||
319 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 304 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
320 | #define IEEE80211_STATMASK_RSSI (1<<1) | 305 | #define IEEE80211_STATMASK_RSSI (1<<1) |
321 | #define IEEE80211_STATMASK_NOISE (1<<2) | 306 | #define IEEE80211_STATMASK_NOISE (1<<2) |
@@ -489,15 +474,6 @@ Total: 28-2340 bytes | |||
489 | 474 | ||
490 | */ | 475 | */ |
491 | 476 | ||
492 | struct ieee80211_header_data { | ||
493 | u16 frame_ctl; | ||
494 | u16 duration_id; | ||
495 | u8 addr1[6]; | ||
496 | u8 addr2[6]; | ||
497 | u8 addr3[6]; | ||
498 | u16 seq_ctrl; | ||
499 | }; | ||
500 | |||
501 | #define BEACON_PROBE_SSID_ID_POSITION 12 | 477 | #define BEACON_PROBE_SSID_ID_POSITION 12 |
502 | 478 | ||
503 | /* Management Frame Information Element Types */ | 479 | /* Management Frame Information Element Types */ |
@@ -542,7 +518,7 @@ struct ieee80211_info_element { | |||
542 | */ | 518 | */ |
543 | 519 | ||
544 | struct ieee80211_authentication { | 520 | struct ieee80211_authentication { |
545 | struct ieee80211_header_data header; | 521 | struct ieee80211_hdr_3addr header; |
546 | u16 algorithm; | 522 | u16 algorithm; |
547 | u16 transaction; | 523 | u16 transaction; |
548 | u16 status; | 524 | u16 status; |
@@ -551,7 +527,7 @@ struct ieee80211_authentication { | |||
551 | 527 | ||
552 | 528 | ||
553 | struct ieee80211_probe_response { | 529 | struct ieee80211_probe_response { |
554 | struct ieee80211_header_data header; | 530 | struct ieee80211_hdr_3addr header; |
555 | u32 time_stamp[2]; | 531 | u32 time_stamp[2]; |
556 | u16 beacon_interval; | 532 | u16 beacon_interval; |
557 | u16 capability; | 533 | u16 capability; |
@@ -793,21 +769,21 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod | |||
793 | 769 | ||
794 | extern inline int ieee80211_get_hdrlen(u16 fc) | 770 | extern inline int ieee80211_get_hdrlen(u16 fc) |
795 | { | 771 | { |
796 | int hdrlen = 24; | 772 | int hdrlen = IEEE80211_3ADDR_LEN; |
797 | 773 | ||
798 | switch (WLAN_FC_GET_TYPE(fc)) { | 774 | switch (WLAN_FC_GET_TYPE(fc)) { |
799 | case IEEE80211_FTYPE_DATA: | 775 | case IEEE80211_FTYPE_DATA: |
800 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) | 776 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) |
801 | hdrlen = 30; /* Addr4 */ | 777 | hdrlen = IEEE80211_4ADDR_LEN; |
802 | break; | 778 | break; |
803 | case IEEE80211_FTYPE_CTL: | 779 | case IEEE80211_FTYPE_CTL: |
804 | switch (WLAN_FC_GET_STYPE(fc)) { | 780 | switch (WLAN_FC_GET_STYPE(fc)) { |
805 | case IEEE80211_STYPE_CTS: | 781 | case IEEE80211_STYPE_CTS: |
806 | case IEEE80211_STYPE_ACK: | 782 | case IEEE80211_STYPE_ACK: |
807 | hdrlen = 10; | 783 | hdrlen = IEEE80211_1ADDR_LEN; |
808 | break; | 784 | break; |
809 | default: | 785 | default: |
810 | hdrlen = 16; | 786 | hdrlen = IEEE80211_2ADDR_LEN; |
811 | break; | 787 | break; |
812 | } | 788 | } |
813 | break; | 789 | break; |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 2bda8a174818..2ae6ab8914b0 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -475,7 +475,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
475 | #endif | 475 | #endif |
476 | 476 | ||
477 | /* Data frame - extract src/dst addresses */ | 477 | /* Data frame - extract src/dst addresses */ |
478 | if (skb->len < IEEE80211_DATA_HDR3_LEN) | 478 | if (skb->len < IEEE80211_3ADDR_LEN) |
479 | goto rx_dropped; | 479 | goto rx_dropped; |
480 | 480 | ||
481 | switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { | 481 | switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { |
@@ -488,7 +488,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
488 | memcpy(src, hdr->addr2, ETH_ALEN); | 488 | memcpy(src, hdr->addr2, ETH_ALEN); |
489 | break; | 489 | break; |
490 | case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: | 490 | case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: |
491 | if (skb->len < IEEE80211_DATA_HDR4_LEN) | 491 | if (skb->len < IEEE80211_4ADDR_LEN) |
492 | goto rx_dropped; | 492 | goto rx_dropped; |
493 | memcpy(dst, hdr->addr3, ETH_ALEN); | 493 | memcpy(dst, hdr->addr3, ETH_ALEN); |
494 | memcpy(src, hdr->addr4, ETH_ALEN); | 494 | memcpy(src, hdr->addr4, ETH_ALEN); |