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/ieee80211_i.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/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 3067fbd69d63..a5911191f224 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -688,15 +688,18 @@ struct ieee80211_local { | |||
688 | 688 | ||
689 | /* Station data */ | 689 | /* Station data */ |
690 | /* | 690 | /* |
691 | * The lock only protects the list, hash, timer and counter | 691 | * The mutex only protects the list and counter, |
692 | * against manipulation, reads are done in RCU. Additionally, | 692 | * reads are done in RCU. |
693 | * the lock protects each BSS's TIM bitmap. | 693 | * Additionally, the lock protects the hash table, |
694 | * the pending list and each BSS's TIM bitmap. | ||
694 | */ | 695 | */ |
696 | struct mutex sta_mtx; | ||
695 | spinlock_t sta_lock; | 697 | spinlock_t sta_lock; |
696 | unsigned long num_sta; | 698 | unsigned long num_sta; |
697 | struct list_head sta_list; | 699 | struct list_head sta_list, sta_pending_list; |
698 | struct sta_info *sta_hash[STA_HASH_SIZE]; | 700 | struct sta_info *sta_hash[STA_HASH_SIZE]; |
699 | struct timer_list sta_cleanup; | 701 | struct timer_list sta_cleanup; |
702 | struct work_struct sta_finish_work; | ||
700 | int sta_generation; | 703 | int sta_generation; |
701 | 704 | ||
702 | struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; | 705 | struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; |
@@ -770,10 +773,6 @@ struct ieee80211_local { | |||
770 | assoc_led_name[32], radio_led_name[32]; | 773 | assoc_led_name[32], radio_led_name[32]; |
771 | #endif | 774 | #endif |
772 | 775 | ||
773 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
774 | struct work_struct sta_debugfs_add; | ||
775 | #endif | ||
776 | |||
777 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS | 776 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS |
778 | /* TX/RX handler statistics */ | 777 | /* TX/RX handler statistics */ |
779 | unsigned int tx_handlers_drop; | 778 | unsigned int tx_handlers_drop; |
@@ -985,7 +984,8 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); | |||
985 | ieee80211_rx_result | 984 | ieee80211_rx_result |
986 | ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); | 985 | ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); |
987 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | 986 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, |
988 | u8 *bssid, u8 *addr, u32 supp_rates); | 987 | u8 *bssid, u8 *addr, u32 supp_rates, |
988 | gfp_t gfp); | ||
989 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, | 989 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, |
990 | struct cfg80211_ibss_params *params); | 990 | struct cfg80211_ibss_params *params); |
991 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); | 991 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); |