Commit 70c5ad7e authored by Zhaoyang Liu's avatar Zhaoyang Liu Committed by Kalle Valo

mwifiex: correct paused tx data packet counter

This patch fixes observed issues while updating counter for
number of paused data packets in wmm queue when trying to
delete packet or delete station entry.
Signed-off-by: default avatarZhaoyang Liu <liuzy@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 14d9c11c
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
*/ */
static bool static bool
mwifiex_uap_del_tx_pkts_in_ralist(struct mwifiex_private *priv, mwifiex_uap_del_tx_pkts_in_ralist(struct mwifiex_private *priv,
struct list_head *ra_list_head) struct list_head *ra_list_head,
int tid)
{ {
struct mwifiex_ra_list_tbl *ra_list; struct mwifiex_ra_list_tbl *ra_list;
struct sk_buff *skb, *tmp; struct sk_buff *skb, *tmp;
...@@ -49,7 +50,10 @@ mwifiex_uap_del_tx_pkts_in_ralist(struct mwifiex_private *priv, ...@@ -49,7 +50,10 @@ mwifiex_uap_del_tx_pkts_in_ralist(struct mwifiex_private *priv,
__skb_unlink(skb, &ra_list->skb_head); __skb_unlink(skb, &ra_list->skb_head);
mwifiex_write_data_complete(adapter, skb, 0, mwifiex_write_data_complete(adapter, skb, 0,
-1); -1);
atomic_dec(&priv->wmm.tx_pkts_queued); if (ra_list->tx_paused)
priv->wmm.pkts_paused[tid]--;
else
atomic_dec(&priv->wmm.tx_pkts_queued);
pkt_deleted = true; pkt_deleted = true;
} }
if ((atomic_read(&adapter->pending_bridged_pkts) <= if ((atomic_read(&adapter->pending_bridged_pkts) <=
...@@ -77,7 +81,7 @@ static void mwifiex_uap_cleanup_tx_queues(struct mwifiex_private *priv) ...@@ -77,7 +81,7 @@ static void mwifiex_uap_cleanup_tx_queues(struct mwifiex_private *priv)
if (priv->del_list_idx == MAX_NUM_TID) if (priv->del_list_idx == MAX_NUM_TID)
priv->del_list_idx = 0; priv->del_list_idx = 0;
ra_list = &priv->wmm.tid_tbl_ptr[priv->del_list_idx].ra_list; ra_list = &priv->wmm.tid_tbl_ptr[priv->del_list_idx].ra_list;
if (mwifiex_uap_del_tx_pkts_in_ralist(priv, ra_list)) { if (mwifiex_uap_del_tx_pkts_in_ralist(priv, ra_list, i)) {
priv->del_list_idx++; priv->del_list_idx++;
break; break;
} }
......
...@@ -160,7 +160,6 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra) ...@@ -160,7 +160,6 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra)
ra_list->tdls_link = false; ra_list->tdls_link = false;
ra_list->ba_status = BA_SETUP_NONE; ra_list->ba_status = BA_SETUP_NONE;
ra_list->amsdu_in_ampdu = false; ra_list->amsdu_in_ampdu = false;
ra_list->tx_paused = false;
if (!mwifiex_queuing_ra_based(priv)) { if (!mwifiex_queuing_ra_based(priv)) {
if (mwifiex_is_tdls_link_setup if (mwifiex_is_tdls_link_setup
(mwifiex_get_tdls_link_status(priv, ra))) { (mwifiex_get_tdls_link_status(priv, ra))) {
...@@ -173,6 +172,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra) ...@@ -173,6 +172,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra)
} else { } else {
spin_lock_irqsave(&priv->sta_list_spinlock, flags); spin_lock_irqsave(&priv->sta_list_spinlock, flags);
node = mwifiex_get_sta_entry(priv, ra); node = mwifiex_get_sta_entry(priv, ra);
if (node)
ra_list->tx_paused = node->tx_pause;
ra_list->is_11n_enabled = ra_list->is_11n_enabled =
mwifiex_is_sta_11n_enabled(priv, node); mwifiex_is_sta_11n_enabled(priv, node);
if (ra_list->is_11n_enabled) if (ra_list->is_11n_enabled)
...@@ -737,7 +738,11 @@ mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv, const u8 *ra_addr) ...@@ -737,7 +738,11 @@ mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv, const u8 *ra_addr)
if (!ra_list) if (!ra_list)
continue; continue;
mwifiex_wmm_del_pkts_in_ralist_node(priv, ra_list); mwifiex_wmm_del_pkts_in_ralist_node(priv, ra_list);
atomic_sub(ra_list->total_pkt_count, &priv->wmm.tx_pkts_queued); if (ra_list->tx_paused)
priv->wmm.pkts_paused[i] -= ra_list->total_pkt_count;
else
atomic_sub(ra_list->total_pkt_count,
&priv->wmm.tx_pkts_queued);
list_del(&ra_list->list); list_del(&ra_list->list);
kfree(ra_list); kfree(ra_list);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment