diff options
author | Michael Buesch <mb@bu3sch.de> | 2006-09-27 08:26:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-10-16 20:09:47 -0400 |
commit | 7c28ad2d83ecc637237fe684659a6afbce0bb2a8 (patch) | |
tree | 4bdbe26516d2d8aa195f97eae9cd120d47521ab6 /include | |
parent | 3693ec670b3bb4d11295856bea3592dd8f37f9a5 (diff) |
[PATCH] softmac: Fix WX and association related races
This fixes some race conditions in the WirelessExtension
handling and association handling code.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ieee80211softmac.h | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 425b3a57ac74..617b672b1132 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -63,13 +63,11 @@ struct ieee80211softmac_wpa { | |||
63 | 63 | ||
64 | /* | 64 | /* |
65 | * Information about association | 65 | * Information about association |
66 | * | ||
67 | * Do we need a lock for this? | ||
68 | * We only ever use this structure inlined | ||
69 | * into our global struct. I've used its lock, | ||
70 | * but maybe we need a local one here? | ||
71 | */ | 66 | */ |
72 | struct ieee80211softmac_assoc_info { | 67 | struct ieee80211softmac_assoc_info { |
68 | |||
69 | struct mutex mutex; | ||
70 | |||
73 | /* | 71 | /* |
74 | * This is the requested ESSID. It is written | 72 | * This is the requested ESSID. It is written |
75 | * only by the WX handlers. | 73 | * only by the WX handlers. |
@@ -99,12 +97,13 @@ struct ieee80211softmac_assoc_info { | |||
99 | * | 97 | * |
100 | * bssfixed is used for SIOCSIWAP. | 98 | * bssfixed is used for SIOCSIWAP. |
101 | */ | 99 | */ |
102 | u8 static_essid:1, | 100 | u8 static_essid; |
103 | short_preamble_available:1, | 101 | u8 short_preamble_available; |
104 | associating:1, | 102 | u8 associating; |
105 | assoc_wait:1, | 103 | u8 associated; |
106 | bssvalid:1, | 104 | u8 assoc_wait; |
107 | bssfixed:1; | 105 | u8 bssvalid; |
106 | u8 bssfixed; | ||
108 | 107 | ||
109 | /* Scan retries remaining */ | 108 | /* Scan retries remaining */ |
110 | int scan_retry; | 109 | int scan_retry; |
@@ -229,12 +228,10 @@ struct ieee80211softmac_device { | |||
229 | /* private stuff follows */ | 228 | /* private stuff follows */ |
230 | /* this lock protects this structure */ | 229 | /* this lock protects this structure */ |
231 | spinlock_t lock; | 230 | spinlock_t lock; |
232 | 231 | ||
233 | /* couple of flags */ | 232 | u8 running; /* SoftMAC started? */ |
234 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | 233 | u8 scanning; |
235 | associated:1, | 234 | |
236 | running:1; | ||
237 | |||
238 | struct ieee80211softmac_scaninfo *scaninfo; | 235 | struct ieee80211softmac_scaninfo *scaninfo; |
239 | struct ieee80211softmac_assoc_info associnfo; | 236 | struct ieee80211softmac_assoc_info associnfo; |
240 | struct ieee80211softmac_bss_info bssinfo; | 237 | struct ieee80211softmac_bss_info bssinfo; |
@@ -250,7 +247,7 @@ struct ieee80211softmac_device { | |||
250 | 247 | ||
251 | /* we need to keep a list of network structs we copied */ | 248 | /* we need to keep a list of network structs we copied */ |
252 | struct list_head network_list; | 249 | struct list_head network_list; |
253 | 250 | ||
254 | /* This must be the last item so that it points to the data | 251 | /* This must be the last item so that it points to the data |
255 | * allocated beyond this structure by alloc_ieee80211 */ | 252 | * allocated beyond this structure by alloc_ieee80211 */ |
256 | u8 priv[0]; | 253 | u8 priv[0]; |
@@ -295,7 +292,7 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device | |||
295 | { | 292 | { |
296 | struct ieee80211softmac_txrates *txrates = &mac->txrates; | 293 | struct ieee80211softmac_txrates *txrates = &mac->txrates; |
297 | 294 | ||
298 | if (!mac->associated) | 295 | if (!mac->associnfo.associated) |
299 | return txrates->mgt_mcast_rate; | 296 | return txrates->mgt_mcast_rate; |
300 | 297 | ||
301 | /* We are associated, sending unicast frame */ | 298 | /* We are associated, sending unicast frame */ |