|
@@ -239,26 +239,22 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority)
|
|
struct iwl_rx_queue *rxq = &priv->rxq;
|
|
struct iwl_rx_queue *rxq = &priv->rxq;
|
|
struct list_head *element;
|
|
struct list_head *element;
|
|
struct iwl_rx_mem_buffer *rxb;
|
|
struct iwl_rx_mem_buffer *rxb;
|
|
|
|
+ struct sk_buff *skb;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
while (1) {
|
|
while (1) {
|
|
spin_lock_irqsave(&rxq->lock, flags);
|
|
spin_lock_irqsave(&rxq->lock, flags);
|
|
-
|
|
|
|
if (list_empty(&rxq->rx_used)) {
|
|
if (list_empty(&rxq->rx_used)) {
|
|
spin_unlock_irqrestore(&rxq->lock, flags);
|
|
spin_unlock_irqrestore(&rxq->lock, flags);
|
|
return;
|
|
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);
|
|
spin_unlock_irqrestore(&rxq->lock, flags);
|
|
|
|
|
|
/* Alloc a new receive buffer */
|
|
/* Alloc a new receive buffer */
|
|
- rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
|
|
|
|
|
|
+ skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
|
|
priority);
|
|
priority);
|
|
|
|
|
|
- if (!rxb->skb) {
|
|
|
|
|
|
+ if (!skb) {
|
|
IWL_CRIT(priv, "Can not allocate SKB buffers\n");
|
|
IWL_CRIT(priv, "Can not allocate SKB buffers\n");
|
|
/* We don't reschedule replenish work here -- we will
|
|
/* We don't reschedule replenish work here -- we will
|
|
* call the restock method and if it still needs
|
|
* call the restock method and if it still needs
|
|
@@ -266,6 +262,20 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ spin_lock_irqsave(&rxq->lock, flags);
|
|
|
|
+
|
|
|
|
+ if (list_empty(&rxq->rx_used)) {
|
|
|
|
+ spin_unlock_irqrestore(&rxq->lock, flags);
|
|
|
|
+ dev_kfree_skb_any(skb);
|
|
|
|
+ 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);
|
|
|
|
+
|
|
|
|
+ rxb->skb = skb;
|
|
/* Get physical address of RB/SKB */
|
|
/* Get physical address of RB/SKB */
|
|
rxb->real_dma_addr = pci_map_single(
|
|
rxb->real_dma_addr = pci_map_single(
|
|
priv->pci_dev,
|
|
priv->pci_dev,
|