2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <proto/ethernet.h>
22 #include <packed_section_start.h>
24 #define DOT11_RC_INVALID_WPA_IE 13
25 #define DOT11_RC_MIC_FAILURE 14
26 #define DOT11_RC_4WH_TIMEOUT 15
27 #define DOT11_RC_GTK_UPDATE_TIMEOUT 16
28 #define DOT11_RC_WPA_IE_MISMATCH 17
29 #define DOT11_RC_INVALID_MC_CIPHER 18
30 #define DOT11_RC_INVALID_UC_CIPHER 19
31 #define DOT11_RC_INVALID_AKMP 20
32 #define DOT11_RC_BAD_WPA_VERSION 21
33 #define DOT11_RC_INVALID_WPA_CAP 22
34 #define DOT11_RC_8021X_AUTH_FAIL 23
36 #define WPA2_PMKID_LEN 16
38 typedef BWL_PRE_PACKED_STRUCT struct {
43 BWL_PRE_PACKED_STRUCT struct {
46 } BWL_POST_PACKED_STRUCT version;
47 } BWL_POST_PACKED_STRUCT wpa_ie_fixed_t;
48 #define WPA_IE_OUITYPE_LEN 4
49 #define WPA_IE_FIXED_LEN 8
50 #define WPA_IE_TAG_FIXED_LEN 6
52 typedef BWL_PRE_PACKED_STRUCT struct {
55 BWL_PRE_PACKED_STRUCT struct {
58 } BWL_POST_PACKED_STRUCT version;
59 } BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t;
60 #define WPA_RSN_IE_FIXED_LEN 4
61 #define WPA_RSN_IE_TAG_FIXED_LEN 2
62 typedef u8 wpa_pmkid_t[WPA2_PMKID_LEN];
64 typedef BWL_PRE_PACKED_STRUCT struct {
67 } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
68 #define WPA_SUITE_LEN 4
70 typedef BWL_PRE_PACKED_STRUCT struct {
71 BWL_PRE_PACKED_STRUCT struct {
74 } BWL_POST_PACKED_STRUCT count;
76 } BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
77 #define WPA_IE_SUITE_COUNT_LEN 2
78 typedef BWL_PRE_PACKED_STRUCT struct {
79 BWL_PRE_PACKED_STRUCT struct {
82 } BWL_POST_PACKED_STRUCT count;
84 } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
86 #define WPA_CIPHER_NONE 0
87 #define WPA_CIPHER_WEP_40 1
88 #define WPA_CIPHER_TKIP 2
89 #define WPA_CIPHER_AES_OCB 3
90 #define WPA_CIPHER_AES_CCM 4
91 #define WPA_CIPHER_WEP_104 5
93 #define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
94 (cipher) == WPA_CIPHER_WEP_40 || \
95 (cipher) == WPA_CIPHER_WEP_104 || \
96 (cipher) == WPA_CIPHER_TKIP || \
97 (cipher) == WPA_CIPHER_AES_OCB || \
98 (cipher) == WPA_CIPHER_AES_CCM)
100 #define WPA_TKIP_CM_DETECT 60
101 #define WPA_TKIP_CM_BLOCK 60
103 #define RSN_CAP_LEN 2
105 #define RSN_CAP_PREAUTH 0x0001
106 #define RSN_CAP_NOPAIRWISE 0x0002
107 #define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
108 #define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2
109 #define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030
110 #define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4
111 #define RSN_CAP_1_REPLAY_CNTR 0
112 #define RSN_CAP_2_REPLAY_CNTRS 1
113 #define RSN_CAP_4_REPLAY_CNTRS 2
114 #define RSN_CAP_16_REPLAY_CNTRS 3
116 #define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS
117 #define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS
118 #define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT
119 #define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK
121 #define WPA_CAP_LEN RSN_CAP_LEN
123 #define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH
125 #include <packed_section_end.h>
127 #endif /* _proto_wpa_h_ */