diff options
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 28 |
1 files changed, 27 insertions, 1 deletions
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 | ||