summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-12-15 11:17:37 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-12-15 20:46:34 +0100
commit8bf11d8d081106c3cce8281a0150e716f8ac5d22 (patch)
tree2b026b9638f7acad90d4712f1675d80f3247a0d1 /net/mac80211/sta_info.c
parentmac80211: make address arguments to sta_info_alloc const (diff)
downloadlinux-8bf11d8d081106c3cce8281a0150e716f8ac5d22.tar.xz
linux-8bf11d8d081106c3cce8281a0150e716f8ac5d22.zip
mac80211: delay IBSS station insertion
In order to notify drivers and simplify the station management code, defer IBSS station insertion to a work item and don't do it directly while receiving a frame. This increases the complexity in IBSS a little bit, but it's pretty straight forward and it allows us to reduce the station management complexity (next patch) considerably. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 16de3bd16107..aa9293d7f3f0 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -354,35 +354,26 @@ static int sta_info_finish_insert(struct sta_info *sta,
/* notify driver */
err = drv_sta_add(local, sdata, &sta->sta);
if (err) {
- if (!async)
+ if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
return err;
printk(KERN_DEBUG "%s: failed to add IBSS STA %pM to "
"driver (%d) - keeping it anyway.\n",
sdata->name, sta->sta.addr, err);
- } else {
+ } else
sta->uploaded = true;
-#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
- if (async)
- wiphy_debug(local->hw.wiphy,
- "Finished adding IBSS STA %pM\n",
- sta->sta.addr);
-#endif
- }
sdata = sta->sdata;
}
if (!dummy_reinsert) {
- if (!async) {
- local->num_sta++;
- local->sta_generation++;
- smp_mb();
-
- /* make the station visible */
- spin_lock_irqsave(&local->sta_lock, flags);
- sta_info_hash_add(local, sta);
- spin_unlock_irqrestore(&local->sta_lock, flags);
- }
+ local->num_sta++;
+ local->sta_generation++;
+ smp_mb();
+
+ /* make the station visible */
+ spin_lock_irqsave(&local->sta_lock, flags);
+ sta_info_hash_add(local, sta);
+ spin_unlock_irqrestore(&local->sta_lock, flags);
list_add(&sta->list, &local->sta_list);
} else {
@@ -1546,7 +1537,7 @@ EXPORT_SYMBOL(ieee80211_sta_set_buffered);
int sta_info_move_state_checked(struct sta_info *sta,
enum ieee80211_sta_state new_state)
{
- /* might_sleep(); -- for driver notify later, fix IBSS first */
+ might_sleep();
if (sta->sta_state == new_state)
return 0;