diff options
-rw-r--r-- | include/linux/etherdevice.h | 2 | ||||
-rw-r--r-- | include/net/ieee80211.h | 48 |
2 files changed, 11 insertions, 39 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index a1478258d002..8a2df4dfbc59 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -65,7 +65,7 @@ static inline int is_zero_ether_addr(const u8 *addr) | |||
65 | */ | 65 | */ |
66 | static inline int is_multicast_ether_addr(const u8 *addr) | 66 | static inline int is_multicast_ether_addr(const u8 *addr) |
67 | { | 67 | { |
68 | return addr[0] & 0x01; | 68 | return ((addr[0] != 0xff) && (0x01 & addr[0])); |
69 | } | 69 | } |
70 | 70 | ||
71 | /** | 71 | /** |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 7fe57f957a51..151c4f203559 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -94,6 +94,8 @@ struct eapol { | |||
94 | u16 length; | 94 | u16 length; |
95 | } __attribute__ ((packed)); | 95 | } __attribute__ ((packed)); |
96 | 96 | ||
97 | #define IEEE80211_1ADDR_LEN 10 | ||
98 | #define IEEE80211_2ADDR_LEN 16 | ||
97 | #define IEEE80211_3ADDR_LEN 24 | 99 | #define IEEE80211_3ADDR_LEN 24 |
98 | #define IEEE80211_4ADDR_LEN 30 | 100 | #define IEEE80211_4ADDR_LEN 30 |
99 | #define IEEE80211_FCS_LEN 4 | 101 | #define IEEE80211_FCS_LEN 4 |
@@ -300,23 +302,6 @@ struct ieee80211_snap_hdr { | |||
300 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 | 302 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 |
301 | 303 | ||
302 | 304 | ||
303 | /* Information Element IDs */ | ||
304 | #define WLAN_EID_SSID 0 | ||
305 | #define WLAN_EID_SUPP_RATES 1 | ||
306 | #define WLAN_EID_FH_PARAMS 2 | ||
307 | #define WLAN_EID_DS_PARAMS 3 | ||
308 | #define WLAN_EID_CF_PARAMS 4 | ||
309 | #define WLAN_EID_TIM 5 | ||
310 | #define WLAN_EID_IBSS_PARAMS 6 | ||
311 | #define WLAN_EID_CHALLENGE 16 | ||
312 | #define WLAN_EID_RSN 48 | ||
313 | #define WLAN_EID_GENERIC 221 | ||
314 | |||
315 | #define IEEE80211_MGMT_HDR_LEN 24 | ||
316 | #define IEEE80211_DATA_HDR3_LEN 24 | ||
317 | #define IEEE80211_DATA_HDR4_LEN 30 | ||
318 | |||
319 | |||
320 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 305 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
321 | #define IEEE80211_STATMASK_RSSI (1<<1) | 306 | #define IEEE80211_STATMASK_RSSI (1<<1) |
322 | #define IEEE80211_STATMASK_NOISE (1<<2) | 307 | #define IEEE80211_STATMASK_NOISE (1<<2) |
@@ -441,6 +426,8 @@ struct ieee80211_stats { | |||
441 | 426 | ||
442 | struct ieee80211_device; | 427 | struct ieee80211_device; |
443 | 428 | ||
429 | #include "ieee80211_crypt.h" | ||
430 | |||
444 | #define SEC_KEY_1 (1<<0) | 431 | #define SEC_KEY_1 (1<<0) |
445 | #define SEC_KEY_2 (1<<1) | 432 | #define SEC_KEY_2 (1<<1) |
446 | #define SEC_KEY_3 (1<<2) | 433 | #define SEC_KEY_3 (1<<2) |
@@ -488,15 +475,6 @@ Total: 28-2340 bytes | |||
488 | 475 | ||
489 | */ | 476 | */ |
490 | 477 | ||
491 | struct ieee80211_header_data { | ||
492 | u16 frame_ctl; | ||
493 | u16 duration_id; | ||
494 | u8 addr1[6]; | ||
495 | u8 addr2[6]; | ||
496 | u8 addr3[6]; | ||
497 | u16 seq_ctrl; | ||
498 | }; | ||
499 | |||
500 | #define BEACON_PROBE_SSID_ID_POSITION 12 | 478 | #define BEACON_PROBE_SSID_ID_POSITION 12 |
501 | 479 | ||
502 | /* Management Frame Information Element Types */ | 480 | /* Management Frame Information Element Types */ |
@@ -541,7 +519,7 @@ struct ieee80211_info_element { | |||
541 | */ | 519 | */ |
542 | 520 | ||
543 | struct ieee80211_authentication { | 521 | struct ieee80211_authentication { |
544 | struct ieee80211_header_data header; | 522 | struct ieee80211_hdr_3addr header; |
545 | u16 algorithm; | 523 | u16 algorithm; |
546 | u16 transaction; | 524 | u16 transaction; |
547 | u16 status; | 525 | u16 status; |
@@ -550,7 +528,7 @@ struct ieee80211_authentication { | |||
550 | 528 | ||
551 | 529 | ||
552 | struct ieee80211_probe_response { | 530 | struct ieee80211_probe_response { |
553 | struct ieee80211_header_data header; | 531 | struct ieee80211_hdr_3addr header; |
554 | u32 time_stamp[2]; | 532 | u32 time_stamp[2]; |
555 | u16 beacon_interval; | 533 | u16 beacon_interval; |
556 | u16 capability; | 534 | u16 capability; |
@@ -648,12 +626,6 @@ enum ieee80211_state { | |||
648 | #define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5] | 626 | #define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5] |
649 | 627 | ||
650 | 628 | ||
651 | extern inline int is_broadcast_ether_addr(const u8 *addr) | ||
652 | { | ||
653 | return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ | ||
654 | (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); | ||
655 | } | ||
656 | |||
657 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) | 629 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) |
658 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) | 630 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) |
659 | 631 | ||
@@ -787,21 +759,21 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod | |||
787 | 759 | ||
788 | extern inline int ieee80211_get_hdrlen(u16 fc) | 760 | extern inline int ieee80211_get_hdrlen(u16 fc) |
789 | { | 761 | { |
790 | int hdrlen = 24; | 762 | int hdrlen = IEEE80211_3ADDR_LEN; |
791 | 763 | ||
792 | switch (WLAN_FC_GET_TYPE(fc)) { | 764 | switch (WLAN_FC_GET_TYPE(fc)) { |
793 | case IEEE80211_FTYPE_DATA: | 765 | case IEEE80211_FTYPE_DATA: |
794 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) | 766 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) |
795 | hdrlen = 30; /* Addr4 */ | 767 | hdrlen = IEEE80211_4ADDR_LEN; |
796 | break; | 768 | break; |
797 | case IEEE80211_FTYPE_CTL: | 769 | case IEEE80211_FTYPE_CTL: |
798 | switch (WLAN_FC_GET_STYPE(fc)) { | 770 | switch (WLAN_FC_GET_STYPE(fc)) { |
799 | case IEEE80211_STYPE_CTS: | 771 | case IEEE80211_STYPE_CTS: |
800 | case IEEE80211_STYPE_ACK: | 772 | case IEEE80211_STYPE_ACK: |
801 | hdrlen = 10; | 773 | hdrlen = IEEE80211_1ADDR_LEN; |
802 | break; | 774 | break; |
803 | default: | 775 | default: |
804 | hdrlen = 16; | 776 | hdrlen = IEEE80211_2ADDR_LEN; |
805 | break; | 777 | break; |
806 | } | 778 | } |
807 | break; | 779 | break; |