Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 1 | #pragma once |
2 | |||||
3 | #include "interface.hpp" | ||||
Patrick Venture | 18bbe3c | 2019-05-14 11:40:57 -0700 | [diff] [blame] | 4 | #include "internal/sys.hpp" |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 5 | #include "pci.hpp" |
Patrick Venture | cf9b219 | 2019-06-27 12:09:52 -0700 | [diff] [blame] | 6 | #include "progress.hpp" |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 7 | |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 8 | #include <ipmiblob/blob_interface.hpp> |
Patrick Venture | 9b37b09 | 2020-05-28 20:58:57 -0700 | [diff] [blame] | 9 | |
10 | #include <cstdint> | ||||
Medad CChien | c8445aa | 2020-04-23 09:47:46 +0800 | [diff] [blame] | 11 | #include <vector> |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 12 | |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 13 | namespace host_tool |
14 | { | ||||
15 | |||||
16 | class P2aDataHandler : public DataInterface | ||||
17 | { | ||||
18 | public: | ||||
Benjamin Fair | e5aafa5 | 2020-06-05 21:04:24 -0700 | [diff] [blame^] | 19 | P2aDataHandler(ipmiblob::BlobInterface* blob, const PciAccess* pci, |
20 | ProgressInterface* progress, | ||||
Patrick Venture | 18bbe3c | 2019-05-14 11:40:57 -0700 | [diff] [blame] | 21 | const internal::Sys* sys = &internal::sys_impl) : |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 22 | blob(blob), |
Benjamin Fair | e5aafa5 | 2020-06-05 21:04:24 -0700 | [diff] [blame^] | 23 | pci(pci), progress(progress), sys(sys) |
Patrick Venture | 9b37b09 | 2020-05-28 20:58:57 -0700 | [diff] [blame] | 24 | {} |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 25 | |
26 | bool sendContents(const std::string& input, std::uint16_t session) override; | ||||
Patrick Venture | 84778b8 | 2019-06-26 20:11:09 -0700 | [diff] [blame] | 27 | ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 28 | { |
Patrick Venture | 84778b8 | 2019-06-26 20:11:09 -0700 | [diff] [blame] | 29 | return ipmi_flash::FirmwareFlags::UpdateFlags::p2a; |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 30 | } |
31 | |||||
32 | private: | ||||
33 | ipmiblob::BlobInterface* blob; | ||||
Benjamin Fair | e5aafa5 | 2020-06-05 21:04:24 -0700 | [diff] [blame^] | 34 | const PciAccess* pci; |
Patrick Venture | cf9b219 | 2019-06-27 12:09:52 -0700 | [diff] [blame] | 35 | ProgressInterface* progress; |
Patrick Venture | 18bbe3c | 2019-05-14 11:40:57 -0700 | [diff] [blame] | 36 | const internal::Sys* sys; |
Medad CChien | c8445aa | 2020-04-23 09:47:46 +0800 | [diff] [blame] | 37 | }; |
Benjamin Fair | e5aafa5 | 2020-06-05 21:04:24 -0700 | [diff] [blame^] | 38 | |
Patrick Venture | b5bf0fc | 2019-05-03 14:33:49 -0700 | [diff] [blame] | 39 | } // namespace host_tool |