blob: cf1d9b047ee6121c6c429039892ad6967dc9b93f [file] [log] [blame]
Randy Dunlap8973a6e2011-04-26 15:25:29 -07001/*
2 * This header file contains definition for global types
3 */
Holger Schurig10078322007-11-15 18:05:47 -05004#ifndef _LBS_TYPES_H_
5#define _LBS_TYPES_H_
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02006
7#include <linux/if_ether.h>
Holger Schurig243e84e2009-10-22 15:30:47 +02008#include <linux/ieee80211.h>
David Woodhouse981f1872007-05-25 23:36:54 -04009#include <asm/byteorder.h>
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020010
Dan Williams75b6a612009-05-22 20:03:09 -040011struct ieee_ie_header {
12 u8 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020013 u8 len;
Eric Dumazetba2d3582010-06-02 18:10:09 +000014} __packed;
Dan Williams75b6a612009-05-22 20:03:09 -040015
16struct ieee_ie_cf_param_set {
17 struct ieee_ie_header header;
18
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020019 u8 cfpcnt;
20 u8 cfpperiod;
David Woodhouse981f1872007-05-25 23:36:54 -040021 __le16 cfpmaxduration;
22 __le16 cfpdurationremaining;
Eric Dumazetba2d3582010-06-02 18:10:09 +000023} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020024
25
Dan Williams5fd164e2009-05-22 20:01:21 -040026struct ieee_ie_ibss_param_set {
Dan Williams75b6a612009-05-22 20:03:09 -040027 struct ieee_ie_header header;
28
David Woodhouse981f1872007-05-25 23:36:54 -040029 __le16 atimwindow;
Eric Dumazetba2d3582010-06-02 18:10:09 +000030} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020031
Dan Williams5fd164e2009-05-22 20:01:21 -040032union ieee_ss_param_set {
33 struct ieee_ie_cf_param_set cf;
34 struct ieee_ie_ibss_param_set ibss;
Eric Dumazetba2d3582010-06-02 18:10:09 +000035} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020036
Dan Williams5fd164e2009-05-22 20:01:21 -040037struct ieee_ie_fh_param_set {
Dan Williams75b6a612009-05-22 20:03:09 -040038 struct ieee_ie_header header;
39
David Woodhouse981f1872007-05-25 23:36:54 -040040 __le16 dwelltime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020041 u8 hopset;
42 u8 hoppattern;
43 u8 hopindex;
Eric Dumazetba2d3582010-06-02 18:10:09 +000044} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020045
Dan Williams5fd164e2009-05-22 20:01:21 -040046struct ieee_ie_ds_param_set {
Dan Williams75b6a612009-05-22 20:03:09 -040047 struct ieee_ie_header header;
48
Dan Williams5fd164e2009-05-22 20:01:21 -040049 u8 channel;
Eric Dumazetba2d3582010-06-02 18:10:09 +000050} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020051
Dan Williams5fd164e2009-05-22 20:01:21 -040052union ieee_phy_param_set {
53 struct ieee_ie_fh_param_set fh;
54 struct ieee_ie_ds_param_set ds;
Eric Dumazetba2d3582010-06-02 18:10:09 +000055} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020056
Randy Dunlap8973a6e2011-04-26 15:25:29 -070057/* TLV type ID definition */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020058#define PROPRIETARY_TLV_BASE_ID 0x0100
59
60/* Terminating TLV type */
61#define MRVL_TERMINATE_TLV_ID 0xffff
62
63#define TLV_TYPE_SSID 0x0000
64#define TLV_TYPE_RATES 0x0001
65#define TLV_TYPE_PHY_FH 0x0002
66#define TLV_TYPE_PHY_DS 0x0003
67#define TLV_TYPE_CF 0x0004
68#define TLV_TYPE_IBSS 0x0006
69
70#define TLV_TYPE_DOMAIN 0x0007
71
72#define TLV_TYPE_POWER_CAPABILITY 0x0021
73
74#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
75#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
76#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
77#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
78#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 5)
79#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 6)
80#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 7)
81#define TLV_TYPE_LED_GPIO (PROPRIETARY_TLV_BASE_ID + 8)
82#define TLV_TYPE_LEDBEHAVIOR (PROPRIETARY_TLV_BASE_ID + 9)
83#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
84#define TLV_TYPE_REASSOCAP (PROPRIETARY_TLV_BASE_ID + 11)
85#define TLV_TYPE_POWER_TBL_2_4GHZ (PROPRIETARY_TLV_BASE_ID + 12)
86#define TLV_TYPE_POWER_TBL_5GHZ (PROPRIETARY_TLV_BASE_ID + 13)
87#define TLV_TYPE_BCASTPROBE (PROPRIETARY_TLV_BASE_ID + 14)
88#define TLV_TYPE_NUMSSID_PROBE (PROPRIETARY_TLV_BASE_ID + 15)
89#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
90#define TLV_TYPE_CRYPTO_DATA (PROPRIETARY_TLV_BASE_ID + 17)
91#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
92#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
93#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
94#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 23)
Dan Williamsbe0d76e2009-05-22 20:05:25 -040095#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
Bing Zhao684d6b32009-03-25 09:51:16 -070096#define TLV_TYPE_MESH_ID (PROPRIETARY_TLV_BASE_ID + 37)
97#define TLV_TYPE_OLD_MESH_ID (PROPRIETARY_TLV_BASE_ID + 291)
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020098
Randy Dunlap8973a6e2011-04-26 15:25:29 -070099/* TLV related data structures */
Dan Williams75b6a612009-05-22 20:03:09 -0400100struct mrvl_ie_header {
David Woodhouse981f1872007-05-25 23:36:54 -0400101 __le16 type;
102 __le16 len;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000103} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200104
Dan Williams75b6a612009-05-22 20:03:09 -0400105struct mrvl_ie_data {
106 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200107 u8 Data[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000108} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200109
Dan Williams75b6a612009-05-22 20:03:09 -0400110struct mrvl_ie_rates_param_set {
111 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200112 u8 rates[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000113} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200114
Dan Williams75b6a612009-05-22 20:03:09 -0400115struct mrvl_ie_ssid_param_set {
116 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200117 u8 ssid[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000118} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200119
Dan Williams75b6a612009-05-22 20:03:09 -0400120struct mrvl_ie_wildcard_ssid_param_set {
121 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200122 u8 MaxSsidlength;
123 u8 ssid[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000124} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200125
126struct chanscanmode {
David Woodhouse981f1872007-05-25 23:36:54 -0400127#ifdef __BIG_ENDIAN_BITFIELD
128 u8 reserved_2_7:6;
129 u8 disablechanfilt:1;
130 u8 passivescan:1;
131#else
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200132 u8 passivescan:1;
133 u8 disablechanfilt:1;
134 u8 reserved_2_7:6;
David Woodhouse981f1872007-05-25 23:36:54 -0400135#endif
Eric Dumazetba2d3582010-06-02 18:10:09 +0000136} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200137
138struct chanscanparamset {
139 u8 radiotype;
140 u8 channumber;
141 struct chanscanmode chanscanmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400142 __le16 minscantime;
143 __le16 maxscantime;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000144} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200145
Dan Williams75b6a612009-05-22 20:03:09 -0400146struct mrvl_ie_chanlist_param_set {
147 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200148 struct chanscanparamset chanscanparam[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000149} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200150
Dan Williams75b6a612009-05-22 20:03:09 -0400151struct mrvl_ie_cf_param_set {
152 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200153 u8 cfpcnt;
154 u8 cfpperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400155 __le16 cfpmaxduration;
156 __le16 cfpdurationremaining;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000157} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200158
Dan Williams75b6a612009-05-22 20:03:09 -0400159struct mrvl_ie_ds_param_set {
160 struct mrvl_ie_header header;
Dan Williams5fd164e2009-05-22 20:01:21 -0400161 u8 channel;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000162} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200163
Dan Williams75b6a612009-05-22 20:03:09 -0400164struct mrvl_ie_rsn_param_set {
165 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200166 u8 rsnie[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000167} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200168
Dan Williams75b6a612009-05-22 20:03:09 -0400169struct mrvl_ie_tsf_timestamp {
170 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200171 __le64 tsftable[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000172} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200173
Dan Williamsbe0d76e2009-05-22 20:05:25 -0400174/* v9 and later firmware only */
175struct mrvl_ie_auth_type {
176 struct mrvl_ie_header header;
177 __le16 auth;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000178} __packed;
Dan Williamsbe0d76e2009-05-22 20:05:25 -0400179
Randy Dunlap8973a6e2011-04-26 15:25:29 -0700180/* Local Power capability */
Dan Williams75b6a612009-05-22 20:03:09 -0400181struct mrvl_ie_power_capability {
182 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200183 s8 minpower;
184 s8 maxpower;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000185} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200186
Holger Schurig3a188642007-11-26 10:07:14 +0100187/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */
Dan Williams75b6a612009-05-22 20:03:09 -0400188struct mrvl_ie_thresholds {
189 struct mrvl_ie_header header;
Holger Schurig3a188642007-11-26 10:07:14 +0100190 u8 value;
191 u8 freq;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000192} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200193
Dan Williams75b6a612009-05-22 20:03:09 -0400194struct mrvl_ie_beacons_missed {
195 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200196 u8 beaconmissed;
197 u8 reserved;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000198} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200199
Dan Williams75b6a612009-05-22 20:03:09 -0400200struct mrvl_ie_num_probes {
201 struct mrvl_ie_header header;
David Woodhouse981f1872007-05-25 23:36:54 -0400202 __le16 numprobes;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000203} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200204
Dan Williams75b6a612009-05-22 20:03:09 -0400205struct mrvl_ie_bcast_probe {
206 struct mrvl_ie_header header;
David Woodhouse981f1872007-05-25 23:36:54 -0400207 __le16 bcastprobe;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000208} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200209
Dan Williams75b6a612009-05-22 20:03:09 -0400210struct mrvl_ie_num_ssid_probe {
211 struct mrvl_ie_header header;
David Woodhouse981f1872007-05-25 23:36:54 -0400212 __le16 numssidprobe;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000213} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200214
215struct led_pin {
216 u8 led;
217 u8 pin;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000218} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200219
Dan Williams75b6a612009-05-22 20:03:09 -0400220struct mrvl_ie_ledgpio {
221 struct mrvl_ie_header header;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200222 struct led_pin ledpin[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000223} __packed;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200224
David Woodhousec5562e92008-03-03 12:16:42 +0100225struct led_bhv {
226 uint8_t firmwarestate;
227 uint8_t led;
228 uint8_t ledstate;
229 uint8_t ledarg;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000230} __packed;
David Woodhousec5562e92008-03-03 12:16:42 +0100231
232
Dan Williams75b6a612009-05-22 20:03:09 -0400233struct mrvl_ie_ledbhv {
234 struct mrvl_ie_header header;
David Woodhousec5562e92008-03-03 12:16:42 +0100235 struct led_bhv ledbhv[1];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000236} __packed;
David Woodhousec5562e92008-03-03 12:16:42 +0100237
Randy Dunlap8973a6e2011-04-26 15:25:29 -0700238/*
239 * Meant to be packed as the value member of a struct ieee80211_info_element.
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700240 * Note that the len member of the ieee80211_info_element varies depending on
Randy Dunlap8973a6e2011-04-26 15:25:29 -0700241 * the mesh_id_len
242 */
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700243struct mrvl_meshie_val {
Johannes Berg2c7060022008-10-30 22:09:54 +0100244 uint8_t oui[3];
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700245 uint8_t type;
246 uint8_t subtype;
247 uint8_t version;
248 uint8_t active_protocol_id;
249 uint8_t active_metric_id;
250 uint8_t mesh_capability;
251 uint8_t mesh_id_len;
Holger Schurig243e84e2009-10-22 15:30:47 +0200252 uint8_t mesh_id[IEEE80211_MAX_SSID_LEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000253} __packed;
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700254
255struct mrvl_meshie {
Johannes Berg2c7060022008-10-30 22:09:54 +0100256 u8 id, len;
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700257 struct mrvl_meshie_val val;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000258} __packed;
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700259
260struct mrvl_mesh_defaults {
261 __le32 bootflag;
262 uint8_t boottime;
263 uint8_t reserved;
264 __le16 channel;
265 struct mrvl_meshie meshie;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000266} __packed;
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700267
Holger Schurig10078322007-11-15 18:05:47 -0500268#endif