[PATCH phosphor-host-ipmid 4/4] Add Get Device UUID
Patrick Williams
patrick at stwcx.xyz
Thu Oct 22 14:00:50 AEDT 2015
This commit looks fine. Again, should be in its own pull request.
The SEL time ones are the only that seem to have issues.
On Tue, Oct 20, 2015 at 10:23:29PM -0500, OpenBMC Patches wrote:
> From: Adriana Kobylak <anoo at us.ibm.com>
>
> ---
> apphandler.C | 47 +++++++++++++++++++++++++++++++++++++++++++++++
> apphandler.h | 1 +
> 2 files changed, 48 insertions(+)
>
> diff --git a/apphandler.C b/apphandler.C
> index 132f5c6..963a3bb 100755
> --- a/apphandler.C
> +++ b/apphandler.C
> @@ -58,6 +58,50 @@ ipmi_ret_t ipmi_app_get_device_id(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
> return rc;
> }
>
> +ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
> + ipmi_request_t request, ipmi_response_t response,
> + ipmi_data_len_t data_len, ipmi_context_t context)
> +{
> + const char *busname = "org.openbmc.control.Chassis";
> + const char *objname = "/org/openbmc/control/chassis0";
> + const char *iface = "org.openbmc.control.Chassis";
> + sd_bus_message *reply = NULL, *m = NULL;
> + sd_bus_error error = SD_BUS_ERROR_NULL;
> + int r = 0;
> + char *id = NULL;
> +
> + // Status code.
> + ipmi_ret_t rc = IPMI_CC_OK;
> +
> + printf("IPMI GET DEVICE GUID\n");
> +
> + r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"getID");
> + if (r < 0) {
> + fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r));
> + return -1;
> + }
> + r = sd_bus_call(bus, m, 0, &error, &reply);
> + if (r < 0) {
> + fprintf(stderr, "Failed to call the start method: %s\n", strerror(-r));
> + return -1;
> + }
> + r = sd_bus_message_read(reply, "s", &id);
> + if (r < 0) {
> + fprintf(stderr, "Failed to get a response: %s", strerror(-r));
> + return -1;
> + }
> +
> + // Data length
> + *data_len = strlen(id);
> +
> + // Pack the actual response
> + memcpy(response, &id, *data_len);
> +
> + sd_bus_error_free(&error);
> + sd_bus_message_unref(m);
> +
> + return rc;
> +}
>
> ipmi_ret_t ipmi_app_get_bt_capabilities(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
> ipmi_request_t request, ipmi_response_t response,
> @@ -237,6 +281,9 @@ void register_netfn_app_functions()
> printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_ID);
> ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_ID, NULL, ipmi_app_get_device_id);
>
> + printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID);
> + ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID, NULL, ipmi_app_get_device_guid);
> +
> printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_SET_ACPI);
> ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_ACPI, NULL, ipmi_app_set_acpi_power_state);
>
> diff --git a/apphandler.h b/apphandler.h
> index 3b8995c..5ae3c9b 100644
> --- a/apphandler.h
> +++ b/apphandler.h
> @@ -6,6 +6,7 @@ enum ipmi_netfn_app_cmds
> {
> IPMI_CMD_GET_DEVICE_ID = 0x01,
> IPMI_CMD_SET_ACPI = 0x06,
> + IPMI_CMD_GET_DEVICE_GUID = 0x08,
> IPMI_CMD_RESET_WD = 0x22,
> IPMI_CMD_SET_WD = 0x24,
> IPMI_CMD_SET_BMC_GLOBAL_ENABLES = 0x2E,
> --
> 2.6.0
>
>
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc
--
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20151021/83226887/attachment-0001.sig>
More information about the openbmc
mailing list