aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2016-02-03 04:05:41 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-03-02 02:01:18 -0500
commitb4f7a9d168d9f8204abf06d244a7938dd62b87b0 (patch)
tree8ba387fe407a4d9c4057e58084edc95802592118 /drivers/net/wireless/intel/iwlwifi/mvm/ops.c
parente27deb4583642d6c5b3cf18060e8239db1be9e59 (diff)
iwlwifi: mvm: support sw queue start/stop from mvm
Add a wrapper function to allow stopping SW queues from MVM as well. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/ops.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/ops.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 3760a094b932..e6d0adc07029 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -897,24 +897,17 @@ static void iwl_mvm_rx_mq(struct iwl_op_mode *op_mode,
897 iwl_mvm_rx_common(mvm, rxb, pkt); 897 iwl_mvm_rx_common(mvm, rxb, pkt);
898} 898}
899 899
900static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int queue) 900void iwl_mvm_stop_mac_queues(struct iwl_mvm *mvm, unsigned long mq)
901{ 901{
902 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
903 unsigned long mq;
904 int q; 902 int q;
905 903
906 spin_lock_bh(&mvm->queue_info_lock);
907 mq = mvm->queue_info[queue].hw_queue_to_mac80211;
908 spin_unlock_bh(&mvm->queue_info_lock);
909
910 if (WARN_ON_ONCE(!mq)) 904 if (WARN_ON_ONCE(!mq))
911 return; 905 return;
912 906
913 for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { 907 for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) {
914 if (atomic_inc_return(&mvm->mac80211_queue_stop_count[q]) > 1) { 908 if (atomic_inc_return(&mvm->mac80211_queue_stop_count[q]) > 1) {
915 IWL_DEBUG_TX_QUEUES(mvm, 909 IWL_DEBUG_TX_QUEUES(mvm,
916 "queue %d (mac80211 %d) already stopped\n", 910 "mac80211 %d already stopped\n", q);
917 queue, q);
918 continue; 911 continue;
919 } 912 }
920 913
@@ -934,24 +927,29 @@ static void iwl_mvm_async_cb(struct iwl_op_mode *op_mode,
934 iwl_trans_block_txq_ptrs(mvm->trans, false); 927 iwl_trans_block_txq_ptrs(mvm->trans, false);
935} 928}
936 929
937static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int queue) 930static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int hw_queue)
938{ 931{
939 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); 932 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
940 unsigned long mq; 933 unsigned long mq;
941 int q;
942 934
943 spin_lock_bh(&mvm->queue_info_lock); 935 spin_lock_bh(&mvm->queue_info_lock);
944 mq = mvm->queue_info[queue].hw_queue_to_mac80211; 936 mq = mvm->queue_info[hw_queue].hw_queue_to_mac80211;
945 spin_unlock_bh(&mvm->queue_info_lock); 937 spin_unlock_bh(&mvm->queue_info_lock);
946 938
939 iwl_mvm_stop_mac_queues(mvm, mq);
940}
941
942void iwl_mvm_start_mac_queues(struct iwl_mvm *mvm, unsigned long mq)
943{
944 int q;
945
947 if (WARN_ON_ONCE(!mq)) 946 if (WARN_ON_ONCE(!mq))
948 return; 947 return;
949 948
950 for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { 949 for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) {
951 if (atomic_dec_return(&mvm->mac80211_queue_stop_count[q]) > 0) { 950 if (atomic_dec_return(&mvm->mac80211_queue_stop_count[q]) > 0) {
952 IWL_DEBUG_TX_QUEUES(mvm, 951 IWL_DEBUG_TX_QUEUES(mvm,
953 "queue %d (mac80211 %d) still stopped\n", 952 "mac80211 %d still stopped\n", q);
954 queue, q);
955 continue; 953 continue;
956 } 954 }
957 955
@@ -959,6 +957,18 @@ static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int queue)
959 } 957 }
960} 958}
961 959
960static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int hw_queue)
961{
962 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
963 unsigned long mq;
964
965 spin_lock_bh(&mvm->queue_info_lock);
966 mq = mvm->queue_info[hw_queue].hw_queue_to_mac80211;
967 spin_unlock_bh(&mvm->queue_info_lock);
968
969 iwl_mvm_start_mac_queues(mvm, mq);
970}
971
962void iwl_mvm_set_hw_ctkill_state(struct iwl_mvm *mvm, bool state) 972void iwl_mvm_set_hw_ctkill_state(struct iwl_mvm *mvm, bool state)
963{ 973{
964 if (state) 974 if (state)