diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index d3d3ddc40875..323ca7b2b095 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h | |||
@@ -35,12 +35,6 @@ | |||
35 | }) | 35 | }) |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * This variable should be used with the | ||
39 | * usb_driver structure initialization. | ||
40 | */ | ||
41 | #define USB_DEVICE_DATA(__ops) .driver_info = (kernel_ulong_t)(__ops) | ||
42 | |||
43 | /* | ||
44 | * For USB vendor requests we need to pass a timeout | 38 | * For USB vendor requests we need to pass a timeout |
45 | * time in ms, for this we use the REGISTER_TIMEOUT, | 39 | * time in ms, for this we use the REGISTER_TIMEOUT, |
46 | * however when loading firmware a higher value is | 40 | * however when loading firmware a higher value is |
@@ -345,6 +339,23 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
345 | const struct rt2x00_field32 field, | 339 | const struct rt2x00_field32 field, |
346 | u32 *reg); | 340 | u32 *reg); |
347 | 341 | ||
342 | /** | ||
343 | * rt2x00usb_register_read_async - Asynchronously read 32bit register word | ||
344 | * @rt2x00dev: Device pointer, see &struct rt2x00_dev. | ||
345 | * @offset: Register offset | ||
346 | * @callback: Functon to call when read completes. | ||
347 | * | ||
348 | * Submit a control URB to read a 32bit register. This safe to | ||
349 | * be called from atomic context. The callback will be called | ||
350 | * when the URB completes. Otherwise the function is similar | ||
351 | * to rt2x00usb_register_read(). | ||
352 | * When the callback function returns false, the memory will be cleaned up, | ||
353 | * when it returns true, the urb will be fired again. | ||
354 | */ | ||
355 | void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, | ||
356 | const unsigned int offset, | ||
357 | bool (*callback)(struct rt2x00_dev*, int, u32)); | ||
358 | |||
348 | /* | 359 | /* |
349 | * Radio handlers | 360 | * Radio handlers |
350 | */ | 361 | */ |
@@ -378,33 +389,31 @@ struct queue_entry_priv_usb_bcn { | |||
378 | }; | 389 | }; |
379 | 390 | ||
380 | /** | 391 | /** |
381 | * rt2x00usb_kick_tx_queue - Kick data queue | 392 | * rt2x00usb_kick_queue - Kick data queue |
382 | * @rt2x00dev: Pointer to &struct rt2x00_dev | 393 | * @queue: Data queue to kick |
383 | * @qid: Data queue to kick | ||
384 | * | 394 | * |
385 | * This will walk through all entries of the queue and push all pending | 395 | * This will walk through all entries of the queue and push all pending |
386 | * frames to the hardware as a single burst. | 396 | * frames to the hardware as a single burst. |
387 | */ | 397 | */ |
388 | void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 398 | void rt2x00usb_kick_queue(struct data_queue *queue); |
389 | const enum data_queue_qid qid); | ||
390 | 399 | ||
391 | /** | 400 | /** |
392 | * rt2x00usb_kill_tx_queue - Kill data queue | 401 | * rt2x00usb_flush_queue - Flush data queue |
393 | * @rt2x00dev: Pointer to &struct rt2x00_dev | 402 | * @queue: Data queue to stop |
394 | * @qid: Data queue to kill | 403 | * @drop: True to drop all pending frames. |
395 | * | 404 | * |
396 | * This will walk through all entries of the queue and kill all | 405 | * This will walk through all entries of the queue and will optionally |
397 | * previously kicked frames before they can be send. | 406 | * kill all URB's which were send to the device, or at least wait until |
407 | * they have been returned from the device.. | ||
398 | */ | 408 | */ |
399 | void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev, | 409 | void rt2x00usb_flush_queue(struct data_queue *queue, bool drop); |
400 | const enum data_queue_qid qid); | ||
401 | 410 | ||
402 | /** | 411 | /** |
403 | * rt2x00usb_watchdog - Watchdog for USB communication | 412 | * rt2x00usb_watchdog - Watchdog for USB communication |
404 | * @rt2x00dev: Pointer to &struct rt2x00_dev | 413 | * @rt2x00dev: Pointer to &struct rt2x00_dev |
405 | * | 414 | * |
406 | * Check the health of the USB communication and determine | 415 | * Check the health of the USB communication and determine |
407 | * if timeouts have occured. If this is the case, this function | 416 | * if timeouts have occurred. If this is the case, this function |
408 | * will reset all communication to restore functionality again. | 417 | * will reset all communication to restore functionality again. |
409 | */ | 418 | */ |
410 | void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev); | 419 | void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev); |
@@ -420,7 +429,7 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev); | |||
420 | * USB driver handlers. | 429 | * USB driver handlers. |
421 | */ | 430 | */ |
422 | int rt2x00usb_probe(struct usb_interface *usb_intf, | 431 | int rt2x00usb_probe(struct usb_interface *usb_intf, |
423 | const struct usb_device_id *id); | 432 | const struct rt2x00_ops *ops); |
424 | void rt2x00usb_disconnect(struct usb_interface *usb_intf); | 433 | void rt2x00usb_disconnect(struct usb_interface *usb_intf); |
425 | #ifdef CONFIG_PM | 434 | #ifdef CONFIG_PM |
426 | int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state); | 435 | int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state); |