aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-27 17:55:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:23 -0400
commitd626f62b11e00c16e81e4308ab93d3f13551812a (patch)
treefac4af6ced853755e12fc709d55f0c2bec51265d /drivers/net/tulip
parent2a123b86e2b242a4a6db990d2851d45e192f88e5 (diff)
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a overly long variant but interesting for the sake of saving some bytes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de2104x.c4
-rw-r--r--drivers/net/tulip/dmfe.c6
-rw-r--r--drivers/net/tulip/uli526x.c2
-rw-r--r--drivers/net/tulip/xircom_cb.c6
-rw-r--r--drivers/net/tulip/xircom_tulip_cb.c4
5 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 8a7effa70904..d19f8568440f 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -449,8 +449,8 @@ static void de_rx (struct de_private *de)
449 } else { 449 } else {
450 pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); 450 pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
451 skb_reserve(copy_skb, RX_OFFSET); 451 skb_reserve(copy_skb, RX_OFFSET);
452 memcpy(skb_put(copy_skb, len), skb->data, len); 452 skb_copy_from_linear_data(skb, skb_put(copy_skb, len),
453 453 len);
454 pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); 454 pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
455 455
456 /* We'll reuse the original ring buffer. */ 456 /* We'll reuse the original ring buffer. */
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index a5e0237a6537..b3a64ca98634 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -682,7 +682,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
682 682
683 /* transmit this packet */ 683 /* transmit this packet */
684 txptr = db->tx_insert_ptr; 684 txptr = db->tx_insert_ptr;
685 memcpy(txptr->tx_buf_ptr, skb->data, skb->len); 685 skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len);
686 txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); 686 txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len);
687 687
688 /* Point to next transmit free descriptor */ 688 /* Point to next transmit free descriptor */
@@ -989,7 +989,9 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
989 skb = newskb; 989 skb = newskb;
990 /* size less than COPY_SIZE, allocate a rxlen SKB */ 990 /* size less than COPY_SIZE, allocate a rxlen SKB */
991 skb_reserve(skb, 2); /* 16byte align */ 991 skb_reserve(skb, 2); /* 16byte align */
992 memcpy(skb_put(skb, rxlen), rxptr->rx_skb_ptr->data, rxlen); 992 skb_copy_from_linear_data(rxptr->rx_skb_ptr,
993 skb_put(skb, rxlen),
994 rxlen);
993 dmfe_reuse_skb(db, rxptr->rx_skb_ptr); 995 dmfe_reuse_skb(db, rxptr->rx_skb_ptr);
994 } else 996 } else
995 skb_put(skb, rxlen); 997 skb_put(skb, rxlen);
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index e46f4cb02c15..ca2548eb7d63 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -583,7 +583,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev)
583 583
584 /* transmit this packet */ 584 /* transmit this packet */
585 txptr = db->tx_insert_ptr; 585 txptr = db->tx_insert_ptr;
586 memcpy(txptr->tx_buf_ptr, skb->data, skb->len); 586 skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len);
587 txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); 587 txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len);
588 588
589 /* Point to next transmit free descriptor */ 589 /* Point to next transmit free descriptor */
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index 1fe3734e155b..985a1810ca59 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -411,9 +411,9 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
411 sometimes sends more than you ask it to. */ 411 sometimes sends more than you ask it to. */
412 412
413 memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536); 413 memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536);
414 memcpy(&(card->tx_buffer[bufferoffsets[desc]/4]),skb->data,skb->len); 414 skb_copy_from_linear_data(skb,
415 415 &(card->tx_buffer[bufferoffsets[desc] / 4]),
416 416 skb->len);
417 /* FIXME: The specification tells us that the length we send HAS to be a multiple of 417 /* FIXME: The specification tells us that the length we send HAS to be a multiple of
418 4 bytes. */ 418 4 bytes. */
419 419
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
index 3f24c82755fc..696b3b8aac8e 100644
--- a/drivers/net/tulip/xircom_tulip_cb.c
+++ b/drivers/net/tulip/xircom_tulip_cb.c
@@ -915,7 +915,9 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
915 915
916 tp->tx_skbuff[entry] = skb; 916 tp->tx_skbuff[entry] = skb;
917 if (tp->chip_id == X3201_3) { 917 if (tp->chip_id == X3201_3) {
918 memcpy(tp->tx_aligned_skbuff[entry]->data,skb->data,skb->len); 918 skb_copy_from_linear_data(skb,
919 tp->tx_aligned_skbuff[entry]->data,
920 skb->len);
919 tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data); 921 tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data);
920 } else 922 } else
921 tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data); 923 tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data);