diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wireless/wl12xx/wl1271_cmd.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_cmd.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.h | 151 |
1 files changed, 104 insertions, 47 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h index 951a8447a516..2dc06c73532b 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.h +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h | |||
@@ -29,27 +29,32 @@ | |||
29 | 29 | ||
30 | struct acx_header; | 30 | struct acx_header; |
31 | 31 | ||
32 | int wl1271_cmd_send(struct wl1271 *wl, u16 type, void *buf, size_t buf_len); | 32 | int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len, |
33 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval, | 33 | size_t res_len); |
34 | u16 beacon_interval, u8 wait); | 34 | int wl1271_cmd_general_parms(struct wl1271 *wl); |
35 | int wl1271_cmd_radio_parms(struct wl1271 *wl); | ||
36 | int wl1271_cmd_join(struct wl1271 *wl); | ||
35 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); | 37 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); |
36 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); | 38 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); |
37 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); | 39 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); |
38 | int wl1271_cmd_data_path(struct wl1271 *wl, u8 channel, bool enable); | 40 | int wl1271_cmd_data_path(struct wl1271 *wl, bool enable); |
39 | int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode); | 41 | int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send); |
40 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, | 42 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, |
41 | size_t len); | 43 | size_t len); |
42 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | 44 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, |
43 | u8 active_scan, u8 high_prio, u8 num_channels, | 45 | u8 active_scan, u8 high_prio, u8 band, |
44 | u8 probe_requests); | 46 | u8 probe_requests); |
45 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, | 47 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, |
46 | void *buf, size_t buf_len); | 48 | void *buf, size_t buf_len); |
47 | int wl1271_cmd_build_null_data(struct wl1271 *wl); | 49 | int wl1271_cmd_build_null_data(struct wl1271 *wl); |
48 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); | 50 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); |
49 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len); | 51 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, |
52 | u8 band); | ||
50 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); | 53 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); |
51 | int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 54 | int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
52 | u8 key_size, const u8 *key, const u8 *addr); | 55 | u8 key_size, const u8 *key, const u8 *addr, |
56 | u32 tx_seq_32, u16 tx_seq_16); | ||
57 | int wl1271_cmd_disconnect(struct wl1271 *wl); | ||
53 | 58 | ||
54 | enum wl1271_commands { | 59 | enum wl1271_commands { |
55 | CMD_INTERROGATE = 1, /*use this to read information elements*/ | 60 | CMD_INTERROGATE = 1, /*use this to read information elements*/ |
@@ -118,8 +123,8 @@ enum cmd_templ { | |||
118 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 | 123 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 |
119 | 124 | ||
120 | struct wl1271_cmd_header { | 125 | struct wl1271_cmd_header { |
121 | u16 id; | 126 | __le16 id; |
122 | u16 status; | 127 | __le16 status; |
123 | /* payload */ | 128 | /* payload */ |
124 | u8 data[0]; | 129 | u8 data[0]; |
125 | } __attribute__ ((packed)); | 130 | } __attribute__ ((packed)); |
@@ -172,17 +177,17 @@ struct cmd_read_write_memory { | |||
172 | struct wl1271_cmd_header header; | 177 | struct wl1271_cmd_header header; |
173 | 178 | ||
174 | /* The address of the memory to read from or write to.*/ | 179 | /* The address of the memory to read from or write to.*/ |
175 | u32 addr; | 180 | __le32 addr; |
176 | 181 | ||
177 | /* The amount of data in bytes to read from or write to the WiLink | 182 | /* The amount of data in bytes to read from or write to the WiLink |
178 | * device.*/ | 183 | * device.*/ |
179 | u32 size; | 184 | __le32 size; |
180 | 185 | ||
181 | /* The actual value read from or written to the Wilink. The source | 186 | /* 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 | 187 | of this field is the Host in WRITE command or the Wilink in READ |
183 | command. */ | 188 | command. */ |
184 | u8 value[MAX_READ_SIZE]; | 189 | u8 value[MAX_READ_SIZE]; |
185 | }; | 190 | } __attribute__ ((packed)); |
186 | 191 | ||
187 | #define CMDMBOX_HEADER_LEN 4 | 192 | #define CMDMBOX_HEADER_LEN 4 |
188 | #define CMDMBOX_INFO_ELEM_HEADER_LEN 4 | 193 | #define CMDMBOX_INFO_ELEM_HEADER_LEN 4 |
@@ -196,22 +201,23 @@ enum { | |||
196 | 201 | ||
197 | #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ | 202 | #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ |
198 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 | 203 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 |
204 | #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10 | ||
199 | 205 | ||
200 | struct wl1271_cmd_join { | 206 | struct wl1271_cmd_join { |
201 | struct wl1271_cmd_header header; | 207 | struct wl1271_cmd_header header; |
202 | 208 | ||
203 | u32 bssid_lsb; | 209 | __le32 bssid_lsb; |
204 | u16 bssid_msb; | 210 | __le16 bssid_msb; |
205 | u16 beacon_interval; /* in TBTTs */ | 211 | __le16 beacon_interval; /* in TBTTs */ |
206 | u32 rx_config_options; | 212 | __le32 rx_config_options; |
207 | u32 rx_filter_options; | 213 | __le32 rx_filter_options; |
208 | 214 | ||
209 | /* | 215 | /* |
210 | * The target uses this field to determine the rate at | 216 | * The target uses this field to determine the rate at |
211 | * which to transmit control frame responses (such as | 217 | * which to transmit control frame responses (such as |
212 | * ACK or CTS frames). | 218 | * ACK or CTS frames). |
213 | */ | 219 | */ |
214 | u32 basic_rate_set; | 220 | __le32 basic_rate_set; |
215 | u8 dtim_interval; | 221 | u8 dtim_interval; |
216 | /* | 222 | /* |
217 | * bits 0-2: This bitwise field specifies the type | 223 | * bits 0-2: This bitwise field specifies the type |
@@ -240,10 +246,10 @@ struct cmd_enabledisable_path { | |||
240 | struct wl1271_cmd_template_set { | 246 | struct wl1271_cmd_template_set { |
241 | struct wl1271_cmd_header header; | 247 | struct wl1271_cmd_header header; |
242 | 248 | ||
243 | u16 len; | 249 | __le16 len; |
244 | u8 template_type; | 250 | u8 template_type; |
245 | u8 index; /* relevant only for KLV_TEMPLATE type */ | 251 | u8 index; /* relevant only for KLV_TEMPLATE type */ |
246 | u32 enabled_rates; | 252 | __le32 enabled_rates; |
247 | u8 short_retry_limit; | 253 | u8 short_retry_limit; |
248 | u8 long_retry_limit; | 254 | u8 long_retry_limit; |
249 | u8 aflags; | 255 | u8 aflags; |
@@ -280,18 +286,13 @@ struct wl1271_cmd_ps_params { | |||
280 | * to power save mode. | 286 | * to power save mode. |
281 | */ | 287 | */ |
282 | u8 hang_over_period; | 288 | u8 hang_over_period; |
283 | u32 null_data_rate; | 289 | __le32 null_data_rate; |
284 | } __attribute__ ((packed)); | 290 | } __attribute__ ((packed)); |
285 | 291 | ||
286 | /* HW encryption keys */ | 292 | /* HW encryption keys */ |
287 | #define NUM_ACCESS_CATEGORIES_COPY 4 | 293 | #define NUM_ACCESS_CATEGORIES_COPY 4 |
288 | #define MAX_KEY_SIZE 32 | 294 | #define MAX_KEY_SIZE 32 |
289 | 295 | ||
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 | |||
295 | enum wl1271_cmd_key_action { | 296 | enum wl1271_cmd_key_action { |
296 | KEY_ADD_OR_REPLACE = 1, | 297 | KEY_ADD_OR_REPLACE = 1, |
297 | KEY_REMOVE = 2, | 298 | KEY_REMOVE = 2, |
@@ -316,9 +317,9 @@ struct wl1271_cmd_set_keys { | |||
316 | u8 addr[ETH_ALEN]; | 317 | u8 addr[ETH_ALEN]; |
317 | 318 | ||
318 | /* key_action_e */ | 319 | /* key_action_e */ |
319 | u16 key_action; | 320 | __le16 key_action; |
320 | 321 | ||
321 | u16 reserved_1; | 322 | __le16 reserved_1; |
322 | 323 | ||
323 | /* key size in bytes */ | 324 | /* key size in bytes */ |
324 | u8 key_size; | 325 | u8 key_size; |
@@ -334,8 +335,8 @@ struct wl1271_cmd_set_keys { | |||
334 | u8 id; | 335 | u8 id; |
335 | u8 reserved_2[6]; | 336 | u8 reserved_2[6]; |
336 | u8 key[MAX_KEY_SIZE]; | 337 | u8 key[MAX_KEY_SIZE]; |
337 | u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; | 338 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; |
338 | u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; | 339 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; |
339 | } __attribute__ ((packed)); | 340 | } __attribute__ ((packed)); |
340 | 341 | ||
341 | 342 | ||
@@ -347,19 +348,22 @@ struct wl1271_cmd_set_keys { | |||
347 | #define WL1271_SCAN_OPT_PRIORITY_HIGH 4 | 348 | #define WL1271_SCAN_OPT_PRIORITY_HIGH 4 |
348 | #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ | 349 | #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ |
349 | #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ | 350 | #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ |
351 | #define WL1271_SCAN_BAND_2_4_GHZ 0 | ||
352 | #define WL1271_SCAN_BAND_5_GHZ 1 | ||
353 | #define WL1271_SCAN_BAND_DUAL 2 | ||
350 | 354 | ||
351 | struct basic_scan_params { | 355 | struct basic_scan_params { |
352 | u32 rx_config_options; | 356 | __le32 rx_config_options; |
353 | u32 rx_filter_options; | 357 | __le32 rx_filter_options; |
354 | /* Scan option flags (WL1271_SCAN_OPT_*) */ | 358 | /* Scan option flags (WL1271_SCAN_OPT_*) */ |
355 | u16 scan_options; | 359 | __le16 scan_options; |
356 | /* Number of scan channels in the list (maximum 30) */ | 360 | /* Number of scan channels in the list (maximum 30) */ |
357 | u8 num_channels; | 361 | u8 num_channels; |
358 | /* This field indicates the number of probe requests to send | 362 | /* This field indicates the number of probe requests to send |
359 | per channel for an active scan */ | 363 | per channel for an active scan */ |
360 | u8 num_probe_requests; | 364 | u8 num_probe_requests; |
361 | /* Rate bit field for sending the probes */ | 365 | /* Rate bit field for sending the probes */ |
362 | u32 tx_rate; | 366 | __le32 tx_rate; |
363 | u8 tid_trigger; | 367 | u8 tid_trigger; |
364 | u8 ssid_len; | 368 | u8 ssid_len; |
365 | /* in order to align */ | 369 | /* in order to align */ |
@@ -374,10 +378,10 @@ struct basic_scan_params { | |||
374 | 378 | ||
375 | struct basic_scan_channel_params { | 379 | struct basic_scan_channel_params { |
376 | /* Duration in TU to wait for frames on a channel for active scan */ | 380 | /* Duration in TU to wait for frames on a channel for active scan */ |
377 | u32 min_duration; | 381 | __le32 min_duration; |
378 | u32 max_duration; | 382 | __le32 max_duration; |
379 | u32 bssid_lsb; | 383 | __le32 bssid_lsb; |
380 | u16 bssid_msb; | 384 | __le16 bssid_msb; |
381 | u8 early_termination; | 385 | u8 early_termination; |
382 | u8 tx_power_att; | 386 | u8 tx_power_att; |
383 | u8 channel; | 387 | u8 channel; |
@@ -397,13 +401,13 @@ struct wl1271_cmd_scan { | |||
397 | struct wl1271_cmd_trigger_scan_to { | 401 | struct wl1271_cmd_trigger_scan_to { |
398 | struct wl1271_cmd_header header; | 402 | struct wl1271_cmd_header header; |
399 | 403 | ||
400 | u32 timeout; | 404 | __le32 timeout; |
401 | }; | 405 | } __attribute__ ((packed)); |
402 | 406 | ||
403 | struct wl1271_cmd_test_header { | 407 | struct wl1271_cmd_test_header { |
404 | u8 id; | 408 | u8 id; |
405 | u8 padding[3]; | 409 | u8 padding[3]; |
406 | }; | 410 | } __attribute__ ((packed)); |
407 | 411 | ||
408 | enum wl1271_channel_tune_bands { | 412 | enum wl1271_channel_tune_bands { |
409 | WL1271_CHANNEL_TUNE_BAND_2_4, | 413 | WL1271_CHANNEL_TUNE_BAND_2_4, |
@@ -416,6 +420,33 @@ enum wl1271_channel_tune_bands { | |||
416 | #define TEST_CMD_P2G_CAL 0x02 | 420 | #define TEST_CMD_P2G_CAL 0x02 |
417 | #define TEST_CMD_CHANNEL_TUNE 0x0d | 421 | #define TEST_CMD_CHANNEL_TUNE 0x0d |
418 | #define TEST_CMD_UPDATE_PD_REFERENCE_POINT 0x1d | 422 | #define TEST_CMD_UPDATE_PD_REFERENCE_POINT 0x1d |
423 | #define TEST_CMD_INI_FILE_RADIO_PARAM 0x19 | ||
424 | #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E | ||
425 | |||
426 | struct wl1271_general_parms_cmd { | ||
427 | struct wl1271_cmd_header header; | ||
428 | |||
429 | struct wl1271_cmd_test_header test; | ||
430 | |||
431 | u8 params[WL1271_NVS_GENERAL_PARAMS_SIZE]; | ||
432 | s8 reserved[23]; | ||
433 | } __attribute__ ((packed)); | ||
434 | |||
435 | #define WL1271_STAT_RADIO_PARAMS_5_SIZE 29 | ||
436 | #define WL1271_DYN_RADIO_PARAMS_5_SIZE 104 | ||
437 | |||
438 | struct wl1271_radio_parms_cmd { | ||
439 | struct wl1271_cmd_header header; | ||
440 | |||
441 | struct wl1271_cmd_test_header test; | ||
442 | |||
443 | u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE]; | ||
444 | u8 stat_radio_params_5[WL1271_STAT_RADIO_PARAMS_5_SIZE]; | ||
445 | |||
446 | u8 dyn_radio_params[WL1271_NVS_DYN_RADIO_PARAMS_SIZE]; | ||
447 | u8 reserved; | ||
448 | u8 dyn_radio_params_5[WL1271_DYN_RADIO_PARAMS_5_SIZE]; | ||
449 | } __attribute__ ((packed)); | ||
419 | 450 | ||
420 | struct wl1271_cmd_cal_channel_tune { | 451 | struct wl1271_cmd_cal_channel_tune { |
421 | struct wl1271_cmd_header header; | 452 | struct wl1271_cmd_header header; |
@@ -425,7 +456,7 @@ struct wl1271_cmd_cal_channel_tune { | |||
425 | u8 band; | 456 | u8 band; |
426 | u8 channel; | 457 | u8 channel; |
427 | 458 | ||
428 | u16 radio_status; | 459 | __le16 radio_status; |
429 | } __attribute__ ((packed)); | 460 | } __attribute__ ((packed)); |
430 | 461 | ||
431 | struct wl1271_cmd_cal_update_ref_point { | 462 | struct wl1271_cmd_cal_update_ref_point { |
@@ -433,8 +464,8 @@ struct wl1271_cmd_cal_update_ref_point { | |||
433 | 464 | ||
434 | struct wl1271_cmd_test_header test; | 465 | struct wl1271_cmd_test_header test; |
435 | 466 | ||
436 | s32 ref_power; | 467 | __le32 ref_power; |
437 | s32 ref_detector; | 468 | __le32 ref_detector; |
438 | u8 sub_band; | 469 | u8 sub_band; |
439 | u8 padding[3]; | 470 | u8 padding[3]; |
440 | } __attribute__ ((packed)); | 471 | } __attribute__ ((packed)); |
@@ -449,16 +480,42 @@ struct wl1271_cmd_cal_p2g { | |||
449 | 480 | ||
450 | struct wl1271_cmd_test_header test; | 481 | struct wl1271_cmd_test_header test; |
451 | 482 | ||
452 | u16 len; | 483 | __le16 len; |
453 | u8 buf[MAX_TLV_LENGTH]; | 484 | u8 buf[MAX_TLV_LENGTH]; |
454 | u8 type; | 485 | u8 type; |
455 | u8 padding; | 486 | u8 padding; |
456 | 487 | ||
457 | s16 radio_status; | 488 | __le16 radio_status; |
458 | u8 nvs_version[MAX_NVS_VERSION_LENGTH]; | 489 | u8 nvs_version[MAX_NVS_VERSION_LENGTH]; |
459 | 490 | ||
460 | u8 sub_band_mask; | 491 | u8 sub_band_mask; |
461 | u8 padding2; | 492 | u8 padding2; |
462 | } __attribute__ ((packed)); | 493 | } __attribute__ ((packed)); |
463 | 494 | ||
495 | |||
496 | /* | ||
497 | * There are three types of disconnections: | ||
498 | * | ||
499 | * DISCONNECT_IMMEDIATE: the fw doesn't send any frames | ||
500 | * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason | ||
501 | * we have passed | ||
502 | * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason | ||
503 | * we have passed | ||
504 | */ | ||
505 | enum wl1271_disconnect_type { | ||
506 | DISCONNECT_IMMEDIATE, | ||
507 | DISCONNECT_DEAUTH, | ||
508 | DISCONNECT_DISASSOC | ||
509 | }; | ||
510 | |||
511 | struct wl1271_cmd_disconnect { | ||
512 | __le32 rx_config_options; | ||
513 | __le32 rx_filter_options; | ||
514 | |||
515 | __le16 reason; | ||
516 | u8 type; | ||
517 | |||
518 | u8 padding; | ||
519 | } __attribute__ ((packed)); | ||
520 | |||
464 | #endif /* __WL1271_CMD_H__ */ | 521 | #endif /* __WL1271_CMD_H__ */ |