diff options
author | Liad Kaufman <liad.kaufman@intel.com> | 2015-08-13 12:16:08 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-05-10 15:34:09 -0400 |
commit | cf961e16620f88686e0662753bd92d8383f36862 (patch) | |
tree | 1ea121d82600c6bef205956ea7e6d3e472259458 /drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |
parent | 192185d68dcc9b4517001fcec645111946f84d40 (diff) |
iwlwifi: mvm: support dqa-mode agg on non-shared queue
In non-shared queues, DQA requires re-configuring existing
queues to become aggregated rather than allocating a new
one. It also requires "un-aggregating" an existing queue
when aggregations are turned off.
Support this requirement for non-shared queues.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index eb41d3bd8059..161b99efd63d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |||
@@ -587,12 +587,45 @@ int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 minq, u8 maxq) | |||
587 | 587 | ||
588 | for (i = minq; i <= maxq; i++) | 588 | for (i = minq; i <= maxq; i++) |
589 | if (mvm->queue_info[i].hw_queue_refcount == 0 && | 589 | if (mvm->queue_info[i].hw_queue_refcount == 0 && |
590 | !mvm->queue_info[i].setup_reserved) | 590 | mvm->queue_info[i].status == IWL_MVM_QUEUE_FREE) |
591 | return i; | 591 | return i; |
592 | 592 | ||
593 | return -ENOSPC; | 593 | return -ENOSPC; |
594 | } | 594 | } |
595 | 595 | ||
596 | int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id, | ||
597 | int tid, int frame_limit, u16 ssn) | ||
598 | { | ||
599 | struct iwl_scd_txq_cfg_cmd cmd = { | ||
600 | .scd_queue = queue, | ||
601 | .enable = 1, | ||
602 | .window = frame_limit, | ||
603 | .sta_id = sta_id, | ||
604 | .ssn = cpu_to_le16(ssn), | ||
605 | .tx_fifo = fifo, | ||
606 | .aggregate = (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE || | ||
607 | queue == IWL_MVM_DQA_BSS_CLIENT_QUEUE), | ||
608 | .tid = tid, | ||
609 | }; | ||
610 | int ret; | ||
611 | |||
612 | spin_lock_bh(&mvm->queue_info_lock); | ||
613 | if (WARN(mvm->queue_info[queue].hw_queue_refcount == 0, | ||
614 | "Trying to reconfig unallocated queue %d\n", queue)) { | ||
615 | spin_unlock_bh(&mvm->queue_info_lock); | ||
616 | return -ENXIO; | ||
617 | } | ||
618 | spin_unlock_bh(&mvm->queue_info_lock); | ||
619 | |||
620 | IWL_DEBUG_TX_QUEUES(mvm, "Reconfig SCD for TXQ #%d\n", queue); | ||
621 | |||
622 | ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), &cmd); | ||
623 | WARN_ONCE(ret, "Failed to re-configure queue %d on FIFO %d, ret=%d\n", | ||
624 | queue, fifo, ret); | ||
625 | |||
626 | return ret; | ||
627 | } | ||
628 | |||
596 | void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | 629 | void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, |
597 | u16 ssn, const struct iwl_trans_txq_scd_cfg *cfg, | 630 | u16 ssn, const struct iwl_trans_txq_scd_cfg *cfg, |
598 | unsigned int wdg_timeout) | 631 | unsigned int wdg_timeout) |
@@ -688,6 +721,8 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
688 | mvm->queue_info[queue].hw_queue_refcount--; | 721 | mvm->queue_info[queue].hw_queue_refcount--; |
689 | 722 | ||
690 | cmd.enable = mvm->queue_info[queue].hw_queue_refcount ? 1 : 0; | 723 | cmd.enable = mvm->queue_info[queue].hw_queue_refcount ? 1 : 0; |
724 | if (!cmd.enable) | ||
725 | mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE; | ||
691 | 726 | ||
692 | IWL_DEBUG_TX_QUEUES(mvm, | 727 | IWL_DEBUG_TX_QUEUES(mvm, |
693 | "Disabling TXQ #%d refcount=%d (mac80211 map:0x%x)\n", | 728 | "Disabling TXQ #%d refcount=%d (mac80211 map:0x%x)\n", |