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; |
Kyösti Mälkki | c33f1e9 | 2012-08-07 17:12:11 +0300 | [diff] [blame] | 42 | unsigned package_id; |
Stefan Reinauer | f622d59 | 2005-11-26 16:56:05 +0000 | [diff] [blame] | 43 | unsigned node_id; |
| 44 | unsigned core_id; |
Kyösti Mälkki | c33f1e9 | 2012-08-07 17:12:11 +0300 | [diff] [blame] | 45 | unsigned thread_id; |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame] | 48 | struct ioapic_path |
| 49 | { |
| 50 | unsigned ioapic_id; |
| 51 | }; |
| 52 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 53 | struct apic_cluster_path |
| 54 | { |
| 55 | unsigned cluster; |
| 56 | }; |
| 57 | |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 58 | struct cpu_path |
| 59 | { |
| 60 | unsigned id; |
| 61 | }; |
| 62 | |
| 63 | struct cpu_bus_path |
| 64 | { |
| 65 | unsigned id; |
| 66 | }; |
| 67 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 68 | |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 69 | struct device_path { |
| 70 | enum device_path_type type; |
| 71 | union { |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 72 | struct pci_path pci; |
| 73 | struct pnp_path pnp; |
| 74 | struct i2c_path i2c; |
| 75 | struct apic_path apic; |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame] | 76 | struct ioapic_path ioapic; |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 77 | struct pci_domain_path pci_domain; |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 78 | struct apic_cluster_path apic_cluster; |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame] | 79 | struct cpu_path cpu; |
| 80 | struct cpu_bus_path cpu_bus; |
Stefan Reinauer | 2b34db8 | 2009-02-28 20:10:20 +0000 | [diff] [blame] | 81 | }; |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | |
| 85 | #define DEVICE_PATH_MAX 30 |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 86 | #define BUS_PATH_MAX (DEVICE_PATH_MAX+10) |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 87 | |
| 88 | extern int path_eq(struct device_path *path1, struct device_path *path2); |
| 89 | |
| 90 | #endif /* DEVICE_PATH_H */ |