aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_iommu.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2006-04-28 09:57:09 -0400
committerPaul Mackerras <paulus@samba.org>2006-04-29 04:08:01 -0400
commita74e5e5facb854ab4be9e0320e0f65074012df9b (patch)
treeae2c8b1462ca659d8b306a530a855d203a303e9f /arch/powerpc/kernel/pci_iommu.c
parentbc97ce951cfb697eaac9d5b6a2fbe4544fdf1a7c (diff)
[PATCH] powerpc iommu: minor cleanup
A couple of minor renames: * The iommu_table is no longer a part of the device node structure, so devnode_table is misleading * Rename struct device *-variables to hwdev Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_iommu.c')
-rw-r--r--arch/powerpc/kernel/pci_iommu.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c
index c1d95e14bbed..48aa82d01624 100644
--- a/arch/powerpc/kernel/pci_iommu.c
+++ b/arch/powerpc/kernel/pci_iommu.c
@@ -44,16 +44,16 @@
44 */ 44 */
45#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata)) 45#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata))
46 46
47static inline struct iommu_table *devnode_table(struct device *dev) 47static inline struct iommu_table *device_to_table(struct device *hwdev)
48{ 48{
49 struct pci_dev *pdev; 49 struct pci_dev *pdev;
50 50
51 if (!dev) { 51 if (!hwdev) {
52 pdev = ppc64_isabridge_dev; 52 pdev = ppc64_isabridge_dev;
53 if (!pdev) 53 if (!pdev)
54 return NULL; 54 return NULL;
55 } else 55 } else
56 pdev = to_pci_dev(dev); 56 pdev = to_pci_dev(hwdev);
57 57
58 return PCI_DN(PCI_GET_DN(pdev))->iommu_table; 58 return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
59} 59}
@@ -85,14 +85,14 @@ static inline unsigned long device_to_mask(struct device *hwdev)
85static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size, 85static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
86 dma_addr_t *dma_handle, gfp_t flag) 86 dma_addr_t *dma_handle, gfp_t flag)
87{ 87{
88 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle, 88 return iommu_alloc_coherent(device_to_table(hwdev), size, dma_handle,
89 device_to_mask(hwdev), flag); 89 device_to_mask(hwdev), flag);
90} 90}
91 91
92static void pci_iommu_free_coherent(struct device *hwdev, size_t size, 92static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
93 void *vaddr, dma_addr_t dma_handle) 93 void *vaddr, dma_addr_t dma_handle)
94{ 94{
95 iommu_free_coherent(devnode_table(hwdev), size, vaddr, dma_handle); 95 iommu_free_coherent(device_to_table(hwdev), size, vaddr, dma_handle);
96} 96}
97 97
98/* Creates TCEs for a user provided buffer. The user buffer must be 98/* Creates TCEs for a user provided buffer. The user buffer must be
@@ -104,7 +104,7 @@ static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
104static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr, 104static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,
105 size_t size, enum dma_data_direction direction) 105 size_t size, enum dma_data_direction direction)
106{ 106{
107 return iommu_map_single(devnode_table(hwdev), vaddr, size, 107 return iommu_map_single(device_to_table(hwdev), vaddr, size,
108 device_to_mask(hwdev), direction); 108 device_to_mask(hwdev), direction);
109} 109}
110 110
@@ -112,27 +112,27 @@ static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,
112static void pci_iommu_unmap_single(struct device *hwdev, dma_addr_t dma_handle, 112static void pci_iommu_unmap_single(struct device *hwdev, dma_addr_t dma_handle,
113 size_t size, enum dma_data_direction direction) 113 size_t size, enum dma_data_direction direction)
114{ 114{
115 iommu_unmap_single(devnode_table(hwdev), dma_handle, size, direction); 115 iommu_unmap_single(device_to_table(hwdev), dma_handle, size, direction);
116} 116}
117 117
118 118
119static int pci_iommu_map_sg(struct device *pdev, struct scatterlist *sglist, 119static int pci_iommu_map_sg(struct device *pdev, struct scatterlist *sglist,
120 int nelems, enum dma_data_direction direction) 120 int nelems, enum dma_data_direction direction)
121{ 121{
122 return iommu_map_sg(pdev, devnode_table(pdev), sglist, 122 return iommu_map_sg(pdev, device_to_table(pdev), sglist,
123 nelems, device_to_mask(pdev), direction); 123 nelems, device_to_mask(pdev), direction);
124} 124}
125 125
126static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist, 126static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
127 int nelems, enum dma_data_direction direction) 127 int nelems, enum dma_data_direction direction)
128{ 128{
129 iommu_unmap_sg(devnode_table(pdev), sglist, nelems, direction); 129 iommu_unmap_sg(device_to_table(pdev), sglist, nelems, direction);
130} 130}
131 131
132/* We support DMA to/from any memory page via the iommu */ 132/* We support DMA to/from any memory page via the iommu */
133static int pci_iommu_dma_supported(struct device *dev, u64 mask) 133static int pci_iommu_dma_supported(struct device *dev, u64 mask)
134{ 134{
135 struct iommu_table *tbl = devnode_table(dev); 135 struct iommu_table *tbl = device_to_table(dev);
136 136
137 if (!tbl || tbl->it_offset > mask) { 137 if (!tbl || tbl->it_offset > mask) {
138 printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n"); 138 printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n");