diff options
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7d4fe4a5292..d8a16b7f6a6 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -202,14 +202,12 @@ void sta_info_destroy(struct sta_info *sta) | |||
202 | dev_kfree_skb_any(skb); | 202 | dev_kfree_skb_any(skb); |
203 | 203 | ||
204 | for (i = 0; i < STA_TID_NUM; i++) { | 204 | for (i = 0; i < STA_TID_NUM; i++) { |
205 | spin_lock_bh(&sta->ampdu_mlme.ampdu_rx); | 205 | spin_lock_bh(&sta->lock); |
206 | if (sta->ampdu_mlme.tid_rx[i]) | 206 | if (sta->ampdu_mlme.tid_rx[i]) |
207 | del_timer_sync(&sta->ampdu_mlme.tid_rx[i]->session_timer); | 207 | del_timer_sync(&sta->ampdu_mlme.tid_rx[i]->session_timer); |
208 | spin_unlock_bh(&sta->ampdu_mlme.ampdu_rx); | ||
209 | spin_lock_bh(&sta->ampdu_mlme.ampdu_tx); | ||
210 | if (sta->ampdu_mlme.tid_tx[i]) | 208 | if (sta->ampdu_mlme.tid_tx[i]) |
211 | del_timer_sync(&sta->ampdu_mlme.tid_tx[i]->addba_resp_timer); | 209 | del_timer_sync(&sta->ampdu_mlme.tid_tx[i]->addba_resp_timer); |
212 | spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); | 210 | spin_unlock_bh(&sta->lock); |
213 | } | 211 | } |
214 | 212 | ||
215 | __sta_info_free(local, sta); | 213 | __sta_info_free(local, sta); |
@@ -236,6 +234,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
236 | if (!sta) | 234 | if (!sta) |
237 | return NULL; | 235 | return NULL; |
238 | 236 | ||
237 | spin_lock_init(&sta->lock); | ||
238 | spin_lock_init(&sta->flaglock); | ||
239 | |||
239 | memcpy(sta->addr, addr, ETH_ALEN); | 240 | memcpy(sta->addr, addr, ETH_ALEN); |
240 | sta->local = local; | 241 | sta->local = local; |
241 | sta->sdata = sdata; | 242 | sta->sdata = sdata; |
@@ -249,15 +250,13 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
249 | return NULL; | 250 | return NULL; |
250 | } | 251 | } |
251 | 252 | ||
252 | spin_lock_init(&sta->ampdu_mlme.ampdu_rx); | ||
253 | spin_lock_init(&sta->ampdu_mlme.ampdu_tx); | ||
254 | for (i = 0; i < STA_TID_NUM; i++) { | 253 | for (i = 0; i < STA_TID_NUM; i++) { |
255 | /* timer_to_tid must be initialized with identity mapping to | 254 | /* timer_to_tid must be initialized with identity mapping to |
256 | * enable session_timer's data differentiation. refer to | 255 | * enable session_timer's data differentiation. refer to |
257 | * sta_rx_agg_session_timer_expired for useage */ | 256 | * sta_rx_agg_session_timer_expired for useage */ |
258 | sta->timer_to_tid[i] = i; | 257 | sta->timer_to_tid[i] = i; |
259 | /* tid to tx queue: initialize according to HW (0 is valid) */ | 258 | /* tid to tx queue: initialize according to HW (0 is valid) */ |
260 | sta->tid_to_tx_q[i] = local->hw.queues; | 259 | sta->tid_to_tx_q[i] = ieee80211_num_queues(&local->hw); |
261 | /* rx */ | 260 | /* rx */ |
262 | sta->ampdu_mlme.tid_state_rx[i] = HT_AGG_STATE_IDLE; | 261 | sta->ampdu_mlme.tid_state_rx[i] = HT_AGG_STATE_IDLE; |
263 | sta->ampdu_mlme.tid_rx[i] = NULL; | 262 | sta->ampdu_mlme.tid_rx[i] = NULL; |
@@ -276,7 +275,6 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
276 | 275 | ||
277 | #ifdef CONFIG_MAC80211_MESH | 276 | #ifdef CONFIG_MAC80211_MESH |
278 | sta->plink_state = PLINK_LISTEN; | 277 | sta->plink_state = PLINK_LISTEN; |
279 | spin_lock_init(&sta->plink_lock); | ||
280 | init_timer(&sta->plink_timer); | 278 | init_timer(&sta->plink_timer); |
281 | #endif | 279 | #endif |
282 | 280 | ||
@@ -437,8 +435,7 @@ void __sta_info_unlink(struct sta_info **sta) | |||
437 | 435 | ||
438 | list_del(&(*sta)->list); | 436 | list_del(&(*sta)->list); |
439 | 437 | ||
440 | if ((*sta)->flags & WLAN_STA_PS) { | 438 | if (test_and_clear_sta_flags(*sta, WLAN_STA_PS)) { |
441 | (*sta)->flags &= ~WLAN_STA_PS; | ||
442 | if (sdata->bss) | 439 | if (sdata->bss) |
443 | atomic_dec(&sdata->bss->num_sta_ps); | 440 | atomic_dec(&sdata->bss->num_sta_ps); |
444 | __sta_info_clear_tim_bit(sdata->bss, *sta); | 441 | __sta_info_clear_tim_bit(sdata->bss, *sta); |
@@ -515,20 +512,20 @@ static inline int sta_info_buffer_expired(struct ieee80211_local *local, | |||
515 | struct sta_info *sta, | 512 | struct sta_info *sta, |
516 | struct sk_buff *skb) | 513 | struct sk_buff *skb) |
517 | { | 514 | { |
518 | struct ieee80211_tx_packet_data *pkt_data; | 515 | struct ieee80211_tx_info *info; |
519 | int timeout; | 516 | int timeout; |
520 | 517 | ||
521 | if (!skb) | 518 | if (!skb) |
522 | return 0; | 519 | return 0; |
523 | 520 | ||
524 | pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; | 521 | info = IEEE80211_SKB_CB(skb); |
525 | 522 | ||
526 | /* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */ | 523 | /* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */ |
527 | timeout = (sta->listen_interval * local->hw.conf.beacon_int * 32 / | 524 | timeout = (sta->listen_interval * local->hw.conf.beacon_int * 32 / |
528 | 15625) * HZ; | 525 | 15625) * HZ; |
529 | if (timeout < STA_TX_BUFFER_EXPIRE) | 526 | if (timeout < STA_TX_BUFFER_EXPIRE) |
530 | timeout = STA_TX_BUFFER_EXPIRE; | 527 | timeout = STA_TX_BUFFER_EXPIRE; |
531 | return time_after(jiffies, pkt_data->jiffies + timeout); | 528 | return time_after(jiffies, info->control.jiffies + timeout); |
532 | } | 529 | } |
533 | 530 | ||
534 | 531 | ||
@@ -557,8 +554,10 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
557 | 554 | ||
558 | sdata = sta->sdata; | 555 | sdata = sta->sdata; |
559 | local->total_ps_buffered--; | 556 | local->total_ps_buffered--; |
557 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG | ||
560 | printk(KERN_DEBUG "Buffered frame expired (STA " | 558 | printk(KERN_DEBUG "Buffered frame expired (STA " |
561 | "%s)\n", print_mac(mac, sta->addr)); | 559 | "%s)\n", print_mac(mac, sta->addr)); |
560 | #endif | ||
562 | dev_kfree_skb(skb); | 561 | dev_kfree_skb(skb); |
563 | 562 | ||
564 | if (skb_queue_empty(&sta->ps_tx_buf)) | 563 | if (skb_queue_empty(&sta->ps_tx_buf)) |