blob: 3dc7625029217604ddb04211913b98e6a47748c3 [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,
Eric Biederman216525d2004-10-16 02:48:37 +000011 DEVICE_PATH_PCI_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
18struct pci_domain_path
19{
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;
Stefan Reinauerf622d592005-11-26 16:56:05 +000042 unsigned node_id;
43 unsigned core_id;
Sven Schnelle042c1462012-06-17 10:32:55 +020044 unsigned index;
Eric Biedermanb78c1972004-10-14 20:54:17 +000045};
46
Sven Schnelle0fa50a12012-06-21 22:19:48 +020047struct ioapic_path
48{
49 unsigned ioapic_id;
50};
51
Eric Biederman216525d2004-10-16 02:48:37 +000052struct apic_cluster_path
53{
54 unsigned cluster;
55};
56
Eric Biedermana9e632c2004-11-18 22:38:08 +000057struct cpu_path
58{
59 unsigned id;
60};
61
62struct cpu_bus_path
63{
64 unsigned id;
65};
66
Eric Biederman216525d2004-10-16 02:48:37 +000067
Eric Biedermane9a271e32003-09-02 03:36:25 +000068struct device_path {
69 enum device_path_type type;
70 union {
Eric Biedermana9e632c2004-11-18 22:38:08 +000071 struct pci_path pci;
72 struct pnp_path pnp;
73 struct i2c_path i2c;
74 struct apic_path apic;
Sven Schnelle0fa50a12012-06-21 22:19:48 +020075 struct ioapic_path ioapic;
Eric Biedermana9e632c2004-11-18 22:38:08 +000076 struct pci_domain_path pci_domain;
Eric Biederman216525d2004-10-16 02:48:37 +000077 struct apic_cluster_path apic_cluster;
Eric Biedermana9e632c2004-11-18 22:38:08 +000078 struct cpu_path cpu;
79 struct cpu_bus_path cpu_bus;
Stefan Reinauer2b34db82009-02-28 20:10:20 +000080 };
Eric Biedermane9a271e32003-09-02 03:36:25 +000081};
82
83
84#define DEVICE_PATH_MAX 30
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000085#define BUS_PATH_MAX (DEVICE_PATH_MAX+10)
Eric Biedermane9a271e32003-09-02 03:36:25 +000086
87extern int path_eq(struct device_path *path1, struct device_path *path2);
88
89#endif /* DEVICE_PATH_H */