aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/dec
diff options
context:
space:
mode:
authorPradeep A Dalvi <netdev@pradeepdalvi.com>2012-02-04 21:50:10 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-06 11:48:09 -0500
commit21a4e46995fa1a76281ac0281ff837f706231a37 (patch)
tree3e57d5f21bbc8ec7e625f05e548957f0b4e54013 /drivers/net/ethernet/dec
parent1d266430546acf01438ae42d0a7370db4817e2ad (diff)
netdev: ethernet dev_alloc_skb to netdev_alloc_skb
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>
Diffstat (limited to 'drivers/net/ethernet/dec')
-rw-r--r--drivers/net/ethernet/dec/ewrk3.c4
-rw-r--r--drivers/net/ethernet/dec/tulip/de2104x.c6
-rw-r--r--drivers/net/ethernet/dec/tulip/de4x5.c4
-rw-r--r--drivers/net/ethernet/dec/tulip/interrupt.c8
-rw-r--r--drivers/net/ethernet/dec/tulip/tulip_core.c5
-rw-r--r--drivers/net/ethernet/dec/tulip/winbond-840.c6
-rw-r--r--drivers/net/ethernet/dec/tulip/xircom_cb.c2
7 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/ethernet/dec/ewrk3.c b/drivers/net/ethernet/dec/ewrk3.c
index f9df5e4d034..1879f84a25a 100644
--- a/drivers/net/ethernet/dec/ewrk3.c
+++ b/drivers/net/ethernet/dec/ewrk3.c
@@ -986,8 +986,10 @@ static int ewrk3_rx(struct net_device *dev)
986 dev->stats.rx_fifo_errors++; 986 dev->stats.rx_fifo_errors++;
987 } else { 987 } else {
988 struct sk_buff *skb; 988 struct sk_buff *skb;
989 skb = netdev_alloc_skb(dev,
990 pkt_len + 2);
989 991
990 if ((skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 992 if (skb != NULL) {
991 unsigned char *p; 993 unsigned char *p;
992 skb_reserve(skb, 2); /* Align to 16 bytes */ 994 skb_reserve(skb, 2); /* Align to 16 bytes */
993 p = skb_put(skb, pkt_len); 995 p = skb_put(skb, pkt_len);
diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index 1eb46a0bb48..68f1c39184d 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -439,7 +439,7 @@ static void de_rx (struct de_private *de)
439 rx_tail, status, len, copying_skb); 439 rx_tail, status, len, copying_skb);
440 440
441 buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz; 441 buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
442 copy_skb = dev_alloc_skb (buflen); 442 copy_skb = netdev_alloc_skb(de->dev, buflen);
443 if (unlikely(!copy_skb)) { 443 if (unlikely(!copy_skb)) {
444 de->net_stats.rx_dropped++; 444 de->net_stats.rx_dropped++;
445 drop = 1; 445 drop = 1;
@@ -1283,12 +1283,10 @@ static int de_refill_rx (struct de_private *de)
1283 for (i = 0; i < DE_RX_RING_SIZE; i++) { 1283 for (i = 0; i < DE_RX_RING_SIZE; i++) {
1284 struct sk_buff *skb; 1284 struct sk_buff *skb;
1285 1285
1286 skb = dev_alloc_skb(de->rx_buf_sz); 1286 skb = netdev_alloc_skb(de->dev, de->rx_buf_sz);
1287 if (!skb) 1287 if (!skb)
1288 goto err_out; 1288 goto err_out;
1289 1289
1290 skb->dev = de->dev;
1291
1292 de->rx_skb[i].mapping = pci_map_single(de->pdev, 1290 de->rx_skb[i].mapping = pci_map_single(de->pdev,
1293 skb->data, de->rx_buf_sz, PCI_DMA_FROMDEVICE); 1291 skb->data, de->rx_buf_sz, PCI_DMA_FROMDEVICE);
1294 de->rx_skb[i].skb = skb; 1292 de->rx_skb[i].skb = skb;
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
index 4d71f5ae20c..93583408a32 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
@@ -3598,7 +3598,7 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
3598 struct sk_buff *ret; 3598 struct sk_buff *ret;
3599 u_long i=0, tmp; 3599 u_long i=0, tmp;
3600 3600
3601 p = dev_alloc_skb(IEEE802_3_SZ + DE4X5_ALIGN + 2); 3601 p = netdev_alloc_skb(dev, IEEE802_3_SZ + DE4X5_ALIGN + 2);
3602 if (!p) return NULL; 3602 if (!p) return NULL;
3603 3603
3604 tmp = virt_to_bus(p->data); 3604 tmp = virt_to_bus(p->data);
@@ -3618,7 +3618,7 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
3618#else 3618#else
3619 if (lp->state != OPEN) return (struct sk_buff *)1; /* Fake out the open */ 3619 if (lp->state != OPEN) return (struct sk_buff *)1; /* Fake out the open */
3620 3620
3621 p = dev_alloc_skb(len + 2); 3621 p = netdev_alloc_skb(dev, len + 2);
3622 if (!p) return NULL; 3622 if (!p) return NULL;
3623 3623
3624 skb_reserve(p, 2); /* Align */ 3624 skb_reserve(p, 2); /* Align */
diff --git a/drivers/net/ethernet/dec/tulip/interrupt.c b/drivers/net/ethernet/dec/tulip/interrupt.c
index feaee7424bd..28a5e425fec 100644
--- a/drivers/net/ethernet/dec/tulip/interrupt.c
+++ b/drivers/net/ethernet/dec/tulip/interrupt.c
@@ -69,7 +69,8 @@ int tulip_refill_rx(struct net_device *dev)
69 struct sk_buff *skb; 69 struct sk_buff *skb;
70 dma_addr_t mapping; 70 dma_addr_t mapping;
71 71
72 skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ); 72 skb = tp->rx_buffers[entry].skb =
73 netdev_alloc_skb(dev, PKT_BUF_SZ);
73 if (skb == NULL) 74 if (skb == NULL)
74 break; 75 break;
75 76
@@ -77,7 +78,6 @@ int tulip_refill_rx(struct net_device *dev)
77 PCI_DMA_FROMDEVICE); 78 PCI_DMA_FROMDEVICE);
78 tp->rx_buffers[entry].mapping = mapping; 79 tp->rx_buffers[entry].mapping = mapping;
79 80
80 skb->dev = dev; /* Mark as being used by this device. */
81 tp->rx_ring[entry].buffer1 = cpu_to_le32(mapping); 81 tp->rx_ring[entry].buffer1 = cpu_to_le32(mapping);
82 refilled++; 82 refilled++;
83 } 83 }
@@ -202,7 +202,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
202 /* Check if the packet is long enough to accept without copying 202 /* Check if the packet is long enough to accept without copying
203 to a minimally-sized skbuff. */ 203 to a minimally-sized skbuff. */
204 if (pkt_len < tulip_rx_copybreak && 204 if (pkt_len < tulip_rx_copybreak &&
205 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 205 (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
206 skb_reserve(skb, 2); /* 16 byte align the IP header */ 206 skb_reserve(skb, 2); /* 16 byte align the IP header */
207 pci_dma_sync_single_for_cpu(tp->pdev, 207 pci_dma_sync_single_for_cpu(tp->pdev,
208 tp->rx_buffers[entry].mapping, 208 tp->rx_buffers[entry].mapping,
@@ -428,7 +428,7 @@ static int tulip_rx(struct net_device *dev)
428 /* Check if the packet is long enough to accept without copying 428 /* Check if the packet is long enough to accept without copying
429 to a minimally-sized skbuff. */ 429 to a minimally-sized skbuff. */
430 if (pkt_len < tulip_rx_copybreak && 430 if (pkt_len < tulip_rx_copybreak &&
431 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 431 (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
432 skb_reserve(skb, 2); /* 16 byte align the IP header */ 432 skb_reserve(skb, 2); /* 16 byte align the IP header */
433 pci_dma_sync_single_for_cpu(tp->pdev, 433 pci_dma_sync_single_for_cpu(tp->pdev,
434 tp->rx_buffers[entry].mapping, 434 tp->rx_buffers[entry].mapping,
diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
index 17ecb18341c..fea3641d939 100644
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -636,16 +636,15 @@ static void tulip_init_ring(struct net_device *dev)
636 dma_addr_t mapping; 636 dma_addr_t mapping;
637 637
638 /* Note the receive buffer must be longword aligned. 638 /* Note the receive buffer must be longword aligned.
639 dev_alloc_skb() provides 16 byte alignment. But do *not* 639 netdev_alloc_skb() provides 16 byte alignment. But do *not*
640 use skb_reserve() to align the IP header! */ 640 use skb_reserve() to align the IP header! */
641 struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ); 641 struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
642 tp->rx_buffers[i].skb = skb; 642 tp->rx_buffers[i].skb = skb;
643 if (skb == NULL) 643 if (skb == NULL)
644 break; 644 break;
645 mapping = pci_map_single(tp->pdev, skb->data, 645 mapping = pci_map_single(tp->pdev, skb->data,
646 PKT_BUF_SZ, PCI_DMA_FROMDEVICE); 646 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
647 tp->rx_buffers[i].mapping = mapping; 647 tp->rx_buffers[i].mapping = mapping;
648 skb->dev = dev; /* Mark as being used by this device. */
649 tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */ 648 tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */
650 tp->rx_ring[i].buffer1 = cpu_to_le32(mapping); 649 tp->rx_ring[i].buffer1 = cpu_to_le32(mapping);
651 } 650 }
diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c
index 52da7b2fe3b..2ac6fff0363 100644
--- a/drivers/net/ethernet/dec/tulip/winbond-840.c
+++ b/drivers/net/ethernet/dec/tulip/winbond-840.c
@@ -815,7 +815,7 @@ static void init_rxtx_rings(struct net_device *dev)
815 815
816 /* Fill in the Rx buffers. Handle allocation failure gracefully. */ 816 /* Fill in the Rx buffers. Handle allocation failure gracefully. */
817 for (i = 0; i < RX_RING_SIZE; i++) { 817 for (i = 0; i < RX_RING_SIZE; i++) {
818 struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); 818 struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
819 np->rx_skbuff[i] = skb; 819 np->rx_skbuff[i] = skb;
820 if (skb == NULL) 820 if (skb == NULL)
821 break; 821 break;
@@ -1231,7 +1231,7 @@ static int netdev_rx(struct net_device *dev)
1231 /* Check if the packet is long enough to accept without copying 1231 /* Check if the packet is long enough to accept without copying
1232 to a minimally-sized skbuff. */ 1232 to a minimally-sized skbuff. */
1233 if (pkt_len < rx_copybreak && 1233 if (pkt_len < rx_copybreak &&
1234 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 1234 (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
1235 skb_reserve(skb, 2); /* 16 byte align the IP header */ 1235 skb_reserve(skb, 2); /* 16 byte align the IP header */
1236 pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry], 1236 pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry],
1237 np->rx_skbuff[entry]->len, 1237 np->rx_skbuff[entry]->len,
@@ -1270,7 +1270,7 @@ static int netdev_rx(struct net_device *dev)
1270 struct sk_buff *skb; 1270 struct sk_buff *skb;
1271 entry = np->dirty_rx % RX_RING_SIZE; 1271 entry = np->dirty_rx % RX_RING_SIZE;
1272 if (np->rx_skbuff[entry] == NULL) { 1272 if (np->rx_skbuff[entry] == NULL) {
1273 skb = dev_alloc_skb(np->rx_buf_sz); 1273 skb = netdev_alloc_skb(dev, np->rx_buf_sz);
1274 np->rx_skbuff[entry] = skb; 1274 np->rx_skbuff[entry] = skb;
1275 if (skb == NULL) 1275 if (skb == NULL)
1276 break; /* Better luck next round. */ 1276 break; /* Better luck next round. */
diff --git a/drivers/net/ethernet/dec/tulip/xircom_cb.c b/drivers/net/ethernet/dec/tulip/xircom_cb.c
index b7c73eefb54..fdb329fe6e8 100644
--- a/drivers/net/ethernet/dec/tulip/xircom_cb.c
+++ b/drivers/net/ethernet/dec/tulip/xircom_cb.c
@@ -1084,7 +1084,7 @@ investigate_read_descriptor(struct net_device *dev, struct xircom_private *card,
1084 pkt_len = 1518; 1084 pkt_len = 1518;
1085 } 1085 }
1086 1086
1087 skb = dev_alloc_skb(pkt_len + 2); 1087 skb = netdev_alloc_skb(dev, pkt_len + 2);
1088 if (skb == NULL) { 1088 if (skb == NULL) {
1089 dev->stats.rx_dropped++; 1089 dev->stats.rx_dropped++;
1090 goto out; 1090 goto out;