pci-bridge.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version
  5. * 2 of the License, or (at your option) any later version.
  6. */
  7. #ifndef _ASM_GENERIC_PCI_BRIDGE_H
  8. #define _ASM_GENERIC_PCI_BRIDGE_H
  9. #ifdef __KERNEL__
  10. enum {
  11. /* Force re-assigning all resources (ignore firmware
  12. * setup completely)
  13. */
  14. PCI_REASSIGN_ALL_RSRC = 0x00000001,
  15. /* Re-assign all bus numbers */
  16. PCI_REASSIGN_ALL_BUS = 0x00000002,
  17. /* Do not try to assign, just use existing setup */
  18. PCI_PROBE_ONLY = 0x00000004,
  19. /* Don't bother with ISA alignment unless the bridge has
  20. * ISA forwarding enabled
  21. */
  22. PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
  23. /* Enable domain numbers in /proc */
  24. PCI_ENABLE_PROC_DOMAINS = 0x00000010,
  25. /* ... except for domain 0 */
  26. PCI_COMPAT_DOMAIN_0 = 0x00000020,
  27. /* PCIe downstream ports are bridges that normally lead to only a
  28. * device 0, but if this is set, we scan all possible devices, not
  29. * just device 0.
  30. */
  31. PCI_SCAN_ALL_PCIE_DEVS = 0x00000040,
  32. };
  33. #ifdef CONFIG_PCI
  34. extern unsigned int pci_flags;
  35. static inline void pci_set_flags(int flags)
  36. {
  37. pci_flags = flags;
  38. }
  39. static inline void pci_add_flags(int flags)
  40. {
  41. pci_flags |= flags;
  42. }
  43. static inline void pci_clear_flags(int flags)
  44. {
  45. pci_flags &= ~flags;
  46. }
  47. static inline int pci_has_flag(int flag)
  48. {
  49. return pci_flags & flag;
  50. }
  51. #else
  52. static inline void pci_set_flags(int flags) { }
  53. static inline void pci_add_flags(int flags) { }
  54. static inline void pci_clear_flags(int flags) { }
  55. static inline int pci_has_flag(int flag)
  56. {
  57. return 0;
  58. }
  59. #endif /* CONFIG_PCI */
  60. #endif /* __KERNEL__ */
  61. #endif /* _ASM_GENERIC_PCI_BRIDGE_H */