Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183611
b: refs/heads/master
c: efb7c49
h: refs/heads/master
i:
  183609: aaca283
  183607: 21c6832
v: v3
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Jan 12, 2010
1 parent 8f4b0e8 commit 327e410
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 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: b64fe619e371fc17d8d686d6d44aef1b41317880
refs/heads/master: efb7c49a68cf206f35793d7799608e1d69a209f9
22 changes: 13 additions & 9 deletions trunk/drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,13 +1249,15 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw)
MWL8K_TXD_STATUS_OK_RETRY | \
MWL8K_TXD_STATUS_OK_MORE_RETRY))

static void mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int force)
static int
mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
{
struct mwl8k_priv *priv = hw->priv;
struct mwl8k_tx_queue *txq = priv->txq + index;
int wake = 0;
int processed;

while (txq->stats.len > 0) {
processed = 0;
while (txq->stats.len > 0 && limit--) {
int tx;
struct mwl8k_tx_desc *tx_desc;
unsigned long addr;
Expand Down Expand Up @@ -1302,11 +1304,13 @@ static void mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int force)

ieee80211_tx_status_irqsafe(hw, skb);

wake = 1;
processed++;
}

if (wake && priv->radio_on && !mutex_is_locked(&priv->fw_mutex))
if (processed && priv->radio_on && !mutex_is_locked(&priv->fw_mutex))
ieee80211_wake_queue(hw, index);

return processed;
}

/* must be called only when the card's transmit is completely halted */
Expand All @@ -1315,7 +1319,7 @@ static void mwl8k_txq_deinit(struct ieee80211_hw *hw, int index)
struct mwl8k_priv *priv = hw->priv;
struct mwl8k_tx_queue *txq = priv->txq + index;

mwl8k_txq_reclaim(hw, index, 1);
mwl8k_txq_reclaim(hw, index, INT_MAX, 1);

kfree(txq->skb);
txq->skb = NULL;
Expand Down Expand Up @@ -3084,7 +3088,7 @@ static void mwl8k_stop(struct ieee80211_hw *hw)

/* Return all skbs to mac80211 */
for (i = 0; i < MWL8K_TX_QUEUES; i++)
mwl8k_txq_reclaim(hw, i, 1);
mwl8k_txq_reclaim(hw, i, INT_MAX, 1);
}

static int mwl8k_add_interface(struct ieee80211_hw *hw,
Expand Down Expand Up @@ -3647,7 +3651,7 @@ static void mwl8k_tx_reclaim_handler(unsigned long data)

spin_lock_bh(&priv->tx_lock);
for (i = 0; i < MWL8K_TX_QUEUES; i++)
mwl8k_txq_reclaim(hw, i, 0);
mwl8k_txq_reclaim(hw, i, INT_MAX, 0);

if (priv->tx_wait != NULL && !priv->pending_tx_pkts) {
complete(priv->tx_wait);
Expand Down Expand Up @@ -4021,7 +4025,7 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)

/* Return all skbs to mac80211 */
for (i = 0; i < MWL8K_TX_QUEUES; i++)
mwl8k_txq_reclaim(hw, i, 1);
mwl8k_txq_reclaim(hw, i, INT_MAX, 1);

for (i = 0; i < MWL8K_TX_QUEUES; i++)
mwl8k_txq_deinit(hw, i);
Expand Down

0 comments on commit 327e410

Please sign in to comment.