aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-01-05 09:52:55 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-01-22 10:54:02 -0500
commit0294d9eece86dbe9bde7b21b097825106e3a3b4f (patch)
tree545b9fe7e2fd25fd66a21568555637ae8ef68c1d /drivers/net/wireless/iwlwifi/mvm/utils.c
parent3cae0734af7c17976ecf4e99a0447168e7fdf4cc (diff)
iwlwifi: mvm: let the firmware configure the scheduler
A new host command can be used to configure the scheduler instead of accessing the scheduler's registers from the driver. This is easier and less error prone since accessing the hardware at certain moments can lead to races with the firmware. Prefer to use the host command whenever it is available. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/utils.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index f0a114102c3f..85effe269a2a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -533,47 +533,46 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
533void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, u16 ssn, 533void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, u16 ssn,
534 const struct iwl_trans_txq_scd_cfg *cfg) 534 const struct iwl_trans_txq_scd_cfg *cfg)
535{ 535{
536 if (iwl_mvm_is_dqa_supported(mvm)) { 536 struct iwl_scd_txq_cfg_cmd cmd = {
537 struct iwl_scd_txq_cfg_cmd cmd = { 537 .scd_queue = queue,
538 .scd_queue = queue, 538 .enable = 1,
539 .enable = 1, 539 .window = cfg->frame_limit,
540 .window = cfg->frame_limit, 540 .sta_id = cfg->sta_id,
541 .sta_id = cfg->sta_id, 541 .ssn = cpu_to_le16(ssn),
542 .ssn = cpu_to_le16(ssn), 542 .tx_fifo = cfg->fifo,
543 .tx_fifo = cfg->fifo, 543 .aggregate = cfg->aggregate,
544 .aggregate = cfg->aggregate, 544 .tid = cfg->tid,
545 .flags = IWL_SCD_FLAGS_DQA_ENABLED, 545 };
546 .tid = cfg->tid, 546
547 .control = IWL_SCD_CONTROL_SET_SSN, 547 if (!iwl_mvm_is_scd_cfg_supported(mvm)) {
548 }; 548 iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, cfg);
549 int ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, 549 return;
550 sizeof(cmd), &cmd);
551 if (ret)
552 IWL_ERR(mvm,
553 "Failed to configure queue %d on FIFO %d\n",
554 queue, cfg->fifo);
555 } 550 }
556 551
557 iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, 552 iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, NULL);
558 iwl_mvm_is_dqa_supported(mvm) ? NULL : cfg); 553 WARN(iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), &cmd),
554 "Failed to configure queue %d on FIFO %d\n", queue, cfg->fifo);
559} 555}
560 556
561void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue) 557void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, u8 flags)
562{ 558{
563 iwl_trans_txq_disable(mvm->trans, queue, 559 struct iwl_scd_txq_cfg_cmd cmd = {
564 !iwl_mvm_is_dqa_supported(mvm)); 560 .scd_queue = queue,
565 561 .enable = 0,
566 if (iwl_mvm_is_dqa_supported(mvm)) { 562 };
567 struct iwl_scd_txq_cfg_cmd cmd = { 563 int ret;
568 .scd_queue = queue, 564
569 .enable = 0, 565 if (!iwl_mvm_is_scd_cfg_supported(mvm)) {
570 }; 566 iwl_trans_txq_disable(mvm->trans, queue, true);
571 int ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, CMD_ASYNC, 567 return;
572 sizeof(cmd), &cmd);
573 if (ret)
574 IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n",
575 queue, ret);
576 } 568 }
569
570 iwl_trans_txq_disable(mvm->trans, queue, false);
571 ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, flags,
572 sizeof(cmd), &cmd);
573 if (ret)
574 IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n",
575 queue, ret);
577} 576}
578 577
579/** 578/**