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/iwl-io.c | |
parent | b7998c8b4459deff3ea9c939e90812439423ab89 (diff) | |
download | blackbird-op-linux-6a06b6c131d529f2913513355dd9e7c4e05e8e42.tar.gz blackbird-op-linux-6a06b6c131d529f2913513355dd9e7c4e05e8e42.zip |
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/iwl-io.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-io.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.c b/drivers/net/wireless/iwlwifi/iwl-io.c index 54c41b44bffe..cdaff9572059 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.c +++ b/drivers/net/wireless/iwlwifi/iwl-io.c @@ -214,84 +214,84 @@ int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask, } EXPORT_SYMBOL_GPL(iwl_poll_direct_bit); -static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg) +static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs) { - iwl_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); - return iwl_read32(trans, HBUS_TARG_PRPH_RDAT); + u32 val = iwl_trans_read_prph(trans, ofs); + trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val); + return val; } -static inline void __iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) +static inline void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) { - iwl_write32(trans, HBUS_TARG_PRPH_WADDR, - ((addr & 0x0000FFFF) | (3 << 24))); - iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val); + trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val); + iwl_trans_write_prph(trans, ofs, val); } -u32 iwl_read_prph(struct iwl_trans *trans, u32 reg) +u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs) { unsigned long flags; u32 val; spin_lock_irqsave(&trans->reg_lock, flags); iwl_grab_nic_access(trans); - val = __iwl_read_prph(trans, reg); + val = __iwl_read_prph(trans, ofs); iwl_release_nic_access(trans); spin_unlock_irqrestore(&trans->reg_lock, flags); return val; } EXPORT_SYMBOL_GPL(iwl_read_prph); -void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) +void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) { unsigned long flags; spin_lock_irqsave(&trans->reg_lock, flags); if (likely(iwl_grab_nic_access(trans))) { - __iwl_write_prph(trans, addr, val); + __iwl_write_prph(trans, ofs, val); iwl_release_nic_access(trans); } spin_unlock_irqrestore(&trans->reg_lock, flags); } EXPORT_SYMBOL_GPL(iwl_write_prph); -void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) +void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) { unsigned long flags; spin_lock_irqsave(&trans->reg_lock, flags); if (likely(iwl_grab_nic_access(trans))) { - __iwl_write_prph(trans, reg, - __iwl_read_prph(trans, reg) | mask); + __iwl_write_prph(trans, ofs, + __iwl_read_prph(trans, ofs) | mask); iwl_release_nic_access(trans); } spin_unlock_irqrestore(&trans->reg_lock, flags); } EXPORT_SYMBOL_GPL(iwl_set_bits_prph); -void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, +void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs, u32 bits, u32 mask) { unsigned long flags; spin_lock_irqsave(&trans->reg_lock, flags); if (likely(iwl_grab_nic_access(trans))) { - __iwl_write_prph(trans, reg, - (__iwl_read_prph(trans, reg) & mask) | bits); + __iwl_write_prph(trans, ofs, + (__iwl_read_prph(trans, ofs) & mask) | bits); iwl_release_nic_access(trans); } spin_unlock_irqrestore(&trans->reg_lock, flags); } EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph); -void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) +void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) { unsigned long flags; u32 val; spin_lock_irqsave(&trans->reg_lock, flags); if (likely(iwl_grab_nic_access(trans))) { - val = __iwl_read_prph(trans, reg); - __iwl_write_prph(trans, reg, (val & ~mask)); + val = __iwl_read_prph(trans, ofs); + __iwl_write_prph(trans, ofs, (val & ~mask)); iwl_release_nic_access(trans); } spin_unlock_irqrestore(&trans->reg_lock, flags); |