diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-11-10 19:41:40 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:32:53 -0500 |
commit | c9c3b1a5deac4297503145840fffcd122b253db5 (patch) | |
tree | 7d5e0cf6510c1687ef6b18d32ba9009a5692fbfd /drivers/net/wireless/rt2x00/rt2x00pci.h | |
parent | 9764f3f9c3700620f9f8a1f9af57f58758e835da (diff) | |
download | kernel_samsung_smdk4412-c9c3b1a5deac4297503145840fffcd122b253db5.zip kernel_samsung_smdk4412-c9c3b1a5deac4297503145840fffcd122b253db5.tar.gz kernel_samsung_smdk4412-c9c3b1a5deac4297503145840fffcd122b253db5.tar.bz2 |
rt2x00: Cleanup indirect register access
All code which accessed indirect registers was similar
in respect to the for-loop, the given timeout, etc.
Move it into a seperate function, which for PCI drivers
can be moved into rt2x00pci.
This allows us to cleanup the cleanup the code further
by removing the goto statementsand making the codepath
look a bit nicer.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00pci.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h index 96a2082..9c0a4d7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.h +++ b/drivers/net/wireless/rt2x00/rt2x00pci.h @@ -77,6 +77,24 @@ rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, } /** + * rt2x00pci_regbusy_read - Read from register with busy check + * @rt2x00dev: Device pointer, see &struct rt2x00_dev. + * @offset: Register offset + * @field: Field to check if register is busy + * @reg: Pointer to where register contents should be stored + * + * This function will read the given register, and checks if the + * register is busy. If it is, it will sleep for a couple of + * microseconds before reading the register again. If the register + * is not read after a certain timeout, this function will return + * FALSE. + */ +int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, + const unsigned int offset, + const struct rt2x00_field32 field, + u32 *reg); + +/** * rt2x00pci_write_tx_data - Initialize data for TX operation * @entry: The entry where the frame is located * |