diff options
author | Yong Li <yong.b.li@linux.intel.com> | 2019-01-18 17:54:32 +0800 |
---|---|---|
committer | Tom Joseph <tomjoseph@in.ibm.com> | 2019-02-05 08:55:38 +0000 |
commit | cb89c0e359f4fd6ce39884a4da6b57b093223829 (patch) | |
tree | 0d40eb7fd567602ab70d6a27213137443ec99447 /chassishandler.cpp | |
parent | 88416834d58471cb4c29551ae0b8f5081cd3ada7 (diff) | |
download | phosphor-host-ipmid-cb89c0e359f4fd6ce39884a4da6b57b093223829.tar.gz phosphor-host-ipmid-cb89c0e359f4fd6ce39884a4da6b57b093223829.zip |
Changes to align with IPMI spec
IPMI Spec Section 19.2:
Unless otherwise noted, Reserved bits and fields in commands(request messages)
and responses shall be written as '0'.
Return "out of range" error for unsupported power policy
and also return the supported policies on success.
Change-Id: I51d63b86ef0d3076438649abc49c63267c57cbd5
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Diffstat (limited to 'chassishandler.cpp')
-rw-r--r-- | chassishandler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp index 4b42b3c..7b94189 100644 --- a/chassishandler.cpp +++ b/chassishandler.cpp @@ -1658,15 +1658,15 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy( return IPMI_CC_REQ_DATA_LEN_INVALID; } - reqPolicy = *reqptr & power_policy::policyBitMask; - if (reqPolicy > power_policy::noChange) + if (*reqptr > power_policy::noChange) { phosphor::logging::log<level::ERR>("Reserved request parameter", - entry("REQ=0x%x", reqPolicy)); + entry("REQ=0x%x", *reqptr)); *data_len = 0; - return IPMI_CC_PARM_NOT_SUPPORTED; + return IPMI_CC_PARM_OUT_OF_RANGE; } + reqPolicy = *reqptr & power_policy::policyBitMask; if (reqPolicy == power_policy::noChange) { // just return the supported policy @@ -1717,6 +1717,7 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy( return IPMI_CC_UNSPECIFIED_ERROR; } + *resptr = power_policy::allSupport; *data_len = power_policy::setPolicyReqLen; return IPMI_CC_OK; } |