[PATCH] libertas: kill ieeetypes_capinfo bitfield, use ieee80211.h types
[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 #define CAPINFO_MASK    (~(0x00da))
34
35 struct ieeetypes_cfparamset {
36         u8 elementid;
37         u8 len;
38         u8 cfpcnt;
39         u8 cfpperiod;
40         __le16 cfpmaxduration;
41         __le16 cfpdurationremaining;
42 } __attribute__ ((packed));
43
44
45 struct ieeetypes_ibssparamset {
46         u8 elementid;
47         u8 len;
48         __le16 atimwindow;
49 } __attribute__ ((packed));
50
51 union IEEEtypes_ssparamset {
52         struct ieeetypes_cfparamset cfparamset;
53         struct ieeetypes_ibssparamset ibssparamset;
54 } __attribute__ ((packed));
55
56 struct ieeetypes_fhparamset {
57         u8 elementid;
58         u8 len;
59         __le16 dwelltime;
60         u8 hopset;
61         u8 hoppattern;
62         u8 hopindex;
63 } __attribute__ ((packed));
64
65 struct ieeetypes_dsparamset {
66         u8 elementid;
67         u8 len;
68         u8 currentchan;
69 } __attribute__ ((packed));
70
71 union ieeetypes_phyparamset {
72         struct ieeetypes_fhparamset fhparamset;
73         struct ieeetypes_dsparamset dsparamset;
74 } __attribute__ ((packed));
75
76 struct ieeetypes_assocrsp {
77         __le16 capability;
78         __le16 statuscode;
79         __le16 aid;
80         u8 iebuffer[1];
81 } __attribute__ ((packed));
82
83 /** TLV  type ID definition */
84 #define PROPRIETARY_TLV_BASE_ID         0x0100
85
86 /* Terminating TLV type */
87 #define MRVL_TERMINATE_TLV_ID           0xffff
88
89 #define TLV_TYPE_SSID                           0x0000
90 #define TLV_TYPE_RATES                          0x0001
91 #define TLV_TYPE_PHY_FH                         0x0002
92 #define TLV_TYPE_PHY_DS                         0x0003
93 #define TLV_TYPE_CF                                 0x0004
94 #define TLV_TYPE_IBSS                           0x0006
95
96 #define TLV_TYPE_DOMAIN                         0x0007
97
98 #define TLV_TYPE_POWER_CAPABILITY       0x0021
99
100 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0)
101 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 1)
102 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 2)
103 #define TLV_TYPE_RSSI_LOW           (PROPRIETARY_TLV_BASE_ID + 4)
104 #define TLV_TYPE_SNR_LOW            (PROPRIETARY_TLV_BASE_ID + 5)
105 #define TLV_TYPE_FAILCOUNT          (PROPRIETARY_TLV_BASE_ID + 6)
106 #define TLV_TYPE_BCNMISS            (PROPRIETARY_TLV_BASE_ID + 7)
107 #define TLV_TYPE_LED_GPIO           (PROPRIETARY_TLV_BASE_ID + 8)
108 #define TLV_TYPE_LEDBEHAVIOR        (PROPRIETARY_TLV_BASE_ID + 9)
109 #define TLV_TYPE_PASSTHROUGH        (PROPRIETARY_TLV_BASE_ID + 10)
110 #define TLV_TYPE_REASSOCAP          (PROPRIETARY_TLV_BASE_ID + 11)
111 #define TLV_TYPE_POWER_TBL_2_4GHZ   (PROPRIETARY_TLV_BASE_ID + 12)
112 #define TLV_TYPE_POWER_TBL_5GHZ     (PROPRIETARY_TLV_BASE_ID + 13)
113 #define TLV_TYPE_BCASTPROBE         (PROPRIETARY_TLV_BASE_ID + 14)
114 #define TLV_TYPE_NUMSSID_PROBE      (PROPRIETARY_TLV_BASE_ID + 15)
115 #define TLV_TYPE_WMMQSTATUS         (PROPRIETARY_TLV_BASE_ID + 16)
116 #define TLV_TYPE_CRYPTO_DATA        (PROPRIETARY_TLV_BASE_ID + 17)
117 #define TLV_TYPE_WILDCARDSSID       (PROPRIETARY_TLV_BASE_ID + 18)
118 #define TLV_TYPE_TSFTIMESTAMP       (PROPRIETARY_TLV_BASE_ID + 19)
119 #define TLV_TYPE_RSSI_HIGH          (PROPRIETARY_TLV_BASE_ID + 22)
120 #define TLV_TYPE_SNR_HIGH           (PROPRIETARY_TLV_BASE_ID + 23)
121
122 /** TLV related data structures*/
123 struct mrvlietypesheader {
124         __le16 type;
125         __le16 len;
126 } __attribute__ ((packed));
127
128 struct mrvlietypes_data {
129         struct mrvlietypesheader header;
130         u8 Data[1];
131 } __attribute__ ((packed));
132
133 struct mrvlietypes_ratesparamset {
134         struct mrvlietypesheader header;
135         u8 rates[1];
136 } __attribute__ ((packed));
137
138 struct mrvlietypes_ssidparamset {
139         struct mrvlietypesheader header;
140         u8 ssid[1];
141 } __attribute__ ((packed));
142
143 struct mrvlietypes_wildcardssidparamset {
144         struct mrvlietypesheader header;
145         u8 MaxSsidlength;
146         u8 ssid[1];
147 } __attribute__ ((packed));
148
149 struct chanscanmode {
150 #ifdef __BIG_ENDIAN_BITFIELD
151         u8 reserved_2_7:6;
152         u8 disablechanfilt:1;
153         u8 passivescan:1;
154 #else
155         u8 passivescan:1;
156         u8 disablechanfilt:1;
157         u8 reserved_2_7:6;
158 #endif
159 } __attribute__ ((packed));
160
161 struct chanscanparamset {
162         u8 radiotype;
163         u8 channumber;
164         struct chanscanmode chanscanmode;
165         __le16 minscantime;
166         __le16 maxscantime;
167 } __attribute__ ((packed));
168
169 struct mrvlietypes_chanlistparamset {
170         struct mrvlietypesheader header;
171         struct chanscanparamset chanscanparam[1];
172 } __attribute__ ((packed));
173
174 struct cfparamset {
175         u8 cfpcnt;
176         u8 cfpperiod;
177         __le16 cfpmaxduration;
178         __le16 cfpdurationremaining;
179 } __attribute__ ((packed));
180
181 struct ibssparamset {
182         __le16 atimwindow;
183 } __attribute__ ((packed));
184
185 struct mrvlietypes_ssparamset {
186         struct mrvlietypesheader header;
187         union {
188                 struct cfparamset cfparamset[1];
189                 struct ibssparamset ibssparamset[1];
190         } cf_ibss;
191 } __attribute__ ((packed));
192
193 struct fhparamset {
194         __le16 dwelltime;
195         u8 hopset;
196         u8 hoppattern;
197         u8 hopindex;
198 } __attribute__ ((packed));
199
200 struct dsparamset {
201         u8 currentchan;
202 } __attribute__ ((packed));
203
204 struct mrvlietypes_phyparamset {
205         struct mrvlietypesheader header;
206         union {
207                 struct fhparamset fhparamset[1];
208                 struct dsparamset dsparamset[1];
209         } fh_ds;
210 } __attribute__ ((packed));
211
212 struct mrvlietypes_rsnparamset {
213         struct mrvlietypesheader header;
214         u8 rsnie[1];
215 } __attribute__ ((packed));
216
217 struct mrvlietypes_tsftimestamp {
218         struct mrvlietypesheader header;
219         __le64 tsftable[1];
220 } __attribute__ ((packed));
221
222 /**  Local Power capability */
223 struct mrvlietypes_powercapability {
224         struct mrvlietypesheader header;
225         s8 minpower;
226         s8 maxpower;
227 } __attribute__ ((packed));
228
229 struct mrvlietypes_rssithreshold {
230         struct mrvlietypesheader header;
231         u8 rssivalue;
232         u8 rssifreq;
233 } __attribute__ ((packed));
234
235 struct mrvlietypes_snrthreshold {
236         struct mrvlietypesheader header;
237         u8 snrvalue;
238         u8 snrfreq;
239 } __attribute__ ((packed));
240
241 struct mrvlietypes_failurecount {
242         struct mrvlietypesheader header;
243         u8 failvalue;
244         u8 Failfreq;
245 } __attribute__ ((packed));
246
247 struct mrvlietypes_beaconsmissed {
248         struct mrvlietypesheader header;
249         u8 beaconmissed;
250         u8 reserved;
251 } __attribute__ ((packed));
252
253 struct mrvlietypes_numprobes {
254         struct mrvlietypesheader header;
255         __le16 numprobes;
256 } __attribute__ ((packed));
257
258 struct mrvlietypes_bcastprobe {
259         struct mrvlietypesheader header;
260         __le16 bcastprobe;
261 } __attribute__ ((packed));
262
263 struct mrvlietypes_numssidprobe {
264         struct mrvlietypesheader header;
265         __le16 numssidprobe;
266 } __attribute__ ((packed));
267
268 struct led_pin {
269         u8 led;
270         u8 pin;
271 } __attribute__ ((packed));
272
273 struct mrvlietypes_ledgpio {
274         struct mrvlietypesheader header;
275         struct led_pin ledpin[1];
276 } __attribute__ ((packed));
277
278 #endif                          /* _WLAN_TYPES_ */