1a2056e9cSWilly Tu // Copyright 2021 Google LLC 2a2056e9cSWilly Tu // 3a2056e9cSWilly Tu // Licensed under the Apache License, Version 2.0 (the "License"); 4a2056e9cSWilly Tu // you may not use this file except in compliance with the License. 5a2056e9cSWilly Tu // You may obtain a copy of the License at 6a2056e9cSWilly Tu // 7a2056e9cSWilly Tu // http://www.apache.org/licenses/LICENSE-2.0 8a2056e9cSWilly Tu // 9a2056e9cSWilly Tu // Unless required by applicable law or agreed to in writing, software 10a2056e9cSWilly Tu // distributed under the License is distributed on an "AS IS" BASIS, 11a2056e9cSWilly Tu // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12a2056e9cSWilly Tu // See the License for the specific language governing permissions and 13a2056e9cSWilly Tu // limitations under the License. 14a2056e9cSWilly Tu 154d49ae65SPatrick Venture #pragma once 164d49ae65SPatrick Venture 17aa374120SPatrick Venture #include "handler.hpp" 18aa374120SPatrick Venture 192c9e1625SWilliam A. Kennington III #include <ipmid/api.h> 204d49ae65SPatrick Venture 21ff3cd8e9SWilly Tu #include <ipmid/api-types.hpp> 22*444b5ea4SPatrick Williams 23b4e3704cSWilly Tu #include <span> 24ff3cd8e9SWilly Tu 254d49ae65SPatrick Venture namespace google 264d49ae65SPatrick Venture { 274d49ae65SPatrick Venture namespace ipmi 284d49ae65SPatrick Venture { 294d49ae65SPatrick Venture 30aa374120SPatrick Venture struct PsuResetRequest 31aa374120SPatrick Venture { 32aa374120SPatrick Venture // Delay in seconds. 33aa374120SPatrick Venture uint32_t delay; 34aa374120SPatrick Venture } __attribute__((packed)); 35aa374120SPatrick Venture 364d49ae65SPatrick Venture // Set a time-delayed PSU hard reset. 37b4e3704cSWilly Tu Resp psuHardReset(std::span<const uint8_t> data, 38ff3cd8e9SWilly Tu const HandlerInterface* handler); 394d49ae65SPatrick Venture 40ac4a16f7SShounak Mitra // Arm for PSU hard reset on host shutdown. 41b4e3704cSWilly Tu Resp psuHardResetOnShutdown(std::span<const uint8_t> data, 42ac4a16f7SShounak Mitra const HandlerInterface* handler); 43ac4a16f7SShounak Mitra 444d49ae65SPatrick Venture } // namespace ipmi 454d49ae65SPatrick Venture } // namespace google 46