diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-11-10 13:42:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:32:53 -0500 |
commit | 0f829b1d6f499447052f98098e41fd6a091eadd0 (patch) | |
tree | 3690f35175e75d94ee7a55320e5bb40620c600be /drivers/net/wireless/rt2x00/rt2x00usb.c | |
parent | c9c3b1a5deac4297503145840fffcd122b253db5 (diff) |
rt2x00: Move rt73usb register access wrappers into rt2x00usb
rt2500usb and rt73usb have different register word sizes,
for that reason the register access wrappers were never
moved into rt2x00usb.
With rt2800usb on its way, we should favor the 32bit
register access and move those wrappers into rt2x00usb.
That saves duplicate code, since only rt2500usb will
need the special 16bit wrappers.
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/rt2x00usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index c507b0d9409f..2fbf78ff6b18 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -154,6 +154,28 @@ int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev, | |||
154 | } | 154 | } |
155 | EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_large_buff); | 155 | EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_large_buff); |
156 | 156 | ||
157 | int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, | ||
158 | const unsigned int offset, | ||
159 | struct rt2x00_field32 field, | ||
160 | u32 *reg) | ||
161 | { | ||
162 | unsigned int i; | ||
163 | |||
164 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | ||
165 | rt2x00usb_register_read_lock(rt2x00dev, offset, reg); | ||
166 | if (!rt2x00_get_field32(*reg, field)) | ||
167 | return 1; | ||
168 | udelay(REGISTER_BUSY_DELAY); | ||
169 | } | ||
170 | |||
171 | ERROR(rt2x00dev, "Indirect register access failed: " | ||
172 | "offset=0x%.08x, value=0x%.08x\n", offset, *reg); | ||
173 | *reg = ~0; | ||
174 | |||
175 | return 0; | ||
176 | } | ||
177 | EXPORT_SYMBOL_GPL(rt2x00usb_regbusy_read); | ||
178 | |||
157 | /* | 179 | /* |
158 | * TX data handlers. | 180 | * TX data handlers. |
159 | */ | 181 | */ |