iwlwifi: trans: configure the scheduler enable register
authorAvri Altman <avri.altman@intel.com>
Thu, 24 Jul 2014 16:25:10 +0000 (19:25 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 3 Sep 2014 19:49:06 +0000 (22:49 +0300)
Currently the firmware is handling this, but that is wrong as it then
needs to assume a certain command queue, therefore this should be in
the driver; add it here so it can be removed from the firmware in the
future.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-prph.h
drivers/net/wireless/iwlwifi/iwl-scd.h
drivers/net/wireless/iwlwifi/pcie/tx.c

index 47033a35a40293f100312ede34bfc3a5b43c9efd..9e152734ed433761b00471eb3bc9df63c8d67279 100644 (file)
 #define SCD_CHAINEXT_EN                (SCD_BASE + 0x244)
 #define SCD_AGGR_SEL           (SCD_BASE + 0x248)
 #define SCD_INTERRUPT_MASK     (SCD_BASE + 0x108)
+#define SCD_EN_CTRL            (SCD_BASE + 0x254)
 
 static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl)
 {
index 5f099d45c09a703bcf276ef259e18f7be87d35b8..6c622b21bba71d5b6abcc882a17ebd8ba6d664ea 100644 (file)
@@ -109,4 +109,10 @@ static inline void iwl_scd_deactivate_fifos(struct iwl_trans *trans)
 {
        iwl_write_prph(trans, SCD_TXFACT, 0);
 }
+
+static inline void iwl_scd_enable_set_active(struct iwl_trans *trans,
+                                            u32 value)
+{
+       iwl_write_prph(trans, SCD_EN_CTRL, value);
+}
 #endif
index a24c1df2b1b54a5f9db21ac788b470325379dc92..9fdfed8fcd8f05538bfe5058a8e57fd0e3a29150 100644 (file)
@@ -1078,6 +1078,10 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, u16 ssn,
        if (cfg) {
                fifo = cfg->fifo;
 
+               /* Disable the scheduler prior configuring the cmd queue */
+               if (txq_id == trans_pcie->cmd_queue)
+                       iwl_scd_enable_set_active(trans, 0);
+
                /* Stop this Tx queue before configuring it */
                iwl_scd_txq_set_inactive(trans, txq_id);
 
@@ -1135,6 +1139,10 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, u16 ssn,
                               (cfg->fifo << SCD_QUEUE_STTS_REG_POS_TXF) |
                               (1 << SCD_QUEUE_STTS_REG_POS_WSL) |
                               SCD_QUEUE_STTS_REG_MSK);
+
+               /* enable the scheduler for this queue (only) */
+               if (txq_id == trans_pcie->cmd_queue)
+                       iwl_scd_enable_set_active(trans, BIT(txq_id));
        }
 
        trans_pcie->txq[txq_id].active = true;
This page took 0.049654 seconds and 5 git commands to generate.