diff options
Diffstat (limited to 'drivers/atm/idt77252.c')
-rw-r--r-- | drivers/atm/idt77252.c | 28 |
1 files changed, 17 insertions, 11 deletions
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 | ||
1889 | outunmap: | 1892 | outunmap: |
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); |