make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / include / asm-ia64 / pci.h
1 #ifndef _ASM_IA64_PCI_H
2 #define _ASM_IA64_PCI_H
3
4 #include <linux/slab.h>
5 #include <linux/string.h>
6 #include <linux/types.h>
7 #include <linux/spinlock.h>
8
9 #include <asm/io.h>
10 #include <asm/scatterlist.h>
11
12 /*
13  * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
14  * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
15  * loader.
16  */
17 #define pcibios_assign_all_busses()     0
18
19 #define PCIBIOS_MIN_IO          0x1000
20 #define PCIBIOS_MIN_MEM         0x10000000
21
22 void pcibios_config_init(void);
23 struct pci_bus *pcibios_scan_root(void *acpi_handle, int segment, int bus);
24 extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
25 extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
26
27 struct pci_dev;
28
29 /*
30  * The PCI address space does equal the physical memory address space.
31  * The networking and block device layers use this boolean for bounce
32  * buffer decisions.
33  */
34 #define PCI_DMA_BUS_IS_PHYS     (1)
35
36 static inline void
37 pcibios_set_master (struct pci_dev *dev)
38 {
39         /* No special bus mastering setup handling */
40 }
41
42 static inline void
43 pcibios_penalize_isa_irq (int irq)
44 {
45         /* We don't do dynamic PCI IRQ allocation */
46 }
47
48 /*
49  * Dynamic DMA mapping API.  See Documentation/DMA-mapping.txt for details.
50  */
51 #define pci_alloc_consistent            platform_pci_alloc_consistent
52 #define pci_free_consistent             platform_pci_free_consistent
53 #define pci_map_single                  platform_pci_map_single
54 #define pci_unmap_single                platform_pci_unmap_single
55 #define pci_map_sg                      platform_pci_map_sg
56 #define pci_unmap_sg                    platform_pci_unmap_sg
57 #define pci_dma_sync_single             platform_pci_dma_sync_single
58 #define pci_dma_sync_sg                 platform_pci_dma_sync_sg
59 #define pci_dma_supported               platform_pci_dma_supported
60
61 /* pci_unmap_{single,page} is not a nop, thus... */
62 #define DECLARE_PCI_UNMAP_ADDR(addr_name)       dma_addr_t addr_name;
63 #define DECLARE_PCI_UNMAP_LEN(len_name)         __u32 len_name;
64 #define pci_unmap_addr(ptr, addr_name)          ((ptr)->addr_name)
65 #define pci_unmap_addr_set(ptr, addr_name, val) (((ptr)->addr_name) = (val))
66 #define pci_unmap_len(ptr, len_name)            ((ptr)->len_name)
67 #define pci_unmap_len_set(ptr, len_name, val)   (((ptr)->len_name) = (val))
68
69 #define pci_map_page(dev,pg,off,size,dir)                               \
70         pci_map_single((dev), page_address(pg) + (off), (size), (dir))
71 #define pci_unmap_page(dev,dma_addr,size,dir)                           \
72         pci_unmap_single((dev), (dma_addr), (size), (dir))
73
74 /* The ia64 platform always supports 64-bit addressing. */
75 #define pci_dac_dma_supported(pci_dev, mask)    (1)
76
77 #define pci_dac_page_to_dma(dev,pg,off,dir)     ((dma_addr_t) page_to_bus(pg) + (off))
78 #define pci_dac_dma_to_page(dev,dma_addr)       (virt_to_page(bus_to_virt(dma_addr)))
79 #define pci_dac_dma_to_offset(dev,dma_addr)     ((dma_addr) & ~PAGE_MASK)
80 #define pci_dac_dma_sync_single(dev,dma_addr,len,dir)   do { /* nothing */ } while (0)
81
82 /* Return the index of the PCI controller for device PDEV. */
83 #define pci_controller_num(PDEV)        (0)
84
85 #define sg_dma_address(sg)      ((sg)->dma_address)
86 #define sg_dma_len(sg)          ((sg)->dma_length)
87
88 #define HAVE_PCI_MMAP
89 extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
90                                 enum pci_mmap_state mmap_state, int write_combine);
91
92 struct pci_controller {
93         void *acpi_handle;
94         void *iommu;
95         int segment;
96
97         u64 mem_offset;
98
99         void *platform_data;
100 };
101
102 #define PCI_CONTROLLER(dev) ((struct pci_controller *) dev->sysdata)
103 #define PCI_SEGMENT(dev)    (PCI_CONTROLLER(dev)->segment)
104
105 #endif /* _ASM_IA64_PCI_H */