diff options
Diffstat (limited to 'drivers/net/ethernet/packetengines/hamachi.c')
-rw-r--r-- | drivers/net/ethernet/packetengines/hamachi.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/packetengines/hamachi.c b/drivers/net/ethernet/packetengines/hamachi.c index 3458df3780b8..0d29f5f4b8e4 100644 --- a/drivers/net/ethernet/packetengines/hamachi.c +++ b/drivers/net/ethernet/packetengines/hamachi.c | |||
@@ -1188,11 +1188,10 @@ static void hamachi_init_ring(struct net_device *dev) | |||
1188 | } | 1188 | } |
1189 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 1189 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
1190 | for (i = 0; i < RX_RING_SIZE; i++) { | 1190 | for (i = 0; i < RX_RING_SIZE; i++) { |
1191 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2); | 1191 | struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz + 2); |
1192 | hmp->rx_skbuff[i] = skb; | 1192 | hmp->rx_skbuff[i] = skb; |
1193 | if (skb == NULL) | 1193 | if (skb == NULL) |
1194 | break; | 1194 | break; |
1195 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1196 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ | 1195 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ |
1197 | hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, | 1196 | hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, |
1198 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 1197 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |
@@ -1488,7 +1487,7 @@ static int hamachi_rx(struct net_device *dev) | |||
1488 | /* Check if the packet is long enough to accept without copying | 1487 | /* Check if the packet is long enough to accept without copying |
1489 | to a minimally-sized skbuff. */ | 1488 | to a minimally-sized skbuff. */ |
1490 | if (pkt_len < rx_copybreak && | 1489 | if (pkt_len < rx_copybreak && |
1491 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1490 | (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) { |
1492 | #ifdef RX_CHECKSUM | 1491 | #ifdef RX_CHECKSUM |
1493 | printk(KERN_ERR "%s: rx_copybreak non-zero " | 1492 | printk(KERN_ERR "%s: rx_copybreak non-zero " |
1494 | "not good with RX_CHECKSUM\n", dev->name); | 1493 | "not good with RX_CHECKSUM\n", dev->name); |
@@ -1591,12 +1590,11 @@ static int hamachi_rx(struct net_device *dev) | |||
1591 | entry = hmp->dirty_rx % RX_RING_SIZE; | 1590 | entry = hmp->dirty_rx % RX_RING_SIZE; |
1592 | desc = &(hmp->rx_ring[entry]); | 1591 | desc = &(hmp->rx_ring[entry]); |
1593 | if (hmp->rx_skbuff[entry] == NULL) { | 1592 | if (hmp->rx_skbuff[entry] == NULL) { |
1594 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2); | 1593 | struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz + 2); |
1595 | 1594 | ||
1596 | hmp->rx_skbuff[entry] = skb; | 1595 | hmp->rx_skbuff[entry] = skb; |
1597 | if (skb == NULL) | 1596 | if (skb == NULL) |
1598 | break; /* Better luck next round. */ | 1597 | break; /* Better luck next round. */ |
1599 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1600 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1598 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
1601 | desc->addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, | 1599 | desc->addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, |
1602 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 1600 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |