diff options
author | Sara Sharon <sara.sharon@intel.com> | 2018-05-30 14:19:56 +0200 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-09-28 07:57:23 +0200 |
commit | 84fb372c892e231e9a2ffdaa5c2df52d94aa536c (patch) | |
tree | bc02cbbdef86085e6db199351464fc3c6ff49c06 /drivers | |
parent | iwlwifi: mvm: enable sending HE_AIR_SNIFFER command via debugfs (diff) | |
download | linux-84fb372c892e231e9a2ffdaa5c2df52d94aa536c.tar.xz linux-84fb372c892e231e9a2ffdaa5c2df52d94aa536c.zip |
iwlwifi: pcie: read correct prph address for newer devices
For newer devices we have higher range of periphery
addresses. Currently it is masked out, so we end up
reading another address.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 93c336ebfa40..ab0a5a663a6d 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -1805,18 +1805,30 @@ 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_prph_msk(struct iwl_trans *trans) +{ + if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) + return 0x00FFFFFF; + else + return 0x000FFFFF; +} + static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) { + u32 mask = iwl_trans_pcie_prph_msk(trans); + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, - ((reg & 0x000FFFFF) | (3 << 24))); + ((reg & mask) | (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) { + u32 mask = iwl_trans_pcie_prph_msk(trans); + iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, - ((addr & 0x000FFFFF) | (3 << 24))); + ((addr & mask) | (3 << 24))); iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); } |