pci.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __x86_PCI_H
  2. #define __x86_PCI_H
  3. #include <linux/mm.h> /* for struct page */
  4. #include <linux/types.h>
  5. #include <linux/slab.h>
  6. #include <linux/string.h>
  7. #include <asm/scatterlist.h>
  8. #include <asm/io.h>
  9. #ifdef __KERNEL__
  10. struct pci_sysdata {
  11. int domain; /* PCI domain */
  12. int node; /* NUMA node */
  13. #ifdef CONFIG_X86_64
  14. void* iommu; /* IOMMU private data */
  15. #endif
  16. };
  17. /* scan a bus after allocating a pci_sysdata for it */
  18. extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
  19. static inline int pci_domain_nr(struct pci_bus *bus)
  20. {
  21. struct pci_sysdata *sd = bus->sysdata;
  22. return sd->domain;
  23. }
  24. static inline int pci_proc_domain(struct pci_bus *bus)
  25. {
  26. return pci_domain_nr(bus);
  27. }
  28. /* Can be used to override the logic in pci_scan_bus for skipping
  29. already-configured bus numbers - to be used for buggy BIOSes
  30. or architectures with incomplete PCI setup by the loader */
  31. #ifdef CONFIG_PCI
  32. extern unsigned int pcibios_assign_all_busses(void);
  33. #else
  34. #define pcibios_assign_all_busses() 0
  35. #endif
  36. #define pcibios_scan_all_fns(a, b) 0
  37. extern unsigned long pci_mem_start;
  38. #define PCIBIOS_MIN_IO 0x1000
  39. #define PCIBIOS_MIN_MEM (pci_mem_start)
  40. #define PCIBIOS_MIN_CARDBUS_IO 0x4000
  41. void pcibios_config_init(void);
  42. struct pci_bus * pcibios_scan_root(int bus);
  43. void pcibios_set_master(struct pci_dev *dev);
  44. void pcibios_penalize_isa_irq(int irq, int active);
  45. struct irq_routing_table *pcibios_get_irq_routing_table(void);
  46. int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
  47. #define HAVE_PCI_MMAP
  48. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  49. enum pci_mmap_state mmap_state, int write_combine);
  50. #ifdef CONFIG_PCI
  51. static inline void pci_dma_burst_advice(struct pci_dev *pdev,
  52. enum pci_dma_burst_strategy *strat,
  53. unsigned long *strategy_parameter)
  54. {
  55. *strat = PCI_DMA_BURST_INFINITY;
  56. *strategy_parameter = ~0UL;
  57. }
  58. #endif
  59. #endif /* __KERNEL__ */
  60. #ifdef CONFIG_X86_32
  61. # include "pci_32.h"
  62. #else
  63. # include "pci_64.h"
  64. #endif
  65. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  66. #include <asm-generic/pci-dma-compat.h>
  67. /* generic pci stuff */
  68. #include <asm-generic/pci.h>
  69. #endif