aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/ambassador.c2
-rw-r--r--drivers/atm/idt77252.c24
2 files changed, 16 insertions, 10 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/idt77252.c b/drivers/atm/idt77252.c
index 1e49799cd6cf..20f2a3a82656 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;
@@ -1875,7 +1878,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1875 } 1878 }
1876 1879
1877 paddr = pci_map_single(card->pcidev, skb->data, 1880 paddr = pci_map_single(card->pcidev, skb->data,
1878 skb->end - skb->data, 1881 skb_end_pointer(skb) - skb->data,
1879 PCI_DMA_FROMDEVICE); 1882 PCI_DMA_FROMDEVICE);
1880 IDT77252_PRV_PADDR(skb) = paddr; 1883 IDT77252_PRV_PADDR(skb) = paddr;
1881 1884
@@ -1889,7 +1892,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1889 1892
1890outunmap: 1893outunmap:
1891 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1894 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
1892 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1895 skb_end_pointer(skb) - skb->data, PCI_DMA_FROMDEVICE);
1893 1896
1894 handle = IDT77252_PRV_POOL(skb); 1897 handle = IDT77252_PRV_POOL(skb);
1895 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL; 1898 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
@@ -1906,12 +1909,14 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb)
1906 int err; 1909 int err;
1907 1910
1908 pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb), 1911 pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb),
1909 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1912 skb_end_pointer(skb) - skb->data,
1913 PCI_DMA_FROMDEVICE);
1910 1914
1911 err = push_rx_skb(card, skb, POOL_QUEUE(handle)); 1915 err = push_rx_skb(card, skb, POOL_QUEUE(handle));
1912 if (err) { 1916 if (err) {
1913 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1917 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
1914 skb->end - skb->data, PCI_DMA_FROMDEVICE); 1918 skb_end_pointer(skb) - skb->data,
1919 PCI_DMA_FROMDEVICE);
1915 sb_pool_remove(card, skb); 1920 sb_pool_remove(card, skb);
1916 dev_kfree_skb(skb); 1921 dev_kfree_skb(skb);
1917 } 1922 }
@@ -3123,7 +3128,8 @@ deinit_card(struct idt77252_dev *card)
3123 if (skb) { 3128 if (skb) {
3124 pci_unmap_single(card->pcidev, 3129 pci_unmap_single(card->pcidev,
3125 IDT77252_PRV_PADDR(skb), 3130 IDT77252_PRV_PADDR(skb),
3126 skb->end - skb->data, 3131 (skb_end_pointer(skb) -
3132 skb->data),
3127 PCI_DMA_FROMDEVICE); 3133 PCI_DMA_FROMDEVICE);
3128 card->sbpool[i].skb[j] = NULL; 3134 card->sbpool[i].skb[j] = NULL;
3129 dev_kfree_skb(skb); 3135 dev_kfree_skb(skb);