blob: ff94c6944cfcc7ec1d0c98e8d55d37bc6f177c1c [file] [log] [blame]
Ivo van Doorn95ea3622007-09-25 17:57:13 -07001/*
Gertjan van Wingerde9c9a0d12009-11-08 16:39:55 +01002 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
Ivo van Doorn95ea3622007-09-25 17:57:13 -07003 <http://rt2x00.serialmonkey.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
Jeff Kirshera05b8c52013-12-06 03:32:11 -080016 along with this program; if not, see <http://www.gnu.org/licenses/>.
Ivo van Doorn95ea3622007-09-25 17:57:13 -070017 */
18
19/*
20 Module: rt2x00usb
21 Abstract: Data structures for the rt2x00usb module.
22 */
23
24#ifndef RT2X00USB_H
25#define RT2X00USB_H
26
Gertjan van Wingerdeac9d1a72009-11-09 23:38:35 +010027#include <linux/usb.h>
28
Ivo van Doornc1d35df2008-06-16 19:57:11 +020029#define to_usb_device_intf(d) \
30({ \
31 struct usb_interface *intf = to_usb_interface(d); \
32 interface_to_usbdev(intf); \
33})
34
Ivo van Doorn95ea3622007-09-25 17:57:13 -070035/*
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +020036 * For USB vendor requests we need to pass a timeout time in ms, for this we
37 * use the REGISTER_TIMEOUT, however when loading firmware or read EEPROM
38 * a higher value is required. In that case we use the REGISTER_TIMEOUT_FIRMWARE
39 * and EEPROM_TIMEOUT.
Ivo van Doorn95ea3622007-09-25 17:57:13 -070040 */
Stanislaw Gruszka14bc8bd2014-11-26 15:29:15 +010041#define REGISTER_TIMEOUT 100
Ivo van Doorn95ea3622007-09-25 17:57:13 -070042#define REGISTER_TIMEOUT_FIRMWARE 1000
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +020043#define EEPROM_TIMEOUT 2000
Ivo van Doornbd394a72008-04-21 19:01:58 +020044
Ivo van Doorn95ea3622007-09-25 17:57:13 -070045/*
46 * Cache size
47 */
Iwo Merglered0dbee2008-07-19 16:16:54 +020048#define CSR_CACHE_SIZE 64
Ivo van Doorn95ea3622007-09-25 17:57:13 -070049
50/*
51 * USB request types.
52 */
53#define USB_VENDOR_REQUEST ( USB_TYPE_VENDOR | USB_RECIP_DEVICE )
54#define USB_VENDOR_REQUEST_IN ( USB_DIR_IN | USB_VENDOR_REQUEST )
55#define USB_VENDOR_REQUEST_OUT ( USB_DIR_OUT | USB_VENDOR_REQUEST )
56
Ivo van Doorn3b640f22008-02-03 15:54:11 +010057/**
58 * enum rt2x00usb_vendor_request: USB vendor commands.
Ivo van Doorn95ea3622007-09-25 17:57:13 -070059 */
Ivo van Doorn3b640f22008-02-03 15:54:11 +010060enum rt2x00usb_vendor_request {
61 USB_DEVICE_MODE = 1,
62 USB_SINGLE_WRITE = 2,
63 USB_SINGLE_READ = 3,
64 USB_MULTI_WRITE = 6,
65 USB_MULTI_READ = 7,
66 USB_EEPROM_WRITE = 8,
67 USB_EEPROM_READ = 9,
68 USB_LED_CONTROL = 10, /* RT73USB */
69 USB_RX_CONTROL = 12,
70};
Ivo van Doorn95ea3622007-09-25 17:57:13 -070071
Ivo van Doorn3b640f22008-02-03 15:54:11 +010072/**
73 * enum rt2x00usb_mode_offset: Device modes offset.
Ivo van Doorn95ea3622007-09-25 17:57:13 -070074 */
Ivo van Doorn3b640f22008-02-03 15:54:11 +010075enum rt2x00usb_mode_offset {
76 USB_MODE_RESET = 1,
77 USB_MODE_UNPLUG = 2,
78 USB_MODE_FUNCTION = 3,
79 USB_MODE_TEST = 4,
80 USB_MODE_SLEEP = 7, /* RT73USB */
81 USB_MODE_FIRMWARE = 8, /* RT73USB */
82 USB_MODE_WAKEUP = 9, /* RT73USB */
Michael Braunde51b352014-06-12 19:33:36 +020083 USB_MODE_AUTORUN = 17, /* RT2800USB */
Ivo van Doorn3b640f22008-02-03 15:54:11 +010084};
Ivo van Doorn95ea3622007-09-25 17:57:13 -070085
Ivo van Doorn3b640f22008-02-03 15:54:11 +010086/**
87 * rt2x00usb_vendor_request - Send register command to device
88 * @rt2x00dev: Pointer to &struct rt2x00_dev
89 * @request: USB vendor command (See &enum rt2x00usb_vendor_request)
90 * @requesttype: Request type &USB_VENDOR_REQUEST_*
91 * @offset: Register offset to perform action on
92 * @value: Value to write to device
93 * @buffer: Buffer where information will be read/written to by device
94 * @buffer_length: Size of &buffer
95 * @timeout: Operation timeout
96 *
Ivo van Doorn95ea3622007-09-25 17:57:13 -070097 * This is the main function to communicate with the device,
Ivo van Doorn3b640f22008-02-03 15:54:11 +010098 * the &buffer argument _must_ either be NULL or point to
Ivo van Doorn95ea3622007-09-25 17:57:13 -070099 * a buffer allocated by kmalloc. Failure to do so can lead
100 * to unexpected behavior depending on the architecture.
101 */
Adam Baker0e14f6d2007-10-27 13:41:25 +0200102int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700103 const u8 request, const u8 requesttype,
104 const u16 offset, const u16 value,
105 void *buffer, const u16 buffer_length,
Ivo van Doorne9136552007-09-25 20:54:20 +0200106 const int timeout);
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700107
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100108/**
109 * rt2x00usb_vendor_request_buff - Send register command to device (buffered)
110 * @rt2x00dev: Pointer to &struct rt2x00_dev
111 * @request: USB vendor command (See &enum rt2x00usb_vendor_request)
112 * @requesttype: Request type &USB_VENDOR_REQUEST_*
113 * @offset: Register offset to perform action on
114 * @buffer: Buffer where information will be read/written to by device
115 * @buffer_length: Size of &buffer
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100116 *
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700117 * This function will use a previously with kmalloc allocated cache
118 * to communicate with the device. The contents of the buffer pointer
119 * will be copied to this cache when writing, or read from the cache
120 * when reading.
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100121 * Buffers send to &rt2x00usb_vendor_request _must_ be allocated with
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700122 * kmalloc. Hence the reason for using a previously allocated cache
123 * which has been allocated properly.
124 */
Adam Baker0e14f6d2007-10-27 13:41:25 +0200125int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev,
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700126 const u8 request, const u8 requesttype,
127 const u16 offset, void *buffer,
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +0200128 const u16 buffer_length);
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700129
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100130/**
131 * rt2x00usb_vendor_request_buff - Send register command to device (buffered)
132 * @rt2x00dev: Pointer to &struct rt2x00_dev
133 * @request: USB vendor command (See &enum rt2x00usb_vendor_request)
134 * @requesttype: Request type &USB_VENDOR_REQUEST_*
135 * @offset: Register offset to perform action on
136 * @buffer: Buffer where information will be read/written to by device
137 * @buffer_length: Size of &buffer
138 * @timeout: Operation timeout
139 *
140 * A version of &rt2x00usb_vendor_request_buff which must be called
141 * if the usb_cache_mutex is already held.
142 */
Adam Baker3d823462007-10-27 13:43:29 +0200143int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev,
144 const u8 request, const u8 requesttype,
145 const u16 offset, void *buffer,
146 const u16 buffer_length, const int timeout);
147
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100148/**
149 * rt2x00usb_vendor_request_sw - Send single register command to device
150 * @rt2x00dev: Pointer to &struct rt2x00_dev
151 * @request: USB vendor command (See &enum rt2x00usb_vendor_request)
152 * @offset: Register offset to perform action on
153 * @value: Value to write to device
154 * @timeout: Operation timeout
155 *
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700156 * Simple wrapper around rt2x00usb_vendor_request to write a single
157 * command to the device. Since we don't use the buffer argument we
158 * don't have to worry about kmalloc here.
159 */
Adam Baker0e14f6d2007-10-27 13:41:25 +0200160static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev,
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700161 const u8 request,
162 const u16 offset,
163 const u16 value,
Ivo van Doorne9136552007-09-25 20:54:20 +0200164 const int timeout)
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700165{
166 return rt2x00usb_vendor_request(rt2x00dev, request,
167 USB_VENDOR_REQUEST_OUT, offset,
168 value, NULL, 0, timeout);
169}
170
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100171/**
172 * rt2x00usb_eeprom_read - Read eeprom from device
173 * @rt2x00dev: Pointer to &struct rt2x00_dev
174 * @eeprom: Pointer to eeprom array to store the information in
175 * @length: Number of bytes to read from the eeprom
176 *
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700177 * Simple wrapper around rt2x00usb_vendor_request to read the eeprom
178 * from the device. Note that the eeprom argument _must_ be allocated using
179 * kmalloc for correct handling inside the kernel USB layer.
180 */
Adam Baker0e14f6d2007-10-27 13:41:25 +0200181static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev,
Ivo van Doorn9a46d442008-04-21 19:02:17 +0200182 __le16 *eeprom, const u16 length)
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700183{
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700184 return rt2x00usb_vendor_request(rt2x00dev, USB_EEPROM_READ,
Ivo van Doorn3b640f22008-02-03 15:54:11 +0100185 USB_VENDOR_REQUEST_IN, 0, 0,
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +0200186 eeprom, length, EEPROM_TIMEOUT);
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700187}
188
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100189/**
Bartlomiej Zolnierkiewicz02a39c22009-11-04 18:32:50 +0100190 * rt2x00usb_register_read - Read 32bit register word
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100191 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
192 * @offset: Register offset
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100193 *
194 * This function is a simple wrapper for 32bit register access
195 * through rt2x00usb_vendor_request_buff().
196 */
Arnd Bergmann48bde9c2017-05-17 16:46:57 +0200197static inline u32 rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev,
198 const unsigned int offset)
Arnd Bergmann6b817452017-05-17 16:46:53 +0200199{
200 __le32 reg = 0;
201 rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ,
202 USB_VENDOR_REQUEST_IN, offset,
203 &reg, sizeof(reg));
204 return le32_to_cpu(reg);
205}
206
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100207/**
208 * rt2x00usb_register_read_lock - Read 32bit register word
209 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
210 * @offset: Register offset
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100211 *
212 * This function is a simple wrapper for 32bit register access
213 * through rt2x00usb_vendor_req_buff_lock().
214 */
Arnd Bergmann48bde9c2017-05-17 16:46:57 +0200215static inline u32 rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
216 const unsigned int offset)
Arnd Bergmann6b817452017-05-17 16:46:53 +0200217{
218 __le32 reg = 0;
219 rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_READ,
220 USB_VENDOR_REQUEST_IN, offset,
221 &reg, sizeof(reg), REGISTER_TIMEOUT);
222 return le32_to_cpu(reg);
223}
224
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100225/**
226 * rt2x00usb_register_multiread - Read 32bit register words
227 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
228 * @offset: Register offset
229 * @value: Pointer to where register contents should be stored
230 * @length: Length of the data
231 *
232 * This function is a simple wrapper for 32bit register access
233 * through rt2x00usb_vendor_request_buff().
234 */
235static inline void rt2x00usb_register_multiread(struct rt2x00_dev *rt2x00dev,
236 const unsigned int offset,
237 void *value, const u32 length)
238{
239 rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ,
240 USB_VENDOR_REQUEST_IN, offset,
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +0200241 value, length);
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100242}
243
244/**
245 * rt2x00usb_register_write - Write 32bit register word
246 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
247 * @offset: Register offset
248 * @value: Data which should be written
249 *
250 * This function is a simple wrapper for 32bit register access
251 * through rt2x00usb_vendor_request_buff().
252 */
253static inline void rt2x00usb_register_write(struct rt2x00_dev *rt2x00dev,
254 const unsigned int offset,
255 u32 value)
256{
257 __le32 reg = cpu_to_le32(value);
258 rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_WRITE,
259 USB_VENDOR_REQUEST_OUT, offset,
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +0200260 &reg, sizeof(reg));
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100261}
262
263/**
264 * rt2x00usb_register_write_lock - Write 32bit register word
265 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
266 * @offset: Register offset
267 * @value: Data which should be written
268 *
269 * This function is a simple wrapper for 32bit register access
270 * through rt2x00usb_vendor_req_buff_lock().
271 */
272static inline void rt2x00usb_register_write_lock(struct rt2x00_dev *rt2x00dev,
273 const unsigned int offset,
274 u32 value)
275{
276 __le32 reg = cpu_to_le32(value);
277 rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_WRITE,
278 USB_VENDOR_REQUEST_OUT, offset,
279 &reg, sizeof(reg), REGISTER_TIMEOUT);
280}
281
282/**
283 * rt2x00usb_register_multiwrite - Write 32bit register words
284 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
285 * @offset: Register offset
286 * @value: Data which should be written
287 * @length: Length of the data
288 *
289 * This function is a simple wrapper for 32bit register access
290 * through rt2x00usb_vendor_request_buff().
291 */
292static inline void rt2x00usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,
Bartlomiej Zolnierkiewicz5b10b092009-11-04 18:35:10 +0100293 const unsigned int offset,
294 const void *value,
295 const u32 length)
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100296{
297 rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_WRITE,
298 USB_VENDOR_REQUEST_OUT, offset,
Stanislaw Gruszkae9dc51a2014-10-08 14:16:37 +0200299 (void *)value, length);
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100300}
301
302/**
303 * rt2x00usb_regbusy_read - Read from register with busy check
304 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
305 * @offset: Register offset
306 * @field: Field to check if register is busy
307 * @reg: Pointer to where register contents should be stored
308 *
309 * This function will read the given register, and checks if the
310 * register is busy. If it is, it will sleep for a couple of
311 * microseconds before reading the register again. If the register
312 * is not read after a certain timeout, this function will return
313 * FALSE.
314 */
315int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
316 const unsigned int offset,
Bartlomiej Zolnierkiewiczf255b922009-11-04 18:35:18 +0100317 const struct rt2x00_field32 field,
Ivo van Doorn0f829b12008-11-10 19:42:18 +0100318 u32 *reg);
319
Johannes Stezenbach0e0d39e2011-04-18 15:29:12 +0200320/**
321 * rt2x00usb_register_read_async - Asynchronously read 32bit register word
322 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
323 * @offset: Register offset
324 * @callback: Functon to call when read completes.
325 *
326 * Submit a control URB to read a 32bit register. This safe to
327 * be called from atomic context. The callback will be called
328 * when the URB completes. Otherwise the function is similar
329 * to rt2x00usb_register_read().
Ivo van Doorna073fde2011-04-30 17:14:23 +0200330 * When the callback function returns false, the memory will be cleaned up,
331 * when it returns true, the urb will be fired again.
Johannes Stezenbach0e0d39e2011-04-18 15:29:12 +0200332 */
333void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev,
334 const unsigned int offset,
Ivo van Doorna073fde2011-04-30 17:14:23 +0200335 bool (*callback)(struct rt2x00_dev*, int, u32));
Johannes Stezenbach0e0d39e2011-04-18 15:29:12 +0200336
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700337/*
338 * Radio handlers
339 */
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700340void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev);
341
Ivo van Doorn6db37862008-06-06 22:50:28 +0200342/**
Ivo van Doornb8be63f2008-05-10 13:46:03 +0200343 * struct queue_entry_priv_usb: Per entry USB specific information
Ivo van Doorn181d6902008-02-05 16:42:23 -0500344 *
345 * @urb: Urb structure used for device communication.
Ivo van Doorn181d6902008-02-05 16:42:23 -0500346 */
Ivo van Doornb8be63f2008-05-10 13:46:03 +0200347struct queue_entry_priv_usb {
Ivo van Doorn181d6902008-02-05 16:42:23 -0500348 struct urb *urb;
Ivo van Doorn181d6902008-02-05 16:42:23 -0500349};
350
351/**
Ivo van Doornb8be63f2008-05-10 13:46:03 +0200352 * struct queue_entry_priv_usb_bcn: Per TX entry USB specific information
Ivo van Doorn181d6902008-02-05 16:42:23 -0500353 *
Ivo van Doornb8be63f2008-05-10 13:46:03 +0200354 * The first section should match &struct queue_entry_priv_usb exactly.
Ivo van Doorn181d6902008-02-05 16:42:23 -0500355 * rt2500usb can use this structure to send a guardian byte when working
356 * with beacons.
357 *
358 * @urb: Urb structure used for device communication.
Ivo van Doorn181d6902008-02-05 16:42:23 -0500359 * @guardian_data: Set to 0, used for sending the guardian data.
360 * @guardian_urb: Urb structure used to send the guardian data.
361 */
362struct queue_entry_priv_usb_bcn {
363 struct urb *urb;
364
Ivo van Doorn181d6902008-02-05 16:42:23 -0500365 unsigned int guardian_data;
366 struct urb *guardian_urb;
367};
368
Ivo van Doornf019d512008-06-06 22:47:39 +0200369/**
Ivo van Doorndbba3062010-12-13 12:34:54 +0100370 * rt2x00usb_kick_queue - Kick data queue
Ivo van Doorn93331452010-08-23 19:53:39 +0200371 * @queue: Data queue to kick
Ivo van Doornf019d512008-06-06 22:47:39 +0200372 *
373 * This will walk through all entries of the queue and push all pending
374 * frames to the hardware as a single burst.
375 */
Ivo van Doorndbba3062010-12-13 12:34:54 +0100376void rt2x00usb_kick_queue(struct data_queue *queue);
Ivo van Doornf019d512008-06-06 22:47:39 +0200377
Ivo van Doorna2c9b652009-01-28 00:32:33 +0100378/**
Ivo van Doorn5be65602010-12-13 12:35:40 +0100379 * rt2x00usb_flush_queue - Flush data queue
Ivo van Doorn5450b7e2010-12-13 12:34:22 +0100380 * @queue: Data queue to stop
Ivo van Doorn152a5992011-04-18 15:31:02 +0200381 * @drop: True to drop all pending frames.
Ivo van Doorna2c9b652009-01-28 00:32:33 +0100382 *
Ivo van Doorn152a5992011-04-18 15:31:02 +0200383 * This will walk through all entries of the queue and will optionally
384 * kill all URB's which were send to the device, or at least wait until
385 * they have been returned from the device..
Ivo van Doorna2c9b652009-01-28 00:32:33 +0100386 */
Ivo van Doorn152a5992011-04-18 15:31:02 +0200387void rt2x00usb_flush_queue(struct data_queue *queue, bool drop);
Ivo van Doorna2c9b652009-01-28 00:32:33 +0100388
Ivo van Doornc965c742010-07-11 12:25:46 +0200389/**
390 * rt2x00usb_watchdog - Watchdog for USB communication
391 * @rt2x00dev: Pointer to &struct rt2x00_dev
392 *
393 * Check the health of the USB communication and determine
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300394 * if timeouts have occurred. If this is the case, this function
Ivo van Doornc965c742010-07-11 12:25:46 +0200395 * will reset all communication to restore functionality again.
396 */
397void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev);
398
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700399/*
400 * Device initialization handlers.
401 */
Ivo van Doorn798b7ad2008-11-08 15:25:33 +0100402void rt2x00usb_clear_entry(struct queue_entry *entry);
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700403int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev);
404void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev);
405
406/*
407 * USB driver handlers.
408 */
409int rt2x00usb_probe(struct usb_interface *usb_intf,
Gertjan van Wingerdee01ae272011-04-18 15:32:13 +0200410 const struct rt2x00_ops *ops);
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700411void rt2x00usb_disconnect(struct usb_interface *usb_intf);
412#ifdef CONFIG_PM
413int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state);
414int rt2x00usb_resume(struct usb_interface *usb_intf);
415#else
416#define rt2x00usb_suspend NULL
417#define rt2x00usb_resume NULL
418#endif /* CONFIG_PM */
419
420#endif /* RT2X00USB_H */