Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256239
b: refs/heads/master
c: 128f8f7
h: refs/heads/master
i:
  256237: 185e706
  256235: e86df84
  256231: 2bd7fff
  256223: 67041c9
v: v3
  • Loading branch information
Gertjan van Wingerde authored and John W. Linville committed Jul 7, 2011
1 parent 8024543 commit 5db29da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77b5621bac4a56b83b9081f48d4e7d1accdde400
refs/heads/master: 128f8f773d77d41a7dbcaf5d36325a0f4e7955cd
51 changes: 26 additions & 25 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,33 +565,11 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
u8 rate_idx, rate_flags;
int ret = 0;

spin_lock(&queue->tx_lock);

entry = rt2x00queue_get_entry(queue, Q_INDEX);

if (unlikely(rt2x00queue_full(queue))) {
ERROR(queue->rt2x00dev,
"Dropping frame due to full tx queue %d.\n", queue->qid);
ret = -ENOBUFS;
goto out;
}

if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
&entry->flags))) {
ERROR(queue->rt2x00dev,
"Arrived at non-free entry in the non-full queue %d.\n"
"Please file bug report to %s.\n",
queue->qid, DRV_PROJECT);
ret = -EINVAL;
goto out;
}

/*
* Copy all TX descriptor information into txdesc,
* after that we are free to use the skb->cb array
* for our information.
*/
entry->skb = skb;
rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc);

/*
Expand All @@ -604,7 +582,6 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
rate_flags = tx_info->control.rates[0].flags;
skbdesc = get_skb_frame_desc(skb);
memset(skbdesc, 0, sizeof(*skbdesc));
skbdesc->entry = entry;
skbdesc->tx_rate_idx = rate_idx;
skbdesc->tx_rate_flags = rate_flags;

Expand Down Expand Up @@ -633,9 +610,33 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
* for PCI devices.
*/
if (test_bit(REQUIRE_L2PAD, &queue->rt2x00dev->cap_flags))
rt2x00queue_insert_l2pad(entry->skb, txdesc.header_length);
rt2x00queue_insert_l2pad(skb, txdesc.header_length);
else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags))
rt2x00queue_align_frame(entry->skb);
rt2x00queue_align_frame(skb);

spin_lock(&queue->tx_lock);

if (unlikely(rt2x00queue_full(queue))) {
ERROR(queue->rt2x00dev,
"Dropping frame due to full tx queue %d.\n", queue->qid);
ret = -ENOBUFS;
goto out;
}

entry = rt2x00queue_get_entry(queue, Q_INDEX);

if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
&entry->flags))) {
ERROR(queue->rt2x00dev,
"Arrived at non-free entry in the non-full queue %d.\n"
"Please file bug report to %s.\n",
queue->qid, DRV_PROJECT);
ret = -EINVAL;
goto out;
}

skbdesc->entry = entry;
entry->skb = skb;

/*
* It could be possible that the queue was corrupted and this
Expand Down

0 comments on commit 5db29da

Please sign in to comment.