Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315539
b: refs/heads/master
c: 5260a5b
h: refs/heads/master
i:
  315537: 21d7e4b
  315535: 0db0a77
v: v3
  • Loading branch information
Johannes Berg committed Jul 12, 2012
1 parent 3bcc28b commit f472321
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2fd5dbc1c7031be5b5de043bcc0a18c7a59a68a
refs/heads/master: 5260a5b2c3524f198ea062fe0a6a4faa724e6a9d
2 changes: 1 addition & 1 deletion trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -965,9 +965,9 @@ struct ieee80211_local {
int scan_channel_idx;
int scan_ies_len;

bool sched_scanning;
struct ieee80211_sched_scan_ies sched_scan_ies;
struct work_struct sched_scan_stopped_work;
struct ieee80211_sub_if_data __rcu *sched_scan_sdata;

unsigned long leave_oper_channel_time;
enum mac80211_scan_state next_scan_state;
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ static void ieee80211_restart_work(struct work_struct *work)

mutex_lock(&local->mtx);
WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
local->sched_scanning,
rcu_dereference_protected(local->sched_scan_sdata,
lockdep_is_held(&local->mtx)),
"%s called with hardware scan in progress\n", __func__);
mutex_unlock(&local->mtx);

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,13 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
struct sk_buff *skb = rx->skb;

if (likely(!(status->rx_flags & IEEE80211_RX_IN_SCAN) &&
!local->sched_scanning))
!rcu_access_pointer(local->sched_scan_sdata)))
return RX_CONTINUE;

if (test_bit(SCAN_HW_SCANNING, &local->scanning) ||
test_bit(SCAN_SW_SCANNING, &local->scanning) ||
test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) ||
local->sched_scanning)
rcu_access_pointer(local->sched_scan_sdata))
return ieee80211_scan_rx(rx->sdata, skb);

/* scanning finished during invoking of handlers */
Expand Down
20 changes: 10 additions & 10 deletions trunk/net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,9 @@ int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local;
int ret, i;

mutex_lock(&sdata->local->mtx);
mutex_lock(&local->mtx);

if (local->sched_scanning) {
if (rcu_access_pointer(local->sched_scan_sdata)) {
ret = -EBUSY;
goto out;
}
Expand Down Expand Up @@ -966,15 +966,15 @@ int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
ret = drv_sched_scan_start(local, sdata, req,
&local->sched_scan_ies);
if (ret == 0) {
local->sched_scanning = true;
rcu_assign_pointer(local->sched_scan_sdata, sdata);
goto out;
}

out_free:
while (i > 0)
kfree(local->sched_scan_ies.ie[--i]);
out:
mutex_unlock(&sdata->local->mtx);
mutex_unlock(&local->mtx);
return ret;
}

Expand All @@ -983,22 +983,22 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
struct ieee80211_local *local = sdata->local;
int ret = 0, i;

mutex_lock(&sdata->local->mtx);
mutex_lock(&local->mtx);

if (!local->ops->sched_scan_stop) {
ret = -ENOTSUPP;
goto out;
}

if (local->sched_scanning) {
if (rcu_access_pointer(local->sched_scan_sdata)) {
for (i = 0; i < IEEE80211_NUM_BANDS; i++)
kfree(local->sched_scan_ies.ie[i]);

drv_sched_scan_stop(local, sdata);
local->sched_scanning = false;
rcu_assign_pointer(local->sched_scan_sdata, NULL);
}
out:
mutex_unlock(&sdata->local->mtx);
mutex_unlock(&local->mtx);

return ret;
}
Expand All @@ -1022,15 +1022,15 @@ void ieee80211_sched_scan_stopped_work(struct work_struct *work)

mutex_lock(&local->mtx);

if (!local->sched_scanning) {
if (!rcu_access_pointer(local->sched_scan_sdata)) {
mutex_unlock(&local->mtx);
return;
}

for (i = 0; i < IEEE80211_NUM_BANDS; i++)
kfree(local->sched_scan_ies.ie[i]);

local->sched_scanning = false;
rcu_assign_pointer(local->sched_scan_sdata, NULL);

mutex_unlock(&local->mtx);

Expand Down

0 comments on commit f472321

Please sign in to comment.