diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 85ae7a62109c..2e89040e63be 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
| @@ -720,8 +720,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
| 720 | goto drop_unlock; | 720 | goto drop_unlock; |
| 721 | } | 721 | } |
| 722 | 722 | ||
| 723 | spin_unlock_irqrestore(&priv->lock, flags); | ||
| 724 | |||
| 725 | hdr_len = ieee80211_hdrlen(fc); | 723 | hdr_len = ieee80211_hdrlen(fc); |
| 726 | 724 | ||
| 727 | /* Find (or create) index into station table for destination station */ | 725 | /* Find (or create) index into station table for destination station */ |
| @@ -729,7 +727,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
| 729 | if (sta_id == IWL_INVALID_STATION) { | 727 | if (sta_id == IWL_INVALID_STATION) { |
| 730 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", | 728 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", |
| 731 | hdr->addr1); | 729 | hdr->addr1); |
| 732 | goto drop; | 730 | goto drop_unlock; |
| 733 | } | 731 | } |
| 734 | 732 | ||
| 735 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); | 733 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); |
| @@ -750,14 +748,17 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
| 750 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; | 748 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; |
| 751 | swq_id = iwl_virtual_agg_queue_num(swq_id, txq_id); | 749 | swq_id = iwl_virtual_agg_queue_num(swq_id, txq_id); |
| 752 | } | 750 | } |
| 753 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | ||
| 754 | } | 751 | } |
| 755 | 752 | ||
| 756 | txq = &priv->txq[txq_id]; | 753 | txq = &priv->txq[txq_id]; |
| 757 | q = &txq->q; | 754 | q = &txq->q; |
| 758 | txq->swq_id = swq_id; | 755 | txq->swq_id = swq_id; |
| 759 | 756 | ||
| 760 | spin_lock_irqsave(&priv->lock, flags); | 757 | if (unlikely(iwl_queue_space(q) < q->high_mark)) |
| 758 | goto drop_unlock; | ||
| 759 | |||
| 760 | if (ieee80211_is_data_qos(fc)) | ||
| 761 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | ||
| 761 | 762 | ||
| 762 | /* Set up driver data for this TFD */ | 763 | /* Set up driver data for this TFD */ |
| 763 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); | 764 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); |
| @@ -872,7 +873,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
| 872 | iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); | 873 | iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); |
| 873 | 874 | ||
| 874 | /* Set up entry for this TFD in Tx byte-count array */ | 875 | /* Set up entry for this TFD in Tx byte-count array */ |
| 875 | priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, | 876 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
| 877 | priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, | ||
| 876 | le16_to_cpu(tx_cmd->len)); | 878 | le16_to_cpu(tx_cmd->len)); |
| 877 | 879 | ||
| 878 | pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, | 880 | pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, |
| @@ -901,7 +903,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
| 901 | 903 | ||
| 902 | drop_unlock: | 904 | drop_unlock: |
| 903 | spin_unlock_irqrestore(&priv->lock, flags); | 905 | spin_unlock_irqrestore(&priv->lock, flags); |
| 904 | drop: | ||
| 905 | return -1; | 906 | return -1; |
| 906 | } | 907 | } |
| 907 | EXPORT_SYMBOL(iwl_tx_skb); | 908 | EXPORT_SYMBOL(iwl_tx_skb); |
| @@ -1170,6 +1171,8 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
| 1170 | IWL_ERR(priv, "Start AGG on invalid station\n"); | 1171 | IWL_ERR(priv, "Start AGG on invalid station\n"); |
| 1171 | return -ENXIO; | 1172 | return -ENXIO; |
| 1172 | } | 1173 | } |
| 1174 | if (unlikely(tid >= MAX_TID_COUNT)) | ||
| 1175 | return -EINVAL; | ||
| 1173 | 1176 | ||
| 1174 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { | 1177 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { |
| 1175 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); | 1178 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); |
