diff options
author | Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> | 2009-10-13 05:47:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:10 -0400 |
commit | abb0b3bfb2d2411034b721df21c31964265b851e (patch) | |
tree | 8788cfe6c870d4b36baa88e3acba6a4acc9e9c1d /drivers/net/wireless/wl12xx | |
parent | 311494c47fb670a1fd74eea54fa4d02a56fcc2ad (diff) |
wl1271: Added support to scan on 5 GHz band
Added support to scan 802.11a access points on 5 GHz band when using
wl1273 chip.
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.c | 121 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_event.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_rx.c | 3 |
7 files changed, 160 insertions, 38 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index dc9957ee1ac3..79a732443151 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
@@ -299,6 +299,15 @@ struct wl1271_rx_mem_pool_addr { | |||
299 | u32 addr_extra; | 299 | u32 addr_extra; |
300 | }; | 300 | }; |
301 | 301 | ||
302 | struct wl1271_scan { | ||
303 | u8 state; | ||
304 | u8 ssid[IW_ESSID_MAX_SIZE+1]; | ||
305 | size_t ssid_len; | ||
306 | u8 active; | ||
307 | u8 high_prio; | ||
308 | u8 probe_requests; | ||
309 | }; | ||
310 | |||
302 | struct wl1271 { | 311 | struct wl1271 { |
303 | struct ieee80211_hw *hw; | 312 | struct ieee80211_hw *hw; |
304 | bool mac80211_registered; | 313 | bool mac80211_registered; |
@@ -382,6 +391,7 @@ struct wl1271 { | |||
382 | 391 | ||
383 | /* Are we currently scanning */ | 392 | /* Are we currently scanning */ |
384 | bool scanning; | 393 | bool scanning; |
394 | struct wl1271_scan scan; | ||
385 | 395 | ||
386 | /* Our association ID */ | 396 | /* Our association ID */ |
387 | u16 aid; | 397 | u16 aid; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c index 204e87218d8f..6d7a40c004f1 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c | |||
@@ -509,7 +509,7 @@ out: | |||
509 | } | 509 | } |
510 | 510 | ||
511 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | 511 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, |
512 | u8 active_scan, u8 high_prio, u8 num_channels, | 512 | u8 active_scan, u8 high_prio, u8 band, |
513 | u8 probe_requests) | 513 | u8 probe_requests) |
514 | { | 514 | { |
515 | 515 | ||
@@ -518,12 +518,25 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
518 | struct ieee80211_channel *channels; | 518 | struct ieee80211_channel *channels; |
519 | int i, j, n_ch, ret; | 519 | int i, j, n_ch, ret; |
520 | u16 scan_options = 0; | 520 | u16 scan_options = 0; |
521 | u8 ieee_band; | ||
522 | |||
523 | if (band == WL1271_SCAN_BAND_2_4_GHZ) | ||
524 | ieee_band = IEEE80211_BAND_2GHZ; | ||
525 | else if (band == WL1271_SCAN_BAND_DUAL && wl1271_11a_enabled()) | ||
526 | ieee_band = IEEE80211_BAND_2GHZ; | ||
527 | else if (band == WL1271_SCAN_BAND_5_GHZ && wl1271_11a_enabled()) | ||
528 | ieee_band = IEEE80211_BAND_5GHZ; | ||
529 | else | ||
530 | return -EINVAL; | ||
521 | 531 | ||
522 | if (wl->scanning) | 532 | if (wl->hw->wiphy->bands[ieee_band]->channels == NULL) |
523 | return -EINVAL; | 533 | return -EINVAL; |
524 | 534 | ||
525 | channels = wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ]->channels; | 535 | channels = wl->hw->wiphy->bands[ieee_band]->channels; |
526 | n_ch = wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ]->n_channels; | 536 | n_ch = wl->hw->wiphy->bands[ieee_band]->n_channels; |
537 | |||
538 | if (wl->scanning) | ||
539 | return -EINVAL; | ||
527 | 540 | ||
528 | params = kzalloc(sizeof(*params), GFP_KERNEL); | 541 | params = kzalloc(sizeof(*params), GFP_KERNEL); |
529 | if (!params) | 542 | if (!params) |
@@ -540,10 +553,16 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
540 | params->params.scan_options = scan_options; | 553 | params->params.scan_options = scan_options; |
541 | 554 | ||
542 | params->params.num_probe_requests = probe_requests; | 555 | params->params.num_probe_requests = probe_requests; |
543 | params->params.tx_rate = cpu_to_le32(CONF_HW_BIT_RATE_2MBPS); | 556 | /* Let the fw autodetect suitable tx_rate for probes */ |
557 | params->params.tx_rate = 0; | ||
544 | params->params.tid_trigger = 0; | 558 | params->params.tid_trigger = 0; |
545 | params->params.scan_tag = WL1271_SCAN_DEFAULT_TAG; | 559 | params->params.scan_tag = WL1271_SCAN_DEFAULT_TAG; |
546 | 560 | ||
561 | if (band == WL1271_SCAN_BAND_DUAL) | ||
562 | params->params.band = WL1271_SCAN_BAND_2_4_GHZ; | ||
563 | else | ||
564 | params->params.band = band; | ||
565 | |||
547 | for (i = 0, j = 0; i < n_ch && i < WL1271_SCAN_MAX_CHANNELS; i++) { | 566 | for (i = 0, j = 0; i < n_ch && i < WL1271_SCAN_MAX_CHANNELS; i++) { |
548 | if (!(channels[i].flags & IEEE80211_CHAN_DISABLED)) { | 567 | if (!(channels[i].flags & IEEE80211_CHAN_DISABLED)) { |
549 | params->channels[j].min_duration = | 568 | params->channels[j].min_duration = |
@@ -567,7 +586,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
567 | memcpy(params->params.ssid, ssid, len); | 586 | memcpy(params->params.ssid, ssid, len); |
568 | } | 587 | } |
569 | 588 | ||
570 | ret = wl1271_cmd_build_probe_req(wl, ssid, len); | 589 | ret = wl1271_cmd_build_probe_req(wl, ssid, len, ieee_band); |
571 | if (ret < 0) { | 590 | if (ret < 0) { |
572 | wl1271_error("PROBE request template failed"); | 591 | wl1271_error("PROBE request template failed"); |
573 | goto out; | 592 | goto out; |
@@ -592,6 +611,19 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | |||
592 | wl1271_dump(DEBUG_SCAN, "SCAN: ", params, sizeof(*params)); | 611 | wl1271_dump(DEBUG_SCAN, "SCAN: ", params, sizeof(*params)); |
593 | 612 | ||
594 | wl->scanning = true; | 613 | wl->scanning = true; |
614 | if (wl1271_11a_enabled()) { | ||
615 | wl->scan.state = band; | ||
616 | if (band == WL1271_SCAN_BAND_DUAL) { | ||
617 | wl->scan.active = active_scan; | ||
618 | wl->scan.high_prio = high_prio; | ||
619 | wl->scan.probe_requests = probe_requests; | ||
620 | if (len && ssid) { | ||
621 | wl->scan.ssid_len = len; | ||
622 | memcpy(wl->scan.ssid, ssid, len); | ||
623 | } else | ||
624 | wl->scan.ssid_len = 0; | ||
625 | } | ||
626 | } | ||
595 | 627 | ||
596 | ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params)); | 628 | ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params)); |
597 | if (ret < 0) { | 629 | if (ret < 0) { |
@@ -654,30 +686,62 @@ out: | |||
654 | return ret; | 686 | return ret; |
655 | } | 687 | } |
656 | 688 | ||
657 | static int wl1271_build_basic_rates(char *rates) | 689 | static int wl1271_build_basic_rates(char *rates, u8 band) |
658 | { | 690 | { |
659 | u8 index = 0; | 691 | u8 index = 0; |
660 | 692 | ||
661 | rates[index++] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; | 693 | if (band == IEEE80211_BAND_2GHZ) { |
662 | rates[index++] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB; | 694 | rates[index++] = |
663 | rates[index++] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB; | 695 | IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; |
664 | rates[index++] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB; | 696 | rates[index++] = |
697 | IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB; | ||
698 | rates[index++] = | ||
699 | IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB; | ||
700 | rates[index++] = | ||
701 | IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB; | ||
702 | } else if (band == IEEE80211_BAND_5GHZ) { | ||
703 | rates[index++] = | ||
704 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB; | ||
705 | rates[index++] = | ||
706 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_12MB; | ||
707 | rates[index++] = | ||
708 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_24MB; | ||
709 | } else { | ||
710 | wl1271_error("build_basic_rates invalid band: %d", band); | ||
711 | } | ||
665 | 712 | ||
666 | return index; | 713 | return index; |
667 | } | 714 | } |
668 | 715 | ||
669 | static int wl1271_build_extended_rates(char *rates) | 716 | static int wl1271_build_extended_rates(char *rates, u8 band) |
670 | { | 717 | { |
671 | u8 index = 0; | 718 | u8 index = 0; |
672 | 719 | ||
673 | rates[index++] = IEEE80211_OFDM_RATE_6MB; | 720 | if (band == IEEE80211_BAND_2GHZ) { |
674 | rates[index++] = IEEE80211_OFDM_RATE_9MB; | 721 | rates[index++] = IEEE80211_OFDM_RATE_6MB; |
675 | rates[index++] = IEEE80211_OFDM_RATE_12MB; | 722 | rates[index++] = IEEE80211_OFDM_RATE_9MB; |
676 | rates[index++] = IEEE80211_OFDM_RATE_18MB; | 723 | rates[index++] = IEEE80211_OFDM_RATE_12MB; |
677 | rates[index++] = IEEE80211_OFDM_RATE_24MB; | 724 | rates[index++] = IEEE80211_OFDM_RATE_18MB; |
678 | rates[index++] = IEEE80211_OFDM_RATE_36MB; | 725 | rates[index++] = IEEE80211_OFDM_RATE_24MB; |
679 | rates[index++] = IEEE80211_OFDM_RATE_48MB; | 726 | rates[index++] = IEEE80211_OFDM_RATE_36MB; |
680 | rates[index++] = IEEE80211_OFDM_RATE_54MB; | 727 | rates[index++] = IEEE80211_OFDM_RATE_48MB; |
728 | rates[index++] = IEEE80211_OFDM_RATE_54MB; | ||
729 | } else if (band == IEEE80211_BAND_5GHZ) { | ||
730 | rates[index++] = | ||
731 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_9MB; | ||
732 | rates[index++] = | ||
733 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_18MB; | ||
734 | rates[index++] = | ||
735 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_24MB; | ||
736 | rates[index++] = | ||
737 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_36MB; | ||
738 | rates[index++] = | ||
739 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_48MB; | ||
740 | rates[index++] = | ||
741 | IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB; | ||
742 | } else { | ||
743 | wl1271_error("build_basic_rates invalid band: %d", band); | ||
744 | } | ||
681 | 745 | ||
682 | return index; | 746 | return index; |
683 | } | 747 | } |
@@ -720,12 +784,14 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid) | |||
720 | 784 | ||
721 | } | 785 | } |
722 | 786 | ||
723 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len) | 787 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, |
788 | u8 band) | ||
724 | { | 789 | { |
725 | struct wl12xx_probe_req_template template; | 790 | struct wl12xx_probe_req_template template; |
726 | struct wl12xx_ie_rates *rates; | 791 | struct wl12xx_ie_rates *rates; |
727 | char *ptr; | 792 | char *ptr; |
728 | u16 size; | 793 | u16 size; |
794 | int ret; | ||
729 | 795 | ||
730 | ptr = (char *)&template; | 796 | ptr = (char *)&template; |
731 | size = sizeof(struct ieee80211_header); | 797 | size = sizeof(struct ieee80211_header); |
@@ -747,20 +813,25 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len) | |||
747 | /* Basic Rates */ | 813 | /* Basic Rates */ |
748 | rates = (struct wl12xx_ie_rates *)ptr; | 814 | rates = (struct wl12xx_ie_rates *)ptr; |
749 | rates->header.id = WLAN_EID_SUPP_RATES; | 815 | rates->header.id = WLAN_EID_SUPP_RATES; |
750 | rates->header.len = wl1271_build_basic_rates(rates->rates); | 816 | rates->header.len = wl1271_build_basic_rates(rates->rates, band); |
751 | size += sizeof(struct wl12xx_ie_header) + rates->header.len; | 817 | size += sizeof(struct wl12xx_ie_header) + rates->header.len; |
752 | ptr += sizeof(struct wl12xx_ie_header) + rates->header.len; | 818 | ptr += sizeof(struct wl12xx_ie_header) + rates->header.len; |
753 | 819 | ||
754 | /* Extended rates */ | 820 | /* Extended rates */ |
755 | rates = (struct wl12xx_ie_rates *)ptr; | 821 | rates = (struct wl12xx_ie_rates *)ptr; |
756 | rates->header.id = WLAN_EID_EXT_SUPP_RATES; | 822 | rates->header.id = WLAN_EID_EXT_SUPP_RATES; |
757 | rates->header.len = wl1271_build_extended_rates(rates->rates); | 823 | rates->header.len = wl1271_build_extended_rates(rates->rates, band); |
758 | size += sizeof(struct wl12xx_ie_header) + rates->header.len; | 824 | size += sizeof(struct wl12xx_ie_header) + rates->header.len; |
759 | 825 | ||
760 | wl1271_dump(DEBUG_SCAN, "PROBE REQ: ", &template, size); | 826 | wl1271_dump(DEBUG_SCAN, "PROBE REQ: ", &template, size); |
761 | 827 | ||
762 | return wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, | 828 | if (band == IEEE80211_BAND_2GHZ) |
763 | &template, size); | 829 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, |
830 | &template, size); | ||
831 | else | ||
832 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, | ||
833 | &template, size); | ||
834 | return ret; | ||
764 | } | 835 | } |
765 | 836 | ||
766 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) | 837 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) |
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h index 91430871c8fd..33089408e759 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.h +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h | |||
@@ -39,13 +39,14 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode); | |||
39 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, | 39 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, |
40 | size_t len); | 40 | size_t len); |
41 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, | 41 | int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len, |
42 | u8 active_scan, u8 high_prio, u8 num_channels, | 42 | u8 active_scan, u8 high_prio, u8 band, |
43 | u8 probe_requests); | 43 | u8 probe_requests); |
44 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, | 44 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, |
45 | void *buf, size_t buf_len); | 45 | void *buf, size_t buf_len); |
46 | int wl1271_cmd_build_null_data(struct wl1271 *wl); | 46 | int wl1271_cmd_build_null_data(struct wl1271 *wl); |
47 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); | 47 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); |
48 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len); | 48 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, |
49 | u8 band); | ||
49 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); | 50 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); |
50 | int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, | 51 | int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
51 | u8 key_size, const u8 *key, const u8 *addr, | 52 | u8 key_size, const u8 *key, const u8 *addr, |
@@ -343,6 +344,9 @@ struct wl1271_cmd_set_keys { | |||
343 | #define WL1271_SCAN_OPT_PRIORITY_HIGH 4 | 344 | #define WL1271_SCAN_OPT_PRIORITY_HIGH 4 |
344 | #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ | 345 | #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ |
345 | #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ | 346 | #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ |
347 | #define WL1271_SCAN_BAND_2_4_GHZ 0 | ||
348 | #define WL1271_SCAN_BAND_5_GHZ 1 | ||
349 | #define WL1271_SCAN_BAND_DUAL 2 | ||
346 | 350 | ||
347 | struct basic_scan_params { | 351 | struct basic_scan_params { |
348 | u32 rx_config_options; | 352 | u32 rx_config_options; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c index 4189e97ca805..e2d7758ba1c9 100644 --- a/drivers/net/wireless/wl12xx/wl1271_event.c +++ b/drivers/net/wireless/wl12xx/wl1271_event.c | |||
@@ -31,19 +31,40 @@ | |||
31 | static int wl1271_event_scan_complete(struct wl1271 *wl, | 31 | static int wl1271_event_scan_complete(struct wl1271 *wl, |
32 | struct event_mailbox *mbox) | 32 | struct event_mailbox *mbox) |
33 | { | 33 | { |
34 | int size = sizeof(struct wl12xx_probe_req_template); | ||
34 | wl1271_debug(DEBUG_EVENT, "status: 0x%x", | 35 | wl1271_debug(DEBUG_EVENT, "status: 0x%x", |
35 | mbox->scheduled_scan_status); | 36 | mbox->scheduled_scan_status); |
36 | 37 | ||
37 | if (wl->scanning) { | 38 | if (wl->scanning) { |
38 | int size = sizeof(struct wl12xx_probe_req_template); | 39 | if (wl->scan.state == WL1271_SCAN_BAND_DUAL) { |
39 | wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, | 40 | wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, |
40 | size); | 41 | NULL, size); |
41 | mutex_unlock(&wl->mutex); | 42 | /* 2.4 GHz band scanned, scan 5 GHz band, pretend |
42 | ieee80211_scan_completed(wl->hw, false); | 43 | * to the wl1271_cmd_scan function that we are not |
43 | mutex_lock(&wl->mutex); | 44 | * scanning as it checks that. |
44 | wl->scanning = false; | 45 | */ |
46 | wl->scanning = false; | ||
47 | wl1271_cmd_scan(wl, wl->scan.ssid, wl->scan.ssid_len, | ||
48 | wl->scan.active, | ||
49 | wl->scan.high_prio, | ||
50 | WL1271_SCAN_BAND_5_GHZ, | ||
51 | wl->scan.probe_requests); | ||
52 | } else { | ||
53 | if (wl->scan.state == WL1271_SCAN_BAND_2_4_GHZ) | ||
54 | wl1271_cmd_template_set(wl, | ||
55 | CMD_TEMPL_CFG_PROBE_REQ_2_4, | ||
56 | NULL, size); | ||
57 | else | ||
58 | wl1271_cmd_template_set(wl, | ||
59 | CMD_TEMPL_CFG_PROBE_REQ_5, | ||
60 | NULL, size); | ||
61 | |||
62 | mutex_unlock(&wl->mutex); | ||
63 | ieee80211_scan_completed(wl->hw, false); | ||
64 | mutex_lock(&wl->mutex); | ||
65 | wl->scanning = false; | ||
66 | } | ||
45 | } | 67 | } |
46 | |||
47 | return 0; | 68 | return 0; |
48 | } | 69 | } |
49 | 70 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 6f21eeae5246..417b4152feb1 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -59,6 +59,14 @@ static int wl1271_init_templates_config(struct wl1271 *wl) | |||
59 | if (ret < 0) | 59 | if (ret < 0) |
60 | return ret; | 60 | return ret; |
61 | 61 | ||
62 | if (wl1271_11a_enabled()) { | ||
63 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, | ||
64 | NULL, | ||
65 | sizeof(struct wl12xx_probe_req_template)); | ||
66 | if (ret < 0) | ||
67 | return ret; | ||
68 | } | ||
69 | |||
62 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, | 70 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, |
63 | sizeof(struct wl12xx_null_data_template)); | 71 | sizeof(struct wl12xx_null_data_template)); |
64 | if (ret < 0) | 72 | if (ret < 0) |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 9b1cc8db1ddd..ae41a7095508 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -1332,13 +1332,13 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw, | |||
1332 | struct wl1271 *wl = hw->priv; | 1332 | struct wl1271 *wl = hw->priv; |
1333 | int ret; | 1333 | int ret; |
1334 | u8 *ssid = NULL; | 1334 | u8 *ssid = NULL; |
1335 | size_t ssid_len = 0; | 1335 | size_t len = 0; |
1336 | 1336 | ||
1337 | wl1271_debug(DEBUG_MAC80211, "mac80211 hw scan"); | 1337 | wl1271_debug(DEBUG_MAC80211, "mac80211 hw scan"); |
1338 | 1338 | ||
1339 | if (req->n_ssids) { | 1339 | if (req->n_ssids) { |
1340 | ssid = req->ssids[0].ssid; | 1340 | ssid = req->ssids[0].ssid; |
1341 | ssid_len = req->ssids[0].ssid_len; | 1341 | len = req->ssids[0].ssid_len; |
1342 | } | 1342 | } |
1343 | 1343 | ||
1344 | mutex_lock(&wl->mutex); | 1344 | mutex_lock(&wl->mutex); |
@@ -1347,7 +1347,12 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw, | |||
1347 | if (ret < 0) | 1347 | if (ret < 0) |
1348 | goto out; | 1348 | goto out; |
1349 | 1349 | ||
1350 | ret = wl1271_cmd_scan(hw->priv, ssid, ssid_len, 1, 0, 13, 3); | 1350 | if (wl1271_11a_enabled()) |
1351 | ret = wl1271_cmd_scan(hw->priv, ssid, len, 1, 0, | ||
1352 | WL1271_SCAN_BAND_DUAL, 3); | ||
1353 | else | ||
1354 | ret = wl1271_cmd_scan(hw->priv, ssid, len, 1, 0, | ||
1355 | WL1271_SCAN_BAND_2_4_GHZ, 3); | ||
1351 | 1356 | ||
1352 | wl1271_ps_elp_sleep(wl); | 1357 | wl1271_ps_elp_sleep(wl); |
1353 | 1358 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c index 7979b69ec52d..66b83e922909 100644 --- a/drivers/net/wireless/wl12xx/wl1271_rx.c +++ b/drivers/net/wireless/wl12xx/wl1271_rx.c | |||
@@ -79,6 +79,9 @@ static void wl1271_rx_status(struct wl1271 *wl, | |||
79 | 79 | ||
80 | if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG) | 80 | if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG) |
81 | status->band = IEEE80211_BAND_2GHZ; | 81 | status->band = IEEE80211_BAND_2GHZ; |
82 | else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == | ||
83 | WL1271_RX_DESC_BAND_A) | ||
84 | status->band = IEEE80211_BAND_5GHZ; | ||
82 | else | 85 | else |
83 | wl1271_warning("unsupported band 0x%x", | 86 | wl1271_warning("unsupported band 0x%x", |
84 | desc->flags & WL1271_RX_DESC_BAND_MASK); | 87 | desc->flags & WL1271_RX_DESC_BAND_MASK); |