vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 1 | #include "apphandler.h" |
Patrick Venture | 5794fcf | 2017-10-26 11:11:14 -0700 | [diff] [blame] | 2 | #include "app/channel.hpp" |
Patrick Venture | 5e6ac71 | 2017-10-25 12:16:19 -0700 | [diff] [blame] | 3 | #include "app/watchdog.hpp" |
Patrick Williams | 37af733 | 2016-09-02 21:21:42 -0500 | [diff] [blame] | 4 | #include "host-ipmid/ipmid-api.h" |
Patrick Williams | 53a360e | 2016-08-12 22:01:02 -0500 | [diff] [blame] | 5 | #include "ipmid.hpp" |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 6 | #include "nlohmann/json.hpp" |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 7 | #include "types.hpp" |
| 8 | #include "utils.hpp" |
| 9 | |
Vernon Mauery | 185b9f8 | 2018-07-20 10:52:36 -0700 | [diff] [blame] | 10 | #if __has_include(<filesystem>) |
| 11 | #include <filesystem> |
| 12 | #elif __has_include(<experimental/filesystem>) |
| 13 | #include <experimental/filesystem> |
| 14 | namespace std { |
| 15 | // splice experimental::filesystem into std |
| 16 | namespace filesystem = std::experimental::filesystem; |
| 17 | } |
| 18 | #else |
| 19 | # error filesystem not available |
| 20 | #endif |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 21 | #include <fstream> |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 22 | #include <stdio.h> |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 23 | #include <stdint.h> |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 24 | #include <systemd/sd-bus.h> |
Sergey Solomin | eb9b814 | 2016-08-23 09:07:28 -0500 | [diff] [blame] | 25 | #include <mapper.h> |
Nan Li | ee0cb90 | 2016-07-11 15:38:03 +0800 | [diff] [blame] | 26 | #include <array> |
Tom Joseph | 69fabfe | 2017-08-04 10:15:01 +0530 | [diff] [blame] | 27 | #include <vector> |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 28 | #include <string> |
| 29 | #include <cstddef> |
Ratan Gupta | 62736ec | 2017-09-02 12:02:47 +0530 | [diff] [blame] | 30 | |
Nan Li | 3d0df91 | 2016-10-18 19:51:41 +0800 | [diff] [blame] | 31 | #include <arpa/inet.h> |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 32 | #include "transporthandler.hpp" |
| 33 | |
| 34 | #include <phosphor-logging/log.hpp> |
| 35 | #include <phosphor-logging/elog-errors.hpp> |
| 36 | #include "xyz/openbmc_project/Common/error.hpp" |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 37 | #include "xyz/openbmc_project/Software/Version/server.hpp" |
| 38 | #include "xyz/openbmc_project/Software/Activation/server.hpp" |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 39 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 40 | extern sd_bus *bus; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 41 | |
Marri Devender Rao | 5e007a5 | 2018-01-08 06:18:36 -0600 | [diff] [blame] | 42 | constexpr auto bmc_interface = "xyz.openbmc_project.Inventory.Item.Bmc"; |
| 43 | constexpr auto bmc_guid_interface = "xyz.openbmc_project.Common.UUID"; |
| 44 | constexpr auto bmc_guid_property = "UUID"; |
| 45 | constexpr auto bmc_guid_len = 16; |
| 46 | |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 47 | static constexpr auto redundancyIntf = |
| 48 | "xyz.openbmc_project.Software.RedundancyPriority"; |
| 49 | static constexpr auto versionIntf = |
| 50 | "xyz.openbmc_project.Software.Version"; |
| 51 | static constexpr auto activationIntf = |
| 52 | "xyz.openbmc_project.Software.Activation"; |
| 53 | static constexpr auto softwareRoot = "/xyz/openbmc_project/software"; |
| 54 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 55 | void register_netfn_app_functions() __attribute__((constructor)); |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 56 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 57 | using namespace phosphor::logging; |
| 58 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 59 | using Version = sdbusplus::xyz::openbmc_project::Software::server::Version; |
| 60 | using Activation = |
| 61 | sdbusplus::xyz::openbmc_project::Software::server::Activation; |
Vernon Mauery | 185b9f8 | 2018-07-20 10:52:36 -0700 | [diff] [blame] | 62 | namespace fs = std::filesystem; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 63 | |
Nan Li | ee0cb90 | 2016-07-11 15:38:03 +0800 | [diff] [blame] | 64 | // Offset in get device id command. |
| 65 | typedef struct |
| 66 | { |
| 67 | uint8_t id; |
| 68 | uint8_t revision; |
| 69 | uint8_t fw[2]; |
| 70 | uint8_t ipmi_ver; |
| 71 | uint8_t addn_dev_support; |
| 72 | uint8_t manuf_id[3]; |
| 73 | uint8_t prod_id[2]; |
| 74 | uint8_t aux[4]; |
| 75 | }__attribute__((packed)) ipmi_device_id_t; |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 76 | |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 77 | /** |
| 78 | * @brief Returns the Version info from primary s/w object |
| 79 | * |
| 80 | * Get the Version info from the active s/w object which is having high |
| 81 | * "Priority" value(a smaller number is a higher priority) and "Purpose" |
| 82 | * is "BMC" from the list of all s/w objects those are implementing |
| 83 | * RedundancyPriority interface from the given softwareRoot path. |
| 84 | * |
| 85 | * @return On success returns the Version info from primary s/w object. |
| 86 | * |
| 87 | */ |
| 88 | std::string getActiveSoftwareVersionInfo() |
| 89 | { |
| 90 | sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()}; |
| 91 | |
| 92 | std::string revision{}; |
| 93 | auto objectTree = ipmi::getAllDbusObjects(bus, softwareRoot, redundancyIntf, |
| 94 | ""); |
| 95 | if (objectTree.empty()) |
| 96 | { |
| 97 | log<level::ERR>("No Obj has implemented the s/w redundancy interface", |
| 98 | entry("INTERFACE=%s", redundancyIntf)); |
| 99 | elog<InternalFailure>(); |
| 100 | } |
| 101 | |
| 102 | auto objectFound = false; |
| 103 | for (auto& softObject : objectTree) |
| 104 | { |
| 105 | auto service = ipmi::getService(bus, redundancyIntf, softObject.first); |
| 106 | auto objValueTree = ipmi::getManagedObjects(bus, service, softwareRoot); |
| 107 | |
| 108 | auto minPriority = 0xFF; |
| 109 | for (const auto& objIter : objValueTree) |
| 110 | { |
| 111 | try |
| 112 | { |
| 113 | auto& intfMap = objIter.second; |
| 114 | auto& redundancyPriorityProps = intfMap.at(redundancyIntf); |
| 115 | auto& versionProps = intfMap.at(versionIntf); |
| 116 | auto& activationProps = intfMap.at(activationIntf); |
| 117 | auto priority = |
| 118 | redundancyPriorityProps.at("Priority").get<uint8_t>(); |
| 119 | auto purpose = versionProps.at("Purpose").get<std::string>(); |
| 120 | auto activation = |
| 121 | activationProps.at("Activation").get<std::string>(); |
| 122 | auto version = versionProps.at("Version").get<std::string>(); |
| 123 | if ((Version::convertVersionPurposeFromString(purpose) == |
| 124 | Version::VersionPurpose::BMC) && |
| 125 | (Activation::convertActivationsFromString(activation) == |
| 126 | Activation::Activations::Active)) |
| 127 | { |
| 128 | if (priority < minPriority) |
| 129 | { |
| 130 | minPriority = priority; |
| 131 | objectFound = true; |
| 132 | revision = std::move(version); |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | catch (const std::exception& e) |
| 137 | { |
| 138 | log<level::ERR>(e.what()); |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | if (!objectFound) |
| 144 | { |
| 145 | log<level::ERR>("Could not found an BMC software Object"); |
| 146 | elog<InternalFailure>(); |
| 147 | } |
| 148 | |
| 149 | return revision; |
| 150 | } |
| 151 | |
| 152 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 153 | ipmi_ret_t ipmi_app_set_acpi_power_state(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 154 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 155 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 156 | { |
| 157 | ipmi_ret_t rc = IPMI_CC_OK; |
| 158 | *data_len = 0; |
| 159 | |
Aditya Saripalli | 5fb1460 | 2017-11-09 14:46:27 +0530 | [diff] [blame] | 160 | log<level::DEBUG>("IPMI SET ACPI STATE Ignoring for now\n"); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 161 | return rc; |
| 162 | } |
| 163 | |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 164 | typedef struct |
| 165 | { |
| 166 | char major; |
| 167 | char minor; |
Chris Austen | 176c965 | 2016-04-30 16:32:17 -0500 | [diff] [blame] | 168 | uint16_t d[2]; |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 169 | } rev_t; |
| 170 | |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 171 | /* Currently supports the vx.x-x-[-x] and v1.x.x-x-[-x] format. It will */ |
| 172 | /* return -1 if not in those formats, this routine knows how to parse */ |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 173 | /* version = v0.6-19-gf363f61-dirty */ |
| 174 | /* ^ ^ ^^ ^ */ |
| 175 | /* | | |----------|-- additional details */ |
| 176 | /* | |---------------- Minor */ |
| 177 | /* |------------------ Major */ |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 178 | /* and version = v1.99.10-113-g65edf7d-r3-0-g9e4f715 */ |
| 179 | /* ^ ^ ^^ ^ */ |
| 180 | /* | | |--|---------- additional details */ |
| 181 | /* | |---------------- Minor */ |
| 182 | /* |------------------ Major */ |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 183 | /* Additional details : If the option group exists it will force Auxiliary */ |
| 184 | /* Firmware Revision Information 4th byte to 1 indicating the build was */ |
| 185 | /* derived with additional edits */ |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 186 | int convert_version(const char * p, rev_t *rev) |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 187 | { |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 188 | std::string s(p); |
| 189 | std::string token; |
Chris Austen | 176c965 | 2016-04-30 16:32:17 -0500 | [diff] [blame] | 190 | uint16_t commits; |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 191 | |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 192 | auto location = s.find_first_of('v'); |
| 193 | if (location != std::string::npos) |
| 194 | { |
| 195 | s = s.substr(location+1); |
Chris Austen | 176c965 | 2016-04-30 16:32:17 -0500 | [diff] [blame] | 196 | } |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 197 | |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 198 | if (!s.empty()) |
| 199 | { |
| 200 | location = s.find_first_of("."); |
| 201 | if (location != std::string::npos) |
| 202 | { |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 203 | rev->major = static_cast<char>( |
| 204 | std::stoi(s.substr(0, location), 0, 16)); |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 205 | token = s.substr(location+1); |
| 206 | } |
Chris Austen | 176c965 | 2016-04-30 16:32:17 -0500 | [diff] [blame] | 207 | |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 208 | if (!token.empty()) |
| 209 | { |
| 210 | location = token.find_first_of(".-"); |
| 211 | if (location != std::string::npos) |
| 212 | { |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 213 | rev->minor = static_cast<char>( |
| 214 | std::stoi(token.substr(0, location), 0, 16)); |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 215 | token = token.substr(location+1); |
| 216 | } |
| 217 | } |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 218 | |
Dinesh Chinari | 2b7e07d | 2017-11-08 15:38:50 -0600 | [diff] [blame] | 219 | // Capture the number of commits on top of the minor tag. |
| 220 | // I'm using BE format like the ipmi spec asked for |
| 221 | location = token.find_first_of(".-"); |
| 222 | if (!token.empty()) |
| 223 | { |
| 224 | commits = std::stoi(token.substr(0, location), 0, 16); |
| 225 | rev->d[0] = (commits>>8) | (commits<<8); |
| 226 | |
| 227 | // commit number we skip |
| 228 | location = token.find_first_of(".-"); |
| 229 | if (location != std::string::npos) |
| 230 | { |
| 231 | token = token.substr(location+1); |
| 232 | } |
| 233 | } |
| 234 | else { |
| 235 | rev->d[0] = 0; |
| 236 | } |
| 237 | |
| 238 | if (location != std::string::npos) |
| 239 | { |
| 240 | token = token.substr(location+1); |
| 241 | } |
| 242 | |
| 243 | // Any value of the optional parameter forces it to 1 |
| 244 | location = token.find_first_of(".-"); |
| 245 | if (location != std::string::npos) |
| 246 | { |
| 247 | token = token.substr(location+1); |
| 248 | } |
| 249 | commits = (!token.empty()) ? 1 : 0; |
| 250 | |
| 251 | //We do this operation to get this displayed in least significant bytes |
| 252 | //of ipmitool device id command. |
| 253 | rev->d[1] = (commits>>8) | (commits<<8); |
| 254 | } |
| 255 | |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 256 | return 0; |
| 257 | } |
| 258 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 259 | ipmi_ret_t ipmi_app_get_device_id(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 260 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 261 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 262 | { |
| 263 | ipmi_ret_t rc = IPMI_CC_OK; |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 264 | int r = -1; |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 265 | rev_t rev = {0}; |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 266 | static ipmi_device_id_t dev_id{}; |
| 267 | static bool dev_id_initialized = false; |
| 268 | const char* filename = "/usr/share/ipmi-providers/dev_id.json"; |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 269 | |
| 270 | // Data length |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 271 | *data_len = sizeof(dev_id); |
| 272 | |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 273 | if (!dev_id_initialized) |
| 274 | { |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 275 | try |
| 276 | { |
| 277 | auto version = getActiveSoftwareVersionInfo(); |
| 278 | r = convert_version(version.c_str(), &rev); |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 279 | } |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 280 | catch (const std::exception& e) |
| 281 | { |
| 282 | log<level::ERR>(e.what()); |
| 283 | } |
Nan Li | ee0cb90 | 2016-07-11 15:38:03 +0800 | [diff] [blame] | 284 | |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 285 | if( r >= 0 ) { |
| 286 | // bit7 identifies if the device is available |
| 287 | // 0=normal operation |
| 288 | // 1=device firmware, SDR update, |
| 289 | // or self-initialization in progress. |
| 290 | // our SDR is normal working condition, so mask: |
| 291 | dev_id.fw[0] = 0x7F & rev.major; |
| 292 | |
| 293 | rev.minor = (rev.minor > 99 ? 99 : rev.minor); |
| 294 | dev_id.fw[1] = rev.minor % 10 + (rev.minor / 10) * 16; |
| 295 | memcpy(&dev_id.aux, rev.d, 4); |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 296 | } |
Nan Li | ee0cb90 | 2016-07-11 15:38:03 +0800 | [diff] [blame] | 297 | |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 298 | // IPMI Spec version 2.0 |
| 299 | dev_id.ipmi_ver = 2; |
Adriana Kobylak | 0e91264 | 2016-06-22 16:54:39 -0500 | [diff] [blame] | 300 | |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 301 | std::ifstream dev_id_file(filename); |
| 302 | if (dev_id_file.is_open()) |
| 303 | { |
| 304 | auto data = nlohmann::json::parse(dev_id_file, nullptr, false); |
| 305 | if (!data.is_discarded()) |
| 306 | { |
| 307 | dev_id.id = data.value("id", 0); |
| 308 | dev_id.revision = data.value("revision", 0); |
| 309 | dev_id.addn_dev_support = data.value("addn_dev_support", 0); |
| 310 | dev_id.manuf_id[2] = data.value("manuf_id", 0) >> 16; |
| 311 | dev_id.manuf_id[1] = data.value("manuf_id", 0) >> 8; |
| 312 | dev_id.manuf_id[0] = data.value("manuf_id", 0); |
| 313 | dev_id.prod_id[1] = data.value("prod_id", 0) >> 8; |
| 314 | dev_id.prod_id[0] = data.value("prod_id", 0); |
Tom Joseph | af8a098 | 2018-03-09 07:54:02 -0600 | [diff] [blame] | 315 | dev_id.aux[3] = data.value("aux", 0); |
| 316 | dev_id.aux[2] = data.value("aux", 0) >> 8; |
| 317 | dev_id.aux[1] = data.value("aux", 0) >> 16; |
| 318 | dev_id.aux[0] = data.value("aux", 0) >> 24; |
David Cobbley | a1adb07 | 2017-11-21 15:58:13 -0800 | [diff] [blame] | 319 | |
| 320 | //Don't read the file every time if successful |
| 321 | dev_id_initialized = true; |
| 322 | } |
| 323 | else |
| 324 | { |
| 325 | log<level::ERR>("Device ID JSON parser failure"); |
| 326 | rc = IPMI_CC_UNSPECIFIED_ERROR; |
| 327 | } |
| 328 | } |
| 329 | else |
| 330 | { |
| 331 | log<level::ERR>("Device ID file not found"); |
| 332 | rc = IPMI_CC_UNSPECIFIED_ERROR; |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 333 | } |
| 334 | } |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 335 | |
| 336 | // Pack the actual response |
Chris Austen | 7303bdc | 2016-04-17 11:50:54 -0500 | [diff] [blame] | 337 | memcpy(response, &dev_id, *data_len); |
Nagaraju Goruganti | 744398d | 2018-02-20 09:52:00 -0600 | [diff] [blame] | 338 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 339 | return rc; |
| 340 | } |
| 341 | |
Nan Li | 41fa24a | 2016-11-10 20:12:37 +0800 | [diff] [blame] | 342 | ipmi_ret_t ipmi_app_get_self_test_results(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 343 | ipmi_request_t request, ipmi_response_t response, |
| 344 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 345 | { |
| 346 | ipmi_ret_t rc = IPMI_CC_OK; |
| 347 | |
| 348 | // Byte 2: |
| 349 | // 55h - No error. |
Gunnar Mills | 8991dd6 | 2017-10-25 17:11:29 -0500 | [diff] [blame] | 350 | // 56h - Self Test function not implemented in this controller. |
Nan Li | 41fa24a | 2016-11-10 20:12:37 +0800 | [diff] [blame] | 351 | // 57h - Corrupted or inaccesssible data or devices. |
| 352 | // 58h - Fatal hardware error. |
| 353 | // FFh - reserved. |
| 354 | // all other: Device-specific 'internal failure'. |
| 355 | // Byte 3: |
| 356 | // For byte 2 = 55h, 56h, FFh: 00h |
| 357 | // For byte 2 = 58h, all other: Device-specific |
| 358 | // For byte 2 = 57h: self-test error bitfield. |
| 359 | // Note: returning 57h does not imply that all test were run. |
| 360 | // [7] 1b = Cannot access SEL device. |
| 361 | // [6] 1b = Cannot access SDR Repository. |
| 362 | // [5] 1b = Cannot access BMC FRU device. |
| 363 | // [4] 1b = IPMB signal lines do not respond. |
| 364 | // [3] 1b = SDR Repository empty. |
| 365 | // [2] 1b = Internal Use Area of BMC FRU corrupted. |
| 366 | // [1] 1b = controller update 'boot block' firmware corrupted. |
| 367 | // [0] 1b = controller operational firmware corrupted. |
| 368 | |
| 369 | char selftestresults[2] = {0}; |
| 370 | |
| 371 | *data_len = 2; |
| 372 | |
| 373 | selftestresults[0] = 0x56; |
| 374 | selftestresults[1] = 0; |
| 375 | |
| 376 | memcpy(response, selftestresults, *data_len); |
| 377 | |
| 378 | return rc; |
| 379 | } |
| 380 | |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 381 | ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 382 | ipmi_request_t request, ipmi_response_t response, |
| 383 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 384 | { |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 385 | const char *objname = "/org/openbmc/control/chassis0"; |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 386 | const char *iface = "org.freedesktop.DBus.Properties"; |
| 387 | const char *chassis_iface = "org.openbmc.control.Chassis"; |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 388 | sd_bus_message *reply = NULL; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 389 | sd_bus_error error = SD_BUS_ERROR_NULL; |
| 390 | int r = 0; |
| 391 | char *uuid = NULL; |
Sergey Solomin | eb9b814 | 2016-08-23 09:07:28 -0500 | [diff] [blame] | 392 | char *busname = NULL; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 393 | |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 394 | // UUID is in RFC4122 format. Ex: 61a39523-78f2-11e5-9862-e6402cfc3223 |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 395 | // Per IPMI Spec 2.0 need to convert to 16 hex bytes and reverse the byte |
| 396 | // order |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 397 | // Ex: 0x2332fc2c40e66298e511f2782395a361 |
| 398 | |
| 399 | const int resp_size = 16; // Response is 16 hex bytes per IPMI Spec |
| 400 | uint8_t resp_uuid[resp_size]; // Array to hold the formatted response |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 401 | // Point resp end of array to save in reverse order |
| 402 | int resp_loc = resp_size-1; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 403 | int i = 0; |
| 404 | char *tokptr = NULL; |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 405 | char *id_octet = NULL; |
| 406 | |
| 407 | // Status code. |
| 408 | ipmi_ret_t rc = IPMI_CC_OK; |
| 409 | *data_len = 0; |
| 410 | |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 411 | // Call Get properties method with the interface and property name |
Sergey Solomin | eb9b814 | 2016-08-23 09:07:28 -0500 | [diff] [blame] | 412 | r = mapper_get_service(bus, objname, &busname); |
| 413 | if (r < 0) { |
Aditya Saripalli | 5fb1460 | 2017-11-09 14:46:27 +0530 | [diff] [blame] | 414 | log<level::ERR>("Failed to get bus name", |
| 415 | entry("BUS=%s", objname), |
| 416 | entry("ERRNO=0x%X", -r)); |
Sergey Solomin | eb9b814 | 2016-08-23 09:07:28 -0500 | [diff] [blame] | 417 | goto finish; |
| 418 | } |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 419 | r = sd_bus_call_method(bus,busname,objname,iface, |
| 420 | "Get",&error, &reply, "ss", |
| 421 | chassis_iface, "uuid"); |
| 422 | if (r < 0) |
| 423 | { |
Aditya Saripalli | 5fb1460 | 2017-11-09 14:46:27 +0530 | [diff] [blame] | 424 | log<level::ERR>("Failed to call Get Method", |
| 425 | entry("ERRNO=0x%X", -r)); |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 426 | rc = IPMI_CC_UNSPECIFIED_ERROR; |
| 427 | goto finish; |
| 428 | } |
| 429 | |
| 430 | r = sd_bus_message_read(reply, "v", "s", &uuid); |
| 431 | if (r < 0 || uuid == NULL) |
| 432 | { |
Aditya Saripalli | 5fb1460 | 2017-11-09 14:46:27 +0530 | [diff] [blame] | 433 | log<level::ERR>("Failed to get a response", |
| 434 | entry("ERRNO=0x%X", -r)); |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 435 | rc = IPMI_CC_RESPONSE_ERROR; |
| 436 | goto finish; |
| 437 | } |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 438 | |
| 439 | // Traverse the UUID |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 440 | // Get the UUID octects separated by dash |
| 441 | id_octet = strtok_r(uuid, "-", &tokptr); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 442 | |
| 443 | if (id_octet == NULL) |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 444 | { |
| 445 | // Error |
Aditya Saripalli | 5fb1460 | 2017-11-09 14:46:27 +0530 | [diff] [blame] | 446 | log<level::ERR>("Unexpected UUID format", |
| 447 | entry("UUID=%s", uuid)); |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 448 | rc = IPMI_CC_RESPONSE_ERROR; |
| 449 | goto finish; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | while (id_octet != NULL) |
| 453 | { |
| 454 | // Calculate the octet string size since it varies |
| 455 | // Divide it by 2 for the array size since 1 byte is built from 2 chars |
| 456 | int tmp_size = strlen(id_octet)/2; |
| 457 | |
| 458 | for(i = 0; i < tmp_size; i++) |
| 459 | { |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 460 | // Holder of the 2 chars that will become a byte |
| 461 | char tmp_array[3] = {0}; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 462 | strncpy(tmp_array, id_octet, 2); // 2 chars at a time |
| 463 | |
| 464 | int resp_byte = strtoul(tmp_array, NULL, 16); // Convert to hex byte |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 465 | // Copy end to first |
| 466 | memcpy((void*)&resp_uuid[resp_loc], &resp_byte, 1); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 467 | resp_loc--; |
| 468 | id_octet+=2; // Finished with the 2 chars, advance |
| 469 | } |
| 470 | id_octet=strtok_r(NULL, "-", &tokptr); // Get next octet |
| 471 | } |
| 472 | |
| 473 | // Data length |
| 474 | *data_len = resp_size; |
| 475 | |
| 476 | // Pack the actual response |
| 477 | memcpy(response, &resp_uuid, *data_len); |
| 478 | |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 479 | finish: |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 480 | sd_bus_error_free(&error); |
vishwa | 1eaea4f | 2016-02-26 11:57:40 -0600 | [diff] [blame] | 481 | reply = sd_bus_message_unref(reply); |
Sergey Solomin | eb9b814 | 2016-08-23 09:07:28 -0500 | [diff] [blame] | 482 | free(busname); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 483 | |
| 484 | return rc; |
| 485 | } |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 486 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 487 | ipmi_ret_t ipmi_app_get_bt_capabilities(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 488 | ipmi_request_t request, ipmi_response_t response, |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 489 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 490 | { |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 491 | |
| 492 | // Status code. |
| 493 | ipmi_ret_t rc = IPMI_CC_OK; |
| 494 | |
Adriana Kobylak | 88ad815 | 2016-12-13 10:09:08 -0600 | [diff] [blame] | 495 | // Per IPMI 2.0 spec, the input and output buffer size must be the max |
| 496 | // buffer size minus one byte to allocate space for the length byte. |
| 497 | uint8_t str[] = {0x01, MAX_IPMI_BUFFER-1, MAX_IPMI_BUFFER-1, 0x0A, 0x01}; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 498 | |
| 499 | // Data length |
| 500 | *data_len = sizeof(str); |
| 501 | |
| 502 | // Pack the actual response |
| 503 | memcpy(response, &str, *data_len); |
| 504 | |
| 505 | return rc; |
| 506 | } |
| 507 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 508 | ipmi_ret_t ipmi_app_wildcard_handler(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 509 | ipmi_request_t request, ipmi_response_t response, |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 510 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 511 | { |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 512 | // Status code. |
Nan Li | 70aa8d9 | 2016-08-29 00:11:10 +0800 | [diff] [blame] | 513 | ipmi_ret_t rc = IPMI_CC_INVALID; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 514 | |
| 515 | *data_len = strlen("THIS IS WILDCARD"); |
| 516 | |
| 517 | // Now pack actual response |
| 518 | memcpy(response, "THIS IS WILDCARD", *data_len); |
| 519 | |
| 520 | return rc; |
| 521 | } |
| 522 | |
Marri Devender Rao | 5e007a5 | 2018-01-08 06:18:36 -0600 | [diff] [blame] | 523 | ipmi_ret_t ipmi_app_get_sys_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 524 | ipmi_request_t request, ipmi_response_t response, |
| 525 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 526 | |
| 527 | { |
| 528 | ipmi_ret_t rc = IPMI_CC_OK; |
| 529 | sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()}; |
| 530 | |
| 531 | try |
| 532 | { |
| 533 | // Get the Inventory object implementing BMC interface |
| 534 | ipmi::DbusObjectInfo bmcObject = |
| 535 | ipmi::getDbusObject(bus, bmc_interface); |
| 536 | |
| 537 | // Read UUID property value from bmcObject |
| 538 | // UUID is in RFC4122 format Ex: 61a39523-78f2-11e5-9862-e6402cfc3223 |
| 539 | auto variant = ipmi::getDbusProperty( |
| 540 | bus, bmcObject.second, bmcObject.first, bmc_guid_interface, |
| 541 | bmc_guid_property); |
| 542 | std::string guidProp = variant.get<std::string>(); |
| 543 | |
| 544 | // Erase "-" characters from the property value |
| 545 | guidProp.erase(std::remove(guidProp.begin(), guidProp.end(), '-'), |
| 546 | guidProp.end()); |
| 547 | |
| 548 | auto guidPropLen = guidProp.length(); |
| 549 | // Validate UUID data |
| 550 | // Divide by 2 as 1 byte is built from 2 chars |
| 551 | if ( (guidPropLen <=0) || ((guidPropLen/2) != bmc_guid_len) ) |
| 552 | |
| 553 | { |
| 554 | log<level::ERR>("Invalid UUID property value", |
| 555 | entry("UUID_LENGTH=%d", guidPropLen)); |
| 556 | return IPMI_CC_RESPONSE_ERROR; |
| 557 | } |
| 558 | |
| 559 | // Convert data in RFC4122(MSB) format to LSB format |
| 560 | // Get 2 characters at a time as 1 byte is built from 2 chars and |
| 561 | // convert to hex byte |
| 562 | // TODO: Data printed for GUID command is not as per the |
| 563 | // GUID format defined in IPMI specification 2.0 section 20.8 |
| 564 | // Ticket raised: https://sourceforge.net/p/ipmitool/bugs/501/ |
| 565 | uint8_t respGuid[bmc_guid_len]; |
| 566 | for (size_t i = 0, respLoc = (bmc_guid_len - 1); |
| 567 | i < guidPropLen && respLoc >= 0; i += 2, respLoc--) |
| 568 | { |
| 569 | auto value = static_cast<uint8_t>( |
| 570 | std::stoi(guidProp.substr(i, 2).c_str(), NULL, 16)); |
| 571 | respGuid[respLoc] = value; |
| 572 | } |
| 573 | |
| 574 | *data_len = bmc_guid_len; |
| 575 | memcpy(response, &respGuid, bmc_guid_len); |
| 576 | } |
| 577 | catch (const InternalFailure& e) |
| 578 | { |
| 579 | log<level::ERR>("Failed in reading BMC UUID property", |
| 580 | entry("INTERFACE=%s", bmc_interface), |
| 581 | entry("PROPERTY_INTERFACE=%s", bmc_guid_interface), |
| 582 | entry("PROPERTY=%s", bmc_guid_property)); |
| 583 | return IPMI_CC_UNSPECIFIED_ERROR; |
| 584 | } |
| 585 | return rc; |
| 586 | } |
| 587 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 588 | void register_netfn_app_functions() |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 589 | { |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 590 | // <Get BT Interface Capabilities> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 591 | ipmi_register_callback(NETFUN_APP, |
| 592 | IPMI_CMD_GET_CAP_BIT, |
| 593 | NULL, |
| 594 | ipmi_app_get_bt_capabilities, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 595 | PRIVILEGE_USER); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 596 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 597 | // <Wildcard Command> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 598 | ipmi_register_callback(NETFUN_APP, |
| 599 | IPMI_CMD_WILDCARD, |
| 600 | NULL, |
| 601 | ipmi_app_wildcard_handler, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 602 | PRIVILEGE_USER); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 603 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 604 | // <Reset Watchdog Timer> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 605 | ipmi_register_callback(NETFUN_APP, |
| 606 | IPMI_CMD_RESET_WD, |
| 607 | NULL, |
William A. Kennington III | 61d5f7b | 2018-02-09 15:23:53 -0800 | [diff] [blame] | 608 | ipmi_app_watchdog_reset, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 609 | PRIVILEGE_OPERATOR); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 610 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 611 | // <Set Watchdog Timer> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 612 | ipmi_register_callback(NETFUN_APP, |
| 613 | IPMI_CMD_SET_WD, |
| 614 | NULL, |
William A. Kennington III | 61d5f7b | 2018-02-09 15:23:53 -0800 | [diff] [blame] | 615 | ipmi_app_watchdog_set, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 616 | PRIVILEGE_OPERATOR); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 617 | |
William A. Kennington III | 73f4451 | 2018-02-09 15:28:46 -0800 | [diff] [blame] | 618 | // <Get Watchdog Timer> |
| 619 | ipmi_register_callback(NETFUN_APP, |
| 620 | IPMI_CMD_GET_WD, |
| 621 | NULL, |
| 622 | ipmi_app_watchdog_get, |
| 623 | PRIVILEGE_OPERATOR); |
| 624 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 625 | // <Get Device ID> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 626 | ipmi_register_callback(NETFUN_APP, |
| 627 | IPMI_CMD_GET_DEVICE_ID, |
| 628 | NULL, |
| 629 | ipmi_app_get_device_id, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 630 | PRIVILEGE_USER); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 631 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 632 | // <Get Self Test Results> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 633 | ipmi_register_callback(NETFUN_APP, |
| 634 | IPMI_CMD_GET_SELF_TEST_RESULTS, |
| 635 | NULL, |
| 636 | ipmi_app_get_self_test_results, |
| 637 | PRIVILEGE_USER); |
Nan Li | 41fa24a | 2016-11-10 20:12:37 +0800 | [diff] [blame] | 638 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 639 | // <Get Device GUID> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 640 | ipmi_register_callback(NETFUN_APP, |
| 641 | IPMI_CMD_GET_DEVICE_GUID, |
| 642 | NULL, |
| 643 | ipmi_app_get_device_guid, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 644 | PRIVILEGE_USER); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 645 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 646 | // <Set ACPI Power State> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 647 | ipmi_register_callback(NETFUN_APP, |
| 648 | IPMI_CMD_SET_ACPI, |
| 649 | NULL, |
| 650 | ipmi_app_set_acpi_power_state, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 651 | PRIVILEGE_ADMIN); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 652 | |
Tom Joseph | 69fabfe | 2017-08-04 10:15:01 +0530 | [diff] [blame] | 653 | // <Get Channel Access> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 654 | ipmi_register_callback(NETFUN_APP, |
| 655 | IPMI_CMD_GET_CHANNEL_ACCESS, |
| 656 | NULL, |
| 657 | ipmi_get_channel_access, |
| 658 | PRIVILEGE_USER); |
Tom Joseph | 69fabfe | 2017-08-04 10:15:01 +0530 | [diff] [blame] | 659 | |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 660 | // <Get Channel Info Command> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 661 | ipmi_register_callback(NETFUN_APP, |
| 662 | IPMI_CMD_GET_CHAN_INFO, |
| 663 | NULL, |
| 664 | ipmi_app_channel_info, |
Tom | 0573237 | 2016-09-06 17:21:23 +0530 | [diff] [blame] | 665 | PRIVILEGE_USER); |
Chris Austen | c2cd29d | 2016-02-05 20:02:29 -0600 | [diff] [blame] | 666 | |
Marri Devender Rao | 5e007a5 | 2018-01-08 06:18:36 -0600 | [diff] [blame] | 667 | // <Get System GUID Command> |
Patrick Venture | d211702 | 2018-02-06 08:54:37 -0800 | [diff] [blame] | 668 | ipmi_register_callback(NETFUN_APP, |
| 669 | IPMI_CMD_GET_SYS_GUID, |
| 670 | NULL, |
| 671 | ipmi_app_get_sys_guid, |
Marri Devender Rao | 5e007a5 | 2018-01-08 06:18:36 -0600 | [diff] [blame] | 672 | PRIVILEGE_USER); |
Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 673 | |
| 674 | // <Get Channel Cipher Suites Command> |
| 675 | ipmi_register_callback(NETFUN_APP, |
| 676 | IPMI_CMD_GET_CHAN_CIPHER_SUITES, |
| 677 | NULL, |
| 678 | getChannelCipherSuites, |
| 679 | PRIVILEGE_CALLBACK); |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 680 | return; |
| 681 | } |
| 682 | |