Commit a0af5f14 authored by Helmut Schaa's avatar Helmut Schaa Committed by John W. Linville

mac80211: Fix queuing of scan containing a SSID

This patch fixes scanning for specific ssid's which is broken due to the
scan being queued up without respecting the ssid to scan for.
Signed-off-by: default avatarHelmut Schaa <hschaa@suse.de>
Signed-off-by: default avatarJiri Benc <jbenc@suse.cz>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dbeeb816
...@@ -241,6 +241,8 @@ struct ieee80211_if_sta { ...@@ -241,6 +241,8 @@ struct ieee80211_if_sta {
u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 ssid[IEEE80211_MAX_SSID_LEN];
size_t ssid_len; size_t ssid_len;
u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
size_t scan_ssid_len;
u16 aid; u16 aid;
u16 ap_capab, capab; u16 ap_capab, capab;
u8 *extra_ie; /* to be added to the end of AssocReq */ u8 *extra_ie; /* to be added to the end of AssocReq */
......
...@@ -1998,6 +1998,9 @@ void ieee80211_sta_work(struct work_struct *work) ...@@ -1998,6 +1998,9 @@ void ieee80211_sta_work(struct work_struct *work)
if (ifsta->state != IEEE80211_AUTHENTICATE && if (ifsta->state != IEEE80211_AUTHENTICATE &&
ifsta->state != IEEE80211_ASSOCIATE && ifsta->state != IEEE80211_ASSOCIATE &&
test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) { test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) {
if (ifsta->scan_ssid_len)
ieee80211_sta_start_scan(dev, ifsta->scan_ssid, ifsta->scan_ssid_len);
else
ieee80211_sta_start_scan(dev, NULL, 0); ieee80211_sta_start_scan(dev, NULL, 0);
return; return;
} }
...@@ -2868,6 +2871,9 @@ int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len) ...@@ -2868,6 +2871,9 @@ int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len)
return -EBUSY; return -EBUSY;
} }
ifsta->scan_ssid_len = ssid_len;
if (ssid_len)
memcpy(ifsta->scan_ssid, ssid, ssid_len);
set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request); set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
queue_work(local->hw.workqueue, &ifsta->work); queue_work(local->hw.workqueue, &ifsta->work);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment