Pull misc into release branch
[linux-2.6] / drivers / net / wireless / libertas / types.h
1 /**
2   * This header file contains definition for global types
3   */
4 #ifndef _WLAN_TYPES_
5 #define _WLAN_TYPES_
6
7 #include <linux/if_ether.h>
8 #include <asm/byteorder.h>
9
10 /** IEEE type definitions  */
11 enum ieeetypes_elementid {
12         SSID = 0,
13         SUPPORTED_RATES,
14         FH_PARAM_SET,
15         DS_PARAM_SET,
16         CF_PARAM_SET,
17         TIM,
18         IBSS_PARAM_SET,
19         COUNTRY_INFO = 7,
20
21         CHALLENGE_TEXT = 16,
22
23         EXTENDED_SUPPORTED_RATES = 50,
24
25         VENDOR_SPECIFIC_221 = 221,
26
27         WPA_IE = 221,
28         WPA2_IE = 48,
29
30         EXTRA_IE = 133,
31 } __attribute__ ((packed));
32
33 #ifdef __BIG_ENDIAN
34 #define CAPINFO_MASK    (~(0xda00))
35 #else
36 #define CAPINFO_MASK    (~(0x00da))
37 #endif
38
39 struct ieeetypes_capinfo {
40 #ifdef __BIG_ENDIAN_BITFIELD
41         u8 chanagility:1;
42         u8 pbcc:1;
43         u8 shortpreamble:1;
44         u8 privacy:1;
45         u8 cfpollrqst:1;
46         u8 cfpollable:1;
47         u8 ibss:1;
48         u8 ess:1;
49         u8 rsrvd1:2;
50         u8 dsssofdm:1;
51         u8 rsvrd2:1;
52         u8 apsd:1;
53         u8 shortslottime:1;
54         u8 rsrvd3:1;
55         u8 spectrummgmt:1;
56 #else
57         u8 ess:1;
58         u8 ibss:1;
59         u8 cfpollable:1;
60         u8 cfpollrqst:1;
61         u8 privacy:1;
62         u8 shortpreamble:1;
63         u8 pbcc:1;
64         u8 chanagility:1;
65         u8 spectrummgmt:1;
66         u8 rsrvd3:1;
67         u8 shortslottime:1;
68         u8 apsd:1;
69         u8 rsvrd2:1;
70         u8 dsssofdm:1;
71         u8 rsrvd1:2;
72 #endif
73 } __attribute__ ((packed));
74
75 struct ieeetypes_cfparamset {
76         u8 elementid;
77         u8 len;
78         u8 cfpcnt;
79         u8 cfpperiod;
80         __le16 cfpmaxduration;
81         __le16 cfpdurationremaining;
82 } __attribute__ ((packed));
83
84
85 struct ieeetypes_ibssparamset {
86         u8 elementid;
87         u8 len;
88         __le16 atimwindow;
89 } __attribute__ ((packed));
90
91 union IEEEtypes_ssparamset {
92         struct ieeetypes_cfparamset cfparamset;
93         struct ieeetypes_ibssparamset ibssparamset;
94 } __attribute__ ((packed));
95
96 struct ieeetypes_fhparamset {
97         u8 elementid;
98         u8 len;
99         __le16 dwelltime;
100         u8 hopset;
101         u8 hoppattern;
102         u8 hopindex;
103 } __attribute__ ((packed));
104
105 struct ieeetypes_dsparamset {
106         u8 elementid;
107         u8 len;
108         u8 currentchan;
109 } __attribute__ ((packed));
110
111 union ieeetypes_phyparamset {
112         struct ieeetypes_fhparamset fhparamset;
113         struct ieeetypes_dsparamset dsparamset;
114 } __attribute__ ((packed));
115
116 struct ieeetypes_assocrsp {
117         struct ieeetypes_capinfo capability;
118         __le16 statuscode;
119         __le16 aid;
120         u8 iebuffer[1];
121 } __attribute__ ((packed));
122
123 /** TLV  type ID definition */
124 #define PROPRIETARY_TLV_BASE_ID         0x0100
125
126 /* Terminating TLV type */
127 #define MRVL_TERMINATE_TLV_ID           0xffff
128
129 #define TLV_TYPE_SSID                           0x0000
130 #define TLV_TYPE_RATES                          0x0001
131 #define TLV_TYPE_PHY_FH                         0x0002
132 #define TLV_TYPE_PHY_DS                         0x0003
133 #define TLV_TYPE_CF                                 0x0004
134 #define TLV_TYPE_IBSS                           0x0006
135
136 #define TLV_TYPE_DOMAIN                         0x0007
137
138 #define TLV_TYPE_POWER_CAPABILITY       0x0021
139
140 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0)
141 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 1)
142 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 2)
143 #define TLV_TYPE_RSSI_LOW           (PROPRIETARY_TLV_BASE_ID + 4)
144 #define TLV_TYPE_SNR_LOW            (PROPRIETARY_TLV_BASE_ID + 5)
145 #define TLV_TYPE_FAILCOUNT          (PROPRIETARY_TLV_BASE_ID + 6)
146 #define TLV_TYPE_BCNMISS            (PROPRIETARY_TLV_BASE_ID + 7)
147 #define TLV_TYPE_LED_GPIO           (PROPRIETARY_TLV_BASE_ID + 8)
148 #define TLV_TYPE_LEDBEHAVIOR        (PROPRIETARY_TLV_BASE_ID + 9)
149 #define TLV_TYPE_PASSTHROUGH        (PROPRIETARY_TLV_BASE_ID + 10)
150 #define TLV_TYPE_REASSOCAP          (PROPRIETARY_TLV_BASE_ID + 11)
151 #define TLV_TYPE_POWER_TBL_2_4GHZ   (PROPRIETARY_TLV_BASE_ID + 12)
152 #define TLV_TYPE_POWER_TBL_5GHZ     (PROPRIETARY_TLV_BASE_ID + 13)
153 #define TLV_TYPE_BCASTPROBE         (PROPRIETARY_TLV_BASE_ID + 14)
154 #define TLV_TYPE_NUMSSID_PROBE      (PROPRIETARY_TLV_BASE_ID + 15)
155 #define TLV_TYPE_WMMQSTATUS         (PROPRIETARY_TLV_BASE_ID + 16)
156 #define TLV_TYPE_CRYPTO_DATA        (PROPRIETARY_TLV_BASE_ID + 17)
157 #define TLV_TYPE_WILDCARDSSID       (PROPRIETARY_TLV_BASE_ID + 18)
158 #define TLV_TYPE_TSFTIMESTAMP       (PROPRIETARY_TLV_BASE_ID + 19)
159 #define TLV_TYPE_RSSI_HIGH          (PROPRIETARY_TLV_BASE_ID + 22)
160 #define TLV_TYPE_SNR_HIGH           (PROPRIETARY_TLV_BASE_ID + 23)
161
162 /** TLV related data structures*/
163 struct mrvlietypesheader {
164         __le16 type;
165         __le16 len;
166 } __attribute__ ((packed));
167
168 struct mrvlietypes_data {
169         struct mrvlietypesheader header;
170         u8 Data[1];
171 } __attribute__ ((packed));
172
173 struct mrvlietypes_ratesparamset {
174         struct mrvlietypesheader header;
175         u8 rates[1];
176 } __attribute__ ((packed));
177
178 struct mrvlietypes_ssidparamset {
179         struct mrvlietypesheader header;
180         u8 ssid[1];
181 } __attribute__ ((packed));
182
183 struct mrvlietypes_wildcardssidparamset {
184         struct mrvlietypesheader header;
185         u8 MaxSsidlength;
186         u8 ssid[1];
187 } __attribute__ ((packed));
188
189 struct chanscanmode {
190 #ifdef __BIG_ENDIAN_BITFIELD
191         u8 reserved_2_7:6;
192         u8 disablechanfilt:1;
193         u8 passivescan:1;
194 #else
195         u8 passivescan:1;
196         u8 disablechanfilt:1;
197         u8 reserved_2_7:6;
198 #endif
199 } __attribute__ ((packed));
200
201 struct chanscanparamset {
202         u8 radiotype;
203         u8 channumber;
204         struct chanscanmode chanscanmode;
205         __le16 minscantime;
206         __le16 maxscantime;
207 } __attribute__ ((packed));
208
209 struct mrvlietypes_chanlistparamset {
210         struct mrvlietypesheader header;
211         struct chanscanparamset chanscanparam[1];
212 } __attribute__ ((packed));
213
214 struct cfparamset {
215         u8 cfpcnt;
216         u8 cfpperiod;
217         __le16 cfpmaxduration;
218         __le16 cfpdurationremaining;
219 } __attribute__ ((packed));
220
221 struct ibssparamset {
222         __le16 atimwindow;
223 } __attribute__ ((packed));
224
225 struct mrvlietypes_ssparamset {
226         struct mrvlietypesheader header;
227         union {
228                 struct cfparamset cfparamset[1];
229                 struct ibssparamset ibssparamset[1];
230         } cf_ibss;
231 } __attribute__ ((packed));
232
233 struct fhparamset {
234         __le16 dwelltime;
235         u8 hopset;
236         u8 hoppattern;
237         u8 hopindex;
238 } __attribute__ ((packed));
239
240 struct dsparamset {
241         u8 currentchan;
242 } __attribute__ ((packed));
243
244 struct mrvlietypes_phyparamset {
245         struct mrvlietypesheader header;
246         union {
247                 struct fhparamset fhparamset[1];
248                 struct dsparamset dsparamset[1];
249         } fh_ds;
250 } __attribute__ ((packed));
251
252 struct mrvlietypes_rsnparamset {
253         struct mrvlietypesheader header;
254         u8 rsnie[1];
255 } __attribute__ ((packed));
256
257 struct mrvlietypes_tsftimestamp {
258         struct mrvlietypesheader header;
259         __le64 tsftable[1];
260 } __attribute__ ((packed));
261
262 /**  Local Power capability */
263 struct mrvlietypes_powercapability {
264         struct mrvlietypesheader header;
265         s8 minpower;
266         s8 maxpower;
267 } __attribute__ ((packed));
268
269 struct mrvlietypes_rssithreshold {
270         struct mrvlietypesheader header;
271         u8 rssivalue;
272         u8 rssifreq;
273 } __attribute__ ((packed));
274
275 struct mrvlietypes_snrthreshold {
276         struct mrvlietypesheader header;
277         u8 snrvalue;
278         u8 snrfreq;
279 } __attribute__ ((packed));
280
281 struct mrvlietypes_failurecount {
282         struct mrvlietypesheader header;
283         u8 failvalue;
284         u8 Failfreq;
285 } __attribute__ ((packed));
286
287 struct mrvlietypes_beaconsmissed {
288         struct mrvlietypesheader header;
289         u8 beaconmissed;
290         u8 reserved;
291 } __attribute__ ((packed));
292
293 struct mrvlietypes_numprobes {
294         struct mrvlietypesheader header;
295         __le16 numprobes;
296 } __attribute__ ((packed));
297
298 struct mrvlietypes_bcastprobe {
299         struct mrvlietypesheader header;
300         __le16 bcastprobe;
301 } __attribute__ ((packed));
302
303 struct mrvlietypes_numssidprobe {
304         struct mrvlietypesheader header;
305         __le16 numssidprobe;
306 } __attribute__ ((packed));
307
308 struct led_pin {
309         u8 led;
310         u8 pin;
311 } __attribute__ ((packed));
312
313 struct mrvlietypes_ledgpio {
314         struct mrvlietypesheader header;
315         struct led_pin ledpin[1];
316 } __attribute__ ((packed));
317
318 #endif                          /* _WLAN_TYPES_ */