aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 0e38a911195d..d81d85f34866 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -401,6 +401,8 @@ struct queue_entry {
401 * 401 *
402 * @Q_INDEX: Index pointer to the current entry in the queue, if this entry is 402 * @Q_INDEX: Index pointer to the current entry in the queue, if this entry is
403 * owned by the hardware then the queue is considered to be full. 403 * owned by the hardware then the queue is considered to be full.
404 * @Q_INDEX_DMA_DONE: Index pointer for the next entry which will have been
405 * transfered to the hardware.
404 * @Q_INDEX_DONE: Index pointer to the next entry which will be completed by 406 * @Q_INDEX_DONE: Index pointer to the next entry which will be completed by
405 * the hardware and for which we need to run the txdone handler. If this 407 * the hardware and for which we need to run the txdone handler. If this
406 * entry is not owned by the hardware the queue is considered to be empty. 408 * entry is not owned by the hardware the queue is considered to be empty.
@@ -409,6 +411,7 @@ struct queue_entry {
409 */ 411 */
410enum queue_index { 412enum queue_index {
411 Q_INDEX, 413 Q_INDEX,
414 Q_INDEX_DMA_DONE,
412 Q_INDEX_DONE, 415 Q_INDEX_DONE,
413 Q_INDEX_MAX, 416 Q_INDEX_MAX,
414}; 417};
@@ -445,13 +448,12 @@ struct data_queue {
445 enum data_queue_qid qid; 448 enum data_queue_qid qid;
446 449
447 spinlock_t lock; 450 spinlock_t lock;
448 unsigned long last_index;
449 unsigned long last_index_done;
450 unsigned int count; 451 unsigned int count;
451 unsigned short limit; 452 unsigned short limit;
452 unsigned short threshold; 453 unsigned short threshold;
453 unsigned short length; 454 unsigned short length;
454 unsigned short index[Q_INDEX_MAX]; 455 unsigned short index[Q_INDEX_MAX];
456 unsigned long last_action[Q_INDEX_MAX];
455 457
456 unsigned short txop; 458 unsigned short txop;
457 unsigned short aifs; 459 unsigned short aifs;
@@ -616,12 +618,23 @@ static inline int rt2x00queue_threshold(struct data_queue *queue)
616} 618}
617 619
618/** 620/**
619 * rt2x00queue_timeout - Check if a timeout occured for this queue 621 * rt2x00queue_timeout - Check if a timeout occured for STATUS reorts
620 * @queue: Queue to check. 622 * @queue: Queue to check.
621 */ 623 */
622static inline int rt2x00queue_timeout(struct data_queue *queue) 624static inline int rt2x00queue_timeout(struct data_queue *queue)
623{ 625{
624 return time_after(queue->last_index, queue->last_index_done + (HZ / 10)); 626 return time_after(queue->last_action[Q_INDEX_DMA_DONE],
627 queue->last_action[Q_INDEX_DONE] + (HZ / 10));
628}
629
630/**
631 * rt2x00queue_timeout - Check if a timeout occured for DMA transfers
632 * @queue: Queue to check.
633 */
634static inline int rt2x00queue_dma_timeout(struct data_queue *queue)
635{
636 return time_after(queue->last_action[Q_INDEX],
637 queue->last_action[Q_INDEX_DMA_DONE] + (HZ / 10));
625} 638}
626 639
627/** 640/**