Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122818
b: refs/heads/master
c: f1bc4ac
h: refs/heads/master
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Dec 19, 2008
1 parent 263b6bc commit ea0c404
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 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: 4087f6f68cdbd2845c7e54236bae1b058a7b827b
refs/heads/master: f1bc4ac61f2c08515afd80c6dc3962aa6d0b138b
12 changes: 1 addition & 11 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,16 +1110,6 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv)
priv->cfg->ops->lib->rx_handler_setup(priv);
}

/*
* this should be called while priv->lock is locked
*/
static void __iwl_rx_replenish(struct iwl_priv *priv)
{
iwl_rx_allocate(priv);
iwl_rx_queue_restock(priv);
}


/**
* iwl_rx_handle - Main entry function for receiving responses from uCode
*
Expand Down Expand Up @@ -1228,7 +1218,7 @@ void iwl_rx_handle(struct iwl_priv *priv)
count++;
if (count >= 8) {
priv->rxq.read = i;
__iwl_rx_replenish(priv);
iwl_rx_queue_restock(priv);
count = 0;
}
}
Expand Down
29 changes: 19 additions & 10 deletions trunk/drivers/net/wireless/iwlwifi/iwl-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,31 @@ void iwl_rx_allocate(struct iwl_priv *priv)
struct list_head *element;
struct iwl_rx_mem_buffer *rxb;
unsigned long flags;
spin_lock_irqsave(&rxq->lock, flags);
while (!list_empty(&rxq->rx_used)) {

while (1) {
spin_lock_irqsave(&rxq->lock, flags);

if (list_empty(&rxq->rx_used)) {
spin_unlock_irqrestore(&rxq->lock, flags);
return;
}
element = rxq->rx_used.next;
rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
list_del(element);

spin_unlock_irqrestore(&rxq->lock, flags);

/* Alloc a new receive buffer */
rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
__GFP_NOWARN | GFP_ATOMIC);
GFP_KERNEL);
if (!rxb->skb) {
if (net_ratelimit())
printk(KERN_CRIT DRV_NAME
": Can not allocate SKB buffers\n");
printk(KERN_CRIT DRV_NAME
"Can not allocate SKB buffers\n");
/* We don't reschedule replenish work here -- we will
* call the restock method and if it still needs
* more buffers it will schedule replenish */
break;
}
priv->alloc_rxb_skb++;
list_del(element);

/* Get physical address of RB/SKB */
rxb->real_dma_addr = pci_map_single(
Expand All @@ -276,12 +282,15 @@ void iwl_rx_allocate(struct iwl_priv *priv)
rxb->aligned_dma_addr = ALIGN(rxb->real_dma_addr, 256);
skb_reserve(rxb->skb, rxb->aligned_dma_addr - rxb->real_dma_addr);

spin_lock_irqsave(&rxq->lock, flags);

list_add_tail(&rxb->list, &rxq->rx_free);
rxq->free_count++;
priv->alloc_rxb_skb++;

spin_unlock_irqrestore(&rxq->lock, flags);
}
spin_unlock_irqrestore(&rxq->lock, flags);
}
EXPORT_SYMBOL(iwl_rx_allocate);

void iwl_rx_replenish(struct iwl_priv *priv)
{
Expand Down

0 comments on commit ea0c404

Please sign in to comment.