diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:23 -0400 |
commit | d626f62b11e00c16e81e4308ab93d3f13551812a (patch) | |
tree | fac4af6ced853755e12fc709d55f0c2bec51265d /drivers/net | |
parent | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (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')
82 files changed, 183 insertions, 138 deletions
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index c693b5a79500..e985a85a5623 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c | |||
@@ -1025,7 +1025,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb) | |||
1025 | adapter->current_dma.start_time = jiffies; | 1025 | adapter->current_dma.start_time = jiffies; |
1026 | 1026 | ||
1027 | if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) { | 1027 | if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) { |
1028 | memcpy(adapter->dma_buffer, skb->data, nlen); | 1028 | skb_copy_from_linear_data(skb, adapter->dma_buffer, nlen); |
1029 | memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len); | 1029 | memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len); |
1030 | target = isa_virt_to_bus(adapter->dma_buffer); | 1030 | target = isa_virt_to_bus(adapter->dma_buffer); |
1031 | } | 1031 | } |
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 6b2036df6856..a384f7d478ab 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -1145,7 +1145,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1145 | 1145 | ||
1146 | if (len != skb->len) | 1146 | if (len != skb->len) |
1147 | memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); | 1147 | memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); |
1148 | memcpy((char *) p->xmit_cbuffs[p->xmit_count], (char *) (skb->data), skb->len); | 1148 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1149 | 1149 | ||
1150 | #if (NUM_XMIT_BUFFS == 1) | 1150 | #if (NUM_XMIT_BUFFS == 1) |
1151 | #ifdef NO_NOPCOMMANDS | 1151 | #ifdef NO_NOPCOMMANDS |
diff --git a/drivers/net/7990.c b/drivers/net/7990.c index c50264aea16b..d396f996af57 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c | |||
@@ -567,7 +567,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
567 | 567 | ||
568 | if (skb->len < ETH_ZLEN) | 568 | if (skb->len < ETH_ZLEN) |
569 | memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN); | 569 | memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN); |
570 | memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 570 | skb_copy_from_linear_data(skb, &ib->tx_buf[entry][0], skblen); |
571 | 571 | ||
572 | /* Now, give the packet to the lance */ | 572 | /* Now, give the packet to the lance */ |
573 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); | 573 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); |
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index b38fc65005eb..1226cbba0450 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -598,7 +598,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
598 | ib->btx_ring [entry].length = (-len) | 0xf000; | 598 | ib->btx_ring [entry].length = (-len) | 0xf000; |
599 | ib->btx_ring [entry].misc = 0; | 599 | ib->btx_ring [entry].misc = 0; |
600 | 600 | ||
601 | memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 601 | skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen); |
602 | 602 | ||
603 | /* Clear the slack of the packet, do I need this? */ | 603 | /* Clear the slack of the packet, do I need this? */ |
604 | if (len != skblen) | 604 | if (len != skblen) |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index f6a87bd20ff2..cc4610db6395 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -273,7 +273,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
273 | /* skb_pull(ackskb, ARC_HDR_SIZE); */ | 273 | /* skb_pull(ackskb, ARC_HDR_SIZE); */ |
274 | 274 | ||
275 | 275 | ||
276 | memcpy(ackpkt, lp->outgoing.skb->data, ARC_HDR_SIZE+sizeof(struct arc_cap)); | 276 | skb_copy_from_linear_data(lp->outgoing.skb, ackpkt, |
277 | ARC_HDR_SIZE + sizeof(struct arc_cap)); | ||
277 | ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */ | 278 | ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */ |
278 | ackpkt->soft.cap.mes.ack=acked; | 279 | ackpkt->soft.cap.mes.ack=acked; |
279 | 280 | ||
diff --git a/drivers/net/atari_bionet.c b/drivers/net/atari_bionet.c index f52e7f22f63d..13dbed368d6a 100644 --- a/drivers/net/atari_bionet.c +++ b/drivers/net/atari_bionet.c | |||
@@ -453,7 +453,8 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) { | |||
453 | stdma_lock(bionet_intr, NULL); | 453 | stdma_lock(bionet_intr, NULL); |
454 | local_irq_restore(flags); | 454 | local_irq_restore(flags); |
455 | if( !STRAM_ADDR(buf+length-1) ) { | 455 | if( !STRAM_ADDR(buf+length-1) ) { |
456 | memcpy(nic_packet->buffer, skb->data, length); | 456 | skb_copy_from_linear_data(skb, nic_packet->buffer, |
457 | length); | ||
457 | buf = (unsigned long)&((struct nic_pkt_s *)phys_nic_packet)->buffer; | 458 | buf = (unsigned long)&((struct nic_pkt_s *)phys_nic_packet)->buffer; |
458 | } | 459 | } |
459 | 460 | ||
diff --git a/drivers/net/atari_pamsnet.c b/drivers/net/atari_pamsnet.c index 3b5436149286..745101d7451b 100644 --- a/drivers/net/atari_pamsnet.c +++ b/drivers/net/atari_pamsnet.c | |||
@@ -717,7 +717,8 @@ pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev) { | |||
717 | 717 | ||
718 | local_irq_restore(flags); | 718 | local_irq_restore(flags); |
719 | if( !STRAM_ADDR(buf+length-1) ) { | 719 | if( !STRAM_ADDR(buf+length-1) ) { |
720 | memcpy(nic_packet->buffer, skb->data, length); | 720 | skb_copy_from_linear_data(skb, nic_packet->buffer, |
721 | length); | ||
721 | buf = (unsigned long)phys_nic_packet; | 722 | buf = (unsigned long)phys_nic_packet; |
722 | } | 723 | } |
723 | 724 | ||
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 97b55f2546c5..d10fb80e9a63 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -1125,7 +1125,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev) | |||
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | pDB = aup->tx_db_inuse[aup->tx_head]; | 1127 | pDB = aup->tx_db_inuse[aup->tx_head]; |
1128 | memcpy((void *)pDB->vaddr, skb->data, skb->len); | 1128 | skb_copy_from_linear_data(skb, pDB->vaddr, skb->len); |
1129 | if (skb->len < ETH_ZLEN) { | 1129 | if (skb->len < ETH_ZLEN) { |
1130 | for (i=skb->len; i<ETH_ZLEN; i++) { | 1130 | for (i=skb->len; i<ETH_ZLEN; i++) { |
1131 | ((char *)pDB->vaddr)[i] = 0; | 1131 | ((char *)pDB->vaddr)[i] = 0; |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index f67d97de97ff..879a2fff474e 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -828,8 +828,8 @@ static int b44_rx(struct b44 *bp, int budget) | |||
828 | skb_reserve(copy_skb, 2); | 828 | skb_reserve(copy_skb, 2); |
829 | skb_put(copy_skb, len); | 829 | skb_put(copy_skb, len); |
830 | /* DMA sync done above, copy just the actual packet */ | 830 | /* DMA sync done above, copy just the actual packet */ |
831 | memcpy(copy_skb->data, skb->data+bp->rx_offset, len); | 831 | skb_copy_from_linear_data_offset(skb, bp->rx_offset, |
832 | 832 | copy_skb->data, len); | |
833 | skb = copy_skb; | 833 | skb = copy_skb; |
834 | } | 834 | } |
835 | skb->ip_summed = CHECKSUM_NONE; | 835 | skb->ip_summed = CHECKSUM_NONE; |
@@ -1006,7 +1006,8 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1006 | goto err_out; | 1006 | goto err_out; |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | memcpy(skb_put(bounce_skb, len), skb->data, skb->len); | 1009 | skb_copy_from_linear_data(skb, skb_put(bounce_skb, len), |
1010 | skb->len); | ||
1010 | dev_kfree_skb_any(skb); | 1011 | dev_kfree_skb_any(skb); |
1011 | skb = bounce_skb; | 1012 | skb = bounce_skb; |
1012 | } | 1013 | } |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7e7b5f344030..f98a2205a090 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1884,10 +1884,8 @@ bnx2_rx_int(struct bnx2 *bp, int budget) | |||
1884 | goto reuse_rx; | 1884 | goto reuse_rx; |
1885 | 1885 | ||
1886 | /* aligned copy */ | 1886 | /* aligned copy */ |
1887 | memcpy(new_skb->data, | 1887 | skb_copy_from_linear_data_offset(skb, bp->rx_offset - 2, |
1888 | skb->data + bp->rx_offset - 2, | 1888 | new_skb->data, len + 2); |
1889 | len + 2); | ||
1890 | |||
1891 | skb_reserve(new_skb, 2); | 1889 | skb_reserve(new_skb, 2); |
1892 | skb_put(new_skb, len); | 1890 | skb_put(new_skb, len); |
1893 | 1891 | ||
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index bd3ab6493e39..4aec747d9e43 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -2846,8 +2846,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring, | |||
2846 | ctrl | TX_DESC_SOF, 0); | 2846 | ctrl | TX_DESC_SOF, 0); |
2847 | entry = TX_DESC_NEXT(ring, entry); | 2847 | entry = TX_DESC_NEXT(ring, entry); |
2848 | 2848 | ||
2849 | memcpy(tx_tiny_buf(cp, ring, entry), skb->data + | 2849 | skb_copy_from_linear_data_offset(skb, len - tabort, |
2850 | len - tabort, tabort); | 2850 | tx_tiny_buf(cp, ring, entry), tabort); |
2851 | mapping = tx_tiny_map(cp, ring, entry, tentry); | 2851 | mapping = tx_tiny_map(cp, ring, entry, tentry); |
2852 | cas_write_txd(cp, ring, entry, mapping, tabort, ctrl, | 2852 | cas_write_txd(cp, ring, entry, mapping, tabort, ctrl, |
2853 | (nr_frags == 0)); | 2853 | (nr_frags == 0)); |
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 43e92f9f0bcd..1be1bbd16164 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1062,7 +1062,7 @@ static inline struct sk_buff *get_packet(struct pci_dev *pdev, | |||
1062 | pci_unmap_addr(ce, dma_addr), | 1062 | pci_unmap_addr(ce, dma_addr), |
1063 | pci_unmap_len(ce, dma_len), | 1063 | pci_unmap_len(ce, dma_len), |
1064 | PCI_DMA_FROMDEVICE); | 1064 | PCI_DMA_FROMDEVICE); |
1065 | memcpy(skb->data, ce->skb->data, len); | 1065 | skb_copy_from_linear_data(ce->skb, skb->data, len); |
1066 | pci_dma_sync_single_for_device(pdev, | 1066 | pci_dma_sync_single_for_device(pdev, |
1067 | pci_unmap_addr(ce, dma_addr), | 1067 | pci_unmap_addr(ce, dma_addr), |
1068 | pci_unmap_len(ce, dma_len), | 1068 | pci_unmap_len(ce, dma_len), |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index c5faf1380e15..166c959c94b9 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -913,7 +913,8 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb, | |||
913 | if (skb->len <= WR_LEN - sizeof(*cpl)) { | 913 | if (skb->len <= WR_LEN - sizeof(*cpl)) { |
914 | q->sdesc[pidx].skb = NULL; | 914 | q->sdesc[pidx].skb = NULL; |
915 | if (!skb->data_len) | 915 | if (!skb->data_len) |
916 | memcpy(&d->flit[2], skb->data, skb->len); | 916 | skb_copy_from_linear_data(skb, &d->flit[2], |
917 | skb->len); | ||
917 | else | 918 | else |
918 | skb_copy_bits(skb, 0, &d->flit[2], skb->len); | 919 | skb_copy_bits(skb, 0, &d->flit[2], skb->len); |
919 | 920 | ||
@@ -1771,7 +1772,7 @@ static struct sk_buff *get_packet(struct adapter *adap, struct sge_fl *fl, | |||
1771 | __skb_put(skb, len); | 1772 | __skb_put(skb, len); |
1772 | pci_dma_sync_single_for_cpu(adap->pdev, mapping, len, | 1773 | pci_dma_sync_single_for_cpu(adap->pdev, mapping, len, |
1773 | PCI_DMA_FROMDEVICE); | 1774 | PCI_DMA_FROMDEVICE); |
1774 | memcpy(skb->data, sd->t.skb->data, len); | 1775 | skb_copy_from_linear_data(sd->t.skb, skb->data, len); |
1775 | pci_dma_sync_single_for_device(adap->pdev, mapping, len, | 1776 | pci_dma_sync_single_for_device(adap->pdev, mapping, len, |
1776 | PCI_DMA_FROMDEVICE); | 1777 | PCI_DMA_FROMDEVICE); |
1777 | } else if (!drop_thres) | 1778 | } else if (!drop_thres) |
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index d223c38966f4..df62c0232f36 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c | |||
@@ -741,7 +741,7 @@ static int dgrs_start_xmit(struct sk_buff *skb, struct net_device *devN) | |||
741 | } | 741 | } |
742 | 742 | ||
743 | amt = min_t(unsigned int, len, rbdp->size - count); | 743 | amt = min_t(unsigned int, len, rbdp->size - count); |
744 | memcpy( (char *) S2H(rbdp->buf) + count, skb->data + i, amt); | 744 | skb_copy_from_linear_data_offset(skb, i, S2H(rbdp->buf) + count, amt); |
745 | i += amt; | 745 | i += amt; |
746 | count += amt; | 746 | count += amt; |
747 | len -= amt; | 747 | len -= amt; |
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index db658bc491a9..6c267c38df97 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c | |||
@@ -1804,8 +1804,9 @@ speedo_rx(struct net_device *dev) | |||
1804 | eth_copy_and_sum(skb, sp->rx_skbuff[entry]->data, pkt_len, 0); | 1804 | eth_copy_and_sum(skb, sp->rx_skbuff[entry]->data, pkt_len, 0); |
1805 | skb_put(skb, pkt_len); | 1805 | skb_put(skb, pkt_len); |
1806 | #else | 1806 | #else |
1807 | memcpy(skb_put(skb, pkt_len), sp->rx_skbuff[entry]->data, | 1807 | skb_copy_from_linear_data(sp->rx_skbuff[entry], |
1808 | pkt_len); | 1808 | skb_put(skb, pkt_len), |
1809 | pkt_len); | ||
1809 | #endif | 1810 | #endif |
1810 | pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry], | 1811 | pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry], |
1811 | sizeof(struct RxFD) + pkt_len, | 1812 | sizeof(struct RxFD) + pkt_len, |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 63732d2305bb..8b5392072632 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -1306,7 +1306,7 @@ static void write_swqe2_TSO(struct sk_buff *skb, | |||
1306 | 1306 | ||
1307 | if (skb_data_size >= headersize) { | 1307 | if (skb_data_size >= headersize) { |
1308 | /* copy immediate data */ | 1308 | /* copy immediate data */ |
1309 | memcpy(imm_data, skb->data, headersize); | 1309 | skb_copy_from_linear_data(skb, imm_data, headersize); |
1310 | swqe->immediate_data_length = headersize; | 1310 | swqe->immediate_data_length = headersize; |
1311 | 1311 | ||
1312 | if (skb_data_size > headersize) { | 1312 | if (skb_data_size > headersize) { |
@@ -1337,7 +1337,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb, | |||
1337 | */ | 1337 | */ |
1338 | if (skb_data_size >= SWQE2_MAX_IMM) { | 1338 | if (skb_data_size >= SWQE2_MAX_IMM) { |
1339 | /* copy immediate data */ | 1339 | /* copy immediate data */ |
1340 | memcpy(imm_data, skb->data, SWQE2_MAX_IMM); | 1340 | skb_copy_from_linear_data(skb, imm_data, SWQE2_MAX_IMM); |
1341 | 1341 | ||
1342 | swqe->immediate_data_length = SWQE2_MAX_IMM; | 1342 | swqe->immediate_data_length = SWQE2_MAX_IMM; |
1343 | 1343 | ||
@@ -1350,7 +1350,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb, | |||
1350 | swqe->descriptors++; | 1350 | swqe->descriptors++; |
1351 | } | 1351 | } |
1352 | } else { | 1352 | } else { |
1353 | memcpy(imm_data, skb->data, skb_data_size); | 1353 | skb_copy_from_linear_data(skb, imm_data, skb_data_size); |
1354 | swqe->immediate_data_length = skb_data_size; | 1354 | swqe->immediate_data_length = skb_data_size; |
1355 | } | 1355 | } |
1356 | } | 1356 | } |
@@ -1772,10 +1772,11 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev, | |||
1772 | /* copy (immediate) data */ | 1772 | /* copy (immediate) data */ |
1773 | if (nfrags == 0) { | 1773 | if (nfrags == 0) { |
1774 | /* data is in a single piece */ | 1774 | /* data is in a single piece */ |
1775 | memcpy(imm_data, skb->data, skb->len); | 1775 | skb_copy_from_linear_data(skb, imm_data, skb->len); |
1776 | } else { | 1776 | } else { |
1777 | /* first copy data from the skb->data buffer ... */ | 1777 | /* first copy data from the skb->data buffer ... */ |
1778 | memcpy(imm_data, skb->data, skb->len - skb->data_len); | 1778 | skb_copy_from_linear_data(skb, imm_data, |
1779 | skb->len - skb->data_len); | ||
1779 | imm_data += skb->len - skb->data_len; | 1780 | imm_data += skb->len - skb->data_len; |
1780 | 1781 | ||
1781 | /* ... then copy data from the fragments */ | 1782 | /* ... then copy data from the fragments */ |
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 698dba8f2aa1..e824d5d231af 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c | |||
@@ -551,7 +551,9 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget) | |||
551 | skbn = dev_alloc_skb(pkt_len + 2); | 551 | skbn = dev_alloc_skb(pkt_len + 2); |
552 | if (skbn != NULL) { | 552 | if (skbn != NULL) { |
553 | skb_reserve(skbn, 2); /* align IP header */ | 553 | skb_reserve(skbn, 2); /* align IP header */ |
554 | memcpy(skbn->data, skb->data, pkt_len); | 554 | skb_copy_from_linear_data(skb |
555 | skbn->data, | ||
556 | pkt_len); | ||
555 | /* swap */ | 557 | /* swap */ |
556 | skbt = skb; | 558 | skbt = skb; |
557 | skb = skbn; | 559 | skb = skbn; |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 9f6ef315ce51..e2ddd617493a 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -160,7 +160,8 @@ static int fs_enet_rx_napi(struct net_device *dev, int *budget) | |||
160 | skbn = dev_alloc_skb(pkt_len + 2); | 160 | skbn = dev_alloc_skb(pkt_len + 2); |
161 | if (skbn != NULL) { | 161 | if (skbn != NULL) { |
162 | skb_reserve(skbn, 2); /* align IP header */ | 162 | skb_reserve(skbn, 2); /* align IP header */ |
163 | memcpy(skbn->data, skb->data, pkt_len); | 163 | skb_copy_from_linear_data(skb, |
164 | skbn->data, pkt_len); | ||
164 | /* swap */ | 165 | /* swap */ |
165 | skbt = skb; | 166 | skbt = skb; |
166 | skb = skbn; | 167 | skb = skbn; |
@@ -293,7 +294,8 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
293 | skbn = dev_alloc_skb(pkt_len + 2); | 294 | skbn = dev_alloc_skb(pkt_len + 2); |
294 | if (skbn != NULL) { | 295 | if (skbn != NULL) { |
295 | skb_reserve(skbn, 2); /* align IP header */ | 296 | skb_reserve(skbn, 2); /* align IP header */ |
296 | memcpy(skbn->data, skb->data, pkt_len); | 297 | skb_copy_from_linear_data(skb, |
298 | skbn->data, pkt_len); | ||
297 | /* swap */ | 299 | /* swap */ |
298 | skbt = skb; | 300 | skbt = skb; |
299 | skb = skbn; | 301 | skb = skbn; |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 0fbb414b5a4d..3be8c5047599 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -930,7 +930,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
930 | 930 | ||
931 | /* Transfer data to DMA buffer */ | 931 | /* Transfer data to DMA buffer */ |
932 | i = priv->tx_head; | 932 | i = priv->tx_head; |
933 | memcpy(priv->tx_buf[i], skb->data + 1, skb->len - 1); | 933 | skb_copy_from_linear_data_offset(skb, 1, priv->tx_buf[i], skb->len - 1); |
934 | priv->tx_len[i] = skb->len - 1; | 934 | priv->tx_len[i] = skb->len - 1; |
935 | 935 | ||
936 | /* Clear interrupts while we touch our circular buffers */ | 936 | /* Clear interrupts while we touch our circular buffers */ |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index f5a17ad9d3d6..b33adc6a340b 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -317,7 +317,9 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s) | |||
317 | dev_kfree_skb_irq(skb); | 317 | dev_kfree_skb_irq(skb); |
318 | break; | 318 | break; |
319 | } | 319 | } |
320 | memcpy(s->hdlctx.buffer, skb->data+1, pkt_len); | 320 | skb_copy_from_linear_data_offset(skb, 1, |
321 | s->hdlctx.buffer, | ||
322 | pkt_len); | ||
321 | dev_kfree_skb_irq(skb); | 323 | dev_kfree_skb_irq(skb); |
322 | s->hdlctx.bp = s->hdlctx.buffer; | 324 | s->hdlctx.bp = s->hdlctx.buffer; |
323 | append_crc_ccitt(s->hdlctx.buffer, pkt_len); | 325 | append_crc_ccitt(s->hdlctx.buffer, pkt_len); |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index ee3ea4fa729f..ac2d6dd9dbe4 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -638,7 +638,9 @@ static void yam_tx_byte(struct net_device *dev, struct yam_port *yp) | |||
638 | dev_kfree_skb_any(skb); | 638 | dev_kfree_skb_any(skb); |
639 | break; | 639 | break; |
640 | } | 640 | } |
641 | memcpy(yp->tx_buf, skb->data + 1, yp->tx_len); | 641 | skb_copy_from_linear_data_offset(skb->data, 1, |
642 | yp->tx_buf, | ||
643 | yp->tx_len); | ||
642 | dev_kfree_skb_any(skb); | 644 | dev_kfree_skb_any(skb); |
643 | yp->tx_count = 0; | 645 | yp->tx_count = 0; |
644 | yp->tx_crcl = 0x21; | 646 | yp->tx_crcl = 0x21; |
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index bc62e770a256..f749e07c6425 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c | |||
@@ -1443,7 +1443,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1443 | 1443 | ||
1444 | if (len <= 104) { | 1444 | if (len <= 104) { |
1445 | /* Short packet, let's copy it directly into the ring. */ | 1445 | /* Short packet, let's copy it directly into the ring. */ |
1446 | memcpy(desc->data, skb->data, skb->len); | 1446 | skb_copy_from_linear_data(skb, desc->data, skb->len); |
1447 | if (len < ETH_ZLEN) { | 1447 | if (len < ETH_ZLEN) { |
1448 | /* Very short packet, pad with zeros at the end. */ | 1448 | /* Very short packet, pad with zeros at the end. */ |
1449 | memset(desc->data + len, 0, ETH_ZLEN - len); | 1449 | memset(desc->data + len, 0, ETH_ZLEN - len); |
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index 0f10758226fa..fb2248a25516 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -1472,9 +1472,8 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1472 | 1472 | ||
1473 | self->stats.tx_bytes += skb->len; | 1473 | self->stats.tx_bytes += skb->len; |
1474 | 1474 | ||
1475 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 1475 | skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start, |
1476 | skb->len); | 1476 | skb->len); |
1477 | |||
1478 | self->tx_fifo.len++; | 1477 | self->tx_fifo.len++; |
1479 | self->tx_fifo.free++; | 1478 | self->tx_fifo.free++; |
1480 | 1479 | ||
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 27afd0f367d6..cdd1f6c1e741 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -526,7 +526,7 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
526 | 526 | ||
527 | if (aup->speed == 4000000) { | 527 | if (aup->speed == 4000000) { |
528 | /* FIR */ | 528 | /* FIR */ |
529 | memcpy((void *)pDB->vaddr, skb->data, skb->len); | 529 | skb_copy_from_linear_data(skb, pDB->vaddr, skb->len); |
530 | ptxd->count_0 = skb->len & 0xff; | 530 | ptxd->count_0 = skb->len & 0xff; |
531 | ptxd->count_1 = (skb->len >> 8) & 0xff; | 531 | ptxd->count_1 = (skb->len >> 8) & 0xff; |
532 | 532 | ||
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index ddfa6c38a16b..9987a0dc1eaf 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1119,7 +1119,7 @@ dumpbufs(skb->data,skb->len,'>'); | |||
1119 | else | 1119 | else |
1120 | { | 1120 | { |
1121 | len = skb->len; | 1121 | len = skb->len; |
1122 | memcpy (self->tx_bufs[self->txs], skb->data, len); | 1122 | skb_copy_from_linear_data(skb, self->tx_bufs[self->txs], len); |
1123 | } | 1123 | } |
1124 | self->ring->tx[self->txs].len = len & 0x0fff; | 1124 | self->ring->tx[self->txs].len = len & 0x0fff; |
1125 | 1125 | ||
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 6ef375a095f4..0ac240ca905b 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -441,7 +441,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
441 | goto drop; | 441 | goto drop; |
442 | } | 442 | } |
443 | 443 | ||
444 | memcpy(self->tx_buff + self->header_length, skb->data, skb->len); | 444 | skb_copy_from_linear_data(skb, self->tx_buff + self->header_length, skb->len); |
445 | 445 | ||
446 | /* Change setting for next frame */ | 446 | /* Change setting for next frame */ |
447 | if (self->capability & IUC_STIR421X) { | 447 | if (self->capability & IUC_STIR421X) { |
@@ -902,7 +902,7 @@ static void irda_usb_receive(struct urb *urb) | |||
902 | 902 | ||
903 | if(docopy) { | 903 | if(docopy) { |
904 | /* Copy packet, so we can recycle the original */ | 904 | /* Copy packet, so we can recycle the original */ |
905 | memcpy(newskb->data, skb->data, urb->actual_length); | 905 | skb_copy_from_linear_data(skb, newskb->data, urb->actual_length); |
906 | /* Deliver this new skb */ | 906 | /* Deliver this new skb */ |
907 | dataskb = newskb; | 907 | dataskb = newskb; |
908 | /* And hook the old skb to the URB | 908 | /* And hook the old skb to the URB |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 3ff1f4b33c06..4b0037e498f8 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf) | |||
353 | buf[0] = len & 0xff; | 353 | buf[0] = len & 0xff; |
354 | buf[1] = (len >> 8) & 0xff; | 354 | buf[1] = (len >> 8) & 0xff; |
355 | /* copy the data into the tx buffer. */ | 355 | /* copy the data into the tx buffer. */ |
356 | memcpy(buf+2, skb->data, skb->len); | 356 | skb_copy_from_linear_data(skb, buf + 2, skb->len); |
357 | /* put the fcs in the last four bytes in little endian order. */ | 357 | /* put the fcs in the last four bytes in little endian order. */ |
358 | buf[len - 4] = fcs & 0xff; | 358 | buf[len - 4] = fcs & 0xff; |
359 | buf[len - 3] = (fcs >> 8) & 0xff; | 359 | buf[len - 3] = (fcs >> 8) & 0xff; |
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf) | |||
377 | buf[0] = len & 0xff; | 377 | buf[0] = len & 0xff; |
378 | buf[1] = (len >> 8) & 0xff; | 378 | buf[1] = (len >> 8) & 0xff; |
379 | /* copy the data */ | 379 | /* copy the data */ |
380 | memcpy(buf+2, skb->data, skb->len); | 380 | skb_copy_from_linear_data(skb, buf + 2, skb->len); |
381 | /* put the fcs in last two bytes in little endian order. */ | 381 | /* put the fcs in last two bytes in little endian order. */ |
382 | buf[len - 2] = fcs & 0xff; | 382 | buf[len - 2] = fcs & 0xff; |
383 | buf[len - 1] = (fcs >> 8) & 0xff; | 383 | buf[len - 1] = (fcs >> 8) & 0xff; |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 8ce7dad582f4..0ff992714136 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -1466,9 +1466,8 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1466 | 1466 | ||
1467 | self->stats.tx_bytes += skb->len; | 1467 | self->stats.tx_bytes += skb->len; |
1468 | 1468 | ||
1469 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 1469 | skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start, |
1470 | skb->len); | 1470 | skb->len); |
1471 | |||
1472 | self->tx_fifo.len++; | 1471 | self->tx_fifo.len++; |
1473 | self->tx_fifo.free++; | 1472 | self->tx_fifo.free++; |
1474 | 1473 | ||
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index f35d7d42624e..b3e1107420af 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -484,7 +484,7 @@ static int pxa_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
484 | unsigned long mtt = irda_get_mtt(skb); | 484 | unsigned long mtt = irda_get_mtt(skb); |
485 | 485 | ||
486 | si->dma_tx_buff_len = skb->len; | 486 | si->dma_tx_buff_len = skb->len; |
487 | memcpy(si->dma_tx_buff, skb->data, skb->len); | 487 | skb_copy_from_linear_data(skb, si->dma_tx_buff, skb->len); |
488 | 488 | ||
489 | if (mtt) | 489 | if (mtt) |
490 | while ((unsigned)(OSCR - si->last_oscr)/4 < mtt) | 490 | while ((unsigned)(OSCR - si->last_oscr)/4 < mtt) |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index e8453868d741..198bf3bfa70f 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -1162,7 +1162,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1162 | self->new_speed = speed; | 1162 | self->new_speed = speed; |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | memcpy(self->tx_buff.head, skb->data, skb->len); | 1165 | skb_copy_from_linear_data(skb, self->tx_buff.head, skb->len); |
1166 | 1166 | ||
1167 | self->tx_buff.len = skb->len; | 1167 | self->tx_buff.len = skb->len; |
1168 | self->tx_buff.data = self->tx_buff.head; | 1168 | self->tx_buff.data = self->tx_buff.head; |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 5ff416314604..45bbd6686151 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -925,8 +925,8 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb, | |||
925 | 925 | ||
926 | self->tx_fifo.tail += skb->len; | 926 | self->tx_fifo.tail += skb->len; |
927 | self->stats.tx_bytes += skb->len; | 927 | self->stats.tx_bytes += skb->len; |
928 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 928 | skb_copy_from_linear_data(skb, |
929 | skb->len); | 929 | self->tx_fifo.queue[self->tx_fifo.free].start, skb->len); |
930 | self->tx_fifo.len++; | 930 | self->tx_fifo.len++; |
931 | self->tx_fifo.free++; | 931 | self->tx_fifo.free++; |
932 | //F01 if (self->tx_fifo.len == 1) { | 932 | //F01 if (self->tx_fifo.len == 1) { |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 79b407f3a49a..c4be973867a6 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -993,7 +993,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
993 | goto drop; | 993 | goto drop; |
994 | } | 994 | } |
995 | else | 995 | else |
996 | memcpy(rd->buf, skb->data, len); | 996 | skb_copy_from_linear_data(skb, rd->buf, len); |
997 | } | 997 | } |
998 | 998 | ||
999 | rd->skb = skb; /* remember skb for tx-complete stats */ | 999 | rd->skb = skb; /* remember skb for tx-complete stats */ |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index bee445130952..0d4a68618fc1 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -529,7 +529,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
529 | /* Decide if we should use PIO or DMA transfer */ | 529 | /* Decide if we should use PIO or DMA transfer */ |
530 | if (self->io.speed > PIO_MAX_SPEED) { | 530 | if (self->io.speed > PIO_MAX_SPEED) { |
531 | self->tx_buff.data = self->tx_buff.head; | 531 | self->tx_buff.data = self->tx_buff.head; |
532 | memcpy(self->tx_buff.data, skb->data, skb->len); | 532 | skb_copy_from_linear_data(skb, self->tx_buff.data, skb->len); |
533 | self->tx_buff.len = skb->len; | 533 | self->tx_buff.len = skb->len; |
534 | 534 | ||
535 | mtt = irda_get_mtt(skb); | 535 | mtt = irda_get_mtt(skb); |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 11cbcb946db4..0fe96c85828b 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -988,7 +988,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
988 | if (lance_debug > 5) | 988 | if (lance_debug > 5) |
989 | printk("%s: bouncing a high-memory packet (%#x).\n", | 989 | printk("%s: bouncing a high-memory packet (%#x).\n", |
990 | dev->name, (u32)isa_virt_to_bus(skb->data)); | 990 | dev->name, (u32)isa_virt_to_bus(skb->data)); |
991 | memcpy(&lp->tx_bounce_buffs[entry], skb->data, skb->len); | 991 | skb_copy_from_linear_data(skb, &lp->tx_bounce_buffs[entry], skb->len); |
992 | lp->tx_ring[entry].base = | 992 | lp->tx_ring[entry].base = |
993 | ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000; | 993 | ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000; |
994 | dev_kfree_skb(skb); | 994 | dev_kfree_skb(skb); |
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c index 8c07ffc9c244..27911c07558d 100644 --- a/drivers/net/macmace.c +++ b/drivers/net/macmace.c | |||
@@ -420,8 +420,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) | |||
420 | mp->stats.tx_bytes += skb->len; | 420 | mp->stats.tx_bytes += skb->len; |
421 | 421 | ||
422 | /* We need to copy into our xmit buffer to take care of alignment and caching issues */ | 422 | /* We need to copy into our xmit buffer to take care of alignment and caching issues */ |
423 | 423 | skb_copy_from_linear_data(skb, mp->tx_ring, skb->len); | |
424 | memcpy((void *) mp->tx_ring, skb->data, skb->len); | ||
425 | 424 | ||
426 | /* load the Tx DMA and fire it off */ | 425 | /* load the Tx DMA and fire it off */ |
427 | 426 | ||
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index fafe67835238..0343ea12b299 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -608,7 +608,7 @@ static void meth_tx_short_prepare(struct meth_private *priv, | |||
608 | 608 | ||
609 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); | 609 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); |
610 | /* maybe I should set whole thing to 0 first... */ | 610 | /* maybe I should set whole thing to 0 first... */ |
611 | memcpy(desc->data.dt + (120 - len), skb->data, skb->len); | 611 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - len), skb->len); |
612 | if (skb->len < len) | 612 | if (skb->len < len) |
613 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); | 613 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); |
614 | } | 614 | } |
@@ -626,8 +626,8 @@ static void meth_tx_1page_prepare(struct meth_private *priv, | |||
626 | 626 | ||
627 | /* unaligned part */ | 627 | /* unaligned part */ |
628 | if (unaligned_len) { | 628 | if (unaligned_len) { |
629 | memcpy(desc->data.dt + (120 - unaligned_len), | 629 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
630 | skb->data, unaligned_len); | 630 | unaligned_len); |
631 | desc->header.raw |= (128 - unaligned_len) << 16; | 631 | desc->header.raw |= (128 - unaligned_len) << 16; |
632 | } | 632 | } |
633 | 633 | ||
@@ -652,8 +652,8 @@ static void meth_tx_2page_prepare(struct meth_private *priv, | |||
652 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); | 652 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); |
653 | /* unaligned part */ | 653 | /* unaligned part */ |
654 | if (unaligned_len){ | 654 | if (unaligned_len){ |
655 | memcpy(desc->data.dt + (120 - unaligned_len), | 655 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
656 | skb->data, unaligned_len); | 656 | unaligned_len); |
657 | desc->header.raw |= (128 - unaligned_len) << 16; | 657 | desc->header.raw |= (128 - unaligned_len) << 16; |
658 | } | 658 | } |
659 | 659 | ||
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index e1f16fb05846..13444da93273 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -502,7 +502,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) | |||
502 | copy_skb->dev = dev; | 502 | copy_skb->dev = dev; |
503 | DRX(("resv_and_put ")); | 503 | DRX(("resv_and_put ")); |
504 | skb_put(copy_skb, len); | 504 | skb_put(copy_skb, len); |
505 | memcpy(copy_skb->data, skb->data, len); | 505 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
506 | 506 | ||
507 | /* Reuse original ring buffer. */ | 507 | /* Reuse original ring buffer. */ |
508 | DRX(("reuse ")); | 508 | DRX(("reuse ")); |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index b488e94bc4c0..ab25c225a07e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -920,8 +920,10 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
920 | /* copy the next 64 bytes - should be enough except | 920 | /* copy the next 64 bytes - should be enough except |
921 | * for pathological case | 921 | * for pathological case |
922 | */ | 922 | */ |
923 | memcpy((void *)hwdesc, (void *)(skb->data) + | 923 | skb_copy_from_linear_data_offset(skb, first_hdr_len, |
924 | first_hdr_len, hdr_len - first_hdr_len); | 924 | hwdesc, |
925 | (hdr_len - | ||
926 | first_hdr_len)); | ||
925 | producer = get_next_index(producer, max_tx_desc_count); | 927 | producer = get_next_index(producer, max_tx_desc_count); |
926 | } | 928 | } |
927 | } | 929 | } |
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c index 70b6812a8a75..8646698c77d4 100644 --- a/drivers/net/ni52.c +++ b/drivers/net/ni52.c | |||
@@ -1182,7 +1182,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1182 | else | 1182 | else |
1183 | #endif | 1183 | #endif |
1184 | { | 1184 | { |
1185 | memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len); | 1185 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1186 | len = skb->len; | 1186 | len = skb->len; |
1187 | if (len < ETH_ZLEN) { | 1187 | if (len < ETH_ZLEN) { |
1188 | len = ETH_ZLEN; | 1188 | len = ETH_ZLEN; |
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c index 782201d12c22..3818edf0ac18 100644 --- a/drivers/net/ni65.c +++ b/drivers/net/ni65.c | |||
@@ -1176,8 +1176,9 @@ static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1176 | if( (unsigned long) (skb->data + skb->len) > 0x1000000) { | 1176 | if( (unsigned long) (skb->data + skb->len) > 0x1000000) { |
1177 | #endif | 1177 | #endif |
1178 | 1178 | ||
1179 | memcpy((char *) p->tmdbounce[p->tmdbouncenum] ,(char *)skb->data, | 1179 | skb_copy_from_linear_data(skb, p->tmdbounce[p->tmdbouncenum], |
1180 | (skb->len > T_BUF_SIZE) ? T_BUF_SIZE : skb->len); | 1180 | skb->len > T_BUF_SIZE ? T_BUF_SIZE : |
1181 | skb->len); | ||
1181 | if (len > skb->len) | 1182 | if (len > skb->len) |
1182 | memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len); | 1183 | memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len); |
1183 | dev_kfree_skb (skb); | 1184 | dev_kfree_skb (skb); |
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index 099972c977ef..df8998b4f37e 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
@@ -1344,7 +1344,7 @@ static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1344 | 1344 | ||
1345 | tp->tx_info[entry].skb = skb; | 1345 | tp->tx_info[entry].skb = skb; |
1346 | /* tp->tx_info[entry].mapping = 0; */ | 1346 | /* tp->tx_info[entry].mapping = 0; */ |
1347 | memcpy (tp->tx_buf[entry], skb->data, skb->len); | 1347 | skb_copy_from_linear_data(skb, tp->tx_buf[entry], skb->len); |
1348 | 1348 | ||
1349 | /* Note: the chip doesn't have auto-pad! */ | 1349 | /* Note: the chip doesn't have auto-pad! */ |
1350 | NETDRV_W32 (TxStatus0 + (entry * sizeof(u32)), | 1350 | NETDRV_W32 (TxStatus0 + (entry * sizeof(u32)), |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index fabbe95c7ef1..808fae1577e0 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1136,7 +1136,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1136 | ei_block_output(dev, length, skb->data, output_page); | 1136 | ei_block_output(dev, length, skb->data, output_page); |
1137 | else { | 1137 | else { |
1138 | memset(packet, 0, ETH_ZLEN); | 1138 | memset(packet, 0, ETH_ZLEN); |
1139 | memcpy(packet, skb->data, skb->len); | 1139 | skb_copy_from_linear_data(skb, packet, skb->len); |
1140 | ei_block_output(dev, length, packet, output_page); | 1140 | ei_block_output(dev, length, packet, output_page); |
1141 | } | 1141 | } |
1142 | 1142 | ||
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index b6f0e9a25e26..5918fab38349 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -594,7 +594,8 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb) | |||
594 | return NULL; | 594 | return NULL; |
595 | } | 595 | } |
596 | skb_reserve(npkt,2); | 596 | skb_reserve(npkt,2); |
597 | memcpy(skb_put(npkt,skb->len), skb->data, skb->len); | 597 | skb_copy_from_linear_data(skb, |
598 | skb_put(npkt, skb->len), skb->len); | ||
598 | kfree_skb(skb); | 599 | kfree_skb(skb); |
599 | skb = npkt; | 600 | skb = npkt; |
600 | } | 601 | } |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index e94790632d55..e9fb616ff663 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -869,7 +869,8 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
869 | goto abort; | 869 | goto abort; |
870 | 870 | ||
871 | skb_reserve(skb2, dev->hard_header_len + sizeof(struct pppoe_hdr)); | 871 | skb_reserve(skb2, dev->hard_header_len + sizeof(struct pppoe_hdr)); |
872 | memcpy(skb_put(skb2, skb->len), skb->data, skb->len); | 872 | skb_copy_from_linear_data(skb, skb_put(skb2, skb->len), |
873 | skb->len); | ||
873 | } else { | 874 | } else { |
874 | /* Make a clone so as to not disturb the original skb, | 875 | /* Make a clone so as to not disturb the original skb, |
875 | * give dev_queue_xmit something it can free. | 876 | * give dev_queue_xmit something it can free. |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 40d2639eedcb..7b80fb7a9d9b 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1927,7 +1927,8 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, | |||
1927 | * Copy the ethhdr from first buffer to second. This | 1927 | * Copy the ethhdr from first buffer to second. This |
1928 | * is necessary for 3022 IP completions. | 1928 | * is necessary for 3022 IP completions. |
1929 | */ | 1929 | */ |
1930 | memcpy(skb_push(skb2, size), skb1->data + VLAN_ID_LEN, size); | 1930 | skb_copy_from_linear_data_offset(skb1, VLAN_ID_LEN, |
1931 | skb_push(skb2, size), size); | ||
1931 | } else { | 1932 | } else { |
1932 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); | 1933 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); |
1933 | if (checksum & | 1934 | if (checksum & |
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index 3a4fce384504..25c73d47daad 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
@@ -1451,7 +1451,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1451 | } | 1451 | } |
1452 | skb_reserve(new_skb, 8); | 1452 | skb_reserve(new_skb, 8); |
1453 | skb_put(new_skb, len); | 1453 | skb_put(new_skb, len); |
1454 | memcpy(new_skb->data, skb->data, len); | 1454 | skb_copy_from_linear_data(skb, new_skb->data, len); |
1455 | dev_kfree_skb(skb); | 1455 | dev_kfree_skb(skb); |
1456 | skb = new_skb; | 1456 | skb = new_skb; |
1457 | } | 1457 | } |
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index 5a8919132186..d8c9c5d66d4f 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
@@ -534,7 +534,7 @@ static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
534 | * entry and the HPC got to the end of the chain before we | 534 | * entry and the HPC got to the end of the chain before we |
535 | * added this new entry and restarted it. | 535 | * added this new entry and restarted it. |
536 | */ | 536 | */ |
537 | memcpy((char *)(long)td->buf_vaddr, skb->data, skblen); | 537 | skb_copy_from_linear_data(skb, (char *)(long)td->buf_vaddr, skblen); |
538 | if (len != skblen) | 538 | if (len != skblen) |
539 | memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen); | 539 | memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen); |
540 | td->tdma.cntinfo = (len & HPCDMA_BCNT) | | 540 | td->tdma.cntinfo = (len & HPCDMA_BCNT) | |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 99b61cfb7ce6..f1a0e6c0fbdd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -2950,7 +2950,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
2950 | pci_dma_sync_single_for_cpu(skge->hw->pdev, | 2950 | pci_dma_sync_single_for_cpu(skge->hw->pdev, |
2951 | pci_unmap_addr(e, mapaddr), | 2951 | pci_unmap_addr(e, mapaddr), |
2952 | len, PCI_DMA_FROMDEVICE); | 2952 | len, PCI_DMA_FROMDEVICE); |
2953 | memcpy(skb->data, e->skb->data, len); | 2953 | skb_copy_from_linear_data(e->skb, skb->data, len); |
2954 | pci_dma_sync_single_for_device(skge->hw->pdev, | 2954 | pci_dma_sync_single_for_device(skge->hw->pdev, |
2955 | pci_unmap_addr(e, mapaddr), | 2955 | pci_unmap_addr(e, mapaddr), |
2956 | len, PCI_DMA_FROMDEVICE); | 2956 | len, PCI_DMA_FROMDEVICE); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fd291fc93169..238c2ca34da6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1971,7 +1971,7 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2, | |||
1971 | skb_reserve(skb, 2); | 1971 | skb_reserve(skb, 2); |
1972 | pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr, | 1972 | pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr, |
1973 | length, PCI_DMA_FROMDEVICE); | 1973 | length, PCI_DMA_FROMDEVICE); |
1974 | memcpy(skb->data, re->skb->data, length); | 1974 | skb_copy_from_linear_data(re->skb, skb->data, length); |
1975 | skb->ip_summed = re->skb->ip_summed; | 1975 | skb->ip_summed = re->skb->ip_summed; |
1976 | skb->csum = re->skb->csum; | 1976 | skb->csum = re->skb->csum; |
1977 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, | 1977 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, |
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c index 5bcc749bef11..396c3d961f88 100644 --- a/drivers/net/sun3_82586.c +++ b/drivers/net/sun3_82586.c | |||
@@ -1026,7 +1026,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1026 | memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); | 1026 | memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); |
1027 | len = ETH_ZLEN; | 1027 | len = ETH_ZLEN; |
1028 | } | 1028 | } |
1029 | memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len); | 1029 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1030 | 1030 | ||
1031 | #if (NUM_XMIT_BUFFS == 1) | 1031 | #if (NUM_XMIT_BUFFS == 1) |
1032 | # ifdef NO_NOPCOMMANDS | 1032 | # ifdef NO_NOPCOMMANDS |
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 0454827c8c21..327ed7962fbd 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -629,7 +629,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
629 | head->length = (-len) | 0xf000; | 629 | head->length = (-len) | 0xf000; |
630 | head->misc = 0; | 630 | head->misc = 0; |
631 | 631 | ||
632 | memcpy( PKTBUF_ADDR(head), (void *)skb->data, skb->len ); | 632 | skb_copy_from_linear_data(skb, PKTBUF_ADDR(head), skb->len); |
633 | if (len != skb->len) | 633 | if (len != skb->len) |
634 | memset(PKTBUF_ADDR(head) + skb->len, 0, len-skb->len); | 634 | memset(PKTBUF_ADDR(head) + skb->len, 0, len-skb->len); |
635 | 635 | ||
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 4bb89dec5650..9df1038ec6bb 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -848,7 +848,7 @@ static int gem_rx(struct gem *gp, int work_to_do) | |||
848 | skb_reserve(copy_skb, 2); | 848 | skb_reserve(copy_skb, 2); |
849 | skb_put(copy_skb, len); | 849 | skb_put(copy_skb, len); |
850 | pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 850 | pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
851 | memcpy(copy_skb->data, skb->data, len); | 851 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
852 | pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 852 | pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
853 | 853 | ||
854 | /* We'll reuse the original ring buffer. */ | 854 | /* We'll reuse the original ring buffer. */ |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 4b69c1deb9f3..5304d7b94e5e 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2061,7 +2061,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) | |||
2061 | skb_reserve(copy_skb, 2); | 2061 | skb_reserve(copy_skb, 2); |
2062 | skb_put(copy_skb, len); | 2062 | skb_put(copy_skb, len); |
2063 | hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); | 2063 | hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); |
2064 | memcpy(copy_skb->data, skb->data, len); | 2064 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
2065 | hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); | 2065 | hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); |
2066 | 2066 | ||
2067 | /* Reuse original ring buffer. */ | 2067 | /* Reuse original ring buffer. */ |
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 8f53a1ef6083..42722530ab24 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -1143,7 +1143,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1143 | struct lance_init_block *ib = lp->init_block_mem; | 1143 | struct lance_init_block *ib = lp->init_block_mem; |
1144 | ib->btx_ring [entry].length = (-len) | 0xf000; | 1144 | ib->btx_ring [entry].length = (-len) | 0xf000; |
1145 | ib->btx_ring [entry].misc = 0; | 1145 | ib->btx_ring [entry].misc = 0; |
1146 | memcpy((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 1146 | skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen); |
1147 | if (len != skblen) | 1147 | if (len != skblen) |
1148 | memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); | 1148 | memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); |
1149 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); | 1149 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); |
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index fbfb98284fde..fa70e0b78af7 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c | |||
@@ -592,7 +592,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
592 | /* Avoid a race... */ | 592 | /* Avoid a race... */ |
593 | qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE; | 593 | qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE; |
594 | 594 | ||
595 | memcpy(txbuf, skb->data, len); | 595 | skb_copy_from_linear_data(skb, txbuf, len); |
596 | 596 | ||
597 | qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma; | 597 | qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma; |
598 | qep->qe_block->qe_txd[entry].tx_flags = | 598 | qep->qe_block->qe_txd[entry].tx_flags = |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 414365c3198d..38383e4e07a1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3350,7 +3350,7 @@ static int tg3_rx(struct tg3 *tp, int budget) | |||
3350 | skb_reserve(copy_skb, 2); | 3350 | skb_reserve(copy_skb, 2); |
3351 | skb_put(copy_skb, len); | 3351 | skb_put(copy_skb, len); |
3352 | pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 3352 | pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
3353 | memcpy(copy_skb->data, skb->data, len); | 3353 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
3354 | pci_dma_sync_single_for_device(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 3354 | pci_dma_sync_single_for_device(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
3355 | 3355 | ||
3356 | /* We'll reuse the original ring buffer. */ | 3356 | /* We'll reuse the original ring buffer. */ |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 2ede3f58cf97..106dc1ef0acb 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -1112,7 +1112,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
1112 | 1112 | ||
1113 | if ( bbuf ) { | 1113 | if ( bbuf ) { |
1114 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); | 1114 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); |
1115 | memcpy( tail_buffer, skb->data, skb->len ); | 1115 | skb_copy_from_linear_data(skb, tail_buffer, skb->len); |
1116 | } else { | 1116 | } else { |
1117 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE); | 1117 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE); |
1118 | TLan_StoreSKB(tail_list, skb); | 1118 | TLan_StoreSKB(tail_list, skb); |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index d293423ee8e3..e22a3f5333ef 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -937,14 +937,17 @@ static void xl_rx(struct net_device *dev) | |||
937 | copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; | 937 | copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; |
938 | frame_length -= copy_len ; | 938 | frame_length -= copy_len ; |
939 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 939 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
940 | memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, copy_len) ; | 940 | skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail], |
941 | skb_put(skb, copy_len), | ||
942 | copy_len); | ||
941 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 943 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
942 | adv_rx_ring(dev) ; | 944 | adv_rx_ring(dev) ; |
943 | } | 945 | } |
944 | 946 | ||
945 | /* Now we have found the last fragment */ | 947 | /* Now we have found the last fragment */ |
946 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 948 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
947 | memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, frame_length) ; | 949 | skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail], |
950 | skb_put(skb,copy_len), frame_length); | ||
948 | /* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */ | 951 | /* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */ |
949 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 952 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
950 | adv_rx_ring(dev) ; | 953 | adv_rx_ring(dev) ; |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index a62065808881..09b3cfb8e809 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -845,7 +845,9 @@ static void olympic_rx(struct net_device *dev) | |||
845 | pci_dma_sync_single_for_cpu(olympic_priv->pdev, | 845 | pci_dma_sync_single_for_cpu(olympic_priv->pdev, |
846 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 846 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
847 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 847 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
848 | memcpy(skb_put(skb,length-4),olympic_priv->rx_ring_skb[rx_ring_last_received]->data,length-4) ; | 848 | skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received], |
849 | skb_put(skb,length - 4), | ||
850 | length - 4); | ||
849 | pci_dma_sync_single_for_device(olympic_priv->pdev, | 851 | pci_dma_sync_single_for_device(olympic_priv->pdev, |
850 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 852 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
851 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 853 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
@@ -862,7 +864,9 @@ static void olympic_rx(struct net_device *dev) | |||
862 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 864 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
863 | rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]); | 865 | rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]); |
864 | cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); | 866 | cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); |
865 | memcpy(skb_put(skb, cpy_length), olympic_priv->rx_ring_skb[rx_ring_last_received]->data, cpy_length) ; | 867 | skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received], |
868 | skb_put(skb, cpy_length), | ||
869 | cpy_length); | ||
866 | pci_dma_sync_single_for_device(olympic_priv->pdev, | 870 | pci_dma_sync_single_for_device(olympic_priv->pdev, |
867 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 871 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
868 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 872 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index de6f72775ecc..e6f0817c3509 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -644,7 +644,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device | |||
644 | dmabuf = 0; | 644 | dmabuf = 0; |
645 | i = tp->TplFree->TPLIndex; | 645 | i = tp->TplFree->TPLIndex; |
646 | buf = tp->LocalTxBuffers[i]; | 646 | buf = tp->LocalTxBuffers[i]; |
647 | memcpy(buf, skb->data, length); | 647 | skb_copy_from_linear_data(skb, buf, length); |
648 | newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer; | 648 | newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer; |
649 | } | 649 | } |
650 | else { | 650 | else { |
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); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 288d8559f8c5..4d461595406d 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -386,8 +386,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv, | |||
386 | * - we are multicast promiscous. | 386 | * - we are multicast promiscous. |
387 | * - we belong to the multicast group. | 387 | * - we belong to the multicast group. |
388 | */ | 388 | */ |
389 | memcpy(addr, skb->data, | 389 | skb_copy_from_linear_data(skb, addr, min_t(size_t, sizeof addr, |
390 | min_t(size_t, sizeof addr, skb->len)); | 390 | skb->len)); |
391 | bit_nr = ether_crc(sizeof addr, addr) >> 26; | 391 | bit_nr = ether_crc(sizeof addr, addr) >> 26; |
392 | if ((tun->if_flags & IFF_PROMISC) || | 392 | if ((tun->if_flags & IFF_PROMISC) || |
393 | memcmp(addr, tun->dev_addr, sizeof addr) == 0 || | 393 | memcmp(addr, tun->dev_addr, sizeof addr) == 0 || |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 422eaf8ea12d..25b75b615188 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1339,7 +1339,8 @@ static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, | |||
1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) | 1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) |
1340 | skb_reserve(new_skb, 2); | 1340 | skb_reserve(new_skb, 2); |
1341 | 1341 | ||
1342 | memcpy(new_skb->data, rx_skb[0]->data, pkt_size); | 1342 | skb_copy_from_linear_data(rx_skb[0], new_skb->data, |
1343 | pkt_size); | ||
1343 | *rx_skb = new_skb; | 1344 | *rx_skb = new_skb; |
1344 | ret = 0; | 1345 | ret = 0; |
1345 | } | 1346 | } |
@@ -1927,7 +1928,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1927 | if (pktlen < ETH_ZLEN) { | 1928 | if (pktlen < ETH_ZLEN) { |
1928 | /* Cannot occur until ZC support */ | 1929 | /* Cannot occur until ZC support */ |
1929 | pktlen = ETH_ZLEN; | 1930 | pktlen = ETH_ZLEN; |
1930 | memcpy(tdinfo->buf, skb->data, skb->len); | 1931 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1931 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); | 1932 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); |
1932 | tdinfo->skb = skb; | 1933 | tdinfo->skb = skb; |
1933 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1934 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
@@ -1943,7 +1944,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1943 | int nfrags = skb_shinfo(skb)->nr_frags; | 1944 | int nfrags = skb_shinfo(skb)->nr_frags; |
1944 | tdinfo->skb = skb; | 1945 | tdinfo->skb = skb; |
1945 | if (nfrags > 6) { | 1946 | if (nfrags > 6) { |
1946 | memcpy(tdinfo->buf, skb->data, skb->len); | 1947 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1947 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1948 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
1948 | td_ptr->tdesc0.pktsize = | 1949 | td_ptr->tdesc0.pktsize = |
1949 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); | 1950 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index a576113abbd9..ae132c1c5459 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -1702,7 +1702,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/ | |||
1702 | if(!nsb) { | 1702 | if(!nsb) { |
1703 | goto give_it_anyways; | 1703 | goto give_it_anyways; |
1704 | } | 1704 | } |
1705 | memcpy(skb_put(nsb, len), skb->data, len); | 1705 | skb_copy_from_linear_data(skb, skb_put(nsb, len), len); |
1706 | 1706 | ||
1707 | nsb->protocol = lmc_proto_type(sc, skb); | 1707 | nsb->protocol = lmc_proto_type(sc, skb); |
1708 | skb_reset_mac_header(nsb); | 1708 | skb_reset_mac_header(nsb); |
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index edbc55528be5..8ba75bb17326 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -1765,7 +1765,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx) | |||
1765 | skb->data[7] = ']'; | 1765 | skb->data[7] = ']'; |
1766 | skb->data[8] = ':'; | 1766 | skb->data[8] = ':'; |
1767 | skb->data[9] = ' '; | 1767 | skb->data[9] = ' '; |
1768 | memcpy(&skb->data[10], skb_main->data, skb_main->len); | 1768 | skb_copy_from_linear_data(skb_main, &skb->data[10], skb_main->len); |
1769 | 1769 | ||
1770 | netif_rx(skb); | 1770 | netif_rx(skb); |
1771 | } | 1771 | } |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 8b4540bfc1b0..9432d2ce7745 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -1782,7 +1782,7 @@ int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb) | |||
1782 | */ | 1782 | */ |
1783 | c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used]; | 1783 | c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used]; |
1784 | c->tx_dma_used^=1; /* Flip temp buffer */ | 1784 | c->tx_dma_used^=1; /* Flip temp buffer */ |
1785 | memcpy(c->tx_next_ptr, skb->data, skb->len); | 1785 | skb_copy_from_linear_data(skb, c->tx_next_ptr, skb->len); |
1786 | } | 1786 | } |
1787 | else | 1787 | else |
1788 | c->tx_next_ptr=skb->data; | 1788 | c->tx_next_ptr=skb->data; |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 1c17cbe007ba..51a7db53afa5 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -827,14 +827,14 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
827 | if (priv->wep_is_on) | 827 | if (priv->wep_is_on) |
828 | frame_ctl |= IEEE80211_FCTL_PROTECTED; | 828 | frame_ctl |= IEEE80211_FCTL_PROTECTED; |
829 | if (priv->operating_mode == IW_MODE_ADHOC) { | 829 | if (priv->operating_mode == IW_MODE_ADHOC) { |
830 | memcpy(&header.addr1, skb->data, 6); | 830 | skb_copy_from_linear_data(skb, &header.addr1, 6); |
831 | memcpy(&header.addr2, dev->dev_addr, 6); | 831 | memcpy(&header.addr2, dev->dev_addr, 6); |
832 | memcpy(&header.addr3, priv->BSSID, 6); | 832 | memcpy(&header.addr3, priv->BSSID, 6); |
833 | } else { | 833 | } else { |
834 | frame_ctl |= IEEE80211_FCTL_TODS; | 834 | frame_ctl |= IEEE80211_FCTL_TODS; |
835 | memcpy(&header.addr1, priv->CurrentBSSID, 6); | 835 | memcpy(&header.addr1, priv->CurrentBSSID, 6); |
836 | memcpy(&header.addr2, dev->dev_addr, 6); | 836 | memcpy(&header.addr2, dev->dev_addr, 6); |
837 | memcpy(&header.addr3, skb->data, 6); | 837 | skb_copy_from_linear_data(skb, &header.addr3, 6); |
838 | } | 838 | } |
839 | 839 | ||
840 | if (priv->use_wpa) | 840 | if (priv->use_wpa) |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index 6e0dc76400e5..e3d2e61a31ee 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -998,7 +998,8 @@ static void dma_tx_fragment(struct bcm43xx_dmaring *ring, | |||
998 | assert(0); | 998 | assert(0); |
999 | return; | 999 | return; |
1000 | } | 1000 | } |
1001 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); | 1001 | skb_copy_from_linear_data(skb, skb_put(bounce_skb, skb->len), |
1002 | skb->len); | ||
1002 | dev_kfree_skb_any(skb); | 1003 | dev_kfree_skb_any(skb); |
1003 | skb = bounce_skb; | 1004 | skb = bounce_skb; |
1004 | } | 1005 | } |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 35a3a50724fe..cbedc9ee740a 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -933,12 +933,14 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
933 | if (frag == 0) { | 933 | if (frag == 0) { |
934 | /* copy first fragment (including full headers) into | 934 | /* copy first fragment (including full headers) into |
935 | * beginning of the fragment cache skb */ | 935 | * beginning of the fragment cache skb */ |
936 | memcpy(skb_put(frag_skb, flen), skb->data, flen); | 936 | skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), |
937 | flen); | ||
937 | } else { | 938 | } else { |
938 | /* append frame payload to the end of the fragment | 939 | /* append frame payload to the end of the fragment |
939 | * cache skb */ | 940 | * cache skb */ |
940 | memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, | 941 | skb_copy_from_linear_data_offset(skb, hdrlen, |
941 | flen); | 942 | skb_put(frag_skb, |
943 | flen), flen); | ||
942 | } | 944 | } |
943 | dev_kfree_skb(skb); | 945 | dev_kfree_skb(skb); |
944 | skb = NULL; | 946 | skb = NULL; |
@@ -1044,8 +1046,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
1044 | skb->len >= ETH_HLEN + ETH_ALEN) { | 1046 | skb->len >= ETH_HLEN + ETH_ALEN) { |
1045 | /* Non-standard frame: get addr4 from its bogus location after | 1047 | /* Non-standard frame: get addr4 from its bogus location after |
1046 | * the payload */ | 1048 | * the payload */ |
1047 | memcpy(skb->data + ETH_ALEN, | 1049 | skb_copy_from_linear_data_offset(skb, skb->len - ETH_ALEN, |
1048 | skb->data + skb->len - ETH_ALEN, ETH_ALEN); | 1050 | skb->data + ETH_ALEN, |
1051 | ETH_ALEN); | ||
1049 | skb_trim(skb, skb->len - ETH_ALEN); | 1052 | skb_trim(skb, skb->len - ETH_ALEN); |
1050 | } | 1053 | } |
1051 | 1054 | ||
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 159baef18e4a..246fac0e8001 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -146,7 +146,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
146 | fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS; | 146 | fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS; |
147 | /* From&To DS: Addr1 = RA, Addr2 = TA, Addr3 = DA, | 147 | /* From&To DS: Addr1 = RA, Addr2 = TA, Addr3 = DA, |
148 | * Addr4 = SA */ | 148 | * Addr4 = SA */ |
149 | memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); | 149 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, |
150 | &hdr.addr4, ETH_ALEN); | ||
150 | hdr_len += ETH_ALEN; | 151 | hdr_len += ETH_ALEN; |
151 | } else { | 152 | } else { |
152 | /* bogus 4-addr format to workaround Prism2 station | 153 | /* bogus 4-addr format to workaround Prism2 station |
@@ -159,7 +160,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
159 | /* SA from skb->data + ETH_ALEN will be added after | 160 | /* SA from skb->data + ETH_ALEN will be added after |
160 | * frame payload; use hdr.addr4 as a temporary buffer | 161 | * frame payload; use hdr.addr4 as a temporary buffer |
161 | */ | 162 | */ |
162 | memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); | 163 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, |
164 | &hdr.addr4, ETH_ALEN); | ||
163 | need_tailroom += ETH_ALEN; | 165 | need_tailroom += ETH_ALEN; |
164 | } | 166 | } |
165 | 167 | ||
@@ -174,24 +176,27 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
174 | else | 176 | else |
175 | memcpy(&hdr.addr1, local->bssid, ETH_ALEN); | 177 | memcpy(&hdr.addr1, local->bssid, ETH_ALEN); |
176 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); | 178 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); |
177 | memcpy(&hdr.addr3, skb->data, ETH_ALEN); | 179 | skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN); |
178 | } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) { | 180 | } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) { |
179 | fc |= IEEE80211_FCTL_FROMDS; | 181 | fc |= IEEE80211_FCTL_FROMDS; |
180 | /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */ | 182 | /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */ |
181 | memcpy(&hdr.addr1, skb->data, ETH_ALEN); | 183 | skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN); |
182 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); | 184 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); |
183 | memcpy(&hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); | 185 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr3, |
186 | ETH_ALEN); | ||
184 | } else if (local->iw_mode == IW_MODE_INFRA || to_assoc_ap) { | 187 | } else if (local->iw_mode == IW_MODE_INFRA || to_assoc_ap) { |
185 | fc |= IEEE80211_FCTL_TODS; | 188 | fc |= IEEE80211_FCTL_TODS; |
186 | /* To DS: Addr1 = BSSID, Addr2 = SA, Addr3 = DA */ | 189 | /* To DS: Addr1 = BSSID, Addr2 = SA, Addr3 = DA */ |
187 | memcpy(&hdr.addr1, to_assoc_ap ? | 190 | memcpy(&hdr.addr1, to_assoc_ap ? |
188 | local->assoc_ap_addr : local->bssid, ETH_ALEN); | 191 | local->assoc_ap_addr : local->bssid, ETH_ALEN); |
189 | memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); | 192 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2, |
190 | memcpy(&hdr.addr3, skb->data, ETH_ALEN); | 193 | ETH_ALEN); |
194 | skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN); | ||
191 | } else if (local->iw_mode == IW_MODE_ADHOC) { | 195 | } else if (local->iw_mode == IW_MODE_ADHOC) { |
192 | /* not From/To DS: Addr1 = DA, Addr2 = SA, Addr3 = BSSID */ | 196 | /* not From/To DS: Addr1 = DA, Addr2 = SA, Addr3 = BSSID */ |
193 | memcpy(&hdr.addr1, skb->data, ETH_ALEN); | 197 | skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN); |
194 | memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); | 198 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2, |
199 | ETH_ALEN); | ||
195 | memcpy(&hdr.addr3, local->bssid, ETH_ALEN); | 200 | memcpy(&hdr.addr3, local->bssid, ETH_ALEN); |
196 | } | 201 | } |
197 | 202 | ||
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 797d950d5d61..4ca8a27b8c55 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1277,8 +1277,8 @@ static char * ap_auth_make_challenge(struct ap_data *ap) | |||
1277 | return NULL; | 1277 | return NULL; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | memcpy(tmpbuf, skb->data + ap->crypt->extra_mpdu_prefix_len, | 1280 | skb_copy_from_linear_data_offset(skb, ap->crypt->extra_mpdu_prefix_len, |
1281 | WLAN_AUTH_CHALLENGE_LEN); | 1281 | tmpbuf, WLAN_AUTH_CHALLENGE_LEN); |
1282 | dev_kfree_skb(skb); | 1282 | dev_kfree_skb(skb); |
1283 | 1283 | ||
1284 | return tmpbuf; | 1284 | return tmpbuf; |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 9003ff7d151a..fb01fb95a9f0 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -1838,13 +1838,14 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) | |||
1838 | 1838 | ||
1839 | /* skb->data starts with txdesc->frame_control */ | 1839 | /* skb->data starts with txdesc->frame_control */ |
1840 | hdr_len = 24; | 1840 | hdr_len = 24; |
1841 | memcpy(&txdesc.frame_control, skb->data, hdr_len); | 1841 | skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len); |
1842 | fc = le16_to_cpu(txdesc.frame_control); | 1842 | fc = le16_to_cpu(txdesc.frame_control); |
1843 | if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && | 1843 | if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && |
1844 | (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && | 1844 | (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && |
1845 | skb->len >= 30) { | 1845 | skb->len >= 30) { |
1846 | /* Addr4 */ | 1846 | /* Addr4 */ |
1847 | memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN); | 1847 | skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4, |
1848 | ETH_ALEN); | ||
1848 | hdr_len += ETH_ALEN; | 1849 | hdr_len += ETH_ALEN; |
1849 | } | 1850 | } |
1850 | 1851 | ||
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index ad6e4a428355..9137a4dd02eb 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2416,8 +2416,9 @@ static void isr_rx(struct ipw2100_priv *priv, int i, | |||
2416 | #ifdef IPW2100_RX_DEBUG | 2416 | #ifdef IPW2100_RX_DEBUG |
2417 | /* Make a copy of the frame so we can dump it to the logs if | 2417 | /* Make a copy of the frame so we can dump it to the logs if |
2418 | * ieee80211_rx fails */ | 2418 | * ieee80211_rx fails */ |
2419 | memcpy(packet_data, packet->skb->data, | 2419 | skb_copy_from_linear_data(packet->skb, packet_data, |
2420 | min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); | 2420 | min_t(u32, status->frame_size, |
2421 | IPW_RX_NIC_BUFFER_LENGTH)); | ||
2421 | #endif | 2422 | #endif |
2422 | 2423 | ||
2423 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { | 2424 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index b04c56a25cc5..4839a45098cb 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -10355,7 +10355,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, | |||
10355 | 10355 | ||
10356 | rt_hdr->it_len = dst->len; | 10356 | rt_hdr->it_len = dst->len; |
10357 | 10357 | ||
10358 | memcpy(skb_put(dst, len), src->data, len); | 10358 | skb_copy_from_linear_data(src, skb_put(dst, len), len); |
10359 | 10359 | ||
10360 | if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) | 10360 | if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) |
10361 | dev_kfree_skb_any(dst); | 10361 | dev_kfree_skb_any(dst); |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 6ebfff034242..7d8bff1dbc4d 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -162,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
162 | 162 | ||
163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); | 163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); |
164 | if (init_wds) { | 164 | if (init_wds) { |
165 | memcpy(newskb->data + 6, skb->data, skb->len); | 165 | skb_copy_from_linear_data(skb, |
166 | newskb->data + 6, | ||
167 | skb->len); | ||
166 | memcpy(newskb->data, wds_mac, 6); | 168 | memcpy(newskb->data, wds_mac, 6); |
167 | #ifdef ISLPCI_ETH_DEBUG | 169 | #ifdef ISLPCI_ETH_DEBUG |
168 | printk("islpci_eth_transmit:wds_mac\n"); | 170 | printk("islpci_eth_transmit:wds_mac\n"); |
169 | #endif | 171 | #endif |
170 | } else | 172 | } else |
171 | memcpy(newskb->data, skb->data, skb->len); | 173 | skb_copy_from_linear_data(skb, newskb->data, |
174 | skb->len); | ||
172 | 175 | ||
173 | #if VERBOSE > SHOW_ERROR_MESSAGES | 176 | #if VERBOSE > SHOW_ERROR_MESSAGES |
174 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", | 177 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", |
@@ -394,8 +397,10 @@ islpci_eth_receive(islpci_private *priv) | |||
394 | /* Update spy records */ | 397 | /* Update spy records */ |
395 | wireless_spy_update(ndev, annex->addr2, &wstats); | 398 | wireless_spy_update(ndev, annex->addr2, &wstats); |
396 | 399 | ||
397 | memcpy(skb->data + sizeof (struct rfmon_header), | 400 | skb_copy_from_linear_data(skb, |
398 | skb->data, 2 * ETH_ALEN); | 401 | (skb->data + |
402 | sizeof(struct rfmon_header)), | ||
403 | 2 * ETH_ALEN); | ||
399 | skb_pull(skb, sizeof (struct rfmon_header)); | 404 | skb_pull(skb, sizeof (struct rfmon_header)); |
400 | } | 405 | } |
401 | skb->protocol = eth_type_trans(skb, ndev); | 406 | skb->protocol = eth_type_trans(skb, ndev); |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 9633b0457f8c..3be624295a1f 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -2242,7 +2242,8 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned i | |||
2242 | rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len); | 2242 | rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len); |
2243 | /* Get source address */ | 2243 | /* Get source address */ |
2244 | #ifdef WIRELESS_SPY | 2244 | #ifdef WIRELESS_SPY |
2245 | memcpy(linksrcaddr, ((struct mac_header *)skb->data)->addr_2, ETH_ALEN); | 2245 | skb_copy_from_linear_data_offset(skb, offsetof(struct mac_header, addr_2), |
2246 | linksrcaddr, ETH_ALEN); | ||
2246 | #endif | 2247 | #endif |
2247 | /* Now, deal with encapsulation/translation/sniffer */ | 2248 | /* Now, deal with encapsulation/translation/sniffer */ |
2248 | if (!sniffer) { | 2249 | if (!sniffer) { |
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index 2bf77b1ee531..1cf090d60edc 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -2938,7 +2938,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) | |||
2938 | * need to pad. Jean II */ | 2938 | * need to pad. Jean II */ |
2939 | if (skb->len < ETH_ZLEN) { | 2939 | if (skb->len < ETH_ZLEN) { |
2940 | memset(data, 0, ETH_ZLEN); | 2940 | memset(data, 0, ETH_ZLEN); |
2941 | memcpy(data, skb->data, skb->len); | 2941 | skb_copy_from_linear_data(skb, data, skb->len); |
2942 | /* Write packet on the card */ | 2942 | /* Write packet on the card */ |
2943 | if(wv_packet_write(dev, data, ETH_ZLEN)) | 2943 | if(wv_packet_write(dev, data, ETH_ZLEN)) |
2944 | return 1; /* We failed */ | 2944 | return 1; /* We failed */ |
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 1fe013a7297a..935b144d9b56 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -807,10 +807,10 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
807 | txbuf[4] = 0x00; | 807 | txbuf[4] = 0x00; |
808 | txbuf[5] = 0x00; | 808 | txbuf[5] = 0x00; |
809 | 809 | ||
810 | memcpy(txbuf+6, skb->data+12, skb->len-12); | 810 | skb_copy_from_linear_data_offset(skb, 12, txbuf + 6, skb->len - 12); |
811 | if (pad) | 811 | if (pad) |
812 | txbuf[skb->len-12+6]=0; | 812 | txbuf[skb->len-12+6]=0; |
813 | memcpy(txbuf+skb->len-12+6+pad, skb->data, 12); | 813 | skb_copy_from_linear_data(skb, txbuf + skb->len - 12 + 6 + pad, 12); |
814 | *(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6); | 814 | *(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6); |
815 | txbuf[txbuflen-1] = 0; | 815 | txbuf[txbuflen-1] = 0; |
816 | 816 | ||