aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
commit15c54033964a943de7b0763efd3bd0ede7326395 (patch)
tree840b292612d1b5396d5bab5bde537a9013db3ceb /drivers/atm
parentad5da3cf39a5b11a198929be1f2644e17ecd767e (diff)
parent912a41a4ab935ce8c4308428ec13fc7f8b1f18f4 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (448 commits) [IPV4] nl_fib_lookup: Initialise res.r before fib_res_put(&res) [IPV6]: Fix thinko in ipv6_rthdr_rcv() changes. [IPV4]: Add multipath cached to feature-removal-schedule.txt [WIRELESS] cfg80211: Clarify locking comment. [WIRELESS] cfg80211: Fix locking in wiphy_new. [WEXT] net_device: Don't include wext bits if not required. [WEXT]: Misc code cleanups. [WEXT]: Reduce inline abuse. [WEXT]: Move EXPORT_SYMBOL statements where they belong. [WEXT]: Cleanup early ioctl call path. [WEXT]: Remove options. [WEXT]: Remove dead debug code. [WEXT]: Clean up how wext is called. [WEXT]: Move to net/wireless [AFS]: Eliminate cmpxchg() usage in vlocation code. [RXRPC]: Fix pointers passed to bitops. [RXRPC]: Remove bogus atomic_* overrides. [AFS]: Fix u64 printing in debug logging. [AFS]: Add "directory write" support. [AFS]: Implement the CB.InitCallBackState3 operation. ...
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/ambassador.c2
-rw-r--r--drivers/atm/atmtcp.c6
-rw-r--r--drivers/atm/eni.c4
-rw-r--r--drivers/atm/eni.h2
-rw-r--r--drivers/atm/fore200e.c20
-rw-r--r--drivers/atm/fore200e.h2
-rw-r--r--drivers/atm/he.c4
-rw-r--r--drivers/atm/idt77252.c28
-rw-r--r--drivers/atm/nicstar.c14
9 files changed, 44 insertions, 38 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 3c372e08f77d..59651abfa4f8 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -821,7 +821,7 @@ static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
821 } 821 }
822 // cast needed as there is no %? for pointer differences 822 // cast needed as there is no %? for pointer differences
823 PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li", 823 PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li",
824 skb, skb->head, (long) (skb->end - skb->head)); 824 skb, skb->head, (long) (skb_end_pointer(skb) - skb->head));
825 rx.handle = virt_to_bus (skb); 825 rx.handle = virt_to_bus (skb);
826 rx.host_address = cpu_to_be32 (virt_to_bus (skb->data)); 826 rx.host_address = cpu_to_be32 (virt_to_bus (skb->data));
827 if (rx_give (dev, &rx, pool)) 827 if (rx_give (dev, &rx, pool))
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
index fc518d85543d..02ad83d6b562 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
221 hdr->vpi = htons(vcc->vpi); 221 hdr->vpi = htons(vcc->vpi);
222 hdr->vci = htons(vcc->vci); 222 hdr->vci = htons(vcc->vci);
223 hdr->length = htonl(skb->len); 223 hdr->length = htonl(skb->len);
224 memcpy(skb_put(new_skb,skb->len),skb->data,skb->len); 224 skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
225 if (vcc->pop) vcc->pop(vcc,skb); 225 if (vcc->pop) vcc->pop(vcc,skb);
226 else dev_kfree_skb(skb); 226 else dev_kfree_skb(skb);
227 out_vcc->push(out_vcc,new_skb); 227 out_vcc->push(out_vcc,new_skb);
@@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
310 goto done; 310 goto done;
311 } 311 }
312 __net_timestamp(new_skb); 312 __net_timestamp(new_skb);
313 memcpy(skb_put(new_skb,skb->len),skb->data,skb->len); 313 skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
314 out_vcc->push(out_vcc,new_skb); 314 out_vcc->push(out_vcc,new_skb);
315 atomic_inc(&vcc->stats->tx); 315 atomic_inc(&vcc->stats->tx);
316 atomic_inc(&out_vcc->stats->rx); 316 atomic_inc(&out_vcc->stats->rx);
@@ -352,7 +352,7 @@ static struct atm_dev atmtcp_control_dev = {
352 .ops = &atmtcp_c_dev_ops, 352 .ops = &atmtcp_c_dev_ops,
353 .type = "atmtcp", 353 .type = "atmtcp",
354 .number = 999, 354 .number = 999,
355 .lock = SPIN_LOCK_UNLOCKED 355 .lock = __SPIN_LOCK_UNLOCKED(atmtcp_control_dev.lock)
356}; 356};
357 357
358 358
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 8fccf018f165..0d3a38b1cb0b 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -536,7 +536,7 @@ static int rx_aal0(struct atm_vcc *vcc)
536 return 0; 536 return 0;
537 } 537 }
538 skb_put(skb,length); 538 skb_put(skb,length);
539 skb_set_timestamp(skb, &eni_vcc->timestamp); 539 skb->tstamp = eni_vcc->timestamp;
540 DPRINTK("got len %ld\n",length); 540 DPRINTK("got len %ld\n",length);
541 if (do_rx_dma(vcc,skb,1,length >> 2,length >> 2)) return 1; 541 if (do_rx_dma(vcc,skb,1,length >> 2,length >> 2)) return 1;
542 eni_vcc->rxing++; 542 eni_vcc->rxing++;
@@ -701,7 +701,7 @@ static void get_service(struct atm_dev *dev)
701 DPRINTK("Grr, servicing VCC %ld twice\n",vci); 701 DPRINTK("Grr, servicing VCC %ld twice\n",vci);
702 continue; 702 continue;
703 } 703 }
704 do_gettimeofday(&ENI_VCC(vcc)->timestamp); 704 ENI_VCC(vcc)->timestamp = ktime_get_real();
705 ENI_VCC(vcc)->next = NULL; 705 ENI_VCC(vcc)->next = NULL;
706 if (vcc->qos.rxtp.traffic_class == ATM_CBR) { 706 if (vcc->qos.rxtp.traffic_class == ATM_CBR) {
707 if (eni_dev->fast) 707 if (eni_dev->fast)
diff --git a/drivers/atm/eni.h b/drivers/atm/eni.h
index 385090c2a580..d04fefb0841f 100644
--- a/drivers/atm/eni.h
+++ b/drivers/atm/eni.h
@@ -59,7 +59,7 @@ struct eni_vcc {
59 int rxing; /* number of pending PDUs */ 59 int rxing; /* number of pending PDUs */
60 int servicing; /* number of waiting VCs (0 or 1) */ 60 int servicing; /* number of waiting VCs (0 or 1) */
61 int txing; /* number of pending TX bytes */ 61 int txing; /* number of pending TX bytes */
62 struct timeval timestamp; /* for RX timing */ 62 ktime_t timestamp; /* for RX timing */
63 struct atm_vcc *next; /* next pending RX */ 63 struct atm_vcc *next; /* next pending RX */
64 struct sk_buff *last; /* last PDU being DMAed (used to carry 64 struct sk_buff *last; /* last PDU being DMAed (used to carry
65 discard information) */ 65 discard information) */
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index a7c0ed3107e3..405ee5e09221 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -1,6 +1,4 @@
1/* 1/*
2 $Id: fore200e.c,v 1.5 2000/04/14 10:10:34 davem Exp $
3
4 A FORE Systems 200E-series driver for ATM on Linux. 2 A FORE Systems 200E-series driver for ATM on Linux.
5 Christophe Lizzi (lizzi@cnam.fr), October 1999-March 2003. 3 Christophe Lizzi (lizzi@cnam.fr), October 1999-March 2003.
6 4
@@ -1502,9 +1500,9 @@ fore200e_open(struct atm_vcc *vcc)
1502 /* pseudo-CBR bandwidth requested? */ 1500 /* pseudo-CBR bandwidth requested? */
1503 if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) { 1501 if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
1504 1502
1505 down(&fore200e->rate_sf); 1503 mutex_lock(&fore200e->rate_mtx);
1506 if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) { 1504 if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) {
1507 up(&fore200e->rate_sf); 1505 mutex_unlock(&fore200e->rate_mtx);
1508 1506
1509 kfree(fore200e_vcc); 1507 kfree(fore200e_vcc);
1510 vc_map->vcc = NULL; 1508 vc_map->vcc = NULL;
@@ -1513,7 +1511,7 @@ fore200e_open(struct atm_vcc *vcc)
1513 1511
1514 /* reserve bandwidth */ 1512 /* reserve bandwidth */
1515 fore200e->available_cell_rate -= vcc->qos.txtp.max_pcr; 1513 fore200e->available_cell_rate -= vcc->qos.txtp.max_pcr;
1516 up(&fore200e->rate_sf); 1514 mutex_unlock(&fore200e->rate_mtx);
1517 } 1515 }
1518 1516
1519 vcc->itf = vcc->dev->number; 1517 vcc->itf = vcc->dev->number;
@@ -1599,9 +1597,9 @@ fore200e_close(struct atm_vcc* vcc)
1599 /* release reserved bandwidth, if any */ 1597 /* release reserved bandwidth, if any */
1600 if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) { 1598 if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
1601 1599
1602 down(&fore200e->rate_sf); 1600 mutex_lock(&fore200e->rate_mtx);
1603 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; 1601 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
1604 up(&fore200e->rate_sf); 1602 mutex_unlock(&fore200e->rate_mtx);
1605 1603
1606 clear_bit(ATM_VF_HASQOS, &vcc->flags); 1604 clear_bit(ATM_VF_HASQOS, &vcc->flags);
1607 } 1605 }
@@ -2064,16 +2062,16 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags)
2064 2062
2065 if ((qos->txtp.traffic_class == ATM_CBR) && (qos->txtp.max_pcr > 0)) { 2063 if ((qos->txtp.traffic_class == ATM_CBR) && (qos->txtp.max_pcr > 0)) {
2066 2064
2067 down(&fore200e->rate_sf); 2065 mutex_lock(&fore200e->rate_mtx);
2068 if (fore200e->available_cell_rate + vcc->qos.txtp.max_pcr < qos->txtp.max_pcr) { 2066 if (fore200e->available_cell_rate + vcc->qos.txtp.max_pcr < qos->txtp.max_pcr) {
2069 up(&fore200e->rate_sf); 2067 mutex_unlock(&fore200e->rate_mtx);
2070 return -EAGAIN; 2068 return -EAGAIN;
2071 } 2069 }
2072 2070
2073 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; 2071 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
2074 fore200e->available_cell_rate -= qos->txtp.max_pcr; 2072 fore200e->available_cell_rate -= qos->txtp.max_pcr;
2075 2073
2076 up(&fore200e->rate_sf); 2074 mutex_unlock(&fore200e->rate_mtx);
2077 2075
2078 memcpy(&vcc->qos, qos, sizeof(struct atm_qos)); 2076 memcpy(&vcc->qos, qos, sizeof(struct atm_qos));
2079 2077
@@ -2459,7 +2457,7 @@ fore200e_initialize(struct fore200e* fore200e)
2459 2457
2460 DPRINTK(2, "device %s being initialized\n", fore200e->name); 2458 DPRINTK(2, "device %s being initialized\n", fore200e->name);
2461 2459
2462 init_MUTEX(&fore200e->rate_sf); 2460 mutex_init(&fore200e->rate_mtx);
2463 spin_lock_init(&fore200e->q_lock); 2461 spin_lock_init(&fore200e->q_lock);
2464 2462
2465 cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET; 2463 cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET;
diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
index f9abfdac33e4..b85a54613dea 100644
--- a/drivers/atm/fore200e.h
+++ b/drivers/atm/fore200e.h
@@ -869,7 +869,7 @@ typedef struct fore200e {
869 869
870 struct stats* stats; /* last snapshot of the stats */ 870 struct stats* stats; /* last snapshot of the stats */
871 871
872 struct semaphore rate_sf; /* protects rate reservation ops */ 872 struct mutex rate_mtx; /* protects rate reservation ops */
873 spinlock_t q_lock; /* protects queue ops */ 873 spinlock_t q_lock; /* protects queue ops */
874#ifdef FORE200E_USE_TASKLET 874#ifdef FORE200E_USE_TASKLET
875 struct tasklet_struct tx_tasklet; /* performs tx interrupt work */ 875 struct tasklet_struct tx_tasklet; /* performs tx interrupt work */
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 8510026b690a..d33aba6864c2 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1901,13 +1901,13 @@ he_service_rbrq(struct he_dev *he_dev, int group)
1901 case ATM_AAL0: 1901 case ATM_AAL0:
1902 /* 2.10.1.5 raw cell receive */ 1902 /* 2.10.1.5 raw cell receive */
1903 skb->len = ATM_AAL0_SDU; 1903 skb->len = ATM_AAL0_SDU;
1904 skb->tail = skb->data + skb->len; 1904 skb_set_tail_pointer(skb, skb->len);
1905 break; 1905 break;
1906 case ATM_AAL5: 1906 case ATM_AAL5:
1907 /* 2.10.1.2 aal5 receive */ 1907 /* 2.10.1.2 aal5 receive */
1908 1908
1909 skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len); 1909 skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len);
1910 skb->tail = skb->data + skb->len; 1910 skb_set_tail_pointer(skb, skb->len);
1911#ifdef USE_CHECKSUM_HW 1911#ifdef USE_CHECKSUM_HW
1912 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) { 1912 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
1913 skb->ip_summed = CHECKSUM_COMPLETE; 1913 skb->ip_summed = CHECKSUM_COMPLETE;
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b4b80140c398..057efbc55d38 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -1065,7 +1065,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1065 vcc = vc->rx_vcc; 1065 vcc = vc->rx_vcc;
1066 1066
1067 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb), 1067 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb),
1068 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1068 skb_end_pointer(skb) - skb->data,
1069 PCI_DMA_FROMDEVICE);
1069 1070
1070 if ((vcc->qos.aal == ATM_AAL0) || 1071 if ((vcc->qos.aal == ATM_AAL0) ||
1071 (vcc->qos.aal == ATM_AAL34)) { 1072 (vcc->qos.aal == ATM_AAL34)) {
@@ -1194,7 +1195,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1194 } 1195 }
1195 1196
1196 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1197 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
1197 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1198 skb_end_pointer(skb) - skb->data,
1199 PCI_DMA_FROMDEVICE);
1198 sb_pool_remove(card, skb); 1200 sb_pool_remove(card, skb);
1199 1201
1200 skb_trim(skb, len); 1202 skb_trim(skb, len);
@@ -1267,7 +1269,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
1267 tail = readl(SAR_REG_RAWCT); 1269 tail = readl(SAR_REG_RAWCT);
1268 1270
1269 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue), 1271 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue),
1270 queue->end - queue->head - 16, 1272 skb_end_pointer(queue) - queue->head - 16,
1271 PCI_DMA_FROMDEVICE); 1273 PCI_DMA_FROMDEVICE);
1272 1274
1273 while (head != tail) { 1275 while (head != tail) {
@@ -1363,7 +1365,8 @@ drop:
1363 queue = card->raw_cell_head; 1365 queue = card->raw_cell_head;
1364 pci_dma_sync_single_for_cpu(card->pcidev, 1366 pci_dma_sync_single_for_cpu(card->pcidev,
1365 IDT77252_PRV_PADDR(queue), 1367 IDT77252_PRV_PADDR(queue),
1366 queue->end - queue->data, 1368 (skb_end_pointer(queue) -
1369 queue->data),
1367 PCI_DMA_FROMDEVICE); 1370 PCI_DMA_FROMDEVICE);
1368 } else { 1371 } else {
1369 card->raw_cell_head = NULL; 1372 card->raw_cell_head = NULL;
@@ -1816,7 +1819,8 @@ push_rx_skb(struct idt77252_dev *card, struct sk_buff *skb, int queue)
1816 u32 handle; 1819 u32 handle;
1817 u32 addr; 1820 u32 addr;
1818 1821
1819 skb->data = skb->tail = skb->head; 1822 skb->data = skb->head;
1823 skb_reset_tail_pointer(skb);
1820 skb->len = 0; 1824 skb->len = 0;
1821 1825
1822 skb_reserve(skb, 16); 1826 skb_reserve(skb, 16);
@@ -1835,7 +1839,6 @@ push_rx_skb(struct idt77252_dev *card, struct sk_buff *skb, int queue)
1835 skb_put(skb, SAR_FB_SIZE_3); 1839 skb_put(skb, SAR_FB_SIZE_3);
1836 break; 1840 break;
1837 default: 1841 default:
1838 dev_kfree_skb(skb);
1839 return -1; 1842 return -1;
1840 } 1843 }
1841 1844
@@ -1874,7 +1877,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1874 } 1877 }
1875 1878
1876 paddr = pci_map_single(card->pcidev, skb->data, 1879 paddr = pci_map_single(card->pcidev, skb->data,
1877 skb->end - skb->data, 1880 skb_end_pointer(skb) - skb->data,
1878 PCI_DMA_FROMDEVICE); 1881 PCI_DMA_FROMDEVICE);
1879 IDT77252_PRV_PADDR(skb) = paddr; 1882 IDT77252_PRV_PADDR(skb) = paddr;
1880 1883
@@ -1888,7 +1891,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1888 1891
1889outunmap: 1892outunmap:
1890 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1893 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
1891 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1894 skb_end_pointer(skb) - skb->data, PCI_DMA_FROMDEVICE);
1892 1895
1893 handle = IDT77252_PRV_POOL(skb); 1896 handle = IDT77252_PRV_POOL(skb);
1894 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL; 1897 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
@@ -1905,12 +1908,14 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb)
1905 int err; 1908 int err;
1906 1909
1907 pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb), 1910 pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb),
1908 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1911 skb_end_pointer(skb) - skb->data,
1912 PCI_DMA_FROMDEVICE);
1909 1913
1910 err = push_rx_skb(card, skb, POOL_QUEUE(handle)); 1914 err = push_rx_skb(card, skb, POOL_QUEUE(handle));
1911 if (err) { 1915 if (err) {
1912 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1916 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
1913 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1917 skb_end_pointer(skb) - skb->data,
1918 PCI_DMA_FROMDEVICE);
1914 sb_pool_remove(card, skb); 1919 sb_pool_remove(card, skb);
1915 dev_kfree_skb(skb); 1920 dev_kfree_skb(skb);
1916 } 1921 }
@@ -3122,7 +3127,8 @@ deinit_card(struct idt77252_dev *card)
3122 if (skb) { 3127 if (skb) {
3123 pci_unmap_single(card->pcidev, 3128 pci_unmap_single(card->pcidev,
3124 IDT77252_PRV_PADDR(skb), 3129 IDT77252_PRV_PADDR(skb),
3125 skb->end - skb->data, 3130 (skb_end_pointer(skb) -
3131 skb->data),
3126 PCI_DMA_FROMDEVICE); 3132 PCI_DMA_FROMDEVICE);
3127 card->sbpool[i].skb[j] = NULL; 3133 card->sbpool[i].skb[j] = NULL;
3128 dev_kfree_skb(skb); 3134 dev_kfree_skb(skb);
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index aab9b3733d52..14ced85b3f54 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -2208,7 +2208,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2208 if (i == 1 && ns_rsqe_eopdu(rsqe)) 2208 if (i == 1 && ns_rsqe_eopdu(rsqe))
2209 *((u32 *) sb->data) |= 0x00000002; 2209 *((u32 *) sb->data) |= 0x00000002;
2210 skb_put(sb, NS_AAL0_HEADER); 2210 skb_put(sb, NS_AAL0_HEADER);
2211 memcpy(sb->tail, cell, ATM_CELL_PAYLOAD); 2211 memcpy(skb_tail_pointer(sb), cell, ATM_CELL_PAYLOAD);
2212 skb_put(sb, ATM_CELL_PAYLOAD); 2212 skb_put(sb, ATM_CELL_PAYLOAD);
2213 ATM_SKB(sb)->vcc = vcc; 2213 ATM_SKB(sb)->vcc = vcc;
2214 __net_timestamp(sb); 2214 __net_timestamp(sb);
@@ -2252,7 +2252,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2252 vc->rx_iov = iovb; 2252 vc->rx_iov = iovb;
2253 NS_SKB(iovb)->iovcnt = 0; 2253 NS_SKB(iovb)->iovcnt = 0;
2254 iovb->len = 0; 2254 iovb->len = 0;
2255 iovb->tail = iovb->data = iovb->head; 2255 iovb->data = iovb->head;
2256 skb_reset_tail_pointer(iovb);
2256 NS_SKB(iovb)->vcc = vcc; 2257 NS_SKB(iovb)->vcc = vcc;
2257 /* IMPORTANT: a pointer to the sk_buff containing the small or large 2258 /* IMPORTANT: a pointer to the sk_buff containing the small or large
2258 buffer is stored as iovec base, NOT a pointer to the 2259 buffer is stored as iovec base, NOT a pointer to the
@@ -2265,7 +2266,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2265 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS); 2266 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS);
2266 NS_SKB(iovb)->iovcnt = 0; 2267 NS_SKB(iovb)->iovcnt = 0;
2267 iovb->len = 0; 2268 iovb->len = 0;
2268 iovb->tail = iovb->data = iovb->head; 2269 iovb->data = iovb->head;
2270 skb_reset_tail_pointer(iovb);
2269 NS_SKB(iovb)->vcc = vcc; 2271 NS_SKB(iovb)->vcc = vcc;
2270 } 2272 }
2271 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++]; 2273 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++];
@@ -2393,7 +2395,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2393 skb->destructor = ns_lb_destructor; 2395 skb->destructor = ns_lb_destructor;
2394#endif /* NS_USE_DESTRUCTORS */ 2396#endif /* NS_USE_DESTRUCTORS */
2395 skb_push(skb, NS_SMBUFSIZE); 2397 skb_push(skb, NS_SMBUFSIZE);
2396 memcpy(skb->data, sb->data, NS_SMBUFSIZE); 2398 skb_copy_from_linear_data(sb, skb->data, NS_SMBUFSIZE);
2397 skb_put(skb, len - NS_SMBUFSIZE); 2399 skb_put(skb, len - NS_SMBUFSIZE);
2398 ATM_SKB(skb)->vcc = vcc; 2400 ATM_SKB(skb)->vcc = vcc;
2399 __net_timestamp(skb); 2401 __net_timestamp(skb);
@@ -2477,7 +2479,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2477 { 2479 {
2478 /* Copy the small buffer to the huge buffer */ 2480 /* Copy the small buffer to the huge buffer */
2479 sb = (struct sk_buff *) iov->iov_base; 2481 sb = (struct sk_buff *) iov->iov_base;
2480 memcpy(hb->data, sb->data, iov->iov_len); 2482 skb_copy_from_linear_data(sb, hb->data, iov->iov_len);
2481 skb_put(hb, iov->iov_len); 2483 skb_put(hb, iov->iov_len);
2482 remaining = len - iov->iov_len; 2484 remaining = len - iov->iov_len;
2483 iov++; 2485 iov++;
@@ -2489,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2489 { 2491 {
2490 lb = (struct sk_buff *) iov->iov_base; 2492 lb = (struct sk_buff *) iov->iov_base;
2491 tocopy = min_t(int, remaining, iov->iov_len); 2493 tocopy = min_t(int, remaining, iov->iov_len);
2492 memcpy(hb->tail, lb->data, tocopy); 2494 skb_copy_from_linear_data(lb, skb_tail_pointer(hb), tocopy);
2493 skb_put(hb, tocopy); 2495 skb_put(hb, tocopy);
2494 iov++; 2496 iov++;
2495 remaining -= tocopy; 2497 remaining -= tocopy;