diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ibss.c | 9 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/main.c | 17 | ||||
-rw-r--r-- | net/mac80211/scan.c | 28 |
4 files changed, 36 insertions, 21 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index c585fced8584..ba752362b2b2 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -488,7 +488,9 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | |||
488 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " | 488 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " |
489 | "IBSS networks with same SSID (merge)\n", sdata->name); | 489 | "IBSS networks with same SSID (merge)\n", sdata->name); |
490 | 490 | ||
491 | ieee80211_request_internal_scan(sdata, ifibss->ssid, ifibss->ssid_len); | 491 | ieee80211_request_internal_scan(sdata, |
492 | ifibss->ssid, ifibss->ssid_len, | ||
493 | ifibss->fixed_channel ? ifibss->channel : NULL); | ||
492 | } | 494 | } |
493 | 495 | ||
494 | static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | 496 | static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) |
@@ -595,8 +597,9 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
595 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " | 597 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " |
596 | "join\n", sdata->name); | 598 | "join\n", sdata->name); |
597 | 599 | ||
598 | ieee80211_request_internal_scan(sdata, ifibss->ssid, | 600 | ieee80211_request_internal_scan(sdata, |
599 | ifibss->ssid_len); | 601 | ifibss->ssid, ifibss->ssid_len, |
602 | ifibss->fixed_channel ? ifibss->channel : NULL); | ||
600 | } else { | 603 | } else { |
601 | int interval = IEEE80211_SCAN_INTERVAL; | 604 | int interval = IEEE80211_SCAN_INTERVAL; |
602 | 605 | ||
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 4e73660ebe99..c8077a3647c6 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1020,7 +1020,8 @@ void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); | |||
1020 | /* scan/BSS handling */ | 1020 | /* scan/BSS handling */ |
1021 | void ieee80211_scan_work(struct work_struct *work); | 1021 | void ieee80211_scan_work(struct work_struct *work); |
1022 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | 1022 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, |
1023 | const u8 *ssid, u8 ssid_len); | 1023 | const u8 *ssid, u8 ssid_len, |
1024 | struct ieee80211_channel *chan); | ||
1024 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | 1025 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, |
1025 | struct cfg80211_scan_request *req); | 1026 | struct cfg80211_scan_request *req); |
1026 | void ieee80211_scan_cancel(struct ieee80211_local *local); | 1027 | void ieee80211_scan_cancel(struct ieee80211_local *local); |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index ebcca0eaf1dc..353b6b42d9c5 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -439,7 +439,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
439 | struct ieee80211_local *local = hw_to_local(hw); | 439 | struct ieee80211_local *local = hw_to_local(hw); |
440 | int result; | 440 | int result; |
441 | enum ieee80211_band band; | 441 | enum ieee80211_band band; |
442 | int channels, i, j, max_bitrates; | 442 | int channels, max_bitrates; |
443 | bool supp_ht; | 443 | bool supp_ht; |
444 | static const u32 cipher_suites[] = { | 444 | static const u32 cipher_suites[] = { |
445 | WLAN_CIPHER_SUITE_WEP40, | 445 | WLAN_CIPHER_SUITE_WEP40, |
@@ -605,21 +605,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
605 | 605 | ||
606 | ieee80211_led_init(local); | 606 | ieee80211_led_init(local); |
607 | 607 | ||
608 | /* alloc internal scan request */ | ||
609 | i = 0; | ||
610 | local->int_scan_req->ssids = &local->scan_ssid; | ||
611 | local->int_scan_req->n_ssids = 1; | ||
612 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | ||
613 | if (!hw->wiphy->bands[band]) | ||
614 | continue; | ||
615 | for (j = 0; j < hw->wiphy->bands[band]->n_channels; j++) { | ||
616 | local->int_scan_req->channels[i] = | ||
617 | &hw->wiphy->bands[band]->channels[j]; | ||
618 | i++; | ||
619 | } | ||
620 | } | ||
621 | local->int_scan_req->n_channels = i; | ||
622 | |||
623 | local->network_latency_notifier.notifier_call = | 608 | local->network_latency_notifier.notifier_call = |
624 | ieee80211_max_network_latency; | 609 | ieee80211_max_network_latency; |
625 | result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY, | 610 | result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY, |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index a9d40584e383..414651217b49 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -728,10 +728,12 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | |||
728 | } | 728 | } |
729 | 729 | ||
730 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | 730 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, |
731 | const u8 *ssid, u8 ssid_len) | 731 | const u8 *ssid, u8 ssid_len, |
732 | struct ieee80211_channel *chan) | ||
732 | { | 733 | { |
733 | struct ieee80211_local *local = sdata->local; | 734 | struct ieee80211_local *local = sdata->local; |
734 | int ret = -EBUSY; | 735 | int ret = -EBUSY; |
736 | enum nl80211_band band; | ||
735 | 737 | ||
736 | mutex_lock(&local->scan_mtx); | 738 | mutex_lock(&local->scan_mtx); |
737 | 739 | ||
@@ -739,6 +741,30 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | |||
739 | if (local->scan_req) | 741 | if (local->scan_req) |
740 | goto unlock; | 742 | goto unlock; |
741 | 743 | ||
744 | /* fill internal scan request */ | ||
745 | if (!chan) { | ||
746 | int i, nchan = 0; | ||
747 | |||
748 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | ||
749 | if (!local->hw.wiphy->bands[band]) | ||
750 | continue; | ||
751 | for (i = 0; | ||
752 | i < local->hw.wiphy->bands[band]->n_channels; | ||
753 | i++) { | ||
754 | local->int_scan_req->channels[nchan] = | ||
755 | &local->hw.wiphy->bands[band]->channels[i]; | ||
756 | nchan++; | ||
757 | } | ||
758 | } | ||
759 | |||
760 | local->int_scan_req->n_channels = nchan; | ||
761 | } else { | ||
762 | local->int_scan_req->channels[0] = chan; | ||
763 | local->int_scan_req->n_channels = 1; | ||
764 | } | ||
765 | |||
766 | local->int_scan_req->ssids = &local->scan_ssid; | ||
767 | local->int_scan_req->n_ssids = 1; | ||
742 | memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); | 768 | memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); |
743 | local->int_scan_req->ssids[0].ssid_len = ssid_len; | 769 | local->int_scan_req->ssids[0].ssid_len = ssid_len; |
744 | 770 | ||