]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blame - drivers/net/wireless/marvell/libertas/types.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-kernels.git] / drivers / net / wireless / marvell / libertas / types.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
8973a6e7
RD
2/*
3 * This header file contains definition for global types
4 */
10078321
HS
5#ifndef _LBS_TYPES_H_
6#define _LBS_TYPES_H_
876c9d3a
MT
7
8#include <linux/if_ether.h>
243e84e9 9#include <linux/ieee80211.h>
981f187b 10#include <asm/byteorder.h>
876c9d3a 11
75b6a61a
DW
12struct ieee_ie_header {
13 u8 id;
876c9d3a 14 u8 len;
ba2d3587 15} __packed;
75b6a61a
DW
16
17struct ieee_ie_cf_param_set {
18 struct ieee_ie_header header;
19
876c9d3a
MT
20 u8 cfpcnt;
21 u8 cfpperiod;
981f187b
DW
22 __le16 cfpmaxduration;
23 __le16 cfpdurationremaining;
ba2d3587 24} __packed;
876c9d3a
MT
25
26
5fd164e9 27struct ieee_ie_ibss_param_set {
75b6a61a
DW
28 struct ieee_ie_header header;
29
981f187b 30 __le16 atimwindow;
ba2d3587 31} __packed;
876c9d3a 32
5fd164e9
DW
33union ieee_ss_param_set {
34 struct ieee_ie_cf_param_set cf;
35 struct ieee_ie_ibss_param_set ibss;
ba2d3587 36} __packed;
876c9d3a 37
5fd164e9 38struct ieee_ie_fh_param_set {
75b6a61a
DW
39 struct ieee_ie_header header;
40
981f187b 41 __le16 dwelltime;
876c9d3a
MT
42 u8 hopset;
43 u8 hoppattern;
44 u8 hopindex;
ba2d3587 45} __packed;
876c9d3a 46
5fd164e9 47struct ieee_ie_ds_param_set {
75b6a61a
DW
48 struct ieee_ie_header header;
49
5fd164e9 50 u8 channel;
ba2d3587 51} __packed;
876c9d3a 52
5fd164e9
DW
53union ieee_phy_param_set {
54 struct ieee_ie_fh_param_set fh;
55 struct ieee_ie_ds_param_set ds;
ba2d3587 56} __packed;
876c9d3a 57
8973a6e7 58/* TLV type ID definition */
876c9d3a
MT
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)
be0d76e4 96#define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
684d6b36
BZ
97#define TLV_TYPE_MESH_ID (PROPRIETARY_TLV_BASE_ID + 37)
98#define TLV_TYPE_OLD_MESH_ID (PROPRIETARY_TLV_BASE_ID + 291)
876c9d3a 99
8973a6e7 100/* TLV related data structures */
75b6a61a 101struct mrvl_ie_header {
981f187b
DW
102 __le16 type;
103 __le16 len;
ba2d3587 104} __packed;
876c9d3a 105
75b6a61a
DW
106struct mrvl_ie_data {
107 struct mrvl_ie_header header;
876c9d3a 108 u8 Data[1];
ba2d3587 109} __packed;
876c9d3a 110
75b6a61a
DW
111struct mrvl_ie_rates_param_set {
112 struct mrvl_ie_header header;
876c9d3a 113 u8 rates[1];
ba2d3587 114} __packed;
876c9d3a 115
75b6a61a
DW
116struct mrvl_ie_ssid_param_set {
117 struct mrvl_ie_header header;
876c9d3a 118 u8 ssid[1];
ba2d3587 119} __packed;
876c9d3a 120
75b6a61a
DW
121struct mrvl_ie_wildcard_ssid_param_set {
122 struct mrvl_ie_header header;
876c9d3a
MT
123 u8 MaxSsidlength;
124 u8 ssid[1];
ba2d3587 125} __packed;
876c9d3a
MT
126
127struct chanscanmode {
981f187b
DW
128#ifdef __BIG_ENDIAN_BITFIELD
129 u8 reserved_2_7:6;
130 u8 disablechanfilt:1;
131 u8 passivescan:1;
132#else
876c9d3a
MT
133 u8 passivescan:1;
134 u8 disablechanfilt:1;
135 u8 reserved_2_7:6;
981f187b 136#endif
ba2d3587 137} __packed;
876c9d3a
MT
138
139struct chanscanparamset {
140 u8 radiotype;
141 u8 channumber;
142 struct chanscanmode chanscanmode;
981f187b
DW
143 __le16 minscantime;
144 __le16 maxscantime;
ba2d3587 145} __packed;
876c9d3a 146
75b6a61a
DW
147struct mrvl_ie_chanlist_param_set {
148 struct mrvl_ie_header header;
876c9d3a 149 struct chanscanparamset chanscanparam[1];
ba2d3587 150} __packed;
876c9d3a 151
75b6a61a
DW
152struct mrvl_ie_cf_param_set {
153 struct mrvl_ie_header header;
876c9d3a
MT
154 u8 cfpcnt;
155 u8 cfpperiod;
981f187b
DW
156 __le16 cfpmaxduration;
157 __le16 cfpdurationremaining;
ba2d3587 158} __packed;
876c9d3a 159
75b6a61a
DW
160struct mrvl_ie_ds_param_set {
161 struct mrvl_ie_header header;
5fd164e9 162 u8 channel;
ba2d3587 163} __packed;
876c9d3a 164
75b6a61a
DW
165struct mrvl_ie_rsn_param_set {
166 struct mrvl_ie_header header;
876c9d3a 167 u8 rsnie[1];
ba2d3587 168} __packed;
876c9d3a 169
75b6a61a
DW
170struct mrvl_ie_tsf_timestamp {
171 struct mrvl_ie_header header;
876c9d3a 172 __le64 tsftable[1];
ba2d3587 173} __packed;
876c9d3a 174
be0d76e4
DW
175/* v9 and later firmware only */
176struct mrvl_ie_auth_type {
177 struct mrvl_ie_header header;
178 __le16 auth;
ba2d3587 179} __packed;
be0d76e4 180
8973a6e7 181/* Local Power capability */
75b6a61a
DW
182struct mrvl_ie_power_capability {
183 struct mrvl_ie_header header;
876c9d3a
MT
184 s8 minpower;
185 s8 maxpower;
ba2d3587 186} __packed;
876c9d3a 187
3a188649 188/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */
75b6a61a
DW
189struct mrvl_ie_thresholds {
190 struct mrvl_ie_header header;
3a188649
HS
191 u8 value;
192 u8 freq;
ba2d3587 193} __packed;
876c9d3a 194
75b6a61a
DW
195struct mrvl_ie_beacons_missed {
196 struct mrvl_ie_header header;
876c9d3a
MT
197 u8 beaconmissed;
198 u8 reserved;
ba2d3587 199} __packed;
876c9d3a 200
75b6a61a
DW
201struct mrvl_ie_num_probes {
202 struct mrvl_ie_header header;
981f187b 203 __le16 numprobes;
ba2d3587 204} __packed;
876c9d3a 205
75b6a61a
DW
206struct mrvl_ie_bcast_probe {
207 struct mrvl_ie_header header;
981f187b 208 __le16 bcastprobe;
ba2d3587 209} __packed;
876c9d3a 210
75b6a61a
DW
211struct mrvl_ie_num_ssid_probe {
212 struct mrvl_ie_header header;
981f187b 213 __le16 numssidprobe;
ba2d3587 214} __packed;
876c9d3a
MT
215
216struct led_pin {
217 u8 led;
218 u8 pin;
ba2d3587 219} __packed;
876c9d3a 220
75b6a61a
DW
221struct mrvl_ie_ledgpio {
222 struct mrvl_ie_header header;
876c9d3a 223 struct led_pin ledpin[1];
ba2d3587 224} __packed;
876c9d3a 225
c5562e98
DW
226struct led_bhv {
227 uint8_t firmwarestate;
228 uint8_t led;
229 uint8_t ledstate;
230 uint8_t ledarg;
ba2d3587 231} __packed;
c5562e98
DW
232
233
75b6a61a
DW
234struct mrvl_ie_ledbhv {
235 struct mrvl_ie_header header;
c5562e98 236 struct led_bhv ledbhv[1];
ba2d3587 237} __packed;
c5562e98 238
8973a6e7
RD
239/*
240 * Meant to be packed as the value member of a struct ieee80211_info_element.
edaea5ce 241 * Note that the len member of the ieee80211_info_element varies depending on
8973a6e7
RD
242 * the mesh_id_len
243 */
edaea5ce 244struct mrvl_meshie_val {
2c706002 245 uint8_t oui[3];
edaea5ce
JC
246 uint8_t type;
247 uint8_t subtype;
248 uint8_t version;
249 uint8_t active_protocol_id;
250 uint8_t active_metric_id;
251 uint8_t mesh_capability;
252 uint8_t mesh_id_len;
243e84e9 253 uint8_t mesh_id[IEEE80211_MAX_SSID_LEN];
ba2d3587 254} __packed;
edaea5ce
JC
255
256struct mrvl_meshie {
2c706002 257 u8 id, len;
edaea5ce 258 struct mrvl_meshie_val val;
ba2d3587 259} __packed;
edaea5ce
JC
260
261struct mrvl_mesh_defaults {
262 __le32 bootflag;
263 uint8_t boottime;
264 uint8_t reserved;
265 __le16 channel;
266 struct mrvl_meshie meshie;
ba2d3587 267} __packed;
edaea5ce 268
10078321 269#endif