Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111166
b: refs/heads/master
c: b9740c2
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Wagner authored and John W. Linville committed Aug 22, 2008
1 parent cab3f43 commit dc7ef1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 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: 8e5f3d0aaa3ae5305613553f869727b0361cd472
refs/heads/master: b9740c2396851178b99c03c2260a0adfe7f52e36
43 changes: 20 additions & 23 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
struct ieee80211_tx_info *rts_info;
struct sk_buff *skb;
int size;
int retval = 0;

if (tx_info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)
size = sizeof(struct ieee80211_cts);
else
size = sizeof(struct ieee80211_rts);

skb = dev_alloc_skb(size + rt2x00dev->hw->extra_tx_headroom);
if (!skb) {
if (unlikely(!skb)) {
WARNING(rt2x00dev, "Failed to create RTS/CTS frame.\n");
return NETDEV_TX_BUSY;
return -ENOMEM;
}

skb_reserve(skb, rt2x00dev->hw->extra_tx_headroom);
Expand Down Expand Up @@ -82,13 +83,13 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
frag_skb->data, size, tx_info,
(struct ieee80211_rts *)(skb->data));

if (rt2x00queue_write_tx_frame(queue, skb)) {
retval = rt2x00queue_write_tx_frame(queue, skb);
if (retval) {
dev_kfree_skb_any(skb);
WARNING(rt2x00dev, "Failed to send RTS/CTS frame.\n");
return NETDEV_TX_BUSY;
}

return NETDEV_TX_OK;
return retval;
}

int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
Expand All @@ -106,11 +107,8 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
* Note that we can only stop the TX queues inside the TX path
* due to possible race conditions in mac80211.
*/
if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) {
ieee80211_stop_queues(hw);
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}
if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags))
goto exit_fail;

/*
* Determine which queue to put packet on.
Expand Down Expand Up @@ -141,26 +139,25 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
if ((tx_info->flags & (IEEE80211_TX_CTL_USE_RTS_CTS |
IEEE80211_TX_CTL_USE_CTS_PROTECT)) &&
!rt2x00dev->ops->hw->set_rts_threshold) {
if (rt2x00queue_available(queue) <= 1) {
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
}

if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb)) {
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
}
}
if (rt2x00queue_available(queue) <= 1)
goto exit_fail;

if (rt2x00queue_write_tx_frame(queue, skb)) {
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb))
goto exit_fail;
}

if (rt2x00queue_write_tx_frame(queue, skb))
goto exit_fail;

if (rt2x00queue_threshold(queue))
ieee80211_stop_queue(rt2x00dev->hw, qid);

return NETDEV_TX_OK;

exit_fail:
ieee80211_stop_queue(rt2x00dev->hw, qid);
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}
EXPORT_SYMBOL_GPL(rt2x00mac_tx);

Expand Down

0 comments on commit dc7ef1a

Please sign in to comment.