aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_cmd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_cmd.h')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.h115
1 files changed, 71 insertions, 44 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index 951a8447a516..174b8209dbf3 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -30,8 +30,7 @@
30struct acx_header; 30struct acx_header;
31 31
32int wl1271_cmd_send(struct wl1271 *wl, u16 type, void *buf, size_t buf_len); 32int wl1271_cmd_send(struct wl1271 *wl, u16 type, void *buf, size_t buf_len);
33int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval, 33int wl1271_cmd_join(struct wl1271 *wl);
34 u16 beacon_interval, u8 wait);
35int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); 34int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
36int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); 35int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
37int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); 36int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
@@ -40,16 +39,19 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
40int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, 39int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
41 size_t len); 40 size_t len);
42int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, 41int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
43 u8 active_scan, u8 high_prio, u8 num_channels, 42 u8 active_scan, u8 high_prio, u8 band,
44 u8 probe_requests); 43 u8 probe_requests);
45int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 44int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
46 void *buf, size_t buf_len); 45 void *buf, size_t buf_len);
47int wl1271_cmd_build_null_data(struct wl1271 *wl); 46int wl1271_cmd_build_null_data(struct wl1271 *wl);
48int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); 47int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
49int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len); 48int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len,
49 u8 band);
50int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); 50int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id);
51int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, 51int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
52 u8 key_size, const u8 *key, const u8 *addr); 52 u8 key_size, const u8 *key, const u8 *addr,
53 u32 tx_seq_32, u16 tx_seq_16);
54int wl1271_cmd_disconnect(struct wl1271 *wl);
53 55
54enum wl1271_commands { 56enum wl1271_commands {
55 CMD_INTERROGATE = 1, /*use this to read information elements*/ 57 CMD_INTERROGATE = 1, /*use this to read information elements*/
@@ -118,8 +120,8 @@ enum cmd_templ {
118#define WL1271_CMD_TEMPL_MAX_SIZE 252 120#define WL1271_CMD_TEMPL_MAX_SIZE 252
119 121
120struct wl1271_cmd_header { 122struct wl1271_cmd_header {
121 u16 id; 123 __le16 id;
122 u16 status; 124 __le16 status;
123 /* payload */ 125 /* payload */
124 u8 data[0]; 126 u8 data[0];
125} __attribute__ ((packed)); 127} __attribute__ ((packed));
@@ -172,17 +174,17 @@ struct cmd_read_write_memory {
172 struct wl1271_cmd_header header; 174 struct wl1271_cmd_header header;
173 175
174 /* The address of the memory to read from or write to.*/ 176 /* The address of the memory to read from or write to.*/
175 u32 addr; 177 __le32 addr;
176 178
177 /* The amount of data in bytes to read from or write to the WiLink 179 /* The amount of data in bytes to read from or write to the WiLink
178 * device.*/ 180 * device.*/
179 u32 size; 181 __le32 size;
180 182
181 /* The actual value read from or written to the Wilink. The source 183 /* The actual value read from or written to the Wilink. The source
182 of this field is the Host in WRITE command or the Wilink in READ 184 of this field is the Host in WRITE command or the Wilink in READ
183 command. */ 185 command. */
184 u8 value[MAX_READ_SIZE]; 186 u8 value[MAX_READ_SIZE];
185}; 187} __attribute__ ((packed));
186 188
187#define CMDMBOX_HEADER_LEN 4 189#define CMDMBOX_HEADER_LEN 4
188#define CMDMBOX_INFO_ELEM_HEADER_LEN 4 190#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
@@ -196,22 +198,23 @@ enum {
196 198
197#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ 199#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
198#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 200#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
201#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
199 202
200struct wl1271_cmd_join { 203struct wl1271_cmd_join {
201 struct wl1271_cmd_header header; 204 struct wl1271_cmd_header header;
202 205
203 u32 bssid_lsb; 206 __le32 bssid_lsb;
204 u16 bssid_msb; 207 __le16 bssid_msb;
205 u16 beacon_interval; /* in TBTTs */ 208 __le16 beacon_interval; /* in TBTTs */
206 u32 rx_config_options; 209 __le32 rx_config_options;
207 u32 rx_filter_options; 210 __le32 rx_filter_options;
208 211
209 /* 212 /*
210 * The target uses this field to determine the rate at 213 * The target uses this field to determine the rate at
211 * which to transmit control frame responses (such as 214 * which to transmit control frame responses (such as
212 * ACK or CTS frames). 215 * ACK or CTS frames).
213 */ 216 */
214 u32 basic_rate_set; 217 __le32 basic_rate_set;
215 u8 dtim_interval; 218 u8 dtim_interval;
216 /* 219 /*
217 * bits 0-2: This bitwise field specifies the type 220 * bits 0-2: This bitwise field specifies the type
@@ -240,10 +243,10 @@ struct cmd_enabledisable_path {
240struct wl1271_cmd_template_set { 243struct wl1271_cmd_template_set {
241 struct wl1271_cmd_header header; 244 struct wl1271_cmd_header header;
242 245
243 u16 len; 246 __le16 len;
244 u8 template_type; 247 u8 template_type;
245 u8 index; /* relevant only for KLV_TEMPLATE type */ 248 u8 index; /* relevant only for KLV_TEMPLATE type */
246 u32 enabled_rates; 249 __le32 enabled_rates;
247 u8 short_retry_limit; 250 u8 short_retry_limit;
248 u8 long_retry_limit; 251 u8 long_retry_limit;
249 u8 aflags; 252 u8 aflags;
@@ -280,18 +283,13 @@ struct wl1271_cmd_ps_params {
280 * to power save mode. 283 * to power save mode.
281 */ 284 */
282 u8 hang_over_period; 285 u8 hang_over_period;
283 u32 null_data_rate; 286 __le32 null_data_rate;
284} __attribute__ ((packed)); 287} __attribute__ ((packed));
285 288
286/* HW encryption keys */ 289/* HW encryption keys */
287#define NUM_ACCESS_CATEGORIES_COPY 4 290#define NUM_ACCESS_CATEGORIES_COPY 4
288#define MAX_KEY_SIZE 32 291#define MAX_KEY_SIZE 32
289 292
290/* When set, disable HW encryption */
291#define DF_ENCRYPTION_DISABLE 0x01
292/* When set, disable HW decryption */
293#define DF_SNIFF_MODE_ENABLE 0x80
294
295enum wl1271_cmd_key_action { 293enum wl1271_cmd_key_action {
296 KEY_ADD_OR_REPLACE = 1, 294 KEY_ADD_OR_REPLACE = 1,
297 KEY_REMOVE = 2, 295 KEY_REMOVE = 2,
@@ -316,9 +314,9 @@ struct wl1271_cmd_set_keys {
316 u8 addr[ETH_ALEN]; 314 u8 addr[ETH_ALEN];
317 315
318 /* key_action_e */ 316 /* key_action_e */
319 u16 key_action; 317 __le16 key_action;
320 318
321 u16 reserved_1; 319 __le16 reserved_1;
322 320
323 /* key size in bytes */ 321 /* key size in bytes */
324 u8 key_size; 322 u8 key_size;
@@ -334,8 +332,8 @@ struct wl1271_cmd_set_keys {
334 u8 id; 332 u8 id;
335 u8 reserved_2[6]; 333 u8 reserved_2[6];
336 u8 key[MAX_KEY_SIZE]; 334 u8 key[MAX_KEY_SIZE];
337 u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; 335 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
338 u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; 336 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
339} __attribute__ ((packed)); 337} __attribute__ ((packed));
340 338
341 339
@@ -347,19 +345,22 @@ struct wl1271_cmd_set_keys {
347#define WL1271_SCAN_OPT_PRIORITY_HIGH 4 345#define WL1271_SCAN_OPT_PRIORITY_HIGH 4
348#define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ 346#define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */
349#define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ 347#define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */
348#define WL1271_SCAN_BAND_2_4_GHZ 0
349#define WL1271_SCAN_BAND_5_GHZ 1
350#define WL1271_SCAN_BAND_DUAL 2
350 351
351struct basic_scan_params { 352struct basic_scan_params {
352 u32 rx_config_options; 353 __le32 rx_config_options;
353 u32 rx_filter_options; 354 __le32 rx_filter_options;
354 /* Scan option flags (WL1271_SCAN_OPT_*) */ 355 /* Scan option flags (WL1271_SCAN_OPT_*) */
355 u16 scan_options; 356 __le16 scan_options;
356 /* Number of scan channels in the list (maximum 30) */ 357 /* Number of scan channels in the list (maximum 30) */
357 u8 num_channels; 358 u8 num_channels;
358 /* This field indicates the number of probe requests to send 359 /* This field indicates the number of probe requests to send
359 per channel for an active scan */ 360 per channel for an active scan */
360 u8 num_probe_requests; 361 u8 num_probe_requests;
361 /* Rate bit field for sending the probes */ 362 /* Rate bit field for sending the probes */
362 u32 tx_rate; 363 __le32 tx_rate;
363 u8 tid_trigger; 364 u8 tid_trigger;
364 u8 ssid_len; 365 u8 ssid_len;
365 /* in order to align */ 366 /* in order to align */
@@ -374,10 +375,10 @@ struct basic_scan_params {
374 375
375struct basic_scan_channel_params { 376struct basic_scan_channel_params {
376 /* Duration in TU to wait for frames on a channel for active scan */ 377 /* Duration in TU to wait for frames on a channel for active scan */
377 u32 min_duration; 378 __le32 min_duration;
378 u32 max_duration; 379 __le32 max_duration;
379 u32 bssid_lsb; 380 __le32 bssid_lsb;
380 u16 bssid_msb; 381 __le16 bssid_msb;
381 u8 early_termination; 382 u8 early_termination;
382 u8 tx_power_att; 383 u8 tx_power_att;
383 u8 channel; 384 u8 channel;
@@ -397,13 +398,13 @@ struct wl1271_cmd_scan {
397struct wl1271_cmd_trigger_scan_to { 398struct wl1271_cmd_trigger_scan_to {
398 struct wl1271_cmd_header header; 399 struct wl1271_cmd_header header;
399 400
400 u32 timeout; 401 __le32 timeout;
401}; 402} __attribute__ ((packed));
402 403
403struct wl1271_cmd_test_header { 404struct wl1271_cmd_test_header {
404 u8 id; 405 u8 id;
405 u8 padding[3]; 406 u8 padding[3];
406}; 407} __attribute__ ((packed));
407 408
408enum wl1271_channel_tune_bands { 409enum wl1271_channel_tune_bands {
409 WL1271_CHANNEL_TUNE_BAND_2_4, 410 WL1271_CHANNEL_TUNE_BAND_2_4,
@@ -425,7 +426,7 @@ struct wl1271_cmd_cal_channel_tune {
425 u8 band; 426 u8 band;
426 u8 channel; 427 u8 channel;
427 428
428 u16 radio_status; 429 __le16 radio_status;
429} __attribute__ ((packed)); 430} __attribute__ ((packed));
430 431
431struct wl1271_cmd_cal_update_ref_point { 432struct wl1271_cmd_cal_update_ref_point {
@@ -433,8 +434,8 @@ struct wl1271_cmd_cal_update_ref_point {
433 434
434 struct wl1271_cmd_test_header test; 435 struct wl1271_cmd_test_header test;
435 436
436 s32 ref_power; 437 __le32 ref_power;
437 s32 ref_detector; 438 __le32 ref_detector;
438 u8 sub_band; 439 u8 sub_band;
439 u8 padding[3]; 440 u8 padding[3];
440} __attribute__ ((packed)); 441} __attribute__ ((packed));
@@ -449,16 +450,42 @@ struct wl1271_cmd_cal_p2g {
449 450
450 struct wl1271_cmd_test_header test; 451 struct wl1271_cmd_test_header test;
451 452
452 u16 len; 453 __le16 len;
453 u8 buf[MAX_TLV_LENGTH]; 454 u8 buf[MAX_TLV_LENGTH];
454 u8 type; 455 u8 type;
455 u8 padding; 456 u8 padding;
456 457
457 s16 radio_status; 458 __le16 radio_status;
458 u8 nvs_version[MAX_NVS_VERSION_LENGTH]; 459 u8 nvs_version[MAX_NVS_VERSION_LENGTH];
459 460
460 u8 sub_band_mask; 461 u8 sub_band_mask;
461 u8 padding2; 462 u8 padding2;
462} __attribute__ ((packed)); 463} __attribute__ ((packed));
463 464
465
466/*
467 * There are three types of disconnections:
468 *
469 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
470 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
471 * we have passed
472 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
473 * we have passed
474 */
475enum wl1271_disconnect_type {
476 DISCONNECT_IMMEDIATE,
477 DISCONNECT_DEAUTH,
478 DISCONNECT_DISASSOC
479};
480
481struct wl1271_cmd_disconnect {
482 __le32 rx_config_options;
483 __le32 rx_filter_options;
484
485 __le16 reason;
486 u8 type;
487
488 u8 padding;
489} __attribute__ ((packed));
490
464#endif /* __WL1271_CMD_H__ */ 491#endif /* __WL1271_CMD_H__ */