Commit f4421b9c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: Use enum dma_data_direction for the vio DMA api routines.

From: Stephen Rothwell <sfr@canb.auug.org.au>

This patch uses enum dma_data_direction for the vio DMA api routines.
This allows us to remove some include of linux/pci.h.

Also missed some pci_dma_mapping_error uses.
parent 61d5b689
...@@ -77,7 +77,7 @@ dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, ...@@ -77,7 +77,7 @@ dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size,
return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
if (dev->bus == &vio_bus_type) if (dev->bus == &vio_bus_type)
return vio_map_single(to_vio_dev(dev), cpu_addr, size, (int)direction); return vio_map_single(to_vio_dev(dev), cpu_addr, size, direction);
#endif #endif
BUG(); BUG();
return (dma_addr_t)0; return (dma_addr_t)0;
...@@ -91,7 +91,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, ...@@ -91,7 +91,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
else if (dev->bus == &vio_bus_type) else if (dev->bus == &vio_bus_type)
vio_unmap_single(to_vio_dev(dev), dma_addr, size, (int)direction); vio_unmap_single(to_vio_dev(dev), dma_addr, size, direction);
#endif #endif
else else
BUG(); BUG();
...@@ -106,7 +106,7 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page, ...@@ -106,7 +106,7 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
if (dev->bus == &vio_bus_type) if (dev->bus == &vio_bus_type)
return vio_map_page(to_vio_dev(dev), page, offset, size, (int)direction); return vio_map_page(to_vio_dev(dev), page, offset, size, direction);
#endif #endif
BUG(); BUG();
return (dma_addr_t)0; return (dma_addr_t)0;
...@@ -120,7 +120,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, ...@@ -120,7 +120,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
else if (dev->bus == &vio_bus_type) else if (dev->bus == &vio_bus_type)
vio_unmap_page(to_vio_dev(dev), dma_address, size, (int)direction); vio_unmap_page(to_vio_dev(dev), dma_address, size, direction);
#endif #endif
else else
BUG(); BUG();
...@@ -134,7 +134,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, ...@@ -134,7 +134,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
if (dev->bus == &vio_bus_type) if (dev->bus == &vio_bus_type)
return vio_map_sg(to_vio_dev(dev), sg, nents, (int)direction); return vio_map_sg(to_vio_dev(dev), sg, nents, direction);
#endif #endif
BUG(); BUG();
return 0; return 0;
...@@ -148,7 +148,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, ...@@ -148,7 +148,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
else if (dev->bus == &vio_bus_type) else if (dev->bus == &vio_bus_type)
vio_unmap_sg(to_vio_dev(dev), sg, nhwentries, (int)direction); vio_unmap_sg(to_vio_dev(dev), sg, nhwentries, direction);
#endif #endif
else else
BUG(); BUG();
...@@ -162,7 +162,7 @@ void dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, ...@@ -162,7 +162,7 @@ void dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
pci_dma_sync_single(to_pci_dev(dev), dma_handle, size, (int)direction); pci_dma_sync_single(to_pci_dev(dev), dma_handle, size, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
else if (dev->bus == &vio_bus_type) else if (dev->bus == &vio_bus_type)
vio_dma_sync_single(to_vio_dev(dev), dma_handle, size, (int)direction); vio_dma_sync_single(to_vio_dev(dev), dma_handle, size, direction);
#endif #endif
else else
BUG(); BUG();
...@@ -176,7 +176,7 @@ void dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, ...@@ -176,7 +176,7 @@ void dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
pci_dma_sync_sg(to_pci_dev(dev), sg, nelems, (int)direction); pci_dma_sync_sg(to_pci_dev(dev), sg, nelems, (int)direction);
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
else if (dev->bus == &vio_bus_type) else if (dev->bus == &vio_bus_type)
vio_dma_sync_sg(to_vio_dev(dev), sg, nelems, (int)direction); vio_dma_sync_sg(to_vio_dev(dev), sg, nelems, direction);
#endif #endif
else else
BUG(); BUG();
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/pci.h>
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kobject.h> #include <linux/kobject.h>
...@@ -416,14 +415,14 @@ EXPORT_SYMBOL(vio_disable_interrupts); ...@@ -416,14 +415,14 @@ EXPORT_SYMBOL(vio_disable_interrupts);
dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
size_t size, int direction ) size_t size, enum dma_data_direction direction)
{ {
struct iommu_table *tbl; struct iommu_table *tbl;
dma_addr_t dma_handle = DMA_ERROR_CODE; dma_addr_t dma_handle = DMA_ERROR_CODE;
unsigned long uaddr; unsigned long uaddr;
unsigned int npages; unsigned int npages;
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
uaddr = (unsigned long)vaddr; uaddr = (unsigned long)vaddr;
npages = PAGE_ALIGN( uaddr + size ) - ( uaddr & PAGE_MASK ); npages = PAGE_ALIGN( uaddr + size ) - ( uaddr & PAGE_MASK );
...@@ -432,7 +431,7 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, ...@@ -432,7 +431,7 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
tbl = dev->iommu_table; tbl = dev->iommu_table;
if (tbl) { if (tbl) {
dma_handle = iommu_alloc(tbl, vaddr, npages, direction); dma_handle = iommu_alloc(tbl, vaddr, npages, (int)direction);
dma_handle |= (uaddr & ~PAGE_MASK); dma_handle |= (uaddr & ~PAGE_MASK);
} }
...@@ -441,12 +440,12 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, ...@@ -441,12 +440,12 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
EXPORT_SYMBOL(vio_map_single); EXPORT_SYMBOL(vio_map_single);
void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle, void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle,
size_t size, int direction) size_t size, enum dma_data_direction direction)
{ {
struct iommu_table * tbl; struct iommu_table * tbl;
unsigned int npages; unsigned int npages;
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
npages = PAGE_ALIGN( dma_handle + size ) - ( dma_handle & PAGE_MASK ); npages = PAGE_ALIGN( dma_handle + size ) - ( dma_handle & PAGE_MASK );
npages >>= PAGE_SHIFT; npages >>= PAGE_SHIFT;
...@@ -458,11 +457,11 @@ void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle, ...@@ -458,11 +457,11 @@ void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle,
EXPORT_SYMBOL(vio_unmap_single); EXPORT_SYMBOL(vio_unmap_single);
int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems, int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems,
int direction) enum dma_data_direction direction)
{ {
struct iommu_table *tbl; struct iommu_table *tbl;
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
if (nelems == 0) if (nelems == 0)
return 0; return 0;
...@@ -471,16 +470,16 @@ int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems, ...@@ -471,16 +470,16 @@ int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems,
if (!tbl) if (!tbl)
return 0; return 0;
return iommu_alloc_sg(tbl, &vdev->dev, sglist, nelems, direction); return iommu_alloc_sg(tbl, &vdev->dev, sglist, nelems, (int)direction);
} }
EXPORT_SYMBOL(vio_map_sg); EXPORT_SYMBOL(vio_map_sg);
void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems, void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist, int nelems,
int direction) enum dma_data_direction direction)
{ {
struct iommu_table *tbl; struct iommu_table *tbl;
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
tbl = vdev->iommu_table; tbl = vdev->iommu_table;
if (tbl) if (tbl)
...@@ -516,7 +515,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size, ...@@ -516,7 +515,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
/* Page allocation succeeded */ /* Page allocation succeeded */
memset(ret, 0, npages << PAGE_SHIFT); memset(ret, 0, npages << PAGE_SHIFT);
/* Set up tces to cover the allocated range */ /* Set up tces to cover the allocated range */
tce = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL); tce = iommu_alloc(tbl, ret, npages, (int)DMA_BIDIRECTIONAL);
if (tce == DMA_ERROR_CODE) { if (tce == DMA_ERROR_CODE) {
PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: iommu_alloc failed\n" ); PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: iommu_alloc failed\n" );
free_pages((unsigned long)ret, order); free_pages((unsigned long)ret, order);
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -218,7 +217,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc ...@@ -218,7 +217,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
ibmveth_assert(index != 0xffff); ibmveth_assert(index != 0xffff);
ibmveth_assert(pool->skbuff[index] == NULL); ibmveth_assert(pool->skbuff[index] == NULL);
dma_addr = vio_map_single(adapter->vdev, skb->data, pool->buff_size, PCI_DMA_FROMDEVICE); dma_addr = vio_map_single(adapter->vdev, skb->data, pool->buff_size, DMA_FROM_DEVICE);
pool->dma_addr[index] = dma_addr; pool->dma_addr[index] = dma_addr;
pool->skbuff[index] = skb; pool->skbuff[index] = skb;
...@@ -236,7 +235,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc ...@@ -236,7 +235,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
if(lpar_rc != H_Success) { if(lpar_rc != H_Success) {
pool->skbuff[index] = NULL; pool->skbuff[index] = NULL;
pool->consumer_index--; pool->consumer_index--;
vio_unmap_single(adapter->vdev, pool->dma_addr[index], pool->buff_size, PCI_DMA_FROMDEVICE); vio_unmap_single(adapter->vdev, pool->dma_addr[index], pool->buff_size, DMA_FROM_DEVICE);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
adapter->replenish_add_buff_failure++; adapter->replenish_add_buff_failure++;
break; break;
...@@ -300,7 +299,7 @@ static void ibmveth_free_buffer_pool(struct ibmveth_adapter *adapter, struct ibm ...@@ -300,7 +299,7 @@ static void ibmveth_free_buffer_pool(struct ibmveth_adapter *adapter, struct ibm
vio_unmap_single(adapter->vdev, vio_unmap_single(adapter->vdev,
pool->dma_addr[i], pool->dma_addr[i],
pool->buff_size, pool->buff_size,
PCI_DMA_FROMDEVICE); DMA_FROM_DEVICE);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
pool->skbuff[i] = NULL; pool->skbuff[i] = NULL;
} }
...@@ -338,7 +337,7 @@ static void ibmveth_remove_buffer_from_pool(struct ibmveth_adapter *adapter, u64 ...@@ -338,7 +337,7 @@ static void ibmveth_remove_buffer_from_pool(struct ibmveth_adapter *adapter, u64
vio_unmap_single(adapter->vdev, vio_unmap_single(adapter->vdev,
adapter->rx_buff_pool[pool].dma_addr[index], adapter->rx_buff_pool[pool].dma_addr[index],
adapter->rx_buff_pool[pool].buff_size, adapter->rx_buff_pool[pool].buff_size,
PCI_DMA_FROMDEVICE); DMA_FROM_DEVICE);
free_index = adapter->rx_buff_pool[pool].producer_index++ % adapter->rx_buff_pool[pool].size; free_index = adapter->rx_buff_pool[pool].producer_index++ % adapter->rx_buff_pool[pool].size;
adapter->rx_buff_pool[pool].free_map[free_index] = index; adapter->rx_buff_pool[pool].free_map[free_index] = index;
...@@ -406,7 +405,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) ...@@ -406,7 +405,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
{ {
if(adapter->buffer_list_addr != NULL) { if(adapter->buffer_list_addr != NULL) {
if(!vio_dma_mapping_error(adapter->buffer_list_dma)) { if(!vio_dma_mapping_error(adapter->buffer_list_dma)) {
vio_unmap_single(adapter->vdev, adapter->buffer_list_dma, 4096, PCI_DMA_BIDIRECTIONAL); vio_unmap_single(adapter->vdev, adapter->buffer_list_dma, 4096, DMA_BIDIRECTIONAL);
adapter->buffer_list_dma = DMA_ERROR_CODE; adapter->buffer_list_dma = DMA_ERROR_CODE;
} }
free_page((unsigned long)adapter->buffer_list_addr); free_page((unsigned long)adapter->buffer_list_addr);
...@@ -415,7 +414,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) ...@@ -415,7 +414,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
if(adapter->filter_list_addr != NULL) { if(adapter->filter_list_addr != NULL) {
if(!vio_dma_mapping_error(adapter->filter_list_dma)) { if(!vio_dma_mapping_error(adapter->filter_list_dma)) {
vio_unmap_single(adapter->vdev, adapter->filter_list_dma, 4096, PCI_DMA_BIDIRECTIONAL); vio_unmap_single(adapter->vdev, adapter->filter_list_dma, 4096, DMA_BIDIRECTIONAL);
adapter->filter_list_dma = DMA_ERROR_CODE; adapter->filter_list_dma = DMA_ERROR_CODE;
} }
free_page((unsigned long)adapter->filter_list_addr); free_page((unsigned long)adapter->filter_list_addr);
...@@ -424,7 +423,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) ...@@ -424,7 +423,7 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
if(adapter->rx_queue.queue_addr != NULL) { if(adapter->rx_queue.queue_addr != NULL) {
if(!vio_dma_mapping_error(adapter->rx_queue.queue_dma)) { if(!vio_dma_mapping_error(adapter->rx_queue.queue_dma)) {
vio_unmap_single(adapter->vdev, adapter->rx_queue.queue_dma, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL); vio_unmap_single(adapter->vdev, adapter->rx_queue.queue_dma, adapter->rx_queue.queue_len, DMA_BIDIRECTIONAL);
adapter->rx_queue.queue_dma = DMA_ERROR_CODE; adapter->rx_queue.queue_dma = DMA_ERROR_CODE;
} }
kfree(adapter->rx_queue.queue_addr); kfree(adapter->rx_queue.queue_addr);
...@@ -470,9 +469,9 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -470,9 +469,9 @@ static int ibmveth_open(struct net_device *netdev)
return -ENOMEM; return -ENOMEM;
} }
adapter->buffer_list_dma = vio_map_single(adapter->vdev, adapter->buffer_list_addr, 4096, PCI_DMA_BIDIRECTIONAL); adapter->buffer_list_dma = vio_map_single(adapter->vdev, adapter->buffer_list_addr, 4096, DMA_BIDIRECTIONAL);
adapter->filter_list_dma = vio_map_single(adapter->vdev, adapter->filter_list_addr, 4096, PCI_DMA_BIDIRECTIONAL); adapter->filter_list_dma = vio_map_single(adapter->vdev, adapter->filter_list_addr, 4096, DMA_BIDIRECTIONAL);
adapter->rx_queue.queue_dma = vio_map_single(adapter->vdev, adapter->rx_queue.queue_addr, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL); adapter->rx_queue.queue_dma = vio_map_single(adapter->vdev, adapter->rx_queue.queue_addr, adapter->rx_queue.queue_len, DMA_BIDIRECTIONAL);
if((vio_dma_mapping_error(adapter->buffer_list_dma) ) || if((vio_dma_mapping_error(adapter->buffer_list_dma) ) ||
(vio_dma_mapping_error(adapter->filter_list_dma)) || (vio_dma_mapping_error(adapter->filter_list_dma)) ||
...@@ -673,7 +672,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -673,7 +672,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
vio_unmap_single(adapter->vdev, vio_unmap_single(adapter->vdev,
desc[curfrag+1].fields.address, desc[curfrag+1].fields.address,
desc[curfrag+1].fields.length, desc[curfrag+1].fields.length,
PCI_DMA_TODEVICE); DMA_TO_DEVICE);
curfrag++; curfrag++;
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -710,7 +709,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -710,7 +709,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
} }
do { do {
vio_unmap_single(adapter->vdev, desc[nfrags].fields.address, desc[nfrags].fields.length, PCI_DMA_TODEVICE); vio_unmap_single(adapter->vdev, desc[nfrags].fields.address, desc[nfrags].fields.length, DMA_TO_DEVICE);
} while(--nfrags >= 0); } while(--nfrags >= 0);
dev_kfree_skb(skb); dev_kfree_skb(skb);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <asm/hvcall.h> #include <asm/hvcall.h>
#include <asm/prom.h> #include <asm/prom.h>
...@@ -58,13 +57,13 @@ int vio_enable_interrupts(struct vio_dev *dev); ...@@ -58,13 +57,13 @@ int vio_enable_interrupts(struct vio_dev *dev);
int vio_disable_interrupts(struct vio_dev *dev); int vio_disable_interrupts(struct vio_dev *dev);
dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
size_t size, int direction); size_t size, enum dma_data_direction direction);
void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle, void vio_unmap_single(struct vio_dev *dev, dma_addr_t dma_handle,
size_t size, int direction); size_t size, enum dma_data_direction direction);
int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist, int vio_map_sg(struct vio_dev *vdev, struct scatterlist *sglist,
int nelems, int direction); int nelems, enum dma_data_direction direction);
void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist, void vio_unmap_sg(struct vio_dev *vdev, struct scatterlist *sglist,
int nelems, int direction); int nelems, enum dma_data_direction direction);
void *vio_alloc_consistent(struct vio_dev *dev, size_t size, void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
dma_addr_t *dma_handle); dma_addr_t *dma_handle);
void vio_free_consistent(struct vio_dev *dev, size_t size, void *vaddr, void vio_free_consistent(struct vio_dev *dev, size_t size, void *vaddr,
...@@ -81,18 +80,18 @@ static inline int vio_dma_supported(struct vio_dev *hwdev, u64 mask) ...@@ -81,18 +80,18 @@ static inline int vio_dma_supported(struct vio_dev *hwdev, u64 mask)
static inline void vio_dma_sync_single(struct vio_dev *hwdev, static inline void vio_dma_sync_single(struct vio_dev *hwdev,
dma_addr_t dma_handle, dma_addr_t dma_handle, size_t size,
size_t size, int direction) enum dma_data_direction direction)
{ {
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
/* nothing to do */ /* nothing to do */
} }
static inline void vio_dma_sync_sg(struct vio_dev *hwdev, static inline void vio_dma_sync_sg(struct vio_dev *hwdev,
struct scatterlist *sg, struct scatterlist *sg, int nelems,
int nelems, int direction) enum dma_data_direction direction)
{ {
BUG_ON(direction == PCI_DMA_NONE); BUG_ON(direction == DMA_NONE);
/* nothing to do */ /* nothing to do */
} }
static inline int vio_set_dma_mask(struct vio_dev *dev, u64 mask) { return -EIO; } static inline int vio_set_dma_mask(struct vio_dev *dev, u64 mask) { return -EIO; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment