Commit f9477c17 authored by Amnon Paz's avatar Amnon Paz Committed by Johannes Berg

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: default avatarAmnon Paz <amnonX.paz@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 490953ac
...@@ -715,7 +715,8 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) ...@@ -715,7 +715,8 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs)
static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) 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)); iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR,
((reg & 0x000FFFFF) | (3 << 24)));
return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT);
} }
...@@ -723,7 +724,7 @@ static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, ...@@ -723,7 +724,7 @@ static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr,
u32 val) u32 val)
{ {
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24))); ((addr & 0x000FFFFF) | (3 << 24)));
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment