ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-mips / pci.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  */
6 #ifndef _ASM_PCI_H
7 #define _ASM_PCI_H
8
9 #include <linux/config.h>
10 #include <linux/mm.h>
11
12 #ifdef __KERNEL__
13
14 /* Can be used to override the logic in pci_scan_bus for skipping
15    already-configured bus numbers - to be used for buggy BIOSes
16    or architectures with incomplete PCI setup by the loader */
17
18 extern unsigned int pcibios_assign_all_busses(void);
19
20 #define pcibios_scan_all_fns(a, b)      0
21
22 extern unsigned long PCIBIOS_MIN_IO;
23 extern unsigned long PCIBIOS_MIN_MEM;
24
25 #define PCIBIOS_MIN_CARDBUS_IO  0x4000
26
27 extern void pcibios_set_master(struct pci_dev *dev);
28
29 static inline void pcibios_penalize_isa_irq(int irq)
30 {
31         /* We don't do dynamic PCI IRQ allocation */
32 }
33
34 /*
35  * Dynamic DMA mapping stuff.
36  * MIPS has everything mapped statically.
37  */
38
39 #include <linux/types.h>
40 #include <linux/slab.h>
41 #include <asm/scatterlist.h>
42 #include <linux/string.h>
43 #include <asm/io.h>
44
45 struct pci_dev;
46
47 /*
48  * The PCI address space does equal the physical memory address space.  The
49  * networking and block device layers use this boolean for bounce buffer
50  * decisions.  This is set if any hose does not have an IOMMU.
51  */
52 extern unsigned int PCI_DMA_BUS_IS_PHYS;
53
54 #ifdef CONFIG_MAPPED_DMA_IO
55
56 /* pci_unmap_{single,page} is not a nop, thus... */
57 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       dma_addr_t ADDR_NAME;
58 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)         __u32 LEN_NAME;
59 #define pci_unmap_addr(PTR, ADDR_NAME)          ((PTR)->ADDR_NAME)
60 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
61 #define pci_unmap_len(PTR, LEN_NAME)            ((PTR)->LEN_NAME)
62 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)   (((PTR)->LEN_NAME) = (VAL))
63
64 #else /* CONFIG_MAPPED_DMA_IO  */
65
66 /* pci_unmap_{page,single} is a nop so... */
67 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
68 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
69 #define pci_unmap_addr(PTR, ADDR_NAME)          (0)
70 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
71 #define pci_unmap_len(PTR, LEN_NAME)            (0)
72 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)   do { } while (0)
73
74 #endif /* CONFIG_MAPPED_DMA_IO  */
75
76 /* This is always fine. */
77 #define pci_dac_dma_supported(pci_dev, mask)    (1)
78
79 extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev,
80         struct page *page, unsigned long offset, int direction);
81 extern struct page *pci_dac_dma_to_page(struct pci_dev *pdev,
82         dma64_addr_t dma_addr);
83 extern unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
84         dma64_addr_t dma_addr);
85 extern void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
86         dma64_addr_t dma_addr, size_t len, int direction);
87 extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
88         dma64_addr_t dma_addr, size_t len, int direction);
89
90 #endif /* __KERNEL__ */
91
92 /* implement the pci_ DMA API in terms of the generic device dma_ one */
93 #include <asm-generic/pci-dma-compat.h>
94
95 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
96 {
97 }
98
99 #endif /* _ASM_PCI_H */