]> 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 c5f46f234083b678fd211e519d3afb792c85c621..14ce8d4e13975eef06886b6abfb48ba5bc322a42 100644 (file)
 
 /**
  * enum data_queue_qid: Queue identification
+ *
+ * @QID_AC_BE: AC BE queue
+ * @QID_AC_BK: AC BK queue
+ * @QID_AC_VI: AC VI queue
+ * @QID_AC_VO: AC VO queue
+ * @QID_HCCA: HCCA queue
+ * @QID_MGMT: MGMT queue (prio queue)
+ * @QID_RX: RX queue
+ * @QID_OTHER: None of the above (don't use, only present for completeness)
+ * @QID_BEACON: Beacon queue (value unspecified, don't send it to device)
+ * @QID_ATIM: Atim queue (value unspeficied, don't send it to device)
  */
 enum data_queue_qid {
        QID_AC_BE = 0,
@@ -64,92 +75,103 @@ enum data_queue_qid {
        QID_MGMT = 13,
        QID_RX = 14,
        QID_OTHER = 15,
-};
-
-/**
- * enum rt2x00_bcn_queue: Beacon queue index
- *
- * Start counting with a high offset, this because this enumeration
- * supplements &enum ieee80211_tx_queue and we should prevent value
- * conflicts.
- *
- * @RT2X00_BCN_QUEUE_BEACON: Beacon queue
- * @RT2X00_BCN_QUEUE_ATIM: Atim queue (sends frame after beacon)
- */
-enum rt2x00_bcn_queue {
-       RT2X00_BCN_QUEUE_BEACON = 100,
-       RT2X00_BCN_QUEUE_ATIM = 101,
+       QID_BEACON,
+       QID_ATIM,
 };
 
 /**
  * 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),
 };
 
 /**
  * struct skb_frame_desc: Descriptor information for the skb buffer
  *
- * This structure is placed over the skb->cb array, this means that
- * this structure should not exceed the size of that array (48 bytes).
+ * This structure is placed over the driver_data array, this means that
+ * this structure should not exceed the size of that array (40 bytes).
  *
  * @flags: Frame flags, see &enum skb_frame_desc_flags.
- * @frame_type: Frame type, see &enum rt2x00_dump_type.
- * @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 int frame_type;
-
-       void *data;
+       unsigned int desc_len;
        void *desc;
 
-       unsigned int data_len;
-       unsigned int desc_len;
+       dma_addr_t skb_dma;
 
        struct queue_entry *entry;
 };
 
+/**
+ * get_skb_frame_desc - Obtain the rt2x00 frame descriptor from a sk_buff.
+ * @skb: &struct sk_buff from where we obtain the &struct skb_frame_desc
+ */
 static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb)
 {
-       BUILD_BUG_ON(sizeof(struct skb_frame_desc) > sizeof(skb->cb));
-       return (struct skb_frame_desc *)&skb->cb[0];
+       BUILD_BUG_ON(sizeof(struct skb_frame_desc) >
+                    IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
+       return (struct skb_frame_desc *)&IEEE80211_SKB_CB(skb)->driver_data;
 }
 
+/**
+ * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc
+ *
+ * @RXDONE_SIGNAL_PLCP: Does the signal field contain the plcp value,
+ *     or does it contain the bitrate itself.
+ * @RXDONE_MY_BSS: Does this frame originate from device's BSS.
+ */
+enum rxdone_entry_desc_flags {
+       RXDONE_SIGNAL_PLCP = 1 << 0,
+       RXDONE_MY_BSS = 1 << 1,
+};
+
 /**
  * struct rxdone_entry_desc: RX Entry descriptor
  *
  * Summary of information that has been read from the RX frame descriptor.
  *
  * @signal: Signal of the received frame.
- * @signal_plcp: Does the signal field contain the plcp value,
- *     or does it contain the bitrate itself.
  * @rssi: RSSI of the received frame.
- * @ofdm: Was frame send with an OFDM rate.
  * @size: Data size of the received frame.
  * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags).
- * @my_bss: Does this frame originate from device's BSS.
+ * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags).
+
  */
 struct rxdone_entry_desc {
        int signal;
-       int signal_plcp;
        int rssi;
-       int ofdm;
        int size;
        int flags;
-       int my_bss;
+       int dev_flags;
+};
+
+/**
+ * enum txdone_entry_desc_flags: Flags for &struct txdone_entry_desc
+ *
+ * @TXDONE_UNKNOWN: Hardware could not determine success of transmission.
+ * @TXDONE_SUCCESS: Frame was successfully send
+ * @TXDONE_FAILURE: Frame was not successfully send
+ * @TXDONE_EXCESSIVE_RETRY: In addition to &TXDONE_FAILURE, the
+ *     frame transmission failed due to excessive retries.
+ */
+enum txdone_entry_desc_flags {
+       TXDONE_UNKNOWN = 1 << 0,
+       TXDONE_SUCCESS = 1 << 1,
+       TXDONE_FAILURE = 1 << 2,
+       TXDONE_EXCESSIVE_RETRY = 1 << 3,
 };
 
 /**
@@ -158,13 +180,11 @@ struct rxdone_entry_desc {
  * Summary of information that has been read from the TX frame descriptor
  * after the device is done with transmission.
  *
- * @control: Control structure which was used to transmit the frame.
- * @status: TX status (See &enum tx_status).
+ * @flags: TX done flags (See &enum txdone_entry_desc_flags).
  * @retry: Retry count.
  */
 struct txdone_entry_desc {
-       struct ieee80211_tx_control *control;
-       int status;
+       unsigned long flags;
        int retry;
 };
 
@@ -172,19 +192,25 @@ struct txdone_entry_desc {
  * enum txentry_desc_flags: Status flags for TX entry descriptor
  *
  * @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame.
+ * @ENTRY_TXD_CTS_FRAME: This frame is a CTS-to-self frame.
  * @ENTRY_TXD_OFDM_RATE: This frame is send out with an OFDM rate.
+ * @ENTRY_TXD_FIRST_FRAGMENT: This is the first frame.
  * @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment.
  * @ENTRY_TXD_REQ_TIMESTAMP: Require timestamp to be inserted.
  * @ENTRY_TXD_BURST: This frame belongs to the same burst event.
  * @ENTRY_TXD_ACK: An ACK is required for this frame.
+ * @ENTRY_TXD_RETRY_MODE: When set, the long retry count is used.
  */
 enum txentry_desc_flags {
        ENTRY_TXD_RTS_FRAME,
+       ENTRY_TXD_CTS_FRAME,
        ENTRY_TXD_OFDM_RATE,
+       ENTRY_TXD_FIRST_FRAGMENT,
        ENTRY_TXD_MORE_FRAG,
        ENTRY_TXD_REQ_TIMESTAMP,
        ENTRY_TXD_BURST,
        ENTRY_TXD_ACK,
+       ENTRY_TXD_RETRY_MODE,
 };
 
 /**
@@ -198,6 +224,7 @@ enum txentry_desc_flags {
  * @length_low: PLCP length low word.
  * @signal: PLCP signal.
  * @service: PLCP service.
+ * @retry_limit: Max number of retries.
  * @aifs: AIFS value.
  * @ifs: IFS value.
  * @cw_min: cwmin value.
@@ -213,10 +240,11 @@ struct txentry_desc {
        u16 signal;
        u16 service;
 
-       int aifs;
-       int ifs;
-       int cw_min;
-       int cw_max;
+       short retry_limit;
+       short aifs;
+       short ifs;
+       short cw_min;
+       short cw_max;
 };
 
 /**
@@ -231,12 +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,
 };
 
 /**
@@ -294,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.
@@ -312,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];
 
@@ -361,7 +393,7 @@ struct data_queue_desc {
  * the end of the TX queue array.
  */
 #define tx_queue_end(__dev) \
-       &(__dev)->tx[(__dev)->hw->queues]
+       &(__dev)->tx[(__dev)->ops->tx_queues]
 
 /**
  * queue_loop - Loop through the queues within a specific range (HELPER MACRO).
@@ -435,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