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