pci.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * linux/include/asm-generic/pci.h
  3. *
  4. * Copyright (C) 2003 Russell King
  5. */
  6. #ifndef _ASM_GENERIC_PCI_H
  7. #define _ASM_GENERIC_PCI_H
  8. /**
  9. * pcibios_resource_to_bus - convert resource to PCI bus address
  10. * @dev: device which owns this resource
  11. * @region: converted bus-centric region (start,end)
  12. * @res: resource to convert
  13. *
  14. * Convert a resource to a PCI device bus address or bus window.
  15. */
  16. static inline void
  17. pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
  18. struct resource *res)
  19. {
  20. region->start = res->start;
  21. region->end = res->end;
  22. }
  23. static inline void
  24. pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
  25. struct pci_bus_region *region)
  26. {
  27. res->start = region->start;
  28. res->end = region->end;
  29. }
  30. static inline struct resource *
  31. pcibios_select_root(struct pci_dev *pdev, struct resource *res)
  32. {
  33. struct resource *root = NULL;
  34. if (res->flags & IORESOURCE_IO)
  35. root = &ioport_resource;
  36. if (res->flags & IORESOURCE_MEM)
  37. root = &iomem_resource;
  38. return root;
  39. }
  40. #define pcibios_scan_all_fns(a, b) 0
  41. #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
  42. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  43. {
  44. return channel ? 15 : 14;
  45. }
  46. #endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */
  47. #endif