blob: 63e95380c440d3a91565a165a32fdd22b0cdd279 [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,
Eric Biederman216525d2004-10-16 02:48:37 +000015};
16
17struct pci_domain_path
18{
19 unsigned domain;
Eric Biedermane9a271e32003-09-02 03:36:25 +000020};
21
22struct pci_path
23{
Eric Biedermane9a271e32003-09-02 03:36:25 +000024 unsigned devfn;
25};
26
27struct pnp_path
28{
29 unsigned port;
30 unsigned device;
31};
32
33struct i2c_path
34{
35 unsigned device;
36};
37
Eric Biedermanb78c1972004-10-14 20:54:17 +000038struct apic_path
39{
40 unsigned apic_id;
Stefan Reinauerf622d592005-11-26 16:56:05 +000041 unsigned node_id;
42 unsigned core_id;
Eric Biedermanb78c1972004-10-14 20:54:17 +000043};
44
Eric Biederman216525d2004-10-16 02:48:37 +000045struct apic_cluster_path
46{
47 unsigned cluster;
48};
49
Eric Biedermana9e632c2004-11-18 22:38:08 +000050struct cpu_path
51{
52 unsigned id;
53};
54
55struct cpu_bus_path
56{
57 unsigned id;
58};
59
Eric Biederman216525d2004-10-16 02:48:37 +000060
Eric Biedermane9a271e32003-09-02 03:36:25 +000061struct device_path {
62 enum device_path_type type;
63 union {
Eric Biedermana9e632c2004-11-18 22:38:08 +000064 struct pci_path pci;
65 struct pnp_path pnp;
66 struct i2c_path i2c;
67 struct apic_path apic;
68 struct pci_domain_path pci_domain;
Eric Biederman216525d2004-10-16 02:48:37 +000069 struct apic_cluster_path apic_cluster;
Eric Biedermana9e632c2004-11-18 22:38:08 +000070 struct cpu_path cpu;
71 struct cpu_bus_path cpu_bus;
Stefan Reinauer2b34db82009-02-28 20:10:20 +000072 };
Eric Biedermane9a271e32003-09-02 03:36:25 +000073};
74
75
76#define DEVICE_PATH_MAX 30
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000077#define BUS_PATH_MAX (DEVICE_PATH_MAX+10)
Eric Biedermane9a271e32003-09-02 03:36:25 +000078
79extern int path_eq(struct device_path *path1, struct device_path *path2);
80
81#endif /* DEVICE_PATH_H */