summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2019-03-25 13:40:11 -0700
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-04-05 17:00:06 +0000
commitcc99ba438270450ab109c75fb2af92da3b32066d (patch)
treed421894fe660cde1b81e5287cc3240fda5cfc8a1
parentb84a5282def272240f7335bd80ab21dbb588b0d9 (diff)
downloadphosphor-host-ipmid-cc99ba438270450ab109c75fb2af92da3b32066d.zip
phosphor-host-ipmid-cc99ba438270450ab109c75fb2af92da3b32066d.tar.gz
rewrite Get BT Capabilities using new provider API
Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 0x36 01 3f 3f 0a 01 Change-Id: I9be3d21c041ba1d99f6672c4501faafcca117d11 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
-rw-r--r--apphandler.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/apphandler.cpp b/apphandler.cpp
index 9427999..fad727b 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -769,28 +769,19 @@ finish:
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,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
+auto ipmiAppGetBtCapabilities()
+ -> ipmi::RspType<uint8_t, uint8_t, uint8_t, uint8_t, uint8_t>
{
-
- // Status code.
- ipmi_ret_t rc = IPMI_CC_OK;
-
// Per IPMI 2.0 spec, the input and output buffer size must be the max
// buffer size minus one byte to allocate space for the length byte.
- uint8_t str[] = {0x01, MAX_IPMI_BUFFER - 1, MAX_IPMI_BUFFER - 1, 0x0A,
- 0x01};
-
- // Data length
- *data_len = sizeof(str);
-
- // Pack the actual response
- std::memcpy(response, &str, *data_len);
-
- return rc;
+ constexpr uint8_t nrOutstanding = 0x01;
+ constexpr uint8_t inputBufferSize = MAX_IPMI_BUFFER - 1;
+ constexpr uint8_t outputBufferSize = MAX_IPMI_BUFFER - 1;
+ constexpr uint8_t transactionTime = 0x0A;
+ constexpr uint8_t nrRetries = 0x01;
+
+ return ipmi::responseSuccess(nrOutstanding, inputBufferSize,
+ outputBufferSize, transactionTime, nrRetries);
}
ipmi_ret_t ipmi_app_wildcard_handler(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
@@ -1058,8 +1049,9 @@ void register_netfn_app_functions()
ipmiAppGetDeviceId);
// <Get BT Interface Capabilities>
- ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_CAP_BIT, NULL,
- ipmi_app_get_bt_capabilities, PRIVILEGE_USER);
+ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnApp,
+ ipmi::app::cmdGetBtIfaceCapabilities,
+ ipmi::Privilege::User, ipmiAppGetBtCapabilities);
// <Wildcard Command>
ipmi_register_callback(NETFUN_APP, IPMI_CMD_WILDCARD, NULL,
OpenPOWER on IntegriCloud