diff options
author | Daniel Drake <dsd@gentoo.org> | 2006-12-11 20:26:11 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:42 -0500 |
commit | 0ce34bc8f7d906d66ce6803f63399ef9bbe54012 (patch) | |
tree | 1326f9105842fc81f89bf8ab1a435ab13a4d72d5 /drivers/net/wireless/zd1211rw/zd_usb.h | |
parent | ee30276774451d657407855d95d9393ee8bc0bac (diff) |
[PATCH] zd1211rw: Remove addressing abstraction
Instead of passing our own custom 32-bit addresses around and
translating them, this patch makes all our register address constants
absolute and removes the translation.
There are two ugly parts:
- fw_reg_addr() is needed to compute addresses of firmware registers, as this
is dynamic based upon firmware
- inc_addr() needs a small hack to handle byte vs word addressing
However, both of those are only small, and we don't use fw_regs a whole
lot anyway.
The bonuses here include simplicity and improved driver readability. Also, the
fact that registers are now referenced by 16-bit absolute addresses (as
opposed to 32-bit pseudo addresses) means that over 2kb compiled code size has
been shaved off.
Includes some touchups and sparse fixes from Ulrich Kunitz.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_usb.h')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index 317d37c36679..506ea6a74393 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/usb.h> | 25 | #include <linux/usb.h> |
26 | 26 | ||
27 | #include "zd_def.h" | 27 | #include "zd_def.h" |
28 | #include "zd_types.h" | ||
29 | 28 | ||
30 | enum devicetype { | 29 | enum devicetype { |
31 | DEVICE_ZD1211 = 0, | 30 | DEVICE_ZD1211 = 0, |
@@ -181,15 +180,14 @@ struct zd_usb_tx { | |||
181 | spinlock_t lock; | 180 | spinlock_t lock; |
182 | }; | 181 | }; |
183 | 182 | ||
184 | /* Contains the usb parts. The structure doesn't require a lock, because intf | 183 | /* Contains the usb parts. The structure doesn't require a lock because intf |
185 | * and fw_base_offset, will not be changed after initialization. | 184 | * will not be changed after initialization. |
186 | */ | 185 | */ |
187 | struct zd_usb { | 186 | struct zd_usb { |
188 | struct zd_usb_interrupt intr; | 187 | struct zd_usb_interrupt intr; |
189 | struct zd_usb_rx rx; | 188 | struct zd_usb_rx rx; |
190 | struct zd_usb_tx tx; | 189 | struct zd_usb_tx tx; |
191 | struct usb_interface *intf; | 190 | struct usb_interface *intf; |
192 | u16 fw_base_offset; | ||
193 | }; | 191 | }; |
194 | 192 | ||
195 | #define zd_usb_dev(usb) (&usb->intf->dev) | 193 | #define zd_usb_dev(usb) (&usb->intf->dev) |