libertas: Extend MESH_CONFIG command to access non-volatile configuration
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / wireless / libertas / types.h
CommitLineData
876c9d3a
MT
1/**
2 * This header file contains definition for global types
3 */
10078321
HS
4#ifndef _LBS_TYPES_H_
5#define _LBS_TYPES_H_
876c9d3a
MT
6
7#include <linux/if_ether.h>
981f187b 8#include <asm/byteorder.h>
edaea5ce
JC
9#include <linux/wireless.h>
10#include <net/ieee80211.h>
876c9d3a 11
876c9d3a
MT
12struct ieeetypes_cfparamset {
13 u8 elementid;
14 u8 len;
15 u8 cfpcnt;
16 u8 cfpperiod;
981f187b
DW
17 __le16 cfpmaxduration;
18 __le16 cfpdurationremaining;
876c9d3a
MT
19} __attribute__ ((packed));
20
21
22struct ieeetypes_ibssparamset {
23 u8 elementid;
24 u8 len;
981f187b 25 __le16 atimwindow;
876c9d3a
MT
26} __attribute__ ((packed));
27
28union IEEEtypes_ssparamset {
29 struct ieeetypes_cfparamset cfparamset;
30 struct ieeetypes_ibssparamset ibssparamset;
31} __attribute__ ((packed));
32
33struct ieeetypes_fhparamset {
34 u8 elementid;
35 u8 len;
981f187b 36 __le16 dwelltime;
876c9d3a
MT
37 u8 hopset;
38 u8 hoppattern;
39 u8 hopindex;
40} __attribute__ ((packed));
41
42struct ieeetypes_dsparamset {
43 u8 elementid;
44 u8 len;
45 u8 currentchan;
46} __attribute__ ((packed));
47
48union ieeetypes_phyparamset {
49 struct ieeetypes_fhparamset fhparamset;
50 struct ieeetypes_dsparamset dsparamset;
51} __attribute__ ((packed));
52
53struct ieeetypes_assocrsp {
0c9ca690 54 __le16 capability;
981f187b
DW
55 __le16 statuscode;
56 __le16 aid;
876c9d3a
MT
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*/
100struct mrvlietypesheader {
981f187b
DW
101 __le16 type;
102 __le16 len;
876c9d3a
MT
103} __attribute__ ((packed));
104
105struct mrvlietypes_data {
106 struct mrvlietypesheader header;
107 u8 Data[1];
108} __attribute__ ((packed));
109
110struct mrvlietypes_ratesparamset {
111 struct mrvlietypesheader header;
112 u8 rates[1];
113} __attribute__ ((packed));
114
115struct mrvlietypes_ssidparamset {
116 struct mrvlietypesheader header;
117 u8 ssid[1];
118} __attribute__ ((packed));
119
120struct mrvlietypes_wildcardssidparamset {
121 struct mrvlietypesheader header;
122 u8 MaxSsidlength;
123 u8 ssid[1];
124} __attribute__ ((packed));
125
126struct chanscanmode {
981f187b
DW
127#ifdef __BIG_ENDIAN_BITFIELD
128 u8 reserved_2_7:6;
129 u8 disablechanfilt:1;
130 u8 passivescan:1;
131#else
876c9d3a
MT
132 u8 passivescan:1;
133 u8 disablechanfilt:1;
134 u8 reserved_2_7:6;
981f187b 135#endif
876c9d3a
MT
136} __attribute__ ((packed));
137
138struct chanscanparamset {
139 u8 radiotype;
140 u8 channumber;
141 struct chanscanmode chanscanmode;
981f187b
DW
142 __le16 minscantime;
143 __le16 maxscantime;
876c9d3a
MT
144} __attribute__ ((packed));
145
146struct mrvlietypes_chanlistparamset {
147 struct mrvlietypesheader header;
148 struct chanscanparamset chanscanparam[1];
149} __attribute__ ((packed));
150
151struct cfparamset {
152 u8 cfpcnt;
153 u8 cfpperiod;
981f187b
DW
154 __le16 cfpmaxduration;
155 __le16 cfpdurationremaining;
876c9d3a
MT
156} __attribute__ ((packed));
157
158struct ibssparamset {
981f187b 159 __le16 atimwindow;
876c9d3a
MT
160} __attribute__ ((packed));
161
162struct 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
170struct fhparamset {
981f187b 171 __le16 dwelltime;
876c9d3a
MT
172 u8 hopset;
173 u8 hoppattern;
174 u8 hopindex;
175} __attribute__ ((packed));
176
177struct dsparamset {
178 u8 currentchan;
179} __attribute__ ((packed));
180
181struct 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
189struct mrvlietypes_rsnparamset {
190 struct mrvlietypesheader header;
191 u8 rsnie[1];
192} __attribute__ ((packed));
193
194struct mrvlietypes_tsftimestamp {
195 struct mrvlietypesheader header;
196 __le64 tsftable[1];
197} __attribute__ ((packed));
198
199/** Local Power capability */
200struct mrvlietypes_powercapability {
201 struct mrvlietypesheader header;
202 s8 minpower;
203 s8 maxpower;
204} __attribute__ ((packed));
205
3a188649
HS
206/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */
207struct mrvlietypes_thresholds {
876c9d3a 208 struct mrvlietypesheader header;
3a188649
HS
209 u8 value;
210 u8 freq;
876c9d3a
MT
211} __attribute__ ((packed));
212
213struct mrvlietypes_beaconsmissed {
214 struct mrvlietypesheader header;
215 u8 beaconmissed;
216 u8 reserved;
217} __attribute__ ((packed));
218
219struct mrvlietypes_numprobes {
220 struct mrvlietypesheader header;
981f187b 221 __le16 numprobes;
876c9d3a
MT
222} __attribute__ ((packed));
223
224struct mrvlietypes_bcastprobe {
225 struct mrvlietypesheader header;
981f187b 226 __le16 bcastprobe;
876c9d3a
MT
227} __attribute__ ((packed));
228
229struct mrvlietypes_numssidprobe {
230 struct mrvlietypesheader header;
981f187b 231 __le16 numssidprobe;
876c9d3a
MT
232} __attribute__ ((packed));
233
234struct led_pin {
235 u8 led;
236 u8 pin;
237} __attribute__ ((packed));
238
239struct mrvlietypes_ledgpio {
240 struct mrvlietypesheader header;
241 struct led_pin ledpin[1];
242} __attribute__ ((packed));
243
c5562e98
DW
244struct led_bhv {
245 uint8_t firmwarestate;
246 uint8_t led;
247 uint8_t ledstate;
248 uint8_t ledarg;
249} __attribute__ ((packed));
250
251
252struct mrvlietypes_ledbhv {
253 struct mrvlietypesheader header;
254 struct led_bhv ledbhv[1];
255} __attribute__ ((packed));
256
edaea5ce
JC
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 */
260struct 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
272struct mrvl_meshie {
273 struct ieee80211_info_element hdr;
274 struct mrvl_meshie_val val;
275} __attribute__ ((packed));
276
277struct 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
10078321 285#endif