pci.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef __i386_PCI_H
  2. #define __i386_PCI_H
  3. #include <linux/config.h>
  4. #ifdef __KERNEL__
  5. #include <linux/mm.h> /* for struct page */
  6. /* Can be used to override the logic in pci_scan_bus for skipping
  7. already-configured bus numbers - to be used for buggy BIOSes
  8. or architectures with incomplete PCI setup by the loader */
  9. #ifdef CONFIG_PCI
  10. extern unsigned int pcibios_assign_all_busses(void);
  11. #else
  12. #define pcibios_assign_all_busses() 0
  13. #endif
  14. #define pcibios_scan_all_fns(a, b) 0
  15. extern unsigned long pci_mem_start;
  16. #define PCIBIOS_MIN_IO 0x1000
  17. #define PCIBIOS_MIN_MEM (pci_mem_start)
  18. #define PCIBIOS_MIN_CARDBUS_IO 0x4000
  19. void pcibios_config_init(void);
  20. struct pci_bus * pcibios_scan_root(int bus);
  21. void pcibios_set_master(struct pci_dev *dev);
  22. void pcibios_penalize_isa_irq(int irq, int active);
  23. struct irq_routing_table *pcibios_get_irq_routing_table(void);
  24. int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
  25. /* Dynamic DMA mapping stuff.
  26. * i386 has everything mapped statically.
  27. */
  28. #include <linux/types.h>
  29. #include <linux/slab.h>
  30. #include <asm/scatterlist.h>
  31. #include <linux/string.h>
  32. #include <asm/io.h>
  33. struct pci_dev;
  34. /* The PCI address space does equal the physical memory
  35. * address space. The networking and block device layers use
  36. * this boolean for bounce buffer decisions.
  37. */
  38. #define PCI_DMA_BUS_IS_PHYS (1)
  39. /* pci_unmap_{page,single} is a nop so... */
  40. #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
  41. #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
  42. #define pci_unmap_addr(PTR, ADDR_NAME) (0)
  43. #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
  44. #define pci_unmap_len(PTR, LEN_NAME) (0)
  45. #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
  46. /* This is always fine. */
  47. #define pci_dac_dma_supported(pci_dev, mask) (1)
  48. static inline dma64_addr_t
  49. pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
  50. {
  51. return ((dma64_addr_t) page_to_phys(page) +
  52. (dma64_addr_t) offset);
  53. }
  54. static inline struct page *
  55. pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
  56. {
  57. return pfn_to_page(dma_addr >> PAGE_SHIFT);
  58. }
  59. static inline unsigned long
  60. pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
  61. {
  62. return (dma_addr & ~PAGE_MASK);
  63. }
  64. static inline void
  65. pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
  66. {
  67. }
  68. static inline void
  69. pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
  70. {
  71. flush_write_buffers();
  72. }
  73. #define HAVE_PCI_MMAP
  74. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  75. enum pci_mmap_state mmap_state, int write_combine);
  76. static inline void pcibios_add_platform_entries(struct pci_dev *dev)
  77. {
  78. }
  79. #ifdef CONFIG_PCI
  80. static inline void pci_dma_burst_advice(struct pci_dev *pdev,
  81. enum pci_dma_burst_strategy *strat,
  82. unsigned long *strategy_parameter)
  83. {
  84. *strat = PCI_DMA_BURST_INFINITY;
  85. *strategy_parameter = ~0UL;
  86. }
  87. #endif
  88. #endif /* __KERNEL__ */
  89. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  90. #include <asm-generic/pci-dma-compat.h>
  91. /* generic pci stuff */
  92. #include <asm-generic/pci.h>
  93. #endif /* __i386_PCI_H */