diff options
Diffstat (limited to 'drivers')
33 files changed, 47 insertions, 58 deletions
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c index 5a12276f810d..9d11ab7521bc 100644 --- a/drivers/net/ethernet/netx-eth.c +++ b/drivers/net/ethernet/netx-eth.c | |||
@@ -150,7 +150,7 @@ static void netx_eth_receive(struct net_device *ndev) | |||
150 | seg = (val & FIFO_PTR_SEGMENT_MASK) >> FIFO_PTR_SEGMENT_SHIFT; | 150 | seg = (val & FIFO_PTR_SEGMENT_MASK) >> FIFO_PTR_SEGMENT_SHIFT; |
151 | len = (val & FIFO_PTR_FRAMELEN_MASK) >> FIFO_PTR_FRAMELEN_SHIFT; | 151 | len = (val & FIFO_PTR_FRAMELEN_MASK) >> FIFO_PTR_FRAMELEN_SHIFT; |
152 | 152 | ||
153 | skb = dev_alloc_skb(len); | 153 | skb = netdev_alloc_skb(ndev, len); |
154 | if (unlikely(skb == NULL)) { | 154 | if (unlikely(skb == NULL)) { |
155 | printk(KERN_NOTICE "%s: Low memory, packet dropped.\n", | 155 | printk(KERN_NOTICE "%s: Low memory, packet dropped.\n", |
156 | ndev->name); | 156 | ndev->name); |
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c index b75a0497d58d..6893a65ae55f 100644 --- a/drivers/net/ethernet/nuvoton/w90p910_ether.c +++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c | |||
@@ -735,7 +735,7 @@ static void netdev_rx(struct net_device *dev) | |||
735 | 735 | ||
736 | if (status & RXDS_RXGD) { | 736 | if (status & RXDS_RXGD) { |
737 | data = ether->rdesc->recv_buf[ether->cur_rx]; | 737 | data = ether->rdesc->recv_buf[ether->cur_rx]; |
738 | skb = dev_alloc_skb(length+2); | 738 | skb = netdev_alloc_skb(dev, length + 2); |
739 | if (!skb) { | 739 | if (!skb) { |
740 | dev_err(&pdev->dev, "get skb buffer error\n"); | 740 | dev_err(&pdev->dev, "get skb buffer error\n"); |
741 | ether->stats.rx_dropped++; | 741 | ether->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 4c4e7f458383..5eeb92f87380 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c | |||
@@ -1815,7 +1815,7 @@ static int nv_alloc_rx(struct net_device *dev) | |||
1815 | less_rx = np->last_rx.orig; | 1815 | less_rx = np->last_rx.orig; |
1816 | 1816 | ||
1817 | while (np->put_rx.orig != less_rx) { | 1817 | while (np->put_rx.orig != less_rx) { |
1818 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); | 1818 | struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz + NV_RX_ALLOC_PAD); |
1819 | if (skb) { | 1819 | if (skb) { |
1820 | np->put_rx_ctx->skb = skb; | 1820 | np->put_rx_ctx->skb = skb; |
1821 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, | 1821 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
@@ -1850,7 +1850,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev) | |||
1850 | less_rx = np->last_rx.ex; | 1850 | less_rx = np->last_rx.ex; |
1851 | 1851 | ||
1852 | while (np->put_rx.ex != less_rx) { | 1852 | while (np->put_rx.ex != less_rx) { |
1853 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); | 1853 | struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz + NV_RX_ALLOC_PAD); |
1854 | if (skb) { | 1854 | if (skb) { |
1855 | np->put_rx_ctx->skb = skb; | 1855 | np->put_rx_ctx->skb = skb; |
1856 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, | 1856 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
@@ -4993,9 +4993,9 @@ static int nv_loopback_test(struct net_device *dev) | |||
4993 | 4993 | ||
4994 | /* setup packet for tx */ | 4994 | /* setup packet for tx */ |
4995 | pkt_len = ETH_DATA_LEN; | 4995 | pkt_len = ETH_DATA_LEN; |
4996 | tx_skb = dev_alloc_skb(pkt_len); | 4996 | tx_skb = netdev_alloc_skb(dev, pkt_len); |
4997 | if (!tx_skb) { | 4997 | if (!tx_skb) { |
4998 | netdev_err(dev, "dev_alloc_skb() failed during loopback test\n"); | 4998 | netdev_err(dev, "netdev_alloc_skb() failed during loopback test\n"); |
4999 | ret = 0; | 4999 | ret = 0; |
5000 | goto out; | 5000 | goto out; |
5001 | } | 5001 | } |
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)); |
diff --git a/drivers/net/ethernet/packetengines/yellowfin.c b/drivers/net/ethernet/packetengines/yellowfin.c index 4a5774271bd4..7757b80ef924 100644 --- a/drivers/net/ethernet/packetengines/yellowfin.c +++ b/drivers/net/ethernet/packetengines/yellowfin.c | |||
@@ -743,11 +743,10 @@ static int yellowfin_init_ring(struct net_device *dev) | |||
743 | } | 743 | } |
744 | 744 | ||
745 | for (i = 0; i < RX_RING_SIZE; i++) { | 745 | for (i = 0; i < RX_RING_SIZE; i++) { |
746 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); | 746 | struct sk_buff *skb = netdev_alloc_skb(dev, yp->rx_buf_sz + 2); |
747 | yp->rx_skbuff[i] = skb; | 747 | yp->rx_skbuff[i] = skb; |
748 | if (skb == NULL) | 748 | if (skb == NULL) |
749 | break; | 749 | break; |
750 | skb->dev = dev; /* Mark as being used by this device. */ | ||
751 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ | 750 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ |
752 | yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev, | 751 | yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev, |
753 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 752 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |
@@ -1133,7 +1132,7 @@ static int yellowfin_rx(struct net_device *dev) | |||
1133 | PCI_DMA_FROMDEVICE); | 1132 | PCI_DMA_FROMDEVICE); |
1134 | yp->rx_skbuff[entry] = NULL; | 1133 | yp->rx_skbuff[entry] = NULL; |
1135 | } else { | 1134 | } else { |
1136 | skb = dev_alloc_skb(pkt_len + 2); | 1135 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
1137 | if (skb == NULL) | 1136 | if (skb == NULL) |
1138 | break; | 1137 | break; |
1139 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1138 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
@@ -1156,11 +1155,10 @@ static int yellowfin_rx(struct net_device *dev) | |||
1156 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { | 1155 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { |
1157 | entry = yp->dirty_rx % RX_RING_SIZE; | 1156 | entry = yp->dirty_rx % RX_RING_SIZE; |
1158 | if (yp->rx_skbuff[entry] == NULL) { | 1157 | if (yp->rx_skbuff[entry] == NULL) { |
1159 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); | 1158 | struct sk_buff *skb = netdev_alloc_skb(dev, yp->rx_buf_sz + 2); |
1160 | if (skb == NULL) | 1159 | if (skb == NULL) |
1161 | break; /* Better luck next round. */ | 1160 | break; /* Better luck next round. */ |
1162 | yp->rx_skbuff[entry] = skb; | 1161 | yp->rx_skbuff[entry] = skb; |
1163 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1164 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1162 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
1165 | yp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(yp->pci_dev, | 1163 | yp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(yp->pci_dev, |
1166 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 1164 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index 3bb725ed2703..667498ea4603 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c | |||
@@ -643,7 +643,7 @@ static void pasemi_mac_replenish_rx_ring(const struct net_device *dev, | |||
643 | /* Entry in use? */ | 643 | /* Entry in use? */ |
644 | WARN_ON(*buff); | 644 | WARN_ON(*buff); |
645 | 645 | ||
646 | skb = dev_alloc_skb(mac->bufsz); | 646 | skb = netdev_alloc_skb(dev, mac->bufsz); |
647 | skb_reserve(skb, LOCAL_SKB_ALIGN); | 647 | skb_reserve(skb, LOCAL_SKB_ALIGN); |
648 | 648 | ||
649 | if (unlikely(!skb)) | 649 | if (unlikely(!skb)) |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index f69ac442c6a1..718b27440351 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | |||
@@ -1487,7 +1487,7 @@ netxen_alloc_rx_skb(struct netxen_adapter *adapter, | |||
1487 | dma_addr_t dma; | 1487 | dma_addr_t dma; |
1488 | struct pci_dev *pdev = adapter->pdev; | 1488 | struct pci_dev *pdev = adapter->pdev; |
1489 | 1489 | ||
1490 | buffer->skb = dev_alloc_skb(rds_ring->skb_size); | 1490 | buffer->skb = netdev_alloc_skb(adapter->netdev, rds_ring->skb_size); |
1491 | if (!buffer->skb) | 1491 | if (!buffer->skb) |
1492 | return 1; | 1492 | return 1; |
1493 | 1493 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 30dcbfba8f24..89ddf7f7d7df 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -719,7 +719,7 @@ static int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode) | |||
719 | int i, loop, cnt = 0; | 719 | int i, loop, cnt = 0; |
720 | 720 | ||
721 | for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) { | 721 | for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) { |
722 | skb = dev_alloc_skb(QLCNIC_ILB_PKT_SIZE); | 722 | skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE); |
723 | qlcnic_create_loopback_buff(skb->data, adapter->mac_addr); | 723 | qlcnic_create_loopback_buff(skb->data, adapter->mac_addr); |
724 | skb_put(skb, QLCNIC_ILB_PKT_SIZE); | 724 | skb_put(skb, QLCNIC_ILB_PKT_SIZE); |
725 | 725 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index 41d85efee422..d32cf0ddf1b9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | |||
@@ -1440,7 +1440,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
1440 | dma_addr_t dma; | 1440 | dma_addr_t dma; |
1441 | struct pci_dev *pdev = adapter->pdev; | 1441 | struct pci_dev *pdev = adapter->pdev; |
1442 | 1442 | ||
1443 | skb = dev_alloc_skb(rds_ring->skb_size); | 1443 | skb = netdev_alloc_skb(adapter->netdev, rds_ring->skb_size); |
1444 | if (!skb) { | 1444 | if (!skb) { |
1445 | adapter->stats.skb_alloc_failure++; | 1445 | adapter->stats.skb_alloc_failure++; |
1446 | return -ENOMEM; | 1446 | return -ENOMEM; |
diff --git a/drivers/net/ethernet/racal/ni5010.c b/drivers/net/ethernet/racal/ni5010.c index 072810da9a37..807982220050 100644 --- a/drivers/net/ethernet/racal/ni5010.c +++ b/drivers/net/ethernet/racal/ni5010.c | |||
@@ -552,7 +552,7 @@ static void ni5010_rx(struct net_device *dev) | |||
552 | } | 552 | } |
553 | 553 | ||
554 | /* Malloc up new buffer. */ | 554 | /* Malloc up new buffer. */ |
555 | skb = dev_alloc_skb(i_pkt_size + 3); | 555 | skb = netdev_alloc_skb(dev, i_pkt_size + 3); |
556 | if (skb == NULL) { | 556 | if (skb == NULL) { |
557 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); | 557 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); |
558 | dev->stats.rx_dropped++; | 558 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c index e3f57fdbf0ea..46c1932048cb 100644 --- a/drivers/net/ethernet/realtek/atp.c +++ b/drivers/net/ethernet/realtek/atp.c | |||
@@ -783,7 +783,7 @@ static void net_rx(struct net_device *dev) | |||
783 | int pkt_len = (rx_head.rx_count & 0x7ff) - 4; | 783 | int pkt_len = (rx_head.rx_count & 0x7ff) - 4; |
784 | struct sk_buff *skb; | 784 | struct sk_buff *skb; |
785 | 785 | ||
786 | skb = dev_alloc_skb(pkt_len + 2); | 786 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
787 | if (skb == NULL) { | 787 | if (skb == NULL) { |
788 | printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", | 788 | printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", |
789 | dev->name); | 789 | dev->name); |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index dacd13150b6c..1a69504ed9c5 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -653,13 +653,12 @@ static void sh_eth_ring_format(struct net_device *ndev) | |||
653 | for (i = 0; i < RX_RING_SIZE; i++) { | 653 | for (i = 0; i < RX_RING_SIZE; i++) { |
654 | /* skb */ | 654 | /* skb */ |
655 | mdp->rx_skbuff[i] = NULL; | 655 | mdp->rx_skbuff[i] = NULL; |
656 | skb = dev_alloc_skb(mdp->rx_buf_sz); | 656 | skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz); |
657 | mdp->rx_skbuff[i] = skb; | 657 | mdp->rx_skbuff[i] = skb; |
658 | if (skb == NULL) | 658 | if (skb == NULL) |
659 | break; | 659 | break; |
660 | dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz, | 660 | dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz, |
661 | DMA_FROM_DEVICE); | 661 | DMA_FROM_DEVICE); |
662 | skb->dev = ndev; /* Mark as being used by this device. */ | ||
663 | sh_eth_set_receive_align(skb); | 662 | sh_eth_set_receive_align(skb); |
664 | 663 | ||
665 | /* RX descriptor */ | 664 | /* RX descriptor */ |
@@ -953,13 +952,12 @@ static int sh_eth_rx(struct net_device *ndev) | |||
953 | rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16); | 952 | rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16); |
954 | 953 | ||
955 | if (mdp->rx_skbuff[entry] == NULL) { | 954 | if (mdp->rx_skbuff[entry] == NULL) { |
956 | skb = dev_alloc_skb(mdp->rx_buf_sz); | 955 | skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz); |
957 | mdp->rx_skbuff[entry] = skb; | 956 | mdp->rx_skbuff[entry] = skb; |
958 | if (skb == NULL) | 957 | if (skb == NULL) |
959 | break; /* Better luck next round. */ | 958 | break; /* Better luck next round. */ |
960 | dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz, | 959 | dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz, |
961 | DMA_FROM_DEVICE); | 960 | DMA_FROM_DEVICE); |
962 | skb->dev = ndev; | ||
963 | sh_eth_set_receive_align(skb); | 961 | sh_eth_set_receive_align(skb); |
964 | 962 | ||
965 | skb_checksum_none_assert(skb); | 963 | skb_checksum_none_assert(skb); |
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c index 893c880dadf0..7b819bd8c416 100644 --- a/drivers/net/ethernet/seeq/ether3.c +++ b/drivers/net/ethernet/seeq/ether3.c | |||
@@ -643,7 +643,7 @@ if (next_ptr < RX_START || next_ptr >= RX_END) { | |||
643 | if (next_ptr <= this_ptr) | 643 | if (next_ptr <= this_ptr) |
644 | length += RX_END - RX_START; | 644 | length += RX_END - RX_START; |
645 | 645 | ||
646 | skb = dev_alloc_skb(length + 2); | 646 | skb = netdev_alloc_skb(dev, length + 2); |
647 | if (skb) { | 647 | if (skb) { |
648 | unsigned char *buf; | 648 | unsigned char *buf; |
649 | 649 | ||
diff --git a/drivers/net/ethernet/seeq/seeq8005.c b/drivers/net/ethernet/seeq/seeq8005.c index 60561451789b..798990774446 100644 --- a/drivers/net/ethernet/seeq/seeq8005.c +++ b/drivers/net/ethernet/seeq/seeq8005.c | |||
@@ -548,7 +548,7 @@ static void seeq8005_rx(struct net_device *dev) | |||
548 | struct sk_buff *skb; | 548 | struct sk_buff *skb; |
549 | unsigned char *buf; | 549 | unsigned char *buf; |
550 | 550 | ||
551 | skb = dev_alloc_skb(pkt_len); | 551 | skb = netdev_alloc_skb(dev, pkt_len); |
552 | if (skb == NULL) { | 552 | if (skb == NULL) { |
553 | printk("%s: Memory squeeze, dropping packet.\n", dev->name); | 553 | printk("%s: Memory squeeze, dropping packet.\n", dev->name); |
554 | dev->stats.rx_dropped++; | 554 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index 91c44688bc3e..f968898c86db 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c | |||
@@ -1166,7 +1166,7 @@ sis900_init_rx_ring(struct net_device *net_dev) | |||
1166 | for (i = 0; i < NUM_RX_DESC; i++) { | 1166 | for (i = 0; i < NUM_RX_DESC; i++) { |
1167 | struct sk_buff *skb; | 1167 | struct sk_buff *skb; |
1168 | 1168 | ||
1169 | if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { | 1169 | if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) { |
1170 | /* not enough memory for skbuff, this makes a "hole" | 1170 | /* not enough memory for skbuff, this makes a "hole" |
1171 | on the buffer ring, it is not clear how the | 1171 | on the buffer ring, it is not clear how the |
1172 | hardware will react to this kind of degenerated | 1172 | hardware will react to this kind of degenerated |
@@ -1769,7 +1769,7 @@ static int sis900_rx(struct net_device *net_dev) | |||
1769 | 1769 | ||
1770 | /* refill the Rx buffer, what if there is not enough | 1770 | /* refill the Rx buffer, what if there is not enough |
1771 | * memory for new socket buffer ?? */ | 1771 | * memory for new socket buffer ?? */ |
1772 | if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { | 1772 | if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) { |
1773 | /* | 1773 | /* |
1774 | * Not enough memory to refill the buffer | 1774 | * Not enough memory to refill the buffer |
1775 | * so we need to recycle the old one so | 1775 | * so we need to recycle the old one so |
@@ -1827,7 +1827,7 @@ refill_rx_ring: | |||
1827 | entry = sis_priv->dirty_rx % NUM_RX_DESC; | 1827 | entry = sis_priv->dirty_rx % NUM_RX_DESC; |
1828 | 1828 | ||
1829 | if (sis_priv->rx_skbuff[entry] == NULL) { | 1829 | if (sis_priv->rx_skbuff[entry] == NULL) { |
1830 | if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { | 1830 | if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) { |
1831 | /* not enough memory for skbuff, this makes a | 1831 | /* not enough memory for skbuff, this makes a |
1832 | * "hole" on the buffer ring, it is not clear | 1832 | * "hole" on the buffer ring, it is not clear |
1833 | * how the hardware will react to this kind | 1833 | * how the hardware will react to this kind |
diff --git a/drivers/net/ethernet/smsc/epic100.c b/drivers/net/ethernet/smsc/epic100.c index 11dcb38b99f7..2a662e6112e9 100644 --- a/drivers/net/ethernet/smsc/epic100.c +++ b/drivers/net/ethernet/smsc/epic100.c | |||
@@ -934,7 +934,7 @@ static void epic_init_ring(struct net_device *dev) | |||
934 | 934 | ||
935 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 935 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
936 | for (i = 0; i < RX_RING_SIZE; i++) { | 936 | for (i = 0; i < RX_RING_SIZE; i++) { |
937 | struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz + 2); | 937 | struct sk_buff *skb = netdev_alloc_skb(dev, ep->rx_buf_sz + 2); |
938 | ep->rx_skbuff[i] = skb; | 938 | ep->rx_skbuff[i] = skb; |
939 | if (skb == NULL) | 939 | if (skb == NULL) |
940 | break; | 940 | break; |
@@ -1199,7 +1199,7 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1199 | /* Check if the packet is long enough to accept without copying | 1199 | /* Check if the packet is long enough to accept without copying |
1200 | to a minimally-sized skbuff. */ | 1200 | to a minimally-sized skbuff. */ |
1201 | if (pkt_len < rx_copybreak && | 1201 | if (pkt_len < rx_copybreak && |
1202 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1202 | (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) { |
1203 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1203 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1204 | pci_dma_sync_single_for_cpu(ep->pci_dev, | 1204 | pci_dma_sync_single_for_cpu(ep->pci_dev, |
1205 | ep->rx_ring[entry].bufaddr, | 1205 | ep->rx_ring[entry].bufaddr, |
@@ -1232,7 +1232,7 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1232 | entry = ep->dirty_rx % RX_RING_SIZE; | 1232 | entry = ep->dirty_rx % RX_RING_SIZE; |
1233 | if (ep->rx_skbuff[entry] == NULL) { | 1233 | if (ep->rx_skbuff[entry] == NULL) { |
1234 | struct sk_buff *skb; | 1234 | struct sk_buff *skb; |
1235 | skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz + 2); | 1235 | skb = ep->rx_skbuff[entry] = netdev_alloc_skb(dev, ep->rx_buf_sz + 2); |
1236 | if (skb == NULL) | 1236 | if (skb == NULL) |
1237 | break; | 1237 | break; |
1238 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1238 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c index c28230148efd..8814b2f5d46f 100644 --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c | |||
@@ -401,7 +401,7 @@ static inline void smc911x_rcv(struct net_device *dev) | |||
401 | } else { | 401 | } else { |
402 | /* Receive a valid packet */ | 402 | /* Receive a valid packet */ |
403 | /* Alloc a buffer with extra room for DMA alignment */ | 403 | /* Alloc a buffer with extra room for DMA alignment */ |
404 | skb=dev_alloc_skb(pkt_len+32); | 404 | skb = netdev_alloc_skb(dev, pkt_len+32); |
405 | if (unlikely(skb == NULL)) { | 405 | if (unlikely(skb == NULL)) { |
406 | PRINTK( "%s: Low memory, rcvd packet dropped.\n", | 406 | PRINTK( "%s: Low memory, rcvd packet dropped.\n", |
407 | dev->name); | 407 | dev->name); |
diff --git a/drivers/net/ethernet/smsc/smc9194.c b/drivers/net/ethernet/smsc/smc9194.c index 4e45094efb18..50823da9dc1e 100644 --- a/drivers/net/ethernet/smsc/smc9194.c +++ b/drivers/net/ethernet/smsc/smc9194.c | |||
@@ -1222,7 +1222,7 @@ static void smc_rcv(struct net_device *dev) | |||
1222 | if ( status & RS_MULTICAST ) | 1222 | if ( status & RS_MULTICAST ) |
1223 | dev->stats.multicast++; | 1223 | dev->stats.multicast++; |
1224 | 1224 | ||
1225 | skb = dev_alloc_skb( packet_length + 5); | 1225 | skb = netdev_alloc_skb(dev, packet_length + 5); |
1226 | 1226 | ||
1227 | if ( skb == NULL ) { | 1227 | if ( skb == NULL ) { |
1228 | printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n"); | 1228 | printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n"); |
diff --git a/drivers/net/ethernet/smsc/smc91c92_cs.c b/drivers/net/ethernet/smsc/smc91c92_cs.c index ada927aba7a5..d12e48a7861d 100644 --- a/drivers/net/ethernet/smsc/smc91c92_cs.c +++ b/drivers/net/ethernet/smsc/smc91c92_cs.c | |||
@@ -1500,7 +1500,7 @@ static void smc_rx(struct net_device *dev) | |||
1500 | struct sk_buff *skb; | 1500 | struct sk_buff *skb; |
1501 | 1501 | ||
1502 | /* Note: packet_length adds 5 or 6 extra bytes here! */ | 1502 | /* Note: packet_length adds 5 or 6 extra bytes here! */ |
1503 | skb = dev_alloc_skb(packet_length+2); | 1503 | skb = netdev_alloc_skb(dev, packet_length+2); |
1504 | 1504 | ||
1505 | if (skb == NULL) { | 1505 | if (skb == NULL) { |
1506 | pr_debug("%s: Low memory, packet dropped.\n", dev->name); | 1506 | pr_debug("%s: Low memory, packet dropped.\n", dev->name); |
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 24104a1ee6a5..1dc4fad593e7 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c | |||
@@ -463,7 +463,7 @@ static inline void smc_rcv(struct net_device *dev) | |||
463 | * multiple of 4 bytes on 32 bit buses. | 463 | * multiple of 4 bytes on 32 bit buses. |
464 | * Hence packet_len - 6 + 2 + 2 + 2. | 464 | * Hence packet_len - 6 + 2 + 2 + 2. |
465 | */ | 465 | */ |
466 | skb = dev_alloc_skb(packet_len); | 466 | skb = netdev_alloc_skb(dev, packet_len); |
467 | if (unlikely(skb == NULL)) { | 467 | if (unlikely(skb == NULL)) { |
468 | printk(KERN_NOTICE "%s: Low memory, packet dropped.\n", | 468 | printk(KERN_NOTICE "%s: Low memory, packet dropped.\n", |
469 | dev->name); | 469 | dev->name); |
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c index 595f9881e096..ee1a1680b7a8 100644 --- a/drivers/net/ethernet/smsc/smsc9420.c +++ b/drivers/net/ethernet/smsc/smsc9420.c | |||
@@ -850,8 +850,6 @@ static int smsc9420_alloc_rx_buffer(struct smsc9420_pdata *pd, int index) | |||
850 | return -ENOMEM; | 850 | return -ENOMEM; |
851 | } | 851 | } |
852 | 852 | ||
853 | skb->dev = pd->dev; | ||
854 | |||
855 | mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb), | 853 | mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb), |
856 | PKT_BUF_SZ, PCI_DMA_FROMDEVICE); | 854 | PKT_BUF_SZ, PCI_DMA_FROMDEVICE); |
857 | if (pci_dma_mapping_error(pd->pdev, mapping)) { | 855 | if (pci_dma_mapping_error(pd->pdev, mapping)) { |
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c index 45292760fce4..b36edbd625dd 100644 --- a/drivers/net/ethernet/sun/cassini.c +++ b/drivers/net/ethernet/sun/cassini.c | |||
@@ -1974,7 +1974,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc, | |||
1974 | else | 1974 | else |
1975 | alloclen = max(hlen, RX_COPY_MIN); | 1975 | alloclen = max(hlen, RX_COPY_MIN); |
1976 | 1976 | ||
1977 | skb = dev_alloc_skb(alloclen + swivel + cp->crc_size); | 1977 | skb = netdev_alloc_skb(cp->dev, alloclen + swivel + cp->crc_size); |
1978 | if (skb == NULL) | 1978 | if (skb == NULL) |
1979 | return -1; | 1979 | return -1; |
1980 | 1980 | ||
diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c index 220f724c3377..f359863b5340 100644 --- a/drivers/net/ethernet/sun/sunbmac.c +++ b/drivers/net/ethernet/sun/sunbmac.c | |||
@@ -853,7 +853,7 @@ static void bigmac_rx(struct bigmac *bp) | |||
853 | /* Trim the original skb for the netif. */ | 853 | /* Trim the original skb for the netif. */ |
854 | skb_trim(skb, len); | 854 | skb_trim(skb, len); |
855 | } else { | 855 | } else { |
856 | struct sk_buff *copy_skb = dev_alloc_skb(len + 2); | 856 | struct sk_buff *copy_skb = netdev_alloc_skb(bp->dev, len + 2); |
857 | 857 | ||
858 | if (copy_skb == NULL) { | 858 | if (copy_skb == NULL) { |
859 | drops++; | 859 | drops++; |
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 09c518655db2..8b627e2f798d 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c | |||
@@ -2043,7 +2043,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) | |||
2043 | /* Trim the original skb for the netif. */ | 2043 | /* Trim the original skb for the netif. */ |
2044 | skb_trim(skb, len); | 2044 | skb_trim(skb, len); |
2045 | } else { | 2045 | } else { |
2046 | struct sk_buff *copy_skb = dev_alloc_skb(len + 2); | 2046 | struct sk_buff *copy_skb = netdev_alloc_skb(dev, len + 2); |
2047 | 2047 | ||
2048 | if (copy_skb == NULL) { | 2048 | if (copy_skb == NULL) { |
2049 | drops++; | 2049 | drops++; |
diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c index b28f74367ebe..b42d1c5a6ca1 100644 --- a/drivers/net/ethernet/sun/sunqe.c +++ b/drivers/net/ethernet/sun/sunqe.c | |||
@@ -435,7 +435,7 @@ static void qe_rx(struct sunqe *qep) | |||
435 | dev->stats.rx_length_errors++; | 435 | dev->stats.rx_length_errors++; |
436 | dev->stats.rx_dropped++; | 436 | dev->stats.rx_dropped++; |
437 | } else { | 437 | } else { |
438 | skb = dev_alloc_skb(len + 2); | 438 | skb = netdev_alloc_skb(dev, len + 2); |
439 | if (skb == NULL) { | 439 | if (skb == NULL) { |
440 | drops++; | 440 | drops++; |
441 | dev->stats.rx_dropped++; | 441 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index df7febba9ea6..ad973ffc9ff3 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c | |||
@@ -1089,12 +1089,11 @@ static void bdx_rx_alloc_skbs(struct bdx_priv *priv, struct rxf_fifo *f) | |||
1089 | ENTER; | 1089 | ENTER; |
1090 | dno = bdx_rxdb_available(db) - 1; | 1090 | dno = bdx_rxdb_available(db) - 1; |
1091 | while (dno > 0) { | 1091 | while (dno > 0) { |
1092 | skb = dev_alloc_skb(f->m.pktsz + NET_IP_ALIGN); | 1092 | skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN); |
1093 | if (!skb) { | 1093 | if (!skb) { |
1094 | pr_err("NO MEM: dev_alloc_skb failed\n"); | 1094 | pr_err("NO MEM: netdev_alloc_skb failed\n"); |
1095 | break; | 1095 | break; |
1096 | } | 1096 | } |
1097 | skb->dev = priv->ndev; | ||
1098 | skb_reserve(skb, NET_IP_ALIGN); | 1097 | skb_reserve(skb, NET_IP_ALIGN); |
1099 | 1098 | ||
1100 | idx = bdx_rxdb_alloc_elem(db); | 1099 | idx = bdx_rxdb_alloc_elem(db); |
@@ -1258,7 +1257,7 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget) | |||
1258 | skb = dm->skb; | 1257 | skb = dm->skb; |
1259 | 1258 | ||
1260 | if (len < BDX_COPYBREAK && | 1259 | if (len < BDX_COPYBREAK && |
1261 | (skb2 = dev_alloc_skb(len + NET_IP_ALIGN))) { | 1260 | (skb2 = netdev_alloc_skb(priv->ndev, len + NET_IP_ALIGN))) { |
1262 | skb_reserve(skb2, NET_IP_ALIGN); | 1261 | skb_reserve(skb2, NET_IP_ALIGN); |
1263 | /*skb_put(skb2, len); */ | 1262 | /*skb_put(skb2, len); */ |
1264 | pci_dma_sync_single_for_cpu(priv->pdev, | 1263 | pci_dma_sync_single_for_cpu(priv->pdev, |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 922a937e05cf..6b0659c59ddd 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -992,10 +992,9 @@ static irqreturn_t emac_irq(int irq, void *dev_id) | |||
992 | 992 | ||
993 | static struct sk_buff *emac_rx_alloc(struct emac_priv *priv) | 993 | static struct sk_buff *emac_rx_alloc(struct emac_priv *priv) |
994 | { | 994 | { |
995 | struct sk_buff *skb = dev_alloc_skb(priv->rx_buf_size); | 995 | struct sk_buff *skb = netdev_alloc_skb(priv->ndev, priv->rx_buf_size); |
996 | if (WARN_ON(!skb)) | 996 | if (WARN_ON(!skb)) |
997 | return NULL; | 997 | return NULL; |
998 | skb->dev = priv->ndev; | ||
999 | skb_reserve(skb, NET_IP_ALIGN); | 998 | skb_reserve(skb, NET_IP_ALIGN); |
1000 | return skb; | 999 | return skb; |
1001 | } | 1000 | } |
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index d9951afb9269..a8e5daaef6fa 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -419,7 +419,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info, | |||
419 | #endif | 419 | #endif |
420 | 420 | ||
421 | /* Avoid "false sharing" with last cache line. */ | 421 | /* Avoid "false sharing" with last cache line. */ |
422 | /* ISSUE: This is already done by "dev_alloc_skb()". */ | 422 | /* ISSUE: This is already done by "netdev_alloc_skb()". */ |
423 | unsigned int len = | 423 | unsigned int len = |
424 | (((small ? LIPP_SMALL_PACKET_SIZE : large_size) + | 424 | (((small ? LIPP_SMALL_PACKET_SIZE : large_size) + |
425 | CHIP_L2_LINE_SIZE() - 1) & -CHIP_L2_LINE_SIZE()); | 425 | CHIP_L2_LINE_SIZE() - 1) & -CHIP_L2_LINE_SIZE()); |
@@ -433,7 +433,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info, | |||
433 | struct sk_buff **skb_ptr; | 433 | struct sk_buff **skb_ptr; |
434 | 434 | ||
435 | /* Request 96 extra bytes for alignment purposes. */ | 435 | /* Request 96 extra bytes for alignment purposes. */ |
436 | skb = dev_alloc_skb(len + padding); | 436 | skb = netdev_alloc_skb(info->napi->dev, len + padding); |
437 | if (skb == NULL) | 437 | if (skb == NULL) |
438 | return false; | 438 | return false; |
439 | 439 | ||
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index f5ac603d5608..d117ad475c3e 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c | |||
@@ -453,7 +453,7 @@ static struct sk_buff *alloc_rxbuf_skb(struct net_device *dev, | |||
453 | dma_addr_t *dma_handle) | 453 | dma_addr_t *dma_handle) |
454 | { | 454 | { |
455 | struct sk_buff *skb; | 455 | struct sk_buff *skb; |
456 | skb = dev_alloc_skb(RX_BUF_SIZE); | 456 | skb = netdev_alloc_skb(dev, RX_BUF_SIZE); |
457 | if (!skb) | 457 | if (!skb) |
458 | return NULL; | 458 | return NULL; |
459 | *dma_handle = pci_map_single(hwdev, skb->data, RX_BUF_SIZE, | 459 | *dma_handle = pci_map_single(hwdev, skb->data, RX_BUF_SIZE, |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 1b95daa372c4..cb2ff28a0602 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -1155,7 +1155,6 @@ static void alloc_rbufs(struct net_device *dev) | |||
1155 | rp->rx_skbuff[i] = skb; | 1155 | rp->rx_skbuff[i] = skb; |
1156 | if (skb == NULL) | 1156 | if (skb == NULL) |
1157 | break; | 1157 | break; |
1158 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1159 | 1158 | ||
1160 | rp->rx_skbuff_dma[i] = | 1159 | rp->rx_skbuff_dma[i] = |
1161 | pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz, | 1160 | pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz, |
@@ -1940,7 +1939,6 @@ static int rhine_rx(struct net_device *dev, int limit) | |||
1940 | rp->rx_skbuff[entry] = skb; | 1939 | rp->rx_skbuff[entry] = skb; |
1941 | if (skb == NULL) | 1940 | if (skb == NULL) |
1942 | break; /* Better luck next round. */ | 1941 | break; /* Better luck next round. */ |
1943 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1944 | rp->rx_skbuff_dma[entry] = | 1942 | rp->rx_skbuff_dma[entry] = |
1945 | pci_map_single(rp->pdev, skb->data, | 1943 | pci_map_single(rp->pdev, skb->data, |
1946 | rp->rx_buf_sz, | 1944 | rp->rx_buf_sz, |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 2776bbc67936..cf69cbf6fec3 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -1509,7 +1509,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) | |||
1509 | struct rx_desc *rd = &(vptr->rx.ring[idx]); | 1509 | struct rx_desc *rd = &(vptr->rx.ring[idx]); |
1510 | struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]); | 1510 | struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]); |
1511 | 1511 | ||
1512 | rd_info->skb = dev_alloc_skb(vptr->rx.buf_sz + 64); | 1512 | rd_info->skb = netdev_alloc_skb(vptr->dev, vptr->rx.buf_sz + 64); |
1513 | if (rd_info->skb == NULL) | 1513 | if (rd_info->skb == NULL) |
1514 | return -ENOMEM; | 1514 | return -ENOMEM; |
1515 | 1515 | ||
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 90e611a6f6c6..77cfe5110318 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c | |||
@@ -613,7 +613,7 @@ static void xemaclite_rx_handler(struct net_device *dev) | |||
613 | u32 len; | 613 | u32 len; |
614 | 614 | ||
615 | len = ETH_FRAME_LEN + ETH_FCS_LEN; | 615 | len = ETH_FRAME_LEN + ETH_FCS_LEN; |
616 | skb = dev_alloc_skb(len + ALIGNMENT); | 616 | skb = netdev_alloc_skb(dev, len + ALIGNMENT); |
617 | if (!skb) { | 617 | if (!skb) { |
618 | /* Couldn't get memory. */ | 618 | /* Couldn't get memory. */ |
619 | dev->stats.rx_dropped++; | 619 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c index 33979c3ac943..5c69c6f93fb8 100644 --- a/drivers/net/ethernet/xircom/xirc2ps_cs.c +++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c | |||
@@ -1039,7 +1039,8 @@ xirc2ps_interrupt(int irq, void *dev_id) | |||
1039 | 1039 | ||
1040 | pr_debug("rsr=%#02x packet_length=%u\n", rsr, pktlen); | 1040 | pr_debug("rsr=%#02x packet_length=%u\n", rsr, pktlen); |
1041 | 1041 | ||
1042 | skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */ | 1042 | /* 1 extra so we can use insw */ |
1043 | skb = netdev_alloc_skb(dev, pktlen + 3); | ||
1043 | if (!skb) { | 1044 | if (!skb) { |
1044 | pr_notice("low memory, packet dropped (size=%u)\n", pktlen); | 1045 | pr_notice("low memory, packet dropped (size=%u)\n", pktlen); |
1045 | dev->stats.rx_dropped++; | 1046 | dev->stats.rx_dropped++; |