Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 1 | #ifndef DEVICE_PATH_H |
| 2 | #define DEVICE_PATH_H |
| 3 | |
| 4 | enum device_path_type { |
| 5 | DEVICE_PATH_NONE = 0, |
Eric Biederman | 83b991a | 2003-10-11 06:20:25 +0000 | [diff] [blame] | 6 | DEVICE_PATH_ROOT, |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 7 | DEVICE_PATH_PCI, |
| 8 | DEVICE_PATH_PNP, |
| 9 | DEVICE_PATH_I2C, |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 10 | DEVICE_PATH_APIC, |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 11 | DEVICE_PATH_PCI_DOMAIN, |
Eric Biederman | 7003ba4 | 2004-10-16 06:20:29 +0000 | [diff] [blame] | 12 | DEVICE_PATH_APIC_CLUSTER, |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 13 | DEVICE_PATH_CPU, |
| 14 | DEVICE_PATH_CPU_BUS, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 15 | DEVICE_PATH_IOAPIC, |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 16 | }; |
| 17 | |
| 18 | struct pci_domain_path |
| 19 | { |
| 20 | unsigned domain; |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | struct pci_path |
| 24 | { |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 25 | unsigned devfn; |
| 26 | }; |
| 27 | |
| 28 | struct pnp_path |
| 29 | { |
| 30 | unsigned port; |
| 31 | unsigned device; |
| 32 | }; |
| 33 | |
| 34 | struct i2c_path |
| 35 | { |
| 36 | unsigned device; |
| 37 | }; |
| 38 | |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 39 | struct apic_path |
| 40 | { |
| 41 | unsigned apic_id; |
Stefan Reinauer | f622d59 | 2005-11-26 16:56:05 +0000 | [diff] [blame] | 42 | unsigned node_id; |
| 43 | unsigned core_id; |
Sven Schnelle | 042c146 | 2012-06-17 10:32:55 +0200 | [diff] [blame] | 44 | unsigned index; |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 47 | struct ioapic_path |
| 48 | { |
| 49 | unsigned ioapic_id; |
| 50 | }; |
| 51 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 52 | struct apic_cluster_path |
| 53 | { |
| 54 | unsigned cluster; |
| 55 | }; |
| 56 | |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 57 | struct cpu_path |
| 58 | { |
| 59 | unsigned id; |
| 60 | }; |
| 61 | |
| 62 | struct cpu_bus_path |
| 63 | { |
| 64 | unsigned id; |
| 65 | }; |
| 66 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 67 | |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 68 | struct device_path { |
| 69 | enum device_path_type type; |
| 70 | union { |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 71 | struct pci_path pci; |
| 72 | struct pnp_path pnp; |
| 73 | struct i2c_path i2c; |
| 74 | struct apic_path apic; |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 75 | struct ioapic_path ioapic; |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 76 | struct pci_domain_path pci_domain; |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 77 | struct apic_cluster_path apic_cluster; |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 78 | struct cpu_path cpu; |
| 79 | struct cpu_bus_path cpu_bus; |
Stefan Reinauer | 2b34db8 | 2009-02-28 20:10:20 +0000 | [diff] [blame] | 80 | }; |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | |
| 84 | #define DEVICE_PATH_MAX 30 |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 85 | #define BUS_PATH_MAX (DEVICE_PATH_MAX+10) |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 86 | |
| 87 | extern int path_eq(struct device_path *path1, struct device_path *path2); |
| 88 | |
| 89 | #endif /* DEVICE_PATH_H */ |