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