summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.h
diff options
context:
space:
mode:
authorIvo van Doorn2008-11-10 19:41:40 +0100
committerJohn W. Linville2008-11-25 22:32:53 +0100
commitc9c3b1a5deac4297503145840fffcd122b253db5 (patch)
tree7d5e0cf6510c1687ef6b18d32ba9009a5692fbfd /drivers/net/wireless/rt2x00/rt2x00pci.h
parentath5k: name pci driver "ath5k" too (diff)
downloadkernel-qcow2-linux-c9c3b1a5deac4297503145840fffcd122b253db5.tar.gz
kernel-qcow2-linux-c9c3b1a5deac4297503145840fffcd122b253db5.tar.xz
kernel-qcow2-linux-c9c3b1a5deac4297503145840fffcd122b253db5.zip
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.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 96a2082a3532..9c0a4d77bc1b 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
*