From be8755e1804d6f60e6a96a46ac6bc46ce6dfca53 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Fri, 27 Jul 2007 15:43:23 +0200 Subject: [MAC80211]: improve locking of sta_info related structures The sta_info code has some awkward locking which prevents some driver callbacks from being allowed to sleep. This patch makes the locking more focused so code that calls driver callbacks are allowed to sleep. It also converts sta_lock to a rwlock. Signed-off-by: Michael Wu Signed-off-by: Jiri Benc Signed-off-by: John W. Linville --- net/mac80211/sta_info.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'net/mac80211/sta_info.h') diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index b5591d2f60a..b5ef72379ad 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -98,9 +98,6 @@ struct sta_info { * filtering; used only if sta->key is not * set */ -#ifdef CONFIG_MAC80211_DEBUGFS - int debugfs_registered; -#endif int assoc_ap; /* whether this is an AP that we are * associated with as a client */ @@ -149,12 +146,18 @@ struct sta_info { */ #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) +static inline void __sta_info_get(struct sta_info *sta) +{ + kref_get(&sta->kref); +} + struct sta_info * sta_info_get(struct ieee80211_local *local, u8 *addr); int sta_info_min_txrate_get(struct ieee80211_local *local); void sta_info_put(struct sta_info *sta); struct sta_info * sta_info_add(struct ieee80211_local *local, struct net_device *dev, u8 *addr, gfp_t gfp); -void sta_info_free(struct sta_info *sta, int locked); +void sta_info_remove(struct sta_info *sta); +void sta_info_free(struct sta_info *sta); void sta_info_init(struct ieee80211_local *local); int sta_info_start(struct ieee80211_local *local); void sta_info_stop(struct ieee80211_local *local); -- cgit v1.2.3 From 53cb670042999b8acb70945ce522b015dcdf7b43 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 28 Aug 2007 17:01:53 -0400 Subject: [MAC80211]: remove unused ioctls (2) The ioctls * PRISM2_PARAM_STA_ANTENNA_SEL * PRISM2_PARAM_TX_POWER_REDUCTION * PRISM2_PARAM_DEFAULT_WEP_ONLY are not used by hostapd or wpa_supplicant. Signed-off-by: Johannes Berg Acked-by: Michael Wu Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/sta_info.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'net/mac80211/sta_info.h') diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index b5ef72379ad..4afa7df2a18 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -90,10 +90,6 @@ struct sta_info { int channel_use; int channel_use_raw; - u8 antenna_sel_tx; - u8 antenna_sel_rx; - - int key_idx_compression; /* key table index for compression and TX * filtering; used only if sta->key is not * set */ -- cgit v1.2.3 From 3aefaa3294193c931b20a574f718efee6baf27d4 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 28 Aug 2007 17:01:55 -0400 Subject: [MAC80211]: remove fake set_key() call Remove adding a fake key with a NONE key algorithm for each associated STA. If we have hardware with such TX filtering we should probably extend the sta_table_notification() callback with the sta information instead; the fact that it's treated as a key for some atheros hardware shouldn't bother the stack. Signed-off-by: Johannes Berg Acked-by: Michael Wu Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/sta_info.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'net/mac80211/sta_info.h') diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 4afa7df2a18..3b0fcb25571 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -90,10 +90,6 @@ struct sta_info { int channel_use; int channel_use_raw; - int key_idx_compression; /* key table index for compression and TX - * filtering; used only if sta->key is not - * set */ - int assoc_ap; /* whether this is an AP that we are * associated with as a client */ -- cgit v1.2.3 From c9ee23dfac61a713de48b20999dcacb7ef3c5ed0 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 28 Aug 2007 17:01:55 -0400 Subject: [MAC80211]: make assoc_ap a flag The sta_info.assoc_ap value is used as a flag, move it into flags. Signed-off-by: Johannes Berg Acked-by: Michael Wu Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/sta_info.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/mac80211/sta_info.h') diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 3b0fcb25571..e3ae0f5cc22 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -26,6 +26,8 @@ * send and receive non-IEEE 802.1X frames */ #define WLAN_STA_SHORT_PREAMBLE BIT(7) +/* whether this is an AP that we are associated with as a client */ +#define WLAN_STA_ASSOC_AP BIT(8) #define WLAN_STA_WME BIT(9) #define WLAN_STA_WDS BIT(27) @@ -90,9 +92,6 @@ struct sta_info { int channel_use; int channel_use_raw; - int assoc_ap; /* whether this is an AP that we are - * associated with as a client */ - #ifdef CONFIG_MAC80211_DEBUG_COUNTERS unsigned int wme_rx_queue[NUM_RX_DATA_QUEUES]; unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES]; -- cgit v1.2.3 From d86ec781ef9627a3fcd64a7a91d1b79a74d3927b Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 18 Sep 2007 17:29:21 -0400 Subject: [MAC80211]: kill vlan_id Each station has a vlan_id that is useless. Remove it. Signed-off-by: Johannes Berg Signed-off-by: Michael Wu Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/sta_info.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'net/mac80211/sta_info.h') diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index e3ae0f5cc22..8f7ebe41c02 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -97,8 +97,6 @@ struct sta_info { unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES]; #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ - int vlan_id; - u16 listen_interval; #ifdef CONFIG_MAC80211_DEBUGFS -- cgit v1.2.3