diff options
Diffstat (limited to 'drivers/net/ethernet')
29 files changed, 39 insertions, 48 deletions
diff --git a/drivers/net/ethernet/fujitsu/eth16i.c b/drivers/net/ethernet/fujitsu/eth16i.c index b0e2313af3d1..c3f0178fb5cb 100644 --- a/drivers/net/ethernet/fujitsu/eth16i.c +++ b/drivers/net/ethernet/fujitsu/eth16i.c | |||
@@ -1164,7 +1164,7 @@ static void eth16i_rx(struct net_device *dev) | |||
1164 | else { /* Ok so now we should have a good packet */ | 1164 | else { /* Ok so now we should have a good packet */ |
1165 | struct sk_buff *skb; | 1165 | struct sk_buff *skb; |
1166 | 1166 | ||
1167 | skb = dev_alloc_skb(pkt_len + 3); | 1167 | skb = netdev_alloc_skb(dev, pkt_len + 3); |
1168 | if( skb == NULL ) { | 1168 | if( skb == NULL ) { |
1169 | printk(KERN_WARNING "%s: Could'n allocate memory for packet (len %d)\n", | 1169 | printk(KERN_WARNING "%s: Could'n allocate memory for packet (len %d)\n", |
1170 | dev->name, pkt_len); | 1170 | dev->name, pkt_len); |
diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c index ee84b472cee6..0230319ddb59 100644 --- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c +++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c | |||
@@ -1002,7 +1002,7 @@ static void fjn_rx(struct net_device *dev) | |||
1002 | dev->stats.rx_errors++; | 1002 | dev->stats.rx_errors++; |
1003 | break; | 1003 | break; |
1004 | } | 1004 | } |
1005 | skb = dev_alloc_skb(pkt_len+2); | 1005 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
1006 | if (skb == NULL) { | 1006 | if (skb == NULL) { |
1007 | netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n", | 1007 | netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n", |
1008 | pkt_len); | 1008 | pkt_len); |
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c index 3598c5408e79..d496673f0908 100644 --- a/drivers/net/ethernet/hp/hp100.c +++ b/drivers/net/ethernet/hp/hp100.c | |||
@@ -1274,7 +1274,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, | |||
1274 | /* Note: This depends on the alloc_skb functions allocating more | 1274 | /* Note: This depends on the alloc_skb functions allocating more |
1275 | * space than requested, i.e. aligning to 16bytes */ | 1275 | * space than requested, i.e. aligning to 16bytes */ |
1276 | 1276 | ||
1277 | ringptr->skb = dev_alloc_skb(roundup(MAX_ETHER_SIZE + 2, 4)); | 1277 | ringptr->skb = netdev_alloc_skb(dev, roundup(MAX_ETHER_SIZE + 2, 4)); |
1278 | 1278 | ||
1279 | if (NULL != ringptr->skb) { | 1279 | if (NULL != ringptr->skb) { |
1280 | /* | 1280 | /* |
@@ -1284,7 +1284,6 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, | |||
1284 | */ | 1284 | */ |
1285 | skb_reserve(ringptr->skb, 2); | 1285 | skb_reserve(ringptr->skb, 2); |
1286 | 1286 | ||
1287 | ringptr->skb->dev = dev; | ||
1288 | ringptr->skb->data = (u_char *) skb_put(ringptr->skb, MAX_ETHER_SIZE); | 1287 | ringptr->skb->data = (u_char *) skb_put(ringptr->skb, MAX_ETHER_SIZE); |
1289 | 1288 | ||
1290 | /* ringptr->pdl points to the beginning of the PDL, i.e. the PDH */ | 1289 | /* 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) | |||
1817 | #endif | 1816 | #endif |
1818 | 1817 | ||
1819 | /* Now we allocate the skb and transfer the data into it. */ | 1818 | /* Now we allocate the skb and transfer the data into it. */ |
1820 | skb = dev_alloc_skb(pkt_len+2); | 1819 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
1821 | if (skb == NULL) { /* Not enough memory->drop packet */ | 1820 | if (skb == NULL) { /* Not enough memory->drop packet */ |
1822 | #ifdef HP100_DEBUG | 1821 | #ifdef HP100_DEBUG |
1823 | printk("hp100: %s: rx: couldn't allocate a sk_buff of size %d\n", | 1822 | printk("hp100: %s: rx: couldn't allocate a sk_buff of size %d\n", |
diff --git a/drivers/net/ethernet/i825xx/3c505.c b/drivers/net/ethernet/i825xx/3c505.c index ba82a266051d..6a5c21b82c51 100644 --- a/drivers/net/ethernet/i825xx/3c505.c +++ b/drivers/net/ethernet/i825xx/3c505.c | |||
@@ -583,7 +583,7 @@ static void receive_packet(struct net_device *dev, int len) | |||
583 | unsigned long flags; | 583 | unsigned long flags; |
584 | 584 | ||
585 | rlen = (len + 1) & ~1; | 585 | rlen = (len + 1) & ~1; |
586 | skb = dev_alloc_skb(rlen + 2); | 586 | skb = netdev_alloc_skb(dev, rlen + 2); |
587 | 587 | ||
588 | if (!skb) { | 588 | if (!skb) { |
589 | pr_warning("%s: memory squeeze, dropping packet\n", dev->name); | 589 | pr_warning("%s: memory squeeze, dropping packet\n", dev->name); |
diff --git a/drivers/net/ethernet/i825xx/3c507.c b/drivers/net/ethernet/i825xx/3c507.c index 1e945551c144..ed6925f11479 100644 --- a/drivers/net/ethernet/i825xx/3c507.c +++ b/drivers/net/ethernet/i825xx/3c507.c | |||
@@ -851,7 +851,7 @@ static void el16_rx(struct net_device *dev) | |||
851 | struct sk_buff *skb; | 851 | struct sk_buff *skb; |
852 | 852 | ||
853 | pkt_len &= 0x3fff; | 853 | pkt_len &= 0x3fff; |
854 | skb = dev_alloc_skb(pkt_len+2); | 854 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
855 | if (skb == NULL) { | 855 | if (skb == NULL) { |
856 | pr_err("%s: Memory squeeze, dropping packet.\n", | 856 | pr_err("%s: Memory squeeze, dropping packet.\n", |
857 | dev->name); | 857 | dev->name); |
diff --git a/drivers/net/ethernet/i825xx/3c523.c b/drivers/net/ethernet/i825xx/3c523.c index d70d3df4c985..8451ecd4c1ec 100644 --- a/drivers/net/ethernet/i825xx/3c523.c +++ b/drivers/net/ethernet/i825xx/3c523.c | |||
@@ -983,7 +983,7 @@ static void elmc_rcv_int(struct net_device *dev) | |||
983 | if ((totlen = rbd->status) & RBD_LAST) { /* the first and the last buffer? */ | 983 | if ((totlen = rbd->status) & RBD_LAST) { /* the first and the last buffer? */ |
984 | totlen &= RBD_MASK; /* length of this frame */ | 984 | totlen &= RBD_MASK; /* length of this frame */ |
985 | rbd->status = 0; | 985 | rbd->status = 0; |
986 | skb = (struct sk_buff *) dev_alloc_skb(totlen + 2); | 986 | skb = netdev_alloc_skb(dev, totlen + 2); |
987 | if (skb != NULL) { | 987 | if (skb != NULL) { |
988 | skb_reserve(skb, 2); /* 16 byte alignment */ | 988 | skb_reserve(skb, 2); /* 16 byte alignment */ |
989 | skb_put(skb,totlen); | 989 | skb_put(skb,totlen); |
diff --git a/drivers/net/ethernet/i825xx/3c527.c b/drivers/net/ethernet/i825xx/3c527.c index 474b5e71a53a..ef43f3e951c5 100644 --- a/drivers/net/ethernet/i825xx/3c527.c +++ b/drivers/net/ethernet/i825xx/3c527.c | |||
@@ -1169,7 +1169,7 @@ static void mc32_rx_ring(struct net_device *dev) | |||
1169 | /* Try to save time by avoiding a copy on big frames */ | 1169 | /* Try to save time by avoiding a copy on big frames */ |
1170 | 1170 | ||
1171 | if ((length > RX_COPYBREAK) && | 1171 | if ((length > RX_COPYBREAK) && |
1172 | ((newskb=dev_alloc_skb(1532)) != NULL)) | 1172 | ((newskb = netdev_alloc_skb(dev, 1532)) != NULL)) |
1173 | { | 1173 | { |
1174 | skb=lp->rx_ring[rx_ring_tail].skb; | 1174 | skb=lp->rx_ring[rx_ring_tail].skb; |
1175 | skb_put(skb, length); | 1175 | skb_put(skb, length); |
@@ -1180,7 +1180,7 @@ static void mc32_rx_ring(struct net_device *dev) | |||
1180 | } | 1180 | } |
1181 | else | 1181 | else |
1182 | { | 1182 | { |
1183 | skb=dev_alloc_skb(length+2); | 1183 | skb = netdev_alloc_skb(dev, length + 2); |
1184 | 1184 | ||
1185 | if(skb==NULL) { | 1185 | if(skb==NULL) { |
1186 | dev->stats.rx_dropped++; | 1186 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/i825xx/82596.c b/drivers/net/ethernet/i825xx/82596.c index f2408a4d5d9c..6aa927af382c 100644 --- a/drivers/net/ethernet/i825xx/82596.c +++ b/drivers/net/ethernet/i825xx/82596.c | |||
@@ -549,14 +549,13 @@ static inline int init_rx_bufs(struct net_device *dev) | |||
549 | /* First build the Receive Buffer Descriptor List */ | 549 | /* First build the Receive Buffer Descriptor List */ |
550 | 550 | ||
551 | for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { | 551 | for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { |
552 | struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ); | 552 | struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ); |
553 | 553 | ||
554 | if (skb == NULL) { | 554 | if (skb == NULL) { |
555 | remove_rx_bufs(dev); | 555 | remove_rx_bufs(dev); |
556 | return -ENOMEM; | 556 | return -ENOMEM; |
557 | } | 557 | } |
558 | 558 | ||
559 | skb->dev = dev; | ||
560 | rbd->v_next = rbd+1; | 559 | rbd->v_next = rbd+1; |
561 | rbd->b_next = WSWAPrbd(virt_to_bus(rbd+1)); | 560 | rbd->b_next = WSWAPrbd(virt_to_bus(rbd+1)); |
562 | rbd->b_addr = WSWAPrbd(virt_to_bus(rbd)); | 561 | rbd->b_addr = WSWAPrbd(virt_to_bus(rbd)); |
@@ -810,7 +809,7 @@ static inline int i596_rx(struct net_device *dev) | |||
810 | struct sk_buff *newskb; | 809 | struct sk_buff *newskb; |
811 | 810 | ||
812 | /* Get fresh skbuff to replace filled one. */ | 811 | /* Get fresh skbuff to replace filled one. */ |
813 | newskb = dev_alloc_skb(PKT_BUF_SZ); | 812 | newskb = netdev_alloc_skb(dev, PKT_BUF_SZ); |
814 | if (newskb == NULL) { | 813 | if (newskb == NULL) { |
815 | skb = NULL; /* drop pkt */ | 814 | skb = NULL; /* drop pkt */ |
816 | goto memory_squeeze; | 815 | goto memory_squeeze; |
@@ -819,7 +818,6 @@ static inline int i596_rx(struct net_device *dev) | |||
819 | skb_put(skb, pkt_len); | 818 | skb_put(skb, pkt_len); |
820 | rx_in_place = 1; | 819 | rx_in_place = 1; |
821 | rbd->skb = newskb; | 820 | rbd->skb = newskb; |
822 | newskb->dev = dev; | ||
823 | rbd->v_data = newskb->data; | 821 | rbd->v_data = newskb->data; |
824 | rbd->b_data = WSWAPchar(virt_to_bus(newskb->data)); | 822 | rbd->b_data = WSWAPchar(virt_to_bus(newskb->data)); |
825 | #ifdef __mc68000__ | 823 | #ifdef __mc68000__ |
@@ -827,7 +825,7 @@ static inline int i596_rx(struct net_device *dev) | |||
827 | #endif | 825 | #endif |
828 | } | 826 | } |
829 | else | 827 | else |
830 | skb = dev_alloc_skb(pkt_len + 2); | 828 | skb = netdev_alloc_skb(dev, pkt_len + 2); |
831 | memory_squeeze: | 829 | memory_squeeze: |
832 | if (skb == NULL) { | 830 | if (skb == NULL) { |
833 | /* XXX tulip.c can defer packets here!! */ | 831 | /* XXX tulip.c can defer packets here!! */ |
diff --git a/drivers/net/ethernet/i825xx/eepro.c b/drivers/net/ethernet/i825xx/eepro.c index 114cda7721fe..7a4ad4a07917 100644 --- a/drivers/net/ethernet/i825xx/eepro.c +++ b/drivers/net/ethernet/i825xx/eepro.c | |||
@@ -1563,7 +1563,7 @@ eepro_rx(struct net_device *dev) | |||
1563 | 1563 | ||
1564 | dev->stats.rx_bytes+=rcv_size; | 1564 | dev->stats.rx_bytes+=rcv_size; |
1565 | rcv_size &= 0x3fff; | 1565 | rcv_size &= 0x3fff; |
1566 | skb = dev_alloc_skb(rcv_size+5); | 1566 | skb = netdev_alloc_skb(dev, rcv_size + 5); |
1567 | if (skb == NULL) { | 1567 | if (skb == NULL) { |
1568 | printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); | 1568 | printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); |
1569 | dev->stats.rx_dropped++; | 1569 | dev->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/i825xx/eexpress.c b/drivers/net/ethernet/i825xx/eexpress.c index 3a9580f3d4dd..3fc649e54a32 100644 --- a/drivers/net/ethernet/i825xx/eexpress.c +++ b/drivers/net/ethernet/i825xx/eexpress.c | |||
@@ -955,7 +955,7 @@ static void eexp_hw_rx_pio(struct net_device *dev) | |||
955 | { | 955 | { |
956 | struct sk_buff *skb; | 956 | struct sk_buff *skb; |
957 | pkt_len &= 0x3fff; | 957 | pkt_len &= 0x3fff; |
958 | skb = dev_alloc_skb(pkt_len+16); | 958 | skb = netdev_alloc_skb(dev, pkt_len + 16); |
959 | if (skb == NULL) | 959 | if (skb == NULL) |
960 | { | 960 | { |
961 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet\n",dev->name); | 961 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet\n",dev->name); |
diff --git a/drivers/net/ethernet/i825xx/ether1.c b/drivers/net/ethernet/i825xx/ether1.c index 42e90a97c7a5..406a12b46404 100644 --- a/drivers/net/ethernet/i825xx/ether1.c +++ b/drivers/net/ethernet/i825xx/ether1.c | |||
@@ -867,7 +867,7 @@ ether1_recv_done (struct net_device *dev) | |||
867 | struct sk_buff *skb; | 867 | struct sk_buff *skb; |
868 | 868 | ||
869 | length = (length + 1) & ~1; | 869 | length = (length + 1) & ~1; |
870 | skb = dev_alloc_skb (length + 2); | 870 | skb = netdev_alloc_skb(dev, length + 2); |
871 | 871 | ||
872 | if (skb) { | 872 | if (skb) { |
873 | skb_reserve (skb, 2); | 873 | skb_reserve (skb, 2); |
diff --git a/drivers/net/ethernet/i825xx/lp486e.c b/drivers/net/ethernet/i825xx/lp486e.c index 02df5f5accb1..6c2952c8ea15 100644 --- a/drivers/net/ethernet/i825xx/lp486e.c +++ b/drivers/net/ethernet/i825xx/lp486e.c | |||
@@ -656,7 +656,7 @@ i596_rx_one(struct net_device *dev, struct i596_private *lp, | |||
656 | if (rfd->stat & RFD_STAT_OK) { | 656 | if (rfd->stat & RFD_STAT_OK) { |
657 | /* a good frame */ | 657 | /* a good frame */ |
658 | int pkt_len = (rfd->count & 0x3fff); | 658 | int pkt_len = (rfd->count & 0x3fff); |
659 | struct sk_buff *skb = dev_alloc_skb(pkt_len); | 659 | struct sk_buff *skb = netdev_alloc_skb(dev, pkt_len); |
660 | 660 | ||
661 | (*frames)++; | 661 | (*frames)++; |
662 | 662 | ||
diff --git a/drivers/net/ethernet/i825xx/ni52.c b/drivers/net/ethernet/i825xx/ni52.c index c0893715ef47..272976e1bb0f 100644 --- a/drivers/net/ethernet/i825xx/ni52.c +++ b/drivers/net/ethernet/i825xx/ni52.c | |||
@@ -964,7 +964,7 @@ static void ni52_rcv_int(struct net_device *dev) | |||
964 | /* the first and the last buffer? */ | 964 | /* the first and the last buffer? */ |
965 | totlen &= RBD_MASK; /* length of this frame */ | 965 | totlen &= RBD_MASK; /* length of this frame */ |
966 | writew(0x00, &rbd->status); | 966 | writew(0x00, &rbd->status); |
967 | skb = (struct sk_buff *)dev_alloc_skb(totlen+2); | 967 | skb = netdev_alloc_skb(dev, totlen + 2); |
968 | if (skb != NULL) { | 968 | if (skb != NULL) { |
969 | skb_reserve(skb, 2); | 969 | skb_reserve(skb, 2); |
970 | skb_put(skb, totlen); | 970 | skb_put(skb, totlen); |
diff --git a/drivers/net/ethernet/i825xx/sun3_82586.c b/drivers/net/ethernet/i825xx/sun3_82586.c index 296cf8a0ee51..cae17f4bc93e 100644 --- a/drivers/net/ethernet/i825xx/sun3_82586.c +++ b/drivers/net/ethernet/i825xx/sun3_82586.c | |||
@@ -778,7 +778,7 @@ static void sun3_82586_rcv_int(struct net_device *dev) | |||
778 | { | 778 | { |
779 | totlen &= RBD_MASK; /* length of this frame */ | 779 | totlen &= RBD_MASK; /* length of this frame */ |
780 | rbd->status = 0; | 780 | rbd->status = 0; |
781 | skb = (struct sk_buff *) dev_alloc_skb(totlen+2); | 781 | skb = netdev_alloc_skb(dev, totlen + 2); |
782 | if(skb != NULL) | 782 | if(skb != NULL) |
783 | { | 783 | { |
784 | skb_reserve(skb,2); | 784 | skb_reserve(skb,2); |
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c index 962b4c421f3f..a43649735a04 100644 --- a/drivers/net/ethernet/i825xx/znet.c +++ b/drivers/net/ethernet/i825xx/znet.c | |||
@@ -762,7 +762,7 @@ static void znet_rx(struct net_device *dev) | |||
762 | /* Malloc up new buffer. */ | 762 | /* Malloc up new buffer. */ |
763 | struct sk_buff *skb; | 763 | struct sk_buff *skb; |
764 | 764 | ||
765 | skb = dev_alloc_skb(pkt_len); | 765 | skb = netdev_alloc_skb(dev, pkt_len); |
766 | if (skb == NULL) { | 766 | if (skb == NULL) { |
767 | if (znet_debug) | 767 | if (znet_debug) |
768 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); | 768 | printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); |
diff --git a/drivers/net/ethernet/icplus/ipg.c b/drivers/net/ethernet/icplus/ipg.c index 3c636f16a3cb..1b563bb959c2 100644 --- a/drivers/net/ethernet/icplus/ipg.c +++ b/drivers/net/ethernet/icplus/ipg.c | |||
@@ -744,9 +744,6 @@ static int ipg_get_rxbuff(struct net_device *dev, int entry) | |||
744 | return -ENOMEM; | 744 | return -ENOMEM; |
745 | } | 745 | } |
746 | 746 | ||
747 | /* Associate the receive buffer with the IPG NIC. */ | ||
748 | skb->dev = dev; | ||
749 | |||
750 | /* Save the address of the sk_buff structure. */ | 747 | /* Save the address of the sk_buff structure. */ |
751 | sp->rx_buff[entry] = skb; | 748 | sp->rx_buff[entry] = skb; |
752 | 749 | ||
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 86d2fe6e053d..3369b7db777d 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c | |||
@@ -114,7 +114,7 @@ struct ltq_etop_priv { | |||
114 | static int | 114 | static int |
115 | ltq_etop_alloc_skb(struct ltq_etop_chan *ch) | 115 | ltq_etop_alloc_skb(struct ltq_etop_chan *ch) |
116 | { | 116 | { |
117 | ch->skb[ch->dma.desc] = dev_alloc_skb(MAX_DMA_DATA_LEN); | 117 | ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN); |
118 | if (!ch->skb[ch->dma.desc]) | 118 | if (!ch->skb[ch->dma.desc]) |
119 | return -ENOMEM; | 119 | return -ENOMEM; |
120 | ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, | 120 | ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, |
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 9edecfa1f0f4..f702d0dc18c7 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -667,7 +667,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget) | |||
667 | 667 | ||
668 | skb = __skb_dequeue(&mp->rx_recycle); | 668 | skb = __skb_dequeue(&mp->rx_recycle); |
669 | if (skb == NULL) | 669 | if (skb == NULL) |
670 | skb = dev_alloc_skb(mp->skb_size); | 670 | skb = netdev_alloc_skb(mp->dev, mp->skb_size); |
671 | 671 | ||
672 | if (skb == NULL) { | 672 | if (skb == NULL) { |
673 | mp->oom = 1; | 673 | mp->oom = 1; |
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c index 92b4b4e68e3b..75df2091bd2e 100644 --- a/drivers/net/ethernet/marvell/pxa168_eth.c +++ b/drivers/net/ethernet/marvell/pxa168_eth.c | |||
@@ -350,7 +350,7 @@ static void rxq_refill(struct net_device *dev) | |||
350 | while (pep->rx_desc_count < pep->rx_ring_size) { | 350 | while (pep->rx_desc_count < pep->rx_ring_size) { |
351 | int size; | 351 | int size; |
352 | 352 | ||
353 | skb = dev_alloc_skb(pep->skb_size); | 353 | skb = netdev_alloc_skb(dev, pep->skb_size); |
354 | if (!skb) | 354 | if (!skb) |
355 | break; | 355 | break; |
356 | if (SKB_DMA_REALIGN) | 356 | if (SKB_DMA_REALIGN) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index f61d0e08f52b..fb6e899f38d3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -463,12 +463,11 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
463 | int used_frags; | 463 | int used_frags; |
464 | dma_addr_t dma; | 464 | dma_addr_t dma; |
465 | 465 | ||
466 | skb = dev_alloc_skb(SMALL_PACKET_SIZE + NET_IP_ALIGN); | 466 | skb = netdev_alloc_skb(priv->dev, SMALL_PACKET_SIZE + NET_IP_ALIGN); |
467 | if (!skb) { | 467 | if (!skb) { |
468 | en_dbg(RX_ERR, priv, "Failed allocating skb\n"); | 468 | en_dbg(RX_ERR, priv, "Failed allocating skb\n"); |
469 | return NULL; | 469 | return NULL; |
470 | } | 470 | } |
471 | skb->dev = priv->dev; | ||
472 | skb_reserve(skb, NET_IP_ALIGN); | 471 | skb_reserve(skb, NET_IP_ALIGN); |
473 | skb->len = length; | 472 | skb->len = length; |
474 | 473 | ||
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c index 7c717276502f..dccae1d1743a 100644 --- a/drivers/net/ethernet/micrel/ks8695net.c +++ b/drivers/net/ethernet/micrel/ks8695net.c | |||
@@ -278,7 +278,8 @@ ks8695_refill_rxbuffers(struct ks8695_priv *ksp) | |||
278 | 278 | ||
279 | for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) { | 279 | for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) { |
280 | if (!ksp->rx_buffers[buff_n].skb) { | 280 | if (!ksp->rx_buffers[buff_n].skb) { |
281 | struct sk_buff *skb = dev_alloc_skb(MAX_RXBUF_SIZE); | 281 | struct sk_buff *skb = |
282 | netdev_alloc_skb(ksp->ndev, MAX_RXBUF_SIZE); | ||
282 | dma_addr_t mapping; | 283 | dma_addr_t mapping; |
283 | 284 | ||
284 | ksp->rx_buffers[buff_n].skb = skb; | 285 | ksp->rx_buffers[buff_n].skb = skb; |
@@ -299,7 +300,6 @@ ks8695_refill_rxbuffers(struct ks8695_priv *ksp) | |||
299 | break; | 300 | break; |
300 | } | 301 | } |
301 | ksp->rx_buffers[buff_n].dma_ptr = mapping; | 302 | ksp->rx_buffers[buff_n].dma_ptr = mapping; |
302 | skb->dev = ksp->ndev; | ||
303 | ksp->rx_buffers[buff_n].length = MAX_RXBUF_SIZE; | 303 | ksp->rx_buffers[buff_n].length = MAX_RXBUF_SIZE; |
304 | 304 | ||
305 | /* Record this into the DMA ring */ | 305 | /* Record this into the DMA ring */ |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index 4a9d57fb9fb4..61a2f61a31f6 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
@@ -796,7 +796,7 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev) | |||
796 | 796 | ||
797 | frame_hdr = ks->frame_head_info; | 797 | frame_hdr = ks->frame_head_info; |
798 | while (ks->frame_cnt--) { | 798 | while (ks->frame_cnt--) { |
799 | skb = dev_alloc_skb(frame_hdr->len + 16); | 799 | skb = netdev_alloc_skb(netdev, frame_hdr->len + 16); |
800 | if (likely(skb && (frame_hdr->sts & RXFSHR_RXFV) && | 800 | if (likely(skb && (frame_hdr->sts & RXFSHR_RXFV) && |
801 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { | 801 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { |
802 | skb_reserve(skb, 2); | 802 | skb_reserve(skb, 2); |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 2725d693c3c4..ef723b185d85 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -4863,7 +4863,7 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev) | |||
4863 | memset(&skb->data[skb->len], 0, 50 - skb->len); | 4863 | memset(&skb->data[skb->len], 0, 50 - skb->len); |
4864 | skb->len = 50; | 4864 | skb->len = 50; |
4865 | } else { | 4865 | } else { |
4866 | skb = dev_alloc_skb(50); | 4866 | skb = netdev_alloc_skb(dev, 50); |
4867 | if (!skb) | 4867 | if (!skb) |
4868 | return NETDEV_TX_BUSY; | 4868 | return NETDEV_TX_BUSY; |
4869 | memcpy(skb->data, org_skb->data, org_skb->len); | 4869 | 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) | |||
4885 | (ETH_P_IPV6 == htons(skb->protocol)))) { | 4885 | (ETH_P_IPV6 == htons(skb->protocol)))) { |
4886 | struct sk_buff *org_skb = skb; | 4886 | struct sk_buff *org_skb = skb; |
4887 | 4887 | ||
4888 | skb = dev_alloc_skb(org_skb->len); | 4888 | skb = netdev_alloc_skb(dev, org_skb->len); |
4889 | if (!skb) { | 4889 | if (!skb) { |
4890 | rc = NETDEV_TX_BUSY; | 4890 | rc = NETDEV_TX_BUSY; |
4891 | goto unlock; | 4891 | goto unlock; |
@@ -5019,7 +5019,7 @@ static inline int rx_proc(struct net_device *dev, struct ksz_hw* hw, | |||
5019 | 5019 | ||
5020 | do { | 5020 | do { |
5021 | /* skb->data != skb->head */ | 5021 | /* skb->data != skb->head */ |
5022 | skb = dev_alloc_skb(packet_len + 2); | 5022 | skb = netdev_alloc_skb(dev, packet_len + 2); |
5023 | if (!skb) { | 5023 | if (!skb) { |
5024 | dev->stats.rx_dropped++; | 5024 | dev->stats.rx_dropped++; |
5025 | return -ENOMEM; | 5025 | return -ENOMEM; |
diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c index c813e5d8db9d..1d6b7ce3e1ee 100644 --- a/drivers/net/ethernet/microchip/enc28j60.c +++ b/drivers/net/ethernet/microchip/enc28j60.c | |||
@@ -954,14 +954,13 @@ static void enc28j60_hw_rx(struct net_device *ndev) | |||
954 | if (len > MAX_FRAMELEN) | 954 | if (len > MAX_FRAMELEN) |
955 | ndev->stats.rx_over_errors++; | 955 | ndev->stats.rx_over_errors++; |
956 | } else { | 956 | } else { |
957 | skb = dev_alloc_skb(len + NET_IP_ALIGN); | 957 | skb = netdev_alloc_skb(ndev, len + NET_IP_ALIGN); |
958 | if (!skb) { | 958 | if (!skb) { |
959 | if (netif_msg_rx_err(priv)) | 959 | if (netif_msg_rx_err(priv)) |
960 | dev_err(&ndev->dev, | 960 | dev_err(&ndev->dev, |
961 | "out of memory for Rx'd frame\n"); | 961 | "out of memory for Rx'd frame\n"); |
962 | ndev->stats.rx_dropped++; | 962 | ndev->stats.rx_dropped++; |
963 | } else { | 963 | } else { |
964 | skb->dev = ndev; | ||
965 | skb_reserve(skb, NET_IP_ALIGN); | 964 | skb_reserve(skb, NET_IP_ALIGN); |
966 | /* copy the packet from the receive buffer */ | 965 | /* copy the packet from the receive buffer */ |
967 | enc28j60_mem_read(priv, | 966 | enc28j60_mem_read(priv, |
diff --git a/drivers/net/ethernet/mipsnet.c b/drivers/net/ethernet/mipsnet.c index d05b0c9e1e9c..dbc666a3d523 100644 --- a/drivers/net/ethernet/mipsnet.c +++ b/drivers/net/ethernet/mipsnet.c | |||
@@ -152,7 +152,7 @@ static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t len) | |||
152 | if (!len) | 152 | if (!len) |
153 | return len; | 153 | return len; |
154 | 154 | ||
155 | skb = dev_alloc_skb(len + NET_IP_ALIGN); | 155 | skb = netdev_alloc_skb(dev, len + NET_IP_ALIGN); |
156 | if (!skb) { | 156 | if (!skb) { |
157 | dev->stats.rx_dropped++; | 157 | dev->stats.rx_dropped++; |
158 | return -ENOMEM; | 158 | return -ENOMEM; |
diff --git a/drivers/net/ethernet/natsemi/ibmlana.c b/drivers/net/ethernet/natsemi/ibmlana.c index 999407f7ebdf..3f94ddbf4dc0 100644 --- a/drivers/net/ethernet/natsemi/ibmlana.c +++ b/drivers/net/ethernet/natsemi/ibmlana.c | |||
@@ -589,7 +589,7 @@ static void irqrx_handler(struct net_device *dev) | |||
589 | 589 | ||
590 | /* fetch buffer */ | 590 | /* fetch buffer */ |
591 | 591 | ||
592 | skb = dev_alloc_skb(rda.length + 2); | 592 | skb = netdev_alloc_skb(dev, rda.length + 2); |
593 | if (skb == NULL) | 593 | if (skb == NULL) |
594 | dev->stats.rx_dropped++; | 594 | dev->stats.rx_dropped++; |
595 | else { | 595 | else { |
diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c index ac7b16b6e7af..d38e48d4f430 100644 --- a/drivers/net/ethernet/natsemi/natsemi.c +++ b/drivers/net/ethernet/natsemi/natsemi.c | |||
@@ -1934,11 +1934,10 @@ static void refill_rx(struct net_device *dev) | |||
1934 | int entry = np->dirty_rx % RX_RING_SIZE; | 1934 | int entry = np->dirty_rx % RX_RING_SIZE; |
1935 | if (np->rx_skbuff[entry] == NULL) { | 1935 | if (np->rx_skbuff[entry] == NULL) { |
1936 | unsigned int buflen = np->rx_buf_sz+NATSEMI_PADDING; | 1936 | unsigned int buflen = np->rx_buf_sz+NATSEMI_PADDING; |
1937 | skb = dev_alloc_skb(buflen); | 1937 | skb = netdev_alloc_skb(dev, buflen); |
1938 | np->rx_skbuff[entry] = skb; | 1938 | np->rx_skbuff[entry] = skb; |
1939 | if (skb == NULL) | 1939 | if (skb == NULL) |
1940 | break; /* Better luck next round. */ | 1940 | break; /* Better luck next round. */ |
1941 | skb->dev = dev; /* Mark as being used by this device. */ | ||
1942 | np->rx_dma[entry] = pci_map_single(np->pci_dev, | 1941 | np->rx_dma[entry] = pci_map_single(np->pci_dev, |
1943 | skb->data, buflen, PCI_DMA_FROMDEVICE); | 1942 | skb->data, buflen, PCI_DMA_FROMDEVICE); |
1944 | np->rx_ring[entry].addr = cpu_to_le32(np->rx_dma[entry]); | 1943 | 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) | |||
2344 | /* Check if the packet is long enough to accept | 2343 | /* Check if the packet is long enough to accept |
2345 | * without copying to a minimally-sized skbuff. */ | 2344 | * without copying to a minimally-sized skbuff. */ |
2346 | if (pkt_len < rx_copybreak && | 2345 | if (pkt_len < rx_copybreak && |
2347 | (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { | 2346 | (skb = netdev_alloc_skb(dev, pkt_len + RX_OFFSET)) != NULL) { |
2348 | /* 16 byte align the IP header */ | 2347 | /* 16 byte align the IP header */ |
2349 | skb_reserve(skb, RX_OFFSET); | 2348 | skb_reserve(skb, RX_OFFSET); |
2350 | pci_dma_sync_single_for_cpu(np->pci_dev, | 2349 | pci_dma_sync_single_for_cpu(np->pci_dev, |
diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c index 26e25d7f5829..0452e2968d27 100644 --- a/drivers/net/ethernet/natsemi/sonic.c +++ b/drivers/net/ethernet/natsemi/sonic.c | |||
@@ -51,7 +51,7 @@ static int sonic_open(struct net_device *dev) | |||
51 | printk("sonic_open: initializing sonic driver.\n"); | 51 | printk("sonic_open: initializing sonic driver.\n"); |
52 | 52 | ||
53 | for (i = 0; i < SONIC_NUM_RRS; i++) { | 53 | for (i = 0; i < SONIC_NUM_RRS; i++) { |
54 | struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2); | 54 | struct sk_buff *skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2); |
55 | if (skb == NULL) { | 55 | if (skb == NULL) { |
56 | while(i > 0) { /* free any that were allocated successfully */ | 56 | while(i > 0) { /* free any that were allocated successfully */ |
57 | i--; | 57 | i--; |
@@ -422,7 +422,7 @@ static void sonic_rx(struct net_device *dev) | |||
422 | status = sonic_rda_get(dev, entry, SONIC_RD_STATUS); | 422 | status = sonic_rda_get(dev, entry, SONIC_RD_STATUS); |
423 | if (status & SONIC_RCR_PRX) { | 423 | if (status & SONIC_RCR_PRX) { |
424 | /* Malloc up new buffer. */ | 424 | /* Malloc up new buffer. */ |
425 | new_skb = dev_alloc_skb(SONIC_RBSIZE + 2); | 425 | new_skb = netdev_alloc_skb(SONIC_RBSIZE + 2); |
426 | if (new_skb == NULL) { | 426 | if (new_skb == NULL) { |
427 | printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name); | 427 | printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name); |
428 | lp->stats.rx_dropped++; | 428 | lp->stats.rx_dropped++; |
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c index 138584608809..44a6065794c3 100644 --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c | |||
@@ -2524,7 +2524,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, struct ring_info *ring, | |||
2524 | size = ring->mtu + ALIGN_SIZE + BUF0_LEN + 4; | 2524 | size = ring->mtu + ALIGN_SIZE + BUF0_LEN + 4; |
2525 | 2525 | ||
2526 | /* allocate skb */ | 2526 | /* allocate skb */ |
2527 | skb = dev_alloc_skb(size); | 2527 | skb = netdev_alloc_skb(nic->dev, size); |
2528 | if (!skb) { | 2528 | if (!skb) { |
2529 | DBG_PRINT(INFO_DBG, "%s: Could not allocate skb\n", | 2529 | DBG_PRINT(INFO_DBG, "%s: Could not allocate skb\n", |
2530 | ring->dev->name); | 2530 | ring->dev->name); |
@@ -6820,7 +6820,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6820 | */ | 6820 | */ |
6821 | rxdp1->Buffer0_ptr = *temp0; | 6821 | rxdp1->Buffer0_ptr = *temp0; |
6822 | } else { | 6822 | } else { |
6823 | *skb = dev_alloc_skb(size); | 6823 | *skb = netdev_alloc_skb(dev, size); |
6824 | if (!(*skb)) { | 6824 | if (!(*skb)) { |
6825 | DBG_PRINT(INFO_DBG, | 6825 | DBG_PRINT(INFO_DBG, |
6826 | "%s: Out of memory to allocate %s\n", | 6826 | "%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, | |||
6849 | rxdp3->Buffer0_ptr = *temp0; | 6849 | rxdp3->Buffer0_ptr = *temp0; |
6850 | rxdp3->Buffer1_ptr = *temp1; | 6850 | rxdp3->Buffer1_ptr = *temp1; |
6851 | } else { | 6851 | } else { |
6852 | *skb = dev_alloc_skb(size); | 6852 | *skb = netdev_alloc_skb(dev, size); |
6853 | if (!(*skb)) { | 6853 | if (!(*skb)) { |
6854 | DBG_PRINT(INFO_DBG, | 6854 | DBG_PRINT(INFO_DBG, |
6855 | "%s: Out of memory to allocate %s\n", | 6855 | "%s: Out of memory to allocate %s\n", |