33## D-Bus
44
55` mctpd ` provides a D-Bus service named ` au.com.codeconstruct.MCTP1 ` , and a base
6- object path of ` /au/com/codeconstruct/mctp1 ` . For each known MCTP endpoint,
7- ` mctpd ` will populate an object at
8- ` /au/com/codeconstruct/mctp1/networks/<NetworkId>/endpoints/<EID> ` . The objects have
9- interface ` xyz.openbmc_project.MCTP.Endpoint ` , as per [ OpenBMC
10- documentation] ( https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/MCTP ) .
6+ object path of ` /au/com/codeconstruct/mctp1 ` . This tree represents both the
7+ local MCTP stack state and the results of remote device enumeration.
8+
9+ ```
10+ Service au.com.codeconstruct.MCTP1:
11+ └─ /au
12+ └─ /au/com
13+ └─ /au/com/codeconstruct
14+ └─ /au/com/codeconstruct/mctp1
15+ ├─ /au/com/codeconstruct/mctp1/interfaces
16+ │ ├─ /au/com/codeconstruct/mctp1/interfaces/lo
17+ │ └─ /au/com/codeconstruct/mctp1/interfaces/mctpi2c1
18+ └─ /au/com/codeconstruct/mctp1/networks
19+ └─ /au/com/codeconstruct/mctp1/networks/1
20+ └─ /au/com/codeconstruct/mctp1/networks/1/endpoints
21+ ├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/8
22+ └─ /au/com/codeconstruct/mctp1/networks/1/endpoints/10
23+ ```
24+
25+
26+ ## Top-level object: ` /au/com/codeconstruct/mctp1 `
27+
28+ This object serves as the global MCTP daemon namespace; it doesn't contain
29+ much at present, but hosts two trees of MCTP objects:
30+
31+ * Interfaces: Local hardware transport bindings that connect us to a MCTP bus
32+ * Endpoints: MCTP endpoints that ` mctpd ` knows about, both remote and local
1133
12- As well as those standard interfaces, ` mctpd ` provides methods to add and
13- configure MCTP endpoints. These are provided by the ` au.com.codeconstruct.MCTP1 `
14- D-Bus interface.
34+ This object implements the ` org.freedesktop.DBus.ObjectManager ` interface,
35+ allowing enumeration of managed networks, endpoints and interfaces.
1536
16- ## Bus-owner methods: ` au.com.codeconstruct.MCTP.BusOwner1 ` interface
37+ ## MCTP Interface objects: ` /au/com/codeconstruct/interfaces/<name> `
38+
39+ The interface objects represent a connection to a MCTP bus; these will be
40+ 1:1 with the MCTP network interfaces on the system.
41+
42+ ### MCTP interface interface: ` au.com.codeconstruct.MCTP.Interface1 `
43+
44+ All MCTP interface objects host the ` au.com.codeconstruct.Interface1 ` dbus
45+ interface:
46+
47+ ```
48+ NAME TYPE SIGNATURE RESULT/VALUE FLAGS
49+ au.com.CodeConstruct.MCTP.Interface1 interface - - -
50+ .Role property s "BusOwner" emits-change writable
51+ ```
52+
53+ The D-Bus interface includes the ` Role ` property which reports BMC roles
54+ in the link. The possible value of ` Role ` are:
55+
56+ * ` BusOwner ` : this link is the owner of the attached bus,
57+ * ` Endpoint ` : this link is not the owner of the attached bus; and
58+ * ` Unknown ` : not yet configured.
59+
60+ The ` Role ` property is writable, but it can only be changed when the current
61+ configured value is ` Unknown ` . Other platform setup infrastructure may use
62+ this to configure the initial MCTP state of the platform.
63+
64+ When the interface ` Role ` is ` BusOwner ` , the MCTP interface object will
65+ also host the ` BusOwner1 ` dbus interface:
66+
67+ ### Bus-owner interface: ` au.com.codeconstruct.MCTP.BusOwner1 ` interface
1768
1869This interface exposes bus-owner level functions, on each interface object that
1970represents the bus-owner side of a transport.
2071
21- ### ` .SetupEndpoint ` : ` ay ` → ` yisb `
72+ ```
73+ NAME TYPE SIGNATURE RESULT/VALUE FLAGS
74+ au.com.CodeConstruct.MCTP.Interface1 interface - - -
75+ .Role property s "BusOwner" emits-change writable
76+ au.com.codeconstruct.MCTP.BusOwner1 interface - - -
77+ .AssignEndpoint method ay yisb -
78+ .AssignEndpointStatic method ayy yisb -
79+ .LearnEndpoint method ay yisb -
80+ .SetupEndpoint method ay yisb -
81+ ```
82+
83+ Those BusOwner methods are:
84+
85+ #### ` .SetupEndpoint ` : ` ay ` → ` yisb `
2286
2387This method is the normal method used to add a MCTP endpoint on this interface.
2488The endpoint is identified by physical address. ` mctpd ` will query for the
@@ -50,15 +114,16 @@ busctl call au.com.codeconstruct.MCTP1 \
50114 au.com.codeconstruct.MCTP.Interface1 \
51115 SetupEndpoint ay 1 0x1d
52116```
117+
53118` 1 ` is the length of the hwaddr array.
54119
55- ### ` .AssignEndpoint ` : ` ay ` → ` yisb `
120+ #### ` .AssignEndpoint ` : ` ay ` → ` yisb `
56121
57122Similar to SetupEndpoint, but will always assign an EID rather than querying for
58123existing ones. Will return ` new = false ` when an endpoint is already known to
59124` mctpd ` .
60125
61- ### ` .AssignEndpointStatic ` : ` ayy ` → ` yisb `
126+ #### ` .AssignEndpointStatic ` : ` ayy ` → ` yisb `
62127
63128Similar to AssignEndpoint, but takes an additional EID argument:
64129
@@ -72,18 +137,26 @@ This call will fail if the endpoint already has an EID, and that EID is
72137different from ` static-EID ` , or if ` static-EID ` is already assigned to another
73138endpoint.
74139
75- ### ` .LearnEndpoint ` : ` ay ` → ` yisb `
140+ #### ` .LearnEndpoint ` : ` ay ` → ` yisb `
76141
77142Like SetupEndpoint but will not assign EIDs, will only query endpoints for a
78143current EID. The ` new ` return value is set to ` false ` for an already known
79144endpoint, or ` true ` when an endpoint's EID is newly discovered.
80145
81- ## Endpoint methods: the ` au.com.codeconstruct.MCTP.Endpoint1 ` interface
146+ ## Endpoint objects: ` /au/com/codeconstruct/networks/<net>/endpoints/<eid> `
147+
148+ These objects represent MCTP endpoints that ` mctpd ` has either discovered
149+ locally (typically: MCTP addresses assigned to the local stack), or remote
150+ interfaces discovered during device enumeration.
151+
152+ These objects host the interface ` xyz.openbmc_project.MCTP.Endpoint ` , as per
153+ [ OpenBMC
154+ documentation] ( https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/MCTP ) .
82155
83156Each endpoint object has methods to configure it, through the
84157` au.com.codeconstruct.MCTP.Endpoint1 ` interface on each endpoint.
85158
86- ## ` .SetMTU ` : ` u `
159+ ### ` .SetMTU ` : ` u `
87160
88161Sets the MTU (maximum transmission unit) on the route for that endpoint. This
89162must be within the MTU range allowed for the network device. For i2c that is
@@ -101,21 +174,6 @@ busctl call au.com.codeconstruct.MCTP1 \
101174 SetMTU u 80
102175```
103176
104- ## ` .Remove `
177+ ### ` .Remove `
105178
106179Removes the MCTP endpoint from ` mctpd ` , and deletes routes and neighbour entries.
107-
108- ## D-Bus /au/com/codeconstruct/mctp1/interfaces/<name >
109-
110- ` mctpd ` provides a D-Bus path of ` /au/com/codeconstruct/mctp1/interfaces ` .
111- For each known MCTP interfaces, ` mctpd ` will populate an D-Bus object
112- ` /au/com/codeconstruct/mctp1/interfaces/<name> ` . The D-Bus objects have
113- interface ` au.com.CodeConstruct.MCTP.Interface1 ` .
114- The D-Bus interface includes the ` Role ` property which reports BMC roles
115- in the link. The possible value of ` Role ` are ` BusOwner ` , ` Endpoint ` and
116- ` Unknown ` . The ` Role ` property is a changeable value but it can only be
117- changed when the current configured value is ` Unknown ` because the BMC
118- ` Role ` in the MCTP link is specific depend on the system.
119- The D-Bus ` /au/com/codeconstruct/mctp1/interfaces/<name> ` objects also
120- includes an au.com.codeconstruct.MCTP.BusOwner1 which exposes bus-owner
121- level functions.
0 commit comments