diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-01-03 13:48:07 +0200 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-02 14:35:38 -0800 |
commit | 0390549571cb614ac5cd3327b63f95155a75c673 (patch) | |
tree | 071b5eb231ba835f3b4da2b1347f1d0673bd3deb /drivers/net/wireless/iwlwifi/iwl-trans.h | |
parent | a42a184458ae95937893cb873c988385637c5e14 (diff) | |
download | lwn-0390549571cb614ac5cd3327b63f95155a75c673.tar.gz lwn-0390549571cb614ac5cd3327b63f95155a75c673.zip |
iwlwifi: the read / write register ops move to transport
Most of the accesses to the registers are done from the transport layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 9a8076194868..0a3727dac6ac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -158,6 +158,9 @@ struct iwl_host_cmd { * automatically deleted. * @suspend: stop the device unless WoWLAN is configured * @resume: resume activity of the device + * @write8: write a u8 to a register at offset ofs from the BAR + * @write32: write a u32 to a register at offset ofs from the BAR + * @read32: read a u32 register at offset ofs from the BAR */ struct iwl_trans_ops { @@ -201,6 +204,9 @@ struct iwl_trans_ops { int (*suspend)(struct iwl_trans *trans); int (*resume)(struct iwl_trans *trans); #endif + void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); + void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); + u32 (*read32)(struct iwl_trans *trans, u32 ofs); }; /* one for each uCode image (inst/data, boot/init/runtime) */ @@ -382,6 +388,21 @@ static inline int iwl_trans_resume(struct iwl_trans *trans) } #endif +static inline void iwl_trans_write8(struct iwl_trans *trans, u32 ofs, u8 val) +{ + trans->ops->write8(trans, ofs, val); +} + +static inline void iwl_trans_write32(struct iwl_trans *trans, u32 ofs, u32 val) +{ + trans->ops->write32(trans, ofs, val); +} + +static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) +{ + return trans->ops->read32(trans, ofs); +} + /***************************************************** * Utils functions ******************************************************/ |