sparc: Move EBUS DMA interfaces into seperate header file.
[linux-2.6/x86.git] / arch / sparc / include / asm / ebus_64.h
blobcd102b8e28d372fedd90c481a5234a0392d46700
1 /*
2 * ebus.h: PCI to Ebus pseudo driver software state.
4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
6 */
8 #ifndef __SPARC64_EBUS_H
9 #define __SPARC64_EBUS_H
11 #include <linux/of_device.h>
13 #include <asm/oplib.h>
14 #include <asm/prom.h>
16 struct linux_ebus_child {
17 struct linux_ebus_child *next;
18 struct linux_ebus_device *parent;
19 struct linux_ebus *bus;
20 struct device_node *prom_node;
21 struct resource resource[PROMREG_MAX];
22 int num_addrs;
23 unsigned int irqs[PROMINTR_MAX];
24 int num_irqs;
27 struct linux_ebus_device {
28 struct of_device ofdev;
29 struct linux_ebus_device *next;
30 struct linux_ebus_child *children;
31 struct linux_ebus *bus;
32 struct device_node *prom_node;
33 struct resource resource[PROMREG_MAX];
34 int num_addrs;
35 unsigned int irqs[PROMINTR_MAX];
36 int num_irqs;
38 #define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev)
40 struct linux_ebus {
41 struct of_device ofdev;
42 struct linux_ebus *next;
43 struct linux_ebus_device *devices;
44 struct pci_dev *self;
45 int index;
46 int is_rio;
47 struct device_node *prom_node;
49 #define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev)
51 extern struct linux_ebus *ebus_chain;
53 extern void ebus_init(void);
55 #define for_each_ebus(bus) \
56 for((bus) = ebus_chain; (bus); (bus) = (bus)->next)
58 #define for_each_ebusdev(dev, bus) \
59 for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
61 #define for_each_edevchild(dev, child) \
62 for((child) = (dev)->children; (child); (child) = (child)->next)
64 #endif /* !(__SPARC64_EBUS_H) */