Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mctpd: use new Bus Owner name of au.com.CodeConstruct.MCTP #34

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3. The `tests` option has changed type from `feature` to `boolean`. Tests are
enabled by default.

4. Use a dbus owner name of au.com.CodeConstruct.MCTP. We still register the
previous name (xyz.openbmc_project.MCTP) for compatibility with existing
consumers, but this will be removed in a future release.

### Fixed

1. mctpd: EID assignments now work in the case where a new endpoint has a
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The `mctpd` daemon will expose a dbus interface, claiming the bus name
`xyz.openbmc_project.MCTP` and object path `/xyz/openbmc_project/mctp`. This
provides a few functions for configuring remote endpoints:

# busctl introspect xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp
# busctl introspect au.com.CodeConstruct.MCTP /xyz/openbmc_project/mctp
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
au.com.CodeConstruct.MCTP interface - - -
.AssignEndpoint method say yisb -
Expand Down
4 changes: 2 additions & 2 deletions docs/mctpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ new (bool) - true if a new EID was assigned
An example:

```shell
busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp \
busctl call au.com.CodeConstruct.MCTP /xyz/openbmc_project/mctp \
au.com.CodeConstruct.MCTP SetupEndpoint say mctpi2c6 1 0x1d
```
`1` is the length of the hwaddr array.
Expand Down Expand Up @@ -81,7 +81,7 @@ MTU, configurable with `mctp link set <ifname> mtu <value>`.
An example, setting MTU of 80:

```shell
busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp/1/11 \
busctl call au.com.CodeConstruct.MCTP /xyz/openbmc_project/mctp/1/11 \
au.com.CodeConstruct.MCTP.Endpoint SetMTU u 80
```

Expand Down
21 changes: 16 additions & 5 deletions src/mctpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#define CC_MCTP_DBUS_IFACE "au.com.CodeConstruct.MCTP"
#define CC_MCTP_DBUS_IFACE_ENDPOINT "au.com.CodeConstruct.MCTP.Endpoint"
#define CC_MCTP_DBUS_IFACE_TESTING "au.com.CodeConstruct.MCTPTesting"
#define MCTP_DBUS_IFACE "xyz.openbmc_project.MCTP"
#define MCTP_DBUS_NAME_OBMC "xyz.openbmc_project.MCTP" /* deprecated */
#define MCTP_DBUS_NAME "au.com.CodeConstruct.MCTP"
#define MCTP_DBUS_IFACE_ENDPOINT "xyz.openbmc_project.MCTP.Endpoint"
#define OPENBMC_IFACE_COMMON_UUID "xyz.openbmc_project.Common.UUID"

Expand Down Expand Up @@ -3134,14 +3135,24 @@ static int setup_bus(ctx *ctx)
}


int request_dbus(ctx *ctx) {
int request_dbus(ctx *ctx)
{
int rc;

rc = sd_bus_request_name(ctx->bus, MCTP_DBUS_IFACE, 0);
rc = sd_bus_request_name(ctx->bus, MCTP_DBUS_NAME, 0);
if (rc < 0) {
warnx("Failed requesting name %s", MCTP_DBUS_IFACE);
warnx("Failed requesting dbus name %s", MCTP_DBUS_NAME);
return rc;
}
return rc;

rc = sd_bus_request_name(ctx->bus, MCTP_DBUS_NAME_OBMC, 0);
if (rc < 0) {
/* non-fatal, but we do warn */
warnx("Failed requesting legacy dbus name %s",
MCTP_DBUS_NAME_OBMC);
}

return 0;
}


Expand Down