diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/wmm.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index faa09e32902e..52d218512c1e 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -399,6 +399,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter) | |||
399 | priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT; | 399 | priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT; |
400 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; | 400 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; |
401 | priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; | 401 | priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; |
402 | |||
403 | atomic_set(&priv->wmm.tx_pkts_queued, 0); | ||
402 | } | 404 | } |
403 | } | 405 | } |
404 | 406 | ||
@@ -408,17 +410,13 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter) | |||
408 | int | 410 | int |
409 | mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter) | 411 | mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter) |
410 | { | 412 | { |
411 | int i, j; | 413 | int i; |
412 | struct mwifiex_private *priv; | 414 | struct mwifiex_private *priv; |
413 | 415 | ||
414 | for (j = 0; j < adapter->priv_num; ++j) { | 416 | for (i = 0; i < adapter->priv_num; ++i) { |
415 | priv = adapter->priv[j]; | 417 | priv = adapter->priv[i]; |
416 | if (priv) { | 418 | if (priv && atomic_read(&priv->wmm.tx_pkts_queued)) |
417 | for (i = 0; i < MAX_NUM_TID; i++) | 419 | return false; |
418 | if (!mwifiex_wmm_is_ra_list_empty( | ||
419 | &priv->wmm.tid_tbl_ptr[i].ra_list)) | ||
420 | return false; | ||
421 | } | ||
422 | } | 420 | } |
423 | 421 | ||
424 | return true; | 422 | return true; |
@@ -468,6 +466,8 @@ static void mwifiex_wmm_cleanup_queues(struct mwifiex_private *priv) | |||
468 | for (i = 0; i < MAX_NUM_TID; i++) | 466 | for (i = 0; i < MAX_NUM_TID; i++) |
469 | mwifiex_wmm_del_pkts_in_ralist(priv, &priv->wmm.tid_tbl_ptr[i]. | 467 | mwifiex_wmm_del_pkts_in_ralist(priv, &priv->wmm.tid_tbl_ptr[i]. |
470 | ra_list); | 468 | ra_list); |
469 | |||
470 | atomic_set(&priv->wmm.tx_pkts_queued, 0); | ||
471 | } | 471 | } |
472 | 472 | ||
473 | /* | 473 | /* |
@@ -638,6 +638,8 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter, | |||
638 | 638 | ||
639 | ra_list->total_pkts_size += skb->len; | 639 | ra_list->total_pkts_size += skb->len; |
640 | 640 | ||
641 | atomic_inc(&priv->wmm.tx_pkts_queued); | ||
642 | |||
641 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); | 643 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); |
642 | } | 644 | } |
643 | 645 | ||
@@ -1028,6 +1030,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, | |||
1028 | .bss_prio_cur->list, | 1030 | .bss_prio_cur->list, |
1029 | struct mwifiex_bss_prio_node, | 1031 | struct mwifiex_bss_prio_node, |
1030 | list); | 1032 | list); |
1033 | atomic_dec(&priv->wmm.tx_pkts_queued); | ||
1031 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, | 1034 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, |
1032 | ra_list_flags); | 1035 | ra_list_flags); |
1033 | } | 1036 | } |
@@ -1134,6 +1137,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv, | |||
1134 | .bss_prio_cur->list, | 1137 | .bss_prio_cur->list, |
1135 | struct mwifiex_bss_prio_node, | 1138 | struct mwifiex_bss_prio_node, |
1136 | list); | 1139 | list); |
1140 | atomic_dec(&priv->wmm.tx_pkts_queued); | ||
1137 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, | 1141 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, |
1138 | ra_list_flags); | 1142 | ra_list_flags); |
1139 | } | 1143 | } |