xref: /openbmc/phosphor-pid-control/ipmi/manualcmds.hpp (revision 22579ca422e4e608bfc21e237b02a8268e33a061)
1391b8b0fSPatrick Venture #pragma once
236ab6f6eSPatrick Venture 
309334bbeSPatrick Venture #include "control.hpp"
409334bbeSPatrick Venture 
59bf5cef4SPatrick Venture #include <ipmid/api.h>
69bf5cef4SPatrick Venture 
736ab6f6eSPatrick Venture #include <cstdint>
809334bbeSPatrick Venture #include <memory>
936ab6f6eSPatrick Venture 
1036ab6f6eSPatrick Venture namespace pid_control
1136ab6f6eSPatrick Venture {
1236ab6f6eSPatrick Venture namespace ipmi
1336ab6f6eSPatrick Venture {
1436ab6f6eSPatrick Venture 
1509334bbeSPatrick Venture // Implements validation of IPMI commands and handles sending back the
1609334bbeSPatrick Venture // responses.
1709334bbeSPatrick Venture class ZoneControlIpmiHandler
1809334bbeSPatrick Venture {
1909334bbeSPatrick Venture   public:
ZoneControlIpmiHandler(std::unique_ptr<ZoneControlInterface> control)20*22579ca4SHarvey Wu     explicit ZoneControlIpmiHandler(
21*22579ca4SHarvey Wu         std::unique_ptr<ZoneControlInterface> control) :
2209334bbeSPatrick Venture         _control(std::move(control))
2309334bbeSPatrick Venture     {}
2409334bbeSPatrick Venture 
2509334bbeSPatrick Venture     ipmi_ret_t getFailsafeModeState(const uint8_t* reqBuf, uint8_t* replyBuf,
2609334bbeSPatrick Venture                                     size_t* dataLen);
2709334bbeSPatrick Venture 
2809334bbeSPatrick Venture     ipmi_ret_t getManualModeState(const uint8_t* reqBuf, uint8_t* replyBuf,
2909334bbeSPatrick Venture                                   size_t* dataLen);
3009334bbeSPatrick Venture 
3109334bbeSPatrick Venture     ipmi_ret_t setManualModeState(const uint8_t* reqBuf, uint8_t* replyBuf,
32*22579ca4SHarvey Wu                                   const size_t* dataLen);
3309334bbeSPatrick Venture 
3409334bbeSPatrick Venture   private:
3509334bbeSPatrick Venture     std::unique_ptr<ZoneControlInterface> _control;
3609334bbeSPatrick Venture };
3709334bbeSPatrick Venture 
3809334bbeSPatrick Venture ipmi_ret_t manualModeControl(ZoneControlIpmiHandler* handler, ipmi_cmd_t cmd,
3909334bbeSPatrick Venture                              const uint8_t* reqBuf, uint8_t* replyCmdBuf,
4009334bbeSPatrick Venture                              size_t* dataLen);
4136ab6f6eSPatrick Venture 
4236ab6f6eSPatrick Venture } // namespace ipmi
4336ab6f6eSPatrick Venture } // namespace pid_control
44