aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lib82596.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/lib82596.c')
-rw-r--r--drivers/net/lib82596.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
index c0dbfc185b53..b117f7f8b194 100644
--- a/drivers/net/lib82596.c
+++ b/drivers/net/lib82596.c
@@ -470,11 +470,11 @@ static inline int init_rx_bufs(struct net_device *dev)
470 470
471 for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) { 471 for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) {
472 dma_addr_t dma_addr; 472 dma_addr_t dma_addr;
473 struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ + 4); 473 struct sk_buff *skb;
474 474
475 skb = netdev_alloc_skb_ip_align(dev, PKT_BUF_SZ);
475 if (skb == NULL) 476 if (skb == NULL)
476 return -1; 477 return -1;
477 skb_reserve(skb, 2);
478 dma_addr = dma_map_single(dev->dev.parent, skb->data, 478 dma_addr = dma_map_single(dev->dev.parent, skb->data,
479 PKT_BUF_SZ, DMA_FROM_DEVICE); 479 PKT_BUF_SZ, DMA_FROM_DEVICE);
480 rbd->v_next = rbd+1; 480 rbd->v_next = rbd+1;
@@ -588,7 +588,7 @@ static int init_i596_mem(struct net_device *dev)
588 "%s: i82596 initialization successful\n", 588 "%s: i82596 initialization successful\n",
589 dev->name)); 589 dev->name));
590 590
591 if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) { 591 if (request_irq(dev->irq, i596_interrupt, 0, "i82596", dev)) {
592 printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq); 592 printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq);
593 goto failed; 593 goto failed;
594 } 594 }
@@ -697,12 +697,12 @@ static inline int i596_rx(struct net_device *dev)
697 (dma_addr_t)SWAP32(rbd->b_data), 697 (dma_addr_t)SWAP32(rbd->b_data),
698 PKT_BUF_SZ, DMA_FROM_DEVICE); 698 PKT_BUF_SZ, DMA_FROM_DEVICE);
699 /* Get fresh skbuff to replace filled one. */ 699 /* Get fresh skbuff to replace filled one. */
700 newskb = netdev_alloc_skb(dev, PKT_BUF_SZ + 4); 700 newskb = netdev_alloc_skb_ip_align(dev,
701 PKT_BUF_SZ);
701 if (newskb == NULL) { 702 if (newskb == NULL) {
702 skb = NULL; /* drop pkt */ 703 skb = NULL; /* drop pkt */
703 goto memory_squeeze; 704 goto memory_squeeze;
704 } 705 }
705 skb_reserve(newskb, 2);
706 706
707 /* Pass up the skb already on the Rx ring. */ 707 /* Pass up the skb already on the Rx ring. */
708 skb_put(skb, pkt_len); 708 skb_put(skb, pkt_len);
@@ -716,7 +716,7 @@ static inline int i596_rx(struct net_device *dev)
716 rbd->b_data = SWAP32(dma_addr); 716 rbd->b_data = SWAP32(dma_addr);
717 DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd)); 717 DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd));
718 } else 718 } else
719 skb = netdev_alloc_skb(dev, pkt_len + 2); 719 skb = netdev_alloc_skb_ip_align(dev, pkt_len);
720memory_squeeze: 720memory_squeeze:
721 if (skb == NULL) { 721 if (skb == NULL) {
722 /* XXX tulip.c can defer packets here!! */ 722 /* XXX tulip.c can defer packets here!! */
@@ -730,7 +730,6 @@ memory_squeeze:
730 dma_sync_single_for_cpu(dev->dev.parent, 730 dma_sync_single_for_cpu(dev->dev.parent,
731 (dma_addr_t)SWAP32(rbd->b_data), 731 (dma_addr_t)SWAP32(rbd->b_data),
732 PKT_BUF_SZ, DMA_FROM_DEVICE); 732 PKT_BUF_SZ, DMA_FROM_DEVICE);
733 skb_reserve(skb, 2);
734 memcpy(skb_put(skb, pkt_len), rbd->v_data, pkt_len); 733 memcpy(skb_put(skb, pkt_len), rbd->v_data, pkt_len);
735 dma_sync_single_for_device(dev->dev.parent, 734 dma_sync_single_for_device(dev->dev.parent,
736 (dma_addr_t)SWAP32(rbd->b_data), 735 (dma_addr_t)SWAP32(rbd->b_data),