aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-07-01 20:34:14 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-01 20:34:14 -0400
commit05318bc905467237d4aa68a701f6e92a2b332218 (patch)
tree3b7577383bca50aeb442568aa16cf8f2167b8694 /drivers/net/wireless/rt2x00/rt2x00queue.c
parentea812ca1b06113597adcd8e70c0f84a413d97544 (diff)
parent88c1f4f6dffe66e2fed8e7e3276e091ee850bed0 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Conflicts: drivers/net/wireless/libertas/host.h
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index f91637147116..5097fe0f9f51 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -404,6 +404,46 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
404 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); 404 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate);
405} 405}
406 406
407static int rt2x00queue_write_tx_data(struct queue_entry *entry,
408 struct txentry_desc *txdesc)
409{
410 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
411
412 /*
413 * This should not happen, we already checked the entry
414 * was ours. When the hardware disagrees there has been
415 * a queue corruption!
416 */
417 if (unlikely(rt2x00dev->ops->lib->get_entry_state &&
418 rt2x00dev->ops->lib->get_entry_state(entry))) {
419 ERROR(rt2x00dev,
420 "Corrupt queue %d, accessing entry which is not ours.\n"
421 "Please file bug report to %s.\n",
422 entry->queue->qid, DRV_PROJECT);
423 return -EINVAL;
424 }
425
426 /*
427 * Add the requested extra tx headroom in front of the skb.
428 */
429 skb_push(entry->skb, rt2x00dev->ops->extra_tx_headroom);
430 memset(entry->skb->data, 0, rt2x00dev->ops->extra_tx_headroom);
431
432 /*
433 * Call the driver's write_tx_data function, if it exists.
434 */
435 if (rt2x00dev->ops->lib->write_tx_data)
436 rt2x00dev->ops->lib->write_tx_data(entry, txdesc);
437
438 /*
439 * Map the skb to DMA.
440 */
441 if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
442 rt2x00queue_map_txskb(rt2x00dev, entry->skb);
443
444 return 0;
445}
446
407static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, 447static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
408 struct txentry_desc *txdesc) 448 struct txentry_desc *txdesc)
409{ 449{
@@ -515,8 +555,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
515 * call failed. Since we always return NETDEV_TX_OK to mac80211, 555 * call failed. Since we always return NETDEV_TX_OK to mac80211,
516 * this frame will simply be dropped. 556 * this frame will simply be dropped.
517 */ 557 */
518 if (unlikely(queue->rt2x00dev->ops->lib->write_tx_data(entry, 558 if (unlikely(rt2x00queue_write_tx_data(entry, &txdesc))) {
519 &txdesc))) {
520 clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 559 clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
521 entry->skb = NULL; 560 entry->skb = NULL;
522 return -EIO; 561 return -EIO;