blob: c59b49ed245958a91c1fce5d5c2af4b7a65e28df [file] [log] [blame]
Eric Biedermane9a271e32003-09-02 03:36:25 +00001#ifndef DEVICE_PATH_H
2#define DEVICE_PATH_H
3
4enum device_path_type {
5 DEVICE_PATH_NONE = 0,
Eric Biederman83b991a2003-10-11 06:20:25 +00006 DEVICE_PATH_ROOT,
Eric Biedermane9a271e32003-09-02 03:36:25 +00007 DEVICE_PATH_PCI,
8 DEVICE_PATH_PNP,
9 DEVICE_PATH_I2C,
Eric Biedermanb78c1972004-10-14 20:54:17 +000010 DEVICE_PATH_APIC,
Stefan Reinauer4aff4452013-02-12 14:17:15 -080011 DEVICE_PATH_DOMAIN,
Eric Biederman7003ba42004-10-16 06:20:29 +000012 DEVICE_PATH_APIC_CLUSTER,
Eric Biedermana9e632c2004-11-18 22:38:08 +000013 DEVICE_PATH_CPU,
14 DEVICE_PATH_CPU_BUS,
Sven Schnelle0fa50a12012-06-21 22:19:48 +020015 DEVICE_PATH_IOAPIC,
Eric Biederman216525d2004-10-16 02:48:37 +000016};
17
Stefan Reinauer4aff4452013-02-12 14:17:15 -080018struct domain_path
Eric Biederman216525d2004-10-16 02:48:37 +000019{
20 unsigned domain;
Eric Biedermane9a271e32003-09-02 03:36:25 +000021};
22
23struct pci_path
24{
Eric Biedermane9a271e32003-09-02 03:36:25 +000025 unsigned devfn;
26};
27
28struct pnp_path
29{
30 unsigned port;
31 unsigned device;
32};
33
34struct i2c_path
35{
36 unsigned device;
37};
38
Eric Biedermanb78c1972004-10-14 20:54:17 +000039struct apic_path
40{
41 unsigned apic_id;
Kyösti Mälkkic33f1e92012-08-07 17:12:11 +030042 unsigned package_id;
Stefan Reinauerf622d592005-11-26 16:56:05 +000043 unsigned node_id;
44 unsigned core_id;
Kyösti Mälkkic33f1e92012-08-07 17:12:11 +030045 unsigned thread_id;
Eric Biedermanb78c1972004-10-14 20:54:17 +000046};
47
Sven Schnelle0fa50a12012-06-21 22:19:48 +020048struct ioapic_path
49{
50 unsigned ioapic_id;
51};
52
Eric Biederman216525d2004-10-16 02:48:37 +000053struct apic_cluster_path
54{
55 unsigned cluster;
56};
57
Eric Biedermana9e632c2004-11-18 22:38:08 +000058struct cpu_path
59{
60 unsigned id;
61};
62
63struct cpu_bus_path
64{
65 unsigned id;
66};
67
Eric Biederman216525d2004-10-16 02:48:37 +000068
Eric Biedermane9a271e32003-09-02 03:36:25 +000069struct device_path {
70 enum device_path_type type;
71 union {
Eric Biedermana9e632c2004-11-18 22:38:08 +000072 struct pci_path pci;
73 struct pnp_path pnp;
74 struct i2c_path i2c;
75 struct apic_path apic;
Sven Schnelle0fa50a12012-06-21 22:19:48 +020076 struct ioapic_path ioapic;
Stefan Reinauer4aff4452013-02-12 14:17:15 -080077 struct domain_path domain;
Eric Biederman216525d2004-10-16 02:48:37 +000078 struct apic_cluster_path apic_cluster;
Eric Biedermana9e632c2004-11-18 22:38:08 +000079 struct cpu_path cpu;
80 struct cpu_bus_path cpu_bus;
Stefan Reinauer2b34db82009-02-28 20:10:20 +000081 };
Eric Biedermane9a271e32003-09-02 03:36:25 +000082};
83
84
85#define DEVICE_PATH_MAX 30
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000086#define BUS_PATH_MAX (DEVICE_PATH_MAX+10)
Eric Biedermane9a271e32003-09-02 03:36:25 +000087
88extern int path_eq(struct device_path *path1, struct device_path *path2);
89
90#endif /* DEVICE_PATH_H */