diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-08-26 02:11:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 15:30:31 -0400 |
commit | fd656935cd05f522d7db97386633f6a0d7751218 (patch) | |
tree | c4633b2033c45e85f759789602116c84757f0dd5 /drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | |
parent | 5f85a7890cbfd2be8f4c6620b2a6774d6b5ac647 (diff) |
iwlagn: remove dereferences of priv from transport
There are still quite a few, but much less.
A few fields have been moved /copied to hw_params which sits in the
shared area:
* priv->cfg->base_params->num_of_ampdu_queues
* priv->cfg->base_params->shadow_reg_enable
* priv->cfg->sku
* priv->ucode_owner
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c index 9f4ffebfa56d..8c18a7545afd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | |||
@@ -86,7 +86,7 @@ void iwl_trans_txq_update_byte_cnt_tbl(struct iwl_trans *trans, | |||
86 | /** | 86 | /** |
87 | * iwl_txq_update_write_ptr - Send new write index to hardware | 87 | * iwl_txq_update_write_ptr - Send new write index to hardware |
88 | */ | 88 | */ |
89 | void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq) | 89 | void iwl_txq_update_write_ptr(struct iwl_trans *trans, struct iwl_tx_queue *txq) |
90 | { | 90 | { |
91 | u32 reg = 0; | 91 | u32 reg = 0; |
92 | int txq_id = txq->q.id; | 92 | int txq_id = txq->q.id; |
@@ -94,28 +94,28 @@ void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq) | |||
94 | if (txq->need_update == 0) | 94 | if (txq->need_update == 0) |
95 | return; | 95 | return; |
96 | 96 | ||
97 | if (priv->cfg->base_params->shadow_reg_enable) { | 97 | if (hw_params(trans).shadow_reg_enable) { |
98 | /* shadow register enabled */ | 98 | /* shadow register enabled */ |
99 | iwl_write32(bus(priv), HBUS_TARG_WRPTR, | 99 | iwl_write32(bus(trans), HBUS_TARG_WRPTR, |
100 | txq->q.write_ptr | (txq_id << 8)); | 100 | txq->q.write_ptr | (txq_id << 8)); |
101 | } else { | 101 | } else { |
102 | /* if we're trying to save power */ | 102 | /* if we're trying to save power */ |
103 | if (test_bit(STATUS_POWER_PMI, &priv->shrd->status)) { | 103 | if (test_bit(STATUS_POWER_PMI, &trans->shrd->status)) { |
104 | /* wake up nic if it's powered down ... | 104 | /* wake up nic if it's powered down ... |
105 | * uCode will wake up, and interrupt us again, so next | 105 | * uCode will wake up, and interrupt us again, so next |
106 | * time we'll skip this part. */ | 106 | * time we'll skip this part. */ |
107 | reg = iwl_read32(bus(priv), CSR_UCODE_DRV_GP1); | 107 | reg = iwl_read32(bus(trans), CSR_UCODE_DRV_GP1); |
108 | 108 | ||
109 | if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { | 109 | if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { |
110 | IWL_DEBUG_INFO(priv, | 110 | IWL_DEBUG_INFO(trans, |
111 | "Tx queue %d requesting wakeup," | 111 | "Tx queue %d requesting wakeup," |
112 | " GP1 = 0x%x\n", txq_id, reg); | 112 | " GP1 = 0x%x\n", txq_id, reg); |
113 | iwl_set_bit(bus(priv), CSR_GP_CNTRL, | 113 | iwl_set_bit(bus(trans), CSR_GP_CNTRL, |
114 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | 114 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); |
115 | return; | 115 | return; |
116 | } | 116 | } |
117 | 117 | ||
118 | iwl_write_direct32(bus(priv), HBUS_TARG_WRPTR, | 118 | iwl_write_direct32(bus(trans), HBUS_TARG_WRPTR, |
119 | txq->q.write_ptr | (txq_id << 8)); | 119 | txq->q.write_ptr | (txq_id << 8)); |
120 | 120 | ||
121 | /* | 121 | /* |
@@ -124,7 +124,7 @@ void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq) | |||
124 | * trying to tx (during RFKILL, we're not trying to tx). | 124 | * trying to tx (during RFKILL, we're not trying to tx). |
125 | */ | 125 | */ |
126 | } else | 126 | } else |
127 | iwl_write32(bus(priv), HBUS_TARG_WRPTR, | 127 | iwl_write32(bus(trans), HBUS_TARG_WRPTR, |
128 | txq->q.write_ptr | (txq_id << 8)); | 128 | txq->q.write_ptr | (txq_id << 8)); |
129 | } | 129 | } |
130 | txq->need_update = 0; | 130 | txq->need_update = 0; |
@@ -498,12 +498,12 @@ int iwl_trans_pcie_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, | |||
498 | struct iwl_trans *trans = trans(priv); | 498 | struct iwl_trans *trans = trans(priv); |
499 | if ((IWLAGN_FIRST_AMPDU_QUEUE > txq_id) || | 499 | if ((IWLAGN_FIRST_AMPDU_QUEUE > txq_id) || |
500 | (IWLAGN_FIRST_AMPDU_QUEUE + | 500 | (IWLAGN_FIRST_AMPDU_QUEUE + |
501 | priv->cfg->base_params->num_of_ampdu_queues <= txq_id)) { | 501 | hw_params(priv).num_ampdu_queues <= txq_id)) { |
502 | IWL_ERR(priv, | 502 | IWL_ERR(priv, |
503 | "queue number out of range: %d, must be %d to %d\n", | 503 | "queue number out of range: %d, must be %d to %d\n", |
504 | txq_id, IWLAGN_FIRST_AMPDU_QUEUE, | 504 | txq_id, IWLAGN_FIRST_AMPDU_QUEUE, |
505 | IWLAGN_FIRST_AMPDU_QUEUE + | 505 | IWLAGN_FIRST_AMPDU_QUEUE + |
506 | priv->cfg->base_params->num_of_ampdu_queues - 1); | 506 | hw_params(priv).num_ampdu_queues - 1); |
507 | return -EINVAL; | 507 | return -EINVAL; |
508 | } | 508 | } |
509 | 509 | ||
@@ -536,8 +536,7 @@ int iwl_trans_pcie_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, | |||
536 | */ | 536 | */ |
537 | static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | 537 | static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) |
538 | { | 538 | { |
539 | struct iwl_priv *priv = priv(trans); | 539 | struct iwl_tx_queue *txq = &priv(trans)->txq[trans->shrd->cmd_queue]; |
540 | struct iwl_tx_queue *txq = &priv->txq[priv->shrd->cmd_queue]; | ||
541 | struct iwl_queue *q = &txq->q; | 540 | struct iwl_queue *q = &txq->q; |
542 | struct iwl_device_cmd *out_cmd; | 541 | struct iwl_device_cmd *out_cmd; |
543 | struct iwl_cmd_meta *out_meta; | 542 | struct iwl_cmd_meta *out_meta; |
@@ -560,7 +559,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
560 | return -EIO; | 559 | return -EIO; |
561 | } | 560 | } |
562 | 561 | ||
563 | if ((priv->ucode_owner == IWL_OWNERSHIP_TM) && | 562 | if ((trans->shrd->ucode_owner == IWL_OWNERSHIP_TM) && |
564 | !(cmd->flags & CMD_ON_DEMAND)) { | 563 | !(cmd->flags & CMD_ON_DEMAND)) { |
565 | IWL_DEBUG_HC(trans, "tm own the uCode, no regular hcmd send\n"); | 564 | IWL_DEBUG_HC(trans, "tm own the uCode, no regular hcmd send\n"); |
566 | return -EIO; | 565 | return -EIO; |
@@ -607,10 +606,10 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
607 | spin_unlock_irqrestore(&trans->hcmd_lock, flags); | 606 | spin_unlock_irqrestore(&trans->hcmd_lock, flags); |
608 | 607 | ||
609 | IWL_ERR(trans, "No space in command queue\n"); | 608 | IWL_ERR(trans, "No space in command queue\n"); |
610 | is_ct_kill = iwl_check_for_ct_kill(priv); | 609 | is_ct_kill = iwl_check_for_ct_kill(priv(trans)); |
611 | if (!is_ct_kill) { | 610 | if (!is_ct_kill) { |
612 | IWL_ERR(trans, "Restarting adapter queue is full\n"); | 611 | IWL_ERR(trans, "Restarting adapter queue is full\n"); |
613 | iwlagn_fw_error(priv, false); | 612 | iwlagn_fw_error(priv(trans), false); |
614 | } | 613 | } |
615 | return -ENOSPC; | 614 | return -ENOSPC; |
616 | } | 615 | } |
@@ -702,7 +701,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
702 | /* check that tracing gets all possible blocks */ | 701 | /* check that tracing gets all possible blocks */ |
703 | BUILD_BUG_ON(IWL_MAX_CMD_TFDS + 1 != 3); | 702 | BUILD_BUG_ON(IWL_MAX_CMD_TFDS + 1 != 3); |
704 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | 703 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING |
705 | trace_iwlwifi_dev_hcmd(priv, cmd->flags, | 704 | trace_iwlwifi_dev_hcmd(priv(trans), cmd->flags, |
706 | trace_bufs[0], trace_lens[0], | 705 | trace_bufs[0], trace_lens[0], |
707 | trace_bufs[1], trace_lens[1], | 706 | trace_bufs[1], trace_lens[1], |
708 | trace_bufs[2], trace_lens[2]); | 707 | trace_bufs[2], trace_lens[2]); |
@@ -710,7 +709,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
710 | 709 | ||
711 | /* Increment and update queue's write index */ | 710 | /* Increment and update queue's write index */ |
712 | q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); | 711 | q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); |
713 | iwl_txq_update_write_ptr(priv, txq); | 712 | iwl_txq_update_write_ptr(trans, txq); |
714 | 713 | ||
715 | out: | 714 | out: |
716 | spin_unlock_irqrestore(&trans->hcmd_lock, flags); | 715 | spin_unlock_irqrestore(&trans->hcmd_lock, flags); |