diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 71d5b8a1a73e..85ae7a62109c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -102,13 +102,8 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq) | |||
102 | return ret; | 102 | return ret; |
103 | } | 103 | } |
104 | 104 | ||
105 | /* restore this queue's parameters in nic hardware. */ | ||
106 | ret = iwl_grab_nic_access(priv); | ||
107 | if (ret) | ||
108 | return ret; | ||
109 | iwl_write_direct32(priv, HBUS_TARG_WRPTR, | 105 | iwl_write_direct32(priv, HBUS_TARG_WRPTR, |
110 | txq->q.write_ptr | (txq_id << 8)); | 106 | txq->q.write_ptr | (txq_id << 8)); |
111 | iwl_release_nic_access(priv); | ||
112 | 107 | ||
113 | /* else not in power-save mode, uCode will never sleep when we're | 108 | /* else not in power-save mode, uCode will never sleep when we're |
114 | * trying to tx (during RFKILL, we're not trying to tx). */ | 109 | * trying to tx (during RFKILL, we're not trying to tx). */ |
@@ -429,11 +424,6 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv) | |||
429 | goto error_kw; | 424 | goto error_kw; |
430 | } | 425 | } |
431 | spin_lock_irqsave(&priv->lock, flags); | 426 | spin_lock_irqsave(&priv->lock, flags); |
432 | ret = iwl_grab_nic_access(priv); | ||
433 | if (unlikely(ret)) { | ||
434 | spin_unlock_irqrestore(&priv->lock, flags); | ||
435 | goto error_reset; | ||
436 | } | ||
437 | 427 | ||
438 | /* Turn off all Tx DMA fifos */ | 428 | /* Turn off all Tx DMA fifos */ |
439 | priv->cfg->ops->lib->txq_set_sched(priv, 0); | 429 | priv->cfg->ops->lib->txq_set_sched(priv, 0); |
@@ -441,7 +431,6 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv) | |||
441 | /* Tell NIC where to find the "keep warm" buffer */ | 431 | /* Tell NIC where to find the "keep warm" buffer */ |
442 | iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, priv->kw.dma >> 4); | 432 | iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, priv->kw.dma >> 4); |
443 | 433 | ||
444 | iwl_release_nic_access(priv); | ||
445 | spin_unlock_irqrestore(&priv->lock, flags); | 434 | spin_unlock_irqrestore(&priv->lock, flags); |
446 | 435 | ||
447 | /* Alloc and init all Tx queues, including the command queue (#4) */ | 436 | /* Alloc and init all Tx queues, including the command queue (#4) */ |
@@ -460,7 +449,6 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv) | |||
460 | 449 | ||
461 | error: | 450 | error: |
462 | iwl_hw_txq_ctx_free(priv); | 451 | iwl_hw_txq_ctx_free(priv); |
463 | error_reset: | ||
464 | iwl_free_dma_ptr(priv, &priv->kw); | 452 | iwl_free_dma_ptr(priv, &priv->kw); |
465 | error_kw: | 453 | error_kw: |
466 | iwl_free_dma_ptr(priv, &priv->scd_bc_tbls); | 454 | iwl_free_dma_ptr(priv, &priv->scd_bc_tbls); |
@@ -478,10 +466,6 @@ void iwl_txq_ctx_stop(struct iwl_priv *priv) | |||
478 | 466 | ||
479 | /* Turn off all Tx DMA fifos */ | 467 | /* Turn off all Tx DMA fifos */ |
480 | spin_lock_irqsave(&priv->lock, flags); | 468 | spin_lock_irqsave(&priv->lock, flags); |
481 | if (iwl_grab_nic_access(priv)) { | ||
482 | spin_unlock_irqrestore(&priv->lock, flags); | ||
483 | return; | ||
484 | } | ||
485 | 469 | ||
486 | priv->cfg->ops->lib->txq_set_sched(priv, 0); | 470 | priv->cfg->ops->lib->txq_set_sched(priv, 0); |
487 | 471 | ||
@@ -492,7 +476,6 @@ void iwl_txq_ctx_stop(struct iwl_priv *priv) | |||
492 | FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch), | 476 | FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch), |
493 | 1000); | 477 | 1000); |
494 | } | 478 | } |
495 | iwl_release_nic_access(priv); | ||
496 | spin_unlock_irqrestore(&priv->lock, flags); | 479 | spin_unlock_irqrestore(&priv->lock, flags); |
497 | 480 | ||
498 | /* Deallocate memory for all Tx queues */ | 481 | /* Deallocate memory for all Tx queues */ |
@@ -728,7 +711,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
728 | 711 | ||
729 | /* drop all data frame if we are not associated */ | 712 | /* drop all data frame if we are not associated */ |
730 | if (ieee80211_is_data(fc) && | 713 | if (ieee80211_is_data(fc) && |
731 | (priv->iw_mode != NL80211_IFTYPE_MONITOR || | 714 | (!iwl_is_monitor_mode(priv) || |
732 | !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ | 715 | !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ |
733 | (!iwl_is_associated(priv) || | 716 | (!iwl_is_associated(priv) || |
734 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || | 717 | ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || |
@@ -1183,8 +1166,10 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
1183 | __func__, ra, tid); | 1166 | __func__, ra, tid); |
1184 | 1167 | ||
1185 | sta_id = iwl_find_station(priv, ra); | 1168 | sta_id = iwl_find_station(priv, ra); |
1186 | if (sta_id == IWL_INVALID_STATION) | 1169 | if (sta_id == IWL_INVALID_STATION) { |
1170 | IWL_ERR(priv, "Start AGG on invalid station\n"); | ||
1187 | return -ENXIO; | 1171 | return -ENXIO; |
1172 | } | ||
1188 | 1173 | ||
1189 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { | 1174 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { |
1190 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); | 1175 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); |
@@ -1192,8 +1177,10 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
1192 | } | 1177 | } |
1193 | 1178 | ||
1194 | txq_id = iwl_txq_ctx_activate_free(priv); | 1179 | txq_id = iwl_txq_ctx_activate_free(priv); |
1195 | if (txq_id == -1) | 1180 | if (txq_id == -1) { |
1181 | IWL_ERR(priv, "No free aggregation queue available\n"); | ||
1196 | return -ENXIO; | 1182 | return -ENXIO; |
1183 | } | ||
1197 | 1184 | ||
1198 | spin_lock_irqsave(&priv->sta_lock, flags); | 1185 | spin_lock_irqsave(&priv->sta_lock, flags); |
1199 | tid_data = &priv->stations[sta_id].tid[tid]; | 1186 | tid_data = &priv->stations[sta_id].tid[tid]; |
@@ -1207,7 +1194,7 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
1207 | return ret; | 1194 | return ret; |
1208 | 1195 | ||
1209 | if (tid_data->tfds_in_queue == 0) { | 1196 | if (tid_data->tfds_in_queue == 0) { |
1210 | IWL_ERR(priv, "HW queue is empty\n"); | 1197 | IWL_DEBUG_HT(priv, "HW queue is empty\n"); |
1211 | tid_data->agg.state = IWL_AGG_ON; | 1198 | tid_data->agg.state = IWL_AGG_ON; |
1212 | ieee80211_start_tx_ba_cb_irqsafe(priv->hw, ra, tid); | 1199 | ieee80211_start_tx_ba_cb_irqsafe(priv->hw, ra, tid); |
1213 | } else { | 1200 | } else { |