diff options
author | Yong Li <yong.b.li@linux.intel.com> | 2019-05-21 14:46:55 +0800 |
---|---|---|
committer | Yong Li <yong.b.li@intel.com> | 2019-05-24 02:05:51 +0000 |
commit | f4e385155ec28c45c70742e19b00cb515ae76783 (patch) | |
tree | 7692bf0d39915c34c01c018d2e9fe594a9447dc6 /chassishandler.cpp | |
parent | 70ce735720983f289c4e7c44987f3b91071c4d4c (diff) | |
download | phosphor-host-ipmid-f4e385155ec28c45c70742e19b00cb515ae76783.tar.gz phosphor-host-ipmid-f4e385155ec28c45c70742e19b00cb515ae76783.zip |
Chassishandler: Add chassis identify state support for chassis status command
Return the present chassis identify state in get chassis status command:
Off
Temporary on
Indefinite on
Reserved
Tested:
Set chassis identify in different states:
ipmitool raw 0 4 10 0
ipmitool raw 0 4 0 1
ipmitool raw 0 4 0 0
Then query the chassis status and check on the third byte
ipmitool raw 0 1
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: I66690b74823a6b819c4fda25d95bc8690b98181a
Diffstat (limited to 'chassishandler.cpp')
-rw-r--r-- | chassishandler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp index 0d2265f..1738ccc 100644 --- a/chassishandler.cpp +++ b/chassishandler.cpp @@ -43,6 +43,8 @@ std::unique_ptr<phosphor::Timer> identifyTimer __attribute__((init_priority(101))); +static ChassisIDState chassisIDState = ChassisIDState::reserved; + constexpr size_t SIZE_MAC = 18; constexpr size_t SIZE_BOOT_OPTION = (uint8_t) BootOptionResponseSize::OPAL_NETWORK_SETTINGS; // Maximum size of the boot @@ -1009,7 +1011,7 @@ ipmi::RspType<bool, // Power is on constexpr bool coolingFanFault = false; // chassisIdentifySupport set because this command is implemented constexpr bool chassisIdentifySupport = true; - constexpr uint2_t chassisIdentifyState(0); + uint2_t chassisIdentifyState = static_cast<uint2_t>(chassisIDState); constexpr bool diagButtonDisabled = false; constexpr bool sleepButtonDisabled = false; constexpr bool diagButtonDisableAllow = false; @@ -1252,6 +1254,7 @@ void enclosureIdentifyLedOff() { try { + chassisIDState = ChassisIDState::off; enclosureIdentifyLed(false); } catch (const InternalFailure& e) @@ -1284,6 +1287,7 @@ ipmi::RspType<> ipmiChassisIdentify(std::optional<uint8_t> interval, identifyTimer->stop(); try { + chassisIDState = ChassisIDState::temporaryOn; enclosureIdentifyLed(true); } catch (const InternalFailure& e) @@ -1294,6 +1298,7 @@ ipmi::RspType<> ipmiChassisIdentify(std::optional<uint8_t> interval, if (forceIdentify) { + chassisIDState = ChassisIDState::indefiniteOn; return ipmi::responseSuccess(); } // start the timer |