diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r-- | drivers/net/wireless/wl12xx/boot.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 515 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.h | 314 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/event.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/event.h | 80 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/init.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 5 |
9 files changed, 527 insertions, 445 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c index 41791ffd26ea..cc70422c0575 100644 --- a/drivers/net/wireless/wl12xx/boot.c +++ b/drivers/net/wireless/wl12xx/boot.c | |||
@@ -494,21 +494,18 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) | |||
494 | wl->event_mask = BSS_LOSE_EVENT_ID | | 494 | wl->event_mask = BSS_LOSE_EVENT_ID | |
495 | SCAN_COMPLETE_EVENT_ID | | 495 | SCAN_COMPLETE_EVENT_ID | |
496 | PS_REPORT_EVENT_ID | | 496 | PS_REPORT_EVENT_ID | |
497 | JOIN_EVENT_COMPLETE_ID | | ||
498 | DISCONNECT_EVENT_COMPLETE_ID | | 497 | DISCONNECT_EVENT_COMPLETE_ID | |
499 | RSSI_SNR_TRIGGER_0_EVENT_ID | | 498 | RSSI_SNR_TRIGGER_0_EVENT_ID | |
500 | PSPOLL_DELIVERY_FAILURE_EVENT_ID | | 499 | PSPOLL_DELIVERY_FAILURE_EVENT_ID | |
501 | SOFT_GEMINI_SENSE_EVENT_ID | | 500 | SOFT_GEMINI_SENSE_EVENT_ID | |
502 | PERIODIC_SCAN_REPORT_EVENT_ID | | 501 | PERIODIC_SCAN_REPORT_EVENT_ID | |
503 | PERIODIC_SCAN_COMPLETE_EVENT_ID; | 502 | PERIODIC_SCAN_COMPLETE_EVENT_ID | |
504 | 503 | DUMMY_PACKET_EVENT_ID | | |
505 | if (wl->bss_type == BSS_TYPE_AP_BSS) | 504 | PEER_REMOVE_COMPLETE_EVENT_ID | |
506 | wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID | | 505 | BA_SESSION_RX_CONSTRAINT_EVENT_ID | |
507 | INACTIVE_STA_EVENT_ID | | 506 | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID | |
508 | MAX_TX_RETRY_EVENT_ID; | 507 | INACTIVE_STA_EVENT_ID | |
509 | else | 508 | MAX_TX_RETRY_EVENT_ID; |
510 | wl->event_mask |= DUMMY_PACKET_EVENT_ID | | ||
511 | BA_SESSION_RX_CONSTRAINT_EVENT_ID; | ||
512 | 509 | ||
513 | ret = wl1271_event_unmask(wl); | 510 | ret = wl1271_event_unmask(wl); |
514 | if (ret < 0) { | 511 | if (ret < 0) { |
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index b6ef65a57b71..b13eed129a92 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -363,61 +363,294 @@ static int wl1271_cmd_wait_for_event(struct wl1271 *wl, u32 mask) | |||
363 | return 0; | 363 | return 0; |
364 | } | 364 | } |
365 | 365 | ||
366 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type) | 366 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 role_type, u8 *role_id) |
367 | { | 367 | { |
368 | struct wl1271_cmd_join *join; | 368 | struct wl12xx_cmd_role_enable *cmd; |
369 | int ret, i; | 369 | int ret; |
370 | u8 *bssid; | 370 | |
371 | wl1271_debug(DEBUG_CMD, "cmd role enable"); | ||
372 | |||
373 | if (WARN_ON(*role_id != WL12XX_INVALID_ROLE_ID)) | ||
374 | return -EBUSY; | ||
375 | |||
376 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
377 | if (!cmd) { | ||
378 | ret = -ENOMEM; | ||
379 | goto out; | ||
380 | } | ||
381 | |||
382 | /* get role id */ | ||
383 | cmd->role_id = find_first_zero_bit(wl->roles_map, WL12XX_MAX_ROLES); | ||
384 | if (cmd->role_id >= WL12XX_MAX_ROLES) { | ||
385 | ret = -EBUSY; | ||
386 | goto out_free; | ||
387 | } | ||
388 | |||
389 | memcpy(cmd->mac_address, wl->mac_addr, ETH_ALEN); | ||
390 | cmd->role_type = role_type; | ||
391 | |||
392 | ret = wl1271_cmd_send(wl, CMD_ROLE_ENABLE, cmd, sizeof(*cmd), 0); | ||
393 | if (ret < 0) { | ||
394 | wl1271_error("failed to initiate cmd role enable"); | ||
395 | goto out_free; | ||
396 | } | ||
397 | |||
398 | __set_bit(cmd->role_id, wl->roles_map); | ||
399 | *role_id = cmd->role_id; | ||
371 | 400 | ||
372 | join = kzalloc(sizeof(*join), GFP_KERNEL); | 401 | out_free: |
373 | if (!join) { | 402 | kfree(cmd); |
403 | |||
404 | out: | ||
405 | return ret; | ||
406 | } | ||
407 | |||
408 | int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id) | ||
409 | { | ||
410 | struct wl12xx_cmd_role_disable *cmd; | ||
411 | int ret; | ||
412 | |||
413 | wl1271_debug(DEBUG_CMD, "cmd role disable"); | ||
414 | |||
415 | if (WARN_ON(*role_id == WL12XX_INVALID_ROLE_ID)) | ||
416 | return -ENOENT; | ||
417 | |||
418 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
419 | if (!cmd) { | ||
374 | ret = -ENOMEM; | 420 | ret = -ENOMEM; |
375 | goto out; | 421 | goto out; |
376 | } | 422 | } |
423 | cmd->role_id = *role_id; | ||
424 | |||
425 | ret = wl1271_cmd_send(wl, CMD_ROLE_DISABLE, cmd, sizeof(*cmd), 0); | ||
426 | if (ret < 0) { | ||
427 | wl1271_error("failed to initiate cmd role disable"); | ||
428 | goto out_free; | ||
429 | } | ||
377 | 430 | ||
378 | wl1271_debug(DEBUG_CMD, "cmd join"); | 431 | __clear_bit(*role_id, wl->roles_map); |
432 | *role_id = WL12XX_INVALID_ROLE_ID; | ||
379 | 433 | ||
380 | /* Reverse order BSSID */ | 434 | out_free: |
381 | bssid = (u8 *) &join->bssid_lsb; | 435 | kfree(cmd); |
382 | for (i = 0; i < ETH_ALEN; i++) | 436 | |
383 | bssid[i] = wl->bssid[ETH_ALEN - i - 1]; | 437 | out: |
438 | return ret; | ||
439 | } | ||
440 | |||
441 | static int wl12xx_allocate_link(struct wl1271 *wl, u8 *hlid) | ||
442 | { | ||
443 | u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS); | ||
444 | if (link >= WL12XX_MAX_LINKS) | ||
445 | return -EBUSY; | ||
446 | |||
447 | __set_bit(link, wl->links_map); | ||
448 | *hlid = link; | ||
449 | return 0; | ||
450 | } | ||
451 | |||
452 | static void wl12xx_free_link(struct wl1271 *wl, u8 *hlid) | ||
453 | { | ||
454 | if (*hlid == WL12XX_INVALID_LINK_ID) | ||
455 | return; | ||
456 | |||
457 | __clear_bit(*hlid, wl->links_map); | ||
458 | *hlid = WL12XX_INVALID_LINK_ID; | ||
459 | } | ||
460 | |||
461 | int wl12xx_cmd_role_start_sta(struct wl1271 *wl) | ||
462 | { | ||
463 | struct wl12xx_cmd_role_start *cmd; | ||
464 | int ret; | ||
384 | 465 | ||
385 | join->bss_type = bss_type; | 466 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
386 | join->basic_rate_set = cpu_to_le32(wl->basic_rate_set); | 467 | if (!cmd) { |
387 | join->supported_rate_set = cpu_to_le32(wl->rate_set); | 468 | ret = -ENOMEM; |
469 | goto out; | ||
470 | } | ||
388 | 471 | ||
472 | wl1271_debug(DEBUG_CMD, "cmd role start sta %d", wl->role_id); | ||
473 | |||
474 | cmd->role_id = wl->role_id; | ||
389 | if (wl->band == IEEE80211_BAND_5GHZ) | 475 | if (wl->band == IEEE80211_BAND_5GHZ) |
390 | join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ; | 476 | cmd->band = WL12XX_BAND_5GHZ; |
477 | cmd->channel = wl->channel; | ||
478 | cmd->sta.basic_rate_set = cpu_to_le32(wl->basic_rate_set); | ||
479 | cmd->sta.beacon_interval = cpu_to_le16(wl->beacon_int); | ||
480 | cmd->sta.ssid_type = WL12XX_SSID_TYPE_ANY; | ||
481 | cmd->sta.ssid_len = wl->ssid_len; | ||
482 | memcpy(cmd->sta.ssid, wl->ssid, wl->ssid_len); | ||
483 | memcpy(cmd->sta.bssid, wl->bssid, ETH_ALEN); | ||
484 | cmd->sta.local_rates = cpu_to_le32(wl->rate_set); | ||
485 | |||
486 | if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) { | ||
487 | ret = wl12xx_allocate_link(wl, &wl->sta_hlid); | ||
488 | if (ret) | ||
489 | goto out_free; | ||
490 | } | ||
491 | cmd->sta.hlid = wl->sta_hlid; | ||
492 | cmd->sta.session = wl->session_counter; | ||
493 | cmd->sta.remote_rates = cpu_to_le32(wl->rate_set); | ||
494 | |||
495 | wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " | ||
496 | "basic_rate_set: 0x%x, remote_rates: 0x%x", | ||
497 | wl->role_id, cmd->sta.hlid, cmd->sta.session, | ||
498 | wl->basic_rate_set, wl->rate_set); | ||
499 | |||
500 | ret = wl1271_cmd_send(wl, CMD_ROLE_START, cmd, sizeof(*cmd), 0); | ||
501 | if (ret < 0) { | ||
502 | wl1271_error("failed to initiate cmd role start sta"); | ||
503 | goto err_hlid; | ||
504 | } | ||
505 | |||
506 | goto out_free; | ||
507 | |||
508 | err_hlid: | ||
509 | /* clear links on error. */ | ||
510 | wl12xx_free_link(wl, &wl->sta_hlid); | ||
511 | |||
512 | out_free: | ||
513 | kfree(cmd); | ||
514 | |||
515 | out: | ||
516 | return ret; | ||
517 | } | ||
391 | 518 | ||
392 | join->beacon_interval = cpu_to_le16(wl->beacon_int); | 519 | int wl12xx_cmd_role_stop_sta(struct wl1271 *wl) |
393 | join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD; | 520 | { |
521 | struct wl12xx_cmd_role_stop *cmd; | ||
522 | int ret; | ||
523 | |||
524 | if (WARN_ON(wl->sta_hlid == WL12XX_INVALID_LINK_ID)) | ||
525 | return -EINVAL; | ||
526 | |||
527 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
528 | if (!cmd) { | ||
529 | ret = -ENOMEM; | ||
530 | goto out; | ||
531 | } | ||
394 | 532 | ||
395 | join->channel = wl->channel; | 533 | wl1271_debug(DEBUG_CMD, "cmd role stop sta %d", wl->role_id); |
396 | join->ssid_len = wl->ssid_len; | ||
397 | memcpy(join->ssid, wl->ssid, wl->ssid_len); | ||
398 | 534 | ||
399 | join->ctrl |= wl->session_counter << WL1271_JOIN_CMD_TX_SESSION_OFFSET; | 535 | cmd->role_id = wl->role_id; |
536 | cmd->disc_type = DISCONNECT_IMMEDIATE; | ||
537 | cmd->reason = cpu_to_le16(WLAN_REASON_UNSPECIFIED); | ||
400 | 538 | ||
401 | wl1271_debug(DEBUG_CMD, "cmd join: basic_rate_set=0x%x, rate_set=0x%x", | 539 | ret = wl1271_cmd_send(wl, CMD_ROLE_STOP, cmd, sizeof(*cmd), 0); |
402 | join->basic_rate_set, join->supported_rate_set); | 540 | if (ret < 0) { |
541 | wl1271_error("failed to initiate cmd role stop sta"); | ||
542 | goto out_free; | ||
543 | } | ||
403 | 544 | ||
404 | ret = wl1271_cmd_send(wl, CMD_START_JOIN, join, sizeof(*join), 0); | 545 | ret = wl1271_cmd_wait_for_event(wl, DISCONNECT_EVENT_COMPLETE_ID); |
405 | if (ret < 0) { | 546 | if (ret < 0) { |
406 | wl1271_error("failed to initiate cmd join"); | 547 | wl1271_error("cmd role stop sta event completion error"); |
407 | goto out_free; | 548 | goto out_free; |
408 | } | 549 | } |
409 | 550 | ||
410 | ret = wl1271_cmd_wait_for_event(wl, JOIN_EVENT_COMPLETE_ID); | 551 | wl12xx_free_link(wl, &wl->sta_hlid); |
411 | if (ret < 0) | 552 | |
412 | wl1271_error("cmd join event completion error"); | 553 | out_free: |
554 | kfree(cmd); | ||
555 | |||
556 | out: | ||
557 | return ret; | ||
558 | } | ||
559 | |||
560 | int wl12xx_cmd_role_start_ap(struct wl1271 *wl) | ||
561 | { | ||
562 | struct wl12xx_cmd_role_start *cmd; | ||
563 | struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; | ||
564 | int ret; | ||
565 | |||
566 | wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id); | ||
567 | |||
568 | /* | ||
569 | * We currently do not support hidden SSID. The real SSID | ||
570 | * should be fetched from mac80211 first. | ||
571 | */ | ||
572 | if (wl->ssid_len == 0) { | ||
573 | wl1271_warning("Hidden SSID currently not supported for AP"); | ||
574 | ret = -EINVAL; | ||
575 | goto out; | ||
576 | } | ||
577 | |||
578 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
579 | if (!cmd) { | ||
580 | ret = -ENOMEM; | ||
581 | goto out; | ||
582 | } | ||
583 | |||
584 | cmd->role_id = wl->role_id; | ||
585 | cmd->ap.aging_period = cpu_to_le16(wl->conf.tx.ap_aging_period); | ||
586 | cmd->ap.bss_index = WL1271_AP_BSS_INDEX; | ||
587 | cmd->ap.global_hlid = WL1271_AP_GLOBAL_HLID; | ||
588 | cmd->ap.broadcast_hlid = WL1271_AP_BROADCAST_HLID; | ||
589 | cmd->ap.basic_rate_set = cpu_to_le32(wl->basic_rate_set); | ||
590 | cmd->ap.beacon_interval = cpu_to_le16(wl->beacon_int); | ||
591 | cmd->ap.dtim_interval = bss_conf->dtim_period; | ||
592 | cmd->ap.beacon_expiry = WL1271_AP_DEF_BEACON_EXP; | ||
593 | cmd->channel = wl->channel; | ||
594 | cmd->ap.ssid_len = wl->ssid_len; | ||
595 | cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC; | ||
596 | memcpy(cmd->ap.ssid, wl->ssid, wl->ssid_len); | ||
597 | cmd->ap.local_rates = cpu_to_le32(0xffffffff); | ||
598 | |||
599 | switch (wl->band) { | ||
600 | case IEEE80211_BAND_2GHZ: | ||
601 | cmd->band = RADIO_BAND_2_4GHZ; | ||
602 | break; | ||
603 | case IEEE80211_BAND_5GHZ: | ||
604 | cmd->band = RADIO_BAND_5GHZ; | ||
605 | break; | ||
606 | default: | ||
607 | wl1271_warning("ap start - unknown band: %d", (int)wl->band); | ||
608 | cmd->band = RADIO_BAND_2_4GHZ; | ||
609 | break; | ||
610 | } | ||
611 | |||
612 | ret = wl1271_cmd_send(wl, CMD_ROLE_START, cmd, sizeof(*cmd), 0); | ||
613 | if (ret < 0) { | ||
614 | wl1271_error("failed to initiate cmd role start ap"); | ||
615 | goto out_free; | ||
616 | } | ||
413 | 617 | ||
414 | out_free: | 618 | out_free: |
415 | kfree(join); | 619 | kfree(cmd); |
416 | 620 | ||
417 | out: | 621 | out: |
418 | return ret; | 622 | return ret; |
419 | } | 623 | } |
420 | 624 | ||
625 | int wl12xx_cmd_role_stop_ap(struct wl1271 *wl) | ||
626 | { | ||
627 | struct wl12xx_cmd_role_stop *cmd; | ||
628 | int ret; | ||
629 | |||
630 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
631 | if (!cmd) { | ||
632 | ret = -ENOMEM; | ||
633 | goto out; | ||
634 | } | ||
635 | |||
636 | wl1271_debug(DEBUG_CMD, "cmd role stop ap %d", wl->role_id); | ||
637 | |||
638 | cmd->role_id = wl->role_id; | ||
639 | |||
640 | ret = wl1271_cmd_send(wl, CMD_ROLE_STOP, cmd, sizeof(*cmd), 0); | ||
641 | if (ret < 0) { | ||
642 | wl1271_error("failed to initiate cmd role stop ap"); | ||
643 | goto out_free; | ||
644 | } | ||
645 | |||
646 | out_free: | ||
647 | kfree(cmd); | ||
648 | |||
649 | out: | ||
650 | return ret; | ||
651 | } | ||
652 | |||
653 | |||
421 | /** | 654 | /** |
422 | * send test command to firmware | 655 | * send test command to firmware |
423 | * | 656 | * |
@@ -565,6 +798,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode) | |||
565 | goto out; | 798 | goto out; |
566 | } | 799 | } |
567 | 800 | ||
801 | ps_params->role_id = wl->role_id; | ||
568 | ps_params->ps_mode = ps_mode; | 802 | ps_params->ps_mode = ps_mode; |
569 | 803 | ||
570 | ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, | 804 | ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, |
@@ -811,9 +1045,9 @@ int wl1271_build_qos_null_data(struct wl1271 *wl) | |||
811 | wl->basic_rate); | 1045 | wl->basic_rate); |
812 | } | 1046 | } |
813 | 1047 | ||
814 | int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id) | 1048 | int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid) |
815 | { | 1049 | { |
816 | struct wl1271_cmd_set_sta_keys *cmd; | 1050 | struct wl1271_cmd_set_keys *cmd; |
817 | int ret = 0; | 1051 | int ret = 0; |
818 | 1052 | ||
819 | wl1271_debug(DEBUG_CMD, "cmd set_default_wep_key %d", id); | 1053 | wl1271_debug(DEBUG_CMD, "cmd set_default_wep_key %d", id); |
@@ -824,36 +1058,7 @@ int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id) | |||
824 | goto out; | 1058 | goto out; |
825 | } | 1059 | } |
826 | 1060 | ||
827 | cmd->id = id; | 1061 | cmd->hlid = hlid; |
828 | cmd->key_action = cpu_to_le16(KEY_SET_ID); | ||
829 | cmd->key_type = KEY_WEP; | ||
830 | |||
831 | ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd), 0); | ||
832 | if (ret < 0) { | ||
833 | wl1271_warning("cmd set_default_wep_key failed: %d", ret); | ||
834 | goto out; | ||
835 | } | ||
836 | |||
837 | out: | ||
838 | kfree(cmd); | ||
839 | |||
840 | return ret; | ||
841 | } | ||
842 | |||
843 | int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id) | ||
844 | { | ||
845 | struct wl1271_cmd_set_ap_keys *cmd; | ||
846 | int ret = 0; | ||
847 | |||
848 | wl1271_debug(DEBUG_CMD, "cmd set_ap_default_wep_key %d", id); | ||
849 | |||
850 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
851 | if (!cmd) { | ||
852 | ret = -ENOMEM; | ||
853 | goto out; | ||
854 | } | ||
855 | |||
856 | cmd->hlid = WL1271_AP_BROADCAST_HLID; | ||
857 | cmd->key_id = id; | 1062 | cmd->key_id = id; |
858 | cmd->lid_key_type = WEP_DEFAULT_LID_TYPE; | 1063 | cmd->lid_key_type = WEP_DEFAULT_LID_TYPE; |
859 | cmd->key_action = cpu_to_le16(KEY_SET_ID); | 1064 | cmd->key_action = cpu_to_le16(KEY_SET_ID); |
@@ -861,7 +1066,7 @@ int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id) | |||
861 | 1066 | ||
862 | ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd), 0); | 1067 | ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd), 0); |
863 | if (ret < 0) { | 1068 | if (ret < 0) { |
864 | wl1271_warning("cmd set_ap_default_wep_key failed: %d", ret); | 1069 | wl1271_warning("cmd set_default_wep_key failed: %d", ret); |
865 | goto out; | 1070 | goto out; |
866 | } | 1071 | } |
867 | 1072 | ||
@@ -875,7 +1080,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | |||
875 | u8 key_size, const u8 *key, const u8 *addr, | 1080 | u8 key_size, const u8 *key, const u8 *addr, |
876 | u32 tx_seq_32, u16 tx_seq_16) | 1081 | u32 tx_seq_32, u16 tx_seq_16) |
877 | { | 1082 | { |
878 | struct wl1271_cmd_set_sta_keys *cmd; | 1083 | struct wl1271_cmd_set_keys *cmd; |
879 | int ret = 0; | 1084 | int ret = 0; |
880 | 1085 | ||
881 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | 1086 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
@@ -884,8 +1089,14 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | |||
884 | goto out; | 1089 | goto out; |
885 | } | 1090 | } |
886 | 1091 | ||
887 | if (key_type != KEY_WEP) | 1092 | cmd->hlid = wl->sta_hlid; |
888 | memcpy(cmd->addr, addr, ETH_ALEN); | 1093 | |
1094 | if (key_type == KEY_WEP) | ||
1095 | cmd->lid_key_type = WEP_DEFAULT_LID_TYPE; | ||
1096 | else if (is_broadcast_ether_addr(addr)) | ||
1097 | cmd->lid_key_type = BROADCAST_LID_TYPE; | ||
1098 | else | ||
1099 | cmd->lid_key_type = UNICAST_LID_TYPE; | ||
889 | 1100 | ||
890 | cmd->key_action = cpu_to_le16(action); | 1101 | cmd->key_action = cpu_to_le16(action); |
891 | cmd->key_size = key_size; | 1102 | cmd->key_size = key_size; |
@@ -894,10 +1105,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | |||
894 | cmd->ac_seq_num16[0] = cpu_to_le16(tx_seq_16); | 1105 | cmd->ac_seq_num16[0] = cpu_to_le16(tx_seq_16); |
895 | cmd->ac_seq_num32[0] = cpu_to_le32(tx_seq_32); | 1106 | cmd->ac_seq_num32[0] = cpu_to_le32(tx_seq_32); |
896 | 1107 | ||
897 | /* we have only one SSID profile */ | 1108 | cmd->key_id = id; |
898 | cmd->ssid_profile = 0; | ||
899 | |||
900 | cmd->id = id; | ||
901 | 1109 | ||
902 | if (key_type == KEY_TKIP) { | 1110 | if (key_type == KEY_TKIP) { |
903 | /* | 1111 | /* |
@@ -928,11 +1136,15 @@ out: | |||
928 | return ret; | 1136 | return ret; |
929 | } | 1137 | } |
930 | 1138 | ||
1139 | /* | ||
1140 | * TODO: merge with sta/ibss into 1 set_key function. | ||
1141 | * note there are slight diffs | ||
1142 | */ | ||
931 | int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 1143 | int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
932 | u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, | 1144 | u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, |
933 | u16 tx_seq_16) | 1145 | u16 tx_seq_16) |
934 | { | 1146 | { |
935 | struct wl1271_cmd_set_ap_keys *cmd; | 1147 | struct wl1271_cmd_set_keys *cmd; |
936 | int ret = 0; | 1148 | int ret = 0; |
937 | u8 lid_type; | 1149 | u8 lid_type; |
938 | 1150 | ||
@@ -989,45 +1201,12 @@ out: | |||
989 | return ret; | 1201 | return ret; |
990 | } | 1202 | } |
991 | 1203 | ||
992 | int wl1271_cmd_disconnect(struct wl1271 *wl) | 1204 | int wl12xx_cmd_set_peer_state(struct wl1271 *wl) |
993 | { | ||
994 | struct wl1271_cmd_disconnect *cmd; | ||
995 | int ret = 0; | ||
996 | |||
997 | wl1271_debug(DEBUG_CMD, "cmd disconnect"); | ||
998 | |||
999 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
1000 | if (!cmd) { | ||
1001 | ret = -ENOMEM; | ||
1002 | goto out; | ||
1003 | } | ||
1004 | |||
1005 | /* disconnect reason is not used in immediate disconnections */ | ||
1006 | cmd->type = DISCONNECT_IMMEDIATE; | ||
1007 | |||
1008 | ret = wl1271_cmd_send(wl, CMD_DISCONNECT, cmd, sizeof(*cmd), 0); | ||
1009 | if (ret < 0) { | ||
1010 | wl1271_error("failed to send disconnect command"); | ||
1011 | goto out_free; | ||
1012 | } | ||
1013 | |||
1014 | ret = wl1271_cmd_wait_for_event(wl, DISCONNECT_EVENT_COMPLETE_ID); | ||
1015 | if (ret < 0) | ||
1016 | wl1271_error("cmd disconnect event completion error"); | ||
1017 | |||
1018 | out_free: | ||
1019 | kfree(cmd); | ||
1020 | |||
1021 | out: | ||
1022 | return ret; | ||
1023 | } | ||
1024 | |||
1025 | int wl1271_cmd_set_sta_state(struct wl1271 *wl) | ||
1026 | { | 1205 | { |
1027 | struct wl1271_cmd_set_sta_state *cmd; | 1206 | struct wl12xx_cmd_set_peer_state *cmd; |
1028 | int ret = 0; | 1207 | int ret = 0; |
1029 | 1208 | ||
1030 | wl1271_debug(DEBUG_CMD, "cmd set sta state"); | 1209 | wl1271_debug(DEBUG_CMD, "cmd set peer state (hlid=%d)", wl->sta_hlid); |
1031 | 1210 | ||
1032 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | 1211 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
1033 | if (!cmd) { | 1212 | if (!cmd) { |
@@ -1035,11 +1214,12 @@ int wl1271_cmd_set_sta_state(struct wl1271 *wl) | |||
1035 | goto out; | 1214 | goto out; |
1036 | } | 1215 | } |
1037 | 1216 | ||
1217 | cmd->hlid = wl->sta_hlid; | ||
1038 | cmd->state = WL1271_CMD_STA_STATE_CONNECTED; | 1218 | cmd->state = WL1271_CMD_STA_STATE_CONNECTED; |
1039 | 1219 | ||
1040 | ret = wl1271_cmd_send(wl, CMD_SET_STA_STATE, cmd, sizeof(*cmd), 0); | 1220 | ret = wl1271_cmd_send(wl, CMD_SET_PEER_STATE, cmd, sizeof(*cmd), 0); |
1041 | if (ret < 0) { | 1221 | if (ret < 0) { |
1042 | wl1271_error("failed to send set STA state command"); | 1222 | wl1271_error("failed to send set peer state command"); |
1043 | goto out_free; | 1223 | goto out_free; |
1044 | } | 1224 | } |
1045 | 1225 | ||
@@ -1049,106 +1229,12 @@ out_free: | |||
1049 | out: | 1229 | out: |
1050 | return ret; | 1230 | return ret; |
1051 | } | 1231 | } |
1052 | 1232 | int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) | |
1053 | int wl1271_cmd_start_bss(struct wl1271 *wl) | ||
1054 | { | ||
1055 | struct wl1271_cmd_bss_start *cmd; | ||
1056 | struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; | ||
1057 | int ret; | ||
1058 | |||
1059 | wl1271_debug(DEBUG_CMD, "cmd start bss"); | ||
1060 | |||
1061 | /* | ||
1062 | * FIXME: We currently do not support hidden SSID. The real SSID | ||
1063 | * should be fetched from mac80211 first. | ||
1064 | */ | ||
1065 | if (wl->ssid_len == 0) { | ||
1066 | wl1271_warning("Hidden SSID currently not supported for AP"); | ||
1067 | ret = -EINVAL; | ||
1068 | goto out; | ||
1069 | } | ||
1070 | |||
1071 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
1072 | if (!cmd) { | ||
1073 | ret = -ENOMEM; | ||
1074 | goto out; | ||
1075 | } | ||
1076 | |||
1077 | memcpy(cmd->bssid, bss_conf->bssid, ETH_ALEN); | ||
1078 | |||
1079 | cmd->aging_period = cpu_to_le16(wl->conf.tx.ap_aging_period); | ||
1080 | cmd->bss_index = WL1271_AP_BSS_INDEX; | ||
1081 | cmd->global_hlid = WL1271_AP_GLOBAL_HLID; | ||
1082 | cmd->broadcast_hlid = WL1271_AP_BROADCAST_HLID; | ||
1083 | cmd->basic_rate_set = cpu_to_le32(wl->basic_rate_set); | ||
1084 | cmd->beacon_interval = cpu_to_le16(wl->beacon_int); | ||
1085 | cmd->dtim_interval = bss_conf->dtim_period; | ||
1086 | cmd->beacon_expiry = WL1271_AP_DEF_BEACON_EXP; | ||
1087 | cmd->channel = wl->channel; | ||
1088 | cmd->ssid_len = wl->ssid_len; | ||
1089 | cmd->ssid_type = SSID_TYPE_PUBLIC; | ||
1090 | memcpy(cmd->ssid, wl->ssid, wl->ssid_len); | ||
1091 | |||
1092 | switch (wl->band) { | ||
1093 | case IEEE80211_BAND_2GHZ: | ||
1094 | cmd->band = RADIO_BAND_2_4GHZ; | ||
1095 | break; | ||
1096 | case IEEE80211_BAND_5GHZ: | ||
1097 | cmd->band = RADIO_BAND_5GHZ; | ||
1098 | break; | ||
1099 | default: | ||
1100 | wl1271_warning("bss start - unknown band: %d", (int)wl->band); | ||
1101 | cmd->band = RADIO_BAND_2_4GHZ; | ||
1102 | break; | ||
1103 | } | ||
1104 | |||
1105 | ret = wl1271_cmd_send(wl, CMD_BSS_START, cmd, sizeof(*cmd), 0); | ||
1106 | if (ret < 0) { | ||
1107 | wl1271_error("failed to initiate cmd start bss"); | ||
1108 | goto out_free; | ||
1109 | } | ||
1110 | |||
1111 | out_free: | ||
1112 | kfree(cmd); | ||
1113 | |||
1114 | out: | ||
1115 | return ret; | ||
1116 | } | ||
1117 | |||
1118 | int wl1271_cmd_stop_bss(struct wl1271 *wl) | ||
1119 | { | ||
1120 | struct wl1271_cmd_bss_start *cmd; | ||
1121 | int ret; | ||
1122 | |||
1123 | wl1271_debug(DEBUG_CMD, "cmd stop bss"); | ||
1124 | |||
1125 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | ||
1126 | if (!cmd) { | ||
1127 | ret = -ENOMEM; | ||
1128 | goto out; | ||
1129 | } | ||
1130 | |||
1131 | cmd->bss_index = WL1271_AP_BSS_INDEX; | ||
1132 | |||
1133 | ret = wl1271_cmd_send(wl, CMD_BSS_STOP, cmd, sizeof(*cmd), 0); | ||
1134 | if (ret < 0) { | ||
1135 | wl1271_error("failed to initiate cmd stop bss"); | ||
1136 | goto out_free; | ||
1137 | } | ||
1138 | |||
1139 | out_free: | ||
1140 | kfree(cmd); | ||
1141 | |||
1142 | out: | ||
1143 | return ret; | ||
1144 | } | ||
1145 | |||
1146 | int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) | ||
1147 | { | 1233 | { |
1148 | struct wl1271_cmd_add_sta *cmd; | 1234 | struct wl12xx_cmd_add_peer *cmd; |
1149 | int ret; | 1235 | int ret; |
1150 | 1236 | ||
1151 | wl1271_debug(DEBUG_CMD, "cmd add sta %d", (int)hlid); | 1237 | wl1271_debug(DEBUG_CMD, "cmd add peer %d", (int)hlid); |
1152 | 1238 | ||
1153 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | 1239 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
1154 | if (!cmd) { | 1240 | if (!cmd) { |
@@ -1168,11 +1254,11 @@ int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) | |||
1168 | cmd->supported_rates = cpu_to_le32(wl1271_tx_enabled_rates_get(wl, | 1254 | cmd->supported_rates = cpu_to_le32(wl1271_tx_enabled_rates_get(wl, |
1169 | sta->supp_rates[wl->band])); | 1255 | sta->supp_rates[wl->band])); |
1170 | 1256 | ||
1171 | wl1271_debug(DEBUG_CMD, "new sta rates: 0x%x", cmd->supported_rates); | 1257 | wl1271_debug(DEBUG_CMD, "new peer rates: 0x%x", cmd->supported_rates); |
1172 | 1258 | ||
1173 | ret = wl1271_cmd_send(wl, CMD_ADD_STA, cmd, sizeof(*cmd), 0); | 1259 | ret = wl1271_cmd_send(wl, CMD_ADD_PEER, cmd, sizeof(*cmd), 0); |
1174 | if (ret < 0) { | 1260 | if (ret < 0) { |
1175 | wl1271_error("failed to initiate cmd add sta"); | 1261 | wl1271_error("failed to initiate cmd add peer"); |
1176 | goto out_free; | 1262 | goto out_free; |
1177 | } | 1263 | } |
1178 | 1264 | ||
@@ -1183,12 +1269,12 @@ out: | |||
1183 | return ret; | 1269 | return ret; |
1184 | } | 1270 | } |
1185 | 1271 | ||
1186 | int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid) | 1272 | int wl12xx_cmd_remove_peer(struct wl1271 *wl, u8 hlid) |
1187 | { | 1273 | { |
1188 | struct wl1271_cmd_remove_sta *cmd; | 1274 | struct wl12xx_cmd_remove_peer *cmd; |
1189 | int ret; | 1275 | int ret; |
1190 | 1276 | ||
1191 | wl1271_debug(DEBUG_CMD, "cmd remove sta %d", (int)hlid); | 1277 | wl1271_debug(DEBUG_CMD, "cmd remove peer %d", (int)hlid); |
1192 | 1278 | ||
1193 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); | 1279 | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); |
1194 | if (!cmd) { | 1280 | if (!cmd) { |
@@ -1201,9 +1287,9 @@ int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid) | |||
1201 | cmd->reason_opcode = 0; | 1287 | cmd->reason_opcode = 0; |
1202 | cmd->send_deauth_flag = 0; | 1288 | cmd->send_deauth_flag = 0; |
1203 | 1289 | ||
1204 | ret = wl1271_cmd_send(wl, CMD_REMOVE_STA, cmd, sizeof(*cmd), 0); | 1290 | ret = wl1271_cmd_send(wl, CMD_REMOVE_PEER, cmd, sizeof(*cmd), 0); |
1205 | if (ret < 0) { | 1291 | if (ret < 0) { |
1206 | wl1271_error("failed to initiate cmd remove sta"); | 1292 | wl1271_error("failed to initiate cmd remove peer"); |
1207 | goto out_free; | 1293 | goto out_free; |
1208 | } | 1294 | } |
1209 | 1295 | ||
@@ -1211,7 +1297,8 @@ int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid) | |||
1211 | * We are ok with a timeout here. The event is sometimes not sent | 1297 | * We are ok with a timeout here. The event is sometimes not sent |
1212 | * due to a firmware bug. | 1298 | * due to a firmware bug. |
1213 | */ | 1299 | */ |
1214 | wl1271_cmd_wait_for_event_or_timeout(wl, STA_REMOVE_COMPLETE_EVENT_ID); | 1300 | wl1271_cmd_wait_for_event_or_timeout(wl, |
1301 | PEER_REMOVE_COMPLETE_EVENT_ID); | ||
1215 | 1302 | ||
1216 | out_free: | 1303 | out_free: |
1217 | kfree(cmd); | 1304 | kfree(cmd); |
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h index bba077ecd945..16e0a877bf57 100644 --- a/drivers/net/wireless/wl12xx/cmd.h +++ b/drivers/net/wireless/wl12xx/cmd.h | |||
@@ -36,7 +36,14 @@ int wl128x_cmd_general_parms(struct wl1271 *wl); | |||
36 | int wl1271_cmd_radio_parms(struct wl1271 *wl); | 36 | int wl1271_cmd_radio_parms(struct wl1271 *wl); |
37 | int wl128x_cmd_radio_parms(struct wl1271 *wl); | 37 | int wl128x_cmd_radio_parms(struct wl1271 *wl); |
38 | int wl1271_cmd_ext_radio_parms(struct wl1271 *wl); | 38 | int wl1271_cmd_ext_radio_parms(struct wl1271 *wl); |
39 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type); | 39 | int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 role_type, u8 *role_id); |
40 | int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id); | ||
41 | int wl12xx_cmd_role_start_dev(struct wl1271 *wl); | ||
42 | int wl12xx_cmd_role_stop_dev(struct wl1271 *wl); | ||
43 | int wl12xx_cmd_role_start_sta(struct wl1271 *wl); | ||
44 | int wl12xx_cmd_role_stop_sta(struct wl1271 *wl); | ||
45 | int wl12xx_cmd_role_start_ap(struct wl1271 *wl); | ||
46 | int wl12xx_cmd_role_stop_ap(struct wl1271 *wl); | ||
40 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); | 47 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); |
41 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); | 48 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); |
42 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); | 49 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); |
@@ -56,20 +63,16 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, | |||
56 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr); | 63 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr); |
57 | int wl1271_build_qos_null_data(struct wl1271 *wl); | 64 | int wl1271_build_qos_null_data(struct wl1271 *wl); |
58 | int wl1271_cmd_build_klv_null_data(struct wl1271 *wl); | 65 | int wl1271_cmd_build_klv_null_data(struct wl1271 *wl); |
59 | int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id); | 66 | int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid); |
60 | int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id); | ||
61 | int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 67 | int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
62 | u8 key_size, const u8 *key, const u8 *addr, | 68 | u8 key_size, const u8 *key, const u8 *addr, |
63 | u32 tx_seq_32, u16 tx_seq_16); | 69 | u32 tx_seq_32, u16 tx_seq_16); |
64 | int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 70 | int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
65 | u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, | 71 | u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, |
66 | u16 tx_seq_16); | 72 | u16 tx_seq_16); |
67 | int wl1271_cmd_disconnect(struct wl1271 *wl); | 73 | int wl12xx_cmd_set_peer_state(struct wl1271 *wl); |
68 | int wl1271_cmd_set_sta_state(struct wl1271 *wl); | 74 | int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid); |
69 | int wl1271_cmd_start_bss(struct wl1271 *wl); | 75 | int wl12xx_cmd_remove_peer(struct wl1271 *wl, u8 hlid); |
70 | int wl1271_cmd_stop_bss(struct wl1271 *wl); | ||
71 | int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid); | ||
72 | int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid); | ||
73 | int wl12xx_cmd_config_fwlog(struct wl1271 *wl); | 76 | int wl12xx_cmd_config_fwlog(struct wl1271 *wl); |
74 | int wl12xx_cmd_start_fwlog(struct wl1271 *wl); | 77 | int wl12xx_cmd_start_fwlog(struct wl1271 *wl); |
75 | int wl12xx_cmd_stop_fwlog(struct wl1271 *wl); | 78 | int wl12xx_cmd_stop_fwlog(struct wl1271 *wl); |
@@ -83,25 +86,21 @@ enum wl1271_commands { | |||
83 | CMD_DISABLE_TX = 6, | 86 | CMD_DISABLE_TX = 6, |
84 | CMD_SCAN = 8, | 87 | CMD_SCAN = 8, |
85 | CMD_STOP_SCAN = 9, | 88 | CMD_STOP_SCAN = 9, |
86 | CMD_START_JOIN = 11, | ||
87 | CMD_SET_KEYS = 12, | 89 | CMD_SET_KEYS = 12, |
88 | CMD_READ_MEMORY = 13, | 90 | CMD_READ_MEMORY = 13, |
89 | CMD_WRITE_MEMORY = 14, | 91 | CMD_WRITE_MEMORY = 14, |
90 | CMD_SET_TEMPLATE = 19, | 92 | CMD_SET_TEMPLATE = 19, |
91 | CMD_TEST = 23, | 93 | CMD_TEST = 23, |
92 | CMD_NOISE_HIST = 28, | 94 | CMD_NOISE_HIST = 28, |
93 | CMD_LNA_CONTROL = 32, | 95 | CMD_QUIET_ELEMENT_SET_STATE = 29, |
94 | CMD_SET_BCN_MODE = 33, | 96 | CMD_SET_BCN_MODE = 33, |
95 | CMD_MEASUREMENT = 34, | 97 | CMD_MEASUREMENT = 34, |
96 | CMD_STOP_MEASUREMENT = 35, | 98 | CMD_STOP_MEASUREMENT = 35, |
97 | CMD_DISCONNECT = 36, | ||
98 | CMD_SET_PS_MODE = 37, | 99 | CMD_SET_PS_MODE = 37, |
99 | CMD_CHANNEL_SWITCH = 38, | 100 | CMD_CHANNEL_SWITCH = 38, |
100 | CMD_STOP_CHANNEL_SWICTH = 39, | 101 | CMD_STOP_CHANNEL_SWICTH = 39, |
101 | CMD_AP_DISCOVERY = 40, | 102 | CMD_AP_DISCOVERY = 40, |
102 | CMD_STOP_AP_DISCOVERY = 41, | 103 | CMD_STOP_AP_DISCOVERY = 41, |
103 | CMD_SPS_SCAN = 42, | ||
104 | CMD_STOP_SPS_SCAN = 43, | ||
105 | CMD_HEALTH_CHECK = 45, | 104 | CMD_HEALTH_CHECK = 45, |
106 | CMD_DEBUG = 46, | 105 | CMD_DEBUG = 46, |
107 | CMD_TRIGGER_SCAN_TO = 47, | 106 | CMD_TRIGGER_SCAN_TO = 47, |
@@ -109,16 +108,30 @@ enum wl1271_commands { | |||
109 | CMD_CONNECTION_SCAN_SSID_CFG = 49, | 108 | CMD_CONNECTION_SCAN_SSID_CFG = 49, |
110 | CMD_START_PERIODIC_SCAN = 50, | 109 | CMD_START_PERIODIC_SCAN = 50, |
111 | CMD_STOP_PERIODIC_SCAN = 51, | 110 | CMD_STOP_PERIODIC_SCAN = 51, |
112 | CMD_SET_STA_STATE = 52, | 111 | CMD_SET_PEER_STATE = 52, |
113 | CMD_CONFIG_FWLOGGER = 53, | 112 | CMD_REMAIN_ON_CHANNEL = 53, |
114 | CMD_START_FWLOGGER = 54, | 113 | CMD_CANCEL_REMAIN_ON_CHANNEL = 54, |
115 | CMD_STOP_FWLOGGER = 55, | ||
116 | 114 | ||
117 | /* AP mode commands */ | 115 | CMD_CONFIG_FWLOGGER = 55, |
118 | CMD_BSS_START = 60, | 116 | CMD_START_FWLOGGER = 56, |
119 | CMD_BSS_STOP = 61, | 117 | CMD_STOP_FWLOGGER = 57, |
120 | CMD_ADD_STA = 62, | 118 | |
121 | CMD_REMOVE_STA = 63, | 119 | /* AP commands */ |
120 | CMD_ADD_PEER = 62, | ||
121 | CMD_REMOVE_PEER = 63, | ||
122 | |||
123 | /* Role API */ | ||
124 | CMD_ROLE_ENABLE = 70, | ||
125 | CMD_ROLE_DISABLE = 71, | ||
126 | CMD_ROLE_START = 72, | ||
127 | CMD_ROLE_STOP = 73, | ||
128 | |||
129 | /* WIFI Direct */ | ||
130 | CMD_WFD_START_DISCOVERY = 80, | ||
131 | CMD_WFD_STOP_DISCOVERY = 81, | ||
132 | CMD_WFD_ATTRIBUTE_CONFIG = 82, | ||
133 | |||
134 | CMD_NOP = 100, | ||
122 | 135 | ||
123 | NUM_COMMANDS, | 136 | NUM_COMMANDS, |
124 | MAX_COMMAND_ID = 0xFFFF, | 137 | MAX_COMMAND_ID = 0xFFFF, |
@@ -147,14 +160,12 @@ enum cmd_templ { | |||
147 | CMD_TEMPL_CTS, /* | 160 | CMD_TEMPL_CTS, /* |
148 | * For CTS-to-self (FastCTS) mechanism | 161 | * For CTS-to-self (FastCTS) mechanism |
149 | * for BT/WLAN coexistence (SoftGemini). */ | 162 | * for BT/WLAN coexistence (SoftGemini). */ |
150 | CMD_TEMPL_ARP_RSP, | 163 | CMD_TEMPL_AP_BEACON, |
151 | CMD_TEMPL_LINK_MEASUREMENT_REPORT, | ||
152 | |||
153 | /* AP-mode specific */ | ||
154 | CMD_TEMPL_AP_BEACON = 13, | ||
155 | CMD_TEMPL_AP_PROBE_RESPONSE, | 164 | CMD_TEMPL_AP_PROBE_RESPONSE, |
156 | CMD_TEMPL_AP_ARP_RSP, | 165 | CMD_TEMPL_ARP_RSP, |
157 | CMD_TEMPL_DEAUTH_AP, | 166 | CMD_TEMPL_DEAUTH_AP, |
167 | CMD_TEMPL_TEMPORARY, | ||
168 | CMD_TEMPL_LINK_MEASUREMENT_REPORT, | ||
158 | 169 | ||
159 | CMD_TEMPL_MAX = 0xff | 170 | CMD_TEMPL_MAX = 0xff |
160 | }; | 171 | }; |
@@ -193,6 +204,7 @@ enum { | |||
193 | CMD_STATUS_WRONG_NESTING = 19, | 204 | CMD_STATUS_WRONG_NESTING = 19, |
194 | CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/ | 205 | CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/ |
195 | CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/ | 206 | CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/ |
207 | CMD_STATUS_TEMPLATE_OOM = 23, | ||
196 | MAX_COMMAND_STATUS = 0xff | 208 | MAX_COMMAND_STATUS = 0xff |
197 | }; | 209 | }; |
198 | 210 | ||
@@ -210,38 +222,114 @@ enum { | |||
210 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 | 222 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 |
211 | #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10 | 223 | #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10 |
212 | 224 | ||
213 | struct wl1271_cmd_join { | 225 | struct wl12xx_cmd_role_enable { |
214 | struct wl1271_cmd_header header; | 226 | struct wl1271_cmd_header header; |
215 | 227 | ||
216 | __le32 bssid_lsb; | 228 | u8 role_id; |
217 | __le16 bssid_msb; | 229 | u8 role_type; |
218 | __le16 beacon_interval; /* in TBTTs */ | 230 | u8 mac_address[ETH_ALEN]; |
219 | __le32 rx_config_options; | 231 | } __packed; |
220 | __le32 rx_filter_options; | ||
221 | 232 | ||
222 | /* | 233 | struct wl12xx_cmd_role_disable { |
223 | * The target uses this field to determine the rate at | 234 | struct wl1271_cmd_header header; |
224 | * which to transmit control frame responses (such as | 235 | |
225 | * ACK or CTS frames). | 236 | u8 role_id; |
226 | */ | 237 | u8 padding[3]; |
227 | __le32 basic_rate_set; | 238 | } __packed; |
228 | __le32 supported_rate_set; | 239 | |
229 | u8 dtim_interval; | 240 | enum wl12xx_band { |
230 | /* | 241 | WL12XX_BAND_2_4GHZ = 0, |
231 | * bits 0-2: This bitwise field specifies the type | 242 | WL12XX_BAND_5GHZ = 1, |
232 | * of BSS to start or join (BSS_TYPE_*). | 243 | WL12XX_BAND_JAPAN_4_9_GHZ = 2, |
233 | * bit 4: Band - The radio band in which to join | 244 | WL12XX_BAND_DEFAULT = WL12XX_BAND_2_4GHZ, |
234 | * or start. | 245 | WL12XX_BAND_INVALID = 0x7E, |
235 | * 0 - 2.4GHz band | 246 | WL12XX_BAND_MAX_RADIO = 0x7F, |
236 | * 1 - 5GHz band | 247 | }; |
237 | * bits 3, 5-7: Reserved | 248 | |
238 | */ | 249 | struct wl12xx_cmd_role_start { |
239 | u8 bss_type; | 250 | struct wl1271_cmd_header header; |
251 | |||
252 | u8 role_id; | ||
253 | u8 band; | ||
240 | u8 channel; | 254 | u8 channel; |
241 | u8 ssid_len; | 255 | u8 padding; |
242 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 256 | |
243 | u8 ctrl; /* JOIN_CMD_CTRL_* */ | 257 | union { |
244 | u8 reserved[3]; | 258 | struct { |
259 | u8 hlid; | ||
260 | u8 session; | ||
261 | u8 padding_1[54]; | ||
262 | } __packed device; | ||
263 | /* sta & p2p_cli use the same struct */ | ||
264 | struct { | ||
265 | u8 bssid[ETH_ALEN]; | ||
266 | u8 hlid; /* data hlid */ | ||
267 | u8 session; | ||
268 | __le32 remote_rates; /* remote supported rates */ | ||
269 | |||
270 | /* | ||
271 | * The target uses this field to determine the rate at | ||
272 | * which to transmit control frame responses (such as | ||
273 | * ACK or CTS frames). | ||
274 | */ | ||
275 | __le32 basic_rate_set; | ||
276 | __le32 local_rates; /* local supported rates */ | ||
277 | |||
278 | u8 ssid_type; | ||
279 | u8 ssid_len; | ||
280 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
281 | |||
282 | __le16 beacon_interval; /* in TBTTs */ | ||
283 | } __packed sta; | ||
284 | struct { | ||
285 | u8 bssid[ETH_ALEN]; | ||
286 | u8 hlid; /* data hlid */ | ||
287 | u8 dtim_interval; | ||
288 | __le32 remote_rates; /* remote supported rates */ | ||
289 | |||
290 | __le32 basic_rate_set; | ||
291 | __le32 local_rates; /* local supported rates */ | ||
292 | |||
293 | u8 ssid_type; | ||
294 | u8 ssid_len; | ||
295 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
296 | |||
297 | __le16 beacon_interval; /* in TBTTs */ | ||
298 | |||
299 | u8 padding_1[4]; | ||
300 | } __packed ibss; | ||
301 | /* ap & p2p_go use the same struct */ | ||
302 | struct { | ||
303 | __le16 aging_period; /* in secs */ | ||
304 | u8 beacon_expiry; /* in ms */ | ||
305 | u8 bss_index; | ||
306 | /* The host link id for the AP's global queue */ | ||
307 | u8 global_hlid; | ||
308 | /* The host link id for the AP's broadcast queue */ | ||
309 | u8 broadcast_hlid; | ||
310 | |||
311 | __le16 beacon_interval; /* in TBTTs */ | ||
312 | |||
313 | __le32 basic_rate_set; | ||
314 | __le32 local_rates; /* local supported rates */ | ||
315 | |||
316 | u8 dtim_interval; | ||
317 | |||
318 | u8 ssid_type; | ||
319 | u8 ssid_len; | ||
320 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
321 | |||
322 | u8 padding_1[5]; | ||
323 | } __packed ap; | ||
324 | }; | ||
325 | } __packed; | ||
326 | |||
327 | struct wl12xx_cmd_role_stop { | ||
328 | struct wl1271_cmd_header header; | ||
329 | |||
330 | u8 role_id; | ||
331 | u8 disc_type; /* only STA and P2P_CLI */ | ||
332 | __le16 reason; /* only STA and P2P_CLI */ | ||
245 | } __packed; | 333 | } __packed; |
246 | 334 | ||
247 | struct cmd_enabledisable_path { | 335 | struct cmd_enabledisable_path { |
@@ -287,8 +375,9 @@ enum wl1271_cmd_ps_mode { | |||
287 | struct wl1271_cmd_ps_params { | 375 | struct wl1271_cmd_ps_params { |
288 | struct wl1271_cmd_header header; | 376 | struct wl1271_cmd_header header; |
289 | 377 | ||
378 | u8 role_id; | ||
290 | u8 ps_mode; /* STATION_* */ | 379 | u8 ps_mode; /* STATION_* */ |
291 | u8 padding[3]; | 380 | u8 padding[2]; |
292 | } __packed; | 381 | } __packed; |
293 | 382 | ||
294 | /* HW encryption keys */ | 383 | /* HW encryption keys */ |
@@ -301,6 +390,12 @@ enum wl1271_cmd_key_action { | |||
301 | MAX_KEY_ACTION = 0xffff, | 390 | MAX_KEY_ACTION = 0xffff, |
302 | }; | 391 | }; |
303 | 392 | ||
393 | enum wl1271_cmd_lid_key_type { | ||
394 | UNICAST_LID_TYPE = 0, | ||
395 | BROADCAST_LID_TYPE = 1, | ||
396 | WEP_DEFAULT_LID_TYPE = 2 | ||
397 | }; | ||
398 | |||
304 | enum wl1271_cmd_key_type { | 399 | enum wl1271_cmd_key_type { |
305 | KEY_NONE = 0, | 400 | KEY_NONE = 0, |
306 | KEY_WEP = 1, | 401 | KEY_WEP = 1, |
@@ -309,44 +404,7 @@ enum wl1271_cmd_key_type { | |||
309 | KEY_GEM = 4, | 404 | KEY_GEM = 4, |
310 | }; | 405 | }; |
311 | 406 | ||
312 | /* FIXME: Add description for key-types */ | 407 | struct wl1271_cmd_set_keys { |
313 | |||
314 | struct wl1271_cmd_set_sta_keys { | ||
315 | struct wl1271_cmd_header header; | ||
316 | |||
317 | /* Ignored for default WEP key */ | ||
318 | u8 addr[ETH_ALEN]; | ||
319 | |||
320 | /* key_action_e */ | ||
321 | __le16 key_action; | ||
322 | |||
323 | __le16 reserved_1; | ||
324 | |||
325 | /* key size in bytes */ | ||
326 | u8 key_size; | ||
327 | |||
328 | /* key_type_e */ | ||
329 | u8 key_type; | ||
330 | u8 ssid_profile; | ||
331 | |||
332 | /* | ||
333 | * TKIP, AES: frame's key id field. | ||
334 | * For WEP default key: key id; | ||
335 | */ | ||
336 | u8 id; | ||
337 | u8 reserved_2[6]; | ||
338 | u8 key[MAX_KEY_SIZE]; | ||
339 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; | ||
340 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; | ||
341 | } __packed; | ||
342 | |||
343 | enum wl1271_cmd_lid_key_type { | ||
344 | UNICAST_LID_TYPE = 0, | ||
345 | BROADCAST_LID_TYPE = 1, | ||
346 | WEP_DEFAULT_LID_TYPE = 2 | ||
347 | }; | ||
348 | |||
349 | struct wl1271_cmd_set_ap_keys { | ||
350 | struct wl1271_cmd_header header; | 408 | struct wl1271_cmd_header header; |
351 | 409 | ||
352 | /* | 410 | /* |
@@ -496,69 +554,23 @@ enum wl1271_disconnect_type { | |||
496 | DISCONNECT_DISASSOC | 554 | DISCONNECT_DISASSOC |
497 | }; | 555 | }; |
498 | 556 | ||
499 | struct wl1271_cmd_disconnect { | ||
500 | struct wl1271_cmd_header header; | ||
501 | |||
502 | __le32 rx_config_options; | ||
503 | __le32 rx_filter_options; | ||
504 | |||
505 | __le16 reason; | ||
506 | u8 type; | ||
507 | |||
508 | u8 padding; | ||
509 | } __packed; | ||
510 | |||
511 | #define WL1271_CMD_STA_STATE_CONNECTED 1 | 557 | #define WL1271_CMD_STA_STATE_CONNECTED 1 |
512 | 558 | ||
513 | struct wl1271_cmd_set_sta_state { | 559 | struct wl12xx_cmd_set_peer_state { |
514 | struct wl1271_cmd_header header; | 560 | struct wl1271_cmd_header header; |
515 | 561 | ||
562 | u8 hlid; | ||
516 | u8 state; | 563 | u8 state; |
517 | u8 padding[3]; | 564 | u8 padding[2]; |
518 | } __packed; | 565 | } __packed; |
519 | 566 | ||
520 | enum wl1271_ssid_type { | 567 | enum wl12xx_ssid_type { |
521 | SSID_TYPE_PUBLIC = 0, | 568 | WL12XX_SSID_TYPE_PUBLIC = 0, |
522 | SSID_TYPE_HIDDEN = 1 | 569 | WL12XX_SSID_TYPE_HIDDEN = 1, |
570 | WL12XX_SSID_TYPE_ANY = 2, | ||
523 | }; | 571 | }; |
524 | 572 | ||
525 | struct wl1271_cmd_bss_start { | 573 | struct wl12xx_cmd_add_peer { |
526 | struct wl1271_cmd_header header; | ||
527 | |||
528 | /* wl1271_ssid_type */ | ||
529 | u8 ssid_type; | ||
530 | u8 ssid_len; | ||
531 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
532 | u8 padding_1[2]; | ||
533 | |||
534 | /* Basic rate set */ | ||
535 | __le32 basic_rate_set; | ||
536 | /* Aging period in seconds*/ | ||
537 | __le16 aging_period; | ||
538 | |||
539 | /* | ||
540 | * This field specifies the time between target beacon | ||
541 | * transmission times (TBTTs), in time units (TUs). | ||
542 | * Valid values are 1 to 1024. | ||
543 | */ | ||
544 | __le16 beacon_interval; | ||
545 | u8 bssid[ETH_ALEN]; | ||
546 | u8 bss_index; | ||
547 | /* Radio band */ | ||
548 | u8 band; | ||
549 | u8 channel; | ||
550 | /* The host link id for the AP's global queue */ | ||
551 | u8 global_hlid; | ||
552 | /* The host link id for the AP's broadcast queue */ | ||
553 | u8 broadcast_hlid; | ||
554 | /* DTIM count */ | ||
555 | u8 dtim_interval; | ||
556 | /* Beacon expiry time in ms */ | ||
557 | u8 beacon_expiry; | ||
558 | u8 padding_2[3]; | ||
559 | } __packed; | ||
560 | |||
561 | struct wl1271_cmd_add_sta { | ||
562 | struct wl1271_cmd_header header; | 574 | struct wl1271_cmd_header header; |
563 | 575 | ||
564 | u8 addr[ETH_ALEN]; | 576 | u8 addr[ETH_ALEN]; |
@@ -572,7 +584,7 @@ struct wl1271_cmd_add_sta { | |||
572 | u8 padding1; | 584 | u8 padding1; |
573 | } __packed; | 585 | } __packed; |
574 | 586 | ||
575 | struct wl1271_cmd_remove_sta { | 587 | struct wl12xx_cmd_remove_peer { |
576 | struct wl1271_cmd_header header; | 588 | struct wl1271_cmd_header header; |
577 | 589 | ||
578 | u8 hlid; | 590 | u8 hlid; |
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c index 304aaa2ee011..431ceae6c1c8 100644 --- a/drivers/net/wireless/wl12xx/event.c +++ b/drivers/net/wireless/wl12xx/event.c | |||
@@ -285,10 +285,10 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) | |||
285 | 285 | ||
286 | if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) && !is_ap) { | 286 | if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) && !is_ap) { |
287 | wl1271_debug(DEBUG_EVENT, "BA_SESSION_RX_CONSTRAINT_EVENT_ID. " | 287 | wl1271_debug(DEBUG_EVENT, "BA_SESSION_RX_CONSTRAINT_EVENT_ID. " |
288 | "ba_allowed = 0x%x", mbox->ba_allowed); | 288 | "ba_allowed = 0x%x", mbox->rx_ba_allowed); |
289 | 289 | ||
290 | if (wl->vif) | 290 | if (wl->vif) |
291 | wl1271_stop_ba_event(wl, mbox->ba_allowed); | 291 | wl1271_stop_ba_event(wl, mbox->rx_ba_allowed); |
292 | } | 292 | } |
293 | 293 | ||
294 | if ((vector & DUMMY_PACKET_EVENT_ID) && !is_ap) { | 294 | if ((vector & DUMMY_PACKET_EVENT_ID) && !is_ap) { |
diff --git a/drivers/net/wireless/wl12xx/event.h b/drivers/net/wireless/wl12xx/event.h index e524ad6fe4e3..49c1a0ede5b1 100644 --- a/drivers/net/wireless/wl12xx/event.h +++ b/drivers/net/wireless/wl12xx/event.h | |||
@@ -49,32 +49,27 @@ enum { | |||
49 | MEASUREMENT_START_EVENT_ID = BIT(8), | 49 | MEASUREMENT_START_EVENT_ID = BIT(8), |
50 | MEASUREMENT_COMPLETE_EVENT_ID = BIT(9), | 50 | MEASUREMENT_COMPLETE_EVENT_ID = BIT(9), |
51 | SCAN_COMPLETE_EVENT_ID = BIT(10), | 51 | SCAN_COMPLETE_EVENT_ID = BIT(10), |
52 | SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT(11), | 52 | WFD_DISCOVERY_COMPLETE_EVENT_ID = BIT(11), |
53 | AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12), | 53 | AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12), |
54 | PS_REPORT_EVENT_ID = BIT(13), | 54 | PS_REPORT_EVENT_ID = BIT(13), |
55 | PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14), | 55 | PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14), |
56 | DISCONNECT_EVENT_COMPLETE_ID = BIT(15), | 56 | DISCONNECT_EVENT_COMPLETE_ID = BIT(15), |
57 | JOIN_EVENT_COMPLETE_ID = BIT(16), | 57 | /* BIT(16) is reserved */ |
58 | CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17), | 58 | CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17), |
59 | BSS_LOSE_EVENT_ID = BIT(18), | 59 | BSS_LOSE_EVENT_ID = BIT(18), |
60 | REGAINED_BSS_EVENT_ID = BIT(19), | 60 | REGAINED_BSS_EVENT_ID = BIT(19), |
61 | MAX_TX_RETRY_EVENT_ID = BIT(20), | 61 | MAX_TX_RETRY_EVENT_ID = BIT(20), |
62 | /* STA: dummy paket for dynamic mem blocks */ | 62 | DUMMY_PACKET_EVENT_ID = BIT(21), |
63 | DUMMY_PACKET_EVENT_ID = BIT(21), | ||
64 | /* AP: STA remove complete */ | ||
65 | STA_REMOVE_COMPLETE_EVENT_ID = BIT(21), | ||
66 | SOFT_GEMINI_SENSE_EVENT_ID = BIT(22), | 63 | SOFT_GEMINI_SENSE_EVENT_ID = BIT(22), |
67 | /* STA: SG prediction */ | 64 | CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID = BIT(23), |
68 | SOFT_GEMINI_PREDICTION_EVENT_ID = BIT(23), | ||
69 | /* AP: Inactive STA */ | ||
70 | INACTIVE_STA_EVENT_ID = BIT(23), | ||
71 | SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24), | 65 | SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24), |
72 | PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25), | 66 | PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25), |
73 | DBG_EVENT_ID = BIT(26), | 67 | INACTIVE_STA_EVENT_ID = BIT(26), |
74 | HEALTH_CHECK_REPLY_EVENT_ID = BIT(27), | 68 | PEER_REMOVE_COMPLETE_EVENT_ID = BIT(27), |
75 | PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28), | 69 | PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28), |
76 | PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29), | 70 | PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29), |
77 | BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30), | 71 | BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30), |
72 | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(31), | ||
78 | EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff, | 73 | EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff, |
79 | }; | 74 | }; |
80 | 75 | ||
@@ -83,15 +78,6 @@ enum { | |||
83 | EVENT_ENTER_POWER_SAVE_SUCCESS, | 78 | EVENT_ENTER_POWER_SAVE_SUCCESS, |
84 | }; | 79 | }; |
85 | 80 | ||
86 | struct event_debug_report { | ||
87 | u8 debug_event_id; | ||
88 | u8 num_params; | ||
89 | __le16 pad; | ||
90 | __le32 report_1; | ||
91 | __le32 report_2; | ||
92 | __le32 report_3; | ||
93 | } __packed; | ||
94 | |||
95 | #define NUM_OF_RSSI_SNR_TRIGGERS 8 | 81 | #define NUM_OF_RSSI_SNR_TRIGGERS 8 |
96 | 82 | ||
97 | struct event_mailbox { | 83 | struct event_mailbox { |
@@ -100,49 +86,45 @@ struct event_mailbox { | |||
100 | __le32 reserved_1; | 86 | __le32 reserved_1; |
101 | __le32 reserved_2; | 87 | __le32 reserved_2; |
102 | 88 | ||
103 | u8 dbg_event_id; | ||
104 | u8 num_relevant_params; | ||
105 | __le16 reserved_3; | ||
106 | __le32 event_report_p1; | ||
107 | __le32 event_report_p2; | ||
108 | __le32 event_report_p3; | ||
109 | |||
110 | u8 number_of_scan_results; | 89 | u8 number_of_scan_results; |
111 | u8 scan_tag; | 90 | u8 scan_tag; |
112 | u8 reserved_4[2]; | 91 | u8 completed_scan_status; |
113 | __le32 compl_scheduled_scan_status; | 92 | u8 reserved_3; |
114 | 93 | ||
115 | __le16 scheduled_scan_attended_channels; | ||
116 | u8 soft_gemini_sense_info; | 94 | u8 soft_gemini_sense_info; |
117 | u8 soft_gemini_protective_info; | 95 | u8 soft_gemini_protective_info; |
118 | s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; | 96 | s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; |
119 | u8 channel_switch_status; | 97 | u8 channel_switch_status; |
120 | u8 scheduled_scan_status; | 98 | u8 scheduled_scan_status; |
121 | u8 ps_status; | 99 | u8 ps_status; |
100 | /* tuned channel (roc) */ | ||
101 | u8 roc_channel; | ||
122 | 102 | ||
123 | /* AP FW only */ | 103 | __le16 hlid_removed_bitmap; |
124 | u8 hlid_removed; | ||
125 | 104 | ||
126 | /* a bitmap of hlids for stations that have been inactive too long */ | 105 | /* bitmap of aged stations (by HLID) */ |
127 | __le16 sta_aging_status; | 106 | __le16 sta_aging_status; |
128 | 107 | ||
129 | /* a bitmap of hlids for stations which didn't respond to TX */ | 108 | /* bitmap of stations (by HLID) which exceeded max tx retries */ |
130 | __le16 sta_tx_retry_exceeded; | 109 | __le16 sta_tx_retry_exceeded; |
131 | 110 | ||
132 | /* | 111 | /* discovery completed results */ |
133 | * Bitmap, Each bit set represents the Role ID for which this constraint | 112 | u8 discovery_tag; |
134 | * is set. Range: 0 - FF, FF means ANY role | 113 | u8 number_of_preq_results; |
135 | */ | 114 | u8 number_of_prsp_results; |
136 | u8 ba_role_id; | 115 | u8 reserved_5; |
137 | /* | 116 | |
138 | * Bitmap, Each bit set represents the Link ID for which this constraint | 117 | /* rx ba constraint */ |
139 | * is set. Not applicable if ba_role_id is set to ANY role (FF). | 118 | u8 role_id; /* 0xFF means any role. */ |
140 | * Range: 0 - FFFF, FFFF means ANY link in that role | 119 | u8 rx_ba_allowed; |
141 | */ | 120 | u8 reserved_6[2]; |
142 | u8 ba_link_id; | 121 | |
143 | u8 ba_allowed; | 122 | u8 ps_poll_delivery_failure_role_ids; |
144 | 123 | u8 stopped_role_ids; | |
145 | u8 reserved_5[21]; | 124 | u8 started_role_ids; |
125 | u8 change_auto_mode_timeout; | ||
126 | |||
127 | u8 reserved_7[12]; | ||
146 | } __packed; | 128 | } __packed; |
147 | 129 | ||
148 | int wl1271_event_unmask(struct wl1271 *wl); | 130 | int wl1271_event_unmask(struct wl1271 *wl); |
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c index 5a3325761d04..76e6f37b87ad 100644 --- a/drivers/net/wireless/wl12xx/init.c +++ b/drivers/net/wireless/wl12xx/init.c | |||
@@ -404,12 +404,6 @@ static int wl1271_sta_hw_init_post_mem(struct wl1271 *wl) | |||
404 | { | 404 | { |
405 | int ret, i; | 405 | int ret, i; |
406 | 406 | ||
407 | ret = wl1271_cmd_set_sta_default_wep_key(wl, wl->default_key); | ||
408 | if (ret < 0) { | ||
409 | wl1271_warning("couldn't set default key"); | ||
410 | return ret; | ||
411 | } | ||
412 | |||
413 | /* disable all keep-alive templates */ | 407 | /* disable all keep-alive templates */ |
414 | for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { | 408 | for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { |
415 | ret = wl1271_acx_keep_alive_config(wl, i, | 409 | ret = wl1271_acx_keep_alive_config(wl, i, |
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 07d50b761610..4689d0bccf6d 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -415,7 +415,7 @@ static int wl1271_check_operstate(struct wl1271 *wl, unsigned char operstate) | |||
415 | if (test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags)) | 415 | if (test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags)) |
416 | return 0; | 416 | return 0; |
417 | 417 | ||
418 | ret = wl1271_cmd_set_sta_state(wl); | 418 | ret = wl12xx_cmd_set_peer_state(wl); |
419 | if (ret < 0) | 419 | if (ret < 0) |
420 | return ret; | 420 | return ret; |
421 | 421 | ||
@@ -1982,6 +1982,8 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, | |||
1982 | wl->ap_ps_map = 0; | 1982 | wl->ap_ps_map = 0; |
1983 | wl->sched_scanning = false; | 1983 | wl->sched_scanning = false; |
1984 | wl->role_id = WL12XX_INVALID_ROLE_ID; | 1984 | wl->role_id = WL12XX_INVALID_ROLE_ID; |
1985 | memset(wl->roles_map, 0, sizeof(wl->roles_map)); | ||
1986 | memset(wl->links_map, 0, sizeof(wl->links_map)); | ||
1985 | 1987 | ||
1986 | /* | 1988 | /* |
1987 | * this is performed after the cancel_work calls and the associated | 1989 | * this is performed after the cancel_work calls and the associated |
@@ -2030,7 +2032,7 @@ static int wl1271_dummy_join(struct wl1271 *wl) | |||
2030 | 2032 | ||
2031 | memcpy(wl->bssid, dummy_bssid, ETH_ALEN); | 2033 | memcpy(wl->bssid, dummy_bssid, ETH_ALEN); |
2032 | 2034 | ||
2033 | ret = wl1271_cmd_join(wl, wl->set_bss_type); | 2035 | ret = wl12xx_cmd_role_start_sta(wl); |
2034 | if (ret < 0) | 2036 | if (ret < 0) |
2035 | goto out; | 2037 | goto out; |
2036 | 2038 | ||
@@ -2059,7 +2061,7 @@ static int wl1271_join(struct wl1271 *wl, bool set_assoc) | |||
2059 | if (set_assoc) | 2061 | if (set_assoc) |
2060 | set_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags); | 2062 | set_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags); |
2061 | 2063 | ||
2062 | ret = wl1271_cmd_join(wl, wl->set_bss_type); | 2064 | ret = wl12xx_cmd_role_start_sta(wl); |
2063 | if (ret < 0) | 2065 | if (ret < 0) |
2064 | goto out; | 2066 | goto out; |
2065 | 2067 | ||
@@ -2100,7 +2102,7 @@ static int wl1271_unjoin(struct wl1271 *wl) | |||
2100 | int ret; | 2102 | int ret; |
2101 | 2103 | ||
2102 | /* to stop listening to a channel, we disconnect */ | 2104 | /* to stop listening to a channel, we disconnect */ |
2103 | ret = wl1271_cmd_disconnect(wl); | 2105 | ret = wl12xx_cmd_role_stop_sta(wl); |
2104 | if (ret < 0) | 2106 | if (ret < 0) |
2105 | goto out; | 2107 | goto out; |
2106 | 2108 | ||
@@ -2472,7 +2474,8 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl) | |||
2472 | } | 2474 | } |
2473 | 2475 | ||
2474 | if (wep_key_added) { | 2476 | if (wep_key_added) { |
2475 | ret = wl1271_cmd_set_ap_default_wep_key(wl, wl->default_key); | 2477 | ret = wl12xx_cmd_set_default_wep_key(wl, wl->default_key, |
2478 | WL1271_AP_BROADCAST_HLID); | ||
2476 | if (ret < 0) | 2479 | if (ret < 0) |
2477 | goto out; | 2480 | goto out; |
2478 | } | 2481 | } |
@@ -2550,8 +2553,9 @@ static int wl1271_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | |||
2550 | 2553 | ||
2551 | /* the default WEP key needs to be configured at least once */ | 2554 | /* the default WEP key needs to be configured at least once */ |
2552 | if (key_type == KEY_WEP) { | 2555 | if (key_type == KEY_WEP) { |
2553 | ret = wl1271_cmd_set_sta_default_wep_key(wl, | 2556 | ret = wl12xx_cmd_set_default_wep_key(wl, |
2554 | wl->default_key); | 2557 | wl->default_key, |
2558 | wl->sta_hlid); | ||
2555 | if (ret < 0) | 2559 | if (ret < 0) |
2556 | return ret; | 2560 | return ret; |
2557 | } | 2561 | } |
@@ -3008,7 +3012,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, | |||
3008 | if ((changed & BSS_CHANGED_BEACON_ENABLED)) { | 3012 | if ((changed & BSS_CHANGED_BEACON_ENABLED)) { |
3009 | if (bss_conf->enable_beacon) { | 3013 | if (bss_conf->enable_beacon) { |
3010 | if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { | 3014 | if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { |
3011 | ret = wl1271_cmd_start_bss(wl); | 3015 | ret = wl12xx_cmd_role_start_ap(wl); |
3012 | if (ret < 0) | 3016 | if (ret < 0) |
3013 | goto out; | 3017 | goto out; |
3014 | 3018 | ||
@@ -3021,7 +3025,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, | |||
3021 | } | 3025 | } |
3022 | } else { | 3026 | } else { |
3023 | if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { | 3027 | if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { |
3024 | ret = wl1271_cmd_stop_bss(wl); | 3028 | ret = wl12xx_cmd_role_stop_ap(wl); |
3025 | if (ret < 0) | 3029 | if (ret < 0) |
3026 | goto out; | 3030 | goto out; |
3027 | 3031 | ||
@@ -3532,7 +3536,7 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw, | |||
3532 | if (ret < 0) | 3536 | if (ret < 0) |
3533 | goto out_free_sta; | 3537 | goto out_free_sta; |
3534 | 3538 | ||
3535 | ret = wl1271_cmd_add_sta(wl, sta, hlid); | 3539 | ret = wl12xx_cmd_add_peer(wl, sta, hlid); |
3536 | if (ret < 0) | 3540 | if (ret < 0) |
3537 | goto out_sleep; | 3541 | goto out_sleep; |
3538 | 3542 | ||
@@ -3575,7 +3579,7 @@ static int wl1271_op_sta_remove(struct ieee80211_hw *hw, | |||
3575 | if (ret < 0) | 3579 | if (ret < 0) |
3576 | goto out; | 3580 | goto out; |
3577 | 3581 | ||
3578 | ret = wl1271_cmd_remove_sta(wl, wl_sta->hlid); | 3582 | ret = wl12xx_cmd_remove_peer(wl, wl_sta->hlid); |
3579 | if (ret < 0) | 3583 | if (ret < 0) |
3580 | goto out_sleep; | 3584 | goto out_sleep; |
3581 | 3585 | ||
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 8a745fbe0f45..f4973366a88b 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -37,9 +37,10 @@ static int wl1271_set_default_wep_key(struct wl1271 *wl, u8 id) | |||
37 | bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS); | 37 | bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS); |
38 | 38 | ||
39 | if (is_ap) | 39 | if (is_ap) |
40 | ret = wl1271_cmd_set_ap_default_wep_key(wl, id); | 40 | ret = wl12xx_cmd_set_default_wep_key(wl, id, |
41 | WL1271_AP_BROADCAST_HLID); | ||
41 | else | 42 | else |
42 | ret = wl1271_cmd_set_sta_default_wep_key(wl, id); | 43 | ret = wl12xx_cmd_set_default_wep_key(wl, id, wl->sta_hlid); |
43 | 44 | ||
44 | if (ret < 0) | 45 | if (ret < 0) |
45 | return ret; | 46 | return ret; |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 9f71dc75a01b..3d43875163e1 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -137,6 +137,7 @@ extern u32 wl12xx_debug_level; | |||
137 | #define WL1271_DEFAULT_BEACON_INT 100 | 137 | #define WL1271_DEFAULT_BEACON_INT 100 |
138 | #define WL1271_DEFAULT_DTIM_PERIOD 1 | 138 | #define WL1271_DEFAULT_DTIM_PERIOD 1 |
139 | 139 | ||
140 | #define WL12XX_MAX_ROLES 4 | ||
140 | #define WL12XX_MAX_LINKS 8 | 141 | #define WL12XX_MAX_LINKS 8 |
141 | #define WL12XX_INVALID_ROLE_ID 0xff | 142 | #define WL12XX_INVALID_ROLE_ID 0xff |
142 | #define WL12XX_INVALID_LINK_ID 0xff | 143 | #define WL12XX_INVALID_LINK_ID 0xff |
@@ -394,6 +395,10 @@ struct wl1271 { | |||
394 | int channel; | 395 | int channel; |
395 | u8 role_id; | 396 | u8 role_id; |
396 | u8 sta_hlid; | 397 | u8 sta_hlid; |
398 | u8 dev_hlid; | ||
399 | |||
400 | unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)]; | ||
401 | unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; | ||
397 | 402 | ||
398 | struct wl1271_acx_mem_map *target_mem_map; | 403 | struct wl1271_acx_mem_map *target_mem_map; |
399 | 404 | ||