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, |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | struct pci_domain_path |
| 18 | { |
| 19 | unsigned domain; |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | struct pci_path |
| 23 | { |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 24 | unsigned devfn; |
| 25 | }; |
| 26 | |
| 27 | struct pnp_path |
| 28 | { |
| 29 | unsigned port; |
| 30 | unsigned device; |
| 31 | }; |
| 32 | |
| 33 | struct i2c_path |
| 34 | { |
| 35 | unsigned device; |
| 36 | }; |
| 37 | |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 38 | struct apic_path |
| 39 | { |
| 40 | unsigned apic_id; |
| 41 | }; |
| 42 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 43 | struct apic_cluster_path |
| 44 | { |
| 45 | unsigned cluster; |
| 46 | }; |
| 47 | |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame^] | 48 | struct cpu_path |
| 49 | { |
| 50 | unsigned id; |
| 51 | }; |
| 52 | |
| 53 | struct cpu_bus_path |
| 54 | { |
| 55 | unsigned id; |
| 56 | }; |
| 57 | |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 58 | |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 59 | struct device_path { |
| 60 | enum device_path_type type; |
| 61 | union { |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame^] | 62 | struct pci_path pci; |
| 63 | struct pnp_path pnp; |
| 64 | struct i2c_path i2c; |
| 65 | struct apic_path apic; |
| 66 | struct pci_domain_path pci_domain; |
Eric Biederman | 216525d | 2004-10-16 02:48:37 +0000 | [diff] [blame] | 67 | struct apic_cluster_path apic_cluster; |
Eric Biederman | a9e632c | 2004-11-18 22:38:08 +0000 | [diff] [blame^] | 68 | struct cpu_path cpu; |
| 69 | struct cpu_bus_path cpu_bus; |
Eric Biederman | e9a271e3 | 2003-09-02 03:36:25 +0000 | [diff] [blame] | 70 | } u; |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | #define DEVICE_PATH_MAX 30 |
| 75 | |
| 76 | extern int path_eq(struct device_path *path1, struct device_path *path2); |
| 77 | |
| 78 | #endif /* DEVICE_PATH_H */ |