diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-11-26 14:49:18 +1100 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2019-01-08 03:11:24 +0000 |
commit | 9ed627ca50700ca99e4a18940a8b62bccd25236f (patch) | |
tree | 7c8e09416001e93c01cfcc950dde9abb58426a79 | |
parent | 7a85d22a5ffce603fa0e6b3dae41aabc954df10f (diff) | |
download | phosphor-mboxbridge-9ed627ca50700ca99e4a18940a8b62bccd25236f.tar.gz phosphor-mboxbridge-9ed627ca50700ca99e4a18940a8b62bccd25236f.zip |
transport: dbus: Remove ProtocolReset and WindowReset signals
These are replaced by the equivalent properties.
Change-Id: Ie2acb98cc592c0ed1f2039f8aa570f1c7944b1e2
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r-- | transport_dbus.c | 75 |
1 files changed, 2 insertions, 73 deletions
diff --git a/transport_dbus.c b/transport_dbus.c index ad0ed0d..42fb018 100644 --- a/transport_dbus.c +++ b/transport_dbus.c @@ -46,90 +46,21 @@ static int transport_dbus_property_update(struct mbox_context *context, return (rc < 0) ? rc : 0; } -static int transport_dbus_signal_update(struct mbox_context *context, - uint8_t events) -{ - int rc; - - /* - * Handle signals - edge triggered, only necessary when they're - * asserted - */ - if (events & BMC_EVENT_WINDOW_RESET) { - sd_bus_message *m = NULL; - - rc = sd_bus_message_new_signal(context->bus, &m, - MBOX_DBUS_OBJECT, - /* FIXME: Hard-coding v2 */ - MBOX_DBUS_PROTOCOL_IFACE_V2, - "WindowReset"); - if (rc < 0) { - return rc; - } - - rc = sd_bus_send(context->bus, m, NULL); - if (rc < 0) { - return rc; - } - } - - if (events & BMC_EVENT_PROTOCOL_RESET) { - sd_bus_message *m = NULL; - - rc = sd_bus_message_new_signal(context->bus, &m, - MBOX_DBUS_OBJECT, - /* FIXME: Hard-coding v2 */ - MBOX_DBUS_PROTOCOL_IFACE_V2, - "ProtocolReset"); - if (rc < 0) { - return rc; - } - - rc = sd_bus_send(context->bus, m, NULL); - if (rc < 0) { - return rc; - } - } - - return 0; -} static int transport_dbus_put_events(struct mbox_context *context, uint8_t mask) { - int rc; - - /* Always update all properties */ - rc = transport_dbus_property_update(context, mask); - if (rc < 0) { - return rc; - } - - /* - * Still test signals against the values set as sending them indicates - * the event has been asserted, so we must not send them if the bits - * are not set. - */ - return transport_dbus_signal_update(context, - context->bmc_events & mask); + return transport_dbus_property_update(context, mask); } static int transport_dbus_set_events(struct mbox_context *context, uint8_t events, uint8_t mask) { - int rc; - - rc = transport_dbus_property_update(context, events & mask); - if (rc < 0) { - return rc; - } - - return transport_dbus_signal_update(context, events & mask); + return transport_dbus_property_update(context, events & mask); } static int transport_dbus_clear_events(struct mbox_context *context, uint8_t events, uint8_t mask) { - /* No need to emit signals for ackable events on clear */ return transport_dbus_property_update(context, events & mask); } @@ -544,8 +475,6 @@ static const sd_bus_vtable protocol_v2_vtable[] = { SD_BUS_PROPERTY("DaemonReady", "b", transport_dbus_get_property, 0, /* Just a pointer to struct mbox_context */ SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), - SD_BUS_SIGNAL("ProtocolReset", NULL, 0), - SD_BUS_SIGNAL("WindowReset", NULL, 0), SD_BUS_PROPERTY("ProtocolReset", "b", transport_dbus_get_property, 0, /* Just a pointer to struct mbox_context */ |