Skip to content

Commit b26b555

Browse files
kevloJeff Garzik
authored andcommitted
via-rhine: changed to use netdev_alloc_skb() from dev_alloc_skb
Use netdev_alloc_skb. This sets skb->dev and allows arch specific allocation. Also cleanup the alignment code. Signed-off-by: Kevin Lo <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent c844d48 commit b26b555

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/via-rhine.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ static void alloc_rbufs(struct net_device *dev)
914914

915915
/* Fill in the Rx buffers. Handle allocation failure gracefully. */
916916
for (i = 0; i < RX_RING_SIZE; i++) {
917-
struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz);
917+
struct sk_buff *skb = netdev_alloc_skb(dev, rp->rx_buf_sz);
918918
rp->rx_skbuff[i] = skb;
919919
if (skb == NULL)
920920
break;
@@ -1473,8 +1473,8 @@ static int rhine_rx(struct net_device *dev, int limit)
14731473
/* Check if the packet is long enough to accept without
14741474
copying to a minimally-sized skbuff. */
14751475
if (pkt_len < rx_copybreak &&
1476-
(skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
1477-
skb_reserve(skb, 2); /* 16 byte align the IP header */
1476+
(skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN)) != NULL) {
1477+
skb_reserve(skb, NET_IP_ALIGN); /* 16 byte align the IP header */
14781478
pci_dma_sync_single_for_cpu(rp->pdev,
14791479
rp->rx_skbuff_dma[entry],
14801480
rp->rx_buf_sz,
@@ -1518,7 +1518,7 @@ static int rhine_rx(struct net_device *dev, int limit)
15181518
struct sk_buff *skb;
15191519
entry = rp->dirty_rx % RX_RING_SIZE;
15201520
if (rp->rx_skbuff[entry] == NULL) {
1521-
skb = dev_alloc_skb(rp->rx_buf_sz);
1521+
skb = netdev_alloc_skb(dev, rp->rx_buf_sz);
15221522
rp->rx_skbuff[entry] = skb;
15231523
if (skb == NULL)
15241524
break; /* Better luck next round. */

0 commit comments

Comments
 (0)