aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 0912987af603..c7100b9dcede 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -724,8 +724,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
724 goto drop_unlock; 724 goto drop_unlock;
725 } 725 }
726 726
727 spin_unlock_irqrestore(&priv->lock, flags);
728
729 hdr_len = ieee80211_hdrlen(fc); 727 hdr_len = ieee80211_hdrlen(fc);
730 728
731 /* Find (or create) index into station table for destination station */ 729 /* Find (or create) index into station table for destination station */
@@ -733,7 +731,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
733 if (sta_id == IWL_INVALID_STATION) { 731 if (sta_id == IWL_INVALID_STATION) {
734 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 732 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
735 hdr->addr1); 733 hdr->addr1);
736 goto drop; 734 goto drop_unlock;
737 } 735 }
738 736
739 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); 737 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
@@ -751,14 +749,17 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
751 /* aggregation is on for this <sta,tid> */ 749 /* aggregation is on for this <sta,tid> */
752 if (info->flags & IEEE80211_TX_CTL_AMPDU) 750 if (info->flags & IEEE80211_TX_CTL_AMPDU)
753 txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; 751 txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
754 priv->stations[sta_id].tid[tid].tfds_in_queue++;
755 } 752 }
756 753
757 txq = &priv->txq[txq_id]; 754 txq = &priv->txq[txq_id];
758 swq_id = txq->swq_id; 755 swq_id = txq->swq_id;
759 q = &txq->q; 756 q = &txq->q;
760 757
761 spin_lock_irqsave(&priv->lock, flags); 758 if (unlikely(iwl_queue_space(q) < q->high_mark))
759 goto drop_unlock;
760
761 if (ieee80211_is_data_qos(fc))
762 priv->stations[sta_id].tid[tid].tfds_in_queue++;
762 763
763 /* Set up driver data for this TFD */ 764 /* Set up driver data for this TFD */
764 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); 765 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info));
@@ -903,7 +904,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
903 904
904drop_unlock: 905drop_unlock:
905 spin_unlock_irqrestore(&priv->lock, flags); 906 spin_unlock_irqrestore(&priv->lock, flags);
906drop:
907 return -1; 907 return -1;
908} 908}
909EXPORT_SYMBOL(iwl_tx_skb); 909EXPORT_SYMBOL(iwl_tx_skb);
@@ -1172,6 +1172,8 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn)
1172 IWL_ERR(priv, "Start AGG on invalid station\n"); 1172 IWL_ERR(priv, "Start AGG on invalid station\n");
1173 return -ENXIO; 1173 return -ENXIO;
1174 } 1174 }
1175 if (unlikely(tid >= MAX_TID_COUNT))
1176 return -EINVAL;
1175 1177
1176 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { 1178 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) {
1177 IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); 1179 IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n");