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.
21 #include <proto/ethernet.h>
23 #include <packed_section_start.h>
25 #define DOT11_RC_INVALID_WPA_IE 13
26 #define DOT11_RC_MIC_FAILURE 14
27 #define DOT11_RC_4WH_TIMEOUT 15
28 #define DOT11_RC_GTK_UPDATE_TIMEOUT 16
29 #define DOT11_RC_WPA_IE_MISMATCH 17
30 #define DOT11_RC_INVALID_MC_CIPHER 18
31 #define DOT11_RC_INVALID_UC_CIPHER 19
32 #define DOT11_RC_INVALID_AKMP 20
33 #define DOT11_RC_BAD_WPA_VERSION 21
34 #define DOT11_RC_INVALID_WPA_CAP 22
35 #define DOT11_RC_8021X_AUTH_FAIL 23
37 #define WPA2_PMKID_LEN 16
39 typedef BWL_PRE_PACKED_STRUCT struct {
44 BWL_PRE_PACKED_STRUCT struct {
47 } BWL_POST_PACKED_STRUCT version;
48 } BWL_POST_PACKED_STRUCT wpa_ie_fixed_t;
49 #define WPA_IE_OUITYPE_LEN 4
50 #define WPA_IE_FIXED_LEN 8
51 #define WPA_IE_TAG_FIXED_LEN 6
53 typedef BWL_PRE_PACKED_STRUCT struct {
56 BWL_PRE_PACKED_STRUCT struct {
59 } BWL_POST_PACKED_STRUCT version;
60 } BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t;
61 #define WPA_RSN_IE_FIXED_LEN 4
62 #define WPA_RSN_IE_TAG_FIXED_LEN 2
63 typedef u8 wpa_pmkid_t[WPA2_PMKID_LEN];
65 typedef BWL_PRE_PACKED_STRUCT struct {
68 } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
69 #define WPA_SUITE_LEN 4
71 typedef BWL_PRE_PACKED_STRUCT struct {
72 BWL_PRE_PACKED_STRUCT struct {
75 } BWL_POST_PACKED_STRUCT count;
77 } BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
78 #define WPA_IE_SUITE_COUNT_LEN 2
79 typedef BWL_PRE_PACKED_STRUCT struct {
80 BWL_PRE_PACKED_STRUCT struct {
83 } BWL_POST_PACKED_STRUCT count;
85 } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
87 #define WPA_CIPHER_NONE 0
88 #define WPA_CIPHER_WEP_40 1
89 #define WPA_CIPHER_TKIP 2
90 #define WPA_CIPHER_AES_OCB 3
91 #define WPA_CIPHER_AES_CCM 4
92 #define WPA_CIPHER_WEP_104 5
94 #define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
95 (cipher) == WPA_CIPHER_WEP_40 || \
96 (cipher) == WPA_CIPHER_WEP_104 || \
97 (cipher) == WPA_CIPHER_TKIP || \
98 (cipher) == WPA_CIPHER_AES_OCB || \
99 (cipher) == WPA_CIPHER_AES_CCM)
101 #define WPA_TKIP_CM_DETECT 60
102 #define WPA_TKIP_CM_BLOCK 60
104 #define RSN_CAP_LEN 2
106 #define RSN_CAP_PREAUTH 0x0001
107 #define RSN_CAP_NOPAIRWISE 0x0002
108 #define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
109 #define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2
110 #define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030
111 #define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4
112 #define RSN_CAP_1_REPLAY_CNTR 0
113 #define RSN_CAP_2_REPLAY_CNTRS 1
114 #define RSN_CAP_4_REPLAY_CNTRS 2
115 #define RSN_CAP_16_REPLAY_CNTRS 3
117 #define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS
118 #define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS
119 #define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT
120 #define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK
122 #define WPA_CAP_LEN RSN_CAP_LEN
124 #define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH
126 #include <packed_section_end.h>
128 #endif /* _proto_wpa_h_ */