Skip to content

Commit

Permalink
iwlwifi: trans: configure the scheduler enable register
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
  • Loading branch information
Avri Altman authored and egrumbach committed Sep 3, 2014
1 parent 64ba893 commit 002a9e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/iwlwifi/iwl-prph.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
#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)
{
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-scd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions drivers/net/wireless/iwlwifi/pcie/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 002a9e2

Please sign in to comment.