Lines Matching +full:version +full:- +full:minor
7 #include <phosphor-logging/elog-errors.hpp>
8 #include <phosphor-logging/lg2.hpp>
12 #include <xyz/openbmc_project/Software/Version/server.hpp>
34 static constexpr auto versionIntf = "xyz.openbmc_project.Software.Version";
43 using Version = sdbusplus::server::xyz::openbmc_project::software::Version; typedef
50 * @brief Returns the Version info from primary s/w object
52 * Get the Version info from the active s/w object which is having high
57 * @return On success returns the Version info from primary s/w object.
67 ipmi::getAllDbusObjects(*ctx->bus, softwareRoot, redundancyIntf); in getActiveSoftwareVersionInfo()
81 ipmi::getService(*ctx->bus, redundancyIntf, softObject.first); in getActiveSoftwareVersionInfo()
83 ipmi::getManagedObjects(*ctx->bus, service, softwareRoot); in getActiveSoftwareVersionInfo()
100 auto version = in getActiveSoftwareVersionInfo() local
101 std::get<std::string>(versionProps.at("Version")); in getActiveSoftwareVersionInfo()
102 if ((Version::convertVersionPurposeFromString(purpose) == in getActiveSoftwareVersionInfo()
103 Version::VersionPurpose::BMC) && in getActiveSoftwareVersionInfo()
111 revision = std::move(version); in getActiveSoftwareVersionInfo()
155 char minor; member
160 /* Major (X) and Minor (Y) version. */
162 /* version = 2.14.0-dev */
164 /* | |---------------- Minor */
165 /* |------------------ Major */
167 /* Default regex string only tries to match Major and Minor version. */
169 /* To match more firmware version info, platforms need to define it own */
174 /* matches[1]: matched index for minor ver */
180 /* regex = "([\d]+).([\d]+).([\d]+)-dev-([\d]+)-g([0-9a-fA-F]{2}) */
181 /* ([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})" */
183 /* version = 2.14.0-dev-750-g37a7c5ad1-dirty */
186 /* | | | | | | | |-- Aux byte 3 (0xAD), index 8 */
187 /* | | | | | | |---- Aux byte 2 (0xC5), index 7 */
188 /* | | | | | |------ Aux byte 1 (0xA7), index 6 */
189 /* | | | | |-------- Aux byte 0 (0x37), index 5 */
190 /* | | | |------------- Not used, index 4 */
191 /* | | |------------------- Not used, index 3 */
192 /* | |---------------------- Minor (14), index 2 */
193 /* |------------------------ Major (2), index 1 */
208 return -1; in convertVersion()
218 return -1; in convertVersion()
222 { // For the platforms use year as major version, it would expect to in convertVersion()
223 // have major version between 0 - 99. If the major version is in convertVersion()
225 // converted to 0 - 99. in convertVersion()
234 // convert minor in convertVersion()
240 { // failed to convert minor string in convertVersion()
241 return -1; in convertVersion()
243 r.minor = val & 0xFF; in convertVersion()
270 return -1; in convertVersion()
279 return -1; in convertVersion()
283 * @param[in] ctx - shared_ptr to an IPMI context struct
286 * - Device ID (manufacturer defined)
287 * - Device revision[4 bits]; reserved[3 bits]; SDR support[1 bit]
288 * - FW revision major[7 bits] (binary encoded); available[1 bit]
289 * - FW Revision minor (BCD encoded)
290 * - IPMI version (0x02 for IPMI 2.0)
291 * - device support (bitfield of supported options)
292 * - MFG IANA ID (3 bytes)
293 * - product ID (2 bytes)
294 * - AUX info (4 bytes)
299 uint8_t, // Firmware Revision minor
300 uint8_t, // IPMI version
321 const char* filename = "/usr/share/ipmi-providers/dev_id.json"; in ipmiAppGetDeviceId()
328 int r = -1; in ipmiAppGetDeviceId()
332 auto version = getActiveSoftwareVersionInfo(ctx); in ipmiAppGetDeviceId() local
333 r = convertVersion(version, rev); in ipmiAppGetDeviceId()
345 // or self-initialization in progress. in ipmiAppGetDeviceId()
350 rev.minor = (rev.minor > 99 ? 99 : rev.minor); in ipmiAppGetDeviceId()
351 devId.fw[1] = rev.minor % 10 + (rev.minor / 10) * 16; in ipmiAppGetDeviceId()
358 // IPMI Spec version 2.0 in ipmiAppGetDeviceId()
385 if (firmwareRevision.contains("minor")) in ipmiAppGetDeviceId()
387 firmwareRevision.at("minor").get_to(devId.fw[1]); in ipmiAppGetDeviceId()