netdev: ethernet dev_alloc_skb to netdev_alloc_skb
authorPradeep A Dalvi <netdev@pradeepdalvi.com>
Sun, 5 Feb 2012 02:50:10 +0000 (02:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Feb 2012 16:48:09 +0000 (11:48 -0500)
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
21 files changed:
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/cirrus/cs89x0.c
drivers/net/ethernet/cirrus/ep93xx_eth.c
drivers/net/ethernet/davicom/dm9000.c
drivers/net/ethernet/dec/ewrk3.c
drivers/net/ethernet/dec/tulip/de2104x.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/dec/tulip/interrupt.c
drivers/net/ethernet/dec/tulip/tulip_core.c
drivers/net/ethernet/dec/tulip/winbond-840.c
drivers/net/ethernet/dec/tulip/xircom_cb.c
drivers/net/ethernet/dlink/de600.c
drivers/net/ethernet/dlink/de620.c
drivers/net/ethernet/dlink/sundance.c
drivers/net/ethernet/dnet.c
drivers/net/ethernet/fealnx.c
drivers/net/ethernet/freescale/fec.c
drivers/net/ethernet/freescale/fec_mpc52xx.c
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
drivers/net/ethernet/freescale/ucc_geth.c
drivers/net/ethernet/fujitsu/at1700.c

index 3c315f46859b3b01f25551a066e0df461bd63963..85e044567f68b15083eacc187ed0f3ae93d33d12 100644 (file)
@@ -397,7 +397,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
        netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n",
                   first_frag, last_frag, len);
 
-       skb = dev_alloc_skb(len + RX_OFFSET);
+       skb = netdev_alloc_skb(bp->dev, len + RX_OFFSET);
        if (!skb) {
                bp->stats.rx_dropped++;
                for (frag = first_frag; ; frag = NEXT_RX(frag)) {
index f328da24c8fa5b66266d0c9e3b374424161b50a2..d5ff93653e4ce0af7ca54fa84a182b32bebf0860 100644 (file)
@@ -911,7 +911,7 @@ dma_rx(struct net_device *dev)
        }
 
        /* Malloc up new buffer. */
-       skb = dev_alloc_skb(length + 2);
+       skb = netdev_alloc_skb(dev, length + 2);
        if (skb == NULL) {
                if (net_debug)  /* I don't think we want to do this to a stressed system */
                        printk("%s: Memory squeeze, dropping packet.\n", dev->name);
@@ -1616,7 +1616,7 @@ net_rx(struct net_device *dev)
        }
 
        /* Malloc up new buffer. */
-       skb = dev_alloc_skb(length + 2);
+       skb = netdev_alloc_skb(dev, length + 2);
        if (skb == NULL) {
 #if 0          /* Again, this seems a cruel thing to do */
                printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
index 4317af8d2f0aa1b3eaa1d5d1d40c21b33a5ed4d2..c21e5ab8d1ef49d2940b3c7775f0516d4211cca7 100644 (file)
@@ -282,7 +282,7 @@ static int ep93xx_rx(struct net_device *dev, int processed, int budget)
                if (rstat0 & RSTAT0_CRCI)
                        length -= 4;
 
-               skb = dev_alloc_skb(length + 2);
+               skb = netdev_alloc_skb(dev, length + 2);
                if (likely(skb != NULL)) {
                        struct ep93xx_rdesc *rxd = &ep->descs->rdesc[entry];
                        skb_reserve(skb, 2);
index 493cc6202081ea52445d728bccf1570e66667a25..42383ab5227eb6d34f299be150c915fda7c4a436 100644 (file)
@@ -1028,7 +1028,7 @@ dm9000_rx(struct net_device *dev)
 
                /* Move data from DM9000 */
                if (GoodPacket &&
-                   ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) {
+                   ((skb = netdev_alloc_skb(dev, RxLen + 4)) != NULL)) {
                        skb_reserve(skb, 2);
                        rdptr = (u8 *) skb_put(skb, RxLen - 4);
 
index f9df5e4d0341eccf98f76557689f4e469355479c..1879f84a25a313efe12cecc31fac76955b123179 100644 (file)
@@ -986,8 +986,10 @@ static int ewrk3_rx(struct net_device *dev)
                                                dev->stats.rx_fifo_errors++;
                                } else {
                                        struct sk_buff *skb;
+                                       skb = netdev_alloc_skb(dev,
+                                                       pkt_len + 2);
 
-                                       if ((skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                                       if (skb != NULL) {
                                                unsigned char *p;
                                                skb_reserve(skb, 2);    /* Align to 16 bytes */
                                                p = skb_put(skb, pkt_len);
index 1eb46a0bb488f86ec4df92b24ec1673b6e2c3599..68f1c39184df6581ac84f4c249f27a6999caa07c 100644 (file)
@@ -439,7 +439,7 @@ static void de_rx (struct de_private *de)
                          rx_tail, status, len, copying_skb);
 
                buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
-               copy_skb = dev_alloc_skb (buflen);
+               copy_skb = netdev_alloc_skb(de->dev, buflen);
                if (unlikely(!copy_skb)) {
                        de->net_stats.rx_dropped++;
                        drop = 1;
@@ -1283,12 +1283,10 @@ static int de_refill_rx (struct de_private *de)
        for (i = 0; i < DE_RX_RING_SIZE; i++) {
                struct sk_buff *skb;
 
-               skb = dev_alloc_skb(de->rx_buf_sz);
+               skb = netdev_alloc_skb(de->dev, de->rx_buf_sz);
                if (!skb)
                        goto err_out;
 
-               skb->dev = de->dev;
-
                de->rx_skb[i].mapping = pci_map_single(de->pdev,
                        skb->data, de->rx_buf_sz, PCI_DMA_FROMDEVICE);
                de->rx_skb[i].skb = skb;
index 4d71f5ae20c8f78fd6ee5571f343d0fc1ea54370..93583408a325072b63911b399cbe42ab96cb7ed3 100644 (file)
@@ -3598,7 +3598,7 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
     struct sk_buff *ret;
     u_long i=0, tmp;
 
-    p = dev_alloc_skb(IEEE802_3_SZ + DE4X5_ALIGN + 2);
+    p = netdev_alloc_skb(dev, IEEE802_3_SZ + DE4X5_ALIGN + 2);
     if (!p) return NULL;
 
     tmp = virt_to_bus(p->data);
@@ -3618,7 +3618,7 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
 #else
     if (lp->state != OPEN) return (struct sk_buff *)1; /* Fake out the open */
 
-    p = dev_alloc_skb(len + 2);
+    p = netdev_alloc_skb(dev, len + 2);
     if (!p) return NULL;
 
     skb_reserve(p, 2);                                /* Align */
index feaee7424bd9e59a511d80bb3b9c544a4f92ca13..28a5e425fecf04fd6199ffb4d518f7e4210d1123 100644 (file)
@@ -69,7 +69,8 @@ int tulip_refill_rx(struct net_device *dev)
                        struct sk_buff *skb;
                        dma_addr_t mapping;
 
-                       skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ);
+                       skb = tp->rx_buffers[entry].skb =
+                               netdev_alloc_skb(dev, PKT_BUF_SZ);
                        if (skb == NULL)
                                break;
 
@@ -77,7 +78,6 @@ int tulip_refill_rx(struct net_device *dev)
                                                 PCI_DMA_FROMDEVICE);
                        tp->rx_buffers[entry].mapping = mapping;
 
-                       skb->dev = dev;                 /* Mark as being used by this device. */
                        tp->rx_ring[entry].buffer1 = cpu_to_le32(mapping);
                        refilled++;
                }
@@ -202,7 +202,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
                                /* Check if the packet is long enough to accept without copying
                                   to a minimally-sized skbuff. */
                                if (pkt_len < tulip_rx_copybreak &&
-                                   (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                                   (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                        skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                        pci_dma_sync_single_for_cpu(tp->pdev,
                                                                   tp->rx_buffers[entry].mapping,
@@ -428,7 +428,7 @@ static int tulip_rx(struct net_device *dev)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < tulip_rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                pci_dma_sync_single_for_cpu(tp->pdev,
                                                            tp->rx_buffers[entry].mapping,
index 17ecb18341c9b35be30512199abb27e8c2667bc8..fea3641d939871cf9dff0c1d500b8f4e59528b09 100644 (file)
@@ -636,16 +636,15 @@ static void tulip_init_ring(struct net_device *dev)
                dma_addr_t mapping;
 
                /* Note the receive buffer must be longword aligned.
-                  dev_alloc_skb() provides 16 byte alignment.  But do *not*
+                  netdev_alloc_skb() provides 16 byte alignment.  But do *not*
                   use skb_reserve() to align the IP header! */
-               struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ);
+               struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
                tp->rx_buffers[i].skb = skb;
                if (skb == NULL)
                        break;
                mapping = pci_map_single(tp->pdev, skb->data,
                                         PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
                tp->rx_buffers[i].mapping = mapping;
-               skb->dev = dev;                 /* Mark as being used by this device. */
                tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */
                tp->rx_ring[i].buffer1 = cpu_to_le32(mapping);
        }
index 52da7b2fe3b6123c32749bd29a4a13c7e94be128..2ac6fff0363a7172dbc218f28b62ccd6c8f3868a 100644 (file)
@@ -815,7 +815,7 @@ static void init_rxtx_rings(struct net_device *dev)
 
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                np->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
@@ -1231,7 +1231,7 @@ static int netdev_rx(struct net_device *dev)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry],
                                                            np->rx_skbuff[entry]->len,
@@ -1270,7 +1270,7 @@ static int netdev_rx(struct net_device *dev)
                struct sk_buff *skb;
                entry = np->dirty_rx % RX_RING_SIZE;
                if (np->rx_skbuff[entry] == NULL) {
-                       skb = dev_alloc_skb(np->rx_buf_sz);
+                       skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                        np->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;                  /* Better luck next round. */
index b7c73eefb54b5237fe456d926a729bf13f05f697..fdb329fe6e8ea8564bb7afb5a5718388ca314164 100644 (file)
@@ -1084,7 +1084,7 @@ investigate_read_descriptor(struct net_device *dev, struct xircom_private *card,
                        pkt_len = 1518;
                }
 
-               skb = dev_alloc_skb(pkt_len + 2);
+               skb = netdev_alloc_skb(dev, pkt_len + 2);
                if (skb == NULL) {
                        dev->stats.rx_dropped++;
                        goto out;
index c24fab1e9cbe5f32fef5372f91b781db18e0553a..682750c052c846839be5b648b53778e7b7941150 100644 (file)
@@ -335,7 +335,7 @@ static void de600_rx_intr(struct net_device *dev)
                return;
        }
 
-       skb = dev_alloc_skb(size+2);
+       skb = netdev_alloc_skb(dev, size + 2);
        if (skb == NULL) {
                printk("%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, size);
                return;
index 3b934ab784d39f4270ffc45025673921f84cb65e..afc5aaac6b600fd904738c0dfcc66ba13de4ced4 100644 (file)
@@ -650,7 +650,7 @@ static int de620_rx_intr(struct net_device *dev)
                printk(KERN_WARNING "%s: Illegal packet size: %d!\n", dev->name, size);
        }
        else { /* Good packet? */
-               skb = dev_alloc_skb(size+2);
+               skb = netdev_alloc_skb(dev, size + 2);
                if (skb == NULL) { /* Yeah, but no place to put it... */
                        printk(KERN_WARNING "%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, size);
                        dev->stats.rx_dropped++;
index 28a3a9b50b8b2856ecac014cc6797b53f7930a7f..7227f29ee2eece5e75b75e6b4c4b652e63069902 100644 (file)
@@ -1020,11 +1020,11 @@ static void init_ring(struct net_device *dev)
 
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);
+               struct sk_buff *skb =
+                       netdev_alloc_skb(dev, np->rx_buf_sz + 2);
                np->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-               skb->dev = dev;         /* Mark as being used by this device. */
                skb_reserve(skb, 2);    /* 16 byte align the IP header. */
                np->rx_ring[i].frag[0].addr = cpu_to_le32(
                        dma_map_single(&np->pci_dev->dev, skb->data,
@@ -1358,7 +1358,7 @@ static void rx_poll(unsigned long data)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                dma_sync_single_for_cpu(&np->pci_dev->dev,
                                                le32_to_cpu(desc->frag[0].addr),
@@ -1411,11 +1411,10 @@ static void refill_rx (struct net_device *dev)
                struct sk_buff *skb;
                entry = np->dirty_rx % RX_RING_SIZE;
                if (np->rx_skbuff[entry] == NULL) {
-                       skb = dev_alloc_skb(np->rx_buf_sz + 2);
+                       skb = netdev_alloc_skb(dev, np->rx_buf_sz + 2);
                        np->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;          /* Better luck next round. */
-                       skb->dev = dev;         /* Mark as being used by this device. */
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                        np->rx_ring[entry].frag[0].addr = cpu_to_le32(
                                dma_map_single(&np->pci_dev->dev, skb->data,
index fe48cb7dde21e38bc9587a114b7c2e7d3e716ddf..8536e376555adfaa61d715c3c47a37959d8a7cb3 100644 (file)
@@ -421,7 +421,7 @@ static int dnet_poll(struct napi_struct *napi, int budget)
                        printk(KERN_ERR "%s packet receive error %x\n",
                               __func__, cmd_word);
 
-               skb = dev_alloc_skb(pkt_len + 5);
+               skb = netdev_alloc_skb(dev, pkt_len + 5);
                if (skb != NULL) {
                        /* Align IP on 16 byte boundaries */
                        skb_reserve(skb, 2);
index c82d444b582d52533dbbd8072ceccc0613b1a12c..1637b986229269b4c3f7b7dcc8f1eeac62b4a915 100644 (file)
@@ -1070,14 +1070,13 @@ static void allocate_rx_buffers(struct net_device *dev)
        while (np->really_rx_count != RX_RING_SIZE) {
                struct sk_buff *skb;
 
-               skb = dev_alloc_skb(np->rx_buf_sz);
+               skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                if (skb == NULL)
                        break;  /* Better luck next round. */
 
                while (np->lack_rxbuf->skbuff)
                        np->lack_rxbuf = np->lack_rxbuf->next_desc_logical;
 
-               skb->dev = dev; /* Mark as being used by this device. */
                np->lack_rxbuf->skbuff = skb;
                np->lack_rxbuf->buffer = pci_map_single(np->pci_dev, skb->data,
                        np->rx_buf_sz, PCI_DMA_FROMDEVICE);
@@ -1265,7 +1264,7 @@ static void init_ring(struct net_device *dev)
 
        /* allocate skb for rx buffers */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
 
                if (skb == NULL) {
                        np->lack_rxbuf = &np->rx_ring[i];
@@ -1274,7 +1273,6 @@ static void init_ring(struct net_device *dev)
 
                ++np->really_rx_count;
                np->rx_ring[i].skbuff = skb;
-               skb->dev = dev; /* Mark as being used by this device. */
                np->rx_ring[i].buffer = pci_map_single(np->pci_dev, skb->data,
                        np->rx_buf_sz, PCI_DMA_FROMDEVICE);
                np->rx_ring[i].status = RXOWN;
@@ -1704,7 +1702,7 @@ static int netdev_rx(struct net_device *dev)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                pci_dma_sync_single_for_cpu(np->pci_dev,
                                                            np->cur_rx->buffer,
index 336edd7e0b78f4762ca06da1646d151e34f6267b..f976619d1b212b3c5c0b8fa5d4e86c9e5c25ada9 100644 (file)
@@ -711,7 +711,7 @@ fec_enet_rx(struct net_device *ndev)
                 * include that when passing upstream as it messes up
                 * bridging applications.
                 */
-               skb = dev_alloc_skb(pkt_len - 4 + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(dev, pkt_len - 4 + NET_IP_ALIGN);
 
                if (unlikely(!skb)) {
                        printk("%s: Memory squeeze, dropping packet.\n",
@@ -1210,7 +1210,7 @@ static int fec_enet_alloc_buffers(struct net_device *ndev)
 
        bdp = fep->rx_bd_base;
        for (i = 0; i < RX_RING_SIZE; i++) {
-               skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE);
+               skb = netdev_alloc_skb(dev, FEC_ENET_RX_FRSIZE);
                if (!skb) {
                        fec_enet_free_buffers(ndev);
                        return -ENOMEM;
index 30745b56fe5d6d5d11193eb966699bf6aed55fc7..7b34d8c698dae663cd3ebf259e4918696b7c9585 100644 (file)
@@ -160,7 +160,7 @@ static int mpc52xx_fec_alloc_rx_buffers(struct net_device *dev, struct bcom_task
        struct sk_buff *skb;
 
        while (!bcom_queue_full(rxtsk)) {
-               skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
+               skb = netdev_alloc_skb(dev, FEC_RX_BUFFER_SIZE);
                if (!skb)
                        return -EAGAIN;
 
@@ -416,7 +416,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 
                /* skbs are allocated on open, so now we allocate a new one,
                 * and remove the old (with the packet) */
-               skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
+               skb = netdev_alloc_skb(dev, FEC_RX_BUFFER_SIZE);
                if (!skb) {
                        /* Can't get a new one : reuse the same & drop pkt */
                        dev_notice(&dev->dev, "Low memory - dropped packet.\n");
index 910a8e18a9ae435807af5aa91812bba14b99d82c..999638a7c851ec6730432614ddf3731c90327d27 100644 (file)
@@ -154,7 +154,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
 
                        if (pkt_len <= fpi->rx_copybreak) {
                                /* +2 to make IP header L1 cache aligned */
-                               skbn = dev_alloc_skb(pkt_len + 2);
+                               skbn = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skbn != NULL) {
                                        skb_reserve(skbn, 2);   /* align IP header */
                                        skb_copy_from_linear_data(skb,
@@ -165,7 +165,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
                                        skbn = skbt;
                                }
                        } else {
-                               skbn = dev_alloc_skb(ENET_RX_FRSIZE);
+                               skbn = netdev_alloc_skb(dev, ENET_RX_FRSIZE);
 
                                if (skbn)
                                        skb_align(skbn, ENET_RX_ALIGN);
@@ -286,7 +286,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
 
                        if (pkt_len <= fpi->rx_copybreak) {
                                /* +2 to make IP header L1 cache aligned */
-                               skbn = dev_alloc_skb(pkt_len + 2);
+                               skbn = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skbn != NULL) {
                                        skb_reserve(skbn, 2);   /* align IP header */
                                        skb_copy_from_linear_data(skb,
@@ -297,7 +297,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
                                        skbn = skbt;
                                }
                        } else {
-                               skbn = dev_alloc_skb(ENET_RX_FRSIZE);
+                               skbn = netdev_alloc_skb(dev, ENET_RX_FRSIZE);
 
                                if (skbn)
                                        skb_align(skbn, ENET_RX_ALIGN);
@@ -504,7 +504,7 @@ void fs_init_bds(struct net_device *dev)
         * Initialize the receive buffer descriptors.
         */
        for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
-               skb = dev_alloc_skb(ENET_RX_FRSIZE);
+               skb = netdev_alloc_skb(dev, ENET_RX_FRSIZE);
                if (skb == NULL) {
                        dev_warn(fep->dev,
                                 "Memory squeeze, unable to allocate skb\n");
@@ -592,7 +592,7 @@ static struct sk_buff *tx_skb_align_workaround(struct net_device *dev,
        struct fs_enet_private *fep = netdev_priv(dev);
 
        /* Alloc new skb */
-       new_skb = dev_alloc_skb(skb->len + 4);
+       new_skb = netdev_alloc_skb(dev, skb->len + 4);
        if (!new_skb) {
                if (net_ratelimit()) {
                        dev_warn(fep->dev,
index ba2dc083bfc007fa416e3c714dd1e6350d59e99b..ec090546131214ede009e72352eef192560c8085 100644 (file)
@@ -214,8 +214,9 @@ static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,
 
        skb = __skb_dequeue(&ugeth->rx_recycle);
        if (!skb)
-               skb = dev_alloc_skb(ugeth->ug_info->uf_info.max_rx_buf_length +
-                                   UCC_GETH_RX_DATA_BUF_ALIGNMENT);
+               skb = netdev_alloc_skb(ugeth->ndev,
+                                     ugeth->ug_info->uf_info.max_rx_buf_length +
+                                     UCC_GETH_RX_DATA_BUF_ALIGNMENT);
        if (skb == NULL)
                return NULL;
 
@@ -227,8 +228,6 @@ static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,
                    (((unsigned)skb->data) & (UCC_GETH_RX_DATA_BUF_ALIGNMENT -
                                              1)));
 
-       skb->dev = ugeth->ndev;
-
        out_be32(&((struct qe_bd __iomem *)bd)->buf,
                      dma_map_single(ugeth->dev,
                                     skb->data,
index 7c6c908bdf02c4374604d76697df2b4168f5c7d4..586b46fd4eed18782faffab05914f084701b07ec 100644 (file)
@@ -757,7 +757,7 @@ net_rx(struct net_device *dev)
                                dev->stats.rx_errors++;
                                break;
                        }
-                       skb = dev_alloc_skb(pkt_len+3);
+                       skb = netdev_alloc_skb(dev, pkt_len + 3);
                        if (skb == NULL) {
                                printk("%s: Memory squeeze, dropping packet (len %d).\n",
                                           dev->name, pkt_len);