Commit 20addec6 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: tid_data logic move to upper layer - check_empty

The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with the code that checks if there are still
pending packets for an RA / TID.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 822e8b2a
...@@ -588,6 +588,43 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, ...@@ -588,6 +588,43 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif,
&sta_priv->lq_sta.lq, CMD_ASYNC, false); &sta_priv->lq_sta.lq, CMD_ASYNC, false);
} }
static void iwlagn_check_ratid_empty(struct iwl_priv *priv, int sta_id, u8 tid)
{
struct iwl_tid_data *tid_data = &priv->shrd->tid_data[sta_id][tid];
lockdep_assert_held(&priv->shrd->sta_lock);
switch (priv->shrd->tid_data[sta_id][tid].agg.state) {
case IWL_EMPTYING_HW_QUEUE_DELBA:
/* There are no packets for this RA / TID in the HW any more */
if (tid_data->agg.ssn == tid_data->next_reclaimed) {
IWL_DEBUG_TX_QUEUES(priv,
"Can continue DELBA flow ssn = next_recl ="
" %d", tid_data->next_reclaimed);
iwl_trans_tx_agg_disable(trans(priv), sta_id, tid);
tid_data->agg.state = IWL_AGG_OFF;
iwl_stop_tx_ba_trans_ready(priv,
NUM_IWL_RXON_CTX,
sta_id, tid);
}
break;
case IWL_EMPTYING_HW_QUEUE_ADDBA:
/* There are no packets for this RA / TID in the HW any more */
if (tid_data->agg.ssn == tid_data->next_reclaimed) {
IWL_DEBUG_TX_QUEUES(priv,
"Can continue ADDBA flow ssn = next_recl ="
" %d", tid_data->next_reclaimed);
tid_data->agg.state = IWL_AGG_ON;
iwl_start_tx_ba_trans_ready(priv,
NUM_IWL_RXON_CTX,
sta_id, tid);
}
break;
default:
break;
}
}
static void iwlagn_non_agg_tx_status(struct iwl_priv *priv, static void iwlagn_non_agg_tx_status(struct iwl_priv *priv,
struct iwl_rxon_context *ctx, struct iwl_rxon_context *ctx,
const u8 *addr1) const u8 *addr1)
...@@ -965,6 +1002,7 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, ...@@ -965,6 +1002,7 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb,
/*we can free until ssn % q.n_bd not inclusive */ /*we can free until ssn % q.n_bd not inclusive */
iwl_trans_reclaim(trans(priv), sta_id, tid, txq_id, iwl_trans_reclaim(trans(priv), sta_id, tid, txq_id,
ssn, status, &skbs); ssn, status, &skbs);
iwlagn_check_ratid_empty(priv, sta_id, tid);
freed = 0; freed = 0;
while (!skb_queue_empty(&skbs)) { while (!skb_queue_empty(&skbs)) {
skb = __skb_dequeue(&skbs); skb = __skb_dequeue(&skbs);
...@@ -1120,6 +1158,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, ...@@ -1120,6 +1158,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
priv->shrd->tid_data[sta_id][tid].next_reclaimed = ba_resp_scd_ssn; priv->shrd->tid_data[sta_id][tid].next_reclaimed = ba_resp_scd_ssn;
iwl_trans_reclaim(trans(priv), sta_id, tid, scd_flow, ba_resp_scd_ssn, iwl_trans_reclaim(trans(priv), sta_id, tid, scd_flow, ba_resp_scd_ssn,
0, &reclaimed_skbs); 0, &reclaimed_skbs);
iwlagn_check_ratid_empty(priv, sta_id, tid);
freed = 0; freed = 0;
while (!skb_queue_empty(&reclaimed_skbs)) { while (!skb_queue_empty(&reclaimed_skbs)) {
......
...@@ -1275,47 +1275,6 @@ static int iwl_trans_pcie_request_irq(struct iwl_trans *trans) ...@@ -1275,47 +1275,6 @@ static int iwl_trans_pcie_request_irq(struct iwl_trans *trans)
return 0; return 0;
} }
static int iwlagn_txq_check_empty(struct iwl_trans *trans,
int sta_id, u8 tid, int txq_id)
{
struct iwl_tid_data *tid_data = &trans->shrd->tid_data[sta_id][tid];
lockdep_assert_held(&trans->shrd->sta_lock);
switch (trans->shrd->tid_data[sta_id][tid].agg.state) {
case IWL_EMPTYING_HW_QUEUE_DELBA:
/* There are no packets for this RA / TID in the HW any more */
if ((txq_id == tid_data->agg.txq_id) &&
(tid_data->agg.ssn == tid_data->next_reclaimed)) {
IWL_DEBUG_TX_QUEUES(trans,
"Can continue DELBA flow ssn = next_recl ="
" %d", tid_data->next_reclaimed);
iwl_trans_pcie_tx_agg_disable(trans, sta_id, tid);
tid_data->agg.state = IWL_AGG_OFF;
iwl_stop_tx_ba_trans_ready(priv(trans),
NUM_IWL_RXON_CTX,
sta_id, tid);
}
break;
case IWL_EMPTYING_HW_QUEUE_ADDBA:
/* There are no packets for this RA / TID in the HW any more */
if (tid_data->agg.ssn == tid_data->next_reclaimed) {
IWL_DEBUG_TX_QUEUES(trans,
"Can continue ADDBA flow ssn = next_recl ="
" %d", tid_data->next_reclaimed);
tid_data->agg.state = IWL_AGG_ON;
iwl_start_tx_ba_trans_ready(priv(trans),
NUM_IWL_RXON_CTX,
sta_id, tid);
}
break;
default:
break;
}
return 0;
}
static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
int txq_id, int ssn, u32 status, int txq_id, int ssn, u32 status,
struct sk_buff_head *skbs) struct sk_buff_head *skbs)
...@@ -1338,8 +1297,6 @@ static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, ...@@ -1338,8 +1297,6 @@ static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
status != TX_STATUS_FAIL_PASSIVE_NO_RX)) status != TX_STATUS_FAIL_PASSIVE_NO_RX))
iwl_wake_queue(trans, txq, "Packets reclaimed"); iwl_wake_queue(trans, txq, "Packets reclaimed");
} }
iwlagn_txq_check_empty(trans, sta_id, tid, txq_id);
} }
static void iwl_trans_pcie_free(struct iwl_trans *trans) static void iwl_trans_pcie_free(struct iwl_trans *trans)
......
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