1 #ifndef __PPC_PCI_H
2 #define __PPC_PCI_H
3 #ifdef __KERNEL__
4
5 /* Values for the `which' argument to sys_pciconfig_iobase syscall. */
6 #define IOBASE_BRIDGE_NUMBER 0
7 #define IOBASE_MEMORY 1
8 #define IOBASE_IO 2
9
10
11 /* Can be used to override the logic in pci_scan_bus for skipping
12 * already-configured bus numbers - to be used for buggy BIOSes
13 * or architectures with incomplete PCI setup by the loader.
14 */
15 #define pcibios_assign_all_busses() 0
16
17 #define PCIBIOS_MIN_IO 0x1000
18 #define PCIBIOS_MIN_MEM 0x10000000
19
20 extern inline void pcibios_set_master(struct pci_dev *dev)
21 {
22 /* No special bus mastering setup handling */
23 }
24
25 extern inline void pcibios_penalize_isa_irq(int irq)
26 {
27 /* We don't do dynamic PCI IRQ allocation */
28 }
29
30 /* Dynamic DMA Mapping stuff
31 * ++ajoshi
32 */
33
34 #include <linux/types.h>
35 #include <linux/slab.h>
36 #include <linux/string.h>
37 #include <asm/scatterlist.h>
38 #include <asm/io.h>
39
40 struct pci_dev;
41
42 extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
43 dma_addr_t *dma_handle);
44 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
45 void *vaddr, dma_addr_t dma_handle);
46 extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
47 size_t size, int direction)
48 {
49 if (direction == PCI_DMA_NONE)
50 BUG();
51 return virt_to_bus(ptr);
52 }
53 extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
54 size_t size, int direction)
55 {
56 if (direction == PCI_DMA_NONE)
57 BUG();
58 /* nothing to do */
59 }
60 extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
61 int nents, int direction)
62 {
63 if (direction == PCI_DMA_NONE)
64 BUG();
65 return nents;
66 }
67 extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
68 int nents, int direction)
69 {
70 if (direction == PCI_DMA_NONE)
71 BUG();
72 /* nothing to do */
73 }
74 extern inline void pci_dma_sync_single(struct pci_dev *hwdev,
75 dma_addr_t dma_handle,
76 size_t size, int direction)
77 {
78 if (direction == PCI_DMA_NONE)
79 BUG();
80 /* nothing to do */
81 }
82
83 extern inline void pci_dma_sync_sg(struct pci_dev *hwdev,
84 struct scatterlist *sg,
85 int nelems, int direction)
86 {
87 if (direction == PCI_DMA_NONE)
88 BUG();
89 /* nothing to do */
90 }
91
92 /* Return whether the given PCI device DMA address mask can
93 * be supported properly. For example, if your device can
94 * only drive the low 24-bits during PCI bus mastering, then
95 * you would pass 0x00ffffff as the mask to this function.
96 */
97 extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
98 {
99 return 1;
100 }
101
102 #define sg_dma_address(sg) (virt_to_bus((sg)->address))
103 #define sg_dma_len(sg) ((sg)->length)
104
105 #endif /* __KERNEL__ */
106
107 #endif /* __PPC_PCI_H */
108
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.