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.h73
1 files changed, 42 insertions, 31 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index d1707a7ca41f..4d00ced14cc7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -80,19 +80,6 @@ enum data_queue_qid {
80}; 80};
81 81
82/** 82/**
83 * mac80211_queue_to_qid - Convert mac80211 queue to rt2x00 qid
84 * @queue: mac80211 queue.
85 */
86static inline enum data_queue_qid mac80211_queue_to_qid(unsigned int queue)
87{
88 /* Regular TX queues are mapped directly */
89 if (queue < 4)
90 return queue;
91 WARN_ON(1);
92 return QID_OTHER;
93}
94
95/**
96 * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc 83 * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc
97 * 84 *
98 * @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver 85 * @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver
@@ -105,11 +92,10 @@ enum skb_frame_desc_flags {
105/** 92/**
106 * struct skb_frame_desc: Descriptor information for the skb buffer 93 * struct skb_frame_desc: Descriptor information for the skb buffer
107 * 94 *
108 * This structure is placed over the skb->cb array, this means that 95 * This structure is placed over the driver_data array, this means that
109 * this structure should not exceed the size of that array (48 bytes). 96 * this structure should not exceed the size of that array (40 bytes).
110 * 97 *
111 * @flags: Frame flags, see &enum skb_frame_desc_flags. 98 * @flags: Frame flags, see &enum skb_frame_desc_flags.
112 * @frame_type: Frame type, see &enum rt2x00_dump_type.
113 * @data: Pointer to data part of frame (Start of ieee80211 header). 99 * @data: Pointer to data part of frame (Start of ieee80211 header).
114 * @desc: Pointer to descriptor part of the frame. 100 * @desc: Pointer to descriptor part of the frame.
115 * Note that this pointer could point to something outside 101 * Note that this pointer could point to something outside
@@ -121,21 +107,24 @@ enum skb_frame_desc_flags {
121struct skb_frame_desc { 107struct skb_frame_desc {
122 unsigned int flags; 108 unsigned int flags;
123 109
124 unsigned int frame_type; 110 unsigned short data_len;
111 unsigned short desc_len;
125 112
126 void *data; 113 void *data;
127 void *desc; 114 void *desc;
128 115
129 unsigned int data_len;
130 unsigned int desc_len;
131
132 struct queue_entry *entry; 116 struct queue_entry *entry;
133}; 117};
134 118
119/**
120 * get_skb_frame_desc - Obtain the rt2x00 frame descriptor from a sk_buff.
121 * @skb: &struct sk_buff from where we obtain the &struct skb_frame_desc
122 */
135static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) 123static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb)
136{ 124{
137 BUILD_BUG_ON(sizeof(struct skb_frame_desc) > sizeof(skb->cb)); 125 BUILD_BUG_ON(sizeof(struct skb_frame_desc) >
138 return (struct skb_frame_desc *)&skb->cb[0]; 126 IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
127 return (struct skb_frame_desc *)&IEEE80211_SKB_CB(skb)->driver_data;
139} 128}
140 129
141/** 130/**
@@ -171,18 +160,32 @@ struct rxdone_entry_desc {
171}; 160};
172 161
173/** 162/**
163 * enum txdone_entry_desc_flags: Flags for &struct txdone_entry_desc
164 *
165 * @TXDONE_UNKNOWN: Hardware could not determine success of transmission.
166 * @TXDONE_SUCCESS: Frame was successfully send
167 * @TXDONE_FAILURE: Frame was not successfully send
168 * @TXDONE_EXCESSIVE_RETRY: In addition to &TXDONE_FAILURE, the
169 * frame transmission failed due to excessive retries.
170 */
171enum txdone_entry_desc_flags {
172 TXDONE_UNKNOWN = 1 << 0,
173 TXDONE_SUCCESS = 1 << 1,
174 TXDONE_FAILURE = 1 << 2,
175 TXDONE_EXCESSIVE_RETRY = 1 << 3,
176};
177
178/**
174 * struct txdone_entry_desc: TX done entry descriptor 179 * struct txdone_entry_desc: TX done entry descriptor
175 * 180 *
176 * Summary of information that has been read from the TX frame descriptor 181 * Summary of information that has been read from the TX frame descriptor
177 * after the device is done with transmission. 182 * after the device is done with transmission.
178 * 183 *
179 * @control: Control structure which was used to transmit the frame. 184 * @flags: TX done flags (See &enum txdone_entry_desc_flags).
180 * @status: TX status (See &enum tx_status).
181 * @retry: Retry count. 185 * @retry: Retry count.
182 */ 186 */
183struct txdone_entry_desc { 187struct txdone_entry_desc {
184 struct ieee80211_tx_control *control; 188 unsigned long flags;
185 int status;
186 int retry; 189 int retry;
187}; 190};
188 191
@@ -190,19 +193,25 @@ struct txdone_entry_desc {
190 * enum txentry_desc_flags: Status flags for TX entry descriptor 193 * enum txentry_desc_flags: Status flags for TX entry descriptor
191 * 194 *
192 * @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame. 195 * @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame.
196 * @ENTRY_TXD_CTS_FRAME: This frame is a CTS-to-self frame.
193 * @ENTRY_TXD_OFDM_RATE: This frame is send out with an OFDM rate. 197 * @ENTRY_TXD_OFDM_RATE: This frame is send out with an OFDM rate.
198 * @ENTRY_TXD_FIRST_FRAGMENT: This is the first frame.
194 * @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment. 199 * @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment.
195 * @ENTRY_TXD_REQ_TIMESTAMP: Require timestamp to be inserted. 200 * @ENTRY_TXD_REQ_TIMESTAMP: Require timestamp to be inserted.
196 * @ENTRY_TXD_BURST: This frame belongs to the same burst event. 201 * @ENTRY_TXD_BURST: This frame belongs to the same burst event.
197 * @ENTRY_TXD_ACK: An ACK is required for this frame. 202 * @ENTRY_TXD_ACK: An ACK is required for this frame.
203 * @ENTRY_TXD_RETRY_MODE: When set, the long retry count is used.
198 */ 204 */
199enum txentry_desc_flags { 205enum txentry_desc_flags {
200 ENTRY_TXD_RTS_FRAME, 206 ENTRY_TXD_RTS_FRAME,
207 ENTRY_TXD_CTS_FRAME,
201 ENTRY_TXD_OFDM_RATE, 208 ENTRY_TXD_OFDM_RATE,
209 ENTRY_TXD_FIRST_FRAGMENT,
202 ENTRY_TXD_MORE_FRAG, 210 ENTRY_TXD_MORE_FRAG,
203 ENTRY_TXD_REQ_TIMESTAMP, 211 ENTRY_TXD_REQ_TIMESTAMP,
204 ENTRY_TXD_BURST, 212 ENTRY_TXD_BURST,
205 ENTRY_TXD_ACK, 213 ENTRY_TXD_ACK,
214 ENTRY_TXD_RETRY_MODE,
206}; 215};
207 216
208/** 217/**
@@ -216,6 +225,7 @@ enum txentry_desc_flags {
216 * @length_low: PLCP length low word. 225 * @length_low: PLCP length low word.
217 * @signal: PLCP signal. 226 * @signal: PLCP signal.
218 * @service: PLCP service. 227 * @service: PLCP service.
228 * @retry_limit: Max number of retries.
219 * @aifs: AIFS value. 229 * @aifs: AIFS value.
220 * @ifs: IFS value. 230 * @ifs: IFS value.
221 * @cw_min: cwmin value. 231 * @cw_min: cwmin value.
@@ -231,10 +241,11 @@ struct txentry_desc {
231 u16 signal; 241 u16 signal;
232 u16 service; 242 u16 service;
233 243
234 int aifs; 244 short retry_limit;
235 int ifs; 245 short aifs;
236 int cw_min; 246 short ifs;
237 int cw_max; 247 short cw_min;
248 short cw_max;
238}; 249};
239 250
240/** 251/**
@@ -378,7 +389,7 @@ struct data_queue_desc {
378 * the end of the TX queue array. 389 * the end of the TX queue array.
379 */ 390 */
380#define tx_queue_end(__dev) \ 391#define tx_queue_end(__dev) \
381 &(__dev)->tx[(__dev)->hw->queues] 392 &(__dev)->tx[(__dev)->ops->tx_queues]
382 393
383/** 394/**
384 * queue_loop - Loop through the queues within a specific range (HELPER MACRO). 395 * queue_loop - Loop through the queues within a specific range (HELPER MACRO).