b44: use netdev_alloc_skb
Use netdev_alloc_skb rather than dev_alloc_skb when allocating receive buffers. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
72f4861ef9
commit
bf0dcbd929
1 changed files with 2 additions and 3 deletions
|
@ -653,7 +653,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
|
||||||
src_map = &bp->rx_buffers[src_idx];
|
src_map = &bp->rx_buffers[src_idx];
|
||||||
dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1);
|
dest_idx = dest_idx_unmasked & (B44_RX_RING_SIZE - 1);
|
||||||
map = &bp->rx_buffers[dest_idx];
|
map = &bp->rx_buffers[dest_idx];
|
||||||
skb = dev_alloc_skb(RX_PKT_BUF_SZ);
|
skb = netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ);
|
||||||
if (skb == NULL)
|
if (skb == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -669,7 +669,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
|
||||||
if (!dma_mapping_error(mapping))
|
if (!dma_mapping_error(mapping))
|
||||||
pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
|
pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
|
||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA);
|
skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA);
|
||||||
if (skb == NULL)
|
if (skb == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
mapping = pci_map_single(bp->pdev, skb->data,
|
mapping = pci_map_single(bp->pdev, skb->data,
|
||||||
|
@ -684,7 +684,6 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->dev = bp->dev;
|
|
||||||
rh = (struct rx_header *) skb->data;
|
rh = (struct rx_header *) skb->data;
|
||||||
skb_reserve(skb, RX_PKT_OFFSET);
|
skb_reserve(skb, RX_PKT_OFFSET);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue