Merge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[pandora-kernel.git] / drivers / net / wireless / libertas / types.h
1 /**
2   * This header file contains definition for global types
3   */
4 #ifndef _LBS_TYPES_H_
5 #define _LBS_TYPES_H_
6
7 #include <linux/if_ether.h>
8 #include <asm/byteorder.h>
9 #include <linux/wireless.h>
10
11 struct ieeetypes_cfparamset {
12         u8 elementid;
13         u8 len;
14         u8 cfpcnt;
15         u8 cfpperiod;
16         __le16 cfpmaxduration;
17         __le16 cfpdurationremaining;
18 } __attribute__ ((packed));
19
20
21 struct ieeetypes_ibssparamset {
22         u8 elementid;
23         u8 len;
24         __le16 atimwindow;
25 } __attribute__ ((packed));
26
27 union IEEEtypes_ssparamset {
28         struct ieeetypes_cfparamset cfparamset;
29         struct ieeetypes_ibssparamset ibssparamset;
30 } __attribute__ ((packed));
31
32 struct ieeetypes_fhparamset {
33         u8 elementid;
34         u8 len;
35         __le16 dwelltime;
36         u8 hopset;
37         u8 hoppattern;
38         u8 hopindex;
39 } __attribute__ ((packed));
40
41 struct ieeetypes_dsparamset {
42         u8 elementid;
43         u8 len;
44         u8 currentchan;
45 } __attribute__ ((packed));
46
47 union ieeetypes_phyparamset {
48         struct ieeetypes_fhparamset fhparamset;
49         struct ieeetypes_dsparamset dsparamset;
50 } __attribute__ ((packed));
51
52 struct ieeetypes_assocrsp {
53         __le16 capability;
54         __le16 statuscode;
55         __le16 aid;
56         u8 iebuffer[1];
57 } __attribute__ ((packed));
58
59 /** TLV  type ID definition */
60 #define PROPRIETARY_TLV_BASE_ID         0x0100
61
62 /* Terminating TLV type */
63 #define MRVL_TERMINATE_TLV_ID           0xffff
64
65 #define TLV_TYPE_SSID                           0x0000
66 #define TLV_TYPE_RATES                          0x0001
67 #define TLV_TYPE_PHY_FH                         0x0002
68 #define TLV_TYPE_PHY_DS                         0x0003
69 #define TLV_TYPE_CF                                 0x0004
70 #define TLV_TYPE_IBSS                           0x0006
71
72 #define TLV_TYPE_DOMAIN                         0x0007
73
74 #define TLV_TYPE_POWER_CAPABILITY       0x0021
75
76 #define TLV_TYPE_KEY_MATERIAL       (PROPRIETARY_TLV_BASE_ID + 0)
77 #define TLV_TYPE_CHANLIST           (PROPRIETARY_TLV_BASE_ID + 1)
78 #define TLV_TYPE_NUMPROBES          (PROPRIETARY_TLV_BASE_ID + 2)
79 #define TLV_TYPE_RSSI_LOW           (PROPRIETARY_TLV_BASE_ID + 4)
80 #define TLV_TYPE_SNR_LOW            (PROPRIETARY_TLV_BASE_ID + 5)
81 #define TLV_TYPE_FAILCOUNT          (PROPRIETARY_TLV_BASE_ID + 6)
82 #define TLV_TYPE_BCNMISS            (PROPRIETARY_TLV_BASE_ID + 7)
83 #define TLV_TYPE_LED_GPIO           (PROPRIETARY_TLV_BASE_ID + 8)
84 #define TLV_TYPE_LEDBEHAVIOR        (PROPRIETARY_TLV_BASE_ID + 9)
85 #define TLV_TYPE_PASSTHROUGH        (PROPRIETARY_TLV_BASE_ID + 10)
86 #define TLV_TYPE_REASSOCAP          (PROPRIETARY_TLV_BASE_ID + 11)
87 #define TLV_TYPE_POWER_TBL_2_4GHZ   (PROPRIETARY_TLV_BASE_ID + 12)
88 #define TLV_TYPE_POWER_TBL_5GHZ     (PROPRIETARY_TLV_BASE_ID + 13)
89 #define TLV_TYPE_BCASTPROBE         (PROPRIETARY_TLV_BASE_ID + 14)
90 #define TLV_TYPE_NUMSSID_PROBE      (PROPRIETARY_TLV_BASE_ID + 15)
91 #define TLV_TYPE_WMMQSTATUS         (PROPRIETARY_TLV_BASE_ID + 16)
92 #define TLV_TYPE_CRYPTO_DATA        (PROPRIETARY_TLV_BASE_ID + 17)
93 #define TLV_TYPE_WILDCARDSSID       (PROPRIETARY_TLV_BASE_ID + 18)
94 #define TLV_TYPE_TSFTIMESTAMP       (PROPRIETARY_TLV_BASE_ID + 19)
95 #define TLV_TYPE_RSSI_HIGH          (PROPRIETARY_TLV_BASE_ID + 22)
96 #define TLV_TYPE_SNR_HIGH           (PROPRIETARY_TLV_BASE_ID + 23)
97
98 /** TLV related data structures*/
99 struct mrvlietypesheader {
100         __le16 type;
101         __le16 len;
102 } __attribute__ ((packed));
103
104 struct mrvlietypes_data {
105         struct mrvlietypesheader header;
106         u8 Data[1];
107 } __attribute__ ((packed));
108
109 struct mrvlietypes_ratesparamset {
110         struct mrvlietypesheader header;
111         u8 rates[1];
112 } __attribute__ ((packed));
113
114 struct mrvlietypes_ssidparamset {
115         struct mrvlietypesheader header;
116         u8 ssid[1];
117 } __attribute__ ((packed));
118
119 struct mrvlietypes_wildcardssidparamset {
120         struct mrvlietypesheader header;
121         u8 MaxSsidlength;
122         u8 ssid[1];
123 } __attribute__ ((packed));
124
125 struct chanscanmode {
126 #ifdef __BIG_ENDIAN_BITFIELD
127         u8 reserved_2_7:6;
128         u8 disablechanfilt:1;
129         u8 passivescan:1;
130 #else
131         u8 passivescan:1;
132         u8 disablechanfilt:1;
133         u8 reserved_2_7:6;
134 #endif
135 } __attribute__ ((packed));
136
137 struct chanscanparamset {
138         u8 radiotype;
139         u8 channumber;
140         struct chanscanmode chanscanmode;
141         __le16 minscantime;
142         __le16 maxscantime;
143 } __attribute__ ((packed));
144
145 struct mrvlietypes_chanlistparamset {
146         struct mrvlietypesheader header;
147         struct chanscanparamset chanscanparam[1];
148 } __attribute__ ((packed));
149
150 struct cfparamset {
151         u8 cfpcnt;
152         u8 cfpperiod;
153         __le16 cfpmaxduration;
154         __le16 cfpdurationremaining;
155 } __attribute__ ((packed));
156
157 struct ibssparamset {
158         __le16 atimwindow;
159 } __attribute__ ((packed));
160
161 struct mrvlietypes_ssparamset {
162         struct mrvlietypesheader header;
163         union {
164                 struct cfparamset cfparamset[1];
165                 struct ibssparamset ibssparamset[1];
166         } cf_ibss;
167 } __attribute__ ((packed));
168
169 struct fhparamset {
170         __le16 dwelltime;
171         u8 hopset;
172         u8 hoppattern;
173         u8 hopindex;
174 } __attribute__ ((packed));
175
176 struct dsparamset {
177         u8 currentchan;
178 } __attribute__ ((packed));
179
180 struct mrvlietypes_phyparamset {
181         struct mrvlietypesheader header;
182         union {
183                 struct fhparamset fhparamset[1];
184                 struct dsparamset dsparamset[1];
185         } fh_ds;
186 } __attribute__ ((packed));
187
188 struct mrvlietypes_rsnparamset {
189         struct mrvlietypesheader header;
190         u8 rsnie[1];
191 } __attribute__ ((packed));
192
193 struct mrvlietypes_tsftimestamp {
194         struct mrvlietypesheader header;
195         __le64 tsftable[1];
196 } __attribute__ ((packed));
197
198 /**  Local Power capability */
199 struct mrvlietypes_powercapability {
200         struct mrvlietypesheader header;
201         s8 minpower;
202         s8 maxpower;
203 } __attribute__ ((packed));
204
205 /* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */
206 struct mrvlietypes_thresholds {
207         struct mrvlietypesheader header;
208         u8 value;
209         u8 freq;
210 } __attribute__ ((packed));
211
212 struct mrvlietypes_beaconsmissed {
213         struct mrvlietypesheader header;
214         u8 beaconmissed;
215         u8 reserved;
216 } __attribute__ ((packed));
217
218 struct mrvlietypes_numprobes {
219         struct mrvlietypesheader header;
220         __le16 numprobes;
221 } __attribute__ ((packed));
222
223 struct mrvlietypes_bcastprobe {
224         struct mrvlietypesheader header;
225         __le16 bcastprobe;
226 } __attribute__ ((packed));
227
228 struct mrvlietypes_numssidprobe {
229         struct mrvlietypesheader header;
230         __le16 numssidprobe;
231 } __attribute__ ((packed));
232
233 struct led_pin {
234         u8 led;
235         u8 pin;
236 } __attribute__ ((packed));
237
238 struct mrvlietypes_ledgpio {
239         struct mrvlietypesheader header;
240         struct led_pin ledpin[1];
241 } __attribute__ ((packed));
242
243 struct led_bhv {
244         uint8_t firmwarestate;
245         uint8_t led;
246         uint8_t ledstate;
247         uint8_t ledarg;
248 } __attribute__ ((packed));
249
250
251 struct mrvlietypes_ledbhv {
252         struct mrvlietypesheader header;
253         struct led_bhv ledbhv[1];
254 } __attribute__ ((packed));
255
256 /* Meant to be packed as the value member of a struct ieee80211_info_element.
257  * Note that the len member of the ieee80211_info_element varies depending on
258  * the mesh_id_len */
259 struct mrvl_meshie_val {
260         uint8_t oui[3];
261         uint8_t type;
262         uint8_t subtype;
263         uint8_t version;
264         uint8_t active_protocol_id;
265         uint8_t active_metric_id;
266         uint8_t mesh_capability;
267         uint8_t mesh_id_len;
268         uint8_t mesh_id[IW_ESSID_MAX_SIZE];
269 } __attribute__ ((packed));
270
271 struct mrvl_meshie {
272         u8 id, len;
273         struct mrvl_meshie_val val;
274 } __attribute__ ((packed));
275
276 struct mrvl_mesh_defaults {
277         __le32 bootflag;
278         uint8_t boottime;
279         uint8_t reserved;
280         __le16 channel;
281         struct mrvl_meshie meshie;
282 } __attribute__ ((packed));
283
284 #endif