diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-12-02 13:07:30 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-12-06 22:24:03 +0100 |
commit | 6a06b6c131d529f2913513355dd9e7c4e05e8e42 (patch) | |
tree | 5880c6e9837014f16bb5b8cfe0018991aecc0a4f /drivers/net/wireless/iwlwifi/pcie/trans.c | |
parent | b7998c8b4459deff3ea9c939e90812439423ab89 (diff) | |
download | op-kernel-dev-6a06b6c131d529f2913513355dd9e7c4e05e8e42.zip op-kernel-dev-6a06b6c131d529f2913513355dd9e7c4e05e8e42.tar.gz |
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 9f317b0..09d2ed1 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) return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); } +static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) +{ + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); + return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); +} + +static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, + u32 val) +{ + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, + ((addr & 0x0000FFFF) | (3 << 24))); + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); +} + static void iwl_trans_pcie_configure(struct iwl_trans *trans, const struct iwl_trans_config *trans_cfg) { @@ -1223,6 +1237,8 @@ static const struct iwl_trans_ops trans_ops_pcie = { .write8 = iwl_trans_pcie_write8, .write32 = iwl_trans_pcie_write32, .read32 = iwl_trans_pcie_read32, + .read_prph = iwl_trans_pcie_read_prph, + .write_prph = iwl_trans_pcie_write_prph, .configure = iwl_trans_pcie_configure, .set_pmi = iwl_trans_pcie_set_pmi, }; |