[SCSI] remove scsi_wait_req
[linux-2.6.22.y-op.git] / include / asm-sh / pci.h
blob0a523c85b11cf855fd42da11ddc00bf1984ef0da
1 #ifndef __ASM_SH_PCI_H
2 #define __ASM_SH_PCI_H
4 #ifdef __KERNEL__
6 #include <linux/dma-mapping.h>
8 /* Can be used to override the logic in pci_scan_bus for skipping
9 already-configured bus numbers - to be used for buggy BIOSes
10 or architectures with incomplete PCI setup by the loader */
12 #define pcibios_assign_all_busses() 1
13 #define pcibios_scan_all_fns(a, b) 0
16 * A board can define one or more PCI channels that represent built-in (or
17 * external) PCI controllers.
19 struct pci_channel {
20 struct pci_ops *pci_ops;
21 struct resource *io_resource;
22 struct resource *mem_resource;
23 int first_devfn;
24 int last_devfn;
28 * Each board initializes this array and terminates it with a NULL entry.
30 extern struct pci_channel board_pci_channels[];
32 #define PCIBIOS_MIN_IO board_pci_channels->io_resource->start
33 #define PCIBIOS_MIN_MEM board_pci_channels->mem_resource->start
35 struct pci_dev;
37 extern void pcibios_set_master(struct pci_dev *dev);
39 static inline void pcibios_penalize_isa_irq(int irq, int active)
41 /* We don't do dynamic PCI IRQ allocation */
44 /* Dynamic DMA mapping stuff.
45 * SuperH has everything mapped statically like x86.
48 /* The PCI address space does equal the physical memory
49 * address space. The networking and block device layers use
50 * this boolean for bounce buffer decisions.
52 #define PCI_DMA_BUS_IS_PHYS (1)
54 #include <linux/types.h>
55 #include <linux/slab.h>
56 #include <asm/scatterlist.h>
57 #include <linux/string.h>
58 #include <asm/io.h>
60 /* pci_unmap_{single,page} being a nop depends upon the
61 * configuration.
63 #ifdef CONFIG_SH_PCIDMA_NONCOHERENT
64 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
65 dma_addr_t ADDR_NAME;
66 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
67 __u32 LEN_NAME;
68 #define pci_unmap_addr(PTR, ADDR_NAME) \
69 ((PTR)->ADDR_NAME)
70 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
71 (((PTR)->ADDR_NAME) = (VAL))
72 #define pci_unmap_len(PTR, LEN_NAME) \
73 ((PTR)->LEN_NAME)
74 #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
75 (((PTR)->LEN_NAME) = (VAL))
76 #else
77 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
78 #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
79 #define pci_unmap_addr(PTR, ADDR_NAME) (0)
80 #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
81 #define pci_unmap_len(PTR, LEN_NAME) (0)
82 #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
83 #endif
85 /* Not supporting more than 32-bit PCI bus addresses now, but
86 * must satisfy references to this function. Change if needed.
88 #define pci_dac_dma_supported(pci_dev, mask) (0)
90 /* These macros should be used after a pci_map_sg call has been done
91 * to get bus addresses of each of the SG entries and their lengths.
92 * You should only work with the number of sg entries pci_map_sg
93 * returns, or alternatively stop on the first sg_dma_len(sg) which
94 * is 0.
96 #define sg_dma_address(sg) (virt_to_bus((sg)->dma_address))
97 #define sg_dma_len(sg) ((sg)->length)
99 #ifdef CONFIG_PCI
100 static inline void pci_dma_burst_advice(struct pci_dev *pdev,
101 enum pci_dma_burst_strategy *strat,
102 unsigned long *strategy_parameter)
104 *strat = PCI_DMA_BURST_INFINITY;
105 *strategy_parameter = ~0UL;
107 #endif
109 /* Board-specific fixup routines. */
110 extern void pcibios_fixup(void);
111 extern void pcibios_fixup_irqs(void);
113 #ifdef CONFIG_PCI_AUTO
114 extern int pciauto_assign_resources(int busno, struct pci_channel *hose);
115 #endif
117 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
121 #endif /* __KERNEL__ */
123 /* generic pci stuff */
124 #include <asm-generic/pci.h>
126 /* generic DMA-mapping stuff */
127 #include <asm-generic/pci-dma-compat.h>
129 #endif /* __ASM_SH_PCI_H */