2 * Fundamental types and constants relating to WPA
4 * Copyright (C) 1999-2010, Broadcom Corporation
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
24 * $Id: wpa.h,v 1.16.166.1.20.1 2008/11/20 00:51:31 Exp $
32 #include <proto/ethernet.h>
36 #include <packed_section_start.h>
41 #define DOT11_RC_INVALID_WPA_IE 13
42 #define DOT11_RC_MIC_FAILURE 14
43 #define DOT11_RC_4WH_TIMEOUT 15
44 #define DOT11_RC_GTK_UPDATE_TIMEOUT 16
45 #define DOT11_RC_WPA_IE_MISMATCH 17
46 #define DOT11_RC_INVALID_MC_CIPHER 18
47 #define DOT11_RC_INVALID_UC_CIPHER 19
48 #define DOT11_RC_INVALID_AKMP 20
49 #define DOT11_RC_BAD_WPA_VERSION 21
50 #define DOT11_RC_INVALID_WPA_CAP 22
51 #define DOT11_RC_8021X_AUTH_FAIL 23
53 #define WPA2_PMKID_LEN 16
56 typedef BWL_PRE_PACKED_STRUCT struct
62 BWL_PRE_PACKED_STRUCT struct {
65 } BWL_POST_PACKED_STRUCT version;
66 } BWL_POST_PACKED_STRUCT wpa_ie_fixed_t;
67 #define WPA_IE_OUITYPE_LEN 4
68 #define WPA_IE_FIXED_LEN 8
69 #define WPA_IE_TAG_FIXED_LEN 6
71 typedef BWL_PRE_PACKED_STRUCT struct {
74 BWL_PRE_PACKED_STRUCT struct {
77 } BWL_POST_PACKED_STRUCT version;
78 } BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t;
79 #define WPA_RSN_IE_FIXED_LEN 4
80 #define WPA_RSN_IE_TAG_FIXED_LEN 2
81 typedef uint8 wpa_pmkid_t[WPA2_PMKID_LEN];
84 typedef BWL_PRE_PACKED_STRUCT struct
88 } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
89 #define WPA_SUITE_LEN 4
92 typedef BWL_PRE_PACKED_STRUCT struct
94 BWL_PRE_PACKED_STRUCT struct {
97 } BWL_POST_PACKED_STRUCT count;
99 } BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
100 #define WPA_IE_SUITE_COUNT_LEN 2
101 typedef BWL_PRE_PACKED_STRUCT struct
103 BWL_PRE_PACKED_STRUCT struct {
106 } BWL_POST_PACKED_STRUCT count;
108 } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
111 #define WPA_CIPHER_NONE 0
112 #define WPA_CIPHER_WEP_40 1
113 #define WPA_CIPHER_TKIP 2
114 #define WPA_CIPHER_AES_OCB 3
115 #define WPA_CIPHER_AES_CCM 4
116 #define WPA_CIPHER_WEP_104 5
118 #define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
119 (cipher) == WPA_CIPHER_WEP_40 || \
120 (cipher) == WPA_CIPHER_WEP_104 || \
121 (cipher) == WPA_CIPHER_TKIP || \
122 (cipher) == WPA_CIPHER_AES_OCB || \
123 (cipher) == WPA_CIPHER_AES_CCM)
126 #define WPA_TKIP_CM_DETECT 60
127 #define WPA_TKIP_CM_BLOCK 60
130 #define RSN_CAP_LEN 2
133 #define RSN_CAP_PREAUTH 0x0001
134 #define RSN_CAP_NOPAIRWISE 0x0002
135 #define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
136 #define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2
137 #define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030
138 #define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4
139 #define RSN_CAP_1_REPLAY_CNTR 0
140 #define RSN_CAP_2_REPLAY_CNTRS 1
141 #define RSN_CAP_4_REPLAY_CNTRS 2
142 #define RSN_CAP_16_REPLAY_CNTRS 3
145 #define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS
146 #define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS
147 #define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT
148 #define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK
151 #define WPA_CAP_LEN RSN_CAP_LEN
153 #define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH
157 #include <packed_section_end.h>