netdev: ethernet dev_alloc_skb to netdev_alloc_skb
authorPradeep A Dalvi <netdev@pradeepdalvi.com>
Sun, 5 Feb 2012 02:49:09 +0000 (02:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Feb 2012 16:41:20 +0000 (11:41 -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>
28 files changed:
drivers/net/ethernet/3com/3c501.c
drivers/net/ethernet/3com/3c509.c
drivers/net/ethernet/3com/3c574_cs.c
drivers/net/ethernet/3com/3c589_cs.c
drivers/net/ethernet/3com/3c59x.c
drivers/net/ethernet/3com/typhoon.c
drivers/net/ethernet/8390/axnet_cs.c
drivers/net/ethernet/8390/lib8390.c
drivers/net/ethernet/adaptec/starfire.c
drivers/net/ethernet/aeroflex/greth.c
drivers/net/ethernet/amd/7990.c
drivers/net/ethernet/amd/a2065.c
drivers/net/ethernet/amd/am79c961a.c
drivers/net/ethernet/amd/amd8111e.c
drivers/net/ethernet/amd/ariadne.c
drivers/net/ethernet/amd/atarilance.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/amd/declance.c
drivers/net/ethernet/amd/depca.c
drivers/net/ethernet/amd/ni65.c
drivers/net/ethernet/amd/nmclan_cs.c
drivers/net/ethernet/amd/pcnet32.c
drivers/net/ethernet/amd/sun3lance.c
drivers/net/ethernet/amd/sunlance.c
drivers/net/ethernet/apple/mace.c
drivers/net/ethernet/apple/macmace.c
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
drivers/net/ethernet/cadence/at91_ether.c

index 68da81d476f3b7e5888457507fa7ea4830f16ed6..bf73e1a02293647a49e9b2b4abcc465149377b94 100644 (file)
@@ -702,7 +702,7 @@ static void el_receive(struct net_device *dev)
         */
 
        outb(AX_SYS, AX_CMD);
-       skb = dev_alloc_skb(pkt_len+2);
+       skb = netdev_alloc_skb(dev, pkt_len + 2);
 
        /*
         *      Start of frame
index 92053e6fc980a95b6ae6f5836ff1fdce5d1f79e2..41719da2e17864e6815e5bf5b2c0ef20062ba703 100644 (file)
@@ -1066,7 +1066,7 @@ el3_rx(struct net_device *dev)
                        short pkt_len = rx_status & 0x7ff;
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len+5);
+                       skb = netdev_alloc_skb(dev, pkt_len + 5);
                        if (el3_debug > 4)
                                pr_debug("Receiving packet size %d status %4.4x.\n",
                                           pkt_len, rx_status);
index 9c01bc9235b36cc7c1c5acfd857e6d4b1f5ab1b9..e61b2f82ba3a8d001e4f0824b22e70e1ef0b2391 100644 (file)
@@ -1012,7 +1012,7 @@ static int el3_rx(struct net_device *dev, int worklimit)
                        short pkt_len = rx_status & 0x7ff;
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len+5);
+                       skb = netdev_alloc_skb(dev, pkt_len + 5);
 
                        pr_debug("  Receiving packet size %d status %4.4x.\n",
                                  pkt_len, rx_status);
index da410f036869cd4cb4f9368acfc4441c027f2278..b23253b9f74235f75bab3ea5355d7aed7d3fbcfe 100644 (file)
@@ -819,7 +819,7 @@ static int el3_rx(struct net_device *dev)
            short pkt_len = rx_status & 0x7ff;
            struct sk_buff *skb;
 
-           skb = dev_alloc_skb(pkt_len+5);
+           skb = netdev_alloc_skb(dev, pkt_len + 5);
 
            netdev_dbg(dev, "    Receiving packet size %d status %4.4x.\n",
                       pkt_len, rx_status);
index dc51d9218e6dadf51a3330a5f8ef6bc3628447a9..1282f048dfad7ea4b6b9b8bd5b498f39046c683e 100644 (file)
@@ -2499,7 +2499,7 @@ static int vortex_rx(struct net_device *dev)
                        int pkt_len = rx_status & 0x1fff;
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len + 5);
+                       skb = netdev_alloc_skb(dev, pkt_len + 5);
                        if (vortex_debug > 4)
                                pr_debug("Receiving packet size %d status %4.4x.\n",
                                           pkt_len, rx_status);
@@ -2578,7 +2578,8 @@ boomerang_rx(struct net_device *dev)
 
                        /* Check if the packet is long enough to just accept without
                           copying to a properly sized skbuff. */
-                       if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                       if (pkt_len < rx_copybreak &&
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                                pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
                                /* 'skb_put()' points to the start of sk_buff data area. */
index 6d6bc754b1a8e9f3fd49255aaadfe5620c49d567..f7d622eed203e69efb922ad70e599e8001db6140 100644 (file)
@@ -1607,7 +1607,7 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
                                le32_to_cpu(indexes->rxBuffCleared))
                return -ENOMEM;
 
-       skb = dev_alloc_skb(PKT_BUF_SZ);
+       skb = netdev_alloc_skb(tp->dev, PKT_BUF_SZ);
        if(!skb)
                return -ENOMEM;
 
@@ -1618,7 +1618,6 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
        skb_reserve(skb, 2);
 #endif
 
-       skb->dev = tp->dev;
        dma_addr = pci_map_single(tp->pdev, skb->data,
                                  PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
 
@@ -1673,7 +1672,7 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read
                pkt_len = le16_to_cpu(rx->frameLen);
 
                if(pkt_len < rx_copybreak &&
-                  (new_skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                  (new_skb = netdev_alloc_skb(tp->dev, pkt_len + 2)) != NULL) {
                        skb_reserve(new_skb, 2);
                        pci_dma_sync_single_for_cpu(tp->pdev, dma_addr,
                                                    PKT_BUF_SZ,
index 5de394368ff3d8771a9fb60438a18439c2a63aaf..c5bd8eb7a9f598d14665c31cfba6f9ff49f83f46 100644 (file)
@@ -1408,7 +1408,7 @@ static void ei_receive(struct net_device *dev)
                {
                        struct sk_buff *skb;
                        
-                       skb = dev_alloc_skb(pkt_len+2);
+                       skb = netdev_alloc_skb(dev, pkt_len + 2);
                        if (skb == NULL) 
                        {
                                if (ei_debug > 1)
index 05ae21435bfddf9abd98e98ef00a98f065f8bdf0..e77f624e819476214ea146b7cc46b511420df4f7 100644 (file)
@@ -717,7 +717,7 @@ static void ei_receive(struct net_device *dev)
                } else if ((pkt_stat & 0x0F) == ENRSR_RXOK) {
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len+2);
+                       skb = netdev_alloc_skb(dev, pkt_len + 2);
                        if (skb == NULL) {
                                if (ei_debug > 1)
                                        netdev_dbg(dev, "Couldn't allocate a sk_buff of size %d\n",
index 11fc2eccb0fdb18c641caaebcc91bebb8d3945dc..d896816512ca952f943b9bbe04e27686a0bab7fd 100644 (file)
@@ -1179,12 +1179,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);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                np->rx_info[i].skb = skb;
                if (skb == NULL)
                        break;
                np->rx_info[i].mapping = pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-               skb->dev = dev;                 /* Mark as being used by this device. */
                /* Grrr, we cannot offset to correctly align the IP header. */
                np->rx_ring[i].rxaddr = cpu_to_dma(np->rx_info[i].mapping | RxDescValid);
        }
@@ -1472,7 +1471,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                /* 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_info[entry].mapping,
@@ -1596,13 +1595,12 @@ static void refill_rx_ring(struct net_device *dev)
        for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
                entry = np->dirty_rx % RX_RING_SIZE;
                if (np->rx_info[entry].skb == NULL) {
-                       skb = dev_alloc_skb(np->rx_buf_sz);
+                       skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                        np->rx_info[entry].skb = skb;
                        if (skb == NULL)
                                break;  /* Better luck next round. */
                        np->rx_info[entry].mapping =
                                pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-                       skb->dev = dev; /* Mark as being used by this device. */
                        np->rx_ring[entry].rxaddr =
                                cpu_to_dma(np->rx_info[entry].mapping | RxDescValid);
                }
index c885aa905decb01c1399ea50639cc2d734d3b419..b23751e683c89cedc307f2a40000712deb5f5b30 100644 (file)
@@ -785,7 +785,6 @@ static int greth_rx(struct net_device *dev, int limit)
 
                        } else {
                                skb_reserve(skb, NET_IP_ALIGN);
-                               skb->dev = dev;
 
                                dma_sync_single_for_cpu(greth->dev,
                                                        dma_addr,
index 60b35fb5f524abe02c9d09d0a64036593d1b956a..1b046f58d58fa7c20384a6192da4e30fc4ad6208 100644 (file)
@@ -316,7 +316,7 @@ static int lance_rx (struct net_device *dev)
                         if (bits & LE_R1_EOP) dev->stats.rx_errors++;
                 } else {
                        int len = (rd->mblength & 0xfff) - 4;
-                       struct sk_buff *skb = dev_alloc_skb (len+2);
+                       struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
 
                         if (!skb) {
                                 printk ("%s: Memory squeeze, deferring packet.\n",
index 825e5d4ef4c3ba739640186f8f8b57f5fb5f56b8..689dfcafc6d47ed843f35ffd1a9ab09517f36d43 100644 (file)
@@ -290,7 +290,7 @@ static int lance_rx(struct net_device *dev)
                                dev->stats.rx_errors++;
                } else {
                        int len = (rd->mblength & 0xfff) - 4;
-                       struct sk_buff *skb = dev_alloc_skb(len + 2);
+                       struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
 
                        if (!skb) {
                                netdev_warn(dev, "Memory squeeze, deferring packet\n");
index 216ae87b94595072b063174ef7c24743a427f86e..cc7b9e46780c2c7cfbcbd94b8607fa154b49d2ed 100644 (file)
@@ -516,7 +516,7 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
                }
 
                len = am_readword(dev, hdraddr + 6);
-               skb = dev_alloc_skb(len + 2);
+               skb = netdev_alloc_skb(dev, len + 2);
 
                if (skb) {
                        skb_reserve(skb, 2);
index b8306a589558603c9ce40e50973fe5d50a725e95..9f62504d008691244ba81d495b47ff64d16a882a 100644 (file)
@@ -336,7 +336,8 @@ static int amd8111e_init_ring(struct net_device *dev)
        /* Allocating receive  skbs */
        for (i = 0; i < NUM_RX_BUFFERS; i++) {
 
-               if (!(lp->rx_skbuff[i] = dev_alloc_skb(lp->rx_buff_len))) {
+               lp->rx_skbuff[i] = netdev_alloc_skb(dev, lp->rx_buff_len);
+               if (!lp->rx_skbuff[i]) {
                                /* Release previos allocated skbs */
                                for(--i; i >= 0 ;i--)
                                        dev_kfree_skb(lp->rx_skbuff[i]);
@@ -768,7 +769,8 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
                        }
                        if(--rx_pkt_limit < 0)
                                goto rx_not_empty;
-                       if(!(new_skb = dev_alloc_skb(lp->rx_buff_len))){
+                       new_skb = netdev_alloc_skb(dev, lp->rx_buff_len);
+                       if (!new_skb) {
                                /* if allocation fail,
                                   ignore that pkt and go to next one */
                                lp->rx_ring[rx_index].rx_flags &= RESET_RX_FLAGS;
index eb18e1fe65c89ef88296b3eec49b22b76ad91aee..f4c228e4d76c89351001cffb9817af870a675da0 100644 (file)
@@ -191,7 +191,7 @@ static int ariadne_rx(struct net_device *dev)
                        short pkt_len = swapw(priv->rx_ring[entry]->RMD3);
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len + 2);
+                       skb = netdev_alloc_skb(dev, pkt_len + 2);
                        if (skb == NULL) {
                                netdev_warn(dev, "Memory squeeze, deferring packet\n");
                                for (i = 0; i < RX_RING_SIZE; i++)
index 15bfa28d6c53a0ef36eede8105eb7703b397ba91..70ed79c46245a4b3bdbe71b3eddf2258cf23e929 100644 (file)
@@ -997,7 +997,7 @@ static int lance_rx( struct net_device *dev )
                                dev->stats.rx_errors++;
                        }
                        else {
-                               skb = dev_alloc_skb( pkt_len+2 );
+                               skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb == NULL) {
                                        DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
                                                                  dev->name ));
index a81c871aeacfe1b0c8162c87757d735cfa2babf6..c1dfdc8b7079b27d09950981be754b7acde823e8 100644 (file)
@@ -725,7 +725,7 @@ static int au1000_rx(struct net_device *dev)
                        /* good frame */
                        frmlen = (status & RX_FRAME_LEN_MASK);
                        frmlen -= 4; /* Remove FCS */
-                       skb = dev_alloc_skb(frmlen + 2);
+                       skb = netdev_alloc_skb(dev, frmlen + 2);
                        if (skb == NULL) {
                                netdev_err(dev, "Memory squeeze, dropping packet.\n");
                                dev->stats.rx_dropped++;
index dd82ee2f8d21a78a9294ab68a6be1a4bc3c9bf12..7dc508e5c72e89e0b7d964c98d4e1aef09e60cb2 100644 (file)
@@ -605,7 +605,7 @@ static int lance_rx(struct net_device *dev)
                                dev->stats.rx_errors++;
                } else {
                        len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4;
-                       skb = dev_alloc_skb(len + 2);
+                       skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == 0) {
                                printk("%s: Memory squeeze, deferring packet.\n",
index 681970c07f22337ba70acdcd7ef59f290b09b155..86dd95766a64f6575bda9b36cfb5ff2dfbf630a6 100644 (file)
@@ -1042,7 +1042,7 @@ static int depca_rx(struct net_device *dev)
                                short len, pkt_len = readw(&lp->rx_ring[entry].msg_length) - 4;
                                struct sk_buff *skb;
 
-                               skb = dev_alloc_skb(pkt_len + 2);
+                               skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb != NULL) {
                                        unsigned char *buf;
                                        skb_reserve(skb, 2);    /* 16 byte align the IP header */
index 735c213798b1bbb691d5d193f8a89287cbf7a400..013b651085369c83e20db7b4c5f868c382c5dccd 100644 (file)
@@ -1089,7 +1089,7 @@ static void ni65_recv_intr(struct net_device *dev,int csr0)
                        if (skb)
                                skb_reserve(skb,16);
 #else
-                       struct sk_buff *skb = dev_alloc_skb(len+2);
+                       struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
 #endif
                        if(skb)
                        {
index 6be0dd67631a448cdeafb39ce23185ae150c22ed..ebdb9e238a8d822e1863aa26adfb99563ed47ece 100644 (file)
@@ -1104,7 +1104,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
       pr_debug("    receiving packet size 0x%X rx_status"
            " 0x%X.\n", pkt_len, rx_status);
 
-      skb = dev_alloc_skb(pkt_len+2);
+      skb = netdev_alloc_skb(dev, pkt_len + 2);
 
       if (skb != NULL) {
        skb_reserve(skb, 2);
index 1bb388f62e5bf2e8bbd911ff4ac55c338eaed0fe..86b6d8e4e6cd594ec39bdb5ca41fe130008fac64 100644 (file)
@@ -588,11 +588,11 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
        /* now allocate any new buffers needed */
        for (; new < size; new++) {
                struct sk_buff *rx_skbuff;
-               new_skb_list[new] = dev_alloc_skb(PKT_BUF_SKB);
+               new_skb_list[new] = netdev_alloc_skb(dev, PKT_BUF_SKB);
                rx_skbuff = new_skb_list[new];
                if (!rx_skbuff) {
                        /* keep the original lists and buffers */
-                       netif_err(lp, drv, dev, "%s dev_alloc_skb failed\n",
+                       netif_err(lp, drv, dev, "%s netdev_alloc_skb failed\n",
                                  __func__);
                        goto free_all_new;
                }
@@ -909,7 +909,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
        /* Initialize Transmit buffers. */
        size = data_len + 15;
        for (x = 0; x < numbuffs; x++) {
-               skb = dev_alloc_skb(size);
+               skb = netdev_alloc_skb(dev, size);
                if (!skb) {
                        netif_printk(lp, hw, KERN_DEBUG, dev,
                                     "Cannot allocate skb at line: %d!\n",
@@ -1152,7 +1152,7 @@ static void pcnet32_rx_entry(struct net_device *dev,
        if (pkt_len > rx_copybreak) {
                struct sk_buff *newskb;
 
-               newskb = dev_alloc_skb(PKT_BUF_SKB);
+               newskb = netdev_alloc_skb(dev, PKT_BUF_SKB);
                if (newskb) {
                        skb_reserve(newskb, NET_IP_ALIGN);
                        skb = lp->rx_skbuff[entry];
@@ -1172,7 +1172,7 @@ static void pcnet32_rx_entry(struct net_device *dev,
                } else
                        skb = NULL;
        } else
-               skb = dev_alloc_skb(pkt_len + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN);
 
        if (skb == NULL) {
                netif_err(lp, drv, dev, "Memory squeeze, dropping packet\n");
@@ -2271,11 +2271,11 @@ static int pcnet32_init_ring(struct net_device *dev)
        for (i = 0; i < lp->rx_ring_size; i++) {
                struct sk_buff *rx_skbuff = lp->rx_skbuff[i];
                if (rx_skbuff == NULL) {
-                       lp->rx_skbuff[i] = dev_alloc_skb(PKT_BUF_SKB);
+                       lp->rx_skbuff[i] = netdev_alloc_skb(dev, PKT_BUF_SKB);
                        rx_skbuff = lp->rx_skbuff[i];
                        if (!rx_skbuff) {
                                /* there is not much we can do at this point */
-                               netif_err(lp, drv, dev, "%s dev_alloc_skb failed\n",
+                               netif_err(lp, drv, dev, "%s netdev_alloc_skb failed\n",
                                          __func__);
                                return -1;
                        }
index 080b71fcc6833d41a12c5fffa48e57812ce51a96..74b3891b64836485143db3dca11948f29f95b683 100644 (file)
@@ -810,7 +810,7 @@ static int lance_rx( struct net_device *dev )
                                dev->stats.rx_errors++;
                        }
                        else {
-                               skb = dev_alloc_skb( pkt_len+2 );
+                               skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb == NULL) {
                                        DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
                                                      dev->name ));
index 7ea16d32a5f5cd49aafb3fbc6e71368c23147674..e3fe3504e198f400916b7b1f506da18c26330900 100644 (file)
@@ -534,7 +534,7 @@ static void lance_rx_dvma(struct net_device *dev)
                        if (bits & LE_R1_EOP) dev->stats.rx_errors++;
                } else {
                        len = (rd->mblength & 0xfff) - 4;
-                       skb = dev_alloc_skb(len + 2);
+                       skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == NULL) {
                                printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
@@ -706,7 +706,7 @@ static void lance_rx_pio(struct net_device *dev)
                        if (bits & LE_R1_EOP) dev->stats.rx_errors++;
                } else {
                        len = (sbus_readw(&rd->mblength) & 0xfff) - 4;
-                       skb = dev_alloc_skb(len + 2);
+                       skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == NULL) {
                                printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
index bd5555dbe027610b6968ea854dcd8fc3688f21ae..06998462e0d313887e92260a5e31a9b323190b25 100644 (file)
@@ -444,7 +444,7 @@ static int mace_open(struct net_device *dev)
     memset((char *)mp->rx_cmds, 0, N_RX_RING * sizeof(struct dbdma_cmd));
     cp = mp->rx_cmds;
     for (i = 0; i < N_RX_RING - 1; ++i) {
-       skb = dev_alloc_skb(RX_BUFLEN + 2);
+       skb = netdev_alloc_skb(dev, RX_BUFLEN + 2);
        if (!skb) {
            data = dummy_buf;
        } else {
@@ -956,7 +956,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
        cp = mp->rx_cmds + i;
        skb = mp->rx_bufs[i];
        if (!skb) {
-           skb = dev_alloc_skb(RX_BUFLEN + 2);
+           skb = netdev_alloc_skb(RX_BUFLEN + 2);
            if (skb) {
                skb_reserve(skb, 2);
                mp->rx_bufs[i] = skb;
index 7cf81bbffe0e6121689514bcc965d6024701f585..ab7ff8645ab1641478cbe73825dde81d9a1dab7c 100644 (file)
@@ -661,7 +661,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
        } else {
                unsigned int frame_length = mf->rcvcnt + ((frame_status & 0x0F) << 8 );
 
-               skb = dev_alloc_skb(frame_length + 2);
+               skb = netdev_alloc_skb(dev, frame_length + 2);
                if (!skb) {
                        dev->stats.rx_dropped++;
                        return;
index 7ee4aacb01a406624d1af49ee93f1bd28cf4d55e..2c8ed70704aa6287013c2a0986e9784ae2ebca51 100644 (file)
@@ -1765,7 +1765,7 @@ static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid
        while (next_info->flags & ATL1C_BUFFER_FREE) {
                rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use);
 
-               skb = dev_alloc_skb(adapter->rx_buffer_len);
+               skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len);
                if (unlikely(!skb)) {
                        if (netif_msg_rx_err(adapter))
                                dev_warn(&pdev->dev, "alloc rx buffer failed\n");
index 1a5b6efa0120358b39adcfcf7f9d3a1c518d78d3..906117016fc4427d63a1a81be78fe03069591a31 100644 (file)
@@ -886,7 +886,7 @@ static void at91ether_rx(struct net_device *dev)
        while (dlist->descriptors[lp->rxBuffIndex].addr & EMAC_DESC_DONE) {
                p_recv = dlist->recv_buf[lp->rxBuffIndex];
                pktlen = dlist->descriptors[lp->rxBuffIndex].size & 0x7ff;      /* Length of frame including FCS */
-               skb = dev_alloc_skb(pktlen + 2);
+               skb = netdev_alloc_skb(dev, pktlen + 2);
                if (skb != NULL) {
                        skb_reserve(skb, 2);
                        memcpy(skb_put(skb, pktlen), p_recv, pktlen);