Jim Yuan | f5da1de | 2019-03-25 09:49:24 -0700 | [diff] [blame] | 1 | From ed60d5736559c4e100e5db20de942a584b58b6f0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jim Yuan <jim.yuan@supermicro.com> |
| 3 | Date: Wed, 25 May 2016 15:24:40 -0700 |
| 4 | Subject: [PATCH 08/14] Fill board mfg time and date in FRU3. It is read from |
| 5 | PVPD:VNDR:IN. |
| 6 | |
| 7 | Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> |
| 8 | --- |
| 9 | src/usr/ipmiext/ipmifruinv.C | 65 +++++++++++++++++++++++++++++++++----------- |
| 10 | 1 file changed, 49 insertions(+), 16 deletions(-) |
| 11 | |
| 12 | diff --git a/src/usr/ipmiext/ipmifruinv.C b/src/usr/ipmiext/ipmifruinv.C |
| 13 | index 23aaf9b97..11fbd7677 100644 |
| 14 | --- a/src/usr/ipmiext/ipmifruinv.C |
| 15 | +++ b/src/usr/ipmiext/ipmifruinv.C |
| 16 | @@ -1279,31 +1279,64 @@ errlHndl_t backplaneIpmiFruInv::buildChassisInfoArea( |
| 17 | return l_errl; |
| 18 | } |
| 19 | |
| 20 | +// Quick hexdigit to binary converter. |
| 21 | +// Hopefull someday to replaced by strtoul |
| 22 | +uint8_t aschex2bin(char c) |
| 23 | +{ |
| 24 | + if(c >= 'a' && c <= 'f') |
| 25 | + { |
| 26 | + c = c + 10 - 'a'; |
| 27 | + } |
| 28 | + else if (c >= 'A' && c <= 'F') |
| 29 | + { |
| 30 | + c = c + 10 - 'A'; |
| 31 | + } |
| 32 | + else if (c >= '0' && c <= '9') |
| 33 | + { |
| 34 | + c -= '0'; |
| 35 | + } |
| 36 | + else return 0;// else it's not a hex digit, return 0 |
| 37 | + |
| 38 | + return c; |
| 39 | +} |
| 40 | + |
| 41 | + |
| 42 | errlHndl_t backplaneIpmiFruInv::buildBoardInfoArea( |
| 43 | std::vector<uint8_t> &io_data) |
| 44 | { |
| 45 | errlHndl_t l_errl = NULL; |
| 46 | + std::vector<uint8_t> oem_data; //jim052316 |
| 47 | + uint8_t i, data1, data2, data3;//jim052316 |
| 48 | |
| 49 | do { |
| 50 | //Set formatting data that goes at the beginning of the record |
| 51 | preFormatProcessing(io_data, true); |
| 52 | |
| 53 | - // Set Mfg Build date |
| 54 | - // Grab VPD data into seperate data vector |
| 55 | - std::vector<uint8_t> mfgDateData; |
| 56 | - l_errl = addVpdData(mfgDateData, PVPD::OPFR, PVPD::MB, false, false); |
| 57 | - if (l_errl) |
| 58 | - { |
| 59 | - // The MB keyword was optional on older cards so just ignore |
| 60 | - // any errors |
| 61 | - delete l_errl; |
| 62 | - l_errl = NULL; |
| 63 | - } |
| 64 | - else |
| 65 | - { |
| 66 | - // Pass that to the function that sets the Build date |
| 67 | - setMfgData(io_data, mfgDateData); |
| 68 | - } |
| 69 | + l_errl = addVpdData(oem_data, PVPD::VNDR, PVPD::IN, true); |
| 70 | + if (l_errl) { break; } |
| 71 | + |
| 72 | + for (i=0; i < oem_data.size(); i++) |
| 73 | + TRACFCOMP(g_trac_ipmi,"Jimdebug board VNDR:IN data is 0x%x", oem_data[i]); |
| 74 | + |
| 75 | + data1 = (aschex2bin(oem_data[5]) << 4) | aschex2bin(oem_data[6]);//jim052416 |
| 76 | + data2 = (aschex2bin(oem_data[3]) << 4) | aschex2bin(oem_data[4]); |
| 77 | + data3 = (aschex2bin(oem_data[1]) << 4) | aschex2bin(oem_data[2]); |
| 78 | + |
| 79 | + |
| 80 | + TRACFCOMP(g_trac_ipmi,"Jimdebug push data1 is 0x%x", data1); |
| 81 | + TRACFCOMP(g_trac_ipmi,"Jimdebug push data2 is 0x%x", data2); |
| 82 | + TRACFCOMP(g_trac_ipmi,"Jimdebug push data3 is 0x%x", data3); |
| 83 | + |
| 84 | + |
| 85 | + io_data.push_back(data1); |
| 86 | + io_data.push_back(data2); |
| 87 | + io_data.push_back(data3); |
| 88 | + |
| 89 | + |
| 90 | + //Set MFG Date/Time - Blank |
| 91 | + //io_data.push_back(0x5E); //jim52016 |
| 92 | + //io_data.push_back(0x9A); |
| 93 | + //io_data.push_back(0xA3); |
| 94 | |
| 95 | //Set Vendor Name - ascii formatted data |
| 96 | l_errl = addVpdData(io_data, PVPD::OPFR, PVPD::VN, true); |
| 97 | -- |
| 98 | 2.16.2.windows.1 |
| 99 | |