aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2016-03-08 03:41:32 -0500
committerLuca Coelho <luciano.coelho@intel.com>2016-08-30 07:16:36 -0400
commitf7c692deef19ea953e3f792cc1c148dfcc74ba17 (patch)
tree80c2fc6cd7c26171f70a34c2da671f153c3bee66
parent8d98ae6eb0d51f75a7af51758072558ffbb8270f (diff)
iwlwifi: mvm: use defines for SCD_CONFIG_CMD enablement
Due to the addition of another option in the SCD_CONFIG_CMD's %enable field, change the assignment of this field to use defines rather than hard-code the value itself. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h12
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/sta.c4
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/utils.c13
3 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
index 4144623e1616..6b4c63a5e625 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
@@ -675,13 +675,21 @@ static inline u32 iwl_mvm_get_scd_ssn(struct iwl_mvm_tx_resp *tx_resp)
675 tx_resp->frame_count) & 0xfff; 675 tx_resp->frame_count) & 0xfff;
676} 676}
677 677
678/* Available options for the SCD_QUEUE_CFG HCMD */
679enum iwl_scd_cfg_actions {
680 SCD_CFG_DISABLE_QUEUE = 0x0,
681 SCD_CFG_ENABLE_QUEUE = 0x1,
682 SCD_CFG_UPDATE_QUEUE_TID = 0x2,
683};
684
678/** 685/**
679 * struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command 686 * struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command
680 * @token: 687 * @token:
681 * @sta_id: station id 688 * @sta_id: station id
682 * @tid: 689 * @tid:
683 * @scd_queue: scheduler queue to confiug 690 * @scd_queue: scheduler queue to confiug
684 * @enable: 1 queue enable, 0 queue disable 691 * @action: 1 queue enable, 0 queue disable, 2 change txq's tid owner
692 * Value is one of %iwl_scd_cfg_actions options
685 * @aggregate: 1 aggregated queue, 0 otherwise 693 * @aggregate: 1 aggregated queue, 0 otherwise
686 * @tx_fifo: %enum iwl_mvm_tx_fifo 694 * @tx_fifo: %enum iwl_mvm_tx_fifo
687 * @window: BA window size 695 * @window: BA window size
@@ -692,7 +700,7 @@ struct iwl_scd_txq_cfg_cmd {
692 u8 sta_id; 700 u8 sta_id;
693 u8 tid; 701 u8 tid;
694 u8 scd_queue; 702 u8 scd_queue;
695 u8 enable; 703 u8 action;
696 u8 aggregate; 704 u8 aggregate;
697 u8 tx_fifo; 705 u8 tx_fifo;
698 u8 window; 706 u8 window;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 1ddcbeacd5f4..e87473a29df2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -536,7 +536,7 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid,
536{ 536{
537 struct iwl_scd_txq_cfg_cmd cmd = { 537 struct iwl_scd_txq_cfg_cmd cmd = {
538 .scd_queue = queue, 538 .scd_queue = queue,
539 .enable = 0, 539 .action = SCD_CFG_DISABLE_QUEUE,
540 }; 540 };
541 bool shared_queue; 541 bool shared_queue;
542 unsigned long mq; 542 unsigned long mq;
@@ -745,7 +745,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
745 if (using_inactive_queue) { 745 if (using_inactive_queue) {
746 struct iwl_scd_txq_cfg_cmd cmd = { 746 struct iwl_scd_txq_cfg_cmd cmd = {
747 .scd_queue = queue, 747 .scd_queue = queue,
748 .enable = 0, 748 .action = SCD_CFG_DISABLE_QUEUE,
749 }; 749 };
750 u8 ac; 750 u8 ac;
751 751
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 423efab90607..7c138fedcb19 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -610,7 +610,7 @@ int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id,
610{ 610{
611 struct iwl_scd_txq_cfg_cmd cmd = { 611 struct iwl_scd_txq_cfg_cmd cmd = {
612 .scd_queue = queue, 612 .scd_queue = queue,
613 .enable = 1, 613 .action = SCD_CFG_ENABLE_QUEUE,
614 .window = frame_limit, 614 .window = frame_limit,
615 .sta_id = sta_id, 615 .sta_id = sta_id,
616 .ssn = cpu_to_le16(ssn), 616 .ssn = cpu_to_le16(ssn),
@@ -684,7 +684,7 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
684 if (enable_queue) { 684 if (enable_queue) {
685 struct iwl_scd_txq_cfg_cmd cmd = { 685 struct iwl_scd_txq_cfg_cmd cmd = {
686 .scd_queue = queue, 686 .scd_queue = queue,
687 .enable = 1, 687 .action = SCD_CFG_ENABLE_QUEUE,
688 .window = cfg->frame_limit, 688 .window = cfg->frame_limit,
689 .sta_id = cfg->sta_id, 689 .sta_id = cfg->sta_id,
690 .ssn = cpu_to_le16(ssn), 690 .ssn = cpu_to_le16(ssn),
@@ -711,7 +711,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
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,
714 .enable = 0, 714 .action = SCD_CFG_DISABLE_QUEUE,
715 }; 715 };
716 bool remove_mac_queue = true; 716 bool remove_mac_queue = true;
717 int ret; 717 int ret;
@@ -746,8 +746,9 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
746 ~BIT(mac80211_queue); 746 ~BIT(mac80211_queue);
747 mvm->queue_info[queue].hw_queue_refcount--; 747 mvm->queue_info[queue].hw_queue_refcount--;
748 748
749 cmd.enable = mvm->queue_info[queue].hw_queue_refcount ? 1 : 0; 749 cmd.action = mvm->queue_info[queue].hw_queue_refcount ?
750 if (!cmd.enable) 750 SCD_CFG_ENABLE_QUEUE : SCD_CFG_DISABLE_QUEUE;
751 if (cmd.action == SCD_CFG_DISABLE_QUEUE)
751 mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE; 752 mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE;
752 753
753 IWL_DEBUG_TX_QUEUES(mvm, 754 IWL_DEBUG_TX_QUEUES(mvm,
@@ -757,7 +758,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
757 mvm->queue_info[queue].hw_queue_to_mac80211); 758 mvm->queue_info[queue].hw_queue_to_mac80211);
758 759
759 /* 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 */
760 if (cmd.enable) { 761 if (cmd.action == SCD_CFG_ENABLE_QUEUE) {
761 spin_unlock_bh(&mvm->queue_info_lock); 762 spin_unlock_bh(&mvm->queue_info_lock);
762 return; 763 return;
763 } 764 }