Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237001
b: refs/heads/master
c: e7332a4
h: refs/heads/master
i:
  236999: 675a88b
v: v3
  • Loading branch information
David Gnedt authored and John W. Linville committed Feb 3, 2011
1 parent f6a5765 commit a6af749
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 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: 172710bf8305c1b145796e34426c865480884024
refs/heads/master: e7332a41442bde1c14550998cadceca34c967dfc
48 changes: 12 additions & 36 deletions trunk/drivers/net/wireless/wl1251/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
{
struct ieee80211_tx_info *info;
struct sk_buff *skb;
int hdrlen, ret;
int hdrlen;
u8 *frame;

skb = wl->tx_frames[result->id];
Expand Down Expand Up @@ -407,40 +407,12 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
ieee80211_tx_status(wl->hw, skb);

wl->tx_frames[result->id] = NULL;

if (wl->tx_queue_stopped) {
wl1251_debug(DEBUG_TX, "cb: queue was stopped");

skb = skb_dequeue(&wl->tx_queue);

/* The skb can be NULL because tx_work might have been
scheduled before the queue was stopped making the
queue empty */

if (skb) {
ret = wl1251_tx_frame(wl, skb);
if (ret == -EBUSY) {
/* firmware buffer is still full */
wl1251_debug(DEBUG_TX, "cb: fw buffer "
"still full");
skb_queue_head(&wl->tx_queue, skb);
return;
} else if (ret < 0) {
dev_kfree_skb(skb);
return;
}
}

wl1251_debug(DEBUG_TX, "cb: waking queues");
ieee80211_wake_queues(wl->hw);
wl->tx_queue_stopped = false;
}
}

/* Called upon reception of a TX complete interrupt */
void wl1251_tx_complete(struct wl1251 *wl)
{
int i, result_index, num_complete = 0;
int i, result_index, num_complete = 0, queue_len;
struct tx_result result[FW_TX_CMPLT_BLOCK_SIZE], *result_ptr;
unsigned long flags;

Expand Down Expand Up @@ -471,18 +443,22 @@ void wl1251_tx_complete(struct wl1251 *wl)
}
}

if (wl->tx_queue_stopped
&&
skb_queue_len(&wl->tx_queue) <= WL1251_TX_QUEUE_LOW_WATERMARK){
queue_len = skb_queue_len(&wl->tx_queue);

/* firmware buffer has space, restart queues */
if ((num_complete > 0) && (queue_len > 0)) {
/* firmware buffer has space, reschedule tx_work */
wl1251_debug(DEBUG_TX, "tx_complete: reschedule tx_work");
ieee80211_queue_work(wl->hw, &wl->tx_work);
}

if (wl->tx_queue_stopped &&
queue_len <= WL1251_TX_QUEUE_LOW_WATERMARK) {
/* tx_queue has space, restart queues */
wl1251_debug(DEBUG_TX, "tx_complete: waking queues");
spin_lock_irqsave(&wl->wl_lock, flags);
ieee80211_wake_queues(wl->hw);
wl->tx_queue_stopped = false;
spin_unlock_irqrestore(&wl->wl_lock, flags);
ieee80211_queue_work(wl->hw, &wl->tx_work);

}

/* Every completed frame needs to be acknowledged */
Expand Down

0 comments on commit a6af749

Please sign in to comment.