Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28688
b: refs/heads/master
c: a74e5e5
h: refs/heads/master
v: v3
  • Loading branch information
Olof Johansson authored and Paul Mackerras committed Apr 29, 2006
1 parent de457e5 commit a1afca3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc97ce951cfb697eaac9d5b6a2fbe4544fdf1a7c
refs/heads/master: a74e5e5facb854ab4be9e0320e0f65074012df9b
20 changes: 10 additions & 10 deletions trunk/arch/powerpc/kernel/pci_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
*/
#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata))

static inline struct iommu_table *devnode_table(struct device *dev)
static inline struct iommu_table *device_to_table(struct device *hwdev)
{
struct pci_dev *pdev;

if (!dev) {
if (!hwdev) {
pdev = ppc64_isabridge_dev;
if (!pdev)
return NULL;
} else
pdev = to_pci_dev(dev);
pdev = to_pci_dev(hwdev);

return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
}
Expand Down Expand Up @@ -85,14 +85,14 @@ static inline unsigned long device_to_mask(struct device *hwdev)
static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,
return iommu_alloc_coherent(device_to_table(hwdev), size, dma_handle,
device_to_mask(hwdev), flag);
}

static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
iommu_free_coherent(devnode_table(hwdev), size, vaddr, dma_handle);
iommu_free_coherent(device_to_table(hwdev), size, vaddr, dma_handle);
}

/* Creates TCEs for a user provided buffer. The user buffer must be
Expand All @@ -104,35 +104,35 @@ static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,
size_t size, enum dma_data_direction direction)
{
return iommu_map_single(devnode_table(hwdev), vaddr, size,
return iommu_map_single(device_to_table(hwdev), vaddr, size,
device_to_mask(hwdev), direction);
}


static void pci_iommu_unmap_single(struct device *hwdev, dma_addr_t dma_handle,
size_t size, enum dma_data_direction direction)
{
iommu_unmap_single(devnode_table(hwdev), dma_handle, size, direction);
iommu_unmap_single(device_to_table(hwdev), dma_handle, size, direction);
}


static int pci_iommu_map_sg(struct device *pdev, struct scatterlist *sglist,
int nelems, enum dma_data_direction direction)
{
return iommu_map_sg(pdev, devnode_table(pdev), sglist,
return iommu_map_sg(pdev, device_to_table(pdev), sglist,
nelems, device_to_mask(pdev), direction);
}

static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
int nelems, enum dma_data_direction direction)
{
iommu_unmap_sg(devnode_table(pdev), sglist, nelems, direction);
iommu_unmap_sg(device_to_table(pdev), sglist, nelems, direction);
}

/* We support DMA to/from any memory page via the iommu */
static int pci_iommu_dma_supported(struct device *dev, u64 mask)
{
struct iommu_table *tbl = devnode_table(dev);
struct iommu_table *tbl = device_to_table(dev);

if (!tbl || tbl->it_offset > mask) {
printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n");
Expand Down

0 comments on commit a1afca3

Please sign in to comment.