aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/pcie/trans.c
diff options
context:
space:
mode:
authorAmnon Paz <amnonX.paz@intel.com>2013-02-27 04:28:16 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 10:48:02 -0500
commitf9477c17c2ce59f64462635c3e5d43c98c0ad67f (patch)
tree7fa7e589ad0e60efecab8b0b5bfba4af497127a2 /drivers/net/wireless/iwlwifi/pcie/trans.c
parent490953ac344725f56746d16ef8480842f4087fc4 (diff)
iwlwifi: fix indirect write bug
Fix a bug in writing to indirect (periphery) registers; although writes seem successful the data is not written to the desired address). Also fix address mask for HBUS_TARG_PRPH_RADDR and HBUS_TARG_PRPH_WADDR registers. Signed-off-by: Amnon Paz <amnonX.paz@intel.com> Reviewed-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index d17fb4bd3efb..6649e377e9cd 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -715,7 +715,8 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs)
715 715
716static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) 716static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg)
717{ 717{
718 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 718 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR,
719 ((reg & 0x000FFFFF) | (3 << 24)));
719 return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); 720 return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT);
720} 721}
721 722
@@ -723,7 +724,7 @@ static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr,
723 u32 val) 724 u32 val)
724{ 725{
725 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, 726 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR,
726 ((addr & 0x0000FFFF) | (3 << 24))); 727 ((addr & 0x000FFFFF) | (3 << 24)));
727 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); 728 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
728} 729}
729 730