aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorAvri Altman <avri.altman@intel.com>2014-07-30 04:41:01 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-16 05:57:50 -0400
commit3edf8ff6179dc470d53f3b88d4a778e241a73654 (patch)
tree79d47945de1c95ac543ae340db2920bbd3c2c6f3 /drivers/net/wireless/iwlwifi/mvm/utils.c
parent73897bd1d949d34b7a38a2cd14302d91f68ef12d (diff)
iwlwifi: mvm: prepare for scheduler config command
The scheduler is a HW sub-block that directs the work of the Flow Handler by issuing requests for frame transfers, specifying source and destination. Its primary function is to allocate flows into the TX FIFOs based upon a pre-determined mapping. The driver has some responsibilities to the scheduler, namely initialising and maintaining the hardware registers. This is currently done by directly accessing them, which can cause races with the firmware also accessing the registers. To address this problem, change the driver to no longer directly access the registers but go through the firmware for this if the firmware has support for DQA and thus the new command. Signed-off-by: Avri Altman <avri.altman@intel.com> Signed-off-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.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index 1958f298ac8b..8021f6eec27f 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -530,6 +530,52 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
530 iwl_mvm_dump_umac_error_log(mvm); 530 iwl_mvm_dump_umac_error_log(mvm);
531} 531}
532 532
533void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, u16 ssn,
534 const struct iwl_trans_txq_scd_cfg *cfg)
535{
536 if (iwl_mvm_is_dqa_supported(mvm)) {
537 struct iwl_scd_txq_cfg_cmd cmd = {
538 .scd_queue = queue,
539 .enable = 1,
540 .window = cfg->frame_limit,
541 .sta_id = cfg->sta_id,
542 .ssn = cpu_to_le16(ssn),
543 .tx_fifo = cfg->fifo,
544 .aggregate = cfg->aggregate,
545 .flags = IWL_SCD_FLAGS_DQA_ENABLED,
546 .tid = cfg->tid,
547 .control = IWL_SCD_CONTROL_SET_SSN,
548 };
549 int ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0,
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 }
556
557 iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn,
558 iwl_mvm_is_dqa_supported(mvm) ? NULL : cfg);
559}
560
561void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue)
562{
563 iwl_trans_txq_disable(mvm->trans, queue,
564 !iwl_mvm_is_dqa_supported(mvm));
565
566 if (iwl_mvm_is_dqa_supported(mvm)) {
567 struct iwl_scd_txq_cfg_cmd cmd = {
568 .scd_queue = queue,
569 .enable = 0,
570 };
571 int ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, CMD_ASYNC,
572 sizeof(cmd), &cmd);
573 if (ret)
574 IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n",
575 queue, ret);
576 }
577}
578
533/** 579/**
534 * iwl_mvm_send_lq_cmd() - Send link quality command 580 * iwl_mvm_send_lq_cmd() - Send link quality command
535 * @init: This command is sent as part of station initialization right 581 * @init: This command is sent as part of station initialization right