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