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