netdev: ethernet dev_alloc_skb to netdev_alloc_skb
authorPradeep A Dalvi <netdev@pradeepdalvi.com>
Sun, 5 Feb 2012 02:50:38 +0000 (02:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Feb 2012 16:52:27 +0000 (11:52 -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>
29 files changed:
drivers/net/ethernet/fujitsu/eth16i.c
drivers/net/ethernet/fujitsu/fmvj18x_cs.c
drivers/net/ethernet/hp/hp100.c
drivers/net/ethernet/i825xx/3c505.c
drivers/net/ethernet/i825xx/3c507.c
drivers/net/ethernet/i825xx/3c523.c
drivers/net/ethernet/i825xx/3c527.c
drivers/net/ethernet/i825xx/82596.c
drivers/net/ethernet/i825xx/eepro.c
drivers/net/ethernet/i825xx/eexpress.c
drivers/net/ethernet/i825xx/ether1.c
drivers/net/ethernet/i825xx/lp486e.c
drivers/net/ethernet/i825xx/ni52.c
drivers/net/ethernet/i825xx/sun3_82586.c
drivers/net/ethernet/i825xx/znet.c
drivers/net/ethernet/icplus/ipg.c
drivers/net/ethernet/lantiq_etop.c
drivers/net/ethernet/marvell/mv643xx_eth.c
drivers/net/ethernet/marvell/pxa168_eth.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/micrel/ks8695net.c
drivers/net/ethernet/micrel/ks8851_mll.c
drivers/net/ethernet/micrel/ksz884x.c
drivers/net/ethernet/microchip/enc28j60.c
drivers/net/ethernet/mipsnet.c
drivers/net/ethernet/natsemi/ibmlana.c
drivers/net/ethernet/natsemi/natsemi.c
drivers/net/ethernet/natsemi/sonic.c
drivers/net/ethernet/neterion/s2io.c

index b0e2313af3d1d9674c20290c944afd8c373e3f08..c3f0178fb5cb07dbc3e10b959e45492968821d05 100644 (file)
@@ -1164,7 +1164,7 @@ static void eth16i_rx(struct net_device *dev)
                else {   /* Ok so now we should have a good packet */
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len + 3);
+                       skb = netdev_alloc_skb(dev, pkt_len + 3);
                        if( skb == NULL ) {
                                printk(KERN_WARNING "%s: Could'n allocate memory for packet (len %d)\n",
                                       dev->name, pkt_len);
index ee84b472cee60c377556495ff54504e8a4f6b7f8..0230319ddb59eef8780e1be5ee7032ec0ee9a993 100644 (file)
@@ -1002,7 +1002,7 @@ static void fjn_rx(struct net_device *dev)
                dev->stats.rx_errors++;
                break;
            }
-           skb = dev_alloc_skb(pkt_len+2);
+           skb = netdev_alloc_skb(dev, pkt_len + 2);
            if (skb == NULL) {
                netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n",
                              pkt_len);
index 3598c5408e7986c47c50918a1d6c4a7048c4f69a..d496673f0908ee62ac591da615e08f6f3cfbd64f 100644 (file)
@@ -1274,7 +1274,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
        /* Note: This depends on the alloc_skb functions allocating more
         * space than requested, i.e. aligning to 16bytes */
 
-       ringptr->skb = dev_alloc_skb(roundup(MAX_ETHER_SIZE + 2, 4));
+       ringptr->skb = netdev_alloc_skb(dev, roundup(MAX_ETHER_SIZE + 2, 4));
 
        if (NULL != ringptr->skb) {
                /*
@@ -1284,7 +1284,6 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
                 */
                skb_reserve(ringptr->skb, 2);
 
-               ringptr->skb->dev = dev;
                ringptr->skb->data = (u_char *) skb_put(ringptr->skb, MAX_ETHER_SIZE);
 
                /* ringptr->pdl points to the beginning of the PDL, i.e. the PDH */
@@ -1817,7 +1816,7 @@ static void hp100_rx(struct net_device *dev)
 #endif
 
                /* Now we allocate the skb and transfer the data into it. */
-               skb = dev_alloc_skb(pkt_len+2);
+               skb = netdev_alloc_skb(dev, pkt_len + 2);
                if (skb == NULL) {      /* Not enough memory->drop packet */
 #ifdef HP100_DEBUG
                        printk("hp100: %s: rx: couldn't allocate a sk_buff of size %d\n",
index ba82a266051ddfa6a22a84412f79b1f64455de16..6a5c21b82c511563b48ef9e807fab0e6b8ae5e2a 100644 (file)
@@ -583,7 +583,7 @@ static void receive_packet(struct net_device *dev, int len)
        unsigned long flags;
 
        rlen = (len + 1) & ~1;
-       skb = dev_alloc_skb(rlen + 2);
+       skb = netdev_alloc_skb(dev, rlen + 2);
 
        if (!skb) {
                pr_warning("%s: memory squeeze, dropping packet\n", dev->name);
index 1e945551c144e6b720c833febc903ec2860296da..ed6925f11479fc51f9eba55451ac4b7ce742d5f8 100644 (file)
@@ -851,7 +851,7 @@ static void el16_rx(struct net_device *dev)
                        struct sk_buff *skb;
 
                        pkt_len &= 0x3fff;
-                       skb = dev_alloc_skb(pkt_len+2);
+                       skb = netdev_alloc_skb(dev, pkt_len + 2);
                        if (skb == NULL) {
                                pr_err("%s: Memory squeeze, dropping packet.\n",
                                       dev->name);
index d70d3df4c9855e735b100d6d372b10d6ac1b0595..8451ecd4c1ec7e819862001bca9bfd591727b8f0 100644 (file)
@@ -983,7 +983,7 @@ static void elmc_rcv_int(struct net_device *dev)
                        if ((totlen = rbd->status) & RBD_LAST) {        /* the first and the last buffer? */
                                totlen &= RBD_MASK;     /* length of this frame */
                                rbd->status = 0;
-                               skb = (struct sk_buff *) dev_alloc_skb(totlen + 2);
+                               skb = netdev_alloc_skb(dev, totlen + 2);
                                if (skb != NULL) {
                                        skb_reserve(skb, 2);    /* 16 byte alignment */
                                        skb_put(skb,totlen);
index 474b5e71a53a7da43df83fdfda311675b9d3f91c..ef43f3e951c5d6c2394168bd10b9fc133213c554 100644 (file)
@@ -1169,7 +1169,7 @@ static void mc32_rx_ring(struct net_device *dev)
                        /* Try to save time by avoiding a copy on big frames */
 
                        if ((length > RX_COPYBREAK) &&
-                           ((newskb=dev_alloc_skb(1532)) != NULL))
+                           ((newskb = netdev_alloc_skb(dev, 1532)) != NULL))
                        {
                                skb=lp->rx_ring[rx_ring_tail].skb;
                                skb_put(skb, length);
@@ -1180,7 +1180,7 @@ static void mc32_rx_ring(struct net_device *dev)
                        }
                        else
                        {
-                               skb=dev_alloc_skb(length+2);
+                               skb = netdev_alloc_skb(dev, length + 2);
 
                                if(skb==NULL) {
                                        dev->stats.rx_dropped++;
index f2408a4d5d9c914c9cd1e96cf19cbb5abe701926..6aa927af382c7bff2a0b1b0d96bca0e2026f30ae 100644 (file)
@@ -549,14 +549,13 @@ static inline int init_rx_bufs(struct net_device *dev)
        /* First build the Receive Buffer Descriptor List */
 
        for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) {
-               struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ);
+               struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
 
                if (skb == NULL) {
                        remove_rx_bufs(dev);
                        return -ENOMEM;
                }
 
-               skb->dev = dev;
                rbd->v_next = rbd+1;
                rbd->b_next = WSWAPrbd(virt_to_bus(rbd+1));
                rbd->b_addr = WSWAPrbd(virt_to_bus(rbd));
@@ -810,7 +809,7 @@ static inline int i596_rx(struct net_device *dev)
                                struct sk_buff *newskb;
 
                                /* Get fresh skbuff to replace filled one. */
-                               newskb = dev_alloc_skb(PKT_BUF_SZ);
+                               newskb = netdev_alloc_skb(dev, PKT_BUF_SZ);
                                if (newskb == NULL) {
                                        skb = NULL;     /* drop pkt */
                                        goto memory_squeeze;
@@ -819,7 +818,6 @@ static inline int i596_rx(struct net_device *dev)
                                skb_put(skb, pkt_len);
                                rx_in_place = 1;
                                rbd->skb = newskb;
-                               newskb->dev = dev;
                                rbd->v_data = newskb->data;
                                rbd->b_data = WSWAPchar(virt_to_bus(newskb->data));
 #ifdef __mc68000__
@@ -827,7 +825,7 @@ static inline int i596_rx(struct net_device *dev)
 #endif
                        }
                        else
-                               skb = dev_alloc_skb(pkt_len + 2);
+                               skb = netdev_alloc_skb(dev, pkt_len + 2);
 memory_squeeze:
                        if (skb == NULL) {
                                /* XXX tulip.c can defer packets here!! */
index 114cda7721fe5d155a46045894b386efa850c545..7a4ad4a079171b6b60aab46c4c999d926fd73a7b 100644 (file)
@@ -1563,7 +1563,7 @@ eepro_rx(struct net_device *dev)
 
                        dev->stats.rx_bytes+=rcv_size;
                        rcv_size &= 0x3fff;
-                       skb = dev_alloc_skb(rcv_size+5);
+                       skb = netdev_alloc_skb(dev, rcv_size + 5);
                        if (skb == NULL) {
                                printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
                                dev->stats.rx_dropped++;
index 3a9580f3d4dd247f61054069a943b2384f399438..3fc649e54a3245ad13b654e2d1932e33f712accb 100644 (file)
@@ -955,7 +955,7 @@ static void eexp_hw_rx_pio(struct net_device *dev)
                        {
                                struct sk_buff *skb;
                                pkt_len &= 0x3fff;
-                               skb = dev_alloc_skb(pkt_len+16);
+                               skb = netdev_alloc_skb(dev, pkt_len + 16);
                                if (skb == NULL)
                                {
                                        printk(KERN_WARNING "%s: Memory squeeze, dropping packet\n",dev->name);
index 42e90a97c7a5e6f965cdcc7e6615699a14f7f4e5..406a12b464042026b74e687709b5c5ffb3388614 100644 (file)
@@ -867,7 +867,7 @@ ether1_recv_done (struct net_device *dev)
                        struct sk_buff *skb;
 
                        length = (length + 1) & ~1;
-                       skb = dev_alloc_skb (length + 2);
+                       skb = netdev_alloc_skb(dev, length + 2);
 
                        if (skb) {
                                skb_reserve (skb, 2);
index 02df5f5accb1a7ec1be7281dd4163910dbe08aba..6c2952c8ea15edbc0a1e10c08a3e3b1f94fd8086 100644 (file)
@@ -656,7 +656,7 @@ i596_rx_one(struct net_device *dev, struct i596_private *lp,
        if (rfd->stat & RFD_STAT_OK) {
                /* a good frame */
                int pkt_len = (rfd->count & 0x3fff);
-               struct sk_buff *skb = dev_alloc_skb(pkt_len);
+               struct sk_buff *skb = netdev_alloc_skb(dev, pkt_len);
 
                (*frames)++;
 
index c0893715ef478c1d088e68971c3642d2921d4695..272976e1bb0f79dc5460c79a991555c3174e21c1 100644 (file)
@@ -964,7 +964,7 @@ static void ni52_rcv_int(struct net_device *dev)
                                /* the first and the last buffer? */
                                totlen &= RBD_MASK; /* length of this frame */
                                writew(0x00, &rbd->status);
-                               skb = (struct sk_buff *)dev_alloc_skb(totlen+2);
+                               skb = netdev_alloc_skb(dev, totlen + 2);
                                if (skb != NULL) {
                                        skb_reserve(skb, 2);
                                        skb_put(skb, totlen);
index 296cf8a0ee5150cafbc4b68fd9a15db38368b1f2..cae17f4bc93e1d8a2cb76e9e382d7b70209bcc64 100644 (file)
@@ -778,7 +778,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)
                                {
                                        totlen &= RBD_MASK; /* length of this frame */
                                        rbd->status = 0;
-                                       skb = (struct sk_buff *) dev_alloc_skb(totlen+2);
+                                       skb = netdev_alloc_skb(dev, totlen + 2);
                                        if(skb != NULL)
                                        {
                                                skb_reserve(skb,2);
index 962b4c421f3fce4bcbf605b7aa1a18a9a94cf53c..a43649735a04d93f706818d1cfde7c1b77539d1a 100644 (file)
@@ -762,7 +762,7 @@ static void znet_rx(struct net_device *dev)
                        /* Malloc up new buffer. */
                        struct sk_buff *skb;
 
-                       skb = dev_alloc_skb(pkt_len);
+                       skb = netdev_alloc_skb(dev, pkt_len);
                        if (skb == NULL) {
                                if (znet_debug)
                                  printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
index 3c636f16a3cb25b11fea2c77c337112e03941fb7..1b563bb959c27d10a14d0cb0f3881c0f5a0962b5 100644 (file)
@@ -744,9 +744,6 @@ static int ipg_get_rxbuff(struct net_device *dev, int entry)
                return -ENOMEM;
        }
 
-       /* Associate the receive buffer with the IPG NIC. */
-       skb->dev = dev;
-
        /* Save the address of the sk_buff structure. */
        sp->rx_buff[entry] = skb;
 
index 86d2fe6e053d6de5258172f13d8e9e51ee711fb1..3369b7db777df872c431b4a513ecad9178272c4b 100644 (file)
@@ -114,7 +114,7 @@ struct ltq_etop_priv {
 static int
 ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
 {
-       ch->skb[ch->dma.desc] = dev_alloc_skb(MAX_DMA_DATA_LEN);
+       ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN);
        if (!ch->skb[ch->dma.desc])
                return -ENOMEM;
        ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL,
index 9edecfa1f0f4ffb556d73cbda06db380f9bdeeb8..f702d0dc18c7dde3173279016b3cd52e51e19158 100644 (file)
@@ -667,7 +667,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
 
                skb = __skb_dequeue(&mp->rx_recycle);
                if (skb == NULL)
-                       skb = dev_alloc_skb(mp->skb_size);
+                       skb = netdev_alloc_skb(mp->dev, mp->skb_size);
 
                if (skb == NULL) {
                        mp->oom = 1;
index 92b4b4e68e3b7b55071b7bc89cd9a4eeff6db15c..75df2091bd2e7a445513dd44cdb3c5fc072e3df0 100644 (file)
@@ -350,7 +350,7 @@ static void rxq_refill(struct net_device *dev)
        while (pep->rx_desc_count < pep->rx_ring_size) {
                int size;
 
-               skb = dev_alloc_skb(pep->skb_size);
+               skb = netdev_alloc_skb(dev, pep->skb_size);
                if (!skb)
                        break;
                if (SKB_DMA_REALIGN)
index f61d0e08f52bbd93f2b4cd329cd393ace17f6829..fb6e899f38d346428082a8d762ea0445f13ca620 100644 (file)
@@ -463,12 +463,11 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
        int used_frags;
        dma_addr_t dma;
 
-       skb = dev_alloc_skb(SMALL_PACKET_SIZE + NET_IP_ALIGN);
+       skb = netdev_alloc_skb(priv->dev, SMALL_PACKET_SIZE + NET_IP_ALIGN);
        if (!skb) {
                en_dbg(RX_ERR, priv, "Failed allocating skb\n");
                return NULL;
        }
-       skb->dev = priv->dev;
        skb_reserve(skb, NET_IP_ALIGN);
        skb->len = length;
 
index 7c717276502f443adee73d42dc6ddd50dcabad9c..dccae1d1743a6241679d2ece28528736404b59e6 100644 (file)
@@ -278,7 +278,8 @@ ks8695_refill_rxbuffers(struct ks8695_priv *ksp)
 
        for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) {
                if (!ksp->rx_buffers[buff_n].skb) {
-                       struct sk_buff *skb = dev_alloc_skb(MAX_RXBUF_SIZE);
+                       struct sk_buff *skb =
+                               netdev_alloc_skb(ksp->ndev, MAX_RXBUF_SIZE);
                        dma_addr_t mapping;
 
                        ksp->rx_buffers[buff_n].skb = skb;
@@ -299,7 +300,6 @@ ks8695_refill_rxbuffers(struct ks8695_priv *ksp)
                                break;
                        }
                        ksp->rx_buffers[buff_n].dma_ptr = mapping;
-                       skb->dev = ksp->ndev;
                        ksp->rx_buffers[buff_n].length = MAX_RXBUF_SIZE;
 
                        /* Record this into the DMA ring */
index 4a9d57fb9fb458825e497c41a4b4f4ce40ba5a29..61a2f61a31f69ff7e315984d580e117551ddfa32 100644 (file)
@@ -796,7 +796,7 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev)
 
        frame_hdr = ks->frame_head_info;
        while (ks->frame_cnt--) {
-               skb = dev_alloc_skb(frame_hdr->len + 16);
+               skb = netdev_alloc_skb(netdev, frame_hdr->len + 16);
                if (likely(skb && (frame_hdr->sts & RXFSHR_RXFV) &&
                        (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) {
                        skb_reserve(skb, 2);
index 2725d693c3c42079fd4f342d813edf9184987b8c..ef723b185d853794746a3882cf54e4c00a205699 100644 (file)
@@ -4863,7 +4863,7 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
                                memset(&skb->data[skb->len], 0, 50 - skb->len);
                                skb->len = 50;
                        } else {
-                               skb = dev_alloc_skb(50);
+                               skb = netdev_alloc_skb(dev, 50);
                                if (!skb)
                                        return NETDEV_TX_BUSY;
                                memcpy(skb->data, org_skb->data, org_skb->len);
@@ -4885,7 +4885,7 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
                                (ETH_P_IPV6 == htons(skb->protocol)))) {
                        struct sk_buff *org_skb = skb;
 
-                       skb = dev_alloc_skb(org_skb->len);
+                       skb = netdev_alloc_skb(dev, org_skb->len);
                        if (!skb) {
                                rc = NETDEV_TX_BUSY;
                                goto unlock;
@@ -5019,7 +5019,7 @@ static inline int rx_proc(struct net_device *dev, struct ksz_hw* hw,
 
        do {
                /* skb->data != skb->head */
-               skb = dev_alloc_skb(packet_len + 2);
+               skb = netdev_alloc_skb(dev, packet_len + 2);
                if (!skb) {
                        dev->stats.rx_dropped++;
                        return -ENOMEM;
index c813e5d8db9df3eae25e8d5d5c70b3a0761aa5d9..1d6b7ce3e1eedc1981252706ef94b9fe59b91766 100644 (file)
@@ -954,14 +954,13 @@ static void enc28j60_hw_rx(struct net_device *ndev)
                if (len > MAX_FRAMELEN)
                        ndev->stats.rx_over_errors++;
        } else {
-               skb = dev_alloc_skb(len + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(ndev, len + NET_IP_ALIGN);
                if (!skb) {
                        if (netif_msg_rx_err(priv))
                                dev_err(&ndev->dev,
                                        "out of memory for Rx'd frame\n");
                        ndev->stats.rx_dropped++;
                } else {
-                       skb->dev = ndev;
                        skb_reserve(skb, NET_IP_ALIGN);
                        /* copy the packet from the receive buffer */
                        enc28j60_mem_read(priv,
index d05b0c9e1e9c4a96c8c214f31848eeecb9d929a5..dbc666a3d52328b942ae89d39250ce1ab30cafbc 100644 (file)
@@ -152,7 +152,7 @@ static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t len)
        if (!len)
                return len;
 
-       skb = dev_alloc_skb(len + NET_IP_ALIGN);
+       skb = netdev_alloc_skb(dev, len + NET_IP_ALIGN);
        if (!skb) {
                dev->stats.rx_dropped++;
                return -ENOMEM;
index 999407f7ebdf02227a79db0412433c5ba694d860..3f94ddbf4dc0db10261077a55dd142fcbf8a4eb4 100644 (file)
@@ -589,7 +589,7 @@ static void irqrx_handler(struct net_device *dev)
 
                        /* fetch buffer */
 
-                       skb = dev_alloc_skb(rda.length + 2);
+                       skb = netdev_alloc_skb(dev, rda.length + 2);
                        if (skb == NULL)
                                dev->stats.rx_dropped++;
                        else {
index ac7b16b6e7af34d4ce91e068b47c2216e773f569..d38e48d4f43057ca8fde7684c5dfb2786c9cadae 100644 (file)
@@ -1934,11 +1934,10 @@ static void refill_rx(struct net_device *dev)
                int entry = np->dirty_rx % RX_RING_SIZE;
                if (np->rx_skbuff[entry] == NULL) {
                        unsigned int buflen = np->rx_buf_sz+NATSEMI_PADDING;
-                       skb = dev_alloc_skb(buflen);
+                       skb = netdev_alloc_skb(dev, buflen);
                        np->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break; /* Better luck next round. */
-                       skb->dev = dev; /* Mark as being used by this device. */
                        np->rx_dma[entry] = pci_map_single(np->pci_dev,
                                skb->data, buflen, PCI_DMA_FROMDEVICE);
                        np->rx_ring[entry].addr = cpu_to_le32(np->rx_dma[entry]);
@@ -2344,7 +2343,7 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
                        /* 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 + RX_OFFSET)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + RX_OFFSET)) != NULL) {
                                /* 16 byte align the IP header */
                                skb_reserve(skb, RX_OFFSET);
                                pci_dma_sync_single_for_cpu(np->pci_dev,
index 26e25d7f58298c16cd0d48df2b58d368f56cfafa..0452e2968d27f3b104b7bfdb6f702e10707c6d9e 100644 (file)
@@ -51,7 +51,7 @@ static int sonic_open(struct net_device *dev)
                printk("sonic_open: initializing sonic driver.\n");
 
        for (i = 0; i < SONIC_NUM_RRS; i++) {
-               struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
+               struct sk_buff *skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2);
                if (skb == NULL) {
                        while(i > 0) { /* free any that were allocated successfully */
                                i--;
@@ -422,7 +422,7 @@ static void sonic_rx(struct net_device *dev)
                status = sonic_rda_get(dev, entry, SONIC_RD_STATUS);
                if (status & SONIC_RCR_PRX) {
                        /* Malloc up new buffer. */
-                       new_skb = dev_alloc_skb(SONIC_RBSIZE + 2);
+                       new_skb = netdev_alloc_skb(SONIC_RBSIZE + 2);
                        if (new_skb == NULL) {
                                printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
                                lp->stats.rx_dropped++;
index 138584608809872d8bcf78ff39b05df385016218..44a6065794c369e5ec665838084e1ed1b4d552a9 100644 (file)
@@ -2524,7 +2524,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, struct ring_info *ring,
                        size = ring->mtu + ALIGN_SIZE + BUF0_LEN + 4;
 
                /* allocate skb */
-               skb = dev_alloc_skb(size);
+               skb = netdev_alloc_skb(nic->dev, size);
                if (!skb) {
                        DBG_PRINT(INFO_DBG, "%s: Could not allocate skb\n",
                                  ring->dev->name);
@@ -6820,7 +6820,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
                         */
                        rxdp1->Buffer0_ptr = *temp0;
                } else {
-                       *skb = dev_alloc_skb(size);
+                       *skb = netdev_alloc_skb(dev, size);
                        if (!(*skb)) {
                                DBG_PRINT(INFO_DBG,
                                          "%s: Out of memory to allocate %s\n",
@@ -6849,7 +6849,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
                        rxdp3->Buffer0_ptr = *temp0;
                        rxdp3->Buffer1_ptr = *temp1;
                } else {
-                       *skb = dev_alloc_skb(size);
+                       *skb = netdev_alloc_skb(dev, size);
                        if (!(*skb)) {
                                DBG_PRINT(INFO_DBG,
                                          "%s: Out of memory to allocate %s\n",