diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-02-03 07:59:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:53 -0500 |
commit | 34e895075e21be3e21e71d6317440d1ee7969ad0 (patch) | |
tree | 217fe70e32e54ef0134f477510472f3992655d79 /net/mac80211/sta_info.h | |
parent | 070bb5477fb4029131aad4941d7aaf0093db0c38 (diff) |
mac80211: allow station add/remove to sleep
Many drivers would like to sleep during station
addition and removal, and currently have a high
complexity there from not being able to.
This introduces two new callbacks sta_add() and
sta_remove() that drivers can implement instead
of using sta_notify() and that can sleep, and
the new sta_add() callback is also allowed to
fail.
The reason we didn't do this previously is that
the IBSS code wants to insert stations from the
RX path, which is a tasklet, so cannot sleep.
This patch will keep the station allocation in
that path, but moves adding the station to the
driver out of line. Since the addition can now
fail, we can have IBSS peer structs the driver
rejected -- in that case we still talk to the
station but never tell the driver about it in
the control.sta pointer. If there will ever be
a driver that has a low limit on the number of
stations and that cannot talk to any stations
that are not known to it, we need to do come up
with a new strategy of handling larger IBSSs,
maybe quicker expiry or rejecting peers.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r-- | net/mac80211/sta_info.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 6f79bba5706e..5ff611a35979 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -162,11 +162,6 @@ struct sta_ampdu_mlme { | |||
162 | }; | 162 | }; |
163 | 163 | ||
164 | 164 | ||
165 | /* see __sta_info_unlink */ | ||
166 | #define STA_INFO_PIN_STAT_NORMAL 0 | ||
167 | #define STA_INFO_PIN_STAT_PINNED 1 | ||
168 | #define STA_INFO_PIN_STAT_DESTROY 2 | ||
169 | |||
170 | /** | 165 | /** |
171 | * struct sta_info - STA information | 166 | * struct sta_info - STA information |
172 | * | 167 | * |
@@ -187,7 +182,6 @@ struct sta_ampdu_mlme { | |||
187 | * @flaglock: spinlock for flags accesses | 182 | * @flaglock: spinlock for flags accesses |
188 | * @drv_unblock_wk: used for driver PS unblocking | 183 | * @drv_unblock_wk: used for driver PS unblocking |
189 | * @listen_interval: listen interval of this station, when we're acting as AP | 184 | * @listen_interval: listen interval of this station, when we're acting as AP |
190 | * @pin_status: used internally for pinning a STA struct into memory | ||
191 | * @flags: STA flags, see &enum ieee80211_sta_info_flags | 185 | * @flags: STA flags, see &enum ieee80211_sta_info_flags |
192 | * @ps_tx_buf: buffer of frames to transmit to this station | 186 | * @ps_tx_buf: buffer of frames to transmit to this station |
193 | * when it leaves power saving state | 187 | * when it leaves power saving state |
@@ -226,6 +220,7 @@ struct sta_ampdu_mlme { | |||
226 | * @debugfs: debug filesystem info | 220 | * @debugfs: debug filesystem info |
227 | * @sta: station information we share with the driver | 221 | * @sta: station information we share with the driver |
228 | * @dead: set to true when sta is unlinked | 222 | * @dead: set to true when sta is unlinked |
223 | * @uploaded: set to true when sta is uploaded to the driver | ||
229 | */ | 224 | */ |
230 | struct sta_info { | 225 | struct sta_info { |
231 | /* General information, mostly static */ | 226 | /* General information, mostly static */ |
@@ -245,11 +240,7 @@ struct sta_info { | |||
245 | 240 | ||
246 | bool dead; | 241 | bool dead; |
247 | 242 | ||
248 | /* | 243 | bool uploaded; |
249 | * for use by the internal lifetime management, | ||
250 | * see __sta_info_unlink | ||
251 | */ | ||
252 | u8 pin_status; | ||
253 | 244 | ||
254 | /* | 245 | /* |
255 | * frequently updated, locked with own spinlock (flaglock), | 246 | * frequently updated, locked with own spinlock (flaglock), |
@@ -449,18 +440,19 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
449 | * Insert STA info into hash table/list, returns zero or a | 440 | * Insert STA info into hash table/list, returns zero or a |
450 | * -EEXIST if (if the same MAC address is already present). | 441 | * -EEXIST if (if the same MAC address is already present). |
451 | * | 442 | * |
452 | * Calling this without RCU protection makes the caller | 443 | * Calling the non-rcu version makes the caller relinquish, |
453 | * relinquish its reference to @sta. | 444 | * the _rcu version calls read_lock_rcu() and must be called |
445 | * without it held. | ||
454 | */ | 446 | */ |
455 | int sta_info_insert(struct sta_info *sta); | 447 | int sta_info_insert(struct sta_info *sta); |
456 | /* | 448 | int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU); |
457 | * Unlink a STA info from the hash table/list. | 449 | int sta_info_insert_atomic(struct sta_info *sta); |
458 | * This can NULL the STA pointer if somebody else | 450 | |
459 | * has already unlinked it. | 451 | int sta_info_destroy_addr(struct ieee80211_sub_if_data *sdata, |
460 | */ | 452 | const u8 *addr); |
461 | void sta_info_unlink(struct sta_info **sta); | 453 | int sta_info_destroy_addr_bss(struct ieee80211_sub_if_data *sdata, |
454 | const u8 *addr); | ||
462 | 455 | ||
463 | void sta_info_destroy(struct sta_info *sta); | ||
464 | void sta_info_set_tim_bit(struct sta_info *sta); | 456 | void sta_info_set_tim_bit(struct sta_info *sta); |
465 | void sta_info_clear_tim_bit(struct sta_info *sta); | 457 | void sta_info_clear_tim_bit(struct sta_info *sta); |
466 | 458 | ||