ebus_64.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * ebus.h: PCI to Ebus pseudo driver software state.
  3. *
  4. * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
  5. * Copyright (C) 1999 David S. Miller (davem@redhat.com)
  6. */
  7. #ifndef __SPARC64_EBUS_H
  8. #define __SPARC64_EBUS_H
  9. #include <linux/of_device.h>
  10. #include <asm/oplib.h>
  11. #include <asm/prom.h>
  12. struct linux_ebus_child {
  13. struct linux_ebus_child *next;
  14. struct linux_ebus_device *parent;
  15. struct linux_ebus *bus;
  16. struct device_node *prom_node;
  17. struct resource resource[PROMREG_MAX];
  18. int num_addrs;
  19. unsigned int irqs[PROMINTR_MAX];
  20. int num_irqs;
  21. };
  22. struct linux_ebus_device {
  23. struct of_device ofdev;
  24. struct linux_ebus_device *next;
  25. struct linux_ebus_child *children;
  26. struct linux_ebus *bus;
  27. struct device_node *prom_node;
  28. struct resource resource[PROMREG_MAX];
  29. int num_addrs;
  30. unsigned int irqs[PROMINTR_MAX];
  31. int num_irqs;
  32. };
  33. #define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev)
  34. struct linux_ebus {
  35. struct of_device ofdev;
  36. struct linux_ebus *next;
  37. struct linux_ebus_device *devices;
  38. struct pci_dev *self;
  39. int index;
  40. int is_rio;
  41. struct device_node *prom_node;
  42. };
  43. #define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev)
  44. extern struct linux_ebus *ebus_chain;
  45. extern void ebus_init(void);
  46. #define for_each_ebus(bus) \
  47. for((bus) = ebus_chain; (bus); (bus) = (bus)->next)
  48. #define for_each_ebusdev(dev, bus) \
  49. for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
  50. #define for_each_edevchild(dev, child) \
  51. for((child) = (dev)->children; (child); (child) = (child)->next)
  52. #endif /* !(__SPARC64_EBUS_H) */