diff options
author | Daniel Drake <dsd@gentoo.org> | 2007-11-19 10:00:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:47 -0500 |
commit | 459c51ad6e1fc19e91a53798358433d3c08cd09d (patch) | |
tree | fb86feacf1b229cb4ab6b36b4d1deaf4983b1e45 /drivers/net/wireless/zd1211rw/zd_usb.h | |
parent | 0765af4493193149505f118d04d9300f0a15c8f5 (diff) |
zd1211rw: port to mac80211
This seems to be working smoothly now. Let's not hold back the mac80211
transition any further. This patch ports the existing driver from softmac
to mac80211.
Many thanks to everyone who helped out with the porting efforts.
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 | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index 961a7a12ad68..42159fc49cf8 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | #include "zd_def.h" | 27 | #include "zd_def.h" |
28 | 28 | ||
29 | #define ZD_USB_TX_HIGH 5 | ||
30 | #define ZD_USB_TX_LOW 2 | ||
31 | |||
29 | enum devicetype { | 32 | enum devicetype { |
30 | DEVICE_ZD1211 = 0, | 33 | DEVICE_ZD1211 = 0, |
31 | DEVICE_ZD1211B = 1, | 34 | DEVICE_ZD1211B = 1, |
@@ -165,7 +168,7 @@ static inline struct usb_int_regs *get_read_regs(struct zd_usb_interrupt *intr) | |||
165 | return (struct usb_int_regs *)intr->read_regs.buffer; | 168 | return (struct usb_int_regs *)intr->read_regs.buffer; |
166 | } | 169 | } |
167 | 170 | ||
168 | #define URBS_COUNT 5 | 171 | #define RX_URBS_COUNT 5 |
169 | 172 | ||
170 | struct zd_usb_rx { | 173 | struct zd_usb_rx { |
171 | spinlock_t lock; | 174 | spinlock_t lock; |
@@ -176,8 +179,21 @@ struct zd_usb_rx { | |||
176 | int urbs_count; | 179 | int urbs_count; |
177 | }; | 180 | }; |
178 | 181 | ||
182 | /** | ||
183 | * struct zd_usb_tx - structure used for transmitting frames | ||
184 | * @lock: lock for transmission | ||
185 | * @free_urb_list: list of free URBs, contains all the URBs, which can be used | ||
186 | * @submitted_urbs: atomic integer that counts the URBs having sent to the | ||
187 | * device, which haven't been completed | ||
188 | * @enabled: enabled flag, indicates whether tx is enabled | ||
189 | * @stopped: indicates whether higher level tx queues are stopped | ||
190 | */ | ||
179 | struct zd_usb_tx { | 191 | struct zd_usb_tx { |
180 | spinlock_t lock; | 192 | spinlock_t lock; |
193 | struct list_head free_urb_list; | ||
194 | int submitted_urbs; | ||
195 | int enabled; | ||
196 | int stopped; | ||
181 | }; | 197 | }; |
182 | 198 | ||
183 | /* Contains the usb parts. The structure doesn't require a lock because intf | 199 | /* Contains the usb parts. The structure doesn't require a lock because intf |
@@ -198,17 +214,17 @@ static inline struct usb_device *zd_usb_to_usbdev(struct zd_usb *usb) | |||
198 | return interface_to_usbdev(usb->intf); | 214 | return interface_to_usbdev(usb->intf); |
199 | } | 215 | } |
200 | 216 | ||
201 | static inline struct net_device *zd_intf_to_netdev(struct usb_interface *intf) | 217 | static inline struct ieee80211_hw *zd_intf_to_hw(struct usb_interface *intf) |
202 | { | 218 | { |
203 | return usb_get_intfdata(intf); | 219 | return usb_get_intfdata(intf); |
204 | } | 220 | } |
205 | 221 | ||
206 | static inline struct net_device *zd_usb_to_netdev(struct zd_usb *usb) | 222 | static inline struct ieee80211_hw *zd_usb_to_hw(struct zd_usb *usb) |
207 | { | 223 | { |
208 | return zd_intf_to_netdev(usb->intf); | 224 | return zd_intf_to_hw(usb->intf); |
209 | } | 225 | } |
210 | 226 | ||
211 | void zd_usb_init(struct zd_usb *usb, struct net_device *netdev, | 227 | void zd_usb_init(struct zd_usb *usb, struct ieee80211_hw *hw, |
212 | struct usb_interface *intf); | 228 | struct usb_interface *intf); |
213 | int zd_usb_init_hw(struct zd_usb *usb); | 229 | int zd_usb_init_hw(struct zd_usb *usb); |
214 | void zd_usb_clear(struct zd_usb *usb); | 230 | void zd_usb_clear(struct zd_usb *usb); |
@@ -221,7 +237,10 @@ void zd_usb_disable_int(struct zd_usb *usb); | |||
221 | int zd_usb_enable_rx(struct zd_usb *usb); | 237 | int zd_usb_enable_rx(struct zd_usb *usb); |
222 | void zd_usb_disable_rx(struct zd_usb *usb); | 238 | void zd_usb_disable_rx(struct zd_usb *usb); |
223 | 239 | ||
224 | int zd_usb_tx(struct zd_usb *usb, const u8 *frame, unsigned int length); | 240 | void zd_usb_enable_tx(struct zd_usb *usb); |
241 | void zd_usb_disable_tx(struct zd_usb *usb); | ||
242 | |||
243 | int zd_usb_tx(struct zd_usb *usb, struct sk_buff *skb); | ||
225 | 244 | ||
226 | int zd_usb_ioread16v(struct zd_usb *usb, u16 *values, | 245 | int zd_usb_ioread16v(struct zd_usb *usb, u16 *values, |
227 | const zd_addr_t *addresses, unsigned int count); | 246 | const zd_addr_t *addresses, unsigned int count); |