aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-07-09 09:12:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:52:56 -0400
commitbd88a7812f1afd50549f3789cacb707b983fef54 (patch)
tree53818d0fbfacabca3ac5f64bf524f5f71952fa27 /drivers/net/wireless/rt2x00/rt2x00queue.c
parente360c4cb2bc2fb2a37981809685984efe8433c52 (diff)
rt2x00: Reorganize beacon handling
With the new beacon handling from mac80211 we can reorganize the beacon handling in rt2x00 as well. This patch will move the function to the TX handlers, and move all duplicate code into rt2x00queue.c. After this change the descriptor helper functions from rt2x00queue.c no longer need to be exported outside of rt2x00lib and can be declared static. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c64
1 files changed, 58 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index ecf57f8f34b2..7f442030f5ad 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -115,8 +115,8 @@ void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
115 dev_kfree_skb_any(skb); 115 dev_kfree_skb_any(skb);
116} 116}
117 117
118void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, 118static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
119 struct txentry_desc *txdesc) 119 struct txentry_desc *txdesc)
120{ 120{
121 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 121 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
122 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 122 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
@@ -240,10 +240,9 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
240 txdesc->signal |= 0x08; 240 txdesc->signal |= 0x08;
241 } 241 }
242} 242}
243EXPORT_SYMBOL_GPL(rt2x00queue_create_tx_descriptor);
244 243
245void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, 244static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
246 struct txentry_desc *txdesc) 245 struct txentry_desc *txdesc)
247{ 246{
248 struct data_queue *queue = entry->queue; 247 struct data_queue *queue = entry->queue;
249 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; 248 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
@@ -273,7 +272,6 @@ void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
273 !test_bit(ENTRY_TXD_BURST, &txdesc->flags)) 272 !test_bit(ENTRY_TXD_BURST, &txdesc->flags))
274 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid); 273 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid);
275} 274}
276EXPORT_SYMBOL_GPL(rt2x00queue_write_tx_descriptor);
277 275
278int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb) 276int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)
279{ 277{
@@ -323,6 +321,60 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)
323 return 0; 321 return 0;
324} 322}
325 323
324int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
325 struct ieee80211_vif *vif)
326{
327 struct rt2x00_intf *intf = vif_to_intf(vif);
328 struct skb_frame_desc *skbdesc;
329 struct txentry_desc txdesc;
330 __le32 desc[16];
331
332 if (unlikely(!intf->beacon))
333 return -ENOBUFS;
334
335 intf->beacon->skb = ieee80211_beacon_get(rt2x00dev->hw, vif);
336 if (!intf->beacon->skb)
337 return -ENOMEM;
338
339 /*
340 * Copy all TX descriptor information into txdesc,
341 * after that we are free to use the skb->cb array
342 * for our information.
343 */
344 rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc);
345
346 /*
347 * For the descriptor we use a local array from where the
348 * driver can move it to the correct location required for
349 * the hardware.
350 */
351 memset(desc, 0, sizeof(desc));
352
353 /*
354 * Fill in skb descriptor
355 */
356 skbdesc = get_skb_frame_desc(intf->beacon->skb);
357 memset(skbdesc, 0, sizeof(*skbdesc));
358 skbdesc->desc = desc;
359 skbdesc->desc_len = intf->beacon->queue->desc_size;
360 skbdesc->entry = intf->beacon;
361
362 /*
363 * Write TX descriptor into reserved room in front of the beacon.
364 */
365 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
366
367 /*
368 * Send beacon to hardware.
369 * Also enable beacon generation, which might have been disabled
370 * by the driver during the config_beacon() callback function.
371 */
372 rt2x00dev->ops->lib->write_beacon(intf->beacon);
373 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
374
375 return 0;
376}
377
326struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev, 378struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
327 const enum data_queue_qid queue) 379 const enum data_queue_qid queue)
328{ 380{