Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* $Id: isa.h,v 1.1 2001/05/11 04:31:55 davem Exp $ |
| 2 | * isa.h: Sparc64 layer for PCI to ISA bridge devices. |
| 3 | * |
| 4 | * Copyright (C) 2001 David S. Miller (davem@redhat.com) |
| 5 | */ |
| 6 | |
| 7 | #ifndef __SPARC64_ISA_H |
| 8 | #define __SPARC64_ISA_H |
| 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm/oplib.h> |
David S. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 11 | #include <asm/prom.h> |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 12 | #include <asm/of_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
| 14 | struct sparc_isa_bridge; |
| 15 | |
| 16 | struct sparc_isa_device { |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 17 | struct of_device ofdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | struct sparc_isa_device *next; |
| 19 | struct sparc_isa_device *child; |
| 20 | struct sparc_isa_bridge *bus; |
David S. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 21 | struct device_node *prom_node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | struct resource resource; |
| 23 | unsigned int irq; |
| 24 | }; |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 25 | #define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | struct sparc_isa_bridge { |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 28 | struct of_device ofdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | struct sparc_isa_bridge *next; |
| 30 | struct sparc_isa_device *devices; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | struct pci_dev *self; |
| 32 | int index; |
David S. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 33 | struct device_node *prom_node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | }; |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 35 | #define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | extern struct sparc_isa_bridge *isa_chain; |
| 38 | |
| 39 | extern void isa_init(void); |
| 40 | |
| 41 | #define for_each_isa(bus) \ |
| 42 | for((bus) = isa_chain; (bus); (bus) = (bus)->next) |
| 43 | |
| 44 | #define for_each_isadev(dev, bus) \ |
| 45 | for((dev) = (bus)->devices; (dev); (dev) = (dev)->next) |
| 46 | |
| 47 | #endif /* !(__SPARC64_ISA_H) */ |