Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224840
b: refs/heads/master
c: 2e34034
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and Wey-Yi Guy committed Nov 25, 2010
1 parent 5195ca3 commit 2fc43ae
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67158b67cea0c92dba1dda74cde926d149cc1a2e
refs/heads/master: 2e34034e8c9755ff144379d410d5227926e91cce
31 changes: 25 additions & 6 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
u8 tid = 0;
u8 *qc = NULL;
unsigned long flags;
bool is_agg = false;

if (info->control.vif)
ctx = iwl_rxon_ctx_from_vif(info->control.vif);
Expand Down Expand Up @@ -616,6 +617,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_CTL_AMPDU &&
priv->stations[sta_id].tid[tid].agg.state == IWL_AGG_ON) {
txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
is_agg = true;
}
}

Expand Down Expand Up @@ -763,8 +765,14 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
* whether or not we should update the write pointer.
*/

/* avoid atomic ops if it isn't an associated client */
if (sta_priv && sta_priv->client)
/*
* Avoid atomic ops if it isn't an associated client.
* Also, if this is a packet for aggregation, don't
* increase the counter because the ucode will stop
* aggregation queues when their respective station
* goes to sleep.
*/
if (sta_priv && sta_priv->client && !is_agg)
atomic_inc(&sta_priv->pending_frames);

if ((iwl_queue_space(q) < q->high_mark) && priv->mac80211_registered) {
Expand Down Expand Up @@ -1143,14 +1151,15 @@ int iwlagn_txq_check_empty(struct iwl_priv *priv,
return 0;
}

static void iwlagn_tx_status(struct iwl_priv *priv, struct iwl_tx_info *tx_info)
static void iwlagn_non_agg_tx_status(struct iwl_priv *priv,
struct iwl_rxon_context *ctx,
const u8 *addr1)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx_info->skb->data;
struct ieee80211_sta *sta;
struct iwl_station_priv *sta_priv;

rcu_read_lock();
sta = ieee80211_find_sta(tx_info->ctx->vif, hdr->addr1);
sta = ieee80211_find_sta(ctx->vif, addr1);
if (sta) {
sta_priv = (void *)sta->drv_priv;
/* avoid atomic ops if this isn't a client */
Expand All @@ -1159,6 +1168,15 @@ static void iwlagn_tx_status(struct iwl_priv *priv, struct iwl_tx_info *tx_info)
ieee80211_sta_block_awake(priv->hw, sta, false);
}
rcu_read_unlock();
}

static void iwlagn_tx_status(struct iwl_priv *priv, struct iwl_tx_info *tx_info,
bool is_agg)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx_info->skb->data;

if (!is_agg)
iwlagn_non_agg_tx_status(priv, tx_info->ctx, hdr->addr1);

ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb);
}
Expand All @@ -1183,7 +1201,8 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {

tx_info = &txq->txb[txq->q.read_ptr];
iwlagn_tx_status(priv, tx_info);
iwlagn_tx_status(priv, tx_info,
txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);

hdr = (struct ieee80211_hdr *)tx_info->skb->data;
if (hdr && ieee80211_is_data_qos(hdr->frame_control))
Expand Down

0 comments on commit 2fc43ae

Please sign in to comment.