aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-08 11:47:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:37 -0400
commit9116dd01120e249dc2e84e6edecd7ad7f828680f (patch)
treee08ccb8239f9130dcf2fc0e27b4d97151dac9238 /net/mac80211/scan.c
parentbacac545f10f2bf6e5ceff0d8e2b82dfc493602a (diff)
mac80211: clarify scan request
When a scan is requested for non-STA interfaces, we simply fire off a scan, but for STA interfaces we shouldn't because they could be in the middle of an association. This clarifies the corresponding code. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 1beefb5ad6fb..9f6120150120 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -674,23 +674,32 @@ int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata,
674 674
675int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t ssid_len) 675int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t ssid_len)
676{ 676{
677 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
678 struct ieee80211_local *local = sdata->local; 677 struct ieee80211_local *local = sdata->local;
678 struct ieee80211_if_sta *ifsta;
679 679
680 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 680 if (sdata->vif.type != IEEE80211_IF_TYPE_STA)
681 return ieee80211_sta_start_scan(sdata, ssid, ssid_len); 681 return ieee80211_sta_start_scan(sdata, ssid, ssid_len);
682 682
683 /*
684 * STA has a state machine that might need to defer scanning
685 * while it's trying to associate/authenticate, therefore we
686 * queue it up to the state machine in that case.
687 */
688
683 if (local->sta_sw_scanning || local->sta_hw_scanning) { 689 if (local->sta_sw_scanning || local->sta_hw_scanning) {
684 if (local->scan_sdata == sdata) 690 if (local->scan_sdata == sdata)
685 return 0; 691 return 0;
686 return -EBUSY; 692 return -EBUSY;
687 } 693 }
688 694
695 ifsta = &sdata->u.sta;
696
689 ifsta->scan_ssid_len = ssid_len; 697 ifsta->scan_ssid_len = ssid_len;
690 if (ssid_len) 698 if (ssid_len)
691 memcpy(ifsta->scan_ssid, ssid, ssid_len); 699 memcpy(ifsta->scan_ssid, ssid, ssid_len);
692 set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request); 700 set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
693 queue_work(local->hw.workqueue, &ifsta->work); 701 queue_work(local->hw.workqueue, &ifsta->work);
702
694 return 0; 703 return 0;
695} 704}
696 705