temp revert rk change
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / bcm4329 / include / proto / wpa.h
1 /*
2  * Fundamental types and constants relating to WPA
3  *
4  * Copyright (C) 1999-2010, Broadcom Corporation
5  * 
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:
11  * 
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.
19  * 
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.
23  *
24  * $Id: wpa.h,v 1.16.166.1.20.1 2008/11/20 00:51:31 Exp $
25  */
26
27
28 #ifndef _proto_wpa_h_
29 #define _proto_wpa_h_
30
31 #include <typedefs.h>
32 #include <proto/ethernet.h>
33
34
35
36 #include <packed_section_start.h>
37
38
39
40
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      
52
53 #define WPA2_PMKID_LEN  16
54
55
56 typedef BWL_PRE_PACKED_STRUCT struct
57 {
58         uint8 tag;      
59         uint8 length;   
60         uint8 oui[3];   
61         uint8 oui_type; 
62         BWL_PRE_PACKED_STRUCT struct {
63                 uint8 low;
64                 uint8 high;
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
70
71 typedef BWL_PRE_PACKED_STRUCT struct {
72         uint8 tag;      
73         uint8 length;   
74         BWL_PRE_PACKED_STRUCT struct {
75                 uint8 low;
76                 uint8 high;
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];
82
83
84 typedef BWL_PRE_PACKED_STRUCT struct
85 {
86         uint8 oui[3];
87         uint8 type;
88 } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
89 #define WPA_SUITE_LEN   4
90
91
92 typedef BWL_PRE_PACKED_STRUCT struct
93 {
94         BWL_PRE_PACKED_STRUCT struct {
95                 uint8 low;
96                 uint8 high;
97         } BWL_POST_PACKED_STRUCT count;
98         wpa_suite_t list[1];
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
102 {
103         BWL_PRE_PACKED_STRUCT struct {
104                 uint8 low;
105                 uint8 high;
106         } BWL_POST_PACKED_STRUCT count;
107         wpa_pmkid_t list[1];
108 } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
109
110
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       
117
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)
124
125
126 #define WPA_TKIP_CM_DETECT      60      
127 #define WPA_TKIP_CM_BLOCK       60      
128
129
130 #define RSN_CAP_LEN             2       
131
132
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
143
144
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
149
150
151 #define WPA_CAP_LEN     RSN_CAP_LEN     
152
153 #define WPA_CAP_WPA2_PREAUTH            RSN_CAP_PREAUTH
154
155
156
157 #include <packed_section_end.h>
158
159 #endif