From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Subject: [RFC 1/4] mac80211: use station mutex in configuration
Date: Tue, 13 Dec 2011 21:07:18 +0100 [thread overview]
Message-ID: <20111213201449.589673140@sipsolutions.net> (raw)
In-Reply-To: 20111213200717.465896579@sipsolutions.net
From: Johannes Berg <johannes.berg@intel.com>
There's no need to use RCU here, we can just lock
the station mutex instead. This allows the code
to sleep, which is necessary for later patches.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/cfg.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/net/mac80211/cfg.c 2011-12-13 21:01:26.000000000 +0100
+++ b/net/mac80211/cfg.c 2011-12-13 21:01:28.000000000 +0100
@@ -960,11 +960,11 @@ static int ieee80211_change_station(stru
struct sta_info *sta;
struct ieee80211_sub_if_data *vlansdata;
- rcu_read_lock();
+ mutex_lock(&local->sta_mtx);
sta = sta_info_get_bss(sdata, mac);
if (!sta) {
- rcu_read_unlock();
+ mutex_unlock(&local->sta_mtx);
return -ENOENT;
}
@@ -972,7 +972,7 @@ static int ieee80211_change_station(stru
if ((params->sta_flags_mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) &&
!!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) !=
!!test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
- rcu_read_unlock();
+ mutex_unlock(&local->sta_mtx);
return -EINVAL;
}
@@ -981,13 +981,13 @@ static int ieee80211_change_station(stru
if (vlansdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
vlansdata->vif.type != NL80211_IFTYPE_AP) {
- rcu_read_unlock();
+ mutex_unlock(&local->sta_mtx);
return -EINVAL;
}
if (params->vlan->ieee80211_ptr->use_4addr) {
if (vlansdata->u.vlan.sta) {
- rcu_read_unlock();
+ mutex_unlock(&local->sta_mtx);
return -EBUSY;
}
@@ -1003,7 +1003,7 @@ static int ieee80211_change_station(stru
if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && params->supported_rates)
rate_control_rate_init(sta);
- rcu_read_unlock();
+ mutex_unlock(&local->sta_mtx);
if (sdata->vif.type == NL80211_IFTYPE_STATION &&
params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED))
next prev parent reply other threads:[~2011-12-13 20:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 20:07 [RFC 0/4] refactor station state management Johannes Berg
2011-12-13 20:07 ` Johannes Berg [this message]
2011-12-13 20:07 ` [RFC 2/4] mac80211: refactor station state transitions Johannes Berg
2011-12-14 0:29 ` Thomas Pedersen
2011-12-14 8:22 ` Johannes Berg
2011-12-13 20:07 ` [RFC 3/4] mac80211: unwind station state on destroy Johannes Berg
2011-12-13 20:07 ` [RFC 4/4] mac80211: count authorized stations per BSS Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111213201449.589673140@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.