Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <climits> |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 4 | #include <map> |
| 5 | #include <sdbusplus/server.hpp> |
Patrick Venture | c83c4dc | 2018-11-01 16:29:18 -0700 | [diff] [blame] | 6 | #include <string> |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 7 | #include <unordered_map> |
Patrick Venture | c83c4dc | 2018-11-01 16:29:18 -0700 | [diff] [blame] | 8 | #include <vector> |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 9 | |
| 10 | namespace openpower |
| 11 | { |
| 12 | namespace vpd |
| 13 | { |
| 14 | |
| 15 | /** @brief The OpenPOWER VPD, in binary, is specified as a |
| 16 | * sequence of characters */ |
| 17 | static_assert((8 == CHAR_BIT), "A byte is not 8 bits!"); |
| 18 | using Byte = uint8_t; |
| 19 | using Binary = std::vector<Byte>; |
Santosh Puranik | f2d3b53 | 2022-04-19 06:44:07 -0500 | [diff] [blame] | 20 | using BIOSAttrValueType = std::variant<int64_t, std::string>; |
| 21 | using PendingBIOSAttrItemType = |
| 22 | std::pair<std::string, std::tuple<std::string, BIOSAttrValueType>>; |
| 23 | using PendingBIOSAttrsType = std::vector<PendingBIOSAttrItemType>; |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 24 | |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 25 | namespace inventory |
| 26 | { |
| 27 | |
| 28 | using Path = std::string; |
| 29 | using Property = std::string; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 30 | using Value = std::variant<bool, size_t, int64_t, std::string, Binary>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 31 | using PropertyMap = std::map<Property, Value>; |
jinuthomas | 6555e7e | 2023-02-14 21:48:00 -0600 | [diff] [blame] | 32 | using kwdVpdValueTypes = std::variant<size_t, Binary, std::string>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 33 | |
| 34 | using Interface = std::string; |
| 35 | using InterfaceMap = std::map<Interface, PropertyMap>; |
| 36 | |
| 37 | using Object = sdbusplus::message::object_path; |
| 38 | using ObjectMap = std::map<Object, InterfaceMap>; |
| 39 | |
SunnySrivastava1984 | de3c60d | 2020-02-03 10:34:33 -0600 | [diff] [blame] | 40 | using VPDfilepath = std::string; |
SunnySrivastava1984 | 4330654 | 2020-04-01 02:50:20 -0500 | [diff] [blame] | 41 | using FruIsMotherboard = bool; |
Santosh Puranik | a0b2391 | 2022-02-10 13:37:09 +0530 | [diff] [blame] | 42 | using FrusMap = |
| 43 | std::multimap<Path, std::tuple<VPDfilepath, VPDfilepath, FruIsMotherboard>>; |
SunnySrivastava1984 | bca5aaa | 2020-04-21 05:31:04 -0500 | [diff] [blame] | 44 | using LocationCode = std::string; |
SunnySrivastava1984 | 1356d7e | 2020-04-24 04:29:35 -0500 | [diff] [blame] | 45 | using LocationCodeMap = std::unordered_multimap<LocationCode, Path>; |
| 46 | using ListOfPaths = std::vector<sdbusplus::message::object_path>; |
SunnySrivastava1984 | fb5815a | 2020-04-24 08:03:52 -0500 | [diff] [blame] | 47 | using NodeNumber = uint16_t; |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 48 | using KeywordVpdMap = std::unordered_map<std::string, kwdVpdValueTypes>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 49 | |
Alpana Kumari | 65b8360 | 2020-09-01 00:24:56 -0500 | [diff] [blame] | 50 | using systemType = std::string; |
| 51 | using deviceTree = std::string; |
| 52 | using deviceTreeMap = std::unordered_map<systemType, deviceTree>; |
SunnySrivastava1984 | a20be8e | 2020-08-26 02:00:50 -0500 | [diff] [blame] | 53 | using PelAdditionalData = std::map<std::string, std::string>; |
SunnySrivastava1984 | 9094d4f | 2020-08-05 09:32:29 -0500 | [diff] [blame] | 54 | using Keyword = std::string; |
| 55 | using KeywordData = std::string; |
| 56 | using DbusPropertyMap = std::unordered_map<Keyword, KeywordData>; |
| 57 | using PelAdditionalData = std::map<std::string, std::string>; |
| 58 | using Service = std::string; |
| 59 | using MapperResponse = |
| 60 | std::map<Path, std::map<Service, std::vector<Interface>>>; |
| 61 | using RestoredEeproms = std::tuple<Path, std::string, Keyword, Binary>; |
SunnySrivastava1984 | 9a19554 | 2020-09-07 06:04:50 -0500 | [diff] [blame] | 62 | using ReplaceableFrus = std::vector<VPDfilepath>; |
Sunny Srivastava | fdf9ff2 | 2022-06-15 11:15:54 -0500 | [diff] [blame] | 63 | using EssentialFrus = std::vector<Path>; |
Priyanga Ramasamy | 952d6c5 | 2022-11-07 07:20:24 -0600 | [diff] [blame] | 64 | using RecordName = std::string; |
| 65 | using KeywordDefault = Binary; |
| 66 | using isPELReqOnRestoreFailure = bool; |
| 67 | using isMFGResetRequired = bool; |
| 68 | using SystemKeywordInfo = |
| 69 | std::tuple<Keyword, KeywordDefault, isPELReqOnRestoreFailure, |
| 70 | isMFGResetRequired>; |
| 71 | |
| 72 | /** Map of system backplane records to list of keywords and its related data. { |
| 73 | * Record : { Keyword, Default value, Is PEL required on restore failure, Is MFG |
| 74 | * reset required }} **/ |
| 75 | using SystemKeywordsMap = |
| 76 | std::unordered_map<RecordName, std::vector<SystemKeywordInfo>>; |
Priyanga Ramasamy | 6d5e734 | 2022-10-14 07:17:25 -0500 | [diff] [blame] | 77 | |
| 78 | using GetAllResultType = std::vector<std::pair<Keyword, Value>>; |
| 79 | using IntfPropMap = std::map<RecordName, GetAllResultType>; |
Priyanga Ramasamy | 124ae6c | 2022-10-18 12:46:14 -0500 | [diff] [blame] | 80 | using RecKwValMap = |
| 81 | std::unordered_map<RecordName, std::unordered_map<Keyword, Binary>>; |
Deepak Kodihalli | 7679449 | 2017-02-16 23:48:18 -0600 | [diff] [blame] | 82 | } // namespace inventory |
| 83 | |
Deepak Kodihalli | 35c7fb1 | 2016-11-21 04:32:44 -0600 | [diff] [blame] | 84 | } // namespace vpd |
Alpana Kumari | 3ab26a7 | 2021-04-05 19:09:19 +0000 | [diff] [blame] | 85 | } // namespace openpower |