int f;
struct pci_dev *pdev = mac->dma_pdev;
- pci_unmap_single(pdev, dmas[0], skb_headlen(skb), PCI_DMA_TODEVICE);
+ dma_unmap_single(&pdev->dev, dmas[0], skb_headlen(skb), DMA_TO_DEVICE);
for (f = 0; f < nfrags; f++) {
const skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
- pci_unmap_page(pdev, dmas[f+1], skb_frag_size(frag), PCI_DMA_TODEVICE);
+ dma_unmap_page(&pdev->dev, dmas[f + 1], skb_frag_size(frag),
+ DMA_TO_DEVICE);
}
dev_kfree_skb_irq(skb);
for (i = 0; i < RX_RING_SIZE; i++) {
info = &RX_DESC_INFO(rx, i);
if (info->skb && info->dma) {
- pci_unmap_single(mac->dma_pdev,
- info->dma,
- info->skb->len,
- PCI_DMA_FROMDEVICE);
+ dma_unmap_single(&mac->dma_pdev->dev, info->dma,
+ info->skb->len, DMA_FROM_DEVICE);
dev_kfree_skb_any(info->skb);
}
info->dma = 0;
if (unlikely(!skb))
break;
- dma = pci_map_single(mac->dma_pdev, skb->data,
+ dma = dma_map_single(&mac->dma_pdev->dev, skb->data,
mac->bufsz - LOCAL_SKB_ALIGN,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
- if (unlikely(pci_dma_mapping_error(mac->dma_pdev, dma))) {
+ if (dma_mapping_error(&mac->dma_pdev->dev, dma)) {
dev_kfree_skb_irq(info->skb);
break;
}
len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
- pci_unmap_single(pdev, dma, mac->bufsz - LOCAL_SKB_ALIGN,
- PCI_DMA_FROMDEVICE);
+ dma_unmap_single(&pdev->dev, dma,
+ mac->bufsz - LOCAL_SKB_ALIGN,
+ DMA_FROM_DEVICE);
if (macrx & XCT_MACRX_CRC) {
/* CRC error flagged */
nfrags = skb_shinfo(skb)->nr_frags;
- map[0] = pci_map_single(mac->dma_pdev, skb->data, skb_headlen(skb),
- PCI_DMA_TODEVICE);
+ map[0] = dma_map_single(&mac->dma_pdev->dev, skb->data,
+ skb_headlen(skb), DMA_TO_DEVICE);
map_size[0] = skb_headlen(skb);
- if (pci_dma_mapping_error(mac->dma_pdev, map[0]))
+ if (dma_mapping_error(&mac->dma_pdev->dev, map[0]))
goto out_err_nolock;
for (i = 0; i < nfrags; i++) {
spin_unlock_irqrestore(&txring->lock, flags);
out_err_nolock:
while (nfrags--)
- pci_unmap_single(mac->dma_pdev, map[nfrags], map_size[nfrags],
- PCI_DMA_TODEVICE);
+ dma_unmap_single(&mac->dma_pdev->dev, map[nfrags],
+ map_size[nfrags], DMA_TO_DEVICE);
return NETDEV_TX_BUSY;
}