diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-12-02 06:07:30 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-12-06 16:24:03 -0500 |
commit | 6a06b6c131d529f2913513355dd9e7c4e05e8e42 (patch) | |
tree | 5880c6e9837014f16bb5b8cfe0018991aecc0a4f /drivers/net/wireless/iwlwifi/pcie/trans.c | |
parent | b7998c8b4459deff3ea9c939e90812439423ab89 (diff) |
iwlwifi: move prph handling into the transport
New transports may handle it internally for better performance.
Also move the tracing inside PRPH access which will make the
output more readable:
iwlwifi_dev_ioread_prph32: Read 0x0 from SCD_AGGR_SEL (32-bit)
instead of the corresponding accesses to HBUS_TARG_PRPH_*.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/trans.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 9f317b016df8..09d2ed1e8020 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -668,6 +668,20 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) | |||
668 | return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); | 668 | return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); |
669 | } | 669 | } |
670 | 670 | ||
671 | static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) | ||
672 | { | ||
673 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); | ||
674 | return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); | ||
675 | } | ||
676 | |||
677 | static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, | ||
678 | u32 val) | ||
679 | { | ||
680 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, | ||
681 | ((addr & 0x0000FFFF) | (3 << 24))); | ||
682 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); | ||
683 | } | ||
684 | |||
671 | static void iwl_trans_pcie_configure(struct iwl_trans *trans, | 685 | static void iwl_trans_pcie_configure(struct iwl_trans *trans, |
672 | const struct iwl_trans_config *trans_cfg) | 686 | const struct iwl_trans_config *trans_cfg) |
673 | { | 687 | { |
@@ -1223,6 +1237,8 @@ static const struct iwl_trans_ops trans_ops_pcie = { | |||
1223 | .write8 = iwl_trans_pcie_write8, | 1237 | .write8 = iwl_trans_pcie_write8, |
1224 | .write32 = iwl_trans_pcie_write32, | 1238 | .write32 = iwl_trans_pcie_write32, |
1225 | .read32 = iwl_trans_pcie_read32, | 1239 | .read32 = iwl_trans_pcie_read32, |
1240 | .read_prph = iwl_trans_pcie_read_prph, | ||
1241 | .write_prph = iwl_trans_pcie_write_prph, | ||
1226 | .configure = iwl_trans_pcie_configure, | 1242 | .configure = iwl_trans_pcie_configure, |
1227 | .set_pmi = iwl_trans_pcie_set_pmi, | 1243 | .set_pmi = iwl_trans_pcie_set_pmi, |
1228 | }; | 1244 | }; |