]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/rt2x00/rt2x00queue.h
rt2x00: Cleanup symbol exports
[linux-2.6] / drivers / net / wireless / rt2x00 / rt2x00queue.h
index 4d00ced14cc7c8a4e4f64743a4fae4f8f28f3211..14ce8d4e13975eef06886b6abfb48ba5bc322a42 100644 (file)
@@ -82,11 +82,12 @@ enum data_queue_qid {
 /**
  * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc
  *
- * @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver
- *     and should not be reported back to mac80211 during txdone.
+ * @SKBDESC_DMA_MAPPED_RX: &skb_dma field has been mapped for RX
+ * @SKBDESC_DMA_MAPPED_TX: &skb_dma field has been mapped for TX
  */
 enum skb_frame_desc_flags {
-       FRAME_DESC_DRIVER_GENERATED = 1 << 0,
+       SKBDESC_DMA_MAPPED_RX = (1 << 0),
+       SKBDESC_DMA_MAPPED_TX = (1 << 1),
 };
 
 /**
@@ -96,23 +97,21 @@ enum skb_frame_desc_flags {
  * this structure should not exceed the size of that array (40 bytes).
  *
  * @flags: Frame flags, see &enum skb_frame_desc_flags.
- * @data: Pointer to data part of frame (Start of ieee80211 header).
+ * @desc_len: Length of the frame descriptor.
  * @desc: Pointer to descriptor part of the frame.
  *     Note that this pointer could point to something outside
  *     of the scope of the skb->data pointer.
- * @data_len: Length of the frame data.
- * @desc_len: Length of the frame descriptor.
+ * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
  * @entry: The entry to which this sk buffer belongs.
  */
 struct skb_frame_desc {
        unsigned int flags;
 
-       unsigned short data_len;
-       unsigned short desc_len;
-
-       void *data;
+       unsigned int desc_len;
        void *desc;
 
+       dma_addr_t skb_dma;
+
        struct queue_entry *entry;
 };
 
@@ -260,11 +259,14 @@ struct txentry_desc {
  * @ENTRY_OWNER_DEVICE_CRYPTO: This entry is owned by the device for data
  *     encryption or decryption. The entry should only be touched after
  *     the device has signaled it is done with it.
+ * @ENTRY_DATA_PENDING: This entry contains a valid frame and is waiting
+ *     for the signal to start sending.
  */
 enum queue_entry_flags {
        ENTRY_BCN_ASSIGNED,
        ENTRY_OWNER_DEVICE_DATA,
        ENTRY_OWNER_DEVICE_CRYPTO,
+       ENTRY_DATA_PENDING,
 };
 
 /**
@@ -322,6 +324,7 @@ enum queue_index {
  *     index corruption due to concurrency.
  * @count: Number of frames handled in the queue.
  * @limit: Maximum number of entries in the queue.
+ * @threshold: Minimum number of free entries before queue is kicked by force.
  * @length: Number of frames in queue.
  * @index: Index pointers to entry positions in the queue,
  *     use &enum queue_index to get a specific index field.
@@ -340,6 +343,7 @@ struct data_queue {
        spinlock_t lock;
        unsigned int count;
        unsigned short limit;
+       unsigned short threshold;
        unsigned short length;
        unsigned short index[Q_INDEX_MAX];
 
@@ -463,6 +467,15 @@ static inline int rt2x00queue_available(struct data_queue *queue)
        return queue->limit - queue->length;
 }
 
+/**
+ * rt2x00queue_threshold - Check if the queue is below threshold
+ * @queue: Queue to check.
+ */
+static inline int rt2x00queue_threshold(struct data_queue *queue)
+{
+       return rt2x00queue_available(queue) < queue->threshold;
+}
+
 /**
  * rt2x00_desc_read - Read a word from the hardware descriptor.
  * @desc: Base descriptor address