Skip to content

Commit

Permalink
iwlwifi: fix indirect write bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amnon Paz authored and Johannes Berg committed Mar 6, 2013
1 parent 490953a commit f9477c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/iwlwifi/pcie/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,16 @@ 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)
{
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);
}

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)));
((addr & 0x000FFFFF) | (3 << 24)));
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
}

Expand Down

0 comments on commit f9477c1

Please sign in to comment.