]>
Commit | Line | Data |
---|---|---|
876c9d3a | 1 | /** |
9e66e701 HS |
2 | * This file function prototypes, data structure |
3 | * and definitions for all the host/station commands | |
876c9d3a MT |
4 | */ |
5 | ||
10078321 HS |
6 | #ifndef _LBS_HOST_H_ |
7 | #define _LBS_HOST_H_ | |
876c9d3a | 8 | |
f4228b4c HS |
9 | #include "types.h" |
10 | #include "defs.h" | |
876c9d3a | 11 | |
9e66e701 HS |
12 | #define DEFAULT_AD_HOC_CHANNEL 6 |
13 | ||
14 | #define CMD_OPTION_WAITFORRSP 0x0002 | |
876c9d3a | 15 | |
6b63cd0f HS |
16 | /** Host command IDs */ |
17 | ||
18 | /* Return command are almost always the same as the host command, but with | |
19 | * bit 15 set high. There are a few exceptions, though... | |
20 | */ | |
9e66e701 | 21 | #define CMD_RET(cmd) (0x8000 | cmd) |
6b63cd0f HS |
22 | |
23 | /* Return command convention exceptions: */ | |
9e66e701 | 24 | #define CMD_RET_802_11_ASSOCIATE 0x8012 |
6b63cd0f HS |
25 | |
26 | /* Command codes */ | |
9e66e701 HS |
27 | #define CMD_GET_HW_SPEC 0x0003 |
28 | #define CMD_EEPROM_UPDATE 0x0004 | |
29 | #define CMD_802_11_RESET 0x0005 | |
30 | #define CMD_802_11_SCAN 0x0006 | |
31 | #define CMD_802_11_GET_LOG 0x000b | |
32 | #define CMD_MAC_MULTICAST_ADR 0x0010 | |
33 | #define CMD_802_11_AUTHENTICATE 0x0011 | |
34 | #define CMD_802_11_EEPROM_ACCESS 0x0059 | |
35 | #define CMD_802_11_ASSOCIATE 0x0050 | |
36 | #define CMD_802_11_SET_WEP 0x0013 | |
37 | #define CMD_802_11_GET_STAT 0x0014 | |
38 | #define CMD_802_3_GET_STAT 0x0015 | |
39 | #define CMD_802_11_SNMP_MIB 0x0016 | |
40 | #define CMD_MAC_REG_MAP 0x0017 | |
41 | #define CMD_BBP_REG_MAP 0x0018 | |
42 | #define CMD_MAC_REG_ACCESS 0x0019 | |
43 | #define CMD_BBP_REG_ACCESS 0x001a | |
44 | #define CMD_RF_REG_ACCESS 0x001b | |
45 | #define CMD_802_11_RADIO_CONTROL 0x001c | |
46 | #define CMD_802_11_RF_CHANNEL 0x001d | |
47 | #define CMD_802_11_RF_TX_POWER 0x001e | |
48 | #define CMD_802_11_RSSI 0x001f | |
49 | #define CMD_802_11_RF_ANTENNA 0x0020 | |
50 | #define CMD_802_11_PS_MODE 0x0021 | |
51 | #define CMD_802_11_DATA_RATE 0x0022 | |
52 | #define CMD_RF_REG_MAP 0x0023 | |
53 | #define CMD_802_11_DEAUTHENTICATE 0x0024 | |
54 | #define CMD_802_11_REASSOCIATE 0x0025 | |
55 | #define CMD_MAC_CONTROL 0x0028 | |
56 | #define CMD_802_11_AD_HOC_START 0x002b | |
57 | #define CMD_802_11_AD_HOC_JOIN 0x002c | |
58 | #define CMD_802_11_QUERY_TKIP_REPLY_CNTRS 0x002e | |
59 | #define CMD_802_11_ENABLE_RSN 0x002f | |
60 | #define CMD_802_11_SET_AFC 0x003c | |
61 | #define CMD_802_11_GET_AFC 0x003d | |
62 | #define CMD_802_11_DEEP_SLEEP 0x003e | |
63 | #define CMD_802_11_AD_HOC_STOP 0x0040 | |
64 | #define CMD_802_11_HOST_SLEEP_CFG 0x0043 | |
65 | #define CMD_802_11_WAKEUP_CONFIRM 0x0044 | |
66 | #define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045 | |
67 | #define CMD_802_11_BEACON_STOP 0x0049 | |
68 | #define CMD_802_11_MAC_ADDRESS 0x004d | |
69 | #define CMD_802_11_LED_GPIO_CTRL 0x004e | |
70 | #define CMD_802_11_EEPROM_ACCESS 0x0059 | |
71 | #define CMD_802_11_BAND_CONFIG 0x0058 | |
72 | #define CMD_GSPI_BUS_CONFIG 0x005a | |
73 | #define CMD_802_11D_DOMAIN_INFO 0x005b | |
74 | #define CMD_802_11_KEY_MATERIAL 0x005e | |
75 | #define CMD_802_11_SLEEP_PARAMS 0x0066 | |
76 | #define CMD_802_11_INACTIVITY_TIMEOUT 0x0067 | |
77 | #define CMD_802_11_SLEEP_PERIOD 0x0068 | |
78 | #define CMD_802_11_TPC_CFG 0x0072 | |
79 | #define CMD_802_11_PA_CFG 0x0073 | |
80 | #define CMD_802_11_FW_WAKE_METHOD 0x0074 | |
81 | #define CMD_802_11_SUBSCRIBE_EVENT 0x0075 | |
82 | #define CMD_802_11_RATE_ADAPT_RATESET 0x0076 | |
83 | #define CMD_802_11_TX_RATE_QUERY 0x007f | |
84 | #define CMD_GET_TSF 0x0080 | |
85 | #define CMD_BT_ACCESS 0x0087 | |
86 | #define CMD_FWT_ACCESS 0x0095 | |
87 | #define CMD_802_11_MONITOR_MODE 0x0098 | |
88 | #define CMD_MESH_ACCESS 0x009b | |
89 | #define CMD_MESH_CONFIG_OLD 0x00a3 | |
90 | #define CMD_MESH_CONFIG 0x00ac | |
91 | #define CMD_SET_BOOT2_VER 0x00a5 | |
92 | #define CMD_FUNC_INIT 0x00a9 | |
93 | #define CMD_FUNC_SHUTDOWN 0x00aa | |
94 | #define CMD_802_11_BEACON_CTRL 0x00b0 | |
96287ac4 | 95 | |
876c9d3a | 96 | /* For the IEEE Power Save */ |
9e66e701 HS |
97 | #define CMD_SUBCMD_ENTER_PS 0x0030 |
98 | #define CMD_SUBCMD_EXIT_PS 0x0031 | |
99 | #define CMD_SUBCMD_SLEEP_CONFIRMED 0x0034 | |
100 | #define CMD_SUBCMD_FULL_POWERDOWN 0x0035 | |
101 | #define CMD_SUBCMD_FULL_POWERUP 0x0036 | |
876c9d3a | 102 | |
9e66e701 HS |
103 | #define CMD_ENABLE_RSN 0x0001 |
104 | #define CMD_DISABLE_RSN 0x0000 | |
876c9d3a | 105 | |
9e66e701 HS |
106 | #define CMD_ACT_GET 0x0000 |
107 | #define CMD_ACT_SET 0x0001 | |
876c9d3a | 108 | |
0aef64d7 | 109 | /* Define action or option for CMD_802_11_SET_WEP */ |
9e66e701 HS |
110 | #define CMD_ACT_ADD 0x0002 |
111 | #define CMD_ACT_REMOVE 0x0004 | |
876c9d3a | 112 | |
9e66e701 HS |
113 | #define CMD_TYPE_WEP_40_BIT 0x01 |
114 | #define CMD_TYPE_WEP_104_BIT 0x02 | |
876c9d3a | 115 | |
9e66e701 | 116 | #define CMD_NUM_OF_WEP_KEYS 4 |
876c9d3a | 117 | |
9e66e701 | 118 | #define CMD_WEP_KEY_INDEX_MASK 0x3fff |
876c9d3a | 119 | |
0aef64d7 | 120 | /* Define action or option for CMD_802_11_SCAN */ |
9e66e701 HS |
121 | #define CMD_BSS_TYPE_BSS 0x0001 |
122 | #define CMD_BSS_TYPE_IBSS 0x0002 | |
123 | #define CMD_BSS_TYPE_ANY 0x0003 | |
876c9d3a | 124 | |
0aef64d7 | 125 | /* Define action or option for CMD_802_11_SCAN */ |
9e66e701 HS |
126 | #define CMD_SCAN_TYPE_ACTIVE 0x0000 |
127 | #define CMD_SCAN_TYPE_PASSIVE 0x0001 | |
876c9d3a | 128 | |
9e66e701 | 129 | #define CMD_SCAN_RADIO_TYPE_BG 0 |
876c9d3a | 130 | |
9e66e701 | 131 | #define CMD_SCAN_PROBE_DELAY_TIME 0 |
876c9d3a | 132 | |
0aef64d7 | 133 | /* Define action or option for CMD_MAC_CONTROL */ |
9e66e701 HS |
134 | #define CMD_ACT_MAC_RX_ON 0x0001 |
135 | #define CMD_ACT_MAC_TX_ON 0x0002 | |
136 | #define CMD_ACT_MAC_LOOPBACK_ON 0x0004 | |
137 | #define CMD_ACT_MAC_WEP_ENABLE 0x0008 | |
138 | #define CMD_ACT_MAC_INT_ENABLE 0x0010 | |
139 | #define CMD_ACT_MAC_MULTICAST_ENABLE 0x0020 | |
140 | #define CMD_ACT_MAC_BROADCAST_ENABLE 0x0040 | |
141 | #define CMD_ACT_MAC_PROMISCUOUS_ENABLE 0x0080 | |
142 | #define CMD_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100 | |
143 | #define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400 | |
876c9d3a | 144 | |
3a188649 | 145 | /* Event flags for CMD_802_11_SUBSCRIBE_EVENT */ |
9e66e701 HS |
146 | #define CMD_SUBSCRIBE_RSSI_LOW 0x0001 |
147 | #define CMD_SUBSCRIBE_SNR_LOW 0x0002 | |
148 | #define CMD_SUBSCRIBE_FAILCOUNT 0x0004 | |
149 | #define CMD_SUBSCRIBE_BCNMISS 0x0008 | |
150 | #define CMD_SUBSCRIBE_RSSI_HIGH 0x0010 | |
151 | #define CMD_SUBSCRIBE_SNR_HIGH 0x0020 | |
3a188649 | 152 | |
9e66e701 HS |
153 | #define RADIO_PREAMBLE_LONG 0x00 |
154 | #define RADIO_PREAMBLE_SHORT 0x02 | |
155 | #define RADIO_PREAMBLE_AUTO 0x04 | |
876c9d3a MT |
156 | |
157 | /* Define action or option for CMD_802_11_RF_CHANNEL */ | |
9e66e701 HS |
158 | #define CMD_OPT_802_11_RF_CHANNEL_GET 0x00 |
159 | #define CMD_OPT_802_11_RF_CHANNEL_SET 0x01 | |
0aef64d7 | 160 | |
0aef64d7 | 161 | /* Define action or option for CMD_802_11_DATA_RATE */ |
9e66e701 HS |
162 | #define CMD_ACT_SET_TX_AUTO 0x0000 |
163 | #define CMD_ACT_SET_TX_FIX_RATE 0x0001 | |
164 | #define CMD_ACT_GET_TX_RATE 0x0002 | |
0aef64d7 DW |
165 | |
166 | /* Define action or option for CMD_802_11_PS_MODE */ | |
9e66e701 HS |
167 | #define CMD_TYPE_CAM 0x0000 |
168 | #define CMD_TYPE_MAX_PSP 0x0001 | |
169 | #define CMD_TYPE_FAST_PSP 0x0002 | |
0aef64d7 | 170 | |
b2c57eee | 171 | /* Options for CMD_802_11_FW_WAKE_METHOD */ |
9e66e701 HS |
172 | #define CMD_WAKE_METHOD_UNCHANGED 0x0000 |
173 | #define CMD_WAKE_METHOD_COMMAND_INT 0x0001 | |
174 | #define CMD_WAKE_METHOD_GPIO 0x0002 | |
b2c57eee | 175 | |
39fcf7a3 | 176 | /* Object IDs for CMD_802_11_SNMP_MIB */ |
9e66e701 HS |
177 | #define SNMP_MIB_OID_BSS_TYPE 0x0000 |
178 | #define SNMP_MIB_OID_OP_RATE_SET 0x0001 | |
179 | #define SNMP_MIB_OID_BEACON_PERIOD 0x0002 /* Reserved on v9+ */ | |
180 | #define SNMP_MIB_OID_DTIM_PERIOD 0x0003 /* Reserved on v9+ */ | |
181 | #define SNMP_MIB_OID_ASSOC_TIMEOUT 0x0004 /* Reserved on v9+ */ | |
182 | #define SNMP_MIB_OID_RTS_THRESHOLD 0x0005 | |
183 | #define SNMP_MIB_OID_SHORT_RETRY_LIMIT 0x0006 | |
184 | #define SNMP_MIB_OID_LONG_RETRY_LIMIT 0x0007 | |
185 | #define SNMP_MIB_OID_FRAG_THRESHOLD 0x0008 | |
186 | #define SNMP_MIB_OID_11D_ENABLE 0x0009 | |
187 | #define SNMP_MIB_OID_11H_ENABLE 0x000A | |
39fcf7a3 | 188 | |
0aef64d7 | 189 | /* Define action or option for CMD_BT_ACCESS */ |
ffcae953 | 190 | enum cmd_bt_access_opts { |
876c9d3a MT |
191 | /* The bt commands start at 5 instead of 1 because the old dft commands |
192 | * are mapped to 1-4. These old commands are no longer maintained and | |
193 | * should not be called. | |
194 | */ | |
0aef64d7 DW |
195 | CMD_ACT_BT_ACCESS_ADD = 5, |
196 | CMD_ACT_BT_ACCESS_DEL, | |
197 | CMD_ACT_BT_ACCESS_LIST, | |
198 | CMD_ACT_BT_ACCESS_RESET, | |
199 | CMD_ACT_BT_ACCESS_SET_INVERT, | |
200 | CMD_ACT_BT_ACCESS_GET_INVERT | |
876c9d3a MT |
201 | }; |
202 | ||
0aef64d7 | 203 | /* Define action or option for CMD_FWT_ACCESS */ |
ffcae953 | 204 | enum cmd_fwt_access_opts { |
0aef64d7 DW |
205 | CMD_ACT_FWT_ACCESS_ADD = 1, |
206 | CMD_ACT_FWT_ACCESS_DEL, | |
207 | CMD_ACT_FWT_ACCESS_LOOKUP, | |
208 | CMD_ACT_FWT_ACCESS_LIST, | |
79a9a37c DW |
209 | CMD_ACT_FWT_ACCESS_LIST_ROUTE, |
210 | CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR, | |
0aef64d7 DW |
211 | CMD_ACT_FWT_ACCESS_RESET, |
212 | CMD_ACT_FWT_ACCESS_CLEANUP, | |
213 | CMD_ACT_FWT_ACCESS_TIME, | |
876c9d3a MT |
214 | }; |
215 | ||
582c1b53 AN |
216 | /* Define action or option for CMD_802_11_HOST_SLEEP_CFG */ |
217 | enum cmd_wol_cfg_opts { | |
218 | CMD_ACT_ACTION_NONE = 0, | |
219 | CMD_ACT_SET_WOL_RULE, | |
220 | CMD_ACT_GET_WOL_RULE, | |
221 | CMD_ACT_RESET_WOL_RULE, | |
222 | }; | |
223 | ||
0aef64d7 | 224 | /* Define action or option for CMD_MESH_ACCESS */ |
ffcae953 | 225 | enum cmd_mesh_access_opts { |
0aef64d7 DW |
226 | CMD_ACT_MESH_GET_TTL = 1, |
227 | CMD_ACT_MESH_SET_TTL, | |
228 | CMD_ACT_MESH_GET_STATS, | |
229 | CMD_ACT_MESH_GET_ANYCAST, | |
230 | CMD_ACT_MESH_SET_ANYCAST, | |
276c015e DW |
231 | CMD_ACT_MESH_SET_LINK_COSTS, |
232 | CMD_ACT_MESH_GET_LINK_COSTS, | |
233 | CMD_ACT_MESH_SET_BCAST_RATE, | |
234 | CMD_ACT_MESH_GET_BCAST_RATE, | |
235 | CMD_ACT_MESH_SET_RREQ_DELAY, | |
236 | CMD_ACT_MESH_GET_RREQ_DELAY, | |
237 | CMD_ACT_MESH_SET_ROUTE_EXP, | |
238 | CMD_ACT_MESH_GET_ROUTE_EXP, | |
a9f38d02 LCC |
239 | CMD_ACT_MESH_SET_AUTOSTART_ENABLED, |
240 | CMD_ACT_MESH_GET_AUTOSTART_ENABLED, | |
6fb53252 | 241 | CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17, |
876c9d3a MT |
242 | }; |
243 | ||
edaea5ce JC |
244 | /* Define actions and types for CMD_MESH_CONFIG */ |
245 | enum cmd_mesh_config_actions { | |
246 | CMD_ACT_MESH_CONFIG_STOP = 0, | |
247 | CMD_ACT_MESH_CONFIG_START, | |
248 | CMD_ACT_MESH_CONFIG_SET, | |
249 | CMD_ACT_MESH_CONFIG_GET, | |
250 | }; | |
251 | ||
252 | enum cmd_mesh_config_types { | |
253 | CMD_TYPE_MESH_SET_BOOTFLAG = 1, | |
254 | CMD_TYPE_MESH_SET_BOOTTIME, | |
255 | CMD_TYPE_MESH_SET_DEF_CHANNEL, | |
256 | CMD_TYPE_MESH_SET_MESH_IE, | |
257 | CMD_TYPE_MESH_GET_DEFAULTS, | |
258 | CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */ | |
259 | }; | |
260 | ||
876c9d3a | 261 | /** Card Event definition */ |
387a1f04 DW |
262 | #define MACREG_INT_CODE_TX_PPA_FREE 0 |
263 | #define MACREG_INT_CODE_TX_DMA_DONE 1 | |
264 | #define MACREG_INT_CODE_LINK_LOST_W_SCAN 2 | |
265 | #define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3 | |
266 | #define MACREG_INT_CODE_LINK_SENSED 4 | |
267 | #define MACREG_INT_CODE_CMD_FINISHED 5 | |
268 | #define MACREG_INT_CODE_MIB_CHANGED 6 | |
269 | #define MACREG_INT_CODE_INIT_DONE 7 | |
270 | #define MACREG_INT_CODE_DEAUTHENTICATED 8 | |
271 | #define MACREG_INT_CODE_DISASSOCIATED 9 | |
272 | #define MACREG_INT_CODE_PS_AWAKE 10 | |
273 | #define MACREG_INT_CODE_PS_SLEEP 11 | |
274 | #define MACREG_INT_CODE_MIC_ERR_MULTICAST 13 | |
275 | #define MACREG_INT_CODE_MIC_ERR_UNICAST 14 | |
276 | #define MACREG_INT_CODE_WM_AWAKE 15 | |
277 | #define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16 | |
278 | #define MACREG_INT_CODE_ADHOC_BCN_LOST 17 | |
279 | #define MACREG_INT_CODE_HOST_AWAKE 18 | |
280 | #define MACREG_INT_CODE_STOP_TX 19 | |
281 | #define MACREG_INT_CODE_START_TX 20 | |
282 | #define MACREG_INT_CODE_CHANNEL_SWITCH 21 | |
283 | #define MACREG_INT_CODE_MEASUREMENT_RDY 22 | |
284 | #define MACREG_INT_CODE_WMM_CHANGE 23 | |
285 | #define MACREG_INT_CODE_BG_SCAN_REPORT 24 | |
286 | #define MACREG_INT_CODE_RSSI_LOW 25 | |
287 | #define MACREG_INT_CODE_SNR_LOW 26 | |
288 | #define MACREG_INT_CODE_MAX_FAIL 27 | |
289 | #define MACREG_INT_CODE_RSSI_HIGH 28 | |
290 | #define MACREG_INT_CODE_SNR_HIGH 29 | |
291 | #define MACREG_INT_CODE_MESH_AUTO_STARTED 35 | |
292 | #define MACREG_INT_CODE_FIRMWARE_READY 48 | |
876c9d3a | 293 | |
9e66e701 HS |
294 | |
295 | /* 802.11-related definitions */ | |
296 | ||
297 | /* TxPD descriptor */ | |
298 | struct txpd { | |
299 | /* union to cope up with later FW revisions */ | |
300 | union { | |
301 | /* Current Tx packet status */ | |
302 | __le32 tx_status; | |
303 | struct { | |
304 | /* BSS type: client, AP, etc. */ | |
305 | u8 bss_type; | |
306 | /* BSS number */ | |
307 | u8 bss_num; | |
308 | /* Reserved */ | |
309 | __le16 reserved; | |
310 | } bss; | |
311 | } u; | |
312 | /* Tx control */ | |
313 | __le32 tx_control; | |
314 | __le32 tx_packet_location; | |
315 | /* Tx packet length */ | |
316 | __le16 tx_packet_length; | |
317 | /* First 2 byte of destination MAC address */ | |
318 | u8 tx_dest_addr_high[2]; | |
319 | /* Last 4 byte of destination MAC address */ | |
320 | u8 tx_dest_addr_low[4]; | |
321 | /* Pkt Priority */ | |
322 | u8 priority; | |
323 | /* Pkt Trasnit Power control */ | |
324 | u8 powermgmt; | |
325 | /* Amount of time the packet has been queued (units = 2ms) */ | |
326 | u8 pktdelay_2ms; | |
327 | /* reserved */ | |
328 | u8 reserved1; | |
ba2d3587 | 329 | } __packed; |
9e66e701 HS |
330 | |
331 | /* RxPD Descriptor */ | |
332 | struct rxpd { | |
333 | /* union to cope up with later FW revisions */ | |
334 | union { | |
335 | /* Current Rx packet status */ | |
336 | __le16 status; | |
337 | struct { | |
338 | /* BSS type: client, AP, etc. */ | |
339 | u8 bss_type; | |
340 | /* BSS number */ | |
341 | u8 bss_num; | |
ba2d3587 ED |
342 | } __packed bss; |
343 | } __packed u; | |
9e66e701 HS |
344 | |
345 | /* SNR */ | |
346 | u8 snr; | |
347 | ||
348 | /* Tx control */ | |
349 | u8 rx_control; | |
350 | ||
351 | /* Pkt length */ | |
352 | __le16 pkt_len; | |
353 | ||
354 | /* Noise Floor */ | |
355 | u8 nf; | |
356 | ||
357 | /* Rx Packet Rate */ | |
358 | u8 rx_rate; | |
359 | ||
360 | /* Pkt addr */ | |
361 | __le32 pkt_ptr; | |
362 | ||
363 | /* Next Rx RxPD addr */ | |
364 | __le32 next_rxpd_ptr; | |
365 | ||
366 | /* Pkt Priority */ | |
367 | u8 priority; | |
368 | u8 reserved[3]; | |
ba2d3587 | 369 | } __packed; |
9e66e701 HS |
370 | |
371 | struct cmd_header { | |
372 | __le16 command; | |
373 | __le16 size; | |
374 | __le16 seqnum; | |
375 | __le16 result; | |
ba2d3587 | 376 | } __packed; |
9e66e701 | 377 | |
9e66e701 HS |
378 | /* Generic structure to hold all key types. */ |
379 | struct enc_key { | |
380 | u16 len; | |
381 | u16 flags; /* KEY_INFO_* from defs.h */ | |
382 | u16 type; /* KEY_TYPE_* from defs.h */ | |
383 | u8 key[32]; | |
384 | }; | |
385 | ||
386 | /* lbs_offset_value */ | |
387 | struct lbs_offset_value { | |
388 | u32 offset; | |
389 | u32 value; | |
ba2d3587 | 390 | } __packed; |
9e66e701 | 391 | |
cc4b9d39 | 392 | #define MAX_11D_TRIPLETS 83 |
1047d5ed KD |
393 | |
394 | struct mrvl_ie_domain_param_set { | |
395 | struct mrvl_ie_header header; | |
396 | ||
cc4b9d39 DW |
397 | u8 country_code[3]; |
398 | struct ieee80211_country_ie_triplet triplet[MAX_11D_TRIPLETS]; | |
beabe914 | 399 | } __packed; |
1047d5ed KD |
400 | |
401 | struct cmd_ds_802_11d_domain_info { | |
cc4b9d39 DW |
402 | struct cmd_header hdr; |
403 | ||
1047d5ed KD |
404 | __le16 action; |
405 | struct mrvl_ie_domain_param_set domain; | |
beabe914 | 406 | } __packed; |
1047d5ed | 407 | |
9e66e701 HS |
408 | /* |
409 | * Define data structure for CMD_GET_HW_SPEC | |
410 | * This structure defines the response for the GET_HW_SPEC command | |
411 | */ | |
412 | struct cmd_ds_get_hw_spec { | |
413 | struct cmd_header hdr; | |
414 | ||
415 | /* HW Interface version number */ | |
416 | __le16 hwifversion; | |
417 | /* HW version number */ | |
418 | __le16 version; | |
419 | /* Max number of TxPD FW can handle */ | |
420 | __le16 nr_txpd; | |
421 | /* Max no of Multicast address */ | |
422 | __le16 nr_mcast_adr; | |
423 | /* MAC address */ | |
424 | u8 permanentaddr[6]; | |
425 | ||
426 | /* region Code */ | |
427 | __le16 regioncode; | |
428 | ||
429 | /* Number of antenna used */ | |
430 | __le16 nr_antenna; | |
431 | ||
432 | /* FW release number, example 0x01030304 = 2.3.4p1 */ | |
433 | __le32 fwrelease; | |
434 | ||
435 | /* Base Address of TxPD queue */ | |
436 | __le32 wcb_base; | |
437 | /* Read Pointer of RxPd queue */ | |
438 | __le32 rxpd_rdptr; | |
439 | ||
440 | /* Write Pointer of RxPd queue */ | |
441 | __le32 rxpd_wrptr; | |
442 | ||
443 | /*FW/HW capability */ | |
444 | __le32 fwcapinfo; | |
ba2d3587 | 445 | } __packed; |
9e66e701 HS |
446 | |
447 | struct cmd_ds_802_11_subscribe_event { | |
448 | struct cmd_header hdr; | |
449 | ||
450 | __le16 action; | |
451 | __le16 events; | |
452 | ||
453 | /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a | |
454 | * number of TLVs. From the v5.1 manual, those TLVs would add up to | |
455 | * 40 bytes. However, future firmware might add additional TLVs, so I | |
456 | * bump this up a bit. | |
457 | */ | |
458 | uint8_t tlv[128]; | |
ba2d3587 | 459 | } __packed; |
9e66e701 HS |
460 | |
461 | /* | |
462 | * This scan handle Country Information IE(802.11d compliant) | |
463 | * Define data structure for CMD_802_11_SCAN | |
464 | */ | |
465 | struct cmd_ds_802_11_scan { | |
466 | struct cmd_header hdr; | |
467 | ||
468 | uint8_t bsstype; | |
469 | uint8_t bssid[ETH_ALEN]; | |
470 | uint8_t tlvbuffer[0]; | |
ba2d3587 | 471 | } __packed; |
9e66e701 HS |
472 | |
473 | struct cmd_ds_802_11_scan_rsp { | |
474 | struct cmd_header hdr; | |
475 | ||
476 | __le16 bssdescriptsize; | |
477 | uint8_t nr_sets; | |
478 | uint8_t bssdesc_and_tlvbuffer[0]; | |
ba2d3587 | 479 | } __packed; |
9e66e701 HS |
480 | |
481 | struct cmd_ds_802_11_get_log { | |
482 | struct cmd_header hdr; | |
483 | ||
484 | __le32 mcasttxframe; | |
485 | __le32 failed; | |
486 | __le32 retry; | |
487 | __le32 multiretry; | |
488 | __le32 framedup; | |
489 | __le32 rtssuccess; | |
490 | __le32 rtsfailure; | |
491 | __le32 ackfailure; | |
492 | __le32 rxfrag; | |
493 | __le32 mcastrxframe; | |
494 | __le32 fcserror; | |
495 | __le32 txframe; | |
496 | __le32 wepundecryptable; | |
ba2d3587 | 497 | } __packed; |
9e66e701 HS |
498 | |
499 | struct cmd_ds_mac_control { | |
500 | struct cmd_header hdr; | |
501 | __le16 action; | |
502 | u16 reserved; | |
ba2d3587 | 503 | } __packed; |
9e66e701 HS |
504 | |
505 | struct cmd_ds_mac_multicast_adr { | |
506 | struct cmd_header hdr; | |
507 | __le16 action; | |
508 | __le16 nr_of_adrs; | |
509 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; | |
ba2d3587 | 510 | } __packed; |
9e66e701 HS |
511 | |
512 | struct cmd_ds_802_11_authenticate { | |
513 | struct cmd_header hdr; | |
514 | ||
515 | u8 bssid[ETH_ALEN]; | |
516 | u8 authtype; | |
517 | u8 reserved[10]; | |
ba2d3587 | 518 | } __packed; |
9e66e701 HS |
519 | |
520 | struct cmd_ds_802_11_deauthenticate { | |
521 | struct cmd_header hdr; | |
522 | ||
523 | u8 macaddr[ETH_ALEN]; | |
524 | __le16 reasoncode; | |
ba2d3587 | 525 | } __packed; |
9e66e701 HS |
526 | |
527 | struct cmd_ds_802_11_associate { | |
528 | struct cmd_header hdr; | |
529 | ||
530 | u8 bssid[6]; | |
531 | __le16 capability; | |
532 | __le16 listeninterval; | |
533 | __le16 bcnperiod; | |
534 | u8 dtimperiod; | |
535 | u8 iebuf[512]; /* Enough for required and most optional IEs */ | |
ba2d3587 | 536 | } __packed; |
9e66e701 HS |
537 | |
538 | struct cmd_ds_802_11_associate_response { | |
539 | struct cmd_header hdr; | |
540 | ||
541 | __le16 capability; | |
542 | __le16 statuscode; | |
543 | __le16 aid; | |
544 | u8 iebuf[512]; | |
ba2d3587 | 545 | } __packed; |
9e66e701 HS |
546 | |
547 | struct cmd_ds_802_11_set_wep { | |
548 | struct cmd_header hdr; | |
549 | ||
550 | /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */ | |
551 | __le16 action; | |
552 | ||
553 | /* key Index selected for Tx */ | |
554 | __le16 keyindex; | |
555 | ||
556 | /* 40, 128bit or TXWEP */ | |
557 | uint8_t keytype[4]; | |
558 | uint8_t keymaterial[4][16]; | |
ba2d3587 | 559 | } __packed; |
9e66e701 HS |
560 | |
561 | struct cmd_ds_802_11_snmp_mib { | |
562 | struct cmd_header hdr; | |
563 | ||
564 | __le16 action; | |
565 | __le16 oid; | |
566 | __le16 bufsize; | |
567 | u8 value[128]; | |
ba2d3587 | 568 | } __packed; |
9e66e701 HS |
569 | |
570 | struct cmd_ds_mac_reg_access { | |
571 | __le16 action; | |
572 | __le16 offset; | |
573 | __le32 value; | |
ba2d3587 | 574 | } __packed; |
9e66e701 HS |
575 | |
576 | struct cmd_ds_bbp_reg_access { | |
577 | __le16 action; | |
578 | __le16 offset; | |
579 | u8 value; | |
580 | u8 reserved[3]; | |
ba2d3587 | 581 | } __packed; |
9e66e701 HS |
582 | |
583 | struct cmd_ds_rf_reg_access { | |
584 | __le16 action; | |
585 | __le16 offset; | |
586 | u8 value; | |
587 | u8 reserved[3]; | |
ba2d3587 | 588 | } __packed; |
9e66e701 HS |
589 | |
590 | struct cmd_ds_802_11_radio_control { | |
591 | struct cmd_header hdr; | |
592 | ||
593 | __le16 action; | |
594 | __le16 control; | |
ba2d3587 | 595 | } __packed; |
9e66e701 HS |
596 | |
597 | struct cmd_ds_802_11_beacon_control { | |
598 | __le16 action; | |
599 | __le16 beacon_enable; | |
600 | __le16 beacon_period; | |
ba2d3587 | 601 | } __packed; |
9e66e701 HS |
602 | |
603 | struct cmd_ds_802_11_sleep_params { | |
604 | struct cmd_header hdr; | |
605 | ||
606 | /* ACT_GET/ACT_SET */ | |
607 | __le16 action; | |
608 | ||
609 | /* Sleep clock error in ppm */ | |
610 | __le16 error; | |
611 | ||
612 | /* Wakeup offset in usec */ | |
613 | __le16 offset; | |
614 | ||
615 | /* Clock stabilization time in usec */ | |
616 | __le16 stabletime; | |
617 | ||
618 | /* control periodic calibration */ | |
619 | uint8_t calcontrol; | |
620 | ||
621 | /* control the use of external sleep clock */ | |
622 | uint8_t externalsleepclk; | |
623 | ||
624 | /* reserved field, should be set to zero */ | |
625 | __le16 reserved; | |
ba2d3587 | 626 | } __packed; |
9e66e701 | 627 | |
9e66e701 HS |
628 | struct cmd_ds_802_11_rf_channel { |
629 | struct cmd_header hdr; | |
630 | ||
631 | __le16 action; | |
632 | __le16 channel; | |
633 | __le16 rftype; /* unused */ | |
634 | __le16 reserved; /* unused */ | |
635 | u8 channellist[32]; /* unused */ | |
ba2d3587 | 636 | } __packed; |
9e66e701 HS |
637 | |
638 | struct cmd_ds_802_11_rssi { | |
9fb7663d | 639 | struct cmd_header hdr; |
9e66e701 | 640 | |
9fb7663d DW |
641 | /* request: number of beacons (N) to average the SNR and NF over |
642 | * response: SNR of most recent beacon | |
643 | */ | |
644 | __le16 n_or_snr; | |
9e66e701 | 645 | |
9fb7663d DW |
646 | /* The following fields are only set in the response. |
647 | * In the request these are reserved and should be set to 0. | |
648 | */ | |
649 | __le16 nf; /* most recent beacon noise floor */ | |
650 | __le16 avg_snr; /* average SNR weighted by N from request */ | |
651 | __le16 avg_nf; /* average noise floor weighted by N from request */ | |
ba2d3587 | 652 | } __packed; |
9e66e701 HS |
653 | |
654 | struct cmd_ds_802_11_mac_address { | |
655 | struct cmd_header hdr; | |
656 | ||
657 | __le16 action; | |
658 | u8 macadd[ETH_ALEN]; | |
ba2d3587 | 659 | } __packed; |
9e66e701 HS |
660 | |
661 | struct cmd_ds_802_11_rf_tx_power { | |
662 | struct cmd_header hdr; | |
663 | ||
664 | __le16 action; | |
665 | __le16 curlevel; | |
666 | s8 maxlevel; | |
667 | s8 minlevel; | |
ba2d3587 | 668 | } __packed; |
9e66e701 | 669 | |
a45b6f4f | 670 | /* MONITOR_MODE only exists in OLPC v5 firmware */ |
9e66e701 | 671 | struct cmd_ds_802_11_monitor_mode { |
a45b6f4f DW |
672 | struct cmd_header hdr; |
673 | ||
9e66e701 HS |
674 | __le16 action; |
675 | __le16 mode; | |
ba2d3587 | 676 | } __packed; |
9e66e701 HS |
677 | |
678 | struct cmd_ds_set_boot2_ver { | |
679 | struct cmd_header hdr; | |
680 | ||
681 | __le16 action; | |
682 | __le16 version; | |
ba2d3587 | 683 | } __packed; |
9e66e701 HS |
684 | |
685 | struct cmd_ds_802_11_fw_wake_method { | |
686 | struct cmd_header hdr; | |
687 | ||
688 | __le16 action; | |
689 | __le16 method; | |
ba2d3587 | 690 | } __packed; |
9e66e701 HS |
691 | |
692 | struct cmd_ds_802_11_ps_mode { | |
693 | __le16 action; | |
694 | __le16 nullpktinterval; | |
695 | __le16 multipledtim; | |
696 | __le16 reserved; | |
697 | __le16 locallisteninterval; | |
ba2d3587 | 698 | } __packed; |
9e66e701 HS |
699 | |
700 | struct cmd_confirm_sleep { | |
701 | struct cmd_header hdr; | |
702 | ||
703 | __le16 action; | |
704 | __le16 nullpktinterval; | |
705 | __le16 multipledtim; | |
706 | __le16 reserved; | |
707 | __le16 locallisteninterval; | |
ba2d3587 | 708 | } __packed; |
9e66e701 HS |
709 | |
710 | struct cmd_ds_802_11_data_rate { | |
711 | struct cmd_header hdr; | |
712 | ||
713 | __le16 action; | |
714 | __le16 reserved; | |
715 | u8 rates[MAX_RATES]; | |
ba2d3587 | 716 | } __packed; |
9e66e701 HS |
717 | |
718 | struct cmd_ds_802_11_rate_adapt_rateset { | |
719 | struct cmd_header hdr; | |
720 | __le16 action; | |
721 | __le16 enablehwauto; | |
722 | __le16 bitmap; | |
ba2d3587 | 723 | } __packed; |
9e66e701 HS |
724 | |
725 | struct cmd_ds_802_11_ad_hoc_start { | |
726 | struct cmd_header hdr; | |
727 | ||
243e84e9 | 728 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
9e66e701 HS |
729 | u8 bsstype; |
730 | __le16 beaconperiod; | |
731 | u8 dtimperiod; /* Reserved on v9 and later */ | |
732 | struct ieee_ie_ibss_param_set ibss; | |
733 | u8 reserved1[4]; | |
734 | struct ieee_ie_ds_param_set ds; | |
735 | u8 reserved2[4]; | |
736 | __le16 probedelay; /* Reserved on v9 and later */ | |
737 | __le16 capability; | |
738 | u8 rates[MAX_RATES]; | |
739 | u8 tlv_memory_size_pad[100]; | |
ba2d3587 | 740 | } __packed; |
9e66e701 HS |
741 | |
742 | struct cmd_ds_802_11_ad_hoc_result { | |
743 | struct cmd_header hdr; | |
744 | ||
745 | u8 pad[3]; | |
746 | u8 bssid[ETH_ALEN]; | |
ba2d3587 | 747 | } __packed; |
9e66e701 HS |
748 | |
749 | struct adhoc_bssdesc { | |
750 | u8 bssid[ETH_ALEN]; | |
243e84e9 | 751 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
9e66e701 HS |
752 | u8 type; |
753 | __le16 beaconperiod; | |
754 | u8 dtimperiod; | |
755 | __le64 timestamp; | |
756 | __le64 localtime; | |
757 | struct ieee_ie_ds_param_set ds; | |
758 | u8 reserved1[4]; | |
759 | struct ieee_ie_ibss_param_set ibss; | |
760 | u8 reserved2[4]; | |
761 | __le16 capability; | |
762 | u8 rates[MAX_RATES]; | |
763 | ||
764 | /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the | |
765 | * Adhoc join command and will cause a binary layout mismatch with | |
766 | * the firmware | |
767 | */ | |
ba2d3587 | 768 | } __packed; |
9e66e701 HS |
769 | |
770 | struct cmd_ds_802_11_ad_hoc_join { | |
771 | struct cmd_header hdr; | |
772 | ||
773 | struct adhoc_bssdesc bss; | |
774 | __le16 failtimeout; /* Reserved on v9 and later */ | |
775 | __le16 probedelay; /* Reserved on v9 and later */ | |
ba2d3587 | 776 | } __packed; |
9e66e701 HS |
777 | |
778 | struct cmd_ds_802_11_ad_hoc_stop { | |
779 | struct cmd_header hdr; | |
ba2d3587 | 780 | } __packed; |
9e66e701 HS |
781 | |
782 | struct cmd_ds_802_11_enable_rsn { | |
783 | struct cmd_header hdr; | |
784 | ||
785 | __le16 action; | |
786 | __le16 enable; | |
ba2d3587 | 787 | } __packed; |
9e66e701 HS |
788 | |
789 | struct MrvlIEtype_keyParamSet { | |
790 | /* type ID */ | |
791 | __le16 type; | |
792 | ||
793 | /* length of Payload */ | |
794 | __le16 length; | |
795 | ||
796 | /* type of key: WEP=0, TKIP=1, AES=2 */ | |
797 | __le16 keytypeid; | |
798 | ||
799 | /* key control Info specific to a keytypeid */ | |
800 | __le16 keyinfo; | |
801 | ||
802 | /* length of key */ | |
803 | __le16 keylen; | |
804 | ||
805 | /* key material of size keylen */ | |
806 | u8 key[32]; | |
ba2d3587 | 807 | } __packed; |
9e66e701 HS |
808 | |
809 | #define MAX_WOL_RULES 16 | |
810 | ||
811 | struct host_wol_rule { | |
812 | uint8_t rule_no; | |
813 | uint8_t rule_ops; | |
814 | __le16 sig_offset; | |
815 | __le16 sig_length; | |
816 | __le16 reserve; | |
817 | __be32 sig_mask; | |
818 | __be32 signature; | |
ba2d3587 | 819 | } __packed; |
9e66e701 HS |
820 | |
821 | struct wol_config { | |
822 | uint8_t action; | |
823 | uint8_t pattern; | |
824 | uint8_t no_rules_in_cmd; | |
825 | uint8_t result; | |
826 | struct host_wol_rule rule[MAX_WOL_RULES]; | |
ba2d3587 | 827 | } __packed; |
9e66e701 HS |
828 | |
829 | struct cmd_ds_host_sleep { | |
830 | struct cmd_header hdr; | |
831 | __le32 criteria; | |
832 | uint8_t gpio; | |
833 | uint16_t gap; | |
834 | struct wol_config wol_conf; | |
ba2d3587 | 835 | } __packed; |
9e66e701 HS |
836 | |
837 | ||
838 | ||
839 | struct cmd_ds_802_11_key_material { | |
840 | struct cmd_header hdr; | |
841 | ||
842 | __le16 action; | |
843 | struct MrvlIEtype_keyParamSet keyParamSet[2]; | |
ba2d3587 | 844 | } __packed; |
9e66e701 HS |
845 | |
846 | struct cmd_ds_802_11_eeprom_access { | |
847 | struct cmd_header hdr; | |
848 | __le16 action; | |
849 | __le16 offset; | |
850 | __le16 len; | |
851 | /* firmware says it returns a maximum of 20 bytes */ | |
852 | #define LBS_EEPROM_READ_LEN 20 | |
853 | u8 value[LBS_EEPROM_READ_LEN]; | |
ba2d3587 | 854 | } __packed; |
9e66e701 HS |
855 | |
856 | struct cmd_ds_802_11_tpc_cfg { | |
857 | struct cmd_header hdr; | |
858 | ||
859 | __le16 action; | |
860 | uint8_t enable; | |
861 | int8_t P0; | |
862 | int8_t P1; | |
863 | int8_t P2; | |
864 | uint8_t usesnr; | |
ba2d3587 | 865 | } __packed; |
9e66e701 HS |
866 | |
867 | ||
868 | struct cmd_ds_802_11_pa_cfg { | |
869 | struct cmd_header hdr; | |
870 | ||
871 | __le16 action; | |
872 | uint8_t enable; | |
873 | int8_t P0; | |
874 | int8_t P1; | |
875 | int8_t P2; | |
ba2d3587 | 876 | } __packed; |
9e66e701 HS |
877 | |
878 | ||
879 | struct cmd_ds_802_11_led_ctrl { | |
880 | __le16 action; | |
881 | __le16 numled; | |
882 | u8 data[256]; | |
ba2d3587 | 883 | } __packed; |
9e66e701 | 884 | |
db08006f | 885 | /* Automatic Frequency Control */ |
9e66e701 | 886 | struct cmd_ds_802_11_afc { |
db08006f DW |
887 | struct cmd_header hdr; |
888 | ||
9e66e701 HS |
889 | __le16 afc_auto; |
890 | union { | |
891 | struct { | |
892 | __le16 threshold; | |
893 | __le16 period; | |
894 | }; | |
895 | struct { | |
896 | __le16 timing_offset; /* signed */ | |
897 | __le16 carrier_offset; /* signed */ | |
898 | }; | |
899 | }; | |
ba2d3587 | 900 | } __packed; |
9e66e701 HS |
901 | |
902 | struct cmd_tx_rate_query { | |
903 | __le16 txrate; | |
ba2d3587 | 904 | } __packed; |
9e66e701 HS |
905 | |
906 | struct cmd_ds_get_tsf { | |
907 | __le64 tsfvalue; | |
ba2d3587 | 908 | } __packed; |
9e66e701 HS |
909 | |
910 | struct cmd_ds_bt_access { | |
911 | __le16 action; | |
912 | __le32 id; | |
913 | u8 addr1[ETH_ALEN]; | |
914 | u8 addr2[ETH_ALEN]; | |
ba2d3587 | 915 | } __packed; |
9e66e701 HS |
916 | |
917 | struct cmd_ds_fwt_access { | |
918 | __le16 action; | |
919 | __le32 id; | |
920 | u8 valid; | |
921 | u8 da[ETH_ALEN]; | |
922 | u8 dir; | |
923 | u8 ra[ETH_ALEN]; | |
924 | __le32 ssn; | |
925 | __le32 dsn; | |
926 | __le32 metric; | |
927 | u8 rate; | |
928 | u8 hopcount; | |
929 | u8 ttl; | |
930 | __le32 expiration; | |
931 | u8 sleepmode; | |
932 | __le32 snr; | |
933 | __le32 references; | |
934 | u8 prec[ETH_ALEN]; | |
ba2d3587 | 935 | } __packed; |
9e66e701 HS |
936 | |
937 | struct cmd_ds_mesh_config { | |
938 | struct cmd_header hdr; | |
939 | ||
940 | __le16 action; | |
941 | __le16 channel; | |
942 | __le16 type; | |
943 | __le16 length; | |
944 | u8 data[128]; /* last position reserved */ | |
ba2d3587 | 945 | } __packed; |
9e66e701 HS |
946 | |
947 | struct cmd_ds_mesh_access { | |
948 | struct cmd_header hdr; | |
949 | ||
950 | __le16 action; | |
951 | __le32 data[32]; /* last position reserved */ | |
ba2d3587 | 952 | } __packed; |
9e66e701 HS |
953 | |
954 | /* Number of stats counters returned by the firmware */ | |
955 | #define MESH_STATS_NUM 8 | |
956 | ||
957 | struct cmd_ds_command { | |
958 | /* command header */ | |
959 | __le16 command; | |
960 | __le16 size; | |
961 | __le16 seqnum; | |
962 | __le16 result; | |
963 | ||
964 | /* command Body */ | |
965 | union { | |
966 | struct cmd_ds_802_11_ps_mode psmode; | |
9e66e701 HS |
967 | struct cmd_ds_mac_reg_access macreg; |
968 | struct cmd_ds_bbp_reg_access bbpreg; | |
969 | struct cmd_ds_rf_reg_access rfreg; | |
970 | ||
9e66e701 HS |
971 | struct cmd_ds_802_11_led_ctrl ledgpio; |
972 | ||
973 | struct cmd_ds_bt_access bt; | |
974 | struct cmd_ds_fwt_access fwt; | |
9e66e701 HS |
975 | struct cmd_ds_802_11_beacon_control bcn_ctrl; |
976 | } params; | |
ba2d3587 | 977 | } __packed; |
10078321 | 978 | #endif |