diff options
author | Sara Sharon <sara.sharon@intel.com> | 2016-11-07 08:22:28 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-01-26 02:39:02 -0500 |
commit | cf90da352a329e755df923fd2c9e810cb75c83a9 (patch) | |
tree | 06d199ffbe62450743da43faebefb627216ca5b4 | |
parent | 758d1a8a8af04c70addb26761796019df267f420 (diff) |
iwlwifi: mvm: use mvm_disable_queue instead of sharing logic
When removing inactive queue - use the central disable queue
function. This is needed due to a000 changes to come, but is
a proper cleanup anyway.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 10 |
3 files changed, 16 insertions, 27 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 4a9cb76b7611..a672aa71c656 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
@@ -1657,8 +1657,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
1657 | * Disable a TXQ. | 1657 | * Disable a TXQ. |
1658 | * Note that in non-DQA mode the %mac80211_queue and %tid params are ignored. | 1658 | * Note that in non-DQA mode the %mac80211_queue and %tid params are ignored. |
1659 | */ | 1659 | */ |
1660 | void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | 1660 | int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, |
1661 | u8 tid, u8 flags); | 1661 | u8 tid, u8 flags); |
1662 | int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, u8 minq, u8 maxq); | 1662 | int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, u8 minq, u8 maxq); |
1663 | 1663 | ||
1664 | /* Return a bitmask with all the hw supported queues, except for the | 1664 | /* Return a bitmask with all the hw supported queues, except for the |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index cf8222a8b588..40e7fc5f1f1f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -454,13 +454,6 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) | |||
454 | 454 | ||
455 | rcu_read_unlock(); | 455 | rcu_read_unlock(); |
456 | 456 | ||
457 | spin_lock_bh(&mvm->queue_info_lock); | ||
458 | /* Unmap MAC queues and TIDs from this queue */ | ||
459 | mvm->queue_info[queue].hw_queue_to_mac80211 = 0; | ||
460 | mvm->queue_info[queue].hw_queue_refcount = 0; | ||
461 | mvm->queue_info[queue].tid_bitmap = 0; | ||
462 | spin_unlock_bh(&mvm->queue_info_lock); | ||
463 | |||
464 | return disable_agg_tids; | 457 | return disable_agg_tids; |
465 | } | 458 | } |
466 | 459 | ||
@@ -755,28 +748,22 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, | |||
755 | * first | 748 | * first |
756 | */ | 749 | */ |
757 | if (using_inactive_queue) { | 750 | if (using_inactive_queue) { |
758 | struct iwl_scd_txq_cfg_cmd cmd = { | 751 | u8 txq_curr_ac, sta_id; |
759 | .scd_queue = queue, | ||
760 | .action = SCD_CFG_DISABLE_QUEUE, | ||
761 | }; | ||
762 | u8 txq_curr_ac; | ||
763 | |||
764 | disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue); | ||
765 | 752 | ||
766 | spin_lock_bh(&mvm->queue_info_lock); | 753 | spin_lock_bh(&mvm->queue_info_lock); |
767 | txq_curr_ac = mvm->queue_info[queue].mac80211_ac; | 754 | txq_curr_ac = mvm->queue_info[queue].mac80211_ac; |
768 | cmd.sta_id = mvm->queue_info[queue].ra_sta_id; | 755 | sta_id = mvm->queue_info[queue].ra_sta_id; |
769 | cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[txq_curr_ac]; | ||
770 | cmd.tid = mvm->queue_info[queue].txq_tid; | ||
771 | spin_unlock_bh(&mvm->queue_info_lock); | 756 | spin_unlock_bh(&mvm->queue_info_lock); |
772 | 757 | ||
758 | disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue); | ||
773 | /* Disable the queue */ | 759 | /* Disable the queue */ |
774 | if (disable_agg_tids) | 760 | if (disable_agg_tids) |
775 | iwl_mvm_invalidate_sta_queue(mvm, queue, | 761 | iwl_mvm_invalidate_sta_queue(mvm, queue, |
776 | disable_agg_tids, false); | 762 | disable_agg_tids, false); |
777 | iwl_trans_txq_disable(mvm->trans, queue, false); | 763 | |
778 | ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), | 764 | ret = iwl_mvm_disable_txq(mvm, queue, |
779 | &cmd); | 765 | mvmsta->vif->hw_queue[txq_curr_ac], |
766 | tid, 0); | ||
780 | if (ret) { | 767 | if (ret) { |
781 | IWL_ERR(mvm, | 768 | IWL_ERR(mvm, |
782 | "Failed to free inactive queue %d (ret=%d)\n", | 769 | "Failed to free inactive queue %d (ret=%d)\n", |
@@ -791,7 +778,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, | |||
791 | } | 778 | } |
792 | 779 | ||
793 | /* If TXQ is allocated to another STA, update removal in FW */ | 780 | /* If TXQ is allocated to another STA, update removal in FW */ |
794 | if (cmd.sta_id != mvmsta->sta_id) | 781 | if (sta_id != mvmsta->sta_id) |
795 | iwl_mvm_invalidate_sta_queue(mvm, queue, 0, true); | 782 | iwl_mvm_invalidate_sta_queue(mvm, queue, 0, true); |
796 | } | 783 | } |
797 | 784 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index d04babd99b53..2beea3b98e52 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |||
@@ -706,8 +706,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
706 | } | 706 | } |
707 | } | 707 | } |
708 | 708 | ||
709 | void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | 709 | int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, |
710 | u8 tid, u8 flags) | 710 | u8 tid, u8 flags) |
711 | { | 711 | { |
712 | struct iwl_scd_txq_cfg_cmd cmd = { | 712 | struct iwl_scd_txq_cfg_cmd cmd = { |
713 | .scd_queue = queue, | 713 | .scd_queue = queue, |
@@ -720,7 +720,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
720 | 720 | ||
721 | if (WARN_ON(mvm->queue_info[queue].hw_queue_refcount == 0)) { | 721 | if (WARN_ON(mvm->queue_info[queue].hw_queue_refcount == 0)) { |
722 | spin_unlock_bh(&mvm->queue_info_lock); | 722 | spin_unlock_bh(&mvm->queue_info_lock); |
723 | return; | 723 | return 0; |
724 | } | 724 | } |
725 | 725 | ||
726 | mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); | 726 | mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); |
@@ -760,7 +760,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
760 | /* If the queue is still enabled - nothing left to do in this func */ | 760 | /* If the queue is still enabled - nothing left to do in this func */ |
761 | if (cmd.action == SCD_CFG_ENABLE_QUEUE) { | 761 | if (cmd.action == SCD_CFG_ENABLE_QUEUE) { |
762 | spin_unlock_bh(&mvm->queue_info_lock); | 762 | spin_unlock_bh(&mvm->queue_info_lock); |
763 | return; | 763 | return 0; |
764 | } | 764 | } |
765 | 765 | ||
766 | cmd.sta_id = mvm->queue_info[queue].ra_sta_id; | 766 | cmd.sta_id = mvm->queue_info[queue].ra_sta_id; |
@@ -791,6 +791,8 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, | |||
791 | if (ret) | 791 | if (ret) |
792 | IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n", | 792 | IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n", |
793 | queue, ret); | 793 | queue, ret); |
794 | |||
795 | return ret; | ||
794 | } | 796 | } |
795 | 797 | ||
796 | /** | 798 | /** |