diff --git a/.gitignore b/.gitignore index 036ee263..1ec0a57e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.a *.o +*.la *.lo *.so .deps/ diff --git a/adb_parser/adb_db.cpp b/adb_parser/adb_db.cpp index 49fe2de7..75e25560 100644 --- a/adb_parser/adb_db.cpp +++ b/adb_parser/adb_db.cpp @@ -38,7 +38,7 @@ #include #include #include -#include "common/algorithm.h" +#include "common/tools_algorithm.h" #include "adb_db.h" #define CHECK_FIELD(field, node_w) \ diff --git a/adb_parser/adb_exceptionHolder.cpp b/adb_parser/adb_exceptionHolder.cpp index 2897b146..56c11eaa 100644 --- a/adb_parser/adb_exceptionHolder.cpp +++ b/adb_parser/adb_exceptionHolder.cpp @@ -107,3 +107,28 @@ void ExceptionHolder::insertNewException(const string exceptionType, string exce ExceptionHolder::adbExceptionMap[exceptionType].push_back(exceptionTxt); ExceptionHolder::exceptionCounter += 1; } + +/** + * Function: Adb::printAdbExceptionMap + * This function will pring the content of the Adb Exception Map + **/ +string ExceptionHolder::printAdbExceptionMap() +{ + string errorStr = ""; + vector fatals = ExceptionHolder::adbExceptionMap[ExceptionHolder::FATAL_EXCEPTION]; + for (vector::iterator it = fatals.begin(); it != fatals.end(); ++it) + { + errorStr += "-" + ExceptionHolder::FATAL_EXCEPTION + "- " + *it + ";"; + } + vector errors = ExceptionHolder::adbExceptionMap[ExceptionHolder::ERROR_EXCEPTION]; + for (vector::iterator it = errors.begin(); it != errors.end(); ++it) + { + errorStr += "-" + ExceptionHolder::ERROR_EXCEPTION + "- " + *it + ";"; + } + vector warnings = ExceptionHolder::adbExceptionMap[ExceptionHolder::WARN_EXCEPTION]; + for (vector::iterator it = warnings.begin(); it != warnings.end(); ++it) + { + errorStr += "-" + ExceptionHolder::WARN_EXCEPTION + "- " + "- " + *it + ";"; + } + return errorStr; +} diff --git a/adb_parser/adb_exceptionHolder.h b/adb_parser/adb_exceptionHolder.h index 0caab8d8..3755e608 100644 --- a/adb_parser/adb_exceptionHolder.h +++ b/adb_parser/adb_exceptionHolder.h @@ -54,6 +54,7 @@ class ExceptionHolder static void insertNewException(const string exceptionType, string exceptionTxt); static ExceptionsMap getAdbExceptionsMap(); static int getNumberOfExceptions(); + static string printAdbExceptionMap(); public: // VARIABLES diff --git a/adb_parser/adb_instance.cpp b/adb_parser/adb_instance.cpp index 6ebc8a85..f40000d9 100644 --- a/adb_parser/adb_instance.cpp +++ b/adb_parser/adb_instance.cpp @@ -46,7 +46,7 @@ #include -#include "common/algorithm.h" +#include "common/tools_algorithm.h" #include "common/tools_regex.h" // Constants @@ -78,7 +78,10 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc, map vars, bool bigEndianArr, bool isExprEval, - unsigned char adabe_version) : + unsigned char adabe_version, + bool optimize_time, + bool stop_on_partition, + PartitionTree* next_partition_tree) : fieldDesc(i_fieldDesc), nodeDesc(i_nodeDesc), parent(i_parent), @@ -89,6 +92,11 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc, // Re-initializations due to packing efficiency string array_name_suffix{fieldDesc->isArray() ? "[" + to_string(arrIdx + fieldDesc->lowBound) + "]" : ""}; layout_item_name = i_fieldDesc->name + array_name_suffix; + if (optimize_time) + { + full_path = parent ? parent->full_path + "." + layout_item_name : layout_item_name; + } + // TODO: the whole block below looks unnecesarry if (fieldDesc->offset == 0xffffffff) @@ -103,12 +111,20 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc, } } - init_props(adabe_version); + if (stop_on_partition) + { + partition_tree = next_partition_tree; + } if (isExprEval) { - initInstOps(false); - eval_expressions(vars); + if (!stop_on_partition) + { + init_props(adabe_version); + + initInstOps(); + eval_expressions(vars); + } } } @@ -117,16 +133,17 @@ void AdbInstance::initInstOps(bool is_root) AttrsMap& attrs_map = is_root ? nodeDesc->attrs : fieldDesc->attrs; inst_ops_props = new InstOpsProperties(attrs_map); - auto found_it = getInstanceAttrIterator("condition"); - if (found_it != inst_ops_props->instAttrsMap.end() && parent->getInstanceAttr("is_conditional") == "1") + string value; + auto found = getInstanceAttr("condition", value); + if (found && parent->getInstanceAttr("is_conditional") == "1") { - inst_ops_props->condition.setCondition(found_it->second); + inst_ops_props->condition.setCondition(value); } - found_it = getInstanceAttrIterator("size_condition"); - if (found_it != inst_ops_props->instAttrsMap.end()) + found = getInstanceAttr("size_condition", value); + if (found) { - string cond_size = found_it->second; + string cond_size = value; if (cond_size.substr(0, 10) == "$(parent).") { cond_size.erase(0, 10); @@ -171,6 +188,11 @@ u_int32_t AdbInstance::calcArrOffset(bool bigEndianArr) return o_offset; } +bool AdbInstance::stop_on_partition() const +{ + return partition_tree != nullptr; +} + void AdbInstance::eval_expressions(AttrsMap& parent_vars) { static mstflint::common::regex::regex EXP_REGEX(EXP_PATTERN); @@ -402,6 +424,10 @@ bool AdbInstance::isPartOfArray() **/ string AdbInstance::fullName(size_t skipLevel) { + if (full_path.size() > 0) + { + return full_path; + } list fnList; AdbInstance* p = parent; @@ -562,19 +588,19 @@ void AdbInstance::set_is_diff(bool val) } /** - * Function: AdbInstance::fullName + * Function: AdbInstance::dwordAddr **/ -u_int32_t AdbInstance::dwordAddr() +u_int32_t AdbInstance::dwordAddr(uint8_t alignment) { - return (offset >> 5) << 2; + return (offset / alignment) << 2; } /** - * Function: AdbInstance::fullName + * Function: AdbInstance::startBit **/ -u_int32_t AdbInstance::startBit() +u_int32_t AdbInstance::startBit(uint8_t alignment) { - return offset % 32; + return offset % alignment; } /** @@ -660,6 +686,19 @@ vector AdbInstance::findChild(const string& childName, bool isCase return childList; } +/** + * Function: AdbInstance::get_root + **/ +AdbInstance* AdbInstance::get_root() +{ + auto current_layout_item = this; + while (current_layout_item->parent) + { + current_layout_item = current_layout_item->parent; + } + return current_layout_item; +} + /** * Function: AdbInstance::getAttr **/ @@ -800,7 +839,9 @@ AttrsMap AdbInstance::getVarsMap() **/ bool AdbInstance::isEnumExists() { - return inst_ops_props ? inst_ops_props->instAttrsMap.contains("enum") : fieldDesc->attrs.count("enum"); + return inst_ops_props ? inst_ops_props->instAttrsMap.contains("enum") : + fieldDesc ? fieldDesc->attrs.count("enum") : + false; } /** diff --git a/adb_parser/adb_instance.h b/adb_parser/adb_instance.h index 190847fd..894603c7 100644 --- a/adb_parser/adb_instance.h +++ b/adb_parser/adb_instance.h @@ -51,6 +51,7 @@ using namespace xmlCreator; typedef map AttrsMap; class AdbField; class AdbNode; +struct PartitionTree; class LayoutItemAttrsMap { public: @@ -144,6 +145,13 @@ class AdbInstance } }; + struct LayoutPartitionProps + { + PartitionTree* partition_tree; + + LayoutPartitionProps(PartitionTree* tree); + }; + public: // Methods AdbInstance() = default; @@ -154,10 +162,15 @@ class AdbInstance map vars, bool bigEndianArr, bool isExprEval, - unsigned char adabe_version = 1); + unsigned char adabe_version = 1, + bool optimize_time = false, + bool stop_on_partition = false, + PartitionTree* next_partition_tree = nullptr); + ~AdbInstance(); void init_props(unsigned char adabe_version); u_int32_t calcArrOffset(bool bigEndianArr); + bool stop_on_partition() const; void eval_expressions(AttrsMap& i_vars); static string evalExpr(string expr, AttrsMap* vars); const string& get_field_name(); @@ -174,9 +187,9 @@ class AdbInstance bool is_wo() const; bool is_diff() const; void set_is_diff(bool val); - u_int32_t dwordAddr(); - u_int32_t startBit(); bool isEnumExists(); + u_int32_t dwordAddr(uint8_t alignment = 32); + u_int32_t startBit(uint8_t alignment = 32); bool enumToInt(const string& name, u_int64_t& val); // false means no enum value found bool intToEnum(u_int64_t val, string& valName); // false means no enum name found map getEnumMap(); @@ -189,6 +202,7 @@ class AdbInstance // DB like access methods AdbInstance* getChildByPath(const string& path, bool isCaseSensitive = true); vector findChild(const string& name, bool isCaseSensitive = true, bool by_inst_name = false); + AdbInstance* get_root(); string getInstanceAttr(const string& attrName) const; bool getInstanceAttr(const string& attrName, string& value); LayoutItemAttrsMap::iterator getInstanceAttrIterator(const string& attrName); @@ -210,6 +224,7 @@ class AdbInstance // Members string layout_item_name{}; // instance name + string full_path{}; vector subItems{}; AdbField* fieldDesc{nullptr}; AdbNode* nodeDesc{nullptr}; @@ -221,6 +236,7 @@ class AdbInstance u_int32_t size{0}; // in bits u_int32_t maxLeafSize{0}; // in bits for DS alignment check InstancePropertiesMask inst_props{}; + PartitionTree* partition_tree{nullptr}; }; #endif diff --git a/adb_parser/adb_parser.cpp b/adb_parser/adb_parser.cpp index 1fa9081e..1f363c72 100644 --- a/adb_parser/adb_parser.cpp +++ b/adb_parser/adb_parser.cpp @@ -47,8 +47,9 @@ #include #include #include +#include -#include "common/algorithm.h" +#include "common/tools_algorithm.h" using namespace std; using namespace xmlCreator; @@ -137,64 +138,14 @@ void Adb::raiseException(bool allowMultipleExceptions, string exceptionTxt, cons return; } -/** - * Function: Adb::getAdbExceptionsMap - * This function return the adb exception map - **/ -void Adb::fetchAdbExceptionsMap(ExceptionsMap otherMap) -{ - vector fatals = otherMap[ExceptionHolder::FATAL_EXCEPTION]; - for (vector::iterator it = fatals.begin(); it != fatals.end(); ++it) - { - insertNewException(ExceptionHolder::FATAL_EXCEPTION, *it); - } - vector errors = otherMap[ExceptionHolder::ERROR_EXCEPTION]; - for (vector::iterator it = errors.begin(); it != errors.end(); ++it) - { - insertNewException(ExceptionHolder::ERROR_EXCEPTION, *it); - } - vector warnings = otherMap[ExceptionHolder::WARN_EXCEPTION]; - for (vector::iterator it = warnings.begin(); it != warnings.end(); ++it) - { - insertNewException(ExceptionHolder::WARN_EXCEPTION, *it); - } -} - -/** - * Function: Adb::insertNewException - * This function take the excpetion type [FATAL:0, ERROR:1, WARNING:2] and the exception string - * Then it insert it to the adb exception map - **/ -void Adb::insertNewException(const string exceptionType, string exceptionTxt) -{ - adbExceptionMap[exceptionType].push_back(exceptionTxt); -} - /** * Function: Adb::printAdbExceptionMap * This function will pring the content of the Adb Exception Map **/ string Adb::printAdbExceptionMap() { - string errorStr = ""; - vector fatals = adbExceptionMap[ExceptionHolder::FATAL_EXCEPTION]; - for (vector::iterator it = fatals.begin(); it != fatals.end(); ++it) - { - errorStr += "-" + ExceptionHolder::FATAL_EXCEPTION + "- " + *it + ";"; - } - vector errors = adbExceptionMap[ExceptionHolder::ERROR_EXCEPTION]; - for (vector::iterator it = errors.begin(); it != errors.end(); ++it) - { - errorStr += "-" + ExceptionHolder::ERROR_EXCEPTION + "- " + *it + ";"; - } - vector warnings = adbExceptionMap[ExceptionHolder::WARN_EXCEPTION]; - for (vector::iterator it = warnings.begin(); it != warnings.end(); ++it) - { - errorStr += "-" + ExceptionHolder::WARN_EXCEPTION + "- " + "- " + *it + ";"; - } - return errorStr; + return ExceptionHolder::printAdbExceptionMap(); } - /** * Function: Adb::load **/ @@ -209,7 +160,10 @@ bool Adb::load(string fname, string logFileStr, bool checkDsAlign, bool enforceGuiChecks, - bool force_pad_32) + bool force_pad_32, + bool variable_alignment, + string root_node_name) + { try { @@ -220,8 +174,8 @@ bool Adb::load(string fname, AdbParser::setAllowMultipleExceptionsTrue(); } _logFile->init(logFileStr, allowMultipleExceptions); - AdbParser p(fname, this, addReserved, evalExpr, strict, includePath, enforceExtraChecks, checkDsAlign, - enforceGuiChecks, force_pad_32); + AdbParser p(fname, this, root_node_name, addReserved, evalExpr, strict, includePath, enforceExtraChecks, checkDsAlign, + enforceGuiChecks, force_pad_32, variable_alignment); _checkDsAlign = checkDsAlign; _enforceGuiChecks = enforceGuiChecks; if (!p.load()) @@ -238,7 +192,7 @@ bool Adb::load(string fname, _lastError = "Empty project, no nodes were found"; if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); + ExceptionHolder::insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); } status = false; } @@ -249,7 +203,6 @@ bool Adb::load(string fname, } if (allowMultipleExceptions && ExceptionHolder::getNumberOfExceptions() > 0) { - fetchAdbExceptionsMap(ExceptionHolder::getAdbExceptionsMap()); status = false; } return status; @@ -259,7 +212,7 @@ bool Adb::load(string fname, _lastError = e.what_s(); if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); + ExceptionHolder::insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); } return false; } @@ -268,11 +221,16 @@ bool Adb::load(string fname, /** * Function: Adb::loadFromString **/ -bool Adb::loadFromString(const char* adbContents, bool addReserved, bool evalExpr, bool strict, bool enforceExtraChecks) +bool Adb::loadFromString(const char* adbContents, + bool addReserved, + bool evalExpr, + bool strict, + bool enforceExtraChecks, + string root_node_name) { try { - AdbParser p(string(), this, addReserved, evalExpr, strict, "", enforceExtraChecks); + AdbParser p(string(), this, root_node_name, addReserved, evalExpr, strict, "", enforceExtraChecks); mainFileName = OS_PATH_SEP; if (!p.loadFromString(adbContents)) { @@ -334,7 +292,7 @@ string Adb::toXml(vector nodeNames, bool addRootNode, string rootName, s for (NodesMap::iterator it = nodesMap.begin(); it != nodesMap.end(); it++) { AdbNode* node = it->second; - xml += node->toXml(addPrefix); + xml += node->toXml(addPrefix) + "\n"; } } else @@ -437,7 +395,7 @@ AdbInstance* Adb::addMissingNodes(int depth, bool allowMultipleExceptions) _lastError = exp.what_s(); if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); + ExceptionHolder::insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); } return NULL; } @@ -456,7 +414,11 @@ AdbInstance* Adb::createLayout(string rootNodeName, bool isExprEval, int depth, bool ignoreMissingNodes, - bool allowMultipleExceptions) + bool allowMultipleExceptions, + bool optimize_time, + uint32_t root_offset, + string root_display_name, + PartitionTree* partition_tree) { try { @@ -465,19 +427,21 @@ AdbInstance* Adb::createLayout(string rootNodeName, it = nodesMap.find(rootNodeName); if (it == nodesMap.end()) { - raiseException(allowMultipleExceptions, - "Can't find definition for node \"" + rootNodeName + "\"", - ExceptionHolder::FATAL_EXCEPTION); + throw AdbException("Can't find definition for node \"" + rootNodeName + "\""); } AdbNode* nodeDesc = it->second; - nodeDesc->inLayout = true; + nodeDesc->inLayout = true && depth == -1; AdbInstance* rootItem = new AdbInstance(); rootItem->fieldDesc = NULL; rootItem->nodeDesc = nodeDesc; rootItem->parent = NULL; - rootItem->layout_item_name = nodeDesc->name; - rootItem->offset = 0; + rootItem->layout_item_name = root_display_name.size() > 0 ? root_display_name : nodeDesc->name; + if (optimize_time) + { + rootItem->full_path = rootItem->layout_item_name; + } + rootItem->offset = root_offset; rootItem->size = nodeDesc->size; if (isExprEval) { @@ -495,10 +459,23 @@ AdbInstance* Adb::createLayout(string rootNodeName, for (size_t i = 0; (depth == -1 || depth > 0) && i < nodeDesc->fields.size(); i++) { + PartitionTree* next_partition_tree = nullptr; + if (partition_tree) + { + auto found_partition_tree = + find_if(partition_tree->sub_items.begin(), partition_tree->sub_items.end(), + [&nodeDesc, i](PartitionTree* si) { return si->name == nodeDesc->fields[i]->name; }); + if (found_partition_tree != partition_tree->sub_items.end()) + { + next_partition_tree = *found_partition_tree; + } + } createInstance(nodeDesc->fields[i], rootItem, emptyVars, isExprEval, depth == -1 ? -1 : depth - 1, - ignoreMissingNodes, allowMultipleExceptions); + ignoreMissingNodes, allowMultipleExceptions, optimize_time, next_partition_tree); } + nodeDesc->inLayout = false; + // Now set the instance attributes (override field attrs), only if this is root node instantiation if (isExprEval && rootNodeName == rootNode && depth == -1) { @@ -539,6 +516,7 @@ AdbInstance* Adb::createLayout(string rootNodeName, mstflint::common::algorithm::split(path, splitVal, mstflint::common::algorithm::is_any_of(string("."))); for (size_t i = 0; i < path.size(); i++) { + // TODO: The code below is shady, looks buggy if (path[i] == "#(parent)" || path[i] == "$(parent)") { curInst = curInst->parent; @@ -683,7 +661,6 @@ AdbInstance* Adb::createLayout(string rootNodeName, if (allowMultipleExceptions && ExceptionHolder::getNumberOfExceptions() > 0) { - fetchAdbExceptionsMap(ExceptionHolder::getAdbExceptionsMap()); delete rootItem; rootItem = NULL; } @@ -694,7 +671,7 @@ AdbInstance* Adb::createLayout(string rootNodeName, _lastError = exp.what_s(); if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); + ExceptionHolder::insertNewException(ExceptionHolder::FATAL_EXCEPTION, _lastError); } return NULL; } @@ -743,8 +720,19 @@ bool Adb::createInstance(AdbField* field, bool isExprEval, int depth, bool ignoreMissingNodes, - bool allowMultipleExceptions) + bool allowMultipleExceptions, + bool optimize_time, + PartitionTree* partition_tree) + { + // Stop on exclude tree leaf + auto stop_on_partition_tree = partition_tree && partition_tree->stop; + + if (stop_on_partition_tree) + { + partition_tree = prune_up(partition_tree); + } + for (u_int32_t i = 0; i < field->arrayLen(); i++) { AdbInstance* inst{nullptr}; @@ -764,14 +752,16 @@ bool Adb::createInstance(AdbField* field, } node = nodes_it->second; } - inst = new AdbInstance(field, node, i, parent, vars, bigEndianArr, isExprEval, stoi(version)); + inst = new AdbInstance(field, node, i, parent, vars, bigEndianArr, stoi(version), stop_on_partition_tree, + optimize_time, partition_tree); } catch (AdbException& exp) { delete inst; if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::ERROR_EXCEPTION, exp.what()); + ExceptionHolder::insertNewException(ExceptionHolder::ERROR_EXCEPTION, exp.what()); + return false; } else { @@ -779,89 +769,108 @@ bool Adb::createInstance(AdbField* field, } } - /* if union and uses selecotr field add it to _unionSelectorEvalDeffered in order to defferred evaluation */ - found_attr = inst->getInstanceAttr("union_selector", attr_val); - if (inst->isUnion() && found_attr) - { - _unionSelectorEvalDeffered.push_back(inst); - } + checkInstanceOffsetValidity(inst, parent, allowMultipleExceptions); - if (isExprEval) + if (!stop_on_partition_tree) { - // if the field has a condition attribute - if (!inst->inst_ops_props->condition.getCondition().empty()) + /* if union and uses selecotr field add it to _unionSelectorEvalDeffered in order to defferred evaluation */ + found_attr = inst->getInstanceAttr("union_selector", attr_val); + if (inst->isUnion() && found_attr) { - _conditionInstances.push_back(inst); + _unionSelectorEvalDeffered.push_back(inst); } - // if the layout item has a conditional array - if (!inst->inst_ops_props->conditionalSize.getCondition().empty()) + if (isExprEval) { - _conditionalArrays.push_back(inst); - } - } - - checkInstanceOffsetValidity(inst, parent, allowMultipleExceptions); + // if the field has a condition attribute + if (!inst->inst_ops_props->condition.getCondition().empty()) + { + _conditionInstances.push_back(inst); + } - if (field->isStruct() && !inst->nodeDesc->fields.empty() && (depth == -1 || depth > 0)) - { - if (inst->nodeDesc->inLayout) - { - delete inst; - raiseException(false, - "Cyclic definition of nodes, node: " + field->name + " was already added to the layout", - ExceptionHolder::ERROR_EXCEPTION); - } - inst->nodeDesc->inLayout = true; - - // // validation 2 TODO: move validation to adbXMLParser - // if (inst->size != inst->nodeDesc->size) - // { - // inst->nodeDesc->size = inst->size; - // /*throw AdbException("Node +(" + inst->name + ") size (" + to_string(inst->size)) + - // " isn't the same as its instance (" + inst->nodeDesc->name + - // ") (" + to_string(inst->nodeDesc->size) + ")";*/ - // } - - for (auto it = inst->nodeDesc->fields.begin(); it != inst->nodeDesc->fields.end(); it++) - { - createInstance(*it, inst, vars, isExprEval, depth == -1 ? -1 : depth - 1, ignoreMissingNodes, - allowMultipleExceptions); + // if the layout item has a conditional array + if (!inst->inst_ops_props->conditionalSize.getCondition().empty()) + { + _conditionalArrays.push_back(inst); + } } - inst->nodeDesc->inLayout = false; - if (_checkDsAlign && inst->maxLeafSize != 0 && inst->size % inst->maxLeafSize != 0) + if (field->isStruct() && !inst->nodeDesc->fields.empty() && (depth == -1 || depth > 0)) { - raiseException(allowMultipleExceptions, - "Node: " + inst->nodeDesc->name + " size(" + to_string(inst->size) + - ") is not aligned with largest leaf(" + to_string(inst->maxLeafSize) + ")", - ExceptionHolder::ERROR_EXCEPTION); - } + if (inst->nodeDesc->inLayout) + { + delete inst; + inst = nullptr; + raiseException(false, + "Cyclic definition of nodes, node: " + field->name + " was already added to the layout", + ExceptionHolder::ERROR_EXCEPTION); + } + else + { + inst->nodeDesc->inLayout = true && depth == -1; + } - if (!inst->isUnion() && inst->subItems.size() > 0) - { - std::stable_sort(inst->subItems.begin(), inst->subItems.end(), - compareFieldsPtr); // TODO: try to remove this shit - for (size_t j = 0; j < inst->subItems.size() - 1; j++) + // // validation 2 TODO: move validation to adbXMLParser + // if (inst->size != inst->nodeDesc->size) + // { + // inst->nodeDesc->size = inst->size; + // /*throw AdbException("Node +(" + inst->name + ") size (" + to_string(inst->size)) + + // " isn't the same as its instance (" + inst->nodeDesc->name + + // ") (" + to_string(inst->nodeDesc->size) + ")";*/ + // } + + for (auto it = inst->nodeDesc->fields.begin(); it != inst->nodeDesc->fields.end(); it++) { - if (inst->subItems[j + 1]->offset < inst->subItems[j]->offset + inst->subItems[j]->size) + PartitionTree* next_partition_tree = nullptr; + if (partition_tree) { - string exceptionTxt = - "Field (" + inst->subItems[j + 1]->get_field_name() + ") (" + - formatAddr(inst->subItems[j + 1]->offset, inst->subItems[j + 1]->size).c_str() + - ") overlaps with (" + inst->subItems[j]->get_field_name() + ") (" + - formatAddr(inst->subItems[j]->offset, inst->subItems[j]->size).c_str() + ")"; - raiseException(allowMultipleExceptions, exceptionTxt, ExceptionHolder::ERROR_EXCEPTION); + auto found_partition_tree = + find_if(partition_tree->sub_items.begin(), partition_tree->sub_items.end(), + [&it](PartitionTree* si) { return si->name == (*it)->name; }); + if (found_partition_tree != partition_tree->sub_items.end()) + { + next_partition_tree = *found_partition_tree; + } + } + createInstance(*it, inst, vars, isExprEval, depth == -1 ? -1 : depth - 1, ignoreMissingNodes, + allowMultipleExceptions, next_partition_tree); + } + inst->nodeDesc->inLayout = false; + + if (_checkDsAlign && inst->maxLeafSize != 0 && inst->size % inst->maxLeafSize != 0) + { + raiseException(allowMultipleExceptions, + "Node: " + inst->nodeDesc->name + " size(" + to_string(inst->size) + + ") is not aligned with largest leaf(" + to_string(inst->maxLeafSize) + ")", + ExceptionHolder::ERROR_EXCEPTION); + } + + if (!inst->isUnion() && inst->subItems.size() > 0) + { + std::stable_sort(inst->subItems.begin(), inst->subItems.end(), + compareFieldsPtr); // TODO: try to remove this shit + + for (size_t j = 0; j < inst->subItems.size() - 1; j++) + { + if (inst->subItems[j + 1]->offset < inst->subItems[j]->offset + inst->subItems[j]->size) + { + string exceptionTxt = + "Field (" + inst->subItems[j + 1]->get_field_name() + ") (" + + formatAddr(inst->subItems[j + 1]->offset, inst->subItems[j + 1]->size).c_str() + + ") overlaps with (" + inst->subItems[j]->get_field_name() + ") (" + + formatAddr(inst->subItems[j]->offset, inst->subItems[j]->size).c_str() + ")"; + raiseException(allowMultipleExceptions, exceptionTxt, ExceptionHolder::ERROR_EXCEPTION); + } } } } - } - u_int32_t esize = inst->fieldDesc->size; - if ((field->isLeaf() || field->subNode == "uint64") && (esize == 16 || esize == 32 || esize == 64)) // A leaf - { - inst->maxLeafSize = esize; + u_int32_t esize = inst->fieldDesc->size; + if ((field->isLeaf() || field->subNode == "uint64") && (esize == 16 || esize == 32 || esize == 64)) // A leaf + { + inst->maxLeafSize = esize; + } } if (parent) { @@ -887,7 +896,7 @@ void Adb::checkInstanceOffsetValidity(AdbInstance* inst, AdbInstance* parent, bo formatAddr(parent->offset, parent->size) + " boundaries"; if (allowMultipleExceptions) { - insertNewException(ExceptionHolder::ERROR_EXCEPTION, exceptionTxt); + ExceptionHolder::insertNewException(ExceptionHolder::ERROR_EXCEPTION, exceptionTxt); } else { @@ -930,7 +939,7 @@ bool Adb::checkInstSizeConsistency(bool allowMultipleExceptions) if (allowMultipleExceptions) { status = false; - insertNewException(ExceptionHolder::ERROR_EXCEPTION, tmp); + ExceptionHolder::insertNewException(ExceptionHolder::ERROR_EXCEPTION, tmp); } else { @@ -978,3 +987,30 @@ void Adb::print(int indent) for (iter = nodesMap.begin(); iter != nodesMap.end(); iter++) iter->second->print(indent + 1); } + +PartitionTree* Adb::prune_up(PartitionTree* partition_tree) +{ + if (partition_tree->sub_items.size() > 0) + { + partition_tree->stop = false; + } + else + { + auto current_tree = partition_tree; + PartitionTree* parent_tree = current_tree->parent; + partition_tree = nullptr; + + do + { + auto found = find(parent_tree->sub_items.begin(), parent_tree->sub_items.end(), current_tree); + printf("found name: %s\n", (*found)->name.c_str()); + parent_tree->sub_items.erase(found); + + auto temp = current_tree; + current_tree = parent_tree; + parent_tree = current_tree->parent; + delete temp; + } while (parent_tree && current_tree && current_tree->sub_items.size() == 0); + } + return partition_tree; +} \ No newline at end of file diff --git a/adb_parser/adb_parser.h b/adb_parser/adb_parser.h index 69dc1d3f..9a1ec50a 100644 --- a/adb_parser/adb_parser.h +++ b/adb_parser/adb_parser.h @@ -103,6 +103,14 @@ struct IncludeFileInfo int includedFromLine; }; +struct PartitionTree +{ + string name; + bool stop; + PartitionTree* parent; + vector sub_items; +}; + class Adb { public: @@ -118,7 +126,8 @@ class Adb bool addReserved = false, bool evalExpr = false, bool strict = true, - bool enforceExtraChecks = false); + bool enforceExtraChecks = false, + string root_node_name = "root"); bool load(string fname, bool addReserved = false, bool evalExpr = false, @@ -130,7 +139,9 @@ class Adb string logFile = "", bool checkDsAlign = false, bool enforceGuiChecks = false, - bool force_pad_32 = false); + bool force_pad_32 = false, + bool variable_alignment = false, + string root_node_name = "root"); string toXml(vector nodeNames = vector(), bool addRootNode = false, string rootName = "MainNode", @@ -141,14 +152,15 @@ class Adb bool isExprEval = false, int depth = -1, /* -1 means instantiate full tree */ bool ignoreMissingNodes = false, - bool getAllExceptions = false); + bool getAllExceptions = false, + bool optimize_time = false, + uint32_t root_offset = 0, + string root_display_name = "", + PartitionTree* partition_tree = nullptr); vector getNodeDeps(string nodeName); void add_include(string fileName, string filePath, string included_from, int lineNumber); string getLastError(); - void fetchAdbExceptionsMap(ExceptionsMap otherMap); - // excpetionType [FATAL:0, ERROR:1, WARNING:2] - void insertNewException(const string exceptionType, string exceptionTxt); string printAdbExceptionMap(); // FOR DEBUG @@ -174,7 +186,6 @@ class Adb string mainFileName; IncludeFileMap includedFiles; vector warnings; - ExceptionsMap adbExceptionMap; private: bool createInstance(AdbField* fieldDesc, @@ -183,9 +194,12 @@ class Adb bool isExprEval, int depth, bool ignoreMissingNodes = false, - bool getAllExceptions = false); + bool getAllExceptions = false, + bool optimize_time = false, + PartitionTree* partition_tree = nullptr); string evalExpr(string expr, AttrsMap* vars); bool checkInstSizeConsistency(bool getAllExceptions = false); + static PartitionTree* prune_up(PartitionTree* partition_tree); private: string _lastError; diff --git a/adb_parser/adb_xmlCreator.cpp b/adb_parser/adb_xmlCreator.cpp index 9b743481..d72ed26c 100644 --- a/adb_parser/adb_xmlCreator.cpp +++ b/adb_parser/adb_xmlCreator.cpp @@ -33,7 +33,7 @@ */ #include "adb_xmlCreator.h" -#include "common/algorithm.h" +#include "common/tools_algorithm.h" string xmlCreator::indentString(int i) { diff --git a/adb_parser/adb_xml_parser.cpp b/adb_parser/adb_xml_parser.cpp index 5b7a0a28..e3712780 100644 --- a/adb_parser/adb_xml_parser.cpp +++ b/adb_parser/adb_xml_parser.cpp @@ -44,8 +44,8 @@ #include #include -#include "common/algorithm.h" -#include "common/filesystem.h" +#include "common/tools_algorithm.h" +#include "common/tools_filesystem.h" #include "common/tools_regex.h" bool AdbParser::allowMultipleExceptions = false; @@ -77,6 +77,7 @@ typedef map AttrsMap; **/ AdbParser::AdbParser(string fileName, Adb* adbCtxt, + string root_node_name, bool addReserved, bool evalExpr, bool strict, @@ -84,16 +85,21 @@ AdbParser::AdbParser(string fileName, bool enforceExtraChecks, bool checkDsAlign, bool enforceGuiChecks, - bool force_pad_32) : + bool force_pad_32, + bool variable_alignment) : + _adbCtxt(adbCtxt), _fileName(fileName), + _root_node_name(root_node_name), _addReserved(addReserved), _isExprEval(evalExpr), _strict(strict), _checkDsAlign(checkDsAlign), skipNode(false), + _support_variable_alignment(variable_alignment), _includePath(includePath), _currentNode(0), + _current_node_alignment(32), _currentField(0), _currentConfig(0), _enforceGuiChecks(enforceGuiChecks), @@ -273,7 +279,7 @@ bool AdbParser::load(bool is_main) if (is_main) { - auto root_node_it = _adbCtxt->nodesMap.find("root"); + auto root_node_it = _adbCtxt->nodesMap.find(_root_node_name); if (root_node_it == _adbCtxt->nodesMap.end()) { throw AdbException("No root found."); @@ -571,17 +577,17 @@ u_int32_t AdbParser::addr2int(string& s) /** * Function: AdbParser::dword **/ -u_int32_t AdbParser::dword(u_int32_t offset) +u_int32_t AdbParser::aligned_word(u_int32_t offset, uint8_t alignment) { - return (offset >> 5) << 2; + return offset / alignment; } /** * Function: AdbParser::startBit **/ -u_int32_t AdbParser::startBit(u_int32_t offset) +u_int32_t AdbParser::startBit(u_int32_t offset, uint8_t alignment) { - return offset % 32; + return offset % alignment; } /** @@ -663,9 +669,9 @@ void AdbParser::includeFile(AdbParser* adbParser, string fileName, int lineNumbe adbParser->_adbCtxt->add_include(fileName, filePath, adbParser->_fileName, lineNumber); // parse the included file - AdbParser p(filePath, adbParser->_adbCtxt, adbParser->_addReserved, adbParser->_isExprEval, adbParser->_strict, - "", adbParser->_enforceExtraChecks, adbParser->_checkDsAlign, adbParser->_enforceGuiChecks, - adbParser->_force_pad_32); + AdbParser p(filePath, adbParser->_adbCtxt, adbParser->_root_node_name, adbParser->_addReserved, + adbParser->_isExprEval, adbParser->_strict, "", adbParser->_enforceExtraChecks, adbParser->_checkDsAlign, + adbParser->_enforceGuiChecks, adbParser->_force_pad_32, adbParser->_support_variable_alignment); if (!p.load(false)) { throw AdbException(p.getError()); @@ -1284,6 +1290,16 @@ void AdbParser::startNodeElement(const XML_Char** atts, AdbParser* adbParser, co // throw AdbException("union must be dword aligned"); } + if (adbParser->_support_variable_alignment && attrValue(atts, "cr_data_wdt") == "64") + { + adbParser->_current_node_alignment = 64; + } + else + { + adbParser->_current_node_alignment = 32; + } + + // Add all node attributes for (int i = 0; i < attrCount(atts); i++) { @@ -1526,7 +1542,7 @@ void AdbParser::startFieldElement(const XML_Char** atts, AdbParser* adbParser, c } // Very tricky but works well for big endian arrays support - on endElement we will fix the address again - if (!expFound && adbParser->_adbCtxt->bigEndianArr) + if (!expFound && adbParser->_adbCtxt->bigEndianArr && adbParser->_current_node_alignment != 64) { u_int32_t offset = adbParser->_currentField->offset; u_int32_t size = adbParser->_currentField->eSize(); @@ -1535,6 +1551,16 @@ void AdbParser::startFieldElement(const XML_Char** atts, AdbParser* adbParser, c ((offset >> 5) << 5) + ((MIN(32, adbParser->_currentNode->size) - ((offset + size) % 32)) % 32); } + // workaround for 64bit registers (flip every two adjacent 32b dwords) + if (adbParser->_current_node_alignment == 64 && adbParser->_currentField->size <= 32) + { + u_int32_t offset = adbParser->_currentField->offset; + + u_int32_t in_dword_offset = offset % 32; + offset = ((offset >> 5) << 5) xor 32; + adbParser->_currentField->offset = offset + in_dword_offset; + } + // For DS alignment check u_int32_t esize = adbParser->_currentField->eSize(); if ((adbParser->_currentField->isLeaf() || adbParser->_currentField->subNode == "uint64") && @@ -1744,35 +1770,39 @@ void AdbParser::startElement(void* _adbParser, const XML_Char* name, const XML_C /** * Function: AdbParser::addReserved **/ -void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_int32_t size) +void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_int32_t size, uint8_t alignment) { - u_int32_t numOfDwords = (dword(offset + size - 1) - dword(offset)) / 4 + 1; + u_int32_t num_aligned_words = (aligned_word(offset + size - 1, alignment) - aligned_word(offset, alignment)) + 1; // printf("==> %s\n", formatAddr(offset, size).c_str()); - // printf("numOfDwords = %d\n", numOfDwords); - - if (numOfDwords == 1 || ((offset % 32) == 0 && ((offset + size) % 32) == 0)) + // printf("num_aligned_words = %d\n", num_aligned_words); + if (num_aligned_words == 1 || ((offset % alignment) == 0 && ((offset + size) % alignment) == 0)) { AdbField* f1 = new AdbField; f1->name = "reserved"; f1->offset = offset; f1->isReserved = true; f1->size = size; + if (alignment == 64) + { + f1->attrs["cr_data_wdt"] = "64"; + } + reserveds.push_back(f1); // printf("case1: reserved0: %s\n", formatAddr(f1->offset, f1->size).c_str()); } - else if (numOfDwords == 2) + else if (num_aligned_words == 2) { AdbField* f1 = new AdbField; f1->name = "reserved"; f1->offset = offset; f1->isReserved = true; - f1->size = 32 - startBit(offset); + f1->size = alignment - startBit(offset, alignment); AdbField* f2 = new AdbField; f2->name = "reserved"; - f2->offset = dword(offset + 32) * 8; + f2->offset = aligned_word(offset + alignment, alignment) * alignment; f2->isReserved = true; f2->size = size - f1->size; reserveds.push_back(f1); @@ -1780,6 +1810,12 @@ void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_in /*printf("case2: reserved0: %s, reserved1: %s\n", formatAddr(f1->offset, f1->size).c_str(), formatAddr(f2->offset, f2->size).c_str());*/ + if (alignment == 64) + { + f1->attrs["cr_data_wdt"] = "64"; + f2->attrs["cr_data_wdt"] = "64"; + } + } else { @@ -1787,29 +1823,34 @@ void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_in f1->name = "reserved"; f1->offset = offset; f1->isReserved = true; - f1->size = 32 - startBit(offset); + f1->size = alignment - startBit(offset, alignment); AdbField* f2 = new AdbField; f2->name = "reserved"; - f2->offset = dword(offset + 32) * 8; + f2->offset = aligned_word(offset + alignment, alignment) * alignment; f2->isReserved = true; - f2->size = (numOfDwords - 2) * 32; + f2->size = (num_aligned_words - 2) * alignment; - if (!((offset + size) % 32)) + if (!((offset + size) % alignment)) { - f2->size = (numOfDwords - 1) * 32; + f2->size = (num_aligned_words - 1) * alignment; reserveds.push_back(f1); reserveds.push_back(f2); /*printf("case3.1: reserved0: %s, reserved1: %s\n", formatAddr(f1->offset, f1->size).c_str(), formatAddr(f2->offset, f2->size).c_str());*/ + if (alignment == 64) + { + f1->attrs["cr_data_wdt"] = "64"; + f2->attrs["cr_data_wdt"] = "64"; + } return; } else { - if (!(f1->size % 32)) + if (!(f1->size % alignment)) { - f1->size = (numOfDwords - 1) * 32; + f1->size = (num_aligned_words - 1) * alignment; f2->size = size - f1->size; f2->offset = f1->offset + f1->size; reserveds.push_back(f1); @@ -1817,11 +1858,17 @@ void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_in /*printf("case3.2: reserved0: %s, reserved1: %s\n", formatAddr(f1->offset, f1->size).c_str(), formatAddr(f2->offset, f2->size).c_str());*/ + + if (alignment == 64) + { + f1->attrs["cr_data_wdt"] = "64"; + f2->attrs["cr_data_wdt"] = "64"; + } return; } else { - f2->size = (numOfDwords - 2) * 32; + f2->size = (num_aligned_words - 2) * alignment; AdbField* f3 = new AdbField; f3->name = "reserved"; f3->offset = f2->offset + f2->size; @@ -1834,6 +1881,12 @@ void AdbParser::addReserved(vector& reserveds, u_int32_t offset, u_in formatAddr(f1->offset, f1->size).c_str(), formatAddr(f2->offset, f2->size).c_str(), formatAddr(f3->offset, f3->size).c_str());*/ + + if (alignment == 64) + { + f1->attrs["cr_data_wdt"] = "64"; + f2->attrs["cr_data_wdt"] = "64"; + } return; } } @@ -1915,7 +1968,8 @@ void AdbParser::endElement(void* _adbParser, const XML_Char* name) } if (delta > 0 && adbParser->_addReserved) { // Need reserved - addReserved(reserveds, prevField->offset + prevField->size, delta); + addReserved(reserveds, prevField->offset + prevField->size, delta, + adbParser->_current_node_alignment); } prevField = field; @@ -1928,7 +1982,7 @@ void AdbParser::endElement(void* _adbParser, const XML_Char* name) { if (adbParser->_currentNode->isUnion) { - addReserved(reserveds, 0, adbParser->_currentNode->size); + addReserved(reserveds, 0, adbParser->_currentNode->size, adbParser->_current_node_alignment); } else { @@ -1950,7 +2004,8 @@ void AdbParser::endElement(void* _adbParser, const XML_Char* name) if (delta > 0) { - addReserved(reserveds, prevField->offset + prevField->size, delta); + addReserved(reserveds, prevField->offset + prevField->size, delta, + adbParser->_current_node_alignment); } } @@ -1971,7 +2026,7 @@ void AdbParser::endElement(void* _adbParser, const XML_Char* name) } // Re-fix fields offset - if (adbParser->_adbCtxt->bigEndianArr) + if (adbParser->_adbCtxt->bigEndianArr && adbParser->_current_node_alignment != 64) { for (size_t i = 0; i < adbParser->_currentNode->fields.size(); i++) { @@ -2006,7 +2061,7 @@ void AdbParser::endElement(void* _adbParser, const XML_Char* name) // Add this field to current node if (!adbParser->skipNode) { - if (adbParser->_currentNode->name == "root") + if (adbParser->_currentNode->name == adbParser->_root_node_name) { adbParser->_adbCtxt->rootNode = adbParser->_currentField->subNode; } diff --git a/adb_parser/adb_xml_parser.h b/adb_parser/adb_xml_parser.h index ef56e278..d4ade731 100755 --- a/adb_parser/adb_xml_parser.h +++ b/adb_parser/adb_xml_parser.h @@ -76,6 +76,7 @@ class AdbParser // METHODS AdbParser(string fileName, Adb* adbCtxt, + string root_node_name = "root", bool addReserved = false, bool evalExpr = false, bool strict = true, @@ -83,7 +84,8 @@ class AdbParser bool enforceExtraChecks = false, bool checkDsAlign = false, bool enforceGuiChecks = false, - bool force_pad_32 = false); + bool force_pad_32 = false, + bool variable_alignment = false); ~AdbParser(); bool load(bool is_main = true); bool loadFromString(const char* adbString); @@ -118,15 +120,15 @@ class AdbParser static void startFieldElement(const XML_Char** atts, AdbParser* adbParser, const int lineNumber); static void endElement(void* adbParser, const XML_Char* name); - static void addReserved(vector& reserveds, u_int32_t offset, u_int32_t size); + static void addReserved(vector& reserveds, u_int32_t offset, u_int32_t size, uint8_t alignment = 32); static int attrCount(const XML_Char** atts); static string attrValue(const XML_Char** atts, const XML_Char* attrName); static string attrName(const XML_Char** atts, int i); static string attrValue(const XML_Char** atts, int i); static bool is_inst_ifdef_exist_and_correct_project(const XML_Char** atts, AdbParser* adbParser); static u_int32_t addr2int(string& s); - static u_int32_t dword(u_int32_t offset); - static u_int32_t startBit(u_int32_t offset); + static u_int32_t aligned_word(u_int32_t offset, uint8_t alignment = 32); + static u_int32_t startBit(u_int32_t offset, uint8_t alignment = 32); static bool raiseException(bool allowMultipleExceptions, string exceptionTxt, string addedMsg, const string expType); private: @@ -134,15 +136,18 @@ class AdbParser Adb* _adbCtxt; XML_Parser _xmlParser; string _fileName; + string _root_node_name; string _lastError; bool _addReserved; bool _isExprEval; bool _strict; bool _checkDsAlign; bool skipNode; + bool _support_variable_alignment; string _includePath; string _currentTagValue; AdbNode* _currentNode; + uint8_t _current_node_alignment; AdbField* _currentField; AdbConfig* _currentConfig; bool _instanceOps; diff --git a/common/BUILD b/common/BUILD index c6b54d67..9f6a2321 100644 --- a/common/BUILD +++ b/common/BUILD @@ -5,7 +5,7 @@ package( ) cc_library( - name = "common-headers", + name = "headers", hdrs = [ "bit_slice.h", "compatibility.h", @@ -18,10 +18,10 @@ cc_library( cc_library( name = "filesystem", srcs = [ - "filesystem.cpp", + "tools_filesystem.cpp", ], hdrs = [ - "filesystem.h", + "tools_filesystem.h", ], copts = [ "-Wall", @@ -31,9 +31,9 @@ cc_library( ) cc_binary( - name = "filesystem-test-bin", + name = "tools-filesystem-test-bin", srcs = [ - "filesystem-test.cpp", + "tools_filesystem_test.cpp", ], copts = [ "-Wall", @@ -49,7 +49,7 @@ cc_binary( cc_binary( name = "boost-filesystem-test-bin", srcs = [ - "filesystem-test.cpp", + "tools_filesystem_test.cpp", ], copts = [ "-Wall", @@ -65,14 +65,14 @@ cc_binary( ) sh_test( - name = "filesystem-test", + name = "tools-filesystem-test", size = "small", srcs = [ - "filesystem-test.sh", + "tools_filesystem_test.sh", ], - args = ["filesystem-test-bin"], + args = ["tools-filesystem-test-bin"], data = [ - ":filesystem-test-bin", + ":tools-filesystem-test-bin", ], ) @@ -80,7 +80,7 @@ sh_test( name = "boost-filesystem-test", size = "small", srcs = [ - "filesystem-test.sh", + "tools_filesystem_test.sh", ], args = ["boost-filesystem-test-bin"], data = [ @@ -94,7 +94,7 @@ cc_library( # ], hdrs = [ - "algorithm.h", + "tools_algorithm.h", ], copts = [ "-Wall", @@ -112,7 +112,7 @@ cc_library( # ], hdrs = [ - "algorithm.h", + "tools_algorithm.h", ], copts = [ "-Wall", @@ -126,10 +126,10 @@ cc_library( ) cc_test( - name = "algorithm-test", + name = "tools-algorithm-test", size = "small", srcs = [ - "algorithm-test.cpp", + "tools_algorithm_test.cpp", ], copts = [ "-Wall", @@ -146,7 +146,7 @@ cc_test( name = "boost-algorithm-test", size = "small", srcs = [ - "algorithm-test.cpp", + "tools_algorithm_test.cpp", ], copts = [ "-Wall", @@ -231,10 +231,10 @@ cc_library( ) cc_test( - name = "regex-test", + name = "tools-regex-test", size = "small", srcs = [ - "tools_regex-test.cpp", + "tools_regex_test.cpp", ], copts = [ "-Wall", @@ -251,7 +251,7 @@ cc_test( name = "stdlib-regex-test", size = "small", srcs = [ - "tools_regex-test.cpp", + "tools_regex_test.cpp", ], copts = [ "-Wall", @@ -268,7 +268,7 @@ cc_test( name = "boost-regex-test", size = "small", srcs = [ - "tools_regex-test.cpp", + "tools_regex_test.cpp", ], copts = [ "-Wall", diff --git a/common/Makefile.am b/common/Makefile.am index 83f300ad..abc6ac20 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -30,11 +30,11 @@ # Makefile.am -- Process this file with automake to produce Makefile.in -noinst_HEADERS = compatibility.h bit_slice.h tools_utils.h tools_utils.h tools_version.h filesystem.h tools_regex.h algorithm.h +noinst_HEADERS = compatibility.h bit_slice.h tools_utils.h tools_utils.h tools_version.h tools_filesystem.h tools_regex.h tools_algorithm.h noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = \ - filesystem.cpp \ + tools_filesystem.cpp \ tools_regex.cpp commonincludedir = $(includedir)/mstflint/common/ diff --git a/common/algorithm.h b/common/tools_algorithm.h similarity index 100% rename from common/algorithm.h rename to common/tools_algorithm.h diff --git a/common/algorithm-test.cpp b/common/tools_algorithm_test.cpp similarity index 99% rename from common/algorithm-test.cpp rename to common/tools_algorithm_test.cpp index 386586c6..769cd145 100644 --- a/common/algorithm-test.cpp +++ b/common/tools_algorithm_test.cpp @@ -33,7 +33,7 @@ #include #include -#include "algorithm.h" +#include "tools_algorithm.h" #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/common/filesystem.cpp b/common/tools_filesystem.cpp similarity index 99% rename from common/filesystem.cpp rename to common/tools_filesystem.cpp index e33b3c40..2fe10964 100644 --- a/common/filesystem.cpp +++ b/common/tools_filesystem.cpp @@ -30,7 +30,7 @@ * SOFTWARE. */ -#include "filesystem.h" +#include "tools_filesystem.h" #include diff --git a/common/filesystem.h b/common/tools_filesystem.h similarity index 100% rename from common/filesystem.h rename to common/tools_filesystem.h diff --git a/common/filesystem-test.cpp b/common/tools_filesystem_test.cpp similarity index 99% rename from common/filesystem-test.cpp rename to common/tools_filesystem_test.cpp index d6610262..b6c94eed 100644 --- a/common/filesystem-test.cpp +++ b/common/tools_filesystem_test.cpp @@ -38,7 +38,7 @@ #include namespace fs = boost::filesystem; #else -#include "filesystem.h" +#include "tools_filesystem.h" namespace fs = mstflint::common::filesystem; #endif diff --git a/common/filesystem-test.sh b/common/tools_filesystem_test.sh similarity index 100% rename from common/filesystem-test.sh rename to common/tools_filesystem_test.sh diff --git a/common/tools_regex-test.cpp b/common/tools_regex_test.cpp similarity index 100% rename from common/tools_regex-test.cpp rename to common/tools_regex_test.cpp diff --git a/configure.ac b/configure.ac index 79ca05a5..0770c87f 100644 --- a/configure.ac +++ b/configure.ac @@ -30,14 +30,11 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(mstflint, 4.26.0, akiselman-org@exchange.nvidia.com) +AC_INIT(mstflint, 4.27.0, akiselman-org@exchange.nvidia.com) AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.]) AC_SUBST([PROJECT]) -AC_DEFINE_UNQUOTED([VERSION], ["4.26.0"], [Define the project version.]) -AC_SUBST([VERSION]) - AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR([README]) @@ -113,6 +110,7 @@ AM_CONDITIONAL(X86_64_BUILD, [ echo $build_cpu | grep -iq "x86_64" ]) dnl Checks for headers AC_CHECK_HEADER(termios.h,[CXXFLAGS="${CXXFLAGS} -DHAVE_TERMIOS_H"]) +AC_CHECK_HEADER(sys/pci.h,[CXXFLAGS="${CXXFLAGS} -DHAVE_SYS_PCI_H"]) TOOLS_CRYPTO="" MAD_IFC="" FW_MGR_TOOLS="" @@ -505,8 +503,11 @@ AC_RUN_IFELSE([ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) - AC_MSG_NOTICE([std::regex support appears to be incomplete, fallback to GNU C regex]) + AC_MSG_NOTICE([std::regex support appears to be incomplete; falling back to GNU C regex.]) AC_DEFINE([USE_STDLIB_REGEX], [1], [Whether to use GNU C regex]) +],[ + AC_MSG_RESULT([yes]) + AC_MSG_WARN([Assuming the cross-compiler has complete support for std::regex functionality. VERIFY BEFORE USING!!!]) ]) AC_LANG_POP([C++]) diff --git a/debian/changelog b/debian/changelog index 6b9d5562..460f9960 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mstflint (4.27.0-1) unstable; urgency=low + + * Updated from MFT-4.27.0 + + -- Alex Blago Mon, 22 Jan 2024 00:00:00 +0000 + mstflint (4.26.0-1) unstable; urgency=low * Updated from MFT-4.26.0 diff --git a/dev_mgt/tools_dev_types.c b/dev_mgt/tools_dev_types.c index b1fec3db..8092775c 100644 --- a/dev_mgt/tools_dev_types.c +++ b/dev_mgt/tools_dev_types.c @@ -226,7 +226,7 @@ static struct device_info g_devs_info[] = { DeviceConnectX8, /* dm_id */ 0x21e, /* hw_dev_id */ -1, /* hw_rev_id */ - -1, /* sw_dev_id */ + 4131, /* sw_dev_id */ "ConnectX8", /* name */ 4, /* port_num */ DM_HCA /* dev_type */ diff --git a/ext_libs/minixz/xz_dec_lzma2.c b/ext_libs/minixz/xz_dec_lzma2.c index 58a28a2b..393c4bc8 100644 --- a/ext_libs/minixz/xz_dec_lzma2.c +++ b/ext_libs/minixz/xz_dec_lzma2.c @@ -1130,6 +1130,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2* s, struct xz_buf* b) return XZ_DATA_ERROR; s->lzma2.sequence = SEQ_LZMA_PREPARE; + /* fall through */ case SEQ_LZMA_PREPARE: if (s->lzma2.compressed < RC_INIT_BYTES) @@ -1140,6 +1141,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2* s, struct xz_buf* b) s->lzma2.compressed -= RC_INIT_BYTES; s->lzma2.sequence = SEQ_LZMA_RUN; + /* fall through */ case SEQ_LZMA_RUN: /* diff --git a/ext_libs/minixz/xz_dec_stream.c b/ext_libs/minixz/xz_dec_stream.c index a81a39b5..97cd2c33 100644 --- a/ext_libs/minixz/xz_dec_stream.c +++ b/ext_libs/minixz/xz_dec_stream.c @@ -617,6 +617,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) ret = dec_stream_header(s); if (ret != XZ_OK) return ret; + /* fall through */ case SEQ_BLOCK_START: /* We need one byte of input to continue. */ @@ -640,6 +641,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) s->temp.size = s->block_header.size; s->temp.pos = 0; s->sequence = SEQ_BLOCK_HEADER; + /* fall through */ case SEQ_BLOCK_HEADER: if (!fill_temp(s, b)) @@ -650,6 +652,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) return ret; s->sequence = SEQ_BLOCK_UNCOMPRESS; + /* fall through */ case SEQ_BLOCK_UNCOMPRESS: ret = dec_block(s, b); @@ -657,6 +660,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) return ret; s->sequence = SEQ_BLOCK_PADDING; + /* fall through */ case SEQ_BLOCK_PADDING: /* @@ -678,6 +682,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) } s->sequence = SEQ_BLOCK_CHECK; + /* fall through */ case SEQ_BLOCK_CHECK: if (s->check_type == XZ_CHECK_CRC32) @@ -702,6 +707,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) return ret; s->sequence = SEQ_INDEX_PADDING; + /* fall through */ case SEQ_INDEX_PADDING: while ((s->index.size + (b->in_pos - s->in_start)) & 3) @@ -724,6 +730,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) return XZ_DATA_ERROR; s->sequence = SEQ_INDEX_CRC32; + /* fall through */ case SEQ_INDEX_CRC32: ret = crc32_validate(s, b); @@ -732,6 +739,7 @@ static enum xz_ret dec_main(struct xz_dec* s, struct xz_buf* b) s->temp.size = STREAM_HEADER_SIZE; s->sequence = SEQ_STREAM_FOOTER; + /* fall through */ case SEQ_STREAM_FOOTER: if (!fill_temp(s, b)) diff --git a/flint/Makefile.am b/flint/Makefile.am index e1950e41..e71c8da3 100644 --- a/flint/Makefile.am +++ b/flint/Makefile.am @@ -55,7 +55,7 @@ mstflint_SOURCES = \ subcommands.h \ subcommands_linkx.cpp -mstflint_CXXFLAGS = -Wall -W -g -MP -MD -pipe -DEXTERNAL $(COMPILER_FPIC) \ +mstflint_CXXFLAGS = -Wall -pthread -W -g -MP -MD -pipe -DEXTERNAL $(COMPILER_FPIC) \ -DUNIX -DOS_UNIX -DOS_LINUX mstflint_DEPENDENCIES = \ diff --git a/flint/subcommands.cpp b/flint/subcommands.cpp index 9b62bb91..15c0cf32 100644 --- a/flint/subcommands.cpp +++ b/flint/subcommands.cpp @@ -2782,7 +2782,7 @@ FlintStatus BurnSubCommand::burnFs3() } // Here we want to burn FS3 device so we check if the image is indeed FS3 image - if (_imgInfo.fw_type != FIT_FS3 && _imgInfo.fw_type != FIT_FS4) + if (_imgInfo.fw_type != FIT_FS3 && _imgInfo.fw_type != FIT_FS4 && _imgInfo.fw_type != FIT_FS5) { reportErr(true, FLINT_IMG_DEV_COMPAT_ERROR, "FS3", "FS3"); return FLINT_FAILED; @@ -3435,7 +3435,7 @@ FlintStatus BurnSubCommand::executeCommand() reportErr(true, "The \"--use_image_guids\" flag is supported only for GEN4 devices.\n"); return FLINT_FAILED; } - if (_fwType == FIT_FS3 || _fwType == FIT_FS4 || _fwType == FIT_FSCTRL) + if (_fwType == FIT_FS3 || _fwType == FIT_FS4 || _fwType == FIT_FS5 || _fwType == FIT_FSCTRL) { u_int32_t devid = 0; mfile* mf = _fwOps->getMfileObj(); diff --git a/fw_comps_mgr/fw_comps_mgr.cpp b/fw_comps_mgr/fw_comps_mgr.cpp index a180f65f..caa28ed8 100644 --- a/fw_comps_mgr/fw_comps_mgr.cpp +++ b/fw_comps_mgr/fw_comps_mgr.cpp @@ -938,9 +938,7 @@ void FwCompsMgr::initialize(mfile* mf) _componentIndex = 0; _lastRegAccessStatus = ME_OK; _updateHandle = 0; - if (getFwSupport()) { - GenerateHandle(); - } + _fwSupport = getFwSupport(); ComponentAccessFactory* factory = ComponentAccessFactory::GetInstance(); _accessObj = factory->createDataAccessObject(this, mf, _isDmaSupported); @@ -966,6 +964,8 @@ void FwCompsMgr::SetIndexAndSize(int deviceIndex, FwCompsMgr::FwCompsMgr(mfile* mf, DeviceTypeT devType, int deviceIndex) { + _fwSupport = false; + _handleGenerated = false; _clearSetEnv = false; _openedMfile = false; _hwDevId = 0; @@ -991,6 +991,8 @@ FwCompsMgr::FwCompsMgr(mfile* mf, DeviceTypeT devType, int deviceIndex) FwCompsMgr::FwCompsMgr(const char* devname, DeviceTypeT devType, int deviceIndex) { _mf = NULL; + _fwSupport = false; + _handleGenerated = false; _openedMfile = false; _clearSetEnv = false; _accessObj = NULL; @@ -1098,11 +1100,16 @@ bool FwCompsMgr::forceRelease() void FwCompsMgr::GenerateHandle() { - if (!controlFsm(FSM_QUERY, FSMST_NA, 0, FSMST_NA, NULL, REG_ACCESS_TOUT)) { - _updateHandle = 0; - return; + if (!_handleGenerated) + { + if (!controlFsm(FSM_QUERY, FSMST_NA, 0, FSMST_NA, NULL, REG_ACCESS_TOUT)) + { + _updateHandle = 0; + return; + } + _updateHandle = _lastFsmCtrl.update_handle & 0xffffff; + _handleGenerated = true; } - _updateHandle = _lastFsmCtrl.update_handle & 0xffffff; } const char* CompNames[] = {"NO_COMPONENT 1", "COMPID_BOOT_IMG", @@ -1206,6 +1213,7 @@ bool FwCompsMgr::readComponent(FwComponent::comps_ids_t compType, u_int32_t compSize = _currCompQuery->comp_cap.component_size; if (_currCompQuery->comp_cap.rd_en) { + GenerateHandle(); data.resize(compSize); if (!controlFsm(FSM_CMD_LOCK_UPDATE_HANDLE, FSMST_LOCKED)) { return false; @@ -1286,6 +1294,7 @@ bool FwCompsMgr::burnComponents(std::vector < FwComponent >& comps, ProgressCall if (!RefreshComponentsStatus()) { return false; } + GenerateHandle(); if (!controlFsm(FSM_CMD_LOCK_UPDATE_HANDLE, FSMST_LOCKED)) { DPRINTF(("Cannot lock the handle!\n")); if (forceRelease() == false) { @@ -1534,13 +1543,22 @@ u_int32_t FwCompsMgr::getFwSupport() _lastError = FWCOMPS_UNSUPPORTED_DEVICE; return 0; } - _mircCaps = EXTRACT(mcam.mng_access_reg_cap_mask[3 - 3], 2, 1); + int mode = 0; + struct tools_open_mlock mlock; + memset(&mlock, 0, sizeof(mlock)); + rc = reg_access_secure_host(_mf, REG_ACCESS_METHOD_GET, &mlock); + if (rc == ME_OK) + { + mode = mlock.operation; + } + DPRINTF(( - "getFwSupport _mircCaps = %d mcqsCap = %d mcqiCap = %d mccCap = %d mcdaCap = %d mqisCap = %d mcddCap = %d mgirCap = %d\n", - _mircCaps, mcqsCap, mcqiCap, mccCap, mcdaCap, mqisCap, mcddCap, mgirCap)); + "getFwSupport _mircCaps = %d mcqsCap = %d mcqiCap = %d mccCap = %d mcdaCap = %d mqisCap = %d mcddCap = %d mgirCap = %d secure_host = %d\n", + _mircCaps, mcqsCap, mcqiCap, mccCap, mcdaCap, mqisCap, mcddCap, mgirCap, mode)); - if (mcqsCap && mcqiCap && mccCap && mcdaCap && mqisCap && mgirCap) { + if (mcqsCap && mcqiCap && mccCap && mcdaCap && mqisCap && mgirCap && mode == 0) + { return 1; } _lastError = FWCOMPS_UNSUPPORTED_DEVICE; @@ -1885,6 +1903,9 @@ unsigned char* FwCompsMgr::getLastErrMsg() case FWCOMPS_MCC_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE: return (unsigned char*)"DRAM not available"; + case FWCOMPS_MCC_REJECTED_FLASH_WP: + return (unsigned char*)"Flash is write protected"; + case FWCOMPS_UNSUPPORTED_DEVICE: return (unsigned char*)"Unsupported device"; @@ -2145,6 +2166,7 @@ bool FwCompsMgr::readBlockFromComponent(FwComponent::comps_ids_t compId, return false; } if (_currCompQuery->comp_cap.rd_en) { + GenerateHandle(); data.resize(size); if (!controlFsm(FSM_CMD_LOCK_UPDATE_HANDLE, FSMST_LOCKED)) { return false; @@ -2412,6 +2434,9 @@ fw_comps_error_t FwCompsMgr::mccErrTrans(u_int8_t err) case MCC_ERRCODE_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE: return FWCOMPS_MCC_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE; + case MCC_ERRCODE_REJECTED_FLASH_WP: + return FWCOMPS_MCC_REJECTED_FLASH_WP; + default: return FWCOMPS_GENERAL_ERR; } diff --git a/fw_comps_mgr/fw_comps_mgr.h b/fw_comps_mgr/fw_comps_mgr.h index 46f5246b..22acd847 100644 --- a/fw_comps_mgr/fw_comps_mgr.h +++ b/fw_comps_mgr/fw_comps_mgr.h @@ -288,6 +288,7 @@ typedef enum FWCOMPS_MCC_REJECTED_INCOMPATIBLE_FLASH = 0x117, FWCOMPS_MCC_REJECTED_TOKEN_ALREADY_APPLIED = 0x118, FWCOMPS_MCC_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE = 0x119, + FWCOMPS_MCC_REJECTED_FLASH_WP = 0x129, // errors regarding REG_ACCESS FWCOMPS_REG_ACCESS_OK = 0, @@ -491,7 +492,8 @@ class FwCompsMgr MCC_ERRCODE_REJECTED_LINKX_ACTIVATE = 0x15, MCC_ERRCODE_REJECTED_INCOMPATIBLE_FLASH = 0x16, MCC_ERRCODE_REJECTED_TOKEN_ALREADY_APPLIED = 0x17, - MCC_ERRCODE_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE = 0x18 + MCC_ERRCODE_REJECTED_FW_BURN_DRAM_NOT_AVAILABLE = 0x18, + MCC_ERRCODE_REJECTED_FLASH_WP = 0x28 } mcc_command_error_t; typedef enum @@ -565,6 +567,8 @@ class FwCompsMgr bool IsDevicePresent(FwComponent::comps_ids_t compType); std::vector _compsQueryMap; + bool _fwSupport; + bool _handleGenerated; bool _refreshed; bool _clearSetEnv; bool _openedMfile; diff --git a/kernel/mstflint_kernel.spec b/kernel/mstflint_kernel.spec index 780b53d3..08a30a03 100644 --- a/kernel/mstflint_kernel.spec +++ b/kernel/mstflint_kernel.spec @@ -22,7 +22,7 @@ %global _name kernel-mstflint %endif -%{!?version: %global version 4.26.0} +%{!?version: %global version 4.27.0} %{!?_release: %global _release 1} %global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist} diff --git a/mflash/flash_int_defs.h b/mflash/flash_int_defs.h index e69fd09e..f7142d80 100644 --- a/mflash/flash_int_defs.h +++ b/mflash/flash_int_defs.h @@ -91,7 +91,7 @@ typedef enum flash_densities FD_64 = 0x17, FD_128 = 0x18, FD_256 = 0x19, - FD_512 = 0x1a + FD_512 = 0x1a // flash vendors advertise 0x20 } flash_densities_t; #endif /* USER_MFLASH_FLASH_INT_DEFS_H_ */ diff --git a/mflash/mflash.c b/mflash/mflash.c index 9ef6fe3f..685fdc14 100644 --- a/mflash/mflash.c +++ b/mflash/mflash.c @@ -418,12 +418,14 @@ flash_info_t g_flash_info_arr[] = { {"M25Pxx", FV_ST, FMT_ST_M25P, FD_LEGACY, MCS_STSPI, SFC_SE, FSS_64KB, 0, 0, 0, 0, 0, 0}, {"N25Q0XX", FV_ST, FMT_N25QXXX, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 0, 1, 0}, /*{MICRON_3V_NAME, FV_ST, FMT_N25QXXX, 1 << FD_256, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 1, 0}, */ + {MICRON_3V_NAME, FV_ST, FMT_N25QXXX, 1 << FD_512, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 1, 0}, {SST_FLASH_NAME, FV_SST, FMT_SST_25, FD_LEGACY, MCS_SSTSPI, SFC_SE, FSS_64KB, 0, 0, 0, 0, 0, 0}, {WINBOND_NAME, FV_WINBOND, FMT_WINBOND, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 1, 0, 0}, {WINBOND_W25X, FV_WINBOND, FMT_WINBOND_W25X, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 0, 0, 0, 0, 0, 0}, {WINBOND_3V_NAME, FV_WINBOND, FMT_WINBOND_3V, 1 << FD_128, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 1, 0, 1}, {WINBOND_3V_NAME, FV_WINBOND, FMT_WINBOND_3V, 1 << FD_256, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 1}, {WINBOND_3V_NAME, FV_WINBOND, FMT_WINBOND, 1 << FD_256, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 1}, + {WINBOND_3V_NAME, FV_WINBOND, FMT_WINBOND, 1 << FD_512, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 1}, {ATMEL_NAME, FV_ATMEL, FMT_ATMEL, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 0, 0, 0, 0, 0, 0}, {S25FLXXXP_NAME, FV_S25FLXXXX, FMT_S25FLXXXP, FD_LEGACY, MCS_STSPI, SFC_SE, FSS_64KB, 0, 0, 0, 0, 0, 0}, {S25FL116K_NAME, FV_S25FLXXXX, FMT_S25FL116K, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 1, 0, 0}, @@ -432,6 +434,7 @@ flash_info_t g_flash_info_arr[] = { {CYPRESS_3V_NAME, FV_S25FLXXXX, FMT_S25FLXXXL, 1 << FD_128, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 1, 0, 0}, /*{CYPRESS_3V_NAME, FV_S25FLXXXX, FMT_S25FLXXXL, 1 << FD_256, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 0}, */ {ISSI_3V_NAME, FV_IS25LPXXX, FMT_IS25LPXXX, FD_LEGACY, MCS_STSPI, SFC_SSE, FSS_4KB, 1, 1, 1, 0, 0, 0}, + {MACRONIX_1V8_NAME, FV_MX25K16XXX, FMT_SST_25, (1 << FD_32), MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 0}, {MACRONIX_1V8_NAME, FV_MX25K16XXX, FMT_SST_25, (1 << FD_256), MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 0, 0, 0}, /* added by edwardg 06/09/2020 */ {ISSI_HUAWEY_NAME, FV_IS25LPXXX, FMT_IS25LPXXX, 1 << FD_256, MCS_STSPI, SFC_4SSE, FSS_4KB, 1, 1, 1, 1, 1, 0}, @@ -470,6 +473,10 @@ int get_log2size_by_vendor_type_density(u_int8_t vendor, u_int8_t type, u_int8_t { return cntx_sst_get_log2size(density, log2size); } + if (((type == FMT_WINBOND && vendor == FV_WINBOND) || (type == FMT_N25QXXX && vendor == FV_ST)) && density == 0x20) + { + *log2size = 0x1a; + } else { *log2size = density; @@ -486,6 +493,14 @@ int get_type_index_by_vendor_type_density(u_int8_t vendor, u_int8_t type, u_int8 for (i = 0; i < arr_size; i++) { flash_info_t* flash_info = &g_flash_info_arr[i]; + + if (flash_info->vendor == vendor && flash_info->type == type) + { + if (density == 0x20) + { + density = 0x1a; + } + } if ((flash_info->vendor == vendor) && (flash_info->type == type) && ((flash_info->densities & (1 << density)) != 0)) { @@ -4118,7 +4133,6 @@ int mf_get_write_protect_direct_access(mflash* mfl, u_int8_t bank_num, write_pro int mf_is_fifth_gen(mflash* mfl) { MfError status; - int is7NmSuppported = 0; int icmdif_supported = is_icmdif_supported(mfl, &status); if (status != MFE_OK) { diff --git a/mlxconfig/mlxcfg_generic_commander.cpp b/mlxconfig/mlxcfg_generic_commander.cpp index d9c2ebce..7af1bc54 100644 --- a/mlxconfig/mlxcfg_generic_commander.cpp +++ b/mlxconfig/mlxcfg_generic_commander.cpp @@ -1654,6 +1654,7 @@ void GenericCommander::checkConfTlvs(const vector& tlvs, FwComponent:: bool rmdtCompFound = false; bool rmcsCompFound = false; bool foundApplicableTLV = false; + bool foundFileDeviceID = false; bool idMlnxCompFound = false; bool idVendorCompFound = false; bool deviceUniqueFound = false; @@ -1703,6 +1704,10 @@ void GenericCommander::checkConfTlvs(const vector& tlvs, FwComponent:: { foundApplicableTLV = true; } + else if (tlv->_name == "file_device_id") + { + foundFileDeviceID = true; + } else if (tlv->_name == "file_device_unique") { deviceUniqueFound = true; @@ -1740,10 +1745,17 @@ void GenericCommander::checkConfTlvs(const vector& tlvs, FwComponent:: throw MlxcfgException("Only one component is allowed"); } - // At least one TLV must be file_applicable_to - if (!foundApplicableTLV) + // At least one TLV must be file_applicable_to or file_device_id + if (!(foundApplicableTLV || foundFileDeviceID)) + { + throw MlxcfgException("At least one file_applicable_to or file_device_id tlv must be in the " + "configuration file"); + } + + // both file_applicable_to and file_device_id can't exist in the same file + if (foundApplicableTLV && foundFileDeviceID) { - throw MlxcfgException("At least one file_applicable_to tlv must be in the " + throw MlxcfgException("Both file_applicable_to and file_device_id tlv must not be in the " "configuration file"); } } @@ -1767,7 +1779,7 @@ void GenericCommander::orderConfTlvs(vector& tlvs) VECTOR_ITERATOR(TLVConf*, tlvs, it) { TLVConf* tlv = *it; - if (tlv->_name == "file_applicable_to") + if (tlv->_name == "file_applicable_to" || tlv->_name == "file_device_id") { *it = *(tlvs.begin() + 1); *(tlvs.begin() + 1) = tlv; diff --git a/mlxconfig/mlxcfg_parser.cpp b/mlxconfig/mlxcfg_parser.cpp index c6b562e0..612a6110 100644 --- a/mlxconfig/mlxcfg_parser.cpp +++ b/mlxconfig/mlxcfg_parser.cpp @@ -393,7 +393,6 @@ mlxCfgStatus MlxCfg::getNumberFromString(const char* str, u_int32_t& num) mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[]) { - mlxCfgStatus status = MLX_CFG_OK; int i = 1; for (; i < argc; i++) { diff --git a/mlxconfig/mlxconfig_dbs/mlxconfig_host.db b/mlxconfig/mlxconfig_dbs/mlxconfig_host.db index f3f4fc5c..a782ca58 100644 Binary files a/mlxconfig/mlxconfig_dbs/mlxconfig_host.db and b/mlxconfig/mlxconfig_dbs/mlxconfig_host.db differ diff --git a/mlxconfig/mlxconfig_dbs/mlxconfig_switch.db b/mlxconfig/mlxconfig_dbs/mlxconfig_switch.db index b97fb16b..778f5b1c 100644 Binary files a/mlxconfig/mlxconfig_dbs/mlxconfig_switch.db and b/mlxconfig/mlxconfig_dbs/mlxconfig_switch.db differ diff --git a/mlxdpa/Makefile.am b/mlxdpa/Makefile.am old mode 100755 new mode 100644 diff --git a/mlxdpa/certcontainerbase.cpp b/mlxdpa/certcontainerbase.cpp old mode 100755 new mode 100644 index 02a74b59..0d6dbc37 --- a/mlxdpa/certcontainerbase.cpp +++ b/mlxdpa/certcontainerbase.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include "certcontainerbase.h" diff --git a/mlxdpa/certcontainerbase.h b/mlxdpa/certcontainerbase.h old mode 100755 new mode 100644 index c03c55d3..aee2d4ed --- a/mlxdpa/certcontainerbase.h +++ b/mlxdpa/certcontainerbase.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #ifndef MLXDPA_CACERTCONTAINER_H_ @@ -99,4 +119,4 @@ class CertContainerItem shared_ptr _struct; }; -#endif /* MLXDPA_CACERTCONTAINER_H_ */ \ No newline at end of file +#endif /* MLXDPA_CACERTCONTAINER_H_ */ diff --git a/mlxdpa/certcontainerimp.cpp b/mlxdpa/certcontainerimp.cpp old mode 100755 new mode 100644 index 8c160253..ac557c57 --- a/mlxdpa/certcontainerimp.cpp +++ b/mlxdpa/certcontainerimp.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include "certcontainerimp.h" diff --git a/mlxdpa/certcontainerimp.h b/mlxdpa/certcontainerimp.h old mode 100755 new mode 100644 index 68d164af..c4c30c47 --- a/mlxdpa/certcontainerimp.h +++ b/mlxdpa/certcontainerimp.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include "certcontainerbase.h" @@ -77,4 +97,4 @@ class CertStructSignature : public CertStructBase private: vector _signature; -}; \ No newline at end of file +}; diff --git a/mlxdpa/cryptodata.cpp b/mlxdpa/cryptodata.cpp old mode 100755 new mode 100644 index 3513a046..a0207e97 --- a/mlxdpa/cryptodata.cpp +++ b/mlxdpa/cryptodata.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -251,4 +271,4 @@ void CryptoDataSection::Sign(const MlxSign::Signer& signer) CPUTOn(_cryptoSignature.data(), _cryptoSignature.size() / 4); // Converting signature (which is big-endian) to platform endianness -} \ No newline at end of file +} diff --git a/mlxdpa/cryptodata.h b/mlxdpa/cryptodata.h old mode 100755 new mode 100644 index 686b18f4..ec567938 --- a/mlxdpa/cryptodata.h +++ b/mlxdpa/cryptodata.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #ifndef MLXDPA_CRYPTODATA_H_ @@ -114,4 +134,4 @@ class CryptoDataSection CertChain _certChain; }; -#endif /* MLXDPA_CRYPTODATA_H_ */ \ No newline at end of file +#endif /* MLXDPA_CRYPTODATA_H_ */ diff --git a/mlxdpa/dpa_elf/dpa_elf.h b/mlxdpa/dpa_elf/dpa_elf.h index 2fabf372..fa636c42 100644 --- a/mlxdpa/dpa_elf/dpa_elf.h +++ b/mlxdpa/dpa_elf/dpa_elf.h @@ -1,15 +1,33 @@ /* - * NVIDIA_COPYRIGHT_BEGIN - * - * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. - * - * NVIDIA CORPORATION and its licensors retain all intellectual property - * and proprietary rights in and to this software, related documentation - * and any modifications thereto. Any use, reproduction, disclosure or - * distribution of this software and related documentation without an express - * license agreement from NVIDIA CORPORATION is strictly prohibited. - * - * NVIDIA_COPYRIGHT_END + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include diff --git a/mlxdpa/elfio/elf_types.hpp b/mlxdpa/elfio/elf_types.hpp old mode 100755 new mode 100644 index b99c35f3..b0823b55 --- a/mlxdpa/elfio/elf_types.hpp +++ b/mlxdpa/elfio/elf_types.hpp @@ -23,6 +23,8 @@ THE SOFTWARE. #ifndef ELFTYPES_H #define ELFTYPES_H +#include + #ifdef __cplusplus namespace ELFIO { #endif diff --git a/mlxdpa/elfio/elfio.hpp b/mlxdpa/elfio/elfio.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_array.hpp b/mlxdpa/elfio/elfio_array.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_dump.hpp b/mlxdpa/elfio/elfio_dump.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_dynamic.hpp b/mlxdpa/elfio/elfio_dynamic.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_header.hpp b/mlxdpa/elfio/elfio_header.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_modinfo.hpp b/mlxdpa/elfio/elfio_modinfo.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_note.hpp b/mlxdpa/elfio/elfio_note.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_relocation.hpp b/mlxdpa/elfio/elfio_relocation.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_section.hpp b/mlxdpa/elfio/elfio_section.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_segment.hpp b/mlxdpa/elfio/elfio_segment.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_strings.hpp b/mlxdpa/elfio/elfio_strings.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_symbols.hpp b/mlxdpa/elfio/elfio_symbols.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_utils.hpp b/mlxdpa/elfio/elfio_utils.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_version.hpp b/mlxdpa/elfio/elfio_version.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/elfio/elfio_versym.hpp b/mlxdpa/elfio/elfio_versym.hpp old mode 100755 new mode 100644 diff --git a/mlxdpa/hostelf.cpp b/mlxdpa/hostelf.cpp old mode 100755 new mode 100644 index fb8d044a..9bc73765 --- a/mlxdpa/hostelf.cpp +++ b/mlxdpa/hostelf.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -34,16 +54,6 @@ HostElf::HostElf(string path, string outputPath) : _filePath(path), _outputPath( } // TODO should i release resources in _dpaAppsTable? _dpaAppsTable = getAppList(hostELF); - - if (_outputPath.empty()) - { - _outputPath = _filePath; - } - else - { - string cmd("cp " + _filePath + " " + _outputPath); - RunCommand(cmd, "Failed to create output file"); - } fclose(hostELF); } @@ -98,4 +108,4 @@ void HostElf::RemoveSection(string sectionName) { string cmd("objcopy --remove-section " + sectionName + " " + _outputPath); RunCommand(cmd, "Failed to remove section from Host ELF"); -} \ No newline at end of file +} diff --git a/mlxdpa/hostelf.h b/mlxdpa/hostelf.h old mode 100755 new mode 100644 index aa295e4d..47026283 --- a/mlxdpa/hostelf.h +++ b/mlxdpa/hostelf.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #ifndef MLXDPA_HOSTELF_H_ @@ -36,4 +56,4 @@ class HostElf AppTable _dpaAppsTable; }; -#endif /* MLXDPA_HOSTELF_H_ */ \ No newline at end of file +#endif /* MLXDPA_HOSTELF_H_ */ diff --git a/mlxdpa/mlxdpa.cpp b/mlxdpa/mlxdpa.cpp old mode 100755 new mode 100644 index ff7597a7..18a1ab07 --- a/mlxdpa/mlxdpa.cpp +++ b/mlxdpa/mlxdpa.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -74,6 +94,7 @@ MlxDpa::MlxDpa() : _removeAllCertsSpecified(false), _removeAllCerts(false), _certContainerPath(""), + _certContainerType(CertContainerType::UnknownType), _command(Unknown) { InitCmdParser(); @@ -555,6 +576,17 @@ void MlxDpa::SignCertContainer() void MlxDpa::SignHostElf() { const u_int32_t ALIGNMENT = 4; + + if (_outputPath.empty()) + { + _outputPath = _hostELFPath; + } + else + { + string cmd("cp " + _hostELFPath + " " + _outputPath); + RunCommand(cmd, "Failed to create output file"); + } + HostElf hostElf(_hostELFPath, _outputPath); CryptoDataSection::CertChain certChain; unique_ptr signer = CreateSigner(_privateKeyPem, _keyLabel); @@ -597,10 +629,16 @@ void MlxDpa::SignHostElf() { throw MlxDpaException("Failed to open Host ELF file with error: %s", strerror(errno)); } + MLX_DPA_DPRINTF( + ("Calling updateSigSectionName: appName %s, sigSectionName %s.\n", app->name, sigSectionName.c_str())); if (updateSigSectionName(outHostELF, app->name, (char*)sigSectionName.c_str())) { throw MlxDpaException("Failed to update signature section name in metadata for %s.\n", app->name); } + if (fclose(outHostELF) != 0) + { + throw MlxDpaException("Failed to close Host ELF file with error: %s", strerror(errno)); + } } cout << _outputPath << " was signed successfully." << endl; @@ -647,4 +685,4 @@ int main(int argc, char** argv) return 1; } return 0; -} \ No newline at end of file +} diff --git a/mlxdpa/mlxdpa.h b/mlxdpa/mlxdpa.h old mode 100755 new mode 100644 index fd80555d..aa307f6b --- a/mlxdpa/mlxdpa.h +++ b/mlxdpa/mlxdpa.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #ifndef MLXDPA_H_ @@ -106,4 +126,4 @@ class MlxDpa : public CommandLineRequester MlxDpaCmd _command; }; -#endif /* MLXDPA_H_ */ \ No newline at end of file +#endif /* MLXDPA_H_ */ diff --git a/mlxdpa/mlxdpa_utils.cpp b/mlxdpa/mlxdpa_utils.cpp old mode 100755 new mode 100644 index c3991cb7..1b510b96 --- a/mlxdpa/mlxdpa_utils.cpp +++ b/mlxdpa/mlxdpa_utils.cpp @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include "mlxdpa_utils.h" @@ -170,4 +190,4 @@ MlxDpaException::MlxDpaException(const char* fmt, ...) vsnprintf(tmp, max, fmt, args); va_end(args); _err = tmp; -} \ No newline at end of file +} diff --git a/mlxdpa/mlxdpa_utils.h b/mlxdpa/mlxdpa_utils.h old mode 100755 new mode 100644 index 0ed5e8e7..3d6da074 --- a/mlxdpa/mlxdpa_utils.h +++ b/mlxdpa/mlxdpa_utils.h @@ -1,13 +1,33 @@ /* - * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. + * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. * - * This software product is a proprietary product of Nvidia Corporation and its affiliates - * (the "Company") and all right, title, and interest in and to the software - * product, including all associated intellectual property rights, are and - * shall remain exclusively with the Company. + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: * - * This software product is governed by the End User License Agreement - * provided with the software product. + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #ifndef MLXDPA_UTILS_H_ @@ -76,4 +96,4 @@ class MlxDpaException : public exception virtual const char* what() const throw() { return _err.c_str(); } }; -#endif /* MLXDPA_UTILS_H_ */ \ No newline at end of file +#endif /* MLXDPA_UTILS_H_ */ diff --git a/mlxfwops/lib/Makefile.am b/mlxfwops/lib/Makefile.am index f47b8267..e41a814b 100644 --- a/mlxfwops/lib/Makefile.am +++ b/mlxfwops/lib/Makefile.am @@ -46,7 +46,9 @@ AM_CPPFLAGS = \ AM_CPPFLAGS += $(JSON_CFLAGS) -AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe $(COMPILER_FPIC) -Wno-implicit-fallthrough +AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe $(COMPILER_FPIC) +AM_CPPFLAGS += -Wno-unused-parameter +AM_CXXFLAGS += -Wno-stringop-truncation if ENABLE_FWMGR AM_CPPFLAGS += -I$(top_srcdir)/libmfa diff --git a/mlxfwops/lib/flint_base.h b/mlxfwops/lib/flint_base.h index b513ce33..350e552d 100644 --- a/mlxfwops/lib/flint_base.h +++ b/mlxfwops/lib/flint_base.h @@ -403,9 +403,10 @@ typedef enum fs3_section FS4_CERTIFICATE_CHAINS_2 = 0xf5, FS4_ROOT_CERTIFICATES_1 = 0xf6, FS4_ROOT_CERTIFICATES_2 = 0xf7, + FS4_TOOLS_AREA = 0xf9, FS4_HASHES_TABLE = 0xfa, FS4_HW_PTR = 0xfb, - FS4_TOOLS_AREA = 0xfc, + FS4_FW_DEBUG_DUMP = 0xfc, FS3_ITOC = 0xfd, FS3_DTOC = 0xfe, FS3_END = 0xff, diff --git a/mlxfwops/lib/fs3_ops.cpp b/mlxfwops/lib/fs3_ops.cpp index 0580fc20..f1e2f921 100644 --- a/mlxfwops/lib/fs3_ops.cpp +++ b/mlxfwops/lib/fs3_ops.cpp @@ -139,9 +139,10 @@ const Fs3Operations::SectionInfo Fs3Operations::_fs3SectionsInfoArr[] = { {FS4_CERTIFICATE_CHAINS_2, "CERTIFICATE_CHAINS_2"}, {FS4_ROOT_CERTIFICATES_1, "ROOT_CERTIFICATES_1"}, {FS4_ROOT_CERTIFICATES_2, "ROOT_CERTIFICATES_2"}, + {FS4_TOOLS_AREA, "TOOLS_AREA"}, {FS3_DTOC, "DTOC_HEADER"}, {FS4_HW_PTR, "HW_POINTERS"}, - {FS4_TOOLS_AREA, "TOOLS_AREA"}, + {FS4_FW_DEBUG_DUMP, "FW_DEBUG_DUMP"}, {FS4_RSA_PUBLIC_KEY, "RSA_PUBLIC_KEY"}, {FS4_RSA_4096_SIGNATURES, "RSA_4096_SIGNATURES"}, {FS4_EXCLKSYNC_INFO, "EXCLKSYNC_INFO"}, @@ -313,6 +314,7 @@ bool Fs3Operations::GetImageInfo(u_int8_t* buff) _fwImgInfo.ext_info.fw_rel_time[2] = (u_int16_t)image_info.FW_VERSION.Seconds; _fwImgInfo.ext_info.burn_image_size = image_info.burn_image_size; + _fwImgInfo.ext_info.dtoc_offset = image_info.dtoc_offset; /* assuming number of supported_hw_id < MAX_NUM_SUPP_HW_IDS */ memcpy(_fwImgInfo.supportedHwId, image_info.supported_hw_id, sizeof(image_info.supported_hw_id)); diff --git a/mlxfwops/lib/fs4_ops.cpp b/mlxfwops/lib/fs4_ops.cpp index 39e67ffc..0c48d1ee 100644 --- a/mlxfwops/lib/fs4_ops.cpp +++ b/mlxfwops/lib/fs4_ops.cpp @@ -919,6 +919,12 @@ bool Fs4Operations::FsVerifyAux(VerifyCallBack verifyCallBackFunc, return false; } + if (!ParseImageInfoFromEncryptedImage()) + { + DPRINTF(("Fs4Operations::FsVerifyAux Failed to read IMAGE_INFO section")); + return false; + } + // if nextBootFwVer is true, no need to get all the information, just the fw version is enough - therefore skip // everything else if (!nextBootFwVer) @@ -1043,7 +1049,10 @@ bool Fs4Operations::FsVerifyAux(VerifyCallBack verifyCallBackFunc, is_image_in_odd_chunks = _ioAccess->get_is_image_in_odd_chunks(); _ioAccess->set_address_convertor(0, 0); //-Verify DToC Header: - dtocPtr = _ioAccess->get_effective_size() - FS4_DEFAULT_SECTOR_SIZE; + if (!GetDtocAddress(dtocPtr)) + { + return false; + } DPRINTF(("Fs4Operations::FsVerifyAux call verifyTocHeader() DTOC\n")); if (!verifyTocHeader(dtocPtr, true, verifyCallBackFunc)) { @@ -1134,6 +1143,22 @@ bool Fs4Operations::GetImageInfo(u_int8_t* buff) return true; } +bool Fs4Operations::GetDtocAddress(u_int32_t& dTocAddress) +{ + u_int32_t imageSize = _ioAccess->get_effective_size(); + + if (_fwImgInfo.ext_info.dtoc_offset != 0) + { + dTocAddress = (imageSize / (_fwImgInfo.ext_info.dtoc_offset * 2)) - FS4_DEFAULT_SECTOR_SIZE; + } + else + { + dTocAddress = imageSize - FS4_DEFAULT_SECTOR_SIZE; + } + + return true; +} + bool Fs4Operations::CheckDevRSAPublicKeyUUID() { //* Read RSA_PUBLIC_KEY section @@ -1177,12 +1202,38 @@ bool Fs4Operations::encryptedFwReadImageInfoSection() return true; } +bool Fs4Operations::ParseImageInfoFromEncryptedImage() +{ + //* Read IMAGE_INFO section + u_int32_t image_info_section_addr = _image_info_section_ptr + _fwImgInfo.imgStart; + DPRINTF( + ("Fs4Operations::ParseImageInfoFromEncryptedImage image_info_section_addr = 0x%x\n", image_info_section_addr)); + vector image_info_data; + image_info_data.resize(IMAGE_LAYOUT_IMAGE_INFO_SIZE); + if (!_ioAccess->read(image_info_section_addr, image_info_data.data(), IMAGE_LAYOUT_IMAGE_INFO_SIZE)) + { + return errmsg("%s - read error (%s)\n", "IMAGE_INFO", (*_ioAccess).err()); + } + + //* Parse IMAGE_INFO section + if (!GetImageInfo(image_info_data.data())) + { + return errmsg("Failed to parse IMAGE_INFO section - %s", err()); + } + + return true; +} + bool Fs4Operations::ParseDevData(bool quickQuery, bool verbose, VerifyCallBack verifyCallBackFunc, bool showItoc) { //* Initializing DTOC info _ioAccess->set_address_convertor(0, 0); // Parse DTOC header: u_int32_t dtoc_addr = _ioAccess->get_size() - FS4_DEFAULT_SECTOR_SIZE; + if (!GetDtocAddress(dtoc_addr)) + { + return false; + } DPRINTF(("Fs4Operations::ParseDevData call verifyTocHeader() DTOC, dtoc_addr = 0x%x\n", dtoc_addr)); if (!verifyTocHeader(dtoc_addr, true, verifyCallBackFunc)) { @@ -2488,7 +2539,7 @@ bool Fs4Operations::burnEncryptedImage(FwOperations* imageOps, ExtBurnParams& bu total_img_size, alreadyWrittenSz)) { - return errmsg("Failed to burn encrypted image\n"); + return errmsg("Failed to burn encrypted image - %s\n", this->err()); } alreadyWrittenSz += imgBuff.size() - FS3_FW_SIGNATURE_SIZE; @@ -2498,6 +2549,10 @@ bool Fs4Operations::burnEncryptedImage(FwOperations* imageOps, ExtBurnParams& bu // Get DTOC from the cache u_int8_t* dtoc_data = new u_int8_t[FS4_DEFAULT_SECTOR_SIZE]; u_int32_t dtoc_addr = imageOps->GetIoAccess()->get_size() - FS4_DEFAULT_SECTOR_SIZE; + if (!((Fs4Operations*)imageOps)->GetDtocAddress(dtoc_addr)) + { + return false; + } DPRINTF(("Fs4Operations::burnEncryptedImage - Burning DTOC at addr 0x%0x\n", dtoc_addr)); ((Fs4Operations*)imageOps)->_imageCache.get(dtoc_data, dtoc_addr, FS4_DEFAULT_SECTOR_SIZE); if (!writeImageEx(burnParams.progressFuncEx, @@ -2805,7 +2860,7 @@ bool Fs4Operations::FsBurnAux(FwOperations* imgops, ExtBurnParams& burnParams) bool rc; Fs4Operations& imageOps = *((Fs4Operations*)imgops); - if (imageOps.FwType() != FIT_FS4) + if (imageOps.FwType() != FIT_FS4 && imageOps.FwType() != FIT_FS5) { return errmsg(MLXFW_IMAGE_FORMAT_ERR, "FW image type is not compatible with device (FS4)"); } @@ -3281,13 +3336,13 @@ bool Fs4Operations::Fs4UpdateVpdSection(struct fs4_toc_info* curr_toc, char* vpd return errmsg("Size of VPD file: %d is not 4-byte aligned!", vpd_size); } - // check if vpd exceeds the dtoc array - u_int32_t vpdAddress = curr_toc->toc_entry.flash_addr << 2; - if (vpdAddress + vpd_size >= (_ioAccess->get_size() - FS4_DEFAULT_SECTOR_SIZE)) + // corresponds to VPD max size in mlx + if (vpd_size > 0x1000) { delete[] vpd_data; - return errmsg("VPD data exceeds dtoc array, max VPD size: 0x%x bytes", _ioAccess->get_size() - vpdAddress - 1); + return errmsg("VPD data size exceeds max VPD size: 0x%x bytes", 0x1000); } + GetSectData(newSectionData, (u_int32_t*)vpd_data, vpd_size); curr_toc->toc_entry.size = vpd_size / 4; delete[] vpd_data; @@ -3811,15 +3866,10 @@ bool Fs4Operations::UpdateSection(void* new_info, } else { - int tocIndex = 0; - if (!Fs4GetItocInfo(tocArr, numOfTocs, sect_type, curr_toc, tocIndex)) + if (!Fs4GetItocInfo(tocArr, numOfTocs, sect_type, curr_toc)) { return false; } - if (sect_type == FS3_VPD_R0 && ((u_int32_t)tocIndex) != numOfTocs - 1) - { - return errmsg("VPD Section is not the last device section"); - } } if (!curr_toc) @@ -4101,9 +4151,11 @@ bool Fs4Operations::UpdateSection(fs3_section_t sectionType, { return false; } - if (sectionType == FS3_VPD_R0 && ((u_int32_t)tocIndex) != numOfTocs - 1) + + // corresponds to VPD max size in mlx + if (sectionType == FS3_VPD_R0 && newSectionData.size() > 0x1000) { - return errmsg("VPD Section is not the last device section"); + return errmsg("VPD data size exceeds max VPD size: 0x%x bytes", 0x1000); } if (!WriteSection(sectionToc, newSectionData, msg, callBackFunc)) @@ -4620,7 +4672,13 @@ bool Fs4Operations::ParsePublicKeyFromFile(const char* public_key_file, // Is the public key file in text format? if (PublicKeyIsSet == false) { - return errmsg("ParsePublicKeyFromFile: Public key file parsing failed, unknown format"); + string pubFileStr(public_key_file); + if (!fromFileToArray(pubFileStr, publicKeyData, PublicKeySize)) + { + return errmsg("ParsePublicKeyFromFile: Public key file parsing failed"); + } + DPRINTF(("Public key in text format. No key pair exponent and key auth conf, using default values\n")); + memset(&keyAuthConf, 0, sizeof(keyAuthConf)); } if (pem_offset > 0) @@ -4676,8 +4734,9 @@ bool Fs4Operations::GetFreeSlotInPublicKeys3(const image_layout_public_keys_3& p return errmsg("GetFreeSlotInPublicKeys3 failed - No free slot for public key\n"); } -bool Fs4Operations::IsPublicKeyAlreadyInPublicKeys2(const image_layout_public_keys_2& public_keys, - const image_layout_file_public_keys_2& public_key) +bool Fs4Operations::FindPublicKeyInPublicKeys2(const image_layout_public_keys_2& public_keys, + const image_layout_file_public_keys_2& public_key, + u_int32_t& idx) { bool res = false; u_int32_t num_of_key_slots = image_layout_public_keys_2_size() / image_layout_file_public_keys_2_size(); @@ -4687,6 +4746,7 @@ bool Fs4Operations::IsPublicKeyAlreadyInPublicKeys2(const image_layout_public_ke // Compare keys based on UUID if (equal(begin(public_key.keypair_uuid), end(public_key.keypair_uuid), begin(stored_public_key.keypair_uuid))) { + idx = ii; res = true; break; } @@ -4694,8 +4754,9 @@ bool Fs4Operations::IsPublicKeyAlreadyInPublicKeys2(const image_layout_public_ke return res; } -bool Fs4Operations::IsPublicKeyAlreadyInPublicKeys3(const image_layout_public_keys_3& public_keys, - const image_layout_file_public_keys_3& public_key) +bool Fs4Operations::FindPublicKeyInPublicKeys3(const image_layout_public_keys_3& public_keys, + const image_layout_file_public_keys_3& public_key, + u_int32_t& idx) { bool res = false; u_int32_t num_of_key_slots = image_layout_public_keys_3_size() / image_layout_file_public_keys_3_size(); @@ -4705,6 +4766,7 @@ bool Fs4Operations::IsPublicKeyAlreadyInPublicKeys3(const image_layout_public_ke // Compare keys based on UUID if (equal(begin(public_key.keypair_uuid), end(public_key.keypair_uuid), begin(stored_public_key.keypair_uuid))) { + idx = ii; res = true; break; } @@ -4776,7 +4838,7 @@ bool Fs4Operations::StoreImagePublicKeyInPublicKeys2(const image_layout_file_pub { // Find ITOC entry fs4_toc_info* itocEntry = (fs4_toc_info*)NULL; - image_layout_public_keys_2 public_keys_2; + image_layout_public_keys_2 public_keys_2 = {{}}; memset(&public_keys_2, 0, sizeof(public_keys_2)); if (!Fs4GetItocInfo(_fs4ImgInfo.itocArr.tocArr, _fs4ImgInfo.itocArr.numOfTocs, FS3_PUBLIC_KEYS_4096, itocEntry)) { @@ -4785,40 +4847,52 @@ bool Fs4Operations::StoreImagePublicKeyInPublicKeys2(const image_layout_file_pub image_layout_public_keys_2_unpack(&public_keys_2, itocEntry->section_data.data()); // Convert public_keys_3 to public_keys_2 - image_layout_file_public_keys_2 new_public_key_2; - memset(&new_public_key_2, 0, sizeof(new_public_key_2)); - copy(begin(public_key.key), end(public_key.key), begin(new_public_key_2.key)); - copy(begin(public_key.keypair_uuid), end(public_key.keypair_uuid), begin(new_public_key_2.keypair_uuid)); - new_public_key_2.keypair_exp = public_key.keypair_exp; - new_public_key_2.component_authentication_configuration = public_key.component_authentication_configuration; + image_layout_file_public_keys_2 new_public_key_2 = {{0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0}, {0}};; + PublicKey3ToPublicKey2(public_key, new_public_key_2); - if (IsPublicKeyAlreadyInPublicKeys2(public_keys_2, new_public_key_2) == false) + u_int32_t slot_of_given_key_in_image = 0; + if (!FindPublicKeyInPublicKeys2(public_keys_2, new_public_key_2, slot_of_given_key_in_image)) { - // Get free slot for public key - u_int32_t public_keys_2_free_slot_idx = 0; - if (!FindImagePublicKeyInPublicKeys2(public_keys_2, public_keys_2_free_slot_idx)) + if (new_public_key_2.component_authentication_configuration.auth_type == 0) + { + return errmsg("StoreImagePublicKeyInPublicKeys2 failed - missing authentication configuration data"); + } + else { - if (!GetFreeSlotInPublicKeys2(public_keys_2, public_keys_2_free_slot_idx)) + u_int32_t slot_idx_for_new_key = 0; + if (!FindImagePublicKeyInPublicKeys2(public_keys_2, slot_idx_for_new_key)) + { + if (!GetFreeSlotInPublicKeys2(public_keys_2, slot_idx_for_new_key)) + { + return errmsg("StoreImagePublicKeyInPublicKeys2 failed - Error: %s", err()); + } + } + + // Prepare public_keys_2 section data with public key at free slot index + public_keys_2.file_public_keys_2[slot_idx_for_new_key] = new_public_key_2; + vector public_keys_2_data; + public_keys_2_data.resize(image_layout_public_keys_2_size()); + image_layout_public_keys_2_pack(&public_keys_2, public_keys_2_data.data()); + if (!UpdateSection(FS3_PUBLIC_KEYS_4096, public_keys_2_data, "PUBLIC KEYS 4096")) { return errmsg("StoreImagePublicKeyInPublicKeys2 failed - Error: %s", err()); } } - - // Prepare public_keys_2 section data with public key at free slot index - public_keys_2.file_public_keys_2[public_keys_2_free_slot_idx] = new_public_key_2; - vector public_keys_2_data; - public_keys_2_data.resize(image_layout_public_keys_2_size()); - image_layout_public_keys_2_pack(&public_keys_2, public_keys_2_data.data()); - if (!UpdateSection(FS3_PUBLIC_KEYS_4096, public_keys_2_data, "PUBLIC KEYS 4096")) + } + else + { + if (public_keys_2.file_public_keys_2[slot_of_given_key_in_image].component_authentication_configuration.fw_en == + 0) { - return errmsg("StoreImagePublicKeyInPublicKeys2 failed - Error: %s", err()); + return errmsg( + "StoreImagePublicKeyInPublicKeys2 failed - key exists but conflicts authentication configuration"); } } return true; } -bool Fs4Operations::StoreImagePublicKeyInPublicKeys3(const image_layout_file_public_keys_3& new_public_key) +bool Fs4Operations::StoreImagePublicKeyInPublicKeys3(const image_layout_file_public_keys_3& public_key) { fs4_toc_info* itocEntry = (fs4_toc_info*)NULL; if (!Fs4GetItocInfo(_fs4ImgInfo.itocArr.tocArr, _fs4ImgInfo.itocArr.numOfTocs, FS4_RSA_PUBLIC_KEY, itocEntry)) @@ -4826,30 +4900,46 @@ bool Fs4Operations::StoreImagePublicKeyInPublicKeys3(const image_layout_file_pub return errmsg("StoreImagePublicKeyInPublicKeys3 failed - Error: %s", err()); } - image_layout_public_keys_3 stored_public_keys_3; - memset(&stored_public_keys_3, 0, sizeof(stored_public_keys_3)); - image_layout_public_keys_3_unpack(&stored_public_keys_3, itocEntry->section_data.data()); - - u_int32_t imagePublicKeyIndex = 0; + image_layout_public_keys_3 public_keys_3; + memset(&public_keys_3, 0, sizeof(public_keys_3)); + image_layout_public_keys_3_unpack(&public_keys_3, itocEntry->section_data.data()); - if (IsPublicKeyAlreadyInPublicKeys3(stored_public_keys_3, new_public_key) == false) + u_int32_t slot_of_given_key_in_image = 0; + if (!FindPublicKeyInPublicKeys3(public_keys_3, public_key, slot_of_given_key_in_image)) { - if (!FindImagePublicKeyInPublicKeys3(stored_public_keys_3, imagePublicKeyIndex)) + if (public_key.component_authentication_configuration.auth_type == 0) + { + return errmsg("StoreImagePublicKeyInPublicKeys3 failed - missing authentication configuration data"); + } + else { - if (!GetFreeSlotInPublicKeys3(stored_public_keys_3, imagePublicKeyIndex)) + u_int32_t slot_idx_for_new_key = 0; + if (!FindImagePublicKeyInPublicKeys3(public_keys_3, slot_idx_for_new_key)) { - return errmsg("StoreImagePublicKeyInPublicKeys3 failed - Error: %s", err()); + if (!GetFreeSlotInPublicKeys3(public_keys_3, slot_idx_for_new_key)) + { + return errmsg("StoreImagePublicKeyInPublicKeys3 failed - Error: %s", err()); + } } - } - stored_public_keys_3.file_public_keys_3[imagePublicKeyIndex] = new_public_key; + public_keys_3.file_public_keys_3[slot_idx_for_new_key] = public_key; - vector public_keys_3_data; - public_keys_3_data.resize(image_layout_public_keys_3_size()); - image_layout_public_keys_3_pack(&stored_public_keys_3, public_keys_3_data.data()); - if (!UpdateSection(public_keys_3_data.data(), FS4_RSA_PUBLIC_KEY, true, CMD_BURN, NULL)) + vector public_keys_3_data; + public_keys_3_data.resize(image_layout_public_keys_3_size()); + image_layout_public_keys_3_pack(&public_keys_3, public_keys_3_data.data()); + if (!UpdateSection(public_keys_3_data.data(), FS4_RSA_PUBLIC_KEY, true, CMD_BURN, NULL)) + { + return errmsg("StoreImagePublicKeyInPublicKeys3 failed - Error: %s", err()); + } + } + } + else + { + if (public_keys_3.file_public_keys_3[slot_of_given_key_in_image].component_authentication_configuration.fw_en == + 0) { - return errmsg("StoreImagePublicKeyInPublicKeys3 failed - Error: %s", err()); + return errmsg( + "StoreImagePublicKeyInPublicKeys3 failed - key exists but conflicts authentication configuration"); } } @@ -4892,6 +4982,16 @@ bool Fs4Operations::FindPublicKeyInPublicKeys2(const vector& keypair_ return true; } +void Fs4Operations::PublicKey3ToPublicKey2(const image_layout_file_public_keys_3& public_key_3, + image_layout_file_public_keys_2& public_key_2) +{ + memset(&public_key_2, 0, sizeof(public_key_2)); + copy(begin(public_key_3.key), end(public_key_3.key), begin(public_key_2.key)); + copy(begin(public_key_3.keypair_uuid), end(public_key_3.keypair_uuid), begin(public_key_2.keypair_uuid)); + public_key_2.keypair_exp = public_key_3.keypair_exp; + public_key_2.component_authentication_configuration = public_key_3.component_authentication_configuration; +} + void Fs4Operations::PublicKey2ToPublicKey3(const image_layout_file_public_keys_2& public_key_2, image_layout_file_public_keys_3& public_key_3) { diff --git a/mlxfwops/lib/fs4_ops.h b/mlxfwops/lib/fs4_ops.h index ea07ed91..85c9521b 100644 --- a/mlxfwops/lib/fs4_ops.h +++ b/mlxfwops/lib/fs4_ops.h @@ -209,6 +209,7 @@ class Fs4Operations : public Fs3Operations bool showItoc = false); bool GetHashesTableSize(u_int32_t& size); bool GetImageInfo(u_int8_t* buff); + virtual bool GetDtocAddress(u_int32_t& dTocAddress); private: @@ -241,6 +242,7 @@ class Fs4Operations : public Fs3Operations bool PrepItocSectionsForHmac(vector& critical, vector& non_critical); bool CheckSignatures(u_int32_t a[], u_int32_t b[], int n); bool encryptedFwReadImageInfoSection(); + bool ParseImageInfoFromEncryptedImage(); bool CheckDevRSAPublicKeyUUID(); virtual bool FwQuery(fw_info_t* fwInfo, bool readRom = true, @@ -384,10 +386,12 @@ class Fs4Operations : public Fs3Operations GetPublicKeyFromFile(const char* public_key_file, const char* uuid, image_layout_file_public_keys_3* public_key); virtual bool GetFreeSlotInPublicKeys2(const image_layout_public_keys_2& public_keys, u_int32_t& idx); virtual bool GetFreeSlotInPublicKeys3(const image_layout_public_keys_3& public_keys, u_int32_t& idx); - virtual bool IsPublicKeyAlreadyInPublicKeys2(const image_layout_public_keys_2& public_keys, - const image_layout_file_public_keys_2& public_key); - virtual bool IsPublicKeyAlreadyInPublicKeys3(const image_layout_public_keys_3& public_keys, - const image_layout_file_public_keys_3& public_key); + virtual bool FindPublicKeyInPublicKeys2(const image_layout_public_keys_2& public_keys, + const image_layout_file_public_keys_2& public_key, + u_int32_t& idx); + virtual bool FindPublicKeyInPublicKeys3(const image_layout_public_keys_3& public_keys, + const image_layout_file_public_keys_3& public_key, + u_int32_t& idx); virtual bool FindImagePublicKeyInPublicKeys2(const image_layout_public_keys_2& public_keys, u_int32_t& idx); virtual bool FindImagePublicKeyInPublicKeys3(const image_layout_public_keys_3& public_keys, u_int32_t& idx); virtual bool StoreImagePublicKeyInPublicKeys2(const image_layout_file_public_keys_3& public_key); @@ -397,6 +401,8 @@ class Fs4Operations : public Fs3Operations image_layout_file_public_keys_3& public_key); virtual void PublicKey2ToPublicKey3(const image_layout_file_public_keys_2& public_key_2, image_layout_file_public_keys_3& public_key_3); + virtual void PublicKey3ToPublicKey2(const image_layout_file_public_keys_3& public_key_3, + image_layout_file_public_keys_2& public_key_2); virtual bool ReadPublicKeys2SectionFromFile(const char* fname, image_layout_public_keys_2& public_keys_2_section); // Members diff --git a/mlxfwops/lib/fs5_ops.cpp b/mlxfwops/lib/fs5_ops.cpp index dbbf50ea..c44a5227 100644 --- a/mlxfwops/lib/fs5_ops.cpp +++ b/mlxfwops/lib/fs5_ops.cpp @@ -33,6 +33,8 @@ #include "calc_hw_crc.h" #include "fs5_image_layout_layouts.h" +const u_int32_t Fs5Operations::BCH_SIZE_IN_BYTES = 0x2000; + u_int8_t Fs5Operations::FwType() { return FIT_FS5; @@ -123,12 +125,12 @@ bool Fs5Operations::Init() { return false; } - // Below commented out at the moment, if needed just remove and inherit it from fs4_ops - // fw_info_t fwInfo; - // if (!FwQuery(&fwInfo, false, false, false)) - // { - // return false; - // } + + fw_info_t fwInfo; + if (!FwQuery(&fwInfo, false, false, false)) + { + return false; + } return true; } @@ -344,6 +346,10 @@ bool Fs5Operations::FsVerifyAux(VerifyCallBack verifyCallBackFunc, _ioAccess->set_address_convertor(0, 0); //-Verify DToC Header: u_int32_t dtocPtr = _ioAccess->get_effective_size() - FS4_DEFAULT_SECTOR_SIZE; + if (!GetDtocAddress(dtocPtr)) + { + return false; + } DPRINTF(("Fs5Operations::FsVerifyAux call verifyTocHeader() DTOC\n")); if (!verifyTocHeader(dtocPtr, true, verifyCallBackFunc)) { @@ -366,3 +372,97 @@ bool Fs5Operations::FwQuery(fw_info_t* fwInfo, bool, bool, bool quickQuery, bool DPRINTF(("Fs5Operations::FwQuery\n")); return encryptedFwQuery(fwInfo, quickQuery, ignoreDToc, verbose); } + +bool Fs5Operations::FwExtract4MBImage(vector& img, + bool maskMagicPatternAndDevToc, + bool verbose, + bool ignoreImageStart) +{ + bool res = Fs4Operations::FwExtract4MBImage(img, maskMagicPatternAndDevToc, verbose, ignoreImageStart); + + if (res) + { + bool isSigned = false; + + if (!IsSecureFwUpdateSigned(isSigned)) + { + return false; + } + + if (isSigned) + { + u_int32_t imageSize = img.size(); + img.resize(imageSize + BCH_SIZE_IN_BYTES); + u_int32_t log2_chunk_size = _ioAccess->get_log2_chunk_size(); + bool is_image_in_odd_chunks = _ioAccess->get_is_image_in_odd_chunks(); + + _ioAccess->set_address_convertor(0, 0); + if (!_ioAccess->read(_ioAccess->get_effective_size() - BCH_SIZE_IN_BYTES, img.data() + imageSize, + BCH_SIZE_IN_BYTES)) + { + return errmsg("Image - read error (%s)\n", _ioAccess->err()); + } + _ioAccess->set_address_convertor(log2_chunk_size, is_image_in_odd_chunks); + } + } + + return res; +} + +bool Fs5Operations::GetDtocAddress(u_int32_t& dTocAddress) +{ + u_int32_t imageSize = _ioAccess->get_effective_size(); + bool isSigned = false; + + if (!IsSecureFwUpdateSigned(isSigned)) + { + return false; + } + + if (isSigned) + { + imageSize -= BCH_SIZE_IN_BYTES; + } + + if (_fwImgInfo.ext_info.dtoc_offset != 0) + { + dTocAddress = (imageSize / (_fwImgInfo.ext_info.dtoc_offset * 2)) - FS4_DEFAULT_SECTOR_SIZE; + } + else + { + dTocAddress = imageSize - FS4_DEFAULT_SECTOR_SIZE; + } + + return true; +} + +bool Fs5Operations::IsSecureFwUpdateSigned(bool& isSigned) +{ + u_int32_t imageSize = _ioAccess->get_effective_size(); + const u_int32_t smallestSupportedImageSize = 0x40000; + + if ((imageSize % smallestSupportedImageSize) != 0) // Check if there's an encapsulation header + { + vector bchHeaderMagic(5, 0); + u_int32_t log2_chunk_size = _ioAccess->get_log2_chunk_size(); + bool is_image_in_odd_chunks = _ioAccess->get_is_image_in_odd_chunks(); + + _ioAccess->set_address_convertor(0, 0); + if (!_ioAccess->read(imageSize - BCH_SIZE_IN_BYTES, bchHeaderMagic.data(), 4)) + { + return errmsg("Image - read error (%s)\n", _ioAccess->err()); + } + _ioAccess->set_address_convertor(log2_chunk_size, is_image_in_odd_chunks); + + if (string(reinterpret_cast(bchHeaderMagic.data())) == "NVDA") + { + isSigned = true; + } + else + { + isSigned = false; + } + } + + return true; +} \ No newline at end of file diff --git a/mlxfwops/lib/fs5_ops.h b/mlxfwops/lib/fs5_ops.h index 193231c9..a31d1738 100644 --- a/mlxfwops/lib/fs5_ops.h +++ b/mlxfwops/lib/fs5_ops.h @@ -49,6 +49,10 @@ class Fs5Operations : public Fs4Operations bool verbose = false) override; bool GetImageSize(u_int32_t* image_size) override; bool GetImageInfo(u_int8_t* buff) override; + bool FwExtract4MBImage(vector& img, + bool maskMagicPatternAndDevToc, + bool verbose = false, + bool ignoreImageStart = false) override; protected: bool CheckBoot2(u_int32_t beg, @@ -57,6 +61,7 @@ class Fs5Operations : public Fs4Operations bool fullRead, const char* pref, VerifyCallBack verifyCallBackFunc = (VerifyCallBack)NULL) override; + bool GetDtocAddress(u_int32_t& dTocAddress) override; u_int32_t _ncore_bch_ptr; private: @@ -69,6 +74,9 @@ class Fs5Operations : public Fs4Operations struct QueryOptions queryOptions, bool ignoreDToc = false, bool verbose = false) override; + bool IsSecureFwUpdateSigned(bool& isSigned); + + static const u_int32_t BCH_SIZE_IN_BYTES; }; #endif /* FS5_OPS_H */ diff --git a/mlxfwops/lib/fsctrl_ops.cpp b/mlxfwops/lib/fsctrl_ops.cpp index de889544..bc3fa1ae 100644 --- a/mlxfwops/lib/fsctrl_ops.cpp +++ b/mlxfwops/lib/fsctrl_ops.cpp @@ -316,12 +316,12 @@ bool FsCtrlOperations::FsIntQuery() CRSpaceRegisters cr_space_reg(mf, _fwImgInfo.ext_info.chip_type); _fsCtrlImgInfo.global_image_status = cr_space_reg.getGlobalImageStatus(); } - catch (logic_error e) + catch (logic_error const &e) { printf("%s\n", e.what()); return false; } - catch (exception e) + catch (exception const &e) { printf("%s\n", e.what()); return false; diff --git a/mlxfwops/lib/fw_ops.cpp b/mlxfwops/lib/fw_ops.cpp index ea3ca19e..80227dd5 100644 --- a/mlxfwops/lib/fw_ops.cpp +++ b/mlxfwops/lib/fw_ops.cpp @@ -2542,9 +2542,8 @@ u_int8_t FwOperations::GetFwFormatFromHwDevID(u_int32_t hwDevId) else if (hwDevId == CX5_HW_ID || hwDevId == CX6_HW_ID || hwDevId == CX6DX_HW_ID || hwDevId == CX6LX_HW_ID || hwDevId == CX7_HW_ID || hwDevId == CX8_HW_ID || hwDevId == BF_HW_ID || hwDevId == BF2_HW_ID || hwDevId == BF3_HW_ID || hwDevId == BF4_HW_ID || hwDevId == QUANTUM_HW_ID || hwDevId == QUANTUM2_HW_ID || - hwDevId == QUANTUM3_HW_ID || hwDevId == SPECTRUM4_HW_ID || hwDevId == SPECTRUM2_HW_ID || - hwDevId == SPECTRUM3_HW_ID || hwDevId == GEARBOX_HW_ID || hwDevId == GB_MANAGER_HW_ID || - hwDevId == ABIR_GB_HW_ID || hwDevId == ARCUSE_HW_ID) + hwDevId == SPECTRUM4_HW_ID || hwDevId == SPECTRUM3_HW_ID || hwDevId == SPECTRUM2_HW_ID || + hwDevId == GEARBOX_HW_ID || hwDevId == GB_MANAGER_HW_ID || hwDevId == ABIR_GB_HW_ID) { return FS_FS4_GEN; } @@ -2791,6 +2790,11 @@ bool FwOperations::VerifyBranchFormat(const char* vsdString) return false; } +bool FwOperations::GetDtocAddress(u_int32_t& dTocAddress) +{ + return errmsg("GetDtocAddress not supported."); +} + bool FwOperations::PrintQuery() { return errmsg("PrintQuery not supported."); diff --git a/mlxfwops/lib/fw_ops.h b/mlxfwops/lib/fw_ops.h index d980e1b3..53b82e98 100644 --- a/mlxfwops/lib/fw_ops.h +++ b/mlxfwops/lib/fw_ops.h @@ -670,6 +670,7 @@ class MLXFWOP_API FwOperations : public FlintErrMsg virtual Tlv_Status_t GetTsObj(TimeStampIFC** tsObj); bool TestAndSetTimeStamp(FwOperations* imageOps); virtual bool VerifyBranchFormat(const char* vsdString); + virtual bool GetDtocAddress(u_int32_t& dTocAddress); // Protected Members FBase* _ioAccess; diff --git a/mlxfwops/lib/fw_version.cpp b/mlxfwops/lib/fw_version.cpp index 972dc68a..86ee4200 100644 --- a/mlxfwops/lib/fw_version.cpp +++ b/mlxfwops/lib/fw_version.cpp @@ -266,8 +266,10 @@ std::string ComponentFwVersion::ToString() { case VersionFormat::SubMinor: fwVersion.insert(0, "." + std::to_string(_subMinor)); + /* fall through */ case VersionFormat::Minor: fwVersion.insert(0, "." + std::to_string(_minor)); + /* fall through */ case VersionFormat::Major: fwVersion.insert(0, std::to_string(_major)); break; diff --git a/mlxfwops/lib/mlxfwops_com.h b/mlxfwops/lib/mlxfwops_com.h index 6d2d7d9f..83bb0cdb 100644 --- a/mlxfwops/lib/mlxfwops_com.h +++ b/mlxfwops/lib/mlxfwops_com.h @@ -526,6 +526,7 @@ typedef struct fw_info_com u_int8_t encrypted_fw; u_int32_t burn_image_size; //! Be aware! This field is backward compatible starting from BB/CX-7 //! Use this field only for encrypted images + u_int8_t dtoc_offset; } fw_info_com_t; typedef struct fw_info_ext diff --git a/mlxfwupdate/mlnx_dev.cpp b/mlxfwupdate/mlnx_dev.cpp index e787200b..fb4842ea 100644 --- a/mlxfwupdate/mlnx_dev.cpp +++ b/mlxfwupdate/mlnx_dev.cpp @@ -388,7 +388,7 @@ void MlnxDev::setDeviceType(void) } else if (dm_is_4th_gen(ptr_dm_dev_id)) { - u_int32_t mac; + u_int32_t mac = 0; if ((mread4(mf, 0x1f148, &mac)) == 4) { // port1 portOneType = EXT(mac, 30, 29) != 1 ? PORT_ETH : PORT_IB; diff --git a/mlxlink/modules/mlxlink_amBER_collector.cpp b/mlxlink/modules/mlxlink_amBER_collector.cpp index d2b11a50..b5e451a5 100644 --- a/mlxlink/modules/mlxlink_amBER_collector.cpp +++ b/mlxlink/modules/mlxlink_amBER_collector.cpp @@ -75,13 +75,14 @@ MlxlinkAmBerCollector::MlxlinkAmBerCollector(Json::Value& jsonRoot) : _jsonRoot( _mlxlinkMaps = NULL; _baseSheetsList[AMBER_SHEET_GENERAL] = FIELDS_COUNT{4, 4, 4}; - _baseSheetsList[AMBER_SHEET_INDEXES] = FIELDS_COUNT{2, 2, 4}; - _baseSheetsList[AMBER_SHEET_LINK_STATUS] = FIELDS_COUNT{50, 143, 6}; + _baseSheetsList[AMBER_SHEET_INDEXES] = FIELDS_COUNT{8, 3, 4}; + _baseSheetsList[AMBER_SHEET_LINK_STATUS] = FIELDS_COUNT{88, 97, 6}; _baseSheetsList[AMBER_SHEET_MODULE_STATUS] = FIELDS_COUNT{94, 110, 0}; - _baseSheetsList[AMBER_SHEET_SYSTEM] = FIELDS_COUNT{16, 21, 11}; + _baseSheetsList[AMBER_SHEET_SYSTEM] = FIELDS_COUNT{19, 19, 10}; _baseSheetsList[AMBER_SHEET_SERDES_16NM] = FIELDS_COUNT{376, 736, 0}; _baseSheetsList[AMBER_SHEET_SERDES_7NM] = FIELDS_COUNT{182, 362, 406}; - _baseSheetsList[AMBER_SHEET_PORT_COUNTERS] = FIELDS_COUNT{35, 0, 50}; + _baseSheetsList[AMBER_SHEET_SERDES_5NM] = FIELDS_COUNT{138, 0, 0}; + _baseSheetsList[AMBER_SHEET_PORT_COUNTERS] = FIELDS_COUNT{45, 0, 50}; _baseSheetsList[AMBER_SHEET_TROUBLESHOOTING] = FIELDS_COUNT{2, 2, 0}; _baseSheetsList[AMBER_SHEET_PHY_OPERATION_INFO] = FIELDS_COUNT{17, 17, 15}; _baseSheetsList[AMBER_SHEET_LINK_UP_INFO] = FIELDS_COUNT{9, 9, 0}; @@ -151,25 +152,6 @@ void MlxlinkAmBerCollector::sendLocalPrmReg(const string& regName, maccess_reg_m } } -void MlxlinkAmBerCollector::sendLocalPrmReg(const string& regName, maccess_reg_method_t method) -{ - try - { - if (AmberField::_dataValid) - { - sendPrmReg(regName, method); - } - } - catch (MlxRegException& exc) - { -#ifdef VALIDATE_REG_REQUEST - throw MlxRegException(regName + ": " + exc.what()); -#else - AmberField::_dataValid = false; -#endif - } -} - string MlxlinkAmBerCollector::getLocalFieldStr(const string& fieldName) { string fieldVal = "N/A"; @@ -442,7 +424,8 @@ vector MlxlinkAmBerCollector::getIndexesInfo() { fields.push_back(AmberField("MAC_Address", getMACAddress())); } - + string aggregatedPort = "N/A"; + string planePort = "N/A"; AmberField::_dataValid = true; string labelPortStr = to_string(_labelPort); if ((_splitPort && _splitPort != 1) || (_devID == DeviceQuantum2) || (_devID == DeviceQuantum3) || @@ -463,6 +446,40 @@ vector MlxlinkAmBerCollector::getIndexesInfo() fields.push_back(AmberField("pcie_index", to_string(_pcieIndex), _isPortPCIE)); fields.push_back(AmberField("node", to_string(_node), _isPortPCIE)); + if (_productTechnology == PRODUCT_5NM) + { + resetLocalParser(ACCESS_REG_PPCR); + updateField("local_port", _localPort); + sendRegister(ACCESS_REG_PPCR, MACCESS_REG_METHOD_GET); + aggregatedPort = getRawFieldValueStr("aggregated_port"); + planePort = getRawFieldValueStr("plane"); + } + fields.push_back(AmberField("aggregated_port", aggregatedPort, _isPortIB)); + fields.push_back(AmberField("plane_port", planePort, _isPortIB)); + + if (!_isPortPCIE) + { + resetLocalParser(ACCESS_REG_MGIR); + sendRegister(ACCESS_REG_MGIR, MACCESS_REG_METHOD_GET); + fields.push_back(AmberField("IC_GA", getRawFieldValueStr("hw_info__ga"), _isPortIB)); + + if (dm_dev_is_switch((dm_dev_id_t)_devID)) + { + resetLocalParser(ACCESS_REG_PLLP); + updateField("local_port", _localPort); + sendRegister(ACCESS_REG_PLLP, MACCESS_REG_METHOD_GET); + fields.push_back(AmberField("Label_cage", getRawFieldValueStr("label_port"))); + if (getFieldValue("ipil_stat") == 0) + { + fields.push_back(AmberField("IPIL", getRawFieldValueStr("ipil_num"), _isPortIB)); + } + if (getFieldValue("split_stat") == 0) + { + fields.push_back(AmberField("split", getRawFieldValueStr("split_num"), _isPortIB)); + } + } + } + return fields; } @@ -491,6 +508,7 @@ vector MlxlinkAmBerCollector::getSystemInfo() string sensNameVoltage = "N/A"; string sensNameTemp = "N/A"; string temp = "N/A"; + string numPlanes = "N/A"; fields.push_back(AmberField("Device_Description", _mstDevName.c_str())); @@ -550,6 +568,15 @@ vector MlxlinkAmBerCollector::getSystemInfo() updateField("page_select", PDDR_MODULE_INFO_PAGE); sendRegister(ACCESS_REG_PDDR, MACCESS_REG_METHOD_GET); fields.push_back(AmberField("Module_Temp", getTemp(getFieldValue("temperature")), !_isPortPCIE)); + + if (_productTechnology == PRODUCT_5NM) + { + resetLocalParser(ACCESS_REG_PPCR); + updateField("local_port", _localPort); + sendRegister(ACCESS_REG_PPCR, MACCESS_REG_METHOD_GET); + numPlanes = getRawFieldValueStr("num_of_planes"); + } + fields.push_back(AmberField("num_of_planes", numPlanes, _isPortIB)); } catch (const std::exception& exc) { @@ -813,16 +840,27 @@ vector MlxlinkAmBerCollector::getLinkStatus() u_int32_t numOfBins = 0; bool skipBinLimit = false; + map histRange; try { resetLocalParser(ACCESS_REG_PPHCR); updateField("local_port", _localPort); genBuffSendRegister(ACCESS_REG_PPHCR, MACCESS_REG_METHOD_GET); numOfBins = getFieldValue("num_of_bins"); + for (u_int32_t idx = 0; idx < NUM_OF_BINS; idx++) + { + histRange["high_val_" + to_string(idx)] = getFieldStr("high_val_" + to_string(idx)); + histRange["low_val_" + to_string(idx)] = getFieldStr("low_val_" + to_string(idx)); + } } catch (...) { skipBinLimit = true; + for (u_int32_t idx = 0; idx < NUM_OF_BINS; idx++) + { + histRange["high_val_" + to_string(idx)] = "N/A"; + histRange["low_val_" + to_string(idx)] = "N/A"; + } } // Getting histogram info for ETH and IB only @@ -834,7 +872,6 @@ vector MlxlinkAmBerCollector::getLinkStatus() vector histPerLane; u_int64_t histBin = 0; string val = ""; - int firstZeroHist = -1; for (u_int32_t idx = 0; idx < NUM_OF_BINS; idx++) { val = "N/A"; @@ -843,16 +880,31 @@ vector MlxlinkAmBerCollector::getLinkStatus() histBin = add32BitTo64(getFieldValue("hist[" + to_string(idx) + "]_hi"), getFieldValue("hist[" + to_string(idx) + "]_lo")); val = to_string(histBin); - if (!histBin && firstZeroHist < 0) + } + histPerLane.push_back(val); + } + int firstZeroHist = -1; + for (u_int32_t idx = NUM_OF_BINS - 1; idx > 0; idx--) + { + if (histPerLane[idx] != "N/A") + { + if (histPerLane[idx] != "0") { - firstZeroHist = idx; + firstZeroHist = idx + 1; + break; } } - histPerLane.push_back(val); } fields.push_back(AmberField("FC_Zero_Hist", firstZeroHist >= 0 ? to_string(firstZeroHist) : "N/A")); fields.push_back(AmberField("Number_of_histogram_bins", to_string(numOfBins))); for (u_int32_t idx = 0; idx < NUM_OF_BINS; idx++) + { + fields.push_back( + AmberField("bin" + to_string(idx) + string("_high_value"), histRange["high_val_" + to_string(idx)])); + fields.push_back( + AmberField("bin" + to_string(idx) + string("_low_value"), histRange["low_val_" + to_string(idx)])); + } + for (u_int32_t idx = 0; idx < NUM_OF_BINS; idx++) { fields.push_back(AmberField("hist" + to_string(idx), histPerLane[idx])); } @@ -885,7 +937,10 @@ vector MlxlinkAmBerCollector::getLinkStatus() fields.push_back(AmberField("Effective_Errors", effErrorsStr)); u_int64_t symErrors = add32BitTo64(getFieldValue("phy_symbol_errors_high"), getFieldValue("phy_symbol_errors_low")); - fields.push_back(AmberField("Symbol_Errors", to_string(symErrors))); + if (_isPortIB) + { + fields.push_back(AmberField("Symbol_Errors", to_string(symErrors))); + } } else { @@ -902,6 +957,23 @@ vector MlxlinkAmBerCollector::getLinkStatus() fields.push_back(AmberField("Rx_error_pci", to_string(getFieldValue("rx_errors")))); fields.push_back(AmberField("Tx_error_pci", to_string(getFieldValue("tx_errors")))); } + + if (_productTechnology == PRODUCT_5NM && _isPortIB) + { + resetLocalParser(ACCESS_REG_PAOS); + updateField("local_port", _localPort); + updateField("swid", SWID); + sendRegister(ACCESS_REG_PAOS, MACCESS_REG_METHOD_GET); + fields.push_back(AmberField("logical_state_status", to_string(getFieldValue("logical_state_status")))); + fields.push_back(AmberField("physical_state_status", to_string(getFieldValue("physical_state_status")))); + + resetLocalParser(ACCESS_REG_PPSLS); + updateField("local_port", _localPort); + sendRegister(ACCESS_REG_PPSLS, MACCESS_REG_METHOD_GET); + fields.push_back(AmberField("l1_neg_status", to_string(getFieldValue("l1_neg_status")))); + fields.push_back(AmberField("fw_mode_neg_status", to_string(getFieldValue("fw_mode_neg_status")))); + fields.push_back(AmberField("fw_mode_act", to_string(getFieldValue("fw_mode_act")))); + } } catch (const std::exception& exc) { @@ -1039,6 +1111,61 @@ vector MlxlinkAmBerCollector::getSerdesNDR() return fields; } +vector MlxlinkAmBerCollector::getSerdesXDR() +{ + vector fields; + + try + { + if (!_isPortPCIE) + { + vector> sltpParams(SLTP_XDR_LAST, vector(_maxLanes, "")); + for (u_int32_t lane = 0; lane < _numOfLanes; lane++) + { + resetLocalParser(ACCESS_REG_SLTP); + updateField("local_port", _localPort); + updateField("lane", lane); + updateField("pnat", _pnat); + sendRegister(ACCESS_REG_SLTP, MACCESS_REG_METHOD_GET); + + sltpParams[SLTP_XDR_DRV_AMP][lane] = getFieldStr("drv_amp"); + sltpParams[SLTP_XDR_TAP0][lane] = getFieldStr("tap0"); + sltpParams[SLTP_XDR_TAP1][lane] = getFieldStr("tap1"); + sltpParams[SLTP_XDR_TAP2][lane] = getFieldStr("tap2"); + sltpParams[SLTP_XDR_TAP3][lane] = getFieldStr("tap3"); + sltpParams[SLTP_XDR_TAP4][lane] = getFieldStr("tap4"); + sltpParams[SLTP_XDR_TAP5][lane] = getFieldStr("tap5"); + sltpParams[SLTP_XDR_TAP6][lane] = getFieldStr("tap6"); + sltpParams[SLTP_XDR_TAP7][lane] = getFieldStr("tap7"); + sltpParams[SLTP_XDR_TAP8][lane] = getFieldStr("tap8"); + sltpParams[SLTP_XDR_TAP9][lane] = getFieldStr("tap9"); + sltpParams[SLTP_XDR_TAP10][lane] = getFieldStr("tap10"); + sltpParams[SLTP_XDR_TAP11][lane] = getFieldStr("tap11"); + } + + fillParamsToFields("drv_amp", sltpParams[SLTP_XDR_DRV_AMP], fields); + fillParamsToFields("tap0", sltpParams[SLTP_XDR_TAP0], fields); + fillParamsToFields("tap1", sltpParams[SLTP_XDR_TAP1], fields); + fillParamsToFields("tap2", sltpParams[SLTP_XDR_TAP2], fields); + fillParamsToFields("tap3", sltpParams[SLTP_XDR_TAP3], fields); + fillParamsToFields("tap4", sltpParams[SLTP_XDR_TAP4], fields); + fillParamsToFields("tap5", sltpParams[SLTP_XDR_TAP5], fields); + fillParamsToFields("tap6", sltpParams[SLTP_XDR_TAP6], fields); + fillParamsToFields("tap7", sltpParams[SLTP_XDR_TAP7], fields); + fillParamsToFields("tap8", sltpParams[SLTP_XDR_TAP8], fields); + fillParamsToFields("tap9", sltpParams[SLTP_XDR_TAP9], fields); + fillParamsToFields("tap10", sltpParams[SLTP_XDR_TAP10], fields); + fillParamsToFields("tap11", sltpParams[SLTP_XDR_TAP11], fields); + } + } + catch (const std::exception& exc) + { + throw MlxRegException("Failed to get SerDes[5nm] information: %s", exc.what()); + } + + return fields; +} + void MlxlinkAmBerCollector::initCableIdentifier(u_int32_t cableIdentifier) { switch (cableIdentifier) @@ -1611,6 +1738,46 @@ vector MlxlinkAmBerCollector::getPortCounters() fields.push_back(AmberField( "PortRcvPktsExtended", to_string(add32BitTo64(getFieldValue("port_rcv_pkts_high"), getFieldValue("port_rcv_pkts_low"))))); + fields.push_back(AmberField("PortUniCastXmitPkts", + to_string(add32BitTo64(getFieldValue("port_unicast_xmit_pkts_high"), + getFieldValue("port_unicast_xmit_pkts_low"))))); + fields.push_back(AmberField("PortUniCastRcvPkts", + to_string(add32BitTo64(getFieldValue("port_unicast_rcv_pkts_high"), + getFieldValue("port_unicast_rcv_pkts_low"))))); + fields.push_back(AmberField("PortMultiCastXmitPkts", + to_string(add32BitTo64(getFieldValue("port_multicast_xmit_pkts_high"), + getFieldValue("port_multicast_xmit_pkts_low"))))); + fields.push_back(AmberField("PortMultiCastRcvPkts", + to_string(add32BitTo64(getFieldValue("port_multicast_rcv_pkts_high"), + getFieldValue("port_multicast_rcv_pkts_low"))))); + fields.push_back(AmberField("SyncHeaderErrorCounter", + to_string(add32BitTo64(getFieldValue("sync_header_error_counter_high"), + getFieldValue("sync_header_error_counter_low"))))); + + fields.push_back(AmberField("PortLocalPhysicalErrors", + to_string(add32BitTo64(getFieldValue("port_local_physical_errors_high"), + getFieldValue("port_local_physical_errors_low"))))); + fields.push_back(AmberField("PortMalformedPacketErrors", + to_string(add32BitTo64(getFieldValue("port_malformed_packet_errors_high"), + getFieldValue("port_malformed_packet_errors_low"))))); + fields.push_back(AmberField("PortBufferOverrunErrors", + to_string(add32BitTo64(getFieldValue("port_buffer_overrun_errors_high"), + getFieldValue("port_buffer_overrun_errors_low"))))); + fields.push_back(AmberField("PortDLIDMappingErrors", + to_string(add32BitTo64(getFieldValue("port_dlid_mapping_errors_high"), + getFieldValue("port_dlid_mapping_errors_low"))))); + fields.push_back(AmberField("PortVLMappingErrors", + to_string(add32BitTo64(getFieldValue("port_vl_mapping_errors_high"), + getFieldValue("port_vl_mapping_errors_low"))))); + fields.push_back(AmberField("PortLoopingErrors", + to_string(add32BitTo64(getFieldValue("port_looping_errors_high"), + getFieldValue("port_looping_errors_low"))))); + fields.push_back(AmberField("PortInactiveDiscards", + to_string(add32BitTo64(getFieldValue("port_inactive_discards_high"), + getFieldValue("port_inactive_discards_low"))))); + fields.push_back(AmberField("PortNeighborMTUDiscards", + to_string(add32BitTo64(getFieldValue("port_neighbor_mtu_discards_high"), + getFieldValue("port_neighbor_mtu_discards_low"))))); // Getting engress counters resetLocalParser(ACCESS_REG_PPCNT); @@ -1658,6 +1825,21 @@ vector MlxlinkAmBerCollector::getPortCounters() "PlrXmitRetryEventsWithinTSecMax", to_string(add32BitTo64(getLocalFieldValue("plr_xmit_retry_events_within_t_sec_max_high"), getLocalFieldValue("plr_xmit_retry_events_within_t_sec_max_low"))))); + + fields.push_back(AmberField("PlrBWLoss_Percent", + to_string(add32BitTo64(getLocalFieldValue("plr_codes_loss_high"), + getLocalFieldValue("plr_codes_loss_low")) / + 1e8))); + + resetLocalParser(ACCESS_REG_PPCNT); + updateField("local_port", _localPort); + updateField("grp", PPCNT_IB_GEN_COUNTERS_GROUP); + updateField("lp_gl", (u_int32_t)(_localPort == 255)); + sendRegister(ACCESS_REG_PPCNT, MACCESS_REG_METHOD_GET); + + fields.push_back(AmberField("rq_general_error", + to_string(add32BitTo64(getLocalFieldValue("rq_general_error_high"), + getLocalFieldValue("rq_general_error_low"))))); } } else @@ -2054,6 +2236,10 @@ vector MlxlinkAmBerCollector::collectSheet(AMBER_SHEET sheet) groupValidIf(_productTechnology == PRODUCT_7NM); fields = getSerdesNDR(); break; + case AMBER_SHEET_SERDES_5NM: + groupValidIf(_productTechnology == PRODUCT_5NM); + fields = getSerdesXDR(); + break; case AMBER_SHEET_PORT_COUNTERS: if (!_inPRBSMode) { diff --git a/mlxlink/modules/mlxlink_amBER_collector.h b/mlxlink/modules/mlxlink_amBER_collector.h index e6f6b8cb..66e67dc7 100644 --- a/mlxlink/modules/mlxlink_amBER_collector.h +++ b/mlxlink/modules/mlxlink_amBER_collector.h @@ -62,6 +62,7 @@ class MlxlinkAmBerCollector : public MlxlinkRegParser virtual vector getLinkStatus(); virtual vector getSerdesHDR(); virtual vector getSerdesNDR(); + virtual vector getSerdesXDR(); virtual vector getModuleStatus(); virtual vector getPortCounters(); virtual vector getTroubleshootingInfo(); @@ -151,7 +152,6 @@ class MlxlinkAmBerCollector : public MlxlinkRegParser u_int32_t getLocalFieldValue(const string& fieldName); void sendRegister(const string& regName, maccess_reg_method_t method); void sendLocalPrmReg(const string& regName, maccess_reg_method_t method, const char* fields, ...); - void sendLocalPrmReg(const string& regName, maccess_reg_method_t method); string getBitmaskPerLaneStr(u_int32_t bitmask); void fillParamsToFields(const string& title, const vector& values, vector& fields); diff --git a/mlxlink/modules/mlxlink_commander.cpp b/mlxlink/modules/mlxlink_commander.cpp index 1f7a589e..308801ea 100644 --- a/mlxlink/modules/mlxlink_commander.cpp +++ b/mlxlink/modules/mlxlink_commander.cpp @@ -39,7 +39,6 @@ using namespace mlxreg; MlxlinkCommander::MlxlinkCommander() : _userInput() { - _device = ""; _extAdbFile = ""; _localPort = 0; _portType = 0; @@ -47,7 +46,7 @@ MlxlinkCommander::MlxlinkCommander() : _userInput() _numOfLanesPcie = 0; _linkUP = false; _plugged = false; - _linkModeForce = false; + _userInput._linkModeForce = false; _prbsTestMode = false; _useExtAdb = true; _portPolling = false; @@ -63,8 +62,6 @@ MlxlinkCommander::MlxlinkCommander() : _userInput() _cableMediaType = 0; _moduleNumber = 0; _slotIndex = 0; - _uniqueCmds = 0; - _networkCmds = 0; _activeSpeed = 0; _activeSpeedEx = 0; _protoCapability = 0; @@ -93,8 +90,6 @@ MlxlinkCommander::MlxlinkCommander() : _userInput() _errInjector = NULL; _portInfo = NULL; _amberCollector = NULL; - _uniqueCableCmds = 0; - _uniquePcieCmds = 0; _groupOpcode = MONITOR_OPCODE; } @@ -258,29 +253,21 @@ u_int32_t MlxlinkCommander::getTechnologyFromMGIR() void MlxlinkCommander::getProductTechnology() { - _productTechnology = getTechnologyFromMGIR(); - - if (_productTechnology) + // Use SLRG to get the product technology, for backward compatibility + try { + sendPrmReg(ACCESS_REG_SLTP, GET); + _productTechnology = getVersion(getFieldValue("version")); if (_productTechnology <= 2) { _productTechnology = PRODUCT_28NM; } } - else + catch (MlxRegException& exc) { - // Use SLRG to get the product technology, for backward compatibility - try + if (!_productTechnology) { - sendPrmReg(ACCESS_REG_SLRG, GET); - _productTechnology = getVersion(getFieldValue("version")); - } - catch (MlxRegException& exc) - { - if (!_productTechnology) - { - throw MlxRegException("Unable to get product technology: %s", exc.what_s().c_str()); - } + throw MlxRegException("Unable to get product technology: %s", exc.what_s().c_str()); } } } @@ -718,49 +705,76 @@ void MlxlinkCommander::labelToSpectLocalPort() void MlxlinkCommander::labelToQtm3LocalPort() { - u_int32_t cage_in = _userInput._labelPort; - u_int32_t ipil_in = _userInput._splitProvided ? _userInput._splitPort : 1; - u_int32_t split_in = _userInput._secondSplitProvided ? _userInput._secondSplitPort : 1; - u_int32_t founded_local_port = 0; + u_int32_t foundedLocalPort = 0; - u_int32_t split_stat = 0; - u_int32_t ipil_stat = 0; - for (u_int32_t localPort = 1; localPort <= maxLocalPort(); localPort++) + if (_devID == DeviceBW00) { - try + if (_userInput._splitProvided || _userInput._secondSplitProvided) { - sendPrmReg(ACCESS_REG_PLLP, GET, "local_port=%d", localPort); + throw MlxRegException("Invalid port number!"); } - catch (MlxRegException& exp) + for (u_int32_t localPort = 1; localPort <= maxLocalPort(); localPort++) { - continue; + try + { + sendPrmReg(ACCESS_REG_PLIB, GET, "local_port=%d", localPort); + } + catch (MlxRegException& exp) + { + continue; + } + if (getFieldValue("ib_port") == _userInput._labelPort) + { + foundedLocalPort = localPort; + break; + } } + } + else + { + u_int32_t cageIn = _userInput._labelPort; + u_int32_t ipilIn = _userInput._splitProvided ? _userInput._splitPort : 1; + u_int32_t splitIn = _userInput._secondSplitProvided ? _userInput._secondSplitPort : 1; - ipil_stat = getFieldValue("ipil_stat"); - split_stat = getFieldValue("split_stat"); - if (ipil_in > (u_int32_t)(1 << ipil_stat)) + u_int32_t splitStat = 0; + u_int32_t ipilStat = 0; + for (u_int32_t localPort = 1; localPort <= maxLocalPort(); localPort++) { - throw MlxRegException("Invalid inter-port number!"); - } + try + { + sendPrmReg(ACCESS_REG_PLLP, GET, "local_port=%d", localPort); + } + catch (MlxRegException& exp) + { + continue; + } - if (split_in > (u_int32_t)(1 << split_stat)) - { - throw MlxRegException("Invalid split number!"); - } + ipilStat = getFieldValue("ipil_stat"); + splitStat = getFieldValue("split_stat"); + if (ipilIn > (u_int32_t)(1 << ipilStat)) + { + throw MlxRegException("Invalid inter-port number!"); + } - if (cage_in == getFieldValue("label_port") && (ipil_stat == 0 || ipil_in == getFieldValue("ipil_num")) && - (split_stat == 0 || split_in == getFieldValue("split_num") - 1)) - { - founded_local_port = localPort; - break; + if (splitIn > (u_int32_t)(1 << splitStat)) + { + throw MlxRegException("Invalid split number!"); + } + + if (cageIn == getFieldValue("label_port") && (ipilStat == 0 || ipilIn == getFieldValue("ipil_num")) && + (splitStat == 0 || splitIn == getFieldValue("split_num") - 1)) + { + foundedLocalPort = localPort; + break; + } } } - if (!founded_local_port) + if (!foundedLocalPort) { throw MlxRegException("Invalid port number!"); } - _localPort = founded_local_port; + _localPort = foundedLocalPort; } void MlxlinkCommander::labelToIBLocalPort() @@ -878,14 +892,6 @@ u_int32_t MlxlinkCommander::calculatePanelPort(bool ibSplitReady) return panelPort; } -void MlxlinkCommander::checkStrLength(const string& str) -{ - if (str.size() > MAX_INPUT_LENGTH) - { - throw MlxRegException("Argument: %s... is invalid.", str.substr(0, MAX_INPUT_LENGTH).c_str()); - } -} - void MlxlinkCommander::getActualNumOfLanes(u_int32_t linkSpeedActive, bool extended) { if (_protoActive == IB) @@ -1016,42 +1022,6 @@ bool MlxlinkCommander::checkPpaosTestMode() return false; } -void MlxlinkCommander::getSltpParamsFromVector(std::vector sltpParams) -{ - for (u_int32_t i = 0; i < sltpParams.size(); i++) - { - strToInt32((char*)sltpParams[i].c_str(), _userInput._sltpParams[i]); - } -} - -std::vector MlxlinkCommander::parseParamsFromLine(const string& ParamsLine) -{ - std::vector paramVector; - string param; - stringstream stream(ParamsLine); - while (getline(stream, param, ',')) - { - if (param == "") - { - throw MlxRegException("Wrong input format"); - } - paramVector.push_back(param.c_str()); - } - return paramVector; -} - -void MlxlinkCommander::getprbsLanesFromParams(std::vector prbsLanesParams) -{ - u_int32_t lane = 0; - vector::iterator it = prbsLanesParams.begin(); - while (it != prbsLanesParams.end()) - { - strToUint32((char*)(*it).c_str(), lane); - _userInput._prbsLanesToSet[lane] = true; - it++; - } -} - bool MlxlinkCommander::handleIBLocalPort(u_int32_t labelPort, bool ibSplitReady) { bool isLabelPortValid = false; @@ -1700,7 +1670,7 @@ void MlxlinkCommander::preparePrtlSection() { if (_userInput._advancedMode) { - char rttFrmt[64]; + char rttFrmt[64] = ""; bool isRttSupported = false; u_int16_t asicLatency = 0; u_int16_t moduleLatency = 0; @@ -1840,18 +1810,20 @@ void MlxlinkCommander::prepareSltpEdrHdrGen(vector>& sltpLanes, u void MlxlinkCommander::prepareSltpNdrGen(std::vector>& sltpLanes, u_int32_t laneNumber) { - if (isSpeed100GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive)) + u_int32_t activeSpeed = _protoActive == IB ? _activeSpeed : _activeSpeedEx; + for (auto const& param : _mlxlinkMaps->_SltpNdrParams) { - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_PRE3])); - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_PRE2])); - } - else if (isSpeed50GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive)) - { - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_PRE2])); + if (param.second.validationMask & activeSpeed) + { + sltpLanes[laneNumber].push_back(getSltpFieldStr(param.second)); + } } - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_PRE1])); - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_MAIN])); - sltpLanes[laneNumber].push_back(getSltpFieldStr(_mlxlinkMaps->_SltpNdrParams[SLTP_NDR_FIR_POST1])); +} + +void MlxlinkCommander::prepareSltpXdrGen(std::vector>& sltpLanes, u_int32_t laneNumber) +{ + (void)sltpLanes; + (void)laneNumber; } template @@ -1869,16 +1841,6 @@ string MlxlinkCommander::getValueAndThresholdsStr(T value, Q lowTH, Q highTH) return out.str(); } -void MlxlinkCommander::strToInt32(char* str, u_int32_t& value) -{ - char* endp; - value = strtol(str, &endp, 0); - if (*endp) - { - throw MlxRegException("Argument: %s is invalid.", str); - } -} - void MlxlinkCommander::runningVersion() { setPrintTitle(_toolInfoCmd, "Tool Information", TOOL_INFORMAITON_INFO_LAST, !_prbsTestMode); @@ -1938,9 +1900,14 @@ void MlxlinkCommander::operatingInfoPage() getAnDisableColor(_anDisable), true, !_prbsTestMode); // Checking cable DDM capability - sendPrmReg(ACCESS_REG_PDDR, GET, "page_select=%d", PDDR_MODULE_INFO_PAGE); + if (_userInput._networkCmds != 0 || _userInput._ddm || _userInput._dump || _userInput._write || + _userInput._read || _userInput.isModuleConfigParamsProvided || _userInput.isPrbsSelProvided || + _userInput._csvBer != "") + { + sendPrmReg(ACCESS_REG_PDDR, GET, "page_select=%d", PDDR_MODULE_INFO_PAGE); - _ddmSupported = getFieldValue("temperature") && _numOfLanes; + _ddmSupported = getFieldValue("temperature") && _numOfLanes; + } } catch (const std::exception& exc) { @@ -2493,6 +2460,7 @@ void MlxlinkCommander::showEye() { checkPCIeValidity(); } + try { if (_userInput._pcie) @@ -2516,7 +2484,7 @@ void MlxlinkCommander::showEye() { prepare40_28_16nmEyeInfo(numOfLanesToUse); } - else if (_productTechnology >= PRODUCT_7NM) + else if (_productTechnology == PRODUCT_7NM || _productTechnology == PRODUCT_5NM) { prepare7nmEyeInfo(numOfLanesToUse); } @@ -2659,38 +2627,26 @@ string MlxlinkCommander::getSltpHeader() { string sep = ","; vector sltpHeader; - map sltpParam = _mlxlinkMaps->_SltpNdrParams; + map sltpParam; + u_int32_t activeSpeed = _protoActive == IB ? _activeSpeed : _activeSpeedEx; - if (_productTechnology >= PRODUCT_7NM) - { - bool is100gPerLane = isSpeed100GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive); - bool is50gPerLane = isSpeed50GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive); - if (is100gPerLane) - { - sltpHeader.push_back(MlxlinkRecord::addSpace(sltpParam[SLTP_NDR_FIR_PRE3].uiField, - sltpParam[SLTP_NDR_FIR_PRE3].uiField.size() + 1, false)); - } - if (is50gPerLane || is100gPerLane) - { - sltpHeader.push_back(MlxlinkRecord::addSpace(sltpParam[SLTP_NDR_FIR_PRE2].uiField, - sltpParam[SLTP_NDR_FIR_PRE2].uiField.size() + 1, false)); - } - sltpHeader.push_back(MlxlinkRecord::addSpace(sltpParam[SLTP_NDR_FIR_PRE1].uiField, - sltpParam[SLTP_NDR_FIR_PRE1].uiField.size() + 1, false)); - sltpHeader.push_back(MlxlinkRecord::addSpace(sltpParam[SLTP_NDR_FIR_MAIN].uiField, - sltpParam[SLTP_NDR_FIR_MAIN].uiField.size() + 1, false)); - sltpHeader.push_back(MlxlinkRecord::addSpace(sltpParam[SLTP_NDR_FIR_POST1].uiField, - sltpParam[SLTP_NDR_FIR_POST1].uiField.size() + 1, false)); - } - else + switch (_productTechnology) { - sltpParam = _mlxlinkMaps->_SltpEdrParams; - if (_productTechnology == PRODUCT_16NM) - { + case PRODUCT_7NM: + sltpParam = _mlxlinkMaps->_SltpNdrParams; + break; + case PRODUCT_16NM: sltpParam = _mlxlinkMaps->_SltpHdrParams; - } + break; + default: + sltpParam = _mlxlinkMaps->_SltpEdrParams; + activeSpeed = _protoActive; + break; + } - for (auto const& param : sltpParam) + for (auto const& param : sltpParam) + { + if (param.second.validationMask & activeSpeed) { if ((param.second.fieldAccess & FIELD_ACCESS_R) || (_userInput._advancedMode && (param.second.fieldAccess & FIELD_ACCESS_ADVANCED))) @@ -2736,13 +2692,16 @@ void MlxlinkCommander::showSltp() { sendPrmReg(ACCESS_REG_SLTP, GET, "lane=%d,c_db=%d", lane, _userInput._db); - if (_productTechnology >= PRODUCT_7NM) + switch (_productTechnology) { - prepareSltpNdrGen(sltpLanes, lane); - } - else - { - prepareSltpEdrHdrGen(sltpLanes, lane); + case PRODUCT_5NM: + prepareSltpXdrGen(sltpLanes, lane); + break; + case PRODUCT_7NM: + prepareSltpNdrGen(sltpLanes, lane); + break; + default: + prepareSltpEdrHdrGen(sltpLanes, lane); } if (!getFieldValue("status")) @@ -3617,7 +3576,8 @@ void MlxlinkCommander::sendPaosDown(bool toggleCommand) string message = "port is not Down, for some reasons:\n"; message += "1- The link is configured to be up, run this command if KEEP_" + protocol + "_LINK_UP_Px is True:\n"; - message += " mlxconfig -d " + _device + " set KEEP_" + protocol + "_LINK_UP_P=0\n"; + message += + " mlxconfig -d " + _userInput._device + " set KEEP_" + protocol + "_LINK_UP_P=0\n"; message += "2- Port management is enabled (management protocol requiring the link to remain up, PAOS " "won't manage to disable the port)\n"; message += "3- In case of multi-host please verify all hosts are not holding the port up"; @@ -3853,41 +3813,35 @@ void MlxlinkCommander::prbsConfiguration(const string& prbsReg, bool perLaneConfig, bool prbsPolInv) { - string rateToUpdate = prbsReg == "PPRT" ? "lane_rate_oper" : "lane_rate_admin"; - string prbsExtraCmd = ""; - if (perLaneConfig) - { - for (const auto& lane : _userInput._prbsLanesToSet) - { - prbsExtraCmd = ""; - if (prbsPolInv) - { - prbsExtraCmd += ",p=1"; - } + const string rateToUpdate = (prbsReg == "PPRT") ? "lane_rate_oper" : "lane_rate_admin"; - if (laneRate == PRBS_HDR) - { - prbsExtraCmd += ",modulation=" + to_string(PRBS_PAM4_ENCODING); - } - - sendPrmReg(prbsReg, SET, "e=%d,%s=%d,prbs_mode_admin=%d,le=%d,lane=%d%s", enable, rateToUpdate.c_str(), - laneRate, prbsMode, perLaneConfig, lane.first, prbsExtraCmd.c_str()); - } - } - else + auto buildPrbsRegArgs = [&]() -> string { - prbsExtraCmd = ""; + stringstream cmd; if (prbsPolInv) { - prbsExtraCmd += ",p=1"; + cmd << ",p=1"; } - if (laneRate == PRBS_HDR) + if (laneRate >= PRBS_HDR && laneRate <= PRBS_XDR) { - prbsExtraCmd += ",modulation=" + to_string(PRBS_PAM4_ENCODING); + cmd << ",modulation=" << PRBS_PAM4_ENCODING; } + cmd << ",e=" << enable << "," << rateToUpdate << "=" << laneRate << ",prbs_mode_admin=" << prbsMode; + return cmd.str(); + }; - sendPrmReg(prbsReg, SET, "e=%d,%s=%d,prbs_mode_admin=%d%s", enable, rateToUpdate.c_str(), laneRate, prbsMode, - prbsExtraCmd.c_str()); + if (perLaneConfig) + { + for (const auto& lane : _userInput._prbsLanesToSet) + { + const string prbsRegArgs = buildPrbsRegArgs(); + sendPrmReg(prbsReg, SET, "le=%d,lane=%d%s", perLaneConfig, lane.first, prbsRegArgs.c_str()); + } + } + else + { + const string prbsRegArgs = buildPrbsRegArgs(); + sendPrmReg(prbsReg, SET, prbsRegArgs.c_str()); } } @@ -3924,7 +3878,7 @@ void MlxlinkCommander::resetPprtPptt() void MlxlinkCommander::validateSpeedStr() { // Normalize IB speeds (Ignore IB- from infiniband speeds) - for (vector::iterator it = _ptysSpeeds.begin(); it != _ptysSpeeds.end(); it++) + for (vector::iterator it = _userInput._ptysSpeeds.begin(); it != _userInput._ptysSpeeds.end(); it++) { size_t found = (*it).find("IB-"); if (found != std::string::npos) @@ -3944,7 +3898,7 @@ void MlxlinkCommander::validateSpeedStr() string speedToCheck = ""; size_t fromIndex = 0; size_t toIndex = 0; - for (vector::iterator it = _ptysSpeeds.begin(); it != _ptysSpeeds.end(); it++) + for (vector::iterator it = _userInput._ptysSpeeds.begin(); it != _userInput._ptysSpeeds.end(); it++) { fromIndex = validSpeedStr.find(*it); toIndex = validSpeedStr.find_first_of(',', fromIndex); @@ -3958,7 +3912,7 @@ void MlxlinkCommander::validateSpeedStr() } } - if (isIn(string("56G"), _ptysSpeeds) && _linkModeForce == true) + if (isIn(string("56G"), _userInput._ptysSpeeds) && _userInput._linkModeForce == true) { throw MlxRegException("No support of 56G FORCE mode"); } @@ -3980,11 +3934,11 @@ void MlxlinkCommander::sendPtys() u_int32_t ptysMask = 0x0; string ptysExtraCmd = ""; string protoAdminField = ""; - for (u_int32_t i = 0; i < _ptysSpeeds.size(); i++) + for (u_int32_t i = 0; i < _userInput._ptysSpeeds.size(); i++) { - ptysMask |= ptysSpeedToMask(_ptysSpeeds[i]); + ptysMask |= ptysSpeedToMask(_userInput._ptysSpeeds[i]); } - if (_linkModeForce == true) + if (_userInput._linkModeForce == true) { gearboxBlock(PTYS_LINK_MODE_FORCE_FLAG); @@ -3992,7 +3946,7 @@ void MlxlinkCommander::sendPtys() } if (_protoActive == IB) { - if (_linkModeForce == false) + if (_userInput._linkModeForce == false) { ptysMask |= 0x1; } @@ -4439,34 +4393,37 @@ string MlxlinkCommander::updateSltpEdrHdrFields() string MlxlinkCommander::updateSltpNdrFields() { - u_int32_t indexCorrection = 0; - char ndrParamBuff[64] = ""; - char hdrParamBuff[32] = ""; - char paramBuff[128] = ""; string sltpParamsCmd = ""; + u_int32_t activeSpeed = _protoActive == IB ? _activeSpeed : _activeSpeedEx; + u_int32_t paramShift = 2; // Assuming that the active speed is NRZ, so user params will represent NRZ params + char paramValueBuff[32] = ""; - if ((!_activeSpeed && _devID == DeviceSpectrum4) || - isSpeed100GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive)) + if (isSpeed100GPerLane(activeSpeed, _protoActive)) { - snprintf(ndrParamBuff, 64, ",fir_pre3=%d,fir_pre2=%d", _userInput._sltpParams[SLTP_NDR_FIR_PRE3], - _userInput._sltpParams[SLTP_NDR_FIR_PRE2]); + paramShift = 0; } - else if (isSpeed50GPerLane(_protoActive == IB ? _activeSpeed : _activeSpeedEx, _protoActive)) + else if (isSpeed50GPerLane(activeSpeed, _protoActive)) { - indexCorrection = 1; - snprintf(hdrParamBuff, 32, ",fir_pre2=%d", _userInput._sltpParams[SLTP_NDR_FIR_PRE2 - indexCorrection]); + paramShift = 1; } - else + + for (auto const& param : _mlxlinkMaps->_SltpNdrParams) { - indexCorrection = 2; + if (param.second.validationMask & activeSpeed) + { + snprintf(paramValueBuff, sizeof(paramValueBuff), "%s=%d", param.second.prmField.c_str(), + _userInput._sltpParams[param.first - paramShift]); + sltpParamsCmd += string(paramValueBuff); + sltpParamsCmd += ","; + } } - snprintf(paramBuff, 128, "fir_pre1=%d,fir_main=%d,fir_post1=%d", - _userInput._sltpParams[SLTP_NDR_FIR_PRE1 - indexCorrection], - _userInput._sltpParams[SLTP_NDR_FIR_MAIN - indexCorrection], - _userInput._sltpParams[SLTP_NDR_FIR_POST1 - indexCorrection]); + return deleteLastChar(sltpParamsCmd); +} - return string(paramBuff) + string(hdrParamBuff) + string(ndrParamBuff); +string MlxlinkCommander::updateSltpXdrFields() +{ + return ""; } string MlxlinkCommander::getSltpStatus() @@ -4539,22 +4496,28 @@ void MlxlinkCommander::sendSltp() } laneSpeed = getLaneSpeed(lane); - if (_productTechnology < PRODUCT_16NM && !_userInput._advancedMode) - { - getSltpRegAndLeva(lane); - } - else if (_productTechnology == PRODUCT_16NM) - { - getSltpAlevOut(lane); - } - if (_productTechnology >= PRODUCT_7NM) + switch (_productTechnology) { - sltpParamsCmd = updateSltpNdrFields(); - } - else - { - sltpParamsCmd = updateSltpEdrHdrFields(); + case PRODUCT_5NM: + sltpParamsCmd = updateSltpXdrFields(); + break; + case PRODUCT_7NM: + sltpParamsCmd = updateSltpNdrFields(); + break; + case PRODUCT_16NM: + getSltpAlevOut(lane); + sltpParamsCmd = updateSltpEdrHdrFields(); + break; + default: + { + if (!_userInput._advancedMode) + { + getSltpRegAndLeva(lane); + } + sltpParamsCmd = updateSltpEdrHdrFields(); + } + break; } sendPrmReg(ACCESS_REG_SLTP, SET, "lane=%d,lane_speed=%d,tx_policy=%d,c_db=%d,%s", lane, laneSpeed, @@ -5196,7 +5159,7 @@ void MlxlinkCommander::setAmBerCollectorFields() _amberCollector->_isHca = _isHCA; _amberCollector->_devID = _devID; _amberCollector->_productTechnology = _productTechnology; - _amberCollector->_mstDevName = _device; + _amberCollector->_mstDevName = _userInput._device; } void MlxlinkCommander::initAmBerCollector() diff --git a/mlxlink/modules/mlxlink_commander.h b/mlxlink/modules/mlxlink_commander.h index d702f8e7..92acfabe 100644 --- a/mlxlink/modules/mlxlink_commander.h +++ b/mlxlink/modules/mlxlink_commander.h @@ -378,9 +378,6 @@ class MlxlinkCommander : public MlxlinkRegParser bool checkGBPpaosDown(); bool checkPaosDown(); bool checkPpaosTestMode(); - void getSltpParamsFromVector(std::vector sltpParams); - void getprbsLanesFromParams(std::vector prbsLanesParams); - std::vector parseParamsFromLine(const string& ParamsLine); bool isSpect2WithGb(); bool isIbLocalPortValid(u_int32_t localPort); void fillIbPortGroupMap(u_int32_t localPort, u_int32_t labelPort, u_int32_t group, bool splitReady); @@ -430,12 +427,12 @@ class MlxlinkCommander : public MlxlinkRegParser void preparePowerAndCdrSection(bool valid); void prepareDDMSection(bool valid, bool isModuleExtSupported); virtual void preparePrtlSection(); - void strToInt32(char* str, u_int32_t& value); template string getValueAndThresholdsStr(T value, Q lowTH, Q highTH); string getSltpFieldStr(const PRM_FIELD& field); void prepareSltpEdrHdrGen(vector>& sltpLanes, u_int32_t laneNumber); virtual void prepareSltpNdrGen(vector>& sltpLanes, u_int32_t laneNumber); + virtual void prepareSltpXdrGen(vector>& sltpLanes, u_int32_t laneNumber); virtual string getSltpHeader(); void startSlrgPciScan(u_int32_t numOfLanesToUse); void initValidDPNList(); @@ -519,10 +516,10 @@ class MlxlinkCommander : public MlxlinkRegParser // Mlxlink config functions void clearCounters(); void sendPaos(); - void handlePrbs(); + virtual void handlePrbs(); void sendPtys(); virtual void sendPplm(); - void sendSltp(); + virtual void sendSltp(); void sendPplr(); void sendPepc(); void setTxGroupMapping(); @@ -561,6 +558,7 @@ class MlxlinkCommander : public MlxlinkRegParser void checkPplmCap(); string updateSltpEdrHdrFields(); string updateSltpNdrFields(); + virtual string updateSltpXdrFields(); string getSltpStatus(); void getSltpAlevOut(u_int32_t lane); void getSltpRegAndLeva(u_int32_t lane); @@ -578,10 +576,6 @@ class MlxlinkCommander : public MlxlinkRegParser u_int32_t _cableMediaType; u_int32_t _fecActive; u_int32_t _protoActive; - u_int32_t _uniqueCmds; - u_int32_t _uniqueCableCmds; - u_int32_t _uniquePcieCmds; - u_int32_t _networkCmds; u_int32_t _anDisable; u_int32_t _speedBerCsv; u_int32_t _cableIdentifier; @@ -600,7 +594,6 @@ class MlxlinkCommander : public MlxlinkRegParser u_int32_t _linkSpeed; u_int32_t _groupOpcode; string _extAdbFile; - string _device; string _fwVersion; string _speedStrG; string _speedForce; @@ -623,7 +616,6 @@ class MlxlinkCommander : public MlxlinkRegParser bool _ignorePortStatus; bool _isGboxPort; bool _ignoreIbFECCheck; - std::vector _ptysSpeeds; std::vector _localPortsPerGroup; std::vector _validDpns; string _allUnhandledErrors; diff --git a/mlxlink/modules/mlxlink_enums.h b/mlxlink/modules/mlxlink_enums.h index 929c7926..12a925b0 100644 --- a/mlxlink/modules/mlxlink_enums.h +++ b/mlxlink/modules/mlxlink_enums.h @@ -34,7 +34,7 @@ #define MLXLINK_ENUMS_H // Common definitions -#define AMBER_VERSION "2.17" +#define AMBER_VERSION "2.8" #define ACCESS_REG_MCIA "MCIA" #define ACCESS_REG_MDDQ "MDDQ" @@ -68,10 +68,13 @@ #define ACCESS_REG_PPAOS "PPAOS" #define ACCESS_REG_PPBMC "PPBMC" #define ACCESS_REG_PPCNT "PPCNT" +#define ACCESS_REG_PPCR "PPCR" #define ACCESS_REG_PPHCR "PPHCR" +#define ACCESS_REG_PPLL "PPLL" #define ACCESS_REG_PPLM "PPLM" #define ACCESS_REG_PPLR "PPLR" #define ACCESS_REG_PPRT "PPRT" +#define ACCESS_REG_PPSLS "PPSLS" #define ACCESS_REG_PPTT "PPTT" #define ACCESS_REG_PREI "PREI" #define ACCESS_REG_PRTL "PRTL" @@ -598,6 +601,7 @@ enum PPCNT_GROUPS PPCNT_PLR_GROUP = 0x22, PPCNT_HISTOGRAM_GROUP = 0x23, PPCNT_IB_PKTS_GROUP = 0x25, + PPCNT_IB_GEN_COUNTERS_GROUP = 0x26, PPCNT_ALL_GROUPS = 63, }; @@ -804,6 +808,24 @@ enum SLTP_NDR SLTP_NDR_LAST }; +enum SLTP_XDR +{ + SLTP_XDR_DRV_AMP, + SLTP_XDR_TAP0, + SLTP_XDR_TAP1, + SLTP_XDR_TAP2, + SLTP_XDR_TAP3, + SLTP_XDR_TAP4, + SLTP_XDR_TAP5, + SLTP_XDR_TAP6, + SLTP_XDR_TAP7, + SLTP_XDR_TAP8, + SLTP_XDR_TAP9, + SLTP_XDR_TAP10, + SLTP_XDR_TAP11, + SLTP_XDR_LAST +}; + enum FEC_MODE { NO_FEC = 1, @@ -1036,10 +1058,15 @@ enum EXT_ETHERNET_COMPLIANCE_CODE EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_DR = 0X25, EXT_ETHERNET_COMPLIABCE_CODE_100G_FR = 0X26, EXT_ETHERNET_COMPLIABCE_CODE_100G_LR = 0X27, + EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_SR4 = 0X29, + EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_FR1 = 0X2A, + EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_LR1 = 0X2B, EXT_ETHERNET_COMPLIABCE_CODE_ACC_10_6 = 0X30, EXT_ETHERNET_COMPLIABCE_CODE_AOC_10_6 = 0X31, EXT_ETHERNET_COMPLIABCE_CODE_ACC_10_4 = 0X32, EXT_ETHERNET_COMPLIABCE_CODE_AOC_10_4 = 0X33, + EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_VR4 = 0X36, + EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_CR4 = 0X3f, EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_CR = 0X40, EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_SR = 0X41, EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_FR = 0X42, @@ -1047,6 +1074,7 @@ enum EXT_ETHERNET_COMPLIANCE_CODE EXT_ETHERNET_COMPLIABCE_CODE_200GBASE_1550NM_PSM4 = 0X44, EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_LR = 0X45, EXT_ETHERNET_COMPLIABCE_CODE_200GBASE_LR4 = 0X46, + EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_DR4 = 0X47, }; enum CMIS_IB_COMPLIANCE_CODE @@ -1203,7 +1231,11 @@ enum CMIS_PASSIVE_COPPER_COMPLIANCE CMIS_COMPLIANCE_EDR = 0x30, CMIS_COMPLIANCE_HDR = 0x31, CMIS_COMPLIANCE_NDR = 0x32, - CMIS_COMPLIANCE_XDR = 0x33 + CMIS_COMPLIANCE_XDR = 0x33, + CMIS_COMPLIANCE_100G_BASE_R1 = 0x46, + CMIS_COMPLIANCE_200G_BASE_R2 = 0x47, + CMIS_COMPLIANCE_400G_BASE_R4 = 0x48, + CMIS_COMPLIANCE_800G_BASE_R8 = 0x49 }; enum CMIS_MM_COMPLIANCE_CODE @@ -1491,6 +1523,29 @@ enum IB_LINK_SPEED IB_LINK_SPEED_XDR = 0x100 }; +#define LINK_SPEED_200G_LANE IB_LINK_SPEED_XDR + +#define LINK_SPEED_100G_LANE (IB_LINK_SPEED_NDR | ETH_LINK_SPEED_100G_LANE) + +#define ETH_LINK_SPEED_100G_LANE \ + (ETH_LINK_SPEED_EXT_100GAUI_1 | ETH_LINK_SPEED_EXT_200GAUI_2 | ETH_LINK_SPEED_EXT_400GAUI_4 | \ + ETH_LINK_SPEED_EXT_800GAUI_8) + +#define LINK_SPEED_50G_LANE (IB_LINK_SPEED_HDR | ETH_LINK_SPEED_50G_LANE) + +#define ETH_LINK_SPEED_50G_LANE \ + (ETH_LINK_SPEED_EXT_50GAUI_1 | ETH_LINK_SPEED_EXT_100GAUI_2 | ETH_LINK_SPEED_EXT_200GAUI_4 | \ + ETH_LINK_SPEED_EXT_400GAUI_8) + +#define LINK_SPEED_25G_LANE (IB_LINK_SPEED_EDR | ETH_LINK_SPEED_25G_LANE) + +#define ETH_LINK_SPEED_25G_LANE \ + (ETH_LINK_SPEED_100G_CR4 | ETH_LINK_SPEED_100G_KR4 | ETH_LINK_SPEED_100G_LR4 | ETH_LINK_SPEED_100G_SR4 | \ + ETH_LINK_SPEED_50G_KR2 | ETH_LINK_SPEED_50G_SR2 | ETH_LINK_SPEED_50G_CR2 | ETH_LINK_SPEED_25G_CR | \ + ETH_LINK_SPEED_25G_KR | ETH_LINK_SPEED_25G_SR | ETH_LINK_SPEED_50G_KR4) + +#define LINK_SPEED_ALL 0xffffffff + enum PRBS_MODULATION { PRBS_NRZ = 0, @@ -1572,6 +1627,7 @@ enum AMBER_SHEET AMBER_SHEET_TEST_MODE_MODULE_INFO = 14, AMBER_SHEET_PHY_DEBUG_INFO = 15, AMBER_SHEET_EXT_MODULE_STATUS = 16, + AMBER_SHEET_SERDES_5NM = 17, AMBER_SHEET_ALL // Keep this enum last }; diff --git a/mlxlink/modules/mlxlink_err_inj_commander.cpp b/mlxlink/modules/mlxlink_err_inj_commander.cpp index 96411614..1fc2741a 100644 --- a/mlxlink/modules/mlxlink_err_inj_commander.cpp +++ b/mlxlink/modules/mlxlink_err_inj_commander.cpp @@ -34,6 +34,8 @@ #include "mlxlink_err_inj_commander.h" +#define MAX_PARAMS_ARG_LEN 8 + MlxlinkErrInjCommander::MlxlinkErrInjCommander(Json::Value& jsonRoot) : _jsonRoot(jsonRoot) { _mixerOffset0 = -1; @@ -278,6 +280,10 @@ ReqParms MlxlinkErrInjCommander::validateErrType(const string& type, throw MlxRegException("Invalid parameters list for error type %s, %s", errTypeSt.errorTypeStr.c_str(), getNumOfValidParams(errTypeSt).c_str()); } + if (params[idx].size() > MAX_PARAMS_ARG_LEN) + { + throw MlxRegException("Invalid error parameter value: %s", params[idx].c_str()); + } strToUint32((char*)params[idx].c_str(), (u_int32_t&)paramsSet[idx]); } diff --git a/mlxlink/modules/mlxlink_maps.cpp b/mlxlink/modules/mlxlink_maps.cpp index fce6e616..85dc3a44 100644 --- a/mlxlink/modules/mlxlink_maps.cpp +++ b/mlxlink/modules/mlxlink_maps.cpp @@ -582,28 +582,30 @@ void MlxlinkMaps::initLinkDownInfoMapping() void MlxlinkMaps::initSltpStatusMapping() { - _SltpEdrParams[SLTP_EDR_POLARITY] = PRM_FIELD{"polarity", "Pol", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_TAP0] = PRM_FIELD{"ob_tap0", "tap0", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_TAP1] = PRM_FIELD{"ob_tap1", "tap1", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_TAP2] = PRM_FIELD{"ob_tap2", "tap2", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_BIAS] = PRM_FIELD{"ob_bias", "bias", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_PREEMP_MODE] = PRM_FIELD{"ob_preemp_mode", "preemp_mode", FIELD_ACCESS_RW, false}; - _SltpEdrParams[SLTP_EDR_OB_REG] = PRM_FIELD{"ob_reg", "reg", FIELD_ACCESS_ADVANCED, false}; - _SltpEdrParams[SLTP_EDR_OB_LEVA] = PRM_FIELD{"ob_leva", "leva", FIELD_ACCESS_ADVANCED, false}; - - _SltpHdrParams[SLTP_HDR_PRE_2_TAP] = PRM_FIELD{"pre_2_tap", "pre2Tap", FIELD_ACCESS_RW, true}; - _SltpHdrParams[SLTP_HDR_PRE_TAP] = PRM_FIELD{"pre_tap", "preTap", FIELD_ACCESS_RW, true}; - _SltpHdrParams[SLTP_HDR_MAIN_TAP] = PRM_FIELD{"main_tap", "mainTap", FIELD_ACCESS_RW, true}; - _SltpHdrParams[SLTP_HDR_POST_TAP] = PRM_FIELD{"post_tap", "postTap", FIELD_ACCESS_RW, true}; - _SltpHdrParams[SLTP_HDR_OB_M2LP] = PRM_FIELD{"ob_m2lp", "m2lp", FIELD_ACCESS_RW, true}; - _SltpHdrParams[SLTP_HDR_OB_AMP] = PRM_FIELD{"ob_amp", "amp", FIELD_ACCESS_RW, false}; - _SltpHdrParams[SLTP_HDR_OB_ALEV_OUT] = PRM_FIELD{"ob_alev_out", "alev_out", FIELD_ACCESS_W, false}; - - _SltpNdrParams[SLTP_NDR_FIR_PRE3] = PRM_FIELD{"fir_pre3", "fir_pre3", FIELD_ACCESS_RW, true}; - _SltpNdrParams[SLTP_NDR_FIR_PRE2] = PRM_FIELD{"fir_pre2", "fir_pre2", FIELD_ACCESS_RW, true}; - _SltpNdrParams[SLTP_NDR_FIR_PRE1] = PRM_FIELD{"fir_pre1", "fir_pre1", FIELD_ACCESS_RW, true}; - _SltpNdrParams[SLTP_NDR_FIR_MAIN] = PRM_FIELD{"fir_main", "fir_main", FIELD_ACCESS_RW, true}; - _SltpNdrParams[SLTP_NDR_FIR_POST1] = PRM_FIELD{"fir_post1", "fir_post1", FIELD_ACCESS_RW, true}; + _SltpEdrParams[SLTP_EDR_POLARITY] = PRM_FIELD{"polarity", "Pol", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_TAP0] = PRM_FIELD{"ob_tap0", "tap0", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_TAP1] = PRM_FIELD{"ob_tap1", "tap1", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_TAP2] = PRM_FIELD{"ob_tap2", "tap2", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_BIAS] = PRM_FIELD{"ob_bias", "bias", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_PREEMP_MODE] = + PRM_FIELD{"ob_preemp_mode", "preemp_mode", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_REG] = PRM_FIELD{"ob_reg", "reg", FIELD_ACCESS_ADVANCED, false, LINK_SPEED_ALL}; + _SltpEdrParams[SLTP_EDR_OB_LEVA] = PRM_FIELD{"ob_leva", "leva", FIELD_ACCESS_ADVANCED, false, LINK_SPEED_ALL}; + + _SltpHdrParams[SLTP_HDR_PRE_2_TAP] = PRM_FIELD{"pre_2_tap", "pre2Tap", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_PRE_TAP] = PRM_FIELD{"pre_tap", "preTap", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_MAIN_TAP] = PRM_FIELD{"main_tap", "mainTap", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_POST_TAP] = PRM_FIELD{"post_tap", "postTap", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_OB_M2LP] = PRM_FIELD{"ob_m2lp", "m2lp", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_OB_AMP] = PRM_FIELD{"ob_amp", "amp", FIELD_ACCESS_RW, false, LINK_SPEED_ALL}; + _SltpHdrParams[SLTP_HDR_OB_ALEV_OUT] = PRM_FIELD{"ob_alev_out", "alev_out", FIELD_ACCESS_W, false, LINK_SPEED_ALL}; + + _SltpNdrParams[SLTP_NDR_FIR_PRE3] = PRM_FIELD{"fir_pre3", "fir_pre3", FIELD_ACCESS_RW, true, LINK_SPEED_100G_LANE}; + _SltpNdrParams[SLTP_NDR_FIR_PRE2] = + PRM_FIELD{"fir_pre2", "fir_pre2", FIELD_ACCESS_RW, true, LINK_SPEED_100G_LANE | LINK_SPEED_50G_LANE}; + _SltpNdrParams[SLTP_NDR_FIR_PRE1] = PRM_FIELD{"fir_pre1", "fir_pre1", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpNdrParams[SLTP_NDR_FIR_MAIN] = PRM_FIELD{"fir_main", "fir_main", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; + _SltpNdrParams[SLTP_NDR_FIR_POST1] = PRM_FIELD{"fir_post1", "fir_post1", FIELD_ACCESS_RW, true, LINK_SPEED_ALL}; _SLTP7BadSetStatus2Str[BAD_STAT_7NM_INVALID_PRE3] = "pre3 is out of range"; _SLTP7BadSetStatus2Str[BAD_STAT_7NM_INVALID_PRE2] = "pre2 is out of range"; @@ -1052,6 +1054,10 @@ void MlxlinkMaps::extComplianceMapping() _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_DR] = "100GBASE-DR, with CAUI-4 without FEC"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_100G_FR] = "100G-FR, with CAUI-4 without FEC"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_100G_LR] = "100G-LR, with CAUI-4 without FEC"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_SR4] = "100GBASE-SR1, 200GBASE-SR2 or 400GBASE-SR4"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_FR1] = "100GBASE-FR1 or 400GBASE-DR4-2"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_100GBASE_LR1] = "100GBASE-LR1"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_ACC_10_6] = "Active Copper Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. " "Providing a worst BER of 10^(-6) or below"; @@ -1066,6 +1072,8 @@ void MlxlinkMaps::extComplianceMapping() "Active Optical Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. " "Providing a worst BER of 2.6x10^(-4) for AOC, 10^(-5) for AUI, " "or below"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_VR4] = "100GBASE-VR1, 200GBASE-VR2 or 400GBASE-VR4"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_CR4] = "100GBASE-CR1, 200GBASE-CR2 or 400GBASE-CR4"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_CR] = "50GBASE-CR, 100GBASE-CR2, or 200GBASE-CR4"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_SR] = "50GBASE-SR, 100GBASE-SR2, or 200GBASE-SR4"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_FR] = "50GBASE-FR or 200GBASE-DR4"; @@ -1073,6 +1081,7 @@ void MlxlinkMaps::extComplianceMapping() _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_200GBASE_1550NM_PSM4] = "200G 1550 nm PSM4"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_50GBASE_LR] = "50GBASE-LR"; _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_200GBASE_LR4] = "200GBASE-LR4"; + _cableComplianceExt[EXT_ETHERNET_COMPLIABCE_CODE_400GBASE_DR4] = "400GBASE-DR4, 400GAUI-4 C2M"; } void MlxlinkMaps::hostComplianceMapping() @@ -1121,6 +1130,10 @@ void MlxlinkMaps::hostComplianceMapping() _cmisHostCompliance[CMIS_COMPLIANCE_HDR] = "IB HDR"; _cmisHostCompliance[CMIS_COMPLIANCE_NDR] = "IB NDR"; _cmisHostCompliance[CMIS_COMPLIANCE_XDR] = "IB XDR"; + _cmisHostCompliance[CMIS_COMPLIANCE_100G_BASE_R1] = "100GBASE-CR1"; + _cmisHostCompliance[CMIS_COMPLIANCE_200G_BASE_R2] = "200GBASE-CR2"; + _cmisHostCompliance[CMIS_COMPLIANCE_400G_BASE_R4] = "400GBASE-CR4"; + _cmisHostCompliance[CMIS_COMPLIANCE_800G_BASE_R8] = "800G-ETC-CR8 or 800GBASE-CR8"; } void MlxlinkMaps::mediaComplianceMapping() diff --git a/mlxlink/modules/mlxlink_maps.h b/mlxlink/modules/mlxlink_maps.h index 43e98ff6..d928f218 100644 --- a/mlxlink/modules/mlxlink_maps.h +++ b/mlxlink/modules/mlxlink_maps.h @@ -109,10 +109,38 @@ struct CAP_VALUE struct PRM_FIELD { + PRM_FIELD() + { + prmField = ""; + uiField = ""; + fieldAccess = 0; + isSigned = false; + validationMask = 0; + } + + PRM_FIELD(string _prmField, string _uiField, u_int32_t _fieldAccess, bool _isSigned) + { + prmField = _prmField; + uiField = _uiField; + fieldAccess = _fieldAccess; + isSigned = _isSigned; + validationMask = 0; + } + + PRM_FIELD(string _prmField, string _uiField, u_int32_t _fieldAccess, bool _isSigned, u_int32_t _validationMask) + { + prmField = _prmField; + uiField = _uiField; + fieldAccess = _fieldAccess; + isSigned = _isSigned; + validationMask = _validationMask; + } + string prmField; string uiField; u_int32_t fieldAccess; bool isSigned; + u_int32_t validationMask; }; class MlxlinkMaps @@ -213,6 +241,7 @@ class MlxlinkMaps std::map _SltpEdrParams; std::map _SltpHdrParams; std::map _SltpNdrParams; + std::map _SltpXdrParams; std::map _ethANFsmState; std::map _fecModeActive; std::map> _fecModeMask; diff --git a/mlxlink/modules/mlxlink_reg_parser.cpp b/mlxlink/modules/mlxlink_reg_parser.cpp index 17fbdc6c..51308722 100644 --- a/mlxlink/modules/mlxlink_reg_parser.cpp +++ b/mlxlink/modules/mlxlink_reg_parser.cpp @@ -36,13 +36,14 @@ MlxlinkRegParser::MlxlinkRegParser() : RegAccessParser("", "", "", NULL, 0) { - _mf = NULL; - _regLib = NULL; + _mf = nullptr; + _regLib = nullptr; _gvmiAddress = 0; _localPort = 0; _portType = 0; _pnat = 0; + _planeInd = -1; _isHCA = false; } diff --git a/mlxlink/modules/mlxlink_reg_parser.h b/mlxlink/modules/mlxlink_reg_parser.h index 301b61b3..f0730aa3 100644 --- a/mlxlink/modules/mlxlink_reg_parser.h +++ b/mlxlink/modules/mlxlink_reg_parser.h @@ -72,6 +72,7 @@ class MlxlinkRegParser : public RegAccessParser u_int32_t _localPort; u_int32_t _pnat; u_int32_t _portType; + int _planeInd; bool _isHCA; }; diff --git a/mlxlink/modules/mlxlink_ui.cpp b/mlxlink/modules/mlxlink_ui.cpp index c2ecd50e..e69341c6 100644 --- a/mlxlink/modules/mlxlink_ui.cpp +++ b/mlxlink/modules/mlxlink_ui.cpp @@ -33,10 +33,12 @@ */ #include "mlxlink_ui.h" +#include MlxlinkUi::MlxlinkUi() : CommandLineRequester(MLXLINK_EXEC " OPTIONS"), _cmdParser(MLXLINK_EXEC) { _mlxlinkCommander = nullptr; + _mf = nullptr; } MlxlinkUi::~MlxlinkUi() @@ -52,6 +54,64 @@ void MlxlinkUi::createMlxlinkCommander() _mlxlinkCommander = new MlxlinkCommander(); } +void MlxlinkUi::initRegAccessLib() +{ + MlxRegLib::isAccessRegisterSupported(_mf); + + _mlxlinkCommander->_mf = _mf; + + _mlxlinkCommander->_regLib = + new MlxRegLib(_mlxlinkCommander->_mf, _mlxlinkCommander->_extAdbFile, _mlxlinkCommander->_useExtAdb); + + _mlxlinkCommander->_userInput = _userInput; + + if (_mlxlinkCommander->_regLib->isIBDevice() && + !_mlxlinkCommander->_regLib->isAccessRegisterGMPSupported(MACCESS_REG_METHOD_GET)) + { + MlxlinkRecord::printWar("Warning: AccessRegisterGMP Get() method is not supported.\n" + " mlxlink has limited functionality", + _mlxlinkCommander->_jsonRoot); + } + + _mlxlinkCommander->_gvmiAddress = _userInput._gvmiAddress; + _mlxlinkCommander->_devID = _mlxlinkCommander->_regLib->getDevId(); + _mlxlinkCommander->_isHCA = dm_dev_is_hca(_mlxlinkCommander->_devID); +} + +void MlxlinkUi::initPortInfo() +{ + _mlxlinkCommander->labelToLocalPort(); + _mlxlinkCommander->validatePortType(_userInput._portType); + if (!_userInput._pcie) + { + _mlxlinkCommander->checkValidFW(); + } + _mlxlinkCommander->getProductTechnology(); + if (!_userInput._pcie) + { + _mlxlinkCommander->_prbsTestMode = _mlxlinkCommander->inPrbsTestMode(); + if (_userInput._networkCmds != 0 || _userInput._ddm || _userInput._dump || _userInput._write || + _userInput._read || _userInput.isModuleConfigParamsProvided || _userInput.isPrbsSelProvided || + _userInput._csvBer != "") + { + _mlxlinkCommander->getCableParams(); + } + } + else if (!_userInput._sendDpn) + { + _mlxlinkCommander->initValidDPNList(); + } +} + +void MlxlinkUi::initMlxlinkCommander() +{ + createMlxlinkCommander(); + + initRegAccessLib(); + + initPortInfo(); +} + void MlxlinkUi::printSynopsisHeader() { printf(IDENT "NAME:\n" IDENT2 MLXLINK_EXEC "\n\n" IDENT "SYNOPSIS:\n" IDENT2 MLXLINK_EXEC " [OPTIONS]\n\n" IDENT @@ -316,7 +376,7 @@ void MlxlinkUi::printSynopsisCommands() MlxlinkRecord::printFlagLine(MPEINJ_ERR_TYPE_FLAG_SHORT, MPEINJ_ERR_TYPE_FLAG, "type", "PCIe error type [ABORT(0),BAD_DLLP_LCRC(1),BAD_TLP_LCRC(2),BAD_TLP_ECRC(3)," "ERR_MSG(4),MALFORMED_TLP(5),POISONED_TLP(6),UNEXPECTED_CPL(7),ACS_VIOLATION(8)," - "SURPRISE_LINK_DOWN(9),RECEIVER_ERROR(10)]"); + "SURPRISE_LINK_DOWN(100),RECEIVER_ERROR(101)]"); printf(IDENT); MlxlinkRecord::printFlagLine(MPEINJ_ERR_DURATION_FLAG_SHORT, MPEINJ_ERR_DURATION_FLAG, "duration", "Error duration, depend on the error type, refer to the UM for more info (Optional)"); @@ -387,7 +447,7 @@ void MlxlinkUi::printHelp() printf(IDENT2 "%-40s: \n" IDENT3 "%s\n", "Write to cable", MLXLINK_EXEC " -d --cable --write --page --offset "); - if (_mlxlinkCommander->_userInput._advancedMode) + if (_userInput._advancedMode) { printf(IDENT2 "%-40s: \n" IDENT3 "%s\n", "Configure Transmitter Parameters (on lane, to database)", MLXLINK_EXEC " -d -p --serdes_tx " @@ -408,21 +468,20 @@ void MlxlinkUi::printHelp() void MlxlinkUi::validateMandatoryParams() { - if (_mlxlinkCommander->_device == "") + if (_userInput._device == "") { throw MlxRegException("Please provide a device name"); } - if (_mlxlinkCommander->_userInput._links && _mlxlinkCommander->_userInput._portType != "PCIE") + if (_userInput._links && _userInput._portType != "PCIE") { throw MlxRegException("The --" PCIE_LINKS_FLAG " option is valid only with --port_type PCIE"); } - if (_mlxlinkCommander->_userInput._links && - (_mlxlinkCommander->_userInput._showEyeInfo || _mlxlinkCommander->_userInput._showSltp || - _mlxlinkCommander->_userInput._showCounters || _mlxlinkCommander->_userInput._showSlrp)) + if (_userInput._links && + (_userInput._showEyeInfo || _userInput._showSltp || _userInput._showCounters || _userInput._showSlrp)) { throw MlxRegException("No options allowed to use while querying --" PCIE_LINKS_FLAG); } - if ((_mlxlinkCommander->_userInput._labelPort == 0) && (_mlxlinkCommander->_userInput._portType != "PCIE")) + if ((_userInput._labelPort == 0) && (_userInput._portType != "PCIE")) { throw MlxRegException("Please provide a valid port number"); } @@ -430,24 +489,23 @@ void MlxlinkUi::validateMandatoryParams() void MlxlinkUi::validatePCIeParams() { - bool dpnFlags = _mlxlinkCommander->_userInput._sendNode || _mlxlinkCommander->_userInput._sendDepth || - _mlxlinkCommander->_userInput._sendPcieIndex; + bool dpnFlags = _userInput._sendNode || _userInput._sendDepth || _userInput._sendPcieIndex; - if (_mlxlinkCommander->_userInput._portType == "PCIE") + if (_userInput._portType == "PCIE") { - _mlxlinkCommander->_userInput._pcie = true; + _userInput._pcie = true; - if (_mlxlinkCommander->_uniqueCmds) + if (_userInput._uniqueCmds) { throw MlxRegException("Command flags are not available for PCIE"); } - if (_mlxlinkCommander->_networkCmds) + if (_userInput._networkCmds) { throw MlxRegException("FEC and Module Info flags are not available for PCIE"); } - if (_mlxlinkCommander->_uniquePcieCmds > 1) + if (_userInput._uniquePcieCmds > 1) { throw MlxRegException("Commands are mutually exclusive!"); } @@ -456,17 +514,16 @@ void MlxlinkUi::validatePCIeParams() if (dpnFlags) { - if (!(_mlxlinkCommander->_userInput._sendNode && _mlxlinkCommander->_userInput._sendDepth && - _mlxlinkCommander->_userInput._sendPcieIndex)) + if (!(_userInput._sendNode && _userInput._sendDepth && _userInput._sendPcieIndex)) { throw MlxRegException("The --depth, --pcie_index and --node must be specified for PCIE"); } else { - _mlxlinkCommander->_userInput._sendDpn = true; + _userInput._sendDpn = true; } } - if (_mlxlinkCommander->_userInput._portSpecified) + if (_userInput._portSpecified) { if (dpnFlags) { @@ -483,27 +540,26 @@ void MlxlinkUi::validatePCIeParams() void MlxlinkUi::validateGeneralCmdsParams() { - if (_mlxlinkCommander->_uniqueCmds > 1) + if (_userInput._uniqueCmds > 1) { throw MlxRegException("Commands are mutually exclusive!"); } - if (isIn(SEND_PAOS, _sendRegFuncMap) && !checkPaosCmd(_mlxlinkCommander->_userInput._paosCmd)) + if (isIn(SEND_PAOS, _sendRegFuncMap) && !checkPaosCmd(_userInput._paosCmd)) { throw MlxRegException("Please provide a valid paos command [UP(up)/DN(down)/TG(toggle)]"); } - if (!isIn(SEND_PPLM, _sendRegFuncMap) && _mlxlinkCommander->_userInput._speedFec != "") + if (!isIn(SEND_PPLM, _sendRegFuncMap) && _userInput._speedFec != "") { throw MlxRegException("The --fec_speed flag is valid only with --fec flag"); } if (isIn(SEND_SLTP, _sendRegFuncMap)) { - if (_mlxlinkCommander->_userInput._sltpLane && _mlxlinkCommander->_userInput._db) + if (_userInput._sltpLane && _userInput._db) { throw MlxRegException("Lane and Database flags are mutually exclusive"); } } - else if (_mlxlinkCommander->_userInput._sltpLane || _mlxlinkCommander->_userInput._db || - _mlxlinkCommander->_userInput._txPolicy) + else if (_userInput._sltpLane || _userInput._db || _userInput._txPolicy) { throw MlxRegException(LANE_FLAG ", --" DATABASE_FLAG " and --" SLTP_TX_POLICY_FLAG @@ -513,17 +569,16 @@ void MlxlinkUi::validateGeneralCmdsParams() void MlxlinkUi::validatePRBSParams() { - bool prbsFlags = _mlxlinkCommander->_userInput._sendPprt || _mlxlinkCommander->_userInput._sendPptt || - _mlxlinkCommander->_userInput._pprtRate != "" || _mlxlinkCommander->_userInput._pprtRate != "" || - _mlxlinkCommander->_userInput._prbsTxInv || _mlxlinkCommander->_userInput._prbsRxInv || - _mlxlinkCommander->_userInput._prbsLanesToSet.size() > 0; + bool prbsFlags = _userInput._sendPprt || _userInput._sendPptt || _userInput._pprtRate != "" || + _userInput._pprtRate != "" || _userInput._prbsTxInv || _userInput._prbsRxInv || + _userInput._prbsLanesToSet.size() > 0; if (isIn(SEND_PRBS, _sendRegFuncMap)) { - if (!checkPrbsCmd(_mlxlinkCommander->_userInput._prbsMode)) + if (!checkPrbsCmd(_userInput._prbsMode)) { throw MlxRegException("you must provide a valid PRBS test mode [DS/EN/TU]"); } - if (_mlxlinkCommander->_userInput._prbsMode == "DS" || _mlxlinkCommander->_userInput._prbsMode == "TU") + if (_userInput._prbsMode == "DS" || _userInput._prbsMode == "TU") { if (prbsFlags) { @@ -539,34 +594,30 @@ void MlxlinkUi::validatePRBSParams() void MlxlinkUi::validateModulePRBSParams() { - if (!_mlxlinkCommander->_userInput.isPrbsSelProvided && - (_mlxlinkCommander->_userInput.isPrbsModeProvided || _mlxlinkCommander->_userInput.isPrbsChProvided || - _mlxlinkCommander->_userInput.isPrbsGenProvided || _mlxlinkCommander->_userInput.isPrbsShowDiagProvided || - _mlxlinkCommander->_userInput.isPrbsClearDiagProvided)) + if (!_userInput.isPrbsSelProvided && + (_userInput.isPrbsModeProvided || _userInput.isPrbsChProvided || _userInput.isPrbsGenProvided || + _userInput.isPrbsShowDiagProvided || _userInput.isPrbsClearDiagProvided)) { throw MlxRegException("Please select PRBS module side using --" CABLE_PRBS_SELECT " [MEDIA|HOST] flag!"); } - if (!_mlxlinkCommander->_userInput.isPrbsModeProvided && - (_mlxlinkCommander->_userInput.isPrbsChProvided || _mlxlinkCommander->_userInput.isPrbsGenProvided || - !_mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_RATE].empty())) + if (!_userInput.isPrbsModeProvided && (_userInput.isPrbsChProvided || _userInput.isPrbsGenProvided || + !_userInput.modulePrbsParams[MODULE_PRBS_RATE].empty())) { throw MlxRegException("--" CABLE_PRBS_MODE " flag should be provided!"); } - if (_mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_MODE] == "DS" && - _mlxlinkCommander->_userInput.modulePrbsParams.size() > 2) + if (_userInput.modulePrbsParams[MODULE_PRBS_MODE] == "DS" && _userInput.modulePrbsParams.size() > 2) { throw MlxRegException("PRBS module parameters flags are valid only with PRBS enable mode (--prbs_mode EN)"); } - if (_mlxlinkCommander->_userInput.isPrbsModeProvided && - (_mlxlinkCommander->_userInput.isPrbsShowDiagProvided || _mlxlinkCommander->_userInput.isPrbsClearDiagProvided)) + if (_userInput.isPrbsModeProvided && (_userInput.isPrbsShowDiagProvided || _userInput.isPrbsClearDiagProvided)) { throw MlxRegException("PRBS Module Diagnostic info flags are not working while configuring the PRBS test " "mode!"); } - if (_mlxlinkCommander->_userInput.isPrbsShowDiagProvided && _mlxlinkCommander->_userInput.isPrbsClearDiagProvided) + if (_userInput.isPrbsShowDiagProvided && _userInput.isPrbsClearDiagProvided) { throw MlxRegException("are mutually exclusive, please select one command only"); } @@ -583,39 +634,38 @@ void MlxlinkUi::validateSpeedAndCSVBerParams() } if (berCollect || amBerCollect) { - if (!endsWith(_mlxlinkCommander->_userInput._csvBer, ".csv")) + if (!endsWith(_userInput._csvBer, ".csv")) { throw MlxRegException("you must provide a valid .csv file"); } - if (!checkTestMode(_mlxlinkCommander->_userInput._testMode)) + if (!checkTestMode(_userInput._testMode)) { throw MlxRegException("Please provide a valid test mode [Nominal(Default)/Corner/Drift]"); } } - else if (_mlxlinkCommander->_userInput._testMode != "Nominal") + else if (_userInput._testMode != "Nominal") { throw MlxRegException("BER Limit Criteria flag is valid only with Port Information Collection flag (--bc)"); } if (isIn(SEND_PEPC, _sendRegFuncMap)) { - if (!_mlxlinkCommander->_userInput._sendPepcForceMode) + if (!_userInput._sendPepcForceMode) { throw MlxRegException("Please provide --twisted_pair_force_mode"); } - if (_mlxlinkCommander->_userInput._sendPepcForceMode && - !checkPepcForceMode(_mlxlinkCommander->_userInput._forceMode)) + if (_userInput._sendPepcForceMode && !checkPepcForceMode(_userInput._forceMode)) { throw MlxRegException("Please provide a valid twisted pair force mode [MA(Master)/SL(Slave)]"); } } else { - if (_mlxlinkCommander->_userInput._sendPepcForceMode) + if (_userInput._sendPepcForceMode) { throw MlxRegException("Please provide --set_external_phy option to configure the twisted pair force mode"); } } - if (_mlxlinkCommander->_linkModeForce && _mlxlinkCommander->_ptysSpeeds.size() != 1) + if (_userInput._linkModeForce && _userInput._ptysSpeeds.size() != 1) { throw MlxRegException("--link_mode_force should receive exactly one speed using --speeds"); } @@ -623,28 +673,25 @@ void MlxlinkUi::validateSpeedAndCSVBerParams() void MlxlinkUi::validateCableParams() { - bool readWriteFlags = _mlxlinkCommander->_userInput._page >= 0 || _mlxlinkCommander->_userInput._offset >= 0 || - _mlxlinkCommander->_userInput._len >= 0; - bool prbsParamProvided = _mlxlinkCommander->_userInput.modulePrbsParams.size(); - bool cablePrbsParamProvided = _mlxlinkCommander->_userInput.isPrbsSelProvided || prbsParamProvided; - bool cableConfigParamProvided = _mlxlinkCommander->_userInput.isModuleConfigParamsProvided; - bool paramSetProvided = _mlxlinkCommander->_userInput.configParamsToSet.size(); - bool cableCommandProvided = _mlxlinkCommander->_userInput._dump || _mlxlinkCommander->_userInput._write || - _mlxlinkCommander->_userInput._read || _mlxlinkCommander->_userInput._ddm || + bool readWriteFlags = _userInput._page >= 0 || _userInput._offset >= 0 || _userInput._len >= 0; + bool prbsParamProvided = _userInput.modulePrbsParams.size(); + bool cablePrbsParamProvided = _userInput.isPrbsSelProvided || prbsParamProvided; + bool cableConfigParamProvided = _userInput.isModuleConfigParamsProvided; + bool paramSetProvided = _userInput.configParamsToSet.size(); + bool cableCommandProvided = _userInput._dump || _userInput._write || _userInput._read || _userInput._ddm || cablePrbsParamProvided || cableConfigParamProvided; - if (!_mlxlinkCommander->_userInput._cable && (cableCommandProvided || readWriteFlags)) + if (!_userInput._cable && (cableCommandProvided || readWriteFlags)) { throw MlxRegException("\"--" CABLE_FLAG "\" flag should be specified!"); } - else if (_mlxlinkCommander->_userInput._cable) + else if (_userInput._cable) { - if ((_mlxlinkCommander->_uniqueCableCmds > 1) || !cableCommandProvided) + if ((_userInput._uniqueCableCmds > 1) || !cableCommandProvided) { throw MlxRegException("Please choose one of " CABLE_FLAG " operations!"); } - if ((_mlxlinkCommander->_userInput._read || _mlxlinkCommander->_userInput._write) && - (_mlxlinkCommander->_userInput._page == -1 || _mlxlinkCommander->_userInput._offset == -1)) + if ((_userInput._read || _userInput._write) && (_userInput._page == -1 || _userInput._offset == -1)) { throw MlxRegException("\"--" WRITE_PAGE_FLAG "\" and \"--" WRITE_OFFSET_FLAG "\" flags should be specified!"); @@ -656,23 +703,23 @@ void MlxlinkUi::validateCableParams() if (readWriteFlags) { - if (!_mlxlinkCommander->_userInput._write && !_mlxlinkCommander->_userInput._read) + if (!_userInput._write && !_userInput._read) { throw MlxRegException("Read or Write flag should be specified!"); } - if (_mlxlinkCommander->_userInput._read) + if (_userInput._read) { - if (_mlxlinkCommander->_userInput._len == -1) + if (_userInput._len == -1) { - _mlxlinkCommander->_userInput._len = 1; // default number of bytes to read + _userInput._len = 1; // default number of bytes to read } - else if (_mlxlinkCommander->_userInput._len == 0) + else if (_userInput._len == 0) { throw MlxRegException("The length cannot be zero!"); } } - else if (_mlxlinkCommander->_userInput._len >= 0) + else if (_userInput._len >= 0) { throw MlxRegException("\"--" READ_LEN_FLAG "\" flag is working with read option only!"); } @@ -682,32 +729,31 @@ void MlxlinkUi::validateCableParams() void MlxlinkUi::validateTxGroupParams() { - if (_mlxlinkCommander->_userInput._showGroup >= 0) + if (_userInput._showGroup >= 0) { - if (!_mlxlinkCommander->_userInput._labelPorts.empty()) + if (!_userInput._labelPorts.empty()) { throw MlxRegException("\"--" TX_GROUP_PORTS_FLAG "\" flag is working with " SET_TX_GROUP_MAP_FLAG " only!"); } } - if (_mlxlinkCommander->_userInput._setGroup >= 0 && _mlxlinkCommander->_userInput._showGroup >= 0) + if (_userInput._setGroup >= 0 && _userInput._showGroup >= 0) { throw MlxRegException("Choose one of operations!"); } - if (_mlxlinkCommander->_userInput._setGroup >= 0) + if (_userInput._setGroup >= 0) { - if (_mlxlinkCommander->_userInput._labelPorts.empty()) + if (_userInput._labelPorts.empty()) { throw MlxRegException("\"--" TX_GROUP_PORTS_FLAG "\" should be specified!"); } } - if (_mlxlinkCommander->_userInput._setGroup >= MAX_TX_GROUP_COUNT || - _mlxlinkCommander->_userInput._showGroup >= MAX_TX_GROUP_COUNT) + if (_userInput._setGroup >= MAX_TX_GROUP_COUNT || _userInput._showGroup >= MAX_TX_GROUP_COUNT) { throw MlxRegException("Tx group is invalid, it can be in range [0-9]!"); } - if (_mlxlinkCommander->_userInput._setGroup == -1 && !_mlxlinkCommander->_userInput._labelPorts.empty()) + if (_userInput._setGroup == -1 && !_userInput._labelPorts.empty()) { throw MlxRegException("\"--" SET_TX_GROUP_MAP_FLAG "\" should be specified!"); } @@ -715,9 +761,9 @@ void MlxlinkUi::validateTxGroupParams() void MlxlinkUi::validateGradeScanParams() { - if (_mlxlinkCommander->_userInput.eyeSelectSpecified) + if (_userInput.eyeSelectSpecified) { - if (_mlxlinkCommander->_userInput._portType == "PCIE") + if (_userInput._portType == "PCIE") { throw MlxRegException(EYE_SEL_FLAG " flag is working with Network ports only!"); } @@ -726,10 +772,9 @@ void MlxlinkUi::validateGradeScanParams() void MlxlinkUi::validateErrInjParams() { - bool errInjEnable = _mlxlinkCommander->_userInput.enableRxErrInj; - bool showMixers = _mlxlinkCommander->_userInput.showMixers; - bool mixerControl = - _mlxlinkCommander->_userInput.mixerOffset0 >= 0 || _mlxlinkCommander->_userInput.mixerOffset1 >= 0; + bool errInjEnable = _userInput.enableRxErrInj; + bool showMixers = _userInput.showMixers; + bool mixerControl = _userInput.mixerOffset0 >= 0 || _userInput.mixerOffset1 >= 0; if ((errInjEnable) && ((!mixerControl && !showMixers) || (mixerControl && showMixers))) { throw MlxRegException("Please provide either mixers offset configuration, " @@ -741,8 +786,7 @@ void MlxlinkUi::validateErrInjParams() } if (mixerControl) { - if (_mlxlinkCommander->_userInput.mixerOffset0 > MAX_MIXER_OFFSET_0 || - _mlxlinkCommander->_userInput.mixerOffset1 > MAX_MIXER_OFFSET_1) + if (_userInput.mixerOffset0 > MAX_MIXER_OFFSET_0 || _userInput.mixerOffset1 > MAX_MIXER_OFFSET_1) { char errMsg[64]; sprintf(errMsg, "For mixer_offset0 [0 to 0x%x] and mixer_offset1 [0 to 0x%x]", MAX_MIXER_OFFSET_0, @@ -751,26 +795,24 @@ void MlxlinkUi::validateErrInjParams() } } - if (_mlxlinkCommander->_userInput.isPcieErrInjProvided) + if (_userInput.isPcieErrInjProvided) { - if (!_mlxlinkCommander->_userInput._pcie) + if (!_userInput._pcie) { throw MlxRegException("The PCIE error injection feature is applicable to the PCIe links only!"); } - if (_mlxlinkCommander->_userInput.errorType.empty()) + if (_userInput.errorType.empty()) { - if (_mlxlinkCommander->_userInput.errorDuration != -1 || !_mlxlinkCommander->_userInput.dbdf.empty() || - _mlxlinkCommander->_userInput.injDelay != -1) + if (_userInput.errorDuration != -1 || !_userInput.dbdf.empty() || _userInput.injDelay != -1) { throw MlxRegException(MPEINJ_ERR_TYPE_FLAG " flag should be specified!"); } } } - if (_mlxlinkCommander->_userInput.errorDuration != -1 || !_mlxlinkCommander->_userInput.dbdf.empty() || - _mlxlinkCommander->_userInput.injDelay != -1 || !_mlxlinkCommander->_userInput.errorType.empty() || - !_mlxlinkCommander->_userInput.parameters.empty()) + if (_userInput.errorDuration != -1 || !_userInput.dbdf.empty() || _userInput.injDelay != -1 || + !_userInput.errorType.empty() || !_userInput.parameters.empty()) { - if (!_mlxlinkCommander->_userInput.isPcieErrInjProvided) + if (!_userInput.isPcieErrInjProvided) { throw MlxRegException(MPEINJ_PCIE_ERR_INJ_FLAG " flag should be specified!"); } @@ -779,23 +821,123 @@ void MlxlinkUi::validateErrInjParams() void MlxlinkUi::validatePortInfoParams() { - if (_mlxlinkCommander->_userInput.enableFecHistogram && !_mlxlinkCommander->_userInput.showFecHistogram && - !_mlxlinkCommander->_userInput.clearFecHistogram) + if (_userInput.enableFecHistogram && !_userInput.showFecHistogram && !_userInput.clearFecHistogram) { throw MlxRegException("Please provide one of FEC Histogram options: " "--" PPHCR_SHOW_FEC_HIST_FLAG " or --" PPHCR_CLEAR_HISTOGRAM_FLAG); } - if (!_mlxlinkCommander->_userInput.enableFecHistogram && - (_mlxlinkCommander->_userInput.showFecHistogram || _mlxlinkCommander->_userInput.clearFecHistogram)) + if (!_userInput.enableFecHistogram && (_userInput.showFecHistogram || _userInput.clearFecHistogram)) { throw MlxRegException(PPHCR_FEC_HIST_FLAG " flag should be specified"); } - if (_mlxlinkCommander->_userInput.showFecHistogram && _mlxlinkCommander->_userInput.clearFecHistogram) + if (_userInput.showFecHistogram && _userInput.clearFecHistogram) { throw MlxRegException("Options are mutually exclusive, please select one option only"); } } +void MlxlinkUi::strToInt32(char* str, u_int32_t& value) +{ + char* endp; + value = strtol(str, &endp, 0); + if (*endp) + { + throw MlxRegException("Argument: %s is invalid.", str); + } +} + +std::vector MlxlinkUi::parseParamsFromLine(const string& paramsLine) +{ + std::vector paramVector; + string param; + stringstream stream(paramsLine); + while (getline(stream, param, ',')) + { + if (param == "") + { + throw MlxRegException("Wrong input format"); + } + paramVector.push_back(param.c_str()); + } + return paramVector; +} + +std::map MlxlinkUi::getSltpParamsFromVector(const string& paramsLine) +{ + std::map sltpParamsInt; + std::vector sltpParamsStr = parseParamsFromLine(paramsLine); + + for (u_int32_t i = 0; i < sltpParamsStr.size(); i++) + { + strToInt32((char*)sltpParamsStr[i].c_str(), sltpParamsInt[i]); + } + + return sltpParamsInt; +} + +std::map MlxlinkUi::getprbsLanesFromParams(const string& paramsLine) +{ + std::vector prbsLanesParams = parseParamsFromLine(paramsLine); + + std::map prbsLanesToSet; + u_int32_t lane = 0; + vector::iterator it = prbsLanesParams.begin(); + while (it != prbsLanesParams.end()) + { + RegAccessParser::RegAccessParser::strToUint32((char*)(*it).c_str(), lane); + prbsLanesToSet[lane] = true; + it++; + } + return prbsLanesToSet; +} + +void MlxlinkUi::handlePortStr(UserInput& userInput, const string& portStr) +{ + auto portParts = MlxlinkRecord::split(portStr, "/"); + // validate arguments + for (auto it = portParts.begin(); it != portParts.end(); it++) + { + if ((*it).empty()) + { + throw MlxRegException("Argument: %s is invalid.", portStr.c_str()); + } + } + + /* For Quantum-2: + * portStr should represent: (cage/port/split) if split sign provided + * (cage/port) if no split sign provided + * For Other Switches: + * portStr should represent: (port/split) if split sign provided + * (port) if no split sign provided + */ + if (portParts.size() > 1) + { + RegAccessParser::RegAccessParser::strToUint32((char*)portParts[1].c_str(), userInput._splitPort); + userInput._splitProvided = true; + if (portParts.size() > SECOND_LEVEL_PORT_ACCESS) + { + // it's the split part of Quantum-2 (xx/xx/split) + RegAccessParser::RegAccessParser::strToUint32((char*)portParts[2].c_str(), userInput._secondSplitPort); + userInput._secondSplitProvided = true; + } + else if (portParts.size() > THIRD_LEVEL_PORT_ACCESS) + { + throw MlxRegException("Failed to handle option port"); + } + } + + RegAccessParser::RegAccessParser::strToUint32((char*)portParts[0].c_str(), userInput._labelPort); + userInput._portSpecified = true; +} + +void MlxlinkUi::checkStrLength(const string& str) +{ + if (str.size() > MAX_INPUT_LENGTH) + { + throw MlxRegException("Argument: %s... is invalid.", str.substr(0, MAX_INPUT_LENGTH).c_str()); + } +} + void MlxlinkUi::paramValidate() { validateMandatoryParams(); @@ -1062,107 +1204,105 @@ ParseStatus MlxlinkUi::HandleOption(string name, string value) } else if (name == DEVICE_FLAG) { - _mlxlinkCommander->_device = value; + _userInput._device = value; return PARSE_OK; } else if (name == MODULE_INFO_FLAG) { addCmd(SHOW_MODULE); - _mlxlinkCommander->_networkCmds++; + _userInput._networkCmds++; return PARSE_OK; } else if (name == BER_FLAG) { addCmd(SHOW_BER); - _mlxlinkCommander->_userInput._showCounters = true; + _userInput._showCounters = true; return PARSE_OK; } else if (name == PPCNT_CLEAR_FLAG) { addCmd(SEND_CLEAR_COUNTERS); - _mlxlinkCommander->_uniqueCmds++; + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == EYE_OPENING_FLAG) { addCmd(SHOW_EYE); - _mlxlinkCommander->_userInput._showEyeInfo = true; + _userInput._showEyeInfo = true; return PARSE_OK; } else if (name == SLTP_SHOW_FLAG) { addCmd(SHOW_SLTP); - _mlxlinkCommander->_userInput._showSltp = true; + _userInput._showSltp = true; return PARSE_OK; } else if (name == SLTP_SET_FLAG) { - string sltpParamsLine = toUpperCase(value); - std::vector sltpParams = _mlxlinkCommander->parseParamsFromLine(sltpParamsLine); - _mlxlinkCommander->getSltpParamsFromVector(sltpParams); + _userInput._sltpParams = getSltpParamsFromVector(toUpperCase(value)); addCmd(SEND_SLTP); - _mlxlinkCommander->_uniqueCmds++; + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == LANE_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._lane); - _mlxlinkCommander->_userInput._sltpLane = true; + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._lane); + _userInput._sltpLane = true; return PARSE_OK; } else if (name == DATABASE_FLAG) { - _mlxlinkCommander->_userInput._db = true; + _userInput._db = true; return PARSE_OK; } else if (name == SLTP_TX_POLICY_FLAG) { - _mlxlinkCommander->_userInput._txPolicy = true; + _userInput._txPolicy = true; return PARSE_OK; } else if (name == GVMI_ADDRESS_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._gvmiAddress); + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._gvmiAddress); return PARSE_OK; } else if (name == SLTP_SET_ADVANCED_FLAG) { - _mlxlinkCommander->_userInput._advancedMode = true; + _userInput._advancedMode = true; return PARSE_OK; } else if (name == PORT_TYPE_FLAG) { - _mlxlinkCommander->_userInput._portType = toUpperCase(value); + _userInput._portType = toUpperCase(value); return PARSE_OK; } else if (name == LABEL_PORT_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->handlePortStr(value); + checkStrLength(value); + handlePortStr(_userInput, value); return PARSE_OK; } else if (name == DEPTH_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._depth); - _mlxlinkCommander->_userInput._sendDepth = true; + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._depth); + _userInput._sendDepth = true; return PARSE_OK; } else if (name == PCIE_INDEX_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._pcieIndex); - _mlxlinkCommander->_userInput._sendPcieIndex = true; + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._pcieIndex); + _userInput._sendPcieIndex = true; return PARSE_OK; } else if (name == NODE_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._node); - _mlxlinkCommander->_userInput._sendNode = true; + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._node); + _userInput._sendNode = true; return PARSE_OK; } else if (name == PCIE_LINKS_FLAG) { addCmd(SHOW_PCIE_LINKS); - _mlxlinkCommander->_userInput._links = true; + _userInput._links = true; return PARSE_OK; } else if (name == DEVICE_DATA_FLAG) @@ -1173,107 +1313,106 @@ ParseStatus MlxlinkUi::HandleOption(string name, string value) else if (name == FEC_DATA_FLAG) { addCmd(SHOW_FEC); - _mlxlinkCommander->_networkCmds++; + _userInput._networkCmds++; return PARSE_OK; } else if (name == PAOS_FLAG) { addCmd(SEND_PAOS); - _mlxlinkCommander->_userInput._paosCmd = toUpperCase(value); - _mlxlinkCommander->_uniqueCmds++; + _userInput._paosCmd = toUpperCase(value); + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PTYS_FLAG) { addCmd(SEND_PTYS); - _mlxlinkCommander->_ptysSpeeds = _mlxlinkCommander->parseParamsFromLine(toUpperCase(value)); - _mlxlinkCommander->_uniqueCmds++; + _userInput._ptysSpeeds = parseParamsFromLine(toUpperCase(value)); + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PPLM_FLAG) { addCmd(SEND_PPLM); - _mlxlinkCommander->_userInput._pplmFec = toUpperCase(value); - _mlxlinkCommander->_uniqueCmds++; + _userInput._pplmFec = toUpperCase(value); + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == FEC_SPEED_FLAG) { - _mlxlinkCommander->_userInput._speedFec = toLowerCase(value); + _userInput._speedFec = toLowerCase(value); return PARSE_OK; } else if (name == PPLR_FLAG) { addCmd(SEND_PPLR); - _mlxlinkCommander->_userInput._pplrLB = toUpperCase(value); - _mlxlinkCommander->_uniqueCmds++; + _userInput._pplrLB = toUpperCase(value); + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PRBS_MODE_FLAG) { addCmd(SEND_PRBS); - _mlxlinkCommander->_userInput._prbsMode = toUpperCase(value); - _mlxlinkCommander->_uniqueCmds++; + _userInput._prbsMode = toUpperCase(value); + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PPRT_PRBS_FLAG) { - _mlxlinkCommander->_userInput._sendPprt = true; - _mlxlinkCommander->_userInput._pprtMode = toUpperCase(value); + _userInput._sendPprt = true; + _userInput._pprtMode = toUpperCase(value); return PARSE_OK; } else if (name == PPTT_PRBS_FLAG) { - _mlxlinkCommander->_userInput._sendPptt = true; - _mlxlinkCommander->_userInput._ppttMode = toUpperCase(value); + _userInput._sendPptt = true; + _userInput._ppttMode = toUpperCase(value); return PARSE_OK; } else if (name == PPRT_RATE_FLAG) { - _mlxlinkCommander->_userInput._pprtRate = toUpperCase(value); + _userInput._pprtRate = toUpperCase(value); return PARSE_OK; } else if (name == PPTT_RATE_FLAG) { - _mlxlinkCommander->_userInput._ppttRate = toUpperCase(value); + _userInput._ppttRate = toUpperCase(value); return PARSE_OK; } else if (name == PRBS_LANES_FLAG) { - std::vector prbsLanesParams = _mlxlinkCommander->parseParamsFromLine(value); - _mlxlinkCommander->getprbsLanesFromParams(prbsLanesParams); + _userInput._prbsLanesToSet = getprbsLanesFromParams(value); return PARSE_OK; } else if (name == PRBS_INVERT_TX_POL_FLAG) { - _mlxlinkCommander->_userInput._prbsTxInv = true; + _userInput._prbsTxInv = true; return PARSE_OK; } else if (name == PRBS_INVERT_RX_POL_FLAG) { - _mlxlinkCommander->_userInput._prbsRxInv = true; + _userInput._prbsRxInv = true; return PARSE_OK; } else if (name == BER_COLLECT_FLAG) { addCmd(SEND_BER_COLLECT); - _mlxlinkCommander->_userInput._csvBer = value; + _userInput._csvBer = value; return PARSE_OK; } else if (name == AMBER_COLLECT_FLAG) { addCmd(SEND_AMBER_COLLECT); - _mlxlinkCommander->_userInput._csvBer = value; + _userInput._csvBer = value; return PARSE_OK; } else if (name == BER_LIMIT_FLAG) { - _mlxlinkCommander->_userInput._testMode = toUpperCase(value); + _userInput._testMode = toUpperCase(value); return PARSE_OK; } else if (name == ITERATION_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), _mlxlinkCommander->_userInput._iteration); + RegAccessParser::strToUint32((char*)value.c_str(), _userInput._iteration); return PARSE_OK; } else if (name == BER_MONITOR_INFO_FLAG) @@ -1288,310 +1427,308 @@ ParseStatus MlxlinkUi::HandleOption(string name, string value) } else if (name == PEPC_FORCE_MODE_FLAG) { - _mlxlinkCommander->_userInput._sendPepcForceMode = true; - _mlxlinkCommander->_userInput._forceMode = toUpperCase(value); + _userInput._sendPepcForceMode = true; + _userInput._forceMode = toUpperCase(value); return PARSE_OK; } else if (name == PEPC_AN_MODE_FLAG) { - _mlxlinkCommander->_userInput._sendPepcANMode = true; - _mlxlinkCommander->_userInput._anMode = toUpperCase(value); + _userInput._sendPepcANMode = true; + _userInput._anMode = toUpperCase(value); return PARSE_OK; } else if (name == PEPC_SET_FLAG) { addCmd(SEND_PEPC); - _mlxlinkCommander->_uniqueCmds++; + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PTYS_LINK_MODE_FORCE_FLAG) { - _mlxlinkCommander->_linkModeForce = true; + _userInput._linkModeForce = true; return PARSE_OK; } else if (name == CABLE_FLAG) { - _mlxlinkCommander->_userInput._cable = true; + _userInput._cable = true; return PARSE_OK; } else if (name == CABLE_DUMP_FLAG) { - _mlxlinkCommander->_userInput._dump = true; + _userInput._dump = true; addCmd(CABLE_SHOW_DUMP); - _mlxlinkCommander->_uniqueCableCmds++; + _userInput._uniqueCableCmds++; return PARSE_OK; } else if (name == CABLE_DDM_FLAG) { - _mlxlinkCommander->_userInput._ddm = true; + _userInput._ddm = true; addCmd(CABLE_SHOW_DDM); - _mlxlinkCommander->_uniqueCableCmds++; + _userInput._uniqueCableCmds++; return PARSE_OK; } else if (name == CABLE_WRITE_FLAG) { - _mlxlinkCommander->_userInput._write = true; - _mlxlinkCommander->_userInput._bytesToWrite = _mlxlinkCommander->parseParamsFromLine(value); + _userInput._write = true; + _userInput._bytesToWrite = parseParamsFromLine(value); addCmd(CABLE_EEPROM_WRITE); - _mlxlinkCommander->_uniqueCableCmds++; + _userInput._uniqueCableCmds++; return PARSE_OK; } else if (name == WRITE_PAGE_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._page); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._page); return PARSE_OK; } else if (name == WRITE_OFFSET_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._offset); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._offset); return PARSE_OK; } else if (name == CABLE_READ_FLAG) { - _mlxlinkCommander->_userInput._read = true; - _mlxlinkCommander->_uniqueCableCmds++; + _userInput._read = true; + _userInput._uniqueCableCmds++; addCmd(CABLE_EEPROM_READ); return PARSE_OK; } else if (name == READ_LEN_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._len); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._len); return PARSE_OK; } else if (name == SHOW_TX_GROUP_MAP_FLAG) { addCmd(SHOW_TX_GROUP_MAP); - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._showGroup); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._showGroup); return PARSE_OK; } else if (name == SET_TX_GROUP_MAP_FLAG) { addCmd(SET_TX_GROUP_MAP); - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._setGroup); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._setGroup); return PARSE_OK; } else if (name == TX_GROUP_PORTS_FLAG) { - _mlxlinkCommander->_userInput._labelPorts = _mlxlinkCommander->parseParamsFromLine(value); + _userInput._labelPorts = parseParamsFromLine(value); return PARSE_OK; } else if (name == MARGIN_SCAN_FLAG) { addCmd(GRADE_SCAN_ENABLE); - _mlxlinkCommander->_uniquePcieCmds++; + _userInput._uniquePcieCmds++; return PARSE_OK; } else if (name == EYE_MEASURE_TIME_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput.measureTime); + checkStrLength(value); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput.measureTime); return PARSE_OK; } else if (name == FORCE_YES_FLAG) { - _mlxlinkCommander->_userInput.force = true; + _userInput.force = true; return PARSE_OK; } else if (name == LANE_INDEX_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput._lane); - _mlxlinkCommander->_userInput.gradeScanPerLane = true; + checkStrLength(value); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput._lane); + _userInput.gradeScanPerLane = true; return PARSE_OK; } else if (name == EYE_SEL_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.eyeSelect = toUpperCase(value); - _mlxlinkCommander->_userInput.eyeSelectSpecified = true; + checkStrLength(value); + _userInput.eyeSelect = toUpperCase(value); + _userInput.eyeSelectSpecified = true; return PARSE_OK; } else if (name == PREI_RX_ERR_INJ_FLAG) { addCmd(ERR_INJ_ENABLE); - _mlxlinkCommander->_userInput.enableRxErrInj = true; - _mlxlinkCommander->_uniqueCmds++; + _userInput.enableRxErrInj = true; + _userInput._uniqueCmds++; return PARSE_OK; } else if (name == PREI_MIXER_OFFSET_0) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput.mixerOffset0); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput.mixerOffset0); return PARSE_OK; } else if (name == PREI_MIXER_OFFSET_1) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput.mixerOffset1); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput.mixerOffset1); return PARSE_OK; } else if (name == PREI_SHOW_MIXERS_FLAG) { - _mlxlinkCommander->_userInput.showMixers = true; + _userInput.showMixers = true; return PARSE_OK; } else if (name == PPHCR_FEC_HIST_FLAG) { addCmd(RS_FEC_HISTOGRAM); - _mlxlinkCommander->_userInput.enableFecHistogram = true; + _userInput.enableFecHistogram = true; return PARSE_OK; } else if (name == PPHCR_SHOW_FEC_HIST_FLAG) { - _mlxlinkCommander->_userInput.showFecHistogram = true; + _userInput.showFecHistogram = true; return PARSE_OK; } else if (name == PPHCR_CLEAR_HISTOGRAM_FLAG) { - _mlxlinkCommander->_userInput.clearFecHistogram = true; + _userInput.clearFecHistogram = true; return PARSE_OK; } else if (name == CABLE_PRBS_SELECT) { addCmd(CABLE_PRBS_CMDS); - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_SELECT] = toUpperCase(value); - _mlxlinkCommander->_userInput.isPrbsSelProvided = true; - _mlxlinkCommander->_uniqueCableCmds++; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_SELECT] = toUpperCase(value); + _userInput.isPrbsSelProvided = true; + _userInput._uniqueCableCmds++; return PARSE_OK; } else if (name == CABLE_PRBS_MODE) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_MODE] = toUpperCase(value); - _mlxlinkCommander->_userInput.isPrbsModeProvided = true; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_MODE] = toUpperCase(value); + _userInput.isPrbsModeProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_GEN_PAT) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_GEN_PAT] = toUpperCase(value); - _mlxlinkCommander->_userInput.isPrbsGenProvided = true; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_GEN_PAT] = toUpperCase(value); + _userInput.isPrbsGenProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_GEN_SWAP) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_GEN_SWAP] = "SWAP"; - _mlxlinkCommander->_userInput.isPrbsGenProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_GEN_SWAP] = "SWAP"; + _userInput.isPrbsGenProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_GEN_INV) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_GEN_INV] = "INV"; - _mlxlinkCommander->_userInput.isPrbsGenProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_GEN_INV] = "INV"; + _userInput.isPrbsGenProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_GEN_LANES) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_GEN_LANES] = value; - _mlxlinkCommander->_userInput.isPrbsGenProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_GEN_LANES] = value; + _userInput.isPrbsGenProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_CH_PAT) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_CH_PAT] = toUpperCase(value); - _mlxlinkCommander->_userInput.isPrbsChProvided = true; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_CH_PAT] = toUpperCase(value); + _userInput.isPrbsChProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_CH_SWAP) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_CH_SWAP] = "SWAP"; - _mlxlinkCommander->_userInput.isPrbsChProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_CH_SWAP] = "SWAP"; + _userInput.isPrbsChProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_CH_INV) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_CH_INV] = "INV"; - _mlxlinkCommander->_userInput.isPrbsChProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_CH_INV] = "INV"; + _userInput.isPrbsChProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_CH_LANES) { - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_CH_LANES] = value; - _mlxlinkCommander->_userInput.isPrbsChProvided = true; + _userInput.modulePrbsParams[MODULE_PRBS_CH_LANES] = value; + _userInput.isPrbsChProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_LANE_RATE) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_RATE] = toUpperCase(value); + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_RATE] = toUpperCase(value); return PARSE_OK; } else if (name == CABLE_PRBS_SHOW_DIAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_SHOW_DIAG] = value; - _mlxlinkCommander->_userInput.isPrbsShowDiagProvided = true; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_SHOW_DIAG] = value; + _userInput.isPrbsShowDiagProvided = true; return PARSE_OK; } else if (name == CABLE_PRBS_CLEAR_DIAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.modulePrbsParams[MODULE_PRBS_CLEAR_DIAG] = value; - _mlxlinkCommander->_userInput.isPrbsClearDiagProvided = true; + checkStrLength(value); + _userInput.modulePrbsParams[MODULE_PRBS_CLEAR_DIAG] = value; + _userInput.isPrbsClearDiagProvided = true; return PARSE_OK; } else if (name == CTRL_PARAM_FLAG) { addCmd(CABLE_CTRL_PARM); - _mlxlinkCommander->_userInput.isModuleConfigParamsProvided = true; + _userInput.isModuleConfigParamsProvided = true; return PARSE_OK; } else if (name == CTRL_PARAM_TX_EQ_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_TX_EQ, value)); + checkStrLength(value); + _userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_TX_EQ, value)); return PARSE_OK; } else if (name == CTRL_PARAM_RX_EMPH_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.configParamsToSet.push_back( - make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_EMPH, value)); + checkStrLength(value); + _userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_EMPH, value)); return PARSE_OK; } else if (name == CTRL_PARAM_RX_POST_EMPH_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.configParamsToSet.push_back( - make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_POST_EMPH, value)); + checkStrLength(value); + _userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_POST_EMPH, value)); return PARSE_OK; } else if (name == CTRL_PARAM_RX_AMP_FLAG) { - _mlxlinkCommander->checkStrLength(value); - _mlxlinkCommander->_userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_AMP, value)); + checkStrLength(value); + _userInput.configParamsToSet.push_back(make_pair(CABLE_CONTROL_PARAMETERS_SET_RX_AMP, value)); return PARSE_OK; } else if (name == MPEINJ_PCIE_ERR_INJ_FLAG) { addCmd(PCIE_ERROR_INJ); - _mlxlinkCommander->_userInput.isPcieErrInjProvided = true; - _mlxlinkCommander->_uniquePcieCmds++; + _userInput.isPcieErrInjProvided = true; + _userInput._uniquePcieCmds++; return PARSE_OK; } else if (name == MPEINJ_ERR_TYPE_FLAG) { - _mlxlinkCommander->_userInput.errorType = toUpperCase(value); + _userInput.errorType = toUpperCase(value); return PARSE_OK; } else if (name == MPEINJ_ERR_DURATION_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput.errorDuration); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput.errorDuration); return PARSE_OK; } else if (name == MPEINJ_INJ_DELAY_FLAG) { - _mlxlinkCommander->strToUint32((char*)value.c_str(), (u_int32_t&)_mlxlinkCommander->_userInput.injDelay); + RegAccessParser::strToUint32((char*)value.c_str(), (u_int32_t&)_userInput.injDelay); return PARSE_OK; } else if (name == MPEINJ_ERR_PARAMETERS_FLAG) { - _mlxlinkCommander->_userInput.parameters = _mlxlinkCommander->parseParamsFromLine(value); + _userInput.parameters = parseParamsFromLine(value); return PARSE_OK; } else if (name == MPEINJ_DBDF_FLAG) { - _mlxlinkCommander->_userInput.dbdf = value; + _userInput.dbdf = value; return PARSE_OK; } return PARSE_ERROR; @@ -1600,8 +1737,9 @@ ParseStatus MlxlinkUi::HandleOption(string name, string value) int MlxlinkUi::run(int argc, char** argv) { int exit_code = 0; - createMlxlinkCommander(); + initCmdParser(); + ParseStatus rc = _cmdParser.ParseOptions(argc, argv); if (rc == PARSE_OK_WITH_EXIT) @@ -1615,48 +1753,19 @@ int MlxlinkUi::run(int argc, char** argv) paramValidate(); - _mlxlinkCommander->_mf = mopen(_mlxlinkCommander->_device.c_str()); + _mf = mopen(_userInput._device.c_str()); - if (!_mlxlinkCommander->_mf) + if (!_mf) { - throw MlxRegException("Failed to open device: \"" + _mlxlinkCommander->_device + "\", " + strerror(errno)); + throw MlxRegException("Failed to open device: \"" + _userInput._device + "\", " + strerror(errno)); } - if (!MlxRegLib::isDeviceSupported(_mlxlinkCommander->_mf)) + if (!MlxRegLib::isDeviceSupported(_mf)) { + mclose(_mf); throw MlxRegException("Device is not supported"); } - MlxRegLib::isAccessRegisterSupported(_mlxlinkCommander->_mf); - _mlxlinkCommander->_regLib = - new MlxRegLib(_mlxlinkCommander->_mf, _mlxlinkCommander->_extAdbFile, _mlxlinkCommander->_useExtAdb); - if (_mlxlinkCommander->_regLib->isIBDevice() && - !_mlxlinkCommander->_regLib->isAccessRegisterGMPSupported(MACCESS_REG_METHOD_GET)) - { - MlxlinkRecord::printWar("Warning: AccessRegisterGMP Get() method is not supported.\n" - " mlxlink has limited functionality", - _mlxlinkCommander->_jsonRoot); - } - - _mlxlinkCommander->_gvmiAddress = _mlxlinkCommander->_userInput._gvmiAddress; - _mlxlinkCommander->_devID = _mlxlinkCommander->_regLib->getDevId(); - _mlxlinkCommander->_isHCA = dm_dev_is_hca(_mlxlinkCommander->_devID); - _mlxlinkCommander->labelToLocalPort(); - _mlxlinkCommander->validatePortType(_mlxlinkCommander->_userInput._portType); - if (!_mlxlinkCommander->_userInput._pcie) - { - _mlxlinkCommander->checkValidFW(); - } - _mlxlinkCommander->getProductTechnology(); - - if (!_mlxlinkCommander->_userInput._pcie) - { - _mlxlinkCommander->_prbsTestMode = _mlxlinkCommander->inPrbsTestMode(); - _mlxlinkCommander->getCableParams(); - } - else if (!_mlxlinkCommander->_userInput._sendDpn) - { - _mlxlinkCommander->initValidDPNList(); - } + initMlxlinkCommander(); commandsCaller(); diff --git a/mlxlink/modules/mlxlink_ui.h b/mlxlink/modules/mlxlink_ui.h index 925771d2..e1b4eec0 100644 --- a/mlxlink/modules/mlxlink_ui.h +++ b/mlxlink/modules/mlxlink_ui.h @@ -47,7 +47,7 @@ class MlxlinkUi : public CommandLineRequester protected: virtual void addCmd(OPTION_TYPE option); - virtual ParseStatus HandleOption(string name, string value); + ParseStatus HandleOption(string name, string value); virtual void printSynopsisHeader(); virtual void printSynopsisQueries(); virtual void printSynopsisCommands(); @@ -68,9 +68,22 @@ class MlxlinkUi : public CommandLineRequester virtual void validatePortInfoParams(); virtual void paramValidate(); virtual void createMlxlinkCommander(); + virtual void initRegAccessLib(); + virtual void initPortInfo(); + virtual void initMlxlinkCommander(); + + void handlePortStr(UserInput& userInput, const string& portStr); + void strToInt32(char* str, u_int32_t& value); + std::vector parseParamsFromLine(const string& paramsLine); + std::map getSltpParamsFromVector(const string& paramsLine); + std::map getprbsLanesFromParams(const string& paramsLine); + void checkStrLength(const string& str); CommandLineParser _cmdParser; std::vector _sendRegFuncMap; MlxlinkCommander* _mlxlinkCommander; + UserInput _userInput; + + mfile* _mf; }; #endif /* MLXLINK_UI_H */ diff --git a/mlxlink/modules/mlxlink_user_input.cpp b/mlxlink/modules/mlxlink_user_input.cpp index a1fd35b0..ca125e3c 100644 --- a/mlxlink/modules/mlxlink_user_input.cpp +++ b/mlxlink/modules/mlxlink_user_input.cpp @@ -46,6 +46,11 @@ UserInput::UserInput() _pcieIndex = 0; _node = 0; _lane = 0; + _networkCmds = 0; + _uniqueCmds = 0; + _networkCmds = 0; + _uniqueCableCmds = 0; + _uniquePcieCmds = 0; _sendPrbs = false; _sendPprt = false; _sendPptt = false; @@ -56,6 +61,7 @@ UserInput::UserInput() _sendPepcANMode = false; _pprtTuningTypeFlag = false; _toggle = true; + _linkModeForce = false; _pcie = false; _links = false; _showSltp = false; @@ -78,6 +84,10 @@ UserInput::UserInput() _ddm = false; _write = false; _read = false; + + _device = ""; + _extAdbFile = ""; + _logFile = ""; _portType = "NETWORK"; _paosCmd = ""; _pplmFec = ""; @@ -103,7 +113,9 @@ UserInput::UserInput() _len = -1; _setGroup = -1; _showGroup = -1; + _slrgTestIterations = -1; + autoCsvName = false; eyeSelect = ""; eyeSelectSpecified = false; measureTime = -1; @@ -134,4 +146,6 @@ UserInput::UserInput() errorDuration = -1; injDelay = -1; dbdf = ""; + + planeIndex = -1; } diff --git a/mlxlink/modules/mlxlink_user_input.h b/mlxlink/modules/mlxlink_user_input.h index 7dd7e637..85e8f768 100644 --- a/mlxlink/modules/mlxlink_user_input.h +++ b/mlxlink/modules/mlxlink_user_input.h @@ -55,6 +55,10 @@ class UserInput u_int32_t _depth; u_int32_t _pcieIndex; u_int32_t _node; + u_int32_t _uniqueCmds; + u_int32_t _uniqueCableCmds; + u_int32_t _uniquePcieCmds; + u_int32_t _networkCmds; bool _sendPrbs; bool _sendPprt; bool _sendPptt; @@ -65,6 +69,7 @@ class UserInput bool _sendPepcANMode; bool _pprtTuningTypeFlag; bool _toggle; + bool _linkModeForce; bool _pcie; bool _links; bool _sendDepth; @@ -88,7 +93,10 @@ class UserInput bool _write; bool _read; bool gradeScanPerLane; + bool autoCsvName; + string _device; + string _extAdbFile; string _portType; string _paosCmd; string _pplmFec; @@ -104,11 +112,14 @@ class UserInput string _testMode; string _forceMode; string _anMode; - u_int32_t _iteration; + string _logFile; double _testTime; u_int32_t _feedbackIndex; u_int32_t _feedbackData; + u_int32_t _iteration; std::map _sltpParams; + std::vector _ptysSpeeds; + std::vector _amberPagesStr; u_int32_t _lane; u_int32_t _gvmiAddress; vector _bytesToWrite; @@ -118,6 +129,7 @@ class UserInput std::map _prbsLanesToSet; int _setGroup; int _showGroup; + int _slrgTestIterations; vector _labelPorts; string eyeSelect; @@ -152,6 +164,8 @@ class UserInput int injDelay; string dbdf; vector parameters; + + int planeIndex; }; #endif /* MLXLINK_USER_INPUT_H */ diff --git a/mlxlink/modules/mlxlink_utils.cpp b/mlxlink/modules/mlxlink_utils.cpp index 1124c8f1..4419ad87 100644 --- a/mlxlink/modules/mlxlink_utils.cpp +++ b/mlxlink/modules/mlxlink_utils.cpp @@ -1348,95 +1348,42 @@ void setPrintTitle(MlxlinkCmdPrint& mlxlinkCmdPrint, string title, u_int32_t siz bool isSpeed25GPerLane(u_int32_t speed, u_int32_t protocol) { - bool valid = false; - if (protocol == IB) { - if (speed == IB_LINK_SPEED_EDR) - { - valid = true; - } - } - else if (protocol == ETH) - { - if (speed == ETH_LINK_SPEED_100G_CR4 || speed == ETH_LINK_SPEED_100G_KR4 || speed == ETH_LINK_SPEED_100G_LR4 || - speed == ETH_LINK_SPEED_100G_SR4 || speed == ETH_LINK_SPEED_50G_KR2 || speed == ETH_LINK_SPEED_50G_SR2 || - speed == ETH_LINK_SPEED_50G_CR2 || speed == ETH_LINK_SPEED_25G_CR || speed == ETH_LINK_SPEED_25G_KR || - speed == ETH_LINK_SPEED_25G_SR || speed == ETH_LINK_SPEED_50G_KR4) - { - valid = true; - } + return speed & IB_LINK_SPEED_EDR; } - - return valid; + return (speed & ETH_LINK_SPEED_25G_LANE); } bool isSpeed50GPerLane(u_int32_t speed, u_int32_t protocol) { - bool valid = false; - if (protocol == IB) { - if (speed == IB_LINK_SPEED_HDR) - { - valid = true; - } - } - else if (protocol == ETH) - { - if (speed == ETH_LINK_SPEED_EXT_50GAUI_1 || speed == ETH_LINK_SPEED_EXT_100GAUI_2 || - speed == ETH_LINK_SPEED_EXT_200GAUI_4 || speed == ETH_LINK_SPEED_EXT_400GAUI_8) - { - valid = true; - } + return speed & IB_LINK_SPEED_HDR; } - - return valid; + return (speed & ETH_LINK_SPEED_50G_LANE); } bool isSpeed100GPerLane(u_int32_t speed, u_int32_t protocol) { - bool valid = false; - if (protocol == IB) { - if (speed == IB_LINK_SPEED_NDR) - { - valid = true; - } - } - else if (protocol == ETH) - { - if (speed == ETH_LINK_SPEED_EXT_100GAUI_1 || speed == ETH_LINK_SPEED_EXT_200GAUI_2 || - speed == ETH_LINK_SPEED_EXT_400GAUI_4 || speed == ETH_LINK_SPEED_EXT_800GAUI_8) - { - valid = true; - } + return speed & IB_LINK_SPEED_NDR; } - - return valid; + return (speed & ETH_LINK_SPEED_100G_LANE); } bool isSpeed200GPerLane(u_int32_t speed, u_int32_t protocol) { - bool valid = false; - - if (protocol == IB) - { - if (speed == IB_LINK_SPEED_XDR) - { - valid = true; - } - } - - return valid; + (void)protocol; + return (speed & LINK_SPEED_200G_LANE); } bool isNRZSpeed(u_int32_t speed, u_int32_t protocol) { return isSpeed25GPerLane(speed, protocol) || !(isSpeed50GPerLane(speed, protocol) || isSpeed100GPerLane(speed, protocol) || - isSpeed100GPerLane(speed, protocol)); + isSpeed200GPerLane(speed, protocol)); } string linkWidthMaskToStr(u_int32_t width) diff --git a/mlxsign_lib/Makefile.am b/mlxsign_lib/Makefile.am index b0c7e652..d35e786e 100644 --- a/mlxsign_lib/Makefile.am +++ b/mlxsign_lib/Makefile.am @@ -37,6 +37,7 @@ AM_CPPFLAGS = \ AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe $(COMPILER_FPIC) AM_CXXFLAGS += -DTOOLS_CRYPTO_KEY='$(TOOLS_CRYPTO_KEY)' -DTOOLS_CRYPTO_IV='$(TOOLS_CRYPTO_IV)' +AM_CXXFLAGS += -Wno-deprecated-declarations noinst_LTLIBRARIES = libmlxsign.la libmlxsign_la_SOURCES = mlxsign_lib.cpp mlxsign_lib.h mlxsign_com_def.h \ diff --git a/mstdump/mstdump_dbs/Spectrum2.csv b/mstdump/mstdump_dbs/Spectrum2.csv index f46371ab..0fffa840 100644 --- a/mstdump/mstdump_dbs/Spectrum2.csv +++ b/mstdump/mstdump_dbs/Spectrum2.csv @@ -504,17 +504,15 @@ 0x042f04,16, 0x050000,12, 0x050040,524, -0x050880,268, -0x050cc0,2572, -0x053500,524, -0x053d40,524, -0x054580,270, -0x0549c0,12, -0x054a00,270, -0x054e40,12, -0x054e80,3084, -0x057ec0,3340, -0x05b300,302, +0x050880,3072, +0x054540,12, +0x054580,3084, +0x0575c0,270, +0x057a00,12, +0x057a40,3084, +0x05aa80,3072, +0x05dec0,144, +0x05e178,256, 0x060000,32, 0x060200,64, 0x060400,96, @@ -1823,7 +1821,7 @@ 0x0f0b90,2, 0x0f0ba0,3, 0x0f0bc0,9, -0x0f0c00,4, +0x0f0c00,5, 0x0f0c20,3, 0x0f0c30,3, 0x0f0c50,58, @@ -14778,6 +14776,7 @@ 0x3bc240,1, 0x3bc248,1, 0x3bc400,4, +0x3c0000,16384, 0x400000,11, 0x400040,9, 0x400080,32, diff --git a/mstdump/mstdump_dbs/Spectrum3.csv b/mstdump/mstdump_dbs/Spectrum3.csv index 56af726a..29d6a2b6 100755 --- a/mstdump/mstdump_dbs/Spectrum3.csv +++ b/mstdump/mstdump_dbs/Spectrum3.csv @@ -569,17 +569,15 @@ 0x0318c0,2, 0x050000,12, 0x050040,524, -0x050880,268, -0x050cc0,2572, -0x053500,524, -0x053d40,524, -0x054580,270, -0x0549c0,12, -0x054a00,270, -0x054e40,12, -0x054e80,3084, -0x057ec0,3340, -0x05b300,302, +0x050880,3072, +0x054540,12, +0x054580,3084, +0x0575c0,270, +0x057a00,12, +0x057a40,3084, +0x05aa80,3072, +0x05dec0,144, +0x05e178,256, 0x060000,32, 0x060200,64, 0x060400,96, @@ -2812,7 +2810,7 @@ 0x0f0b90,2, 0x0f0ba0,5, 0x0f0bc0,9, -0x0f0c00,5, +0x0f0c00,6, 0x0f0c20,3, 0x0f0c30,5, 0x0f0c50,62, @@ -19436,6 +19434,7 @@ 0x57d240,1, 0x57d248,1, 0x57d400,4, +0x580000,16384, 0x600000,11, 0x600040,9, 0x600080,32, @@ -49621,128 +49620,111 @@ 0x2080e00,2, 0x2080e20,2, 0x2090000,3, -0x209001c,4, +0x209001c,6, 0x2090080,3, 0x2090090,2, 0x20900d4,4, 0x20900ec,27, 0x209015c,27, 0x20901cc,19, -0x2090224,120, -0x2090408,24, -0x209046c,84, +0x2090224,124, +0x209041c,104, 0x20905f8,4, 0x2090610,27, 0x2090680,27, 0x20906f0,19, -0x2090748,120, -0x209092c,24, -0x2090990,84, +0x2090748,124, +0x2090940,104, 0x2090b1c,4, 0x2090b34,27, 0x2090ba4,27, 0x2090c14,19, -0x2090c6c,120, -0x2090e50,24, -0x2090eb4,84, +0x2090c6c,124, +0x2090e64,104, 0x2091040,4, 0x2091058,27, 0x20910c8,27, 0x2091138,19, -0x2091190,120, -0x2091374,24, -0x20913d8,84, +0x2091190,124, +0x2091388,104, 0x2091564,4, 0x209157c,27, 0x20915ec,27, 0x209165c,19, -0x20916b4,120, -0x2091898,24, -0x20918fc,84, +0x20916b4,124, +0x20918ac,104, 0x2091a88,4, 0x2091aa0,27, 0x2091b10,27, 0x2091b80,19, -0x2091bd8,120, -0x2091dbc,24, -0x2091e20,84, +0x2091bd8,124, +0x2091dd0,104, 0x2091fac,4, 0x2091fc4,27, 0x2092034,27, 0x20920a4,19, -0x20920fc,120, -0x20922e0,24, -0x2092344,84, +0x20920fc,124, +0x20922f4,104, 0x20924d0,4, 0x20924e8,27, 0x2092558,27, 0x20925c8,19, -0x2092620,120, -0x2092804,24, -0x2092868,84, +0x2092620,124, +0x2092818,104, 0x20929f4,4, 0x2092a0c,27, 0x2092a7c,27, 0x2092aec,19, -0x2092b44,120, -0x2092d28,24, -0x2092d8c,84, +0x2092b44,124, +0x2092d3c,104, 0x2092f18,4, 0x2092f30,27, 0x2092fa0,27, 0x2093010,19, -0x2093068,120, -0x209324c,24, -0x20932b0,84, +0x2093068,124, +0x2093260,104, 0x209343c,4, 0x2093454,27, 0x20934c4,27, 0x2093534,19, -0x209358c,120, -0x2093770,24, -0x20937d4,84, +0x209358c,124, +0x2093784,104, 0x2093960,4, 0x2093978,27, 0x20939e8,27, 0x2093a58,19, -0x2093ab0,120, -0x2093c94,24, -0x2093cf8,84, +0x2093ab0,124, +0x2093ca8,104, 0x2093e84,4, 0x2093e9c,27, 0x2093f0c,27, 0x2093f7c,19, -0x2093fd4,120, -0x20941b8,24, -0x209421c,84, +0x2093fd4,124, +0x20941cc,104, 0x20943a8,4, 0x20943c0,27, 0x2094430,27, 0x20944a0,19, -0x20944f8,120, -0x20946dc,24, -0x2094740,84, +0x20944f8,124, +0x20946f0,104, 0x20948cc,4, 0x20948e4,27, 0x2094954,27, 0x20949c4,19, -0x2094a1c,120, -0x2094c00,24, -0x2094c64,84, +0x2094a1c,124, +0x2094c14,104, 0x2094df0,4, 0x2094e08,27, 0x2094e78,27, 0x2094ee8,19, -0x2094f40,120, -0x2095124,24, -0x2095188,84, +0x2094f40,124, +0x2095138,104, 0x2095314,4, 0x209532c,27, 0x209539c,27, 0x209540c,19, -0x2095464,120, -0x2095648,24, -0x20956ac,84, +0x2095464,124, +0x209565c,104, 0x2095838,14, 0x2095940,13, 0x2095a44,13, @@ -49788,7 +49770,7 @@ 0x2097e30,4, 0x2097e54,45, 0x2097f58,9, -0x2097f88,3, +0x2097f88,4, 0x2097fa0,2, 0x2097fd8,14, 0x2098014,12, @@ -49891,49 +49873,32 @@ 0x20995e8,64, 0x2099748,5, 0x2099990,28, -0x2099a04,1, +0x2099a04,4, 0x2099a98,1, -0x2099be8,5, -0x2099c04,3, +0x2099be8,11, 0x2099c18,13, -0x2099c50,2, +0x2099c50,6, 0x209a000,15, -0x209a044,81, -0x209a18c,84, -0x209a2e0,84, -0x209a434,84, -0x209a588,84, -0x209a6dc,84, -0x209a830,84, -0x209a984,84, -0x209aad8,84, -0x209ac2c,84, -0x209ad80,84, -0x209aed4,84, -0x209b028,84, -0x209b17c,84, -0x209b2d0,84, -0x209b424,84, -0x209b578,84, -0x209b6cc,5, +0x209a044,1447, 0x209b760,4, -0x209b8e0,2414, -0x209dea4,80, +0x209b8e0,2416, +0x209dea4,88, 0x209e048,4, 0x209ebe0,1, 0x209ebf0,97, 0x209ed94,7, +0x209edb4,20, 0x209ee7c,1, 0x209eeac,9, 0x209eed4,5, 0x209eeec,11, -0x209ef2c,17, -0x209ef74,29, +0x209ef2c,3, +0x209ef58,37, 0x209f034,3, -0x209f044,1, +0x209f044,2, 0x209f054,17, 0x209fbe0,3, -0x209fbf0,2, +0x209fbf0,1, 0x20a0000,3, 0x20a0018,2, 0x20a0024,14, @@ -50153,71 +50118,57 @@ 0x20e01a4,2, 0x20e01b0,1, 0x20e01c0,57, -0x20e02b0,67, -0x20e03c0,16, -0x20e0410,23, -0x20e0470,16, -0x20e04c0,23, -0x20e0520,16, -0x20e0570,23, -0x20e05d0,16, -0x20e0620,23, -0x20e0680,16, -0x20e06d0,23, -0x20e0730,16, -0x20e0780,23, -0x20e07e0,16, -0x20e0830,23, -0x20e0890,16, -0x20e08e0,23, -0x20e0940,16, -0x20e0990,23, -0x20e09f0,16, -0x20e0a40,23, -0x20e0aa0,16, -0x20e0af0,23, -0x20e0b50,16, -0x20e0ba0,23, -0x20e0c00,16, -0x20e0c50,23, -0x20e0cb0,16, -0x20e0d00,23, -0x20e0d60,16, -0x20e0db0,23, -0x20e0e10,16, -0x20e0e60,23, -0x20e0ec0,16, -0x20e0f10,23, -0x20e0f70,16, -0x20e0fc0,23, -0x20e1020,16, -0x20e1070,23, -0x20e10d0,16, -0x20e1120,23, -0x20e1180,16, -0x20e11d0,23, -0x20e1230,16, -0x20e1280,23, -0x20e12e0,16, -0x20e1330,23, -0x20e1390,16, -0x20e13e0,23, -0x20e1440,16, -0x20e1490,23, -0x20e14f0,16, -0x20e1540,23, -0x20e15a0,16, -0x20e15f0,23, -0x20e1650,16, -0x20e16a0,23, -0x20e1700,16, -0x20e1750,23, -0x20e17b0,16, -0x20e1800,23, -0x20e1860,16, -0x20e18b0,23, -0x20e1910,16, -0x20e1960,2, +0x20e02b0,23, +0x20e0310,83, +0x20e0460,83, +0x20e05b0,83, +0x20e0700,83, +0x20e0850,83, +0x20e09a0,83, +0x20e0af0,83, +0x20e0c40,83, +0x20e0d90,83, +0x20e0ee0,83, +0x20e1030,83, +0x20e1180,83, +0x20e12d0,83, +0x20e1420,83, +0x20e1570,83, +0x20e16c0,83, +0x20e1810,83, +0x20e1960,83, +0x20e1ab0,83, +0x20e1c00,83, +0x20e1d50,83, +0x20e1ea0,83, +0x20e1ff0,83, +0x20e2140,83, +0x20e2290,83, +0x20e23e0,83, +0x20e2530,83, +0x20e2680,83, +0x20e27d0,83, +0x20e2920,83, +0x20e2a70,83, +0x20e2bc0,62, +0x20e2db4,3, +0x20e2df4,3, +0x20e2e34,3, +0x20e2e74,3, +0x20e2eb4,3, +0x20e2ef4,3, +0x20e2f34,3, +0x20e2f74,3, +0x20e2fb4,3, +0x20e2ff4,3, +0x20e3034,3, +0x20e3074,3, +0x20e30b4,3, +0x20e30f4,3, +0x20e3134,3, +0x20e3174,3, +0x20e31b4,3, +0x20e3500,102, 0x20f0000,4, 0x20f0014,2, 0x20f0020,8, @@ -50319,6 +50270,7 @@ 0x20fa11c,13, 0x20fa160,3, 0x20fa180,8, +0x2170000,12288, 0x2200004,5, 0x2200020,3, 0x2200030,3, @@ -53151,128 +53103,111 @@ 0x2280e00,2, 0x2280e20,2, 0x2290000,3, -0x229001c,4, +0x229001c,6, 0x2290080,3, 0x2290090,2, 0x22900d4,4, 0x22900ec,27, 0x229015c,27, 0x22901cc,19, -0x2290224,120, -0x2290408,24, -0x229046c,84, +0x2290224,124, +0x229041c,104, 0x22905f8,4, 0x2290610,27, 0x2290680,27, 0x22906f0,19, -0x2290748,120, -0x229092c,24, -0x2290990,84, +0x2290748,124, +0x2290940,104, 0x2290b1c,4, 0x2290b34,27, 0x2290ba4,27, 0x2290c14,19, -0x2290c6c,120, -0x2290e50,24, -0x2290eb4,84, +0x2290c6c,124, +0x2290e64,104, 0x2291040,4, 0x2291058,27, 0x22910c8,27, 0x2291138,19, -0x2291190,120, -0x2291374,24, -0x22913d8,84, +0x2291190,124, +0x2291388,104, 0x2291564,4, 0x229157c,27, 0x22915ec,27, 0x229165c,19, -0x22916b4,120, -0x2291898,24, -0x22918fc,84, +0x22916b4,124, +0x22918ac,104, 0x2291a88,4, 0x2291aa0,27, 0x2291b10,27, 0x2291b80,19, -0x2291bd8,120, -0x2291dbc,24, -0x2291e20,84, +0x2291bd8,124, +0x2291dd0,104, 0x2291fac,4, 0x2291fc4,27, 0x2292034,27, 0x22920a4,19, -0x22920fc,120, -0x22922e0,24, -0x2292344,84, +0x22920fc,124, +0x22922f4,104, 0x22924d0,4, 0x22924e8,27, 0x2292558,27, 0x22925c8,19, -0x2292620,120, -0x2292804,24, -0x2292868,84, +0x2292620,124, +0x2292818,104, 0x22929f4,4, 0x2292a0c,27, 0x2292a7c,27, 0x2292aec,19, -0x2292b44,120, -0x2292d28,24, -0x2292d8c,84, +0x2292b44,124, +0x2292d3c,104, 0x2292f18,4, 0x2292f30,27, 0x2292fa0,27, 0x2293010,19, -0x2293068,120, -0x229324c,24, -0x22932b0,84, +0x2293068,124, +0x2293260,104, 0x229343c,4, 0x2293454,27, 0x22934c4,27, 0x2293534,19, -0x229358c,120, -0x2293770,24, -0x22937d4,84, +0x229358c,124, +0x2293784,104, 0x2293960,4, 0x2293978,27, 0x22939e8,27, 0x2293a58,19, -0x2293ab0,120, -0x2293c94,24, -0x2293cf8,84, +0x2293ab0,124, +0x2293ca8,104, 0x2293e84,4, 0x2293e9c,27, 0x2293f0c,27, 0x2293f7c,19, -0x2293fd4,120, -0x22941b8,24, -0x229421c,84, +0x2293fd4,124, +0x22941cc,104, 0x22943a8,4, 0x22943c0,27, 0x2294430,27, 0x22944a0,19, -0x22944f8,120, -0x22946dc,24, -0x2294740,84, +0x22944f8,124, +0x22946f0,104, 0x22948cc,4, 0x22948e4,27, 0x2294954,27, 0x22949c4,19, -0x2294a1c,120, -0x2294c00,24, -0x2294c64,84, +0x2294a1c,124, +0x2294c14,104, 0x2294df0,4, 0x2294e08,27, 0x2294e78,27, 0x2294ee8,19, -0x2294f40,120, -0x2295124,24, -0x2295188,84, +0x2294f40,124, +0x2295138,104, 0x2295314,4, 0x229532c,27, 0x229539c,27, 0x229540c,19, -0x2295464,120, -0x2295648,24, -0x22956ac,84, +0x2295464,124, +0x229565c,104, 0x2295838,14, 0x2295940,13, 0x2295a44,13, @@ -53318,7 +53253,7 @@ 0x2297e30,4, 0x2297e54,45, 0x2297f58,9, -0x2297f88,3, +0x2297f88,4, 0x2297fa0,2, 0x2297fd8,14, 0x2298014,12, @@ -53421,49 +53356,32 @@ 0x22995e8,64, 0x2299748,5, 0x2299990,28, -0x2299a04,1, +0x2299a04,4, 0x2299a98,1, -0x2299be8,5, -0x2299c04,3, +0x2299be8,11, 0x2299c18,13, -0x2299c50,2, +0x2299c50,6, 0x229a000,15, -0x229a044,81, -0x229a18c,84, -0x229a2e0,84, -0x229a434,84, -0x229a588,84, -0x229a6dc,84, -0x229a830,84, -0x229a984,84, -0x229aad8,84, -0x229ac2c,84, -0x229ad80,84, -0x229aed4,84, -0x229b028,84, -0x229b17c,84, -0x229b2d0,84, -0x229b424,84, -0x229b578,84, -0x229b6cc,5, +0x229a044,1447, 0x229b760,4, -0x229b8e0,2414, -0x229dea4,80, +0x229b8e0,2416, +0x229dea4,88, 0x229e048,4, 0x229ebe0,1, 0x229ebf0,97, 0x229ed94,7, +0x229edb4,20, 0x229ee7c,1, 0x229eeac,9, 0x229eed4,5, 0x229eeec,11, -0x229ef2c,17, -0x229ef74,29, +0x229ef2c,3, +0x229ef58,37, 0x229f034,3, -0x229f044,1, +0x229f044,2, 0x229f054,17, 0x229fbe0,3, -0x229fbf0,2, +0x229fbf0,1, 0x22a0000,3, 0x22a0018,2, 0x22a0024,14, @@ -53683,71 +53601,57 @@ 0x22e01a4,2, 0x22e01b0,1, 0x22e01c0,57, -0x22e02b0,67, -0x22e03c0,16, -0x22e0410,23, -0x22e0470,16, -0x22e04c0,23, -0x22e0520,16, -0x22e0570,23, -0x22e05d0,16, -0x22e0620,23, -0x22e0680,16, -0x22e06d0,23, -0x22e0730,16, -0x22e0780,23, -0x22e07e0,16, -0x22e0830,23, -0x22e0890,16, -0x22e08e0,23, -0x22e0940,16, -0x22e0990,23, -0x22e09f0,16, -0x22e0a40,23, -0x22e0aa0,16, -0x22e0af0,23, -0x22e0b50,16, -0x22e0ba0,23, -0x22e0c00,16, -0x22e0c50,23, -0x22e0cb0,16, -0x22e0d00,23, -0x22e0d60,16, -0x22e0db0,23, -0x22e0e10,16, -0x22e0e60,23, -0x22e0ec0,16, -0x22e0f10,23, -0x22e0f70,16, -0x22e0fc0,23, -0x22e1020,16, -0x22e1070,23, -0x22e10d0,16, -0x22e1120,23, -0x22e1180,16, -0x22e11d0,23, -0x22e1230,16, -0x22e1280,23, -0x22e12e0,16, -0x22e1330,23, -0x22e1390,16, -0x22e13e0,23, -0x22e1440,16, -0x22e1490,23, -0x22e14f0,16, -0x22e1540,23, -0x22e15a0,16, -0x22e15f0,23, -0x22e1650,16, -0x22e16a0,23, -0x22e1700,16, -0x22e1750,23, -0x22e17b0,16, -0x22e1800,23, -0x22e1860,16, -0x22e18b0,23, -0x22e1910,16, -0x22e1960,2, +0x22e02b0,23, +0x22e0310,83, +0x22e0460,83, +0x22e05b0,83, +0x22e0700,83, +0x22e0850,83, +0x22e09a0,83, +0x22e0af0,83, +0x22e0c40,83, +0x22e0d90,83, +0x22e0ee0,83, +0x22e1030,83, +0x22e1180,83, +0x22e12d0,83, +0x22e1420,83, +0x22e1570,83, +0x22e16c0,83, +0x22e1810,83, +0x22e1960,83, +0x22e1ab0,83, +0x22e1c00,83, +0x22e1d50,83, +0x22e1ea0,83, +0x22e1ff0,83, +0x22e2140,83, +0x22e2290,83, +0x22e23e0,83, +0x22e2530,83, +0x22e2680,83, +0x22e27d0,83, +0x22e2920,83, +0x22e2a70,83, +0x22e2bc0,62, +0x22e2db4,3, +0x22e2df4,3, +0x22e2e34,3, +0x22e2e74,3, +0x22e2eb4,3, +0x22e2ef4,3, +0x22e2f34,3, +0x22e2f74,3, +0x22e2fb4,3, +0x22e2ff4,3, +0x22e3034,3, +0x22e3074,3, +0x22e30b4,3, +0x22e30f4,3, +0x22e3134,3, +0x22e3174,3, +0x22e31b4,3, +0x22e3500,102, 0x22f0000,4, 0x22f0014,2, 0x22f0020,8, @@ -53849,6 +53753,7 @@ 0x22fa11c,13, 0x22fa160,3, 0x22fa180,8, +0x2370000,12288, 0x2400004,5, 0x2400020,3, 0x2400030,3, @@ -56681,128 +56586,111 @@ 0x2480e00,2, 0x2480e20,2, 0x2490000,3, -0x249001c,4, +0x249001c,6, 0x2490080,3, 0x2490090,2, 0x24900d4,4, 0x24900ec,27, 0x249015c,27, 0x24901cc,19, -0x2490224,120, -0x2490408,24, -0x249046c,84, +0x2490224,124, +0x249041c,104, 0x24905f8,4, 0x2490610,27, 0x2490680,27, 0x24906f0,19, -0x2490748,120, -0x249092c,24, -0x2490990,84, +0x2490748,124, +0x2490940,104, 0x2490b1c,4, 0x2490b34,27, 0x2490ba4,27, 0x2490c14,19, -0x2490c6c,120, -0x2490e50,24, -0x2490eb4,84, +0x2490c6c,124, +0x2490e64,104, 0x2491040,4, 0x2491058,27, 0x24910c8,27, 0x2491138,19, -0x2491190,120, -0x2491374,24, -0x24913d8,84, +0x2491190,124, +0x2491388,104, 0x2491564,4, 0x249157c,27, 0x24915ec,27, 0x249165c,19, -0x24916b4,120, -0x2491898,24, -0x24918fc,84, +0x24916b4,124, +0x24918ac,104, 0x2491a88,4, 0x2491aa0,27, 0x2491b10,27, 0x2491b80,19, -0x2491bd8,120, -0x2491dbc,24, -0x2491e20,84, +0x2491bd8,124, +0x2491dd0,104, 0x2491fac,4, 0x2491fc4,27, 0x2492034,27, 0x24920a4,19, -0x24920fc,120, -0x24922e0,24, -0x2492344,84, +0x24920fc,124, +0x24922f4,104, 0x24924d0,4, 0x24924e8,27, 0x2492558,27, 0x24925c8,19, -0x2492620,120, -0x2492804,24, -0x2492868,84, +0x2492620,124, +0x2492818,104, 0x24929f4,4, 0x2492a0c,27, 0x2492a7c,27, 0x2492aec,19, -0x2492b44,120, -0x2492d28,24, -0x2492d8c,84, +0x2492b44,124, +0x2492d3c,104, 0x2492f18,4, 0x2492f30,27, 0x2492fa0,27, 0x2493010,19, -0x2493068,120, -0x249324c,24, -0x24932b0,84, +0x2493068,124, +0x2493260,104, 0x249343c,4, 0x2493454,27, 0x24934c4,27, 0x2493534,19, -0x249358c,120, -0x2493770,24, -0x24937d4,84, +0x249358c,124, +0x2493784,104, 0x2493960,4, 0x2493978,27, 0x24939e8,27, 0x2493a58,19, -0x2493ab0,120, -0x2493c94,24, -0x2493cf8,84, +0x2493ab0,124, +0x2493ca8,104, 0x2493e84,4, 0x2493e9c,27, 0x2493f0c,27, 0x2493f7c,19, -0x2493fd4,120, -0x24941b8,24, -0x249421c,84, +0x2493fd4,124, +0x24941cc,104, 0x24943a8,4, 0x24943c0,27, 0x2494430,27, 0x24944a0,19, -0x24944f8,120, -0x24946dc,24, -0x2494740,84, +0x24944f8,124, +0x24946f0,104, 0x24948cc,4, 0x24948e4,27, 0x2494954,27, 0x24949c4,19, -0x2494a1c,120, -0x2494c00,24, -0x2494c64,84, +0x2494a1c,124, +0x2494c14,104, 0x2494df0,4, 0x2494e08,27, 0x2494e78,27, 0x2494ee8,19, -0x2494f40,120, -0x2495124,24, -0x2495188,84, +0x2494f40,124, +0x2495138,104, 0x2495314,4, 0x249532c,27, 0x249539c,27, 0x249540c,19, -0x2495464,120, -0x2495648,24, -0x24956ac,84, +0x2495464,124, +0x249565c,104, 0x2495838,14, 0x2495940,13, 0x2495a44,13, @@ -56848,7 +56736,7 @@ 0x2497e30,4, 0x2497e54,45, 0x2497f58,9, -0x2497f88,3, +0x2497f88,4, 0x2497fa0,2, 0x2497fd8,14, 0x2498014,12, @@ -56951,49 +56839,32 @@ 0x24995e8,64, 0x2499748,5, 0x2499990,28, -0x2499a04,1, +0x2499a04,4, 0x2499a98,1, -0x2499be8,5, -0x2499c04,3, +0x2499be8,11, 0x2499c18,13, -0x2499c50,2, +0x2499c50,6, 0x249a000,15, -0x249a044,81, -0x249a18c,84, -0x249a2e0,84, -0x249a434,84, -0x249a588,84, -0x249a6dc,84, -0x249a830,84, -0x249a984,84, -0x249aad8,84, -0x249ac2c,84, -0x249ad80,84, -0x249aed4,84, -0x249b028,84, -0x249b17c,84, -0x249b2d0,84, -0x249b424,84, -0x249b578,84, -0x249b6cc,5, +0x249a044,1447, 0x249b760,4, -0x249b8e0,2414, -0x249dea4,80, +0x249b8e0,2416, +0x249dea4,88, 0x249e048,4, 0x249ebe0,1, 0x249ebf0,97, 0x249ed94,7, +0x249edb4,20, 0x249ee7c,1, 0x249eeac,9, 0x249eed4,5, 0x249eeec,11, -0x249ef2c,17, -0x249ef74,29, +0x249ef2c,3, +0x249ef58,37, 0x249f034,3, -0x249f044,1, +0x249f044,2, 0x249f054,17, 0x249fbe0,3, -0x249fbf0,2, +0x249fbf0,1, 0x24a0000,3, 0x24a0018,2, 0x24a0024,14, @@ -57213,71 +57084,57 @@ 0x24e01a4,2, 0x24e01b0,1, 0x24e01c0,57, -0x24e02b0,67, -0x24e03c0,16, -0x24e0410,23, -0x24e0470,16, -0x24e04c0,23, -0x24e0520,16, -0x24e0570,23, -0x24e05d0,16, -0x24e0620,23, -0x24e0680,16, -0x24e06d0,23, -0x24e0730,16, -0x24e0780,23, -0x24e07e0,16, -0x24e0830,23, -0x24e0890,16, -0x24e08e0,23, -0x24e0940,16, -0x24e0990,23, -0x24e09f0,16, -0x24e0a40,23, -0x24e0aa0,16, -0x24e0af0,23, -0x24e0b50,16, -0x24e0ba0,23, -0x24e0c00,16, -0x24e0c50,23, -0x24e0cb0,16, -0x24e0d00,23, -0x24e0d60,16, -0x24e0db0,23, -0x24e0e10,16, -0x24e0e60,23, -0x24e0ec0,16, -0x24e0f10,23, -0x24e0f70,16, -0x24e0fc0,23, -0x24e1020,16, -0x24e1070,23, -0x24e10d0,16, -0x24e1120,23, -0x24e1180,16, -0x24e11d0,23, -0x24e1230,16, -0x24e1280,23, -0x24e12e0,16, -0x24e1330,23, -0x24e1390,16, -0x24e13e0,23, -0x24e1440,16, -0x24e1490,23, -0x24e14f0,16, -0x24e1540,23, -0x24e15a0,16, -0x24e15f0,23, -0x24e1650,16, -0x24e16a0,23, -0x24e1700,16, -0x24e1750,23, -0x24e17b0,16, -0x24e1800,23, -0x24e1860,16, -0x24e18b0,23, -0x24e1910,16, -0x24e1960,2, +0x24e02b0,23, +0x24e0310,83, +0x24e0460,83, +0x24e05b0,83, +0x24e0700,83, +0x24e0850,83, +0x24e09a0,83, +0x24e0af0,83, +0x24e0c40,83, +0x24e0d90,83, +0x24e0ee0,83, +0x24e1030,83, +0x24e1180,83, +0x24e12d0,83, +0x24e1420,83, +0x24e1570,83, +0x24e16c0,83, +0x24e1810,83, +0x24e1960,83, +0x24e1ab0,83, +0x24e1c00,83, +0x24e1d50,83, +0x24e1ea0,83, +0x24e1ff0,83, +0x24e2140,83, +0x24e2290,83, +0x24e23e0,83, +0x24e2530,83, +0x24e2680,83, +0x24e27d0,83, +0x24e2920,83, +0x24e2a70,83, +0x24e2bc0,62, +0x24e2db4,3, +0x24e2df4,3, +0x24e2e34,3, +0x24e2e74,3, +0x24e2eb4,3, +0x24e2ef4,3, +0x24e2f34,3, +0x24e2f74,3, +0x24e2fb4,3, +0x24e2ff4,3, +0x24e3034,3, +0x24e3074,3, +0x24e30b4,3, +0x24e30f4,3, +0x24e3134,3, +0x24e3174,3, +0x24e31b4,3, +0x24e3500,102, 0x24f0000,4, 0x24f0014,2, 0x24f0020,8, @@ -57379,6 +57236,7 @@ 0x24fa11c,13, 0x24fa160,3, 0x24fa180,8, +0x2570000,12288, 0x2600004,5, 0x2600020,3, 0x2600030,3, @@ -60211,128 +60069,111 @@ 0x2680e00,2, 0x2680e20,2, 0x2690000,3, -0x269001c,4, +0x269001c,6, 0x2690080,3, 0x2690090,2, 0x26900d4,4, 0x26900ec,27, 0x269015c,27, 0x26901cc,19, -0x2690224,120, -0x2690408,24, -0x269046c,84, +0x2690224,124, +0x269041c,104, 0x26905f8,4, 0x2690610,27, 0x2690680,27, 0x26906f0,19, -0x2690748,120, -0x269092c,24, -0x2690990,84, +0x2690748,124, +0x2690940,104, 0x2690b1c,4, 0x2690b34,27, 0x2690ba4,27, 0x2690c14,19, -0x2690c6c,120, -0x2690e50,24, -0x2690eb4,84, +0x2690c6c,124, +0x2690e64,104, 0x2691040,4, 0x2691058,27, 0x26910c8,27, 0x2691138,19, -0x2691190,120, -0x2691374,24, -0x26913d8,84, +0x2691190,124, +0x2691388,104, 0x2691564,4, 0x269157c,27, 0x26915ec,27, 0x269165c,19, -0x26916b4,120, -0x2691898,24, -0x26918fc,84, +0x26916b4,124, +0x26918ac,104, 0x2691a88,4, 0x2691aa0,27, 0x2691b10,27, 0x2691b80,19, -0x2691bd8,120, -0x2691dbc,24, -0x2691e20,84, +0x2691bd8,124, +0x2691dd0,104, 0x2691fac,4, 0x2691fc4,27, 0x2692034,27, 0x26920a4,19, -0x26920fc,120, -0x26922e0,24, -0x2692344,84, +0x26920fc,124, +0x26922f4,104, 0x26924d0,4, 0x26924e8,27, 0x2692558,27, 0x26925c8,19, -0x2692620,120, -0x2692804,24, -0x2692868,84, +0x2692620,124, +0x2692818,104, 0x26929f4,4, 0x2692a0c,27, 0x2692a7c,27, 0x2692aec,19, -0x2692b44,120, -0x2692d28,24, -0x2692d8c,84, +0x2692b44,124, +0x2692d3c,104, 0x2692f18,4, 0x2692f30,27, 0x2692fa0,27, 0x2693010,19, -0x2693068,120, -0x269324c,24, -0x26932b0,84, +0x2693068,124, +0x2693260,104, 0x269343c,4, 0x2693454,27, 0x26934c4,27, 0x2693534,19, -0x269358c,120, -0x2693770,24, -0x26937d4,84, +0x269358c,124, +0x2693784,104, 0x2693960,4, 0x2693978,27, 0x26939e8,27, 0x2693a58,19, -0x2693ab0,120, -0x2693c94,24, -0x2693cf8,84, +0x2693ab0,124, +0x2693ca8,104, 0x2693e84,4, 0x2693e9c,27, 0x2693f0c,27, 0x2693f7c,19, -0x2693fd4,120, -0x26941b8,24, -0x269421c,84, +0x2693fd4,124, +0x26941cc,104, 0x26943a8,4, 0x26943c0,27, 0x2694430,27, 0x26944a0,19, -0x26944f8,120, -0x26946dc,24, -0x2694740,84, +0x26944f8,124, +0x26946f0,104, 0x26948cc,4, 0x26948e4,27, 0x2694954,27, 0x26949c4,19, -0x2694a1c,120, -0x2694c00,24, -0x2694c64,84, +0x2694a1c,124, +0x2694c14,104, 0x2694df0,4, 0x2694e08,27, 0x2694e78,27, 0x2694ee8,19, -0x2694f40,120, -0x2695124,24, -0x2695188,84, +0x2694f40,124, +0x2695138,104, 0x2695314,4, 0x269532c,27, 0x269539c,27, 0x269540c,19, -0x2695464,120, -0x2695648,24, -0x26956ac,84, +0x2695464,124, +0x269565c,104, 0x2695838,14, 0x2695940,13, 0x2695a44,13, @@ -60378,7 +60219,7 @@ 0x2697e30,4, 0x2697e54,45, 0x2697f58,9, -0x2697f88,3, +0x2697f88,4, 0x2697fa0,2, 0x2697fd8,14, 0x2698014,12, @@ -60481,49 +60322,32 @@ 0x26995e8,64, 0x2699748,5, 0x2699990,28, -0x2699a04,1, +0x2699a04,4, 0x2699a98,1, -0x2699be8,5, -0x2699c04,3, +0x2699be8,11, 0x2699c18,13, -0x2699c50,2, +0x2699c50,6, 0x269a000,15, -0x269a044,81, -0x269a18c,84, -0x269a2e0,84, -0x269a434,84, -0x269a588,84, -0x269a6dc,84, -0x269a830,84, -0x269a984,84, -0x269aad8,84, -0x269ac2c,84, -0x269ad80,84, -0x269aed4,84, -0x269b028,84, -0x269b17c,84, -0x269b2d0,84, -0x269b424,84, -0x269b578,84, -0x269b6cc,5, +0x269a044,1447, 0x269b760,4, -0x269b8e0,2414, -0x269dea4,80, +0x269b8e0,2416, +0x269dea4,88, 0x269e048,4, 0x269ebe0,1, 0x269ebf0,97, 0x269ed94,7, +0x269edb4,20, 0x269ee7c,1, 0x269eeac,9, 0x269eed4,5, 0x269eeec,11, -0x269ef2c,17, -0x269ef74,29, +0x269ef2c,3, +0x269ef58,37, 0x269f034,3, -0x269f044,1, +0x269f044,2, 0x269f054,17, 0x269fbe0,3, -0x269fbf0,2, +0x269fbf0,1, 0x26a0000,3, 0x26a0018,2, 0x26a0024,14, @@ -60743,71 +60567,57 @@ 0x26e01a4,2, 0x26e01b0,1, 0x26e01c0,57, -0x26e02b0,67, -0x26e03c0,16, -0x26e0410,23, -0x26e0470,16, -0x26e04c0,23, -0x26e0520,16, -0x26e0570,23, -0x26e05d0,16, -0x26e0620,23, -0x26e0680,16, -0x26e06d0,23, -0x26e0730,16, -0x26e0780,23, -0x26e07e0,16, -0x26e0830,23, -0x26e0890,16, -0x26e08e0,23, -0x26e0940,16, -0x26e0990,23, -0x26e09f0,16, -0x26e0a40,23, -0x26e0aa0,16, -0x26e0af0,23, -0x26e0b50,16, -0x26e0ba0,23, -0x26e0c00,16, -0x26e0c50,23, -0x26e0cb0,16, -0x26e0d00,23, -0x26e0d60,16, -0x26e0db0,23, -0x26e0e10,16, -0x26e0e60,23, -0x26e0ec0,16, -0x26e0f10,23, -0x26e0f70,16, -0x26e0fc0,23, -0x26e1020,16, -0x26e1070,23, -0x26e10d0,16, -0x26e1120,23, -0x26e1180,16, -0x26e11d0,23, -0x26e1230,16, -0x26e1280,23, -0x26e12e0,16, -0x26e1330,23, -0x26e1390,16, -0x26e13e0,23, -0x26e1440,16, -0x26e1490,23, -0x26e14f0,16, -0x26e1540,23, -0x26e15a0,16, -0x26e15f0,23, -0x26e1650,16, -0x26e16a0,23, -0x26e1700,16, -0x26e1750,23, -0x26e17b0,16, -0x26e1800,23, -0x26e1860,16, -0x26e18b0,23, -0x26e1910,16, -0x26e1960,2, +0x26e02b0,23, +0x26e0310,83, +0x26e0460,83, +0x26e05b0,83, +0x26e0700,83, +0x26e0850,83, +0x26e09a0,83, +0x26e0af0,83, +0x26e0c40,83, +0x26e0d90,83, +0x26e0ee0,83, +0x26e1030,83, +0x26e1180,83, +0x26e12d0,83, +0x26e1420,83, +0x26e1570,83, +0x26e16c0,83, +0x26e1810,83, +0x26e1960,83, +0x26e1ab0,83, +0x26e1c00,83, +0x26e1d50,83, +0x26e1ea0,83, +0x26e1ff0,83, +0x26e2140,83, +0x26e2290,83, +0x26e23e0,83, +0x26e2530,83, +0x26e2680,83, +0x26e27d0,83, +0x26e2920,83, +0x26e2a70,83, +0x26e2bc0,62, +0x26e2db4,3, +0x26e2df4,3, +0x26e2e34,3, +0x26e2e74,3, +0x26e2eb4,3, +0x26e2ef4,3, +0x26e2f34,3, +0x26e2f74,3, +0x26e2fb4,3, +0x26e2ff4,3, +0x26e3034,3, +0x26e3074,3, +0x26e30b4,3, +0x26e30f4,3, +0x26e3134,3, +0x26e3174,3, +0x26e31b4,3, +0x26e3500,102, 0x26f0000,4, 0x26f0014,2, 0x26f0020,8, @@ -60909,6 +60719,7 @@ 0x26fa11c,13, 0x26fa160,3, 0x26fa180,8, +0x2770000,12288, 0x2800004,5, 0x2800020,3, 0x2800030,3, @@ -63741,128 +63552,111 @@ 0x2880e00,2, 0x2880e20,2, 0x2890000,3, -0x289001c,4, +0x289001c,6, 0x2890080,3, 0x2890090,2, 0x28900d4,4, 0x28900ec,27, 0x289015c,27, 0x28901cc,19, -0x2890224,120, -0x2890408,24, -0x289046c,84, +0x2890224,124, +0x289041c,104, 0x28905f8,4, 0x2890610,27, 0x2890680,27, 0x28906f0,19, -0x2890748,120, -0x289092c,24, -0x2890990,84, +0x2890748,124, +0x2890940,104, 0x2890b1c,4, 0x2890b34,27, 0x2890ba4,27, 0x2890c14,19, -0x2890c6c,120, -0x2890e50,24, -0x2890eb4,84, +0x2890c6c,124, +0x2890e64,104, 0x2891040,4, 0x2891058,27, 0x28910c8,27, 0x2891138,19, -0x2891190,120, -0x2891374,24, -0x28913d8,84, +0x2891190,124, +0x2891388,104, 0x2891564,4, 0x289157c,27, 0x28915ec,27, 0x289165c,19, -0x28916b4,120, -0x2891898,24, -0x28918fc,84, +0x28916b4,124, +0x28918ac,104, 0x2891a88,4, 0x2891aa0,27, 0x2891b10,27, 0x2891b80,19, -0x2891bd8,120, -0x2891dbc,24, -0x2891e20,84, +0x2891bd8,124, +0x2891dd0,104, 0x2891fac,4, 0x2891fc4,27, 0x2892034,27, 0x28920a4,19, -0x28920fc,120, -0x28922e0,24, -0x2892344,84, +0x28920fc,124, +0x28922f4,104, 0x28924d0,4, 0x28924e8,27, 0x2892558,27, 0x28925c8,19, -0x2892620,120, -0x2892804,24, -0x2892868,84, +0x2892620,124, +0x2892818,104, 0x28929f4,4, 0x2892a0c,27, 0x2892a7c,27, 0x2892aec,19, -0x2892b44,120, -0x2892d28,24, -0x2892d8c,84, +0x2892b44,124, +0x2892d3c,104, 0x2892f18,4, 0x2892f30,27, 0x2892fa0,27, 0x2893010,19, -0x2893068,120, -0x289324c,24, -0x28932b0,84, +0x2893068,124, +0x2893260,104, 0x289343c,4, 0x2893454,27, 0x28934c4,27, 0x2893534,19, -0x289358c,120, -0x2893770,24, -0x28937d4,84, +0x289358c,124, +0x2893784,104, 0x2893960,4, 0x2893978,27, 0x28939e8,27, 0x2893a58,19, -0x2893ab0,120, -0x2893c94,24, -0x2893cf8,84, +0x2893ab0,124, +0x2893ca8,104, 0x2893e84,4, 0x2893e9c,27, 0x2893f0c,27, 0x2893f7c,19, -0x2893fd4,120, -0x28941b8,24, -0x289421c,84, +0x2893fd4,124, +0x28941cc,104, 0x28943a8,4, 0x28943c0,27, 0x2894430,27, 0x28944a0,19, -0x28944f8,120, -0x28946dc,24, -0x2894740,84, +0x28944f8,124, +0x28946f0,104, 0x28948cc,4, 0x28948e4,27, 0x2894954,27, 0x28949c4,19, -0x2894a1c,120, -0x2894c00,24, -0x2894c64,84, +0x2894a1c,124, +0x2894c14,104, 0x2894df0,4, 0x2894e08,27, 0x2894e78,27, 0x2894ee8,19, -0x2894f40,120, -0x2895124,24, -0x2895188,84, +0x2894f40,124, +0x2895138,104, 0x2895314,4, 0x289532c,27, 0x289539c,27, 0x289540c,19, -0x2895464,120, -0x2895648,24, -0x28956ac,84, +0x2895464,124, +0x289565c,104, 0x2895838,14, 0x2895940,13, 0x2895a44,13, @@ -63908,7 +63702,7 @@ 0x2897e30,4, 0x2897e54,45, 0x2897f58,9, -0x2897f88,3, +0x2897f88,4, 0x2897fa0,2, 0x2897fd8,14, 0x2898014,12, @@ -64011,49 +63805,32 @@ 0x28995e8,64, 0x2899748,5, 0x2899990,28, -0x2899a04,1, +0x2899a04,4, 0x2899a98,1, -0x2899be8,5, -0x2899c04,3, +0x2899be8,11, 0x2899c18,13, -0x2899c50,2, +0x2899c50,6, 0x289a000,15, -0x289a044,81, -0x289a18c,84, -0x289a2e0,84, -0x289a434,84, -0x289a588,84, -0x289a6dc,84, -0x289a830,84, -0x289a984,84, -0x289aad8,84, -0x289ac2c,84, -0x289ad80,84, -0x289aed4,84, -0x289b028,84, -0x289b17c,84, -0x289b2d0,84, -0x289b424,84, -0x289b578,84, -0x289b6cc,5, +0x289a044,1447, 0x289b760,4, -0x289b8e0,2414, -0x289dea4,80, +0x289b8e0,2416, +0x289dea4,88, 0x289e048,4, 0x289ebe0,1, 0x289ebf0,97, 0x289ed94,7, +0x289edb4,20, 0x289ee7c,1, 0x289eeac,9, 0x289eed4,5, 0x289eeec,11, -0x289ef2c,17, -0x289ef74,29, +0x289ef2c,3, +0x289ef58,37, 0x289f034,3, -0x289f044,1, +0x289f044,2, 0x289f054,17, 0x289fbe0,3, -0x289fbf0,2, +0x289fbf0,1, 0x28a0000,3, 0x28a0018,2, 0x28a0024,14, @@ -64273,71 +64050,57 @@ 0x28e01a4,2, 0x28e01b0,1, 0x28e01c0,57, -0x28e02b0,67, -0x28e03c0,16, -0x28e0410,23, -0x28e0470,16, -0x28e04c0,23, -0x28e0520,16, -0x28e0570,23, -0x28e05d0,16, -0x28e0620,23, -0x28e0680,16, -0x28e06d0,23, -0x28e0730,16, -0x28e0780,23, -0x28e07e0,16, -0x28e0830,23, -0x28e0890,16, -0x28e08e0,23, -0x28e0940,16, -0x28e0990,23, -0x28e09f0,16, -0x28e0a40,23, -0x28e0aa0,16, -0x28e0af0,23, -0x28e0b50,16, -0x28e0ba0,23, -0x28e0c00,16, -0x28e0c50,23, -0x28e0cb0,16, -0x28e0d00,23, -0x28e0d60,16, -0x28e0db0,23, -0x28e0e10,16, -0x28e0e60,23, -0x28e0ec0,16, -0x28e0f10,23, -0x28e0f70,16, -0x28e0fc0,23, -0x28e1020,16, -0x28e1070,23, -0x28e10d0,16, -0x28e1120,23, -0x28e1180,16, -0x28e11d0,23, -0x28e1230,16, -0x28e1280,23, -0x28e12e0,16, -0x28e1330,23, -0x28e1390,16, -0x28e13e0,23, -0x28e1440,16, -0x28e1490,23, -0x28e14f0,16, -0x28e1540,23, -0x28e15a0,16, -0x28e15f0,23, -0x28e1650,16, -0x28e16a0,23, -0x28e1700,16, -0x28e1750,23, -0x28e17b0,16, -0x28e1800,23, -0x28e1860,16, -0x28e18b0,23, -0x28e1910,16, -0x28e1960,2, +0x28e02b0,23, +0x28e0310,83, +0x28e0460,83, +0x28e05b0,83, +0x28e0700,83, +0x28e0850,83, +0x28e09a0,83, +0x28e0af0,83, +0x28e0c40,83, +0x28e0d90,83, +0x28e0ee0,83, +0x28e1030,83, +0x28e1180,83, +0x28e12d0,83, +0x28e1420,83, +0x28e1570,83, +0x28e16c0,83, +0x28e1810,83, +0x28e1960,83, +0x28e1ab0,83, +0x28e1c00,83, +0x28e1d50,83, +0x28e1ea0,83, +0x28e1ff0,83, +0x28e2140,83, +0x28e2290,83, +0x28e23e0,83, +0x28e2530,83, +0x28e2680,83, +0x28e27d0,83, +0x28e2920,83, +0x28e2a70,83, +0x28e2bc0,62, +0x28e2db4,3, +0x28e2df4,3, +0x28e2e34,3, +0x28e2e74,3, +0x28e2eb4,3, +0x28e2ef4,3, +0x28e2f34,3, +0x28e2f74,3, +0x28e2fb4,3, +0x28e2ff4,3, +0x28e3034,3, +0x28e3074,3, +0x28e30b4,3, +0x28e30f4,3, +0x28e3134,3, +0x28e3174,3, +0x28e31b4,3, +0x28e3500,102, 0x28f0000,4, 0x28f0014,2, 0x28f0020,8, @@ -64439,6 +64202,7 @@ 0x28fa11c,13, 0x28fa160,3, 0x28fa180,8, +0x2970000,12288, 0x2a00004,5, 0x2a00020,3, 0x2a00030,3, @@ -67271,128 +67035,111 @@ 0x2a80e00,2, 0x2a80e20,2, 0x2a90000,3, -0x2a9001c,4, +0x2a9001c,6, 0x2a90080,3, 0x2a90090,2, 0x2a900d4,4, 0x2a900ec,27, 0x2a9015c,27, 0x2a901cc,19, -0x2a90224,120, -0x2a90408,24, -0x2a9046c,84, +0x2a90224,124, +0x2a9041c,104, 0x2a905f8,4, 0x2a90610,27, 0x2a90680,27, 0x2a906f0,19, -0x2a90748,120, -0x2a9092c,24, -0x2a90990,84, +0x2a90748,124, +0x2a90940,104, 0x2a90b1c,4, 0x2a90b34,27, 0x2a90ba4,27, 0x2a90c14,19, -0x2a90c6c,120, -0x2a90e50,24, -0x2a90eb4,84, +0x2a90c6c,124, +0x2a90e64,104, 0x2a91040,4, 0x2a91058,27, 0x2a910c8,27, 0x2a91138,19, -0x2a91190,120, -0x2a91374,24, -0x2a913d8,84, +0x2a91190,124, +0x2a91388,104, 0x2a91564,4, 0x2a9157c,27, 0x2a915ec,27, 0x2a9165c,19, -0x2a916b4,120, -0x2a91898,24, -0x2a918fc,84, +0x2a916b4,124, +0x2a918ac,104, 0x2a91a88,4, 0x2a91aa0,27, 0x2a91b10,27, 0x2a91b80,19, -0x2a91bd8,120, -0x2a91dbc,24, -0x2a91e20,84, +0x2a91bd8,124, +0x2a91dd0,104, 0x2a91fac,4, 0x2a91fc4,27, 0x2a92034,27, 0x2a920a4,19, -0x2a920fc,120, -0x2a922e0,24, -0x2a92344,84, +0x2a920fc,124, +0x2a922f4,104, 0x2a924d0,4, 0x2a924e8,27, 0x2a92558,27, 0x2a925c8,19, -0x2a92620,120, -0x2a92804,24, -0x2a92868,84, +0x2a92620,124, +0x2a92818,104, 0x2a929f4,4, 0x2a92a0c,27, 0x2a92a7c,27, 0x2a92aec,19, -0x2a92b44,120, -0x2a92d28,24, -0x2a92d8c,84, +0x2a92b44,124, +0x2a92d3c,104, 0x2a92f18,4, 0x2a92f30,27, 0x2a92fa0,27, 0x2a93010,19, -0x2a93068,120, -0x2a9324c,24, -0x2a932b0,84, +0x2a93068,124, +0x2a93260,104, 0x2a9343c,4, 0x2a93454,27, 0x2a934c4,27, 0x2a93534,19, -0x2a9358c,120, -0x2a93770,24, -0x2a937d4,84, +0x2a9358c,124, +0x2a93784,104, 0x2a93960,4, 0x2a93978,27, 0x2a939e8,27, 0x2a93a58,19, -0x2a93ab0,120, -0x2a93c94,24, -0x2a93cf8,84, +0x2a93ab0,124, +0x2a93ca8,104, 0x2a93e84,4, 0x2a93e9c,27, 0x2a93f0c,27, 0x2a93f7c,19, -0x2a93fd4,120, -0x2a941b8,24, -0x2a9421c,84, +0x2a93fd4,124, +0x2a941cc,104, 0x2a943a8,4, 0x2a943c0,27, 0x2a94430,27, 0x2a944a0,19, -0x2a944f8,120, -0x2a946dc,24, -0x2a94740,84, +0x2a944f8,124, +0x2a946f0,104, 0x2a948cc,4, 0x2a948e4,27, 0x2a94954,27, 0x2a949c4,19, -0x2a94a1c,120, -0x2a94c00,24, -0x2a94c64,84, +0x2a94a1c,124, +0x2a94c14,104, 0x2a94df0,4, 0x2a94e08,27, 0x2a94e78,27, 0x2a94ee8,19, -0x2a94f40,120, -0x2a95124,24, -0x2a95188,84, +0x2a94f40,124, +0x2a95138,104, 0x2a95314,4, 0x2a9532c,27, 0x2a9539c,27, 0x2a9540c,19, -0x2a95464,120, -0x2a95648,24, -0x2a956ac,84, +0x2a95464,124, +0x2a9565c,104, 0x2a95838,14, 0x2a95940,13, 0x2a95a44,13, @@ -67438,7 +67185,7 @@ 0x2a97e30,4, 0x2a97e54,45, 0x2a97f58,9, -0x2a97f88,3, +0x2a97f88,4, 0x2a97fa0,2, 0x2a97fd8,14, 0x2a98014,12, @@ -67541,49 +67288,32 @@ 0x2a995e8,64, 0x2a99748,5, 0x2a99990,28, -0x2a99a04,1, +0x2a99a04,4, 0x2a99a98,1, -0x2a99be8,5, -0x2a99c04,3, +0x2a99be8,11, 0x2a99c18,13, -0x2a99c50,2, +0x2a99c50,6, 0x2a9a000,15, -0x2a9a044,81, -0x2a9a18c,84, -0x2a9a2e0,84, -0x2a9a434,84, -0x2a9a588,84, -0x2a9a6dc,84, -0x2a9a830,84, -0x2a9a984,84, -0x2a9aad8,84, -0x2a9ac2c,84, -0x2a9ad80,84, -0x2a9aed4,84, -0x2a9b028,84, -0x2a9b17c,84, -0x2a9b2d0,84, -0x2a9b424,84, -0x2a9b578,84, -0x2a9b6cc,5, +0x2a9a044,1447, 0x2a9b760,4, -0x2a9b8e0,2414, -0x2a9dea4,80, +0x2a9b8e0,2416, +0x2a9dea4,88, 0x2a9e048,4, 0x2a9ebe0,1, 0x2a9ebf0,97, 0x2a9ed94,7, +0x2a9edb4,20, 0x2a9ee7c,1, 0x2a9eeac,9, 0x2a9eed4,5, 0x2a9eeec,11, -0x2a9ef2c,17, -0x2a9ef74,29, +0x2a9ef2c,3, +0x2a9ef58,37, 0x2a9f034,3, -0x2a9f044,1, +0x2a9f044,2, 0x2a9f054,17, 0x2a9fbe0,3, -0x2a9fbf0,2, +0x2a9fbf0,1, 0x2aa0000,3, 0x2aa0018,2, 0x2aa0024,14, @@ -67803,71 +67533,57 @@ 0x2ae01a4,2, 0x2ae01b0,1, 0x2ae01c0,57, -0x2ae02b0,67, -0x2ae03c0,16, -0x2ae0410,23, -0x2ae0470,16, -0x2ae04c0,23, -0x2ae0520,16, -0x2ae0570,23, -0x2ae05d0,16, -0x2ae0620,23, -0x2ae0680,16, -0x2ae06d0,23, -0x2ae0730,16, -0x2ae0780,23, -0x2ae07e0,16, -0x2ae0830,23, -0x2ae0890,16, -0x2ae08e0,23, -0x2ae0940,16, -0x2ae0990,23, -0x2ae09f0,16, -0x2ae0a40,23, -0x2ae0aa0,16, -0x2ae0af0,23, -0x2ae0b50,16, -0x2ae0ba0,23, -0x2ae0c00,16, -0x2ae0c50,23, -0x2ae0cb0,16, -0x2ae0d00,23, -0x2ae0d60,16, -0x2ae0db0,23, -0x2ae0e10,16, -0x2ae0e60,23, -0x2ae0ec0,16, -0x2ae0f10,23, -0x2ae0f70,16, -0x2ae0fc0,23, -0x2ae1020,16, -0x2ae1070,23, -0x2ae10d0,16, -0x2ae1120,23, -0x2ae1180,16, -0x2ae11d0,23, -0x2ae1230,16, -0x2ae1280,23, -0x2ae12e0,16, -0x2ae1330,23, -0x2ae1390,16, -0x2ae13e0,23, -0x2ae1440,16, -0x2ae1490,23, -0x2ae14f0,16, -0x2ae1540,23, -0x2ae15a0,16, -0x2ae15f0,23, -0x2ae1650,16, -0x2ae16a0,23, -0x2ae1700,16, -0x2ae1750,23, -0x2ae17b0,16, -0x2ae1800,23, -0x2ae1860,16, -0x2ae18b0,23, -0x2ae1910,16, -0x2ae1960,2, +0x2ae02b0,23, +0x2ae0310,83, +0x2ae0460,83, +0x2ae05b0,83, +0x2ae0700,83, +0x2ae0850,83, +0x2ae09a0,83, +0x2ae0af0,83, +0x2ae0c40,83, +0x2ae0d90,83, +0x2ae0ee0,83, +0x2ae1030,83, +0x2ae1180,83, +0x2ae12d0,83, +0x2ae1420,83, +0x2ae1570,83, +0x2ae16c0,83, +0x2ae1810,83, +0x2ae1960,83, +0x2ae1ab0,83, +0x2ae1c00,83, +0x2ae1d50,83, +0x2ae1ea0,83, +0x2ae1ff0,83, +0x2ae2140,83, +0x2ae2290,83, +0x2ae23e0,83, +0x2ae2530,83, +0x2ae2680,83, +0x2ae27d0,83, +0x2ae2920,83, +0x2ae2a70,83, +0x2ae2bc0,62, +0x2ae2db4,3, +0x2ae2df4,3, +0x2ae2e34,3, +0x2ae2e74,3, +0x2ae2eb4,3, +0x2ae2ef4,3, +0x2ae2f34,3, +0x2ae2f74,3, +0x2ae2fb4,3, +0x2ae2ff4,3, +0x2ae3034,3, +0x2ae3074,3, +0x2ae30b4,3, +0x2ae30f4,3, +0x2ae3134,3, +0x2ae3174,3, +0x2ae31b4,3, +0x2ae3500,102, 0x2af0000,4, 0x2af0014,2, 0x2af0020,8, @@ -67969,6 +67685,7 @@ 0x2afa11c,13, 0x2afa160,3, 0x2afa180,8, +0x2b70000,12288, 0x2c00004,5, 0x2c00020,3, 0x2c00030,3, @@ -70801,128 +70518,111 @@ 0x2c80e00,2, 0x2c80e20,2, 0x2c90000,3, -0x2c9001c,4, +0x2c9001c,6, 0x2c90080,3, 0x2c90090,2, 0x2c900d4,4, 0x2c900ec,27, 0x2c9015c,27, 0x2c901cc,19, -0x2c90224,120, -0x2c90408,24, -0x2c9046c,84, +0x2c90224,124, +0x2c9041c,104, 0x2c905f8,4, 0x2c90610,27, 0x2c90680,27, 0x2c906f0,19, -0x2c90748,120, -0x2c9092c,24, -0x2c90990,84, +0x2c90748,124, +0x2c90940,104, 0x2c90b1c,4, 0x2c90b34,27, 0x2c90ba4,27, 0x2c90c14,19, -0x2c90c6c,120, -0x2c90e50,24, -0x2c90eb4,84, +0x2c90c6c,124, +0x2c90e64,104, 0x2c91040,4, 0x2c91058,27, 0x2c910c8,27, 0x2c91138,19, -0x2c91190,120, -0x2c91374,24, -0x2c913d8,84, +0x2c91190,124, +0x2c91388,104, 0x2c91564,4, 0x2c9157c,27, 0x2c915ec,27, 0x2c9165c,19, -0x2c916b4,120, -0x2c91898,24, -0x2c918fc,84, +0x2c916b4,124, +0x2c918ac,104, 0x2c91a88,4, 0x2c91aa0,27, 0x2c91b10,27, 0x2c91b80,19, -0x2c91bd8,120, -0x2c91dbc,24, -0x2c91e20,84, +0x2c91bd8,124, +0x2c91dd0,104, 0x2c91fac,4, 0x2c91fc4,27, 0x2c92034,27, 0x2c920a4,19, -0x2c920fc,120, -0x2c922e0,24, -0x2c92344,84, +0x2c920fc,124, +0x2c922f4,104, 0x2c924d0,4, 0x2c924e8,27, 0x2c92558,27, 0x2c925c8,19, -0x2c92620,120, -0x2c92804,24, -0x2c92868,84, +0x2c92620,124, +0x2c92818,104, 0x2c929f4,4, 0x2c92a0c,27, 0x2c92a7c,27, 0x2c92aec,19, -0x2c92b44,120, -0x2c92d28,24, -0x2c92d8c,84, +0x2c92b44,124, +0x2c92d3c,104, 0x2c92f18,4, 0x2c92f30,27, 0x2c92fa0,27, 0x2c93010,19, -0x2c93068,120, -0x2c9324c,24, -0x2c932b0,84, +0x2c93068,124, +0x2c93260,104, 0x2c9343c,4, 0x2c93454,27, 0x2c934c4,27, 0x2c93534,19, -0x2c9358c,120, -0x2c93770,24, -0x2c937d4,84, +0x2c9358c,124, +0x2c93784,104, 0x2c93960,4, 0x2c93978,27, 0x2c939e8,27, 0x2c93a58,19, -0x2c93ab0,120, -0x2c93c94,24, -0x2c93cf8,84, +0x2c93ab0,124, +0x2c93ca8,104, 0x2c93e84,4, 0x2c93e9c,27, 0x2c93f0c,27, 0x2c93f7c,19, -0x2c93fd4,120, -0x2c941b8,24, -0x2c9421c,84, +0x2c93fd4,124, +0x2c941cc,104, 0x2c943a8,4, 0x2c943c0,27, 0x2c94430,27, 0x2c944a0,19, -0x2c944f8,120, -0x2c946dc,24, -0x2c94740,84, +0x2c944f8,124, +0x2c946f0,104, 0x2c948cc,4, 0x2c948e4,27, 0x2c94954,27, 0x2c949c4,19, -0x2c94a1c,120, -0x2c94c00,24, -0x2c94c64,84, +0x2c94a1c,124, +0x2c94c14,104, 0x2c94df0,4, 0x2c94e08,27, 0x2c94e78,27, 0x2c94ee8,19, -0x2c94f40,120, -0x2c95124,24, -0x2c95188,84, +0x2c94f40,124, +0x2c95138,104, 0x2c95314,4, 0x2c9532c,27, 0x2c9539c,27, 0x2c9540c,19, -0x2c95464,120, -0x2c95648,24, -0x2c956ac,84, +0x2c95464,124, +0x2c9565c,104, 0x2c95838,14, 0x2c95940,13, 0x2c95a44,13, @@ -70968,7 +70668,7 @@ 0x2c97e30,4, 0x2c97e54,45, 0x2c97f58,9, -0x2c97f88,3, +0x2c97f88,4, 0x2c97fa0,2, 0x2c97fd8,14, 0x2c98014,12, @@ -71071,49 +70771,32 @@ 0x2c995e8,64, 0x2c99748,5, 0x2c99990,28, -0x2c99a04,1, +0x2c99a04,4, 0x2c99a98,1, -0x2c99be8,5, -0x2c99c04,3, +0x2c99be8,11, 0x2c99c18,13, -0x2c99c50,2, +0x2c99c50,6, 0x2c9a000,15, -0x2c9a044,81, -0x2c9a18c,84, -0x2c9a2e0,84, -0x2c9a434,84, -0x2c9a588,84, -0x2c9a6dc,84, -0x2c9a830,84, -0x2c9a984,84, -0x2c9aad8,84, -0x2c9ac2c,84, -0x2c9ad80,84, -0x2c9aed4,84, -0x2c9b028,84, -0x2c9b17c,84, -0x2c9b2d0,84, -0x2c9b424,84, -0x2c9b578,84, -0x2c9b6cc,5, +0x2c9a044,1447, 0x2c9b760,4, -0x2c9b8e0,2414, -0x2c9dea4,80, +0x2c9b8e0,2416, +0x2c9dea4,88, 0x2c9e048,4, 0x2c9ebe0,1, 0x2c9ebf0,97, 0x2c9ed94,7, +0x2c9edb4,20, 0x2c9ee7c,1, 0x2c9eeac,9, 0x2c9eed4,5, 0x2c9eeec,11, -0x2c9ef2c,17, -0x2c9ef74,29, +0x2c9ef2c,3, +0x2c9ef58,37, 0x2c9f034,3, -0x2c9f044,1, +0x2c9f044,2, 0x2c9f054,17, 0x2c9fbe0,3, -0x2c9fbf0,2, +0x2c9fbf0,1, 0x2ca0000,3, 0x2ca0018,2, 0x2ca0024,14, @@ -71333,71 +71016,57 @@ 0x2ce01a4,2, 0x2ce01b0,1, 0x2ce01c0,57, -0x2ce02b0,67, -0x2ce03c0,16, -0x2ce0410,23, -0x2ce0470,16, -0x2ce04c0,23, -0x2ce0520,16, -0x2ce0570,23, -0x2ce05d0,16, -0x2ce0620,23, -0x2ce0680,16, -0x2ce06d0,23, -0x2ce0730,16, -0x2ce0780,23, -0x2ce07e0,16, -0x2ce0830,23, -0x2ce0890,16, -0x2ce08e0,23, -0x2ce0940,16, -0x2ce0990,23, -0x2ce09f0,16, -0x2ce0a40,23, -0x2ce0aa0,16, -0x2ce0af0,23, -0x2ce0b50,16, -0x2ce0ba0,23, -0x2ce0c00,16, -0x2ce0c50,23, -0x2ce0cb0,16, -0x2ce0d00,23, -0x2ce0d60,16, -0x2ce0db0,23, -0x2ce0e10,16, -0x2ce0e60,23, -0x2ce0ec0,16, -0x2ce0f10,23, -0x2ce0f70,16, -0x2ce0fc0,23, -0x2ce1020,16, -0x2ce1070,23, -0x2ce10d0,16, -0x2ce1120,23, -0x2ce1180,16, -0x2ce11d0,23, -0x2ce1230,16, -0x2ce1280,23, -0x2ce12e0,16, -0x2ce1330,23, -0x2ce1390,16, -0x2ce13e0,23, -0x2ce1440,16, -0x2ce1490,23, -0x2ce14f0,16, -0x2ce1540,23, -0x2ce15a0,16, -0x2ce15f0,23, -0x2ce1650,16, -0x2ce16a0,23, -0x2ce1700,16, -0x2ce1750,23, -0x2ce17b0,16, -0x2ce1800,23, -0x2ce1860,16, -0x2ce18b0,23, -0x2ce1910,16, -0x2ce1960,2, +0x2ce02b0,23, +0x2ce0310,83, +0x2ce0460,83, +0x2ce05b0,83, +0x2ce0700,83, +0x2ce0850,83, +0x2ce09a0,83, +0x2ce0af0,83, +0x2ce0c40,83, +0x2ce0d90,83, +0x2ce0ee0,83, +0x2ce1030,83, +0x2ce1180,83, +0x2ce12d0,83, +0x2ce1420,83, +0x2ce1570,83, +0x2ce16c0,83, +0x2ce1810,83, +0x2ce1960,83, +0x2ce1ab0,83, +0x2ce1c00,83, +0x2ce1d50,83, +0x2ce1ea0,83, +0x2ce1ff0,83, +0x2ce2140,83, +0x2ce2290,83, +0x2ce23e0,83, +0x2ce2530,83, +0x2ce2680,83, +0x2ce27d0,83, +0x2ce2920,83, +0x2ce2a70,83, +0x2ce2bc0,62, +0x2ce2db4,3, +0x2ce2df4,3, +0x2ce2e34,3, +0x2ce2e74,3, +0x2ce2eb4,3, +0x2ce2ef4,3, +0x2ce2f34,3, +0x2ce2f74,3, +0x2ce2fb4,3, +0x2ce2ff4,3, +0x2ce3034,3, +0x2ce3074,3, +0x2ce30b4,3, +0x2ce30f4,3, +0x2ce3134,3, +0x2ce3174,3, +0x2ce31b4,3, +0x2ce3500,102, 0x2cf0000,4, 0x2cf0014,2, 0x2cf0020,8, @@ -71499,6 +71168,7 @@ 0x2cfa11c,13, 0x2cfa160,3, 0x2cfa180,8, +0x2d70000,12288, 0x2e00004,5, 0x2e00020,3, 0x2e00030,3, @@ -74331,128 +74001,111 @@ 0x2e80e00,2, 0x2e80e20,2, 0x2e90000,3, -0x2e9001c,4, +0x2e9001c,6, 0x2e90080,3, 0x2e90090,2, 0x2e900d4,4, 0x2e900ec,27, 0x2e9015c,27, 0x2e901cc,19, -0x2e90224,120, -0x2e90408,24, -0x2e9046c,84, +0x2e90224,124, +0x2e9041c,104, 0x2e905f8,4, 0x2e90610,27, 0x2e90680,27, 0x2e906f0,19, -0x2e90748,120, -0x2e9092c,24, -0x2e90990,84, +0x2e90748,124, +0x2e90940,104, 0x2e90b1c,4, 0x2e90b34,27, 0x2e90ba4,27, 0x2e90c14,19, -0x2e90c6c,120, -0x2e90e50,24, -0x2e90eb4,84, +0x2e90c6c,124, +0x2e90e64,104, 0x2e91040,4, 0x2e91058,27, 0x2e910c8,27, 0x2e91138,19, -0x2e91190,120, -0x2e91374,24, -0x2e913d8,84, +0x2e91190,124, +0x2e91388,104, 0x2e91564,4, 0x2e9157c,27, 0x2e915ec,27, 0x2e9165c,19, -0x2e916b4,120, -0x2e91898,24, -0x2e918fc,84, +0x2e916b4,124, +0x2e918ac,104, 0x2e91a88,4, 0x2e91aa0,27, 0x2e91b10,27, 0x2e91b80,19, -0x2e91bd8,120, -0x2e91dbc,24, -0x2e91e20,84, +0x2e91bd8,124, +0x2e91dd0,104, 0x2e91fac,4, 0x2e91fc4,27, 0x2e92034,27, 0x2e920a4,19, -0x2e920fc,120, -0x2e922e0,24, -0x2e92344,84, +0x2e920fc,124, +0x2e922f4,104, 0x2e924d0,4, 0x2e924e8,27, 0x2e92558,27, 0x2e925c8,19, -0x2e92620,120, -0x2e92804,24, -0x2e92868,84, +0x2e92620,124, +0x2e92818,104, 0x2e929f4,4, 0x2e92a0c,27, 0x2e92a7c,27, 0x2e92aec,19, -0x2e92b44,120, -0x2e92d28,24, -0x2e92d8c,84, +0x2e92b44,124, +0x2e92d3c,104, 0x2e92f18,4, 0x2e92f30,27, 0x2e92fa0,27, 0x2e93010,19, -0x2e93068,120, -0x2e9324c,24, -0x2e932b0,84, +0x2e93068,124, +0x2e93260,104, 0x2e9343c,4, 0x2e93454,27, 0x2e934c4,27, 0x2e93534,19, -0x2e9358c,120, -0x2e93770,24, -0x2e937d4,84, +0x2e9358c,124, +0x2e93784,104, 0x2e93960,4, 0x2e93978,27, 0x2e939e8,27, 0x2e93a58,19, -0x2e93ab0,120, -0x2e93c94,24, -0x2e93cf8,84, +0x2e93ab0,124, +0x2e93ca8,104, 0x2e93e84,4, 0x2e93e9c,27, 0x2e93f0c,27, 0x2e93f7c,19, -0x2e93fd4,120, -0x2e941b8,24, -0x2e9421c,84, +0x2e93fd4,124, +0x2e941cc,104, 0x2e943a8,4, 0x2e943c0,27, 0x2e94430,27, 0x2e944a0,19, -0x2e944f8,120, -0x2e946dc,24, -0x2e94740,84, +0x2e944f8,124, +0x2e946f0,104, 0x2e948cc,4, 0x2e948e4,27, 0x2e94954,27, 0x2e949c4,19, -0x2e94a1c,120, -0x2e94c00,24, -0x2e94c64,84, +0x2e94a1c,124, +0x2e94c14,104, 0x2e94df0,4, 0x2e94e08,27, 0x2e94e78,27, 0x2e94ee8,19, -0x2e94f40,120, -0x2e95124,24, -0x2e95188,84, +0x2e94f40,124, +0x2e95138,104, 0x2e95314,4, 0x2e9532c,27, 0x2e9539c,27, 0x2e9540c,19, -0x2e95464,120, -0x2e95648,24, -0x2e956ac,84, +0x2e95464,124, +0x2e9565c,104, 0x2e95838,14, 0x2e95940,13, 0x2e95a44,13, @@ -74498,7 +74151,7 @@ 0x2e97e30,4, 0x2e97e54,45, 0x2e97f58,9, -0x2e97f88,3, +0x2e97f88,4, 0x2e97fa0,2, 0x2e97fd8,14, 0x2e98014,12, @@ -74601,49 +74254,32 @@ 0x2e995e8,64, 0x2e99748,5, 0x2e99990,28, -0x2e99a04,1, +0x2e99a04,4, 0x2e99a98,1, -0x2e99be8,5, -0x2e99c04,3, +0x2e99be8,11, 0x2e99c18,13, -0x2e99c50,2, +0x2e99c50,6, 0x2e9a000,15, -0x2e9a044,81, -0x2e9a18c,84, -0x2e9a2e0,84, -0x2e9a434,84, -0x2e9a588,84, -0x2e9a6dc,84, -0x2e9a830,84, -0x2e9a984,84, -0x2e9aad8,84, -0x2e9ac2c,84, -0x2e9ad80,84, -0x2e9aed4,84, -0x2e9b028,84, -0x2e9b17c,84, -0x2e9b2d0,84, -0x2e9b424,84, -0x2e9b578,84, -0x2e9b6cc,5, +0x2e9a044,1447, 0x2e9b760,4, -0x2e9b8e0,2414, -0x2e9dea4,80, +0x2e9b8e0,2416, +0x2e9dea4,88, 0x2e9e048,4, 0x2e9ebe0,1, 0x2e9ebf0,97, 0x2e9ed94,7, +0x2e9edb4,20, 0x2e9ee7c,1, 0x2e9eeac,9, 0x2e9eed4,5, 0x2e9eeec,11, -0x2e9ef2c,17, -0x2e9ef74,29, +0x2e9ef2c,3, +0x2e9ef58,37, 0x2e9f034,3, -0x2e9f044,1, +0x2e9f044,2, 0x2e9f054,17, 0x2e9fbe0,3, -0x2e9fbf0,2, +0x2e9fbf0,1, 0x2ea0000,3, 0x2ea0018,2, 0x2ea0024,14, @@ -74863,71 +74499,57 @@ 0x2ee01a4,2, 0x2ee01b0,1, 0x2ee01c0,57, -0x2ee02b0,67, -0x2ee03c0,16, -0x2ee0410,23, -0x2ee0470,16, -0x2ee04c0,23, -0x2ee0520,16, -0x2ee0570,23, -0x2ee05d0,16, -0x2ee0620,23, -0x2ee0680,16, -0x2ee06d0,23, -0x2ee0730,16, -0x2ee0780,23, -0x2ee07e0,16, -0x2ee0830,23, -0x2ee0890,16, -0x2ee08e0,23, -0x2ee0940,16, -0x2ee0990,23, -0x2ee09f0,16, -0x2ee0a40,23, -0x2ee0aa0,16, -0x2ee0af0,23, -0x2ee0b50,16, -0x2ee0ba0,23, -0x2ee0c00,16, -0x2ee0c50,23, -0x2ee0cb0,16, -0x2ee0d00,23, -0x2ee0d60,16, -0x2ee0db0,23, -0x2ee0e10,16, -0x2ee0e60,23, -0x2ee0ec0,16, -0x2ee0f10,23, -0x2ee0f70,16, -0x2ee0fc0,23, -0x2ee1020,16, -0x2ee1070,23, -0x2ee10d0,16, -0x2ee1120,23, -0x2ee1180,16, -0x2ee11d0,23, -0x2ee1230,16, -0x2ee1280,23, -0x2ee12e0,16, -0x2ee1330,23, -0x2ee1390,16, -0x2ee13e0,23, -0x2ee1440,16, -0x2ee1490,23, -0x2ee14f0,16, -0x2ee1540,23, -0x2ee15a0,16, -0x2ee15f0,23, -0x2ee1650,16, -0x2ee16a0,23, -0x2ee1700,16, -0x2ee1750,23, -0x2ee17b0,16, -0x2ee1800,23, -0x2ee1860,16, -0x2ee18b0,23, -0x2ee1910,16, -0x2ee1960,2, +0x2ee02b0,23, +0x2ee0310,83, +0x2ee0460,83, +0x2ee05b0,83, +0x2ee0700,83, +0x2ee0850,83, +0x2ee09a0,83, +0x2ee0af0,83, +0x2ee0c40,83, +0x2ee0d90,83, +0x2ee0ee0,83, +0x2ee1030,83, +0x2ee1180,83, +0x2ee12d0,83, +0x2ee1420,83, +0x2ee1570,83, +0x2ee16c0,83, +0x2ee1810,83, +0x2ee1960,83, +0x2ee1ab0,83, +0x2ee1c00,83, +0x2ee1d50,83, +0x2ee1ea0,83, +0x2ee1ff0,83, +0x2ee2140,83, +0x2ee2290,83, +0x2ee23e0,83, +0x2ee2530,83, +0x2ee2680,83, +0x2ee27d0,83, +0x2ee2920,83, +0x2ee2a70,83, +0x2ee2bc0,62, +0x2ee2db4,3, +0x2ee2df4,3, +0x2ee2e34,3, +0x2ee2e74,3, +0x2ee2eb4,3, +0x2ee2ef4,3, +0x2ee2f34,3, +0x2ee2f74,3, +0x2ee2fb4,3, +0x2ee2ff4,3, +0x2ee3034,3, +0x2ee3074,3, +0x2ee30b4,3, +0x2ee30f4,3, +0x2ee3134,3, +0x2ee3174,3, +0x2ee31b4,3, +0x2ee3500,102, 0x2ef0000,4, 0x2ef0014,2, 0x2ef0020,8, @@ -75029,3 +74651,4 @@ 0x2efa11c,13, 0x2efa160,3, 0x2efa180,8, +0x2f70000,12288, diff --git a/mstflint.spec.in b/mstflint.spec.in index 670f386e..b5a7d127 100644 --- a/mstflint.spec.in +++ b/mstflint.spec.in @@ -1,6 +1,6 @@ %{!?ibmadlib: %define ibmadlib libibmad-devel} %{!?name: %define name mstflint} -%{!?version: %define version 4.26.0} +%{!?version: %define version 4.27.0} %{!?release: %define release 1} %{!?buildtype: %define buildtype "native"} %{!?noinband: %define noinband 0} diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c index bc0c0d7e..6eb73b1a 100644 --- a/mtcr_ul/mtcr_ul_com.c +++ b/mtcr_ul/mtcr_ul_com.c @@ -85,7 +85,11 @@ #if CONFIG_ENABLE_MMAP #include +#ifdef HAVE_SYS_PCI_H #include +#else +#include +#endif #include #endif diff --git a/reg_access/reg_access.c b/reg_access/reg_access.c index 8badaca1..b8b88cca 100644 --- a/reg_access/reg_access.c +++ b/reg_access/reg_access.c @@ -117,6 +117,7 @@ //================================== // RESOURCE DUMP FEATURE #define REG_ID_RES_DUMP 0xC000 +#define REG_ID_MORD 0x9153 //================================== #define REG_ID_MPEGC 0x9056 #define REG_ID_NIC_CAP_EXT 0xC011 @@ -356,6 +357,12 @@ reg_access_status_t reg_access_mmdio(mfile* mf, reg_access_method_t method, stru /************************************ * * Function: reg_access_resource_dump * ************************************/ + +/***********************************************************/ +/*********************** ATTENTION *************************/ +/** The registers below must be same (except for the ID) ***/ +/** Changes in them should be made both in switch and nic **/ + reg_access_status_t reg_access_res_dump(mfile* mf, reg_access_method_t method, struct reg_access_hca_resource_dump_ext* resource_dump) { @@ -366,6 +373,12 @@ reg_access_status_t } REG_ACCCESS(mf, method, REG_ID_RES_DUMP, resource_dump, resource_dump_ext, reg_access_hca); } + +reg_access_status_t + reg_access_mord(mfile* mf, reg_access_method_t method, struct reg_access_hca_resource_dump_ext* resource_dump) +{ + REG_ACCCESS(mf, method, REG_ID_MORD, resource_dump, resource_dump_ext, reg_access_hca); +} //================================================================================================================================= reg_access_status_t reg_access_mnvda(mfile* mf, reg_access_method_t method, struct tools_open_mnvda* mnvda) diff --git a/reg_access/reg_access.h b/reg_access/reg_access.h index 747f5c38..0a859846 100644 --- a/reg_access/reg_access.h +++ b/reg_access/reg_access.h @@ -113,8 +113,14 @@ reg_access_status_t reg_access_sbcm(mfile* mf, reg_access_method_t method, struc struct switchen_sbpm; reg_access_status_t reg_access_sbpm(mfile* mf, reg_access_method_t method, struct switchen_sbpm* sbpm); struct reg_access_hca_resource_dump_ext; +/***********************************************************/ +/*********************** ATTENTION *************************/ +/** The registers below must be same (except for the ID) ***/ +/** Changes in them should be made both in switch and nic **/ reg_access_status_t reg_access_res_dump(mfile* mf, reg_access_method_t method, struct reg_access_hca_resource_dump_ext* res_dump); +reg_access_status_t + reg_access_mord(mfile* mf, reg_access_method_t method, struct reg_access_hca_resource_dump_ext* res_dump); struct switchen_ppcnt_reg; reg_access_status_t reg_access_ppcnt(mfile* mf, reg_access_method_t method, struct switchen_ppcnt_reg* ricnt); diff --git a/resourcetools/mstresourcedump.py b/resourcetools/mstresourcedump.py index dc23ef83..32dc1bce 100644 --- a/resourcetools/mstresourcedump.py +++ b/resourcetools/mstresourcedump.py @@ -217,6 +217,9 @@ def create_command(arguments): command = create_command(dump_args) command.execute() print("{:#^100}".format(" Dump finished successfully ")) + except KeyboardInterrupt: + print("Aborted by user.") + sys.exit(1) except Exception as e: print("Error: {0}. Exiting...".format(e)) sys.exit(1) @@ -231,6 +234,9 @@ def create_command(arguments): parse_manager.parse() print("{:#^100}".format(" Parse finished successfully ")) + except KeyboardInterrupt: + print("Aborted by user.") + sys.exit(1) except ResourceParseException as rpe: print("ResourceParse failed!\n{0}.\nExiting...".format(rpe)) sys.exit(1) diff --git a/resourcetools/mstresourceparse.py b/resourcetools/mstresourceparse.py index 39eb0b5b..433b2595 100644 --- a/resourcetools/mstresourceparse.py +++ b/resourcetools/mstresourceparse.py @@ -136,6 +136,9 @@ def run(self, argv=None, segments=None): if __name__ == '__main__': try: ResourceParse().run() + except KeyboardInterrupt: + print("Aborted by user.") + sys.exit(1) except ResourceParseException as rpe: print("ResourceParse failed!\n{0}.\nExiting...".format(rpe)) sys.exit(1) diff --git a/resourcetools/resourcedump_lib/src/commands/dump_command.cpp b/resourcetools/resourcedump_lib/src/commands/dump_command.cpp index 404bb0de..8a7a4af6 100644 --- a/resourcetools/resourcedump_lib/src/commands/dump_command.cpp +++ b/resourcetools/resourcedump_lib/src/commands/dump_command.cpp @@ -32,6 +32,7 @@ #include "dump_command.h" #include "resource_dump_types.h" +#include "resource_dump_segments.h" #include "resource_dump_error_handling.h" #include "utils.h" @@ -90,6 +91,59 @@ void DumpCommand::reverse_fstream_endianess() _ostream->write(reversed_string.c_str(), reversed_string.size()); } +resource_dump_segment_header DumpCommand::read_header(size_t segment_idx) +{ + if (!_data_fetched) + { + throw ResourceDumpException(ResourceDumpException::Reason::DATA_NOT_FETCHED); + } + + if (segment_idx >= _segment_offsets.size()) + { + throw ResourceDumpException(ResourceDumpException::Reason::DATA_OVERFLOW); + } + + resource_dump_segment_header header_buffer{0, 0}; + + auto curr_pos = _istream->tellg(); + if (segment_idx < _segment_offsets.size()) + { + _istream->seekg(_segment_offsets[segment_idx]); + } + _istream->read(reinterpret_cast(&header_buffer), sizeof(resource_dump_segment_header)); + _istream->seekg(curr_pos); + + return header_buffer; +} + +bool DumpCommand::get_error_message(string& error_message) +{ + if (!_data_fetched) + { + throw ResourceDumpException(ResourceDumpException::Reason::DATA_NOT_FETCHED); + } + + auto num_segments = _segment_offsets.size(); + if (num_segments == 0) + { + return false; + } + + auto header_buffer = read_header(_segment_offsets.size() - 1); + + if (header_buffer.segment_type == static_cast(SegmentType::error)) + { + error_segment_data error_buffer{0, 0, 0, 0, {0}}; + _istream->read(reinterpret_cast(&error_buffer), sizeof(error_segment_data)); + error_message = error_buffer.notice; + return true; + } + else + { + return false; + } +} + bool DumpCommand::validate() { return true; // TODO: go through capability fetcher diff --git a/resourcetools/resourcedump_lib/src/commands/dump_command.h b/resourcetools/resourcedump_lib/src/commands/dump_command.h index 15522466..a19c0fb6 100644 --- a/resourcetools/resourcedump_lib/src/commands/dump_command.h +++ b/resourcetools/resourcedump_lib/src/commands/dump_command.h @@ -39,6 +39,8 @@ namespace mft { namespace resource_dump { +struct resource_dump_segment_header; + class DumpCommand : public ResourceDumpCommand { public: @@ -57,6 +59,11 @@ class DumpCommand : public ResourceDumpCommand bool validate() override; + resource_dump_segment_header read_header(size_t segment_idx); + + // Returns true <-> dump contains an error segment, if returns true also puts the error message + bool get_error_message(std::string& error_message); + const std::string to_string() const override; private: diff --git a/resourcetools/resourcedump_lib/src/commands/query_command.cpp b/resourcetools/resourcedump_lib/src/commands/query_command.cpp index 55b57b26..d3192f82 100644 --- a/resourcetools/resourcedump_lib/src/commands/query_command.cpp +++ b/resourcetools/resourcedump_lib/src/commands/query_command.cpp @@ -48,7 +48,7 @@ namespace resource_dump using namespace std; QueryCommand::QueryCommand(device_attributes device_attrs) : - ResourceDumpCommand{device_attrs, dump_request{static_cast(SegmentType::menu)}, 0, false}, + ResourceDumpCommand{device_attrs, dump_request{static_cast(SegmentType::menu), 0, 0, 0, 0}, 0, false}, _sstream{make_shared()} { _ostream = _sstream; @@ -90,7 +90,7 @@ RecordList::RecordList(string&& retrieved_data) : _full_data(move(retrieved_data // Switch endianness of char* to represent strings } -const uint16_t RecordList::size() +uint16_t RecordList::size() { return _size; } diff --git a/resourcetools/resourcedump_lib/src/commands/query_command.h b/resourcetools/resourcedump_lib/src/commands/query_command.h index 284bed4e..5aa303df 100644 --- a/resourcetools/resourcedump_lib/src/commands/query_command.h +++ b/resourcetools/resourcedump_lib/src/commands/query_command.h @@ -49,7 +49,7 @@ class RecordList RecordList() = default; const menu_record_data& operator*(); const menu_record_data& operator[](const uint16_t idx); - const uint16_t size(); + uint16_t size(); private: uint16_t _size; diff --git a/resourcetools/resourcedump_lib/src/commands/resource_dump_command.cpp b/resourcetools/resourcedump_lib/src/commands/resource_dump_command.cpp index b4efa163..1be2d8f2 100644 --- a/resourcetools/resourcedump_lib/src/commands/resource_dump_command.cpp +++ b/resourcetools/resourcedump_lib/src/commands/resource_dump_command.cpp @@ -87,7 +87,7 @@ void ResourceDumpCommand::execute() void ResourceDumpCommand::parse_data() { - resource_dump_segment_header header_buffer{0}; + resource_dump_segment_header header_buffer{0, 0}; _istream->seekg(0); for (size_t pos = _istream->tellg(); pos < _dumped_size; pos = _istream->tellg()) @@ -98,12 +98,12 @@ void ResourceDumpCommand::parse_data() } } -const size_t ResourceDumpCommand::get_dumped_size() const +size_t ResourceDumpCommand::get_dumped_size() const { return _dumped_size; } -const bool ResourceDumpCommand::data_fetched() const +bool ResourceDumpCommand::data_fetched() const { return _data_fetched; } diff --git a/resourcetools/resourcedump_lib/src/commands/resource_dump_command.h b/resourcetools/resourcedump_lib/src/commands/resource_dump_command.h index bcd9a78f..dbee8b1a 100644 --- a/resourcetools/resourcedump_lib/src/commands/resource_dump_command.h +++ b/resourcetools/resourcedump_lib/src/commands/resource_dump_command.h @@ -53,8 +53,8 @@ class ResourceDumpCommand { public: virtual void execute() final; - const size_t get_dumped_size() const; - const bool data_fetched() const; + size_t get_dumped_size() const; + bool data_fetched() const; const std::vector& get_segment_offsets() const; std::istream& get_native_stream(); diff --git a/resourcetools/resourcedump_lib/src/common/resource_dump_types.h b/resourcetools/resourcedump_lib/src/common/resource_dump_types.h index d5e05768..d3a6e474 100644 --- a/resourcetools/resourcedump_lib/src/common/resource_dump_types.h +++ b/resourcetools/resourcedump_lib/src/common/resource_dump_types.h @@ -60,10 +60,12 @@ enum arg_attr_t constexpr const char* AUTO_RDMA_NAME = "__AUTO__"; constexpr uint8_t NUM_INLINE_DATA_DWORDS = 52; constexpr uint16_t DEFAULT_VHCA = (uint16_t)-1; +constexpr uint32_t INFINITE_DEPTH = (uint32_t)-1; #else #define AUTO_RDMA_NAME "__AUTO__" #define NUM_INLINE_DATA_DWORDS 52 #define DEFAULT_VHCA ((uint16_t)-1) +#define INFINITE_DEPTH ((uint32_t)-1) #endif typedef struct device_attributes diff --git a/resourcetools/resourcedump_lib/src/fetchers/fetcher.h b/resourcetools/resourcedump_lib/src/fetchers/fetcher.h index 31e0f347..d88caef6 100644 --- a/resourcetools/resourcedump_lib/src/fetchers/fetcher.h +++ b/resourcetools/resourcedump_lib/src/fetchers/fetcher.h @@ -51,6 +51,8 @@ class Fetcher virtual ~Fetcher() = default; virtual void set_streams(std::shared_ptr os, std::shared_ptr is) { + (void)os; + (void)is; static_assert(true, "Abstract class, unimplemented"); }; virtual void fetch_data() { static_assert(true, "Abstract class, unimplemented"); }; diff --git a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.cpp b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.cpp index b83226bd..d3900d1f 100644 --- a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.cpp +++ b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.cpp @@ -35,6 +35,7 @@ #include "resource_dump_types.h" #include "reg_access/reg_access.h" +#include "dev_mgt/tools_dev_types.h" #include @@ -99,7 +100,7 @@ void RegAccessResourceDumpFetcher::fetch_data() retrieve_from_reg_access(); - resource_dump_segment_header header_buffer{0}; + resource_dump_segment_header header_buffer{0, 0}; uint32_t level{0}; uint32_t prev_level_refs{1}; @@ -110,7 +111,10 @@ void RegAccessResourceDumpFetcher::fetch_data() while (level < _depth && _ostream->tellp() - _istream->tellg() > 0) { _istream->read(reinterpret_cast(&header_buffer), sizeof(resource_dump_segment_header)); - + if (header_buffer.length_dw * 4 < sizeof(resource_dump_segment_header)) + { + throw ResourceDumpException(ResourceDumpException::Reason::SEGMENT_DATA_TOO_SHORT); + } if (header_buffer.segment_type == static_cast(SegmentType::reference)) { _istream->read(reinterpret_cast(&_segment_params), sizeof(reference_segment_data)); @@ -134,7 +138,7 @@ void RegAccessResourceDumpFetcher::fetch_data() } catch (const istream::failure& e) { - if (_istream->eof()) + if (_istream->fail()) { throw ResourceDumpException(ResourceDumpException::Reason::SEGMENT_DATA_TOO_SHORT); } @@ -149,7 +153,15 @@ void RegAccessResourceDumpFetcher::retrieve_from_reg_access() do { - reg_access_status_t res = reg_access_res_dump(_mf, REG_ACCESS_METHOD_GET, &_reg_access_layout); + dm_dev_id_t dev_id = DeviceUnknown; + u_int32_t hw_id, hw_rev; + dm_get_device_id(_mf, &dev_id, &hw_id, &hw_rev); + /***********************************************************/ + /*********************** ATTENTION *************************/ + /******** The functions below must be equivalent ***********/ + /** Changes in them should be made both in switch and nic **/ + auto reg_access_func = dm_dev_is_hca(dev_id) ? reg_access_res_dump : reg_access_mord; + reg_access_status_t res = reg_access_func(_mf, REG_ACCESS_METHOD_GET, &_reg_access_layout); if (res != ME_REG_ACCESS_OK) { throw ResourceDumpException(ResourceDumpException::Reason::SEND_REG_ACCESS_FAILED, res); diff --git a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.h b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.h index 658d7dd2..690d90ca 100644 --- a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.h +++ b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_fetcher.h @@ -79,7 +79,7 @@ class RegAccessResourceDumpFetcher : public Fetcher shared_ptr _istream; reference_segment_data _segment_params; - reg_access_hca_resource_dump_ext _reg_access_layout{0}; + reg_access_hca_resource_dump_ext _reg_access_layout{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0}}; private: void retrieve_from_reg_access(); diff --git a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_mkey_fetcher.cpp b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_mkey_fetcher.cpp index 330e1657..74615b69 100644 --- a/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_mkey_fetcher.cpp +++ b/resourcetools/resourcedump_lib/src/fetchers/reg_access_resource_dump_mkey_fetcher.cpp @@ -184,29 +184,26 @@ void RegAccessResourceDumpMkeyFetcher::init_ibv_context(const string rdma_name) } ibv_device_list = ibv_get_device_list(&num_ibv_devices); - if (ibv_device_list) + if (!ibv_device_list) + { + throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_GET_DEVICE_LIST_FAILED); + } + for (i = 0; i < num_ibv_devices; ++i) { - for (i = 0; i < num_ibv_devices; ++i) + if (ibv_device_list[i] != NULL && + strcmp(ibv_get_device_name(ibv_device_list[i]), device_rdma_name_buffer) == 0) { - if (ibv_device_list[i] != NULL && - strcmp(ibv_get_device_name(ibv_device_list[i]), device_rdma_name_buffer) == 0) + _ibv_context = mlx5dv_open_device(ibv_device_list[i], my_context_attr); + if (!_ibv_context) { - _ibv_context = mlx5dv_open_device(ibv_device_list[i], my_context_attr); - if (!_ibv_context) - { - throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_MLX5DV_OPEN_FAILED); - } - return; + throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_MLX5DV_OPEN_FAILED); } - } - if (!_ibv_context) - { - throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_RDMA_NAME_INVALID); + break; } } - else + if (!_ibv_context) { - throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_GET_DEVICE_LIST_FAILED); + throw ResourceDumpException(ResourceDumpException::Reason::MKEY_FETCHER_RDMA_NAME_INVALID); } } catch (...) diff --git a/resourcetools/resourcedump_lib/src/filters/include_exclude_segments_filter.cpp b/resourcetools/resourcedump_lib/src/filters/include_exclude_segments_filter.cpp index d244b688..47bd71ea 100644 --- a/resourcetools/resourcedump_lib/src/filters/include_exclude_segments_filter.cpp +++ b/resourcetools/resourcedump_lib/src/filters/include_exclude_segments_filter.cpp @@ -61,7 +61,7 @@ string IncludeExcludeSegmentsFilter::get_big_endian_string() Filter::FilteredView IncludeExcludeSegmentsFilter::_apply() { - resource_dump_segment_header header_buffer{0}; + resource_dump_segment_header header_buffer{0, 0}; istream& parsed_istream = _command.get_native_stream(); bool include; @@ -76,7 +76,7 @@ Filter::FilteredView IncludeExcludeSegmentsFilter::_apply() if (include) { _filtered_stream.write(reinterpret_cast(&header_buffer), sizeof(resource_dump_segment_header)); - uint16_t segment_payload_size = 4 * header_buffer.length_dw - sizeof(resource_dump_segment_header); + uint32_t segment_payload_size = 4 * header_buffer.length_dw - sizeof(resource_dump_segment_header); copy_n(istreambuf_iterator(parsed_istream), segment_payload_size, ostreambuf_iterator(_filtered_stream)); diff --git a/resourcetools/resourcedump_lib/src/sdk/resource_dump_sdk.cpp b/resourcetools/resourcedump_lib/src/sdk/resource_dump_sdk.cpp index 7abda8b3..a6c04007 100644 --- a/resourcetools/resourcedump_lib/src/sdk/resource_dump_sdk.cpp +++ b/resourcetools/resourcedump_lib/src/sdk/resource_dump_sdk.cpp @@ -58,8 +58,16 @@ enum result_t query_command.execute(); - auto record_data_size = sizeof(mft::resource_dump::menu_record_data) * query_command.menu_records.size(); - available_resources->num_of_resources = query_command.menu_records.size(); + auto record_data_count = query_command.menu_records.size(); + auto record_data_size = sizeof(mft::resource_dump::menu_record_data) * record_data_count; + + if (record_data_count > available_resources->num_of_resources) + { + throw mft::resource_dump::ResourceDumpException( + mft::resource_dump::ResourceDumpException::Reason::BUFFER_TOO_SMALL); + } + + available_resources->num_of_resources = record_data_count; if (__BYTE_ORDER != __BIG_ENDIAN && endianess == endianess_t::RD_BIG_ENDIAN) { diff --git a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments.h b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments.h index 93bb1bb1..1f84008b 100644 --- a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments.h +++ b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments.h @@ -30,9 +30,37 @@ * SOFTWARE. */ +#ifndef RESOURCE_DUMP_SEGMENT_H +#define RESOURCE_DUMP_SEGMENT_H + #include #if __BYTE_ORDER == __BIG_ENDIAN #include "resource_dump_segments_be.h" #else #include "resource_dump_segments_le.h" #endif + +#ifdef __cplusplus +namespace mft +{ +namespace resource_dump +{ +#endif + +#ifdef __cplusplus +constexpr +#else +inline +#endif + uint32_t + to_segment_data_size(uint16_t length_dw) +{ + return length_dw * 4 - (sizeof(resource_dump_segment_header_t) + sizeof(resource_segment_sub_header_t)); +} + +#ifdef __cplusplus +} // namespace resource_dump +} // namespace mft +#endif + +#endif // RESOURCE_DUMP_SEGMENT_H diff --git a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_be.h b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_be.h index ac23afbd..e1d52cc6 100644 --- a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_be.h +++ b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_be.h @@ -30,8 +30,8 @@ * SOFTWARE. */ -#ifndef RESOURCE_DUMP_SEGMENT_H -#define RESOURCE_DUMP_SEGMENT_H +#ifndef RESOURCE_DUMP_SEGMENT_BE_H +#define RESOURCE_DUMP_SEGMENT_BE_H #include @@ -73,6 +73,7 @@ typedef struct segment_params_data typedef struct resource_segment_sub_header { + uint32_t reserved; uint32_t index1; uint32_t index2; } resource_segment_sub_header_t; @@ -145,4 +146,4 @@ typedef struct menu_record_data } // namespace mft #endif -#endif // RESOURCE_DUMP_SEGMENT_H +#endif // RESOURCE_DUMP_SEGMENT_BE_H diff --git a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_le.h b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_le.h index a8f05ef5..597e4786 100644 --- a/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_le.h +++ b/resourcetools/resourcedump_lib/src/segments/resource_dump_segments_le.h @@ -30,8 +30,8 @@ * SOFTWARE. */ -#ifndef RESOURCE_DUMP_SEGMENT_H -#define RESOURCE_DUMP_SEGMENT_H +#ifndef RESOURCE_DUMP_SEGMENT_LE_H +#define RESOURCE_DUMP_SEGMENT_LE_H #include @@ -73,6 +73,7 @@ typedef struct segment_params_data typedef struct resource_segment_sub_header { + uint32_t reserved; uint32_t index1; uint32_t index2; } resource_segment_sub_header_t; @@ -144,4 +145,4 @@ typedef struct menu_record_data } // namespace mft #endif -#endif // RESOURCE_DUMP_SEGMENT_H +#endif // RESOURCE_DUMP_SEGMENT_LE_H diff --git a/resourcetools/segments/ResourceSegment.py b/resourcetools/segments/ResourceSegment.py index 37673220..9efc5ff9 100644 --- a/resourcetools/segments/ResourceSegment.py +++ b/resourcetools/segments/ResourceSegment.py @@ -73,7 +73,8 @@ def unpack_aggregate_bit(self): return aggregate_dword & self.AGGREGATE_BIT_MASK def aggregate(self, other): - self.raw_data += other.raw_data[16:] + data_start = self.segment_header_struct.size + self.aggregate_dword_struct.size + self.indices_struct.size + self.raw_data += other.raw_data[data_start:] def unpack_indices(self): index1, index2 = self.indices_struct.unpack_from(self.raw_data, self.segment_header_struct.size + self.aggregate_dword_struct.size) diff --git a/small_utils/mlxfwresetlib/cmd_reg_mfrl.py b/small_utils/mlxfwresetlib/cmd_reg_mfrl.py index a89d1197..4b72aa43 100755 --- a/small_utils/mlxfwresetlib/cmd_reg_mfrl.py +++ b/small_utils/mlxfwresetlib/cmd_reg_mfrl.py @@ -253,6 +253,9 @@ def is_default_reset_level(self, reset_level): def is_reset_state_in_progress(self): return True if self._reset_state == CmdRegMfrl.RESET_STATE_ARM_OS_SHUTDOWN_IN_PROGRESS else False + def is_arm_reset(self, reset_type): + return False if reset_type in [CmdRegMfrl.PHY_LESS, CmdRegMfrl.NIC_ONLY] else True + def read(self): # Read register ('get' command) from device reg = self._read_reg() diff --git a/small_utils/mstfwreset.py b/small_utils/mstfwreset.py index c93ab69b..67075132 100644 --- a/small_utils/mstfwreset.py +++ b/small_utils/mstfwreset.py @@ -123,8 +123,7 @@ class SyncOwner(): # Supported devices. SUPP_DEVICES = ["ConnectIB", "ConnectX4", "ConnectX4LX", "ConnectX5", "BlueField", "ConnectX6", "ConnectX6DX", "ConnectX6LX", "BlueField2", "ConnectX7", "BlueField3", "ConnectX8", "BlueField4"] -SUPP_SWITCH_DEVICES = ["Spectrum", "Spectrum-2", "Spectrum-3", "Spectrum-4", - "Switch-IB", "Switch-IB-2", "Quantum", "Quantum-2", "Quantum-3"] +SUPP_SWITCH_DEVICES = ["Spectrum", "Spectrum-2", "Spectrum-3", "Switch-IB", "Switch-IB-2", "Quantum", "Quantum-2"] SUPP_OS = ["FreeBSD", "Linux", "Windows"] IS_MSTFLINT = os.path.basename(__file__) == "mstfwreset.py" @@ -805,13 +804,27 @@ def getPciOpObj(self, dbdf): else: raise RuntimeError("Unsupported OS: %s" % operatingSystem) + +def CloseAndMstRestart(lspci_valdation=True): + # We close MstDevObj to allow a clean operation of mst restart + MstDevObj.close() + for MstDevObjSD in MstDevObjsSD: + MstDevObjSD.close() + + if SkipMstRestart == False and platform.system() == "Linux" and not IS_MSTFLINT: + printAndFlush("-I- %-40s-" % ("Restarting MST"), endChar="") + if mstRestart(lspci_valdation) == 0: + printAndFlush("Done") + else: + printAndFlush("Skipped") + ###################################################################### # Description: Perform mst restart # OS Support : Linux. ###################################################################### -def mstRestart(busId): +def mstRestart(lspci_valdation): global MstFlags if platform.system() == "FreeBSD" or platform.system() == "Windows": return 1 @@ -833,22 +846,23 @@ def mstRestart(busId): else: time.sleep(2) - cmd = "lspci -s %s" % busId - logger.debug('Execute {0}'.format(cmd)) - foundBus = False - rc = 0 - for _ in range(0, 30): - (rc, stdout, _) = cmdExec(cmd) - if rc == 0 and stdout != "": - foundBus = True - break - else: - time.sleep(2) - if rc != 0: - raise WarningException( - "Failed to run lspci command, please restart MST manually") - if not foundBus: - raise RuntimeError("The device is not appearing in lspci output!") + if lspci_valdation is True: + cmd = "lspci -s %s" % DevDBDF + logger.debug('Execute {0}'.format(cmd)) + foundBus = False + rc = 0 + for _ in range(0, 30): + (rc, stdout, _) = cmdExec(cmd) + if rc == 0 and stdout != "": + foundBus = True + break + else: + time.sleep(2) + if rc != 0: + raise WarningException( + "Failed to run lspci command, please restart MST manually") + if not foundBus: + raise RuntimeError("The device is not appearing in lspci output!") ignore_signals() cmd = "/etc/init.d/mst restart %s" % MstFlags @@ -1634,17 +1648,8 @@ def resetFlow(device, devicesSD, reset_level, reset_type, cmdLineArgs, mfrl): logger.debug('UpdateUptimeAfterReset') FWResetStatusChecker.UpdateUptimeAfterReset() - # we close MstDevObj to allow a clean operation of mst restart - MstDevObj.close() - for MstDevObjSD in MstDevObjsSD: # Roei close mst devices for all "other" devices - MstDevObjSD.close() + CloseAndMstRestart() - if SkipMstRestart == False and platform.system() == "Linux" and not IS_MSTFLINT: - printAndFlush("-I- %-40s-" % ("Restarting MST"), endChar="") - if mstRestart(DevDBDF) == 0: - printAndFlush("Done") - else: - printAndFlush("Skipped") except Exception as e: reset_fsm_register() printAndFlush("Failed") @@ -1784,6 +1789,11 @@ def execute_driver_sync_reset(mfrl, reset_level, reset_type): logger.debug('UpdateUptimeAfterReset') FWResetStatusChecker.UpdateUptimeAfterReset() + # When Hotplug is activated, resetting the device causes the bdf to change. + # As a result, running lspci on the previously known bdf will not be successful due to the altered bdf. + # Running mst restart is necessary to re-enumerate the mst devices. + CloseAndMstRestart(lspci_valdation=False) + ###################################################################### # Description: execute sync 1 reset for BF ###################################################################### @@ -2074,7 +2084,9 @@ def reset_flow_host(device, args, command): print("-W- PCI rescan is required after device reset.") if is_bluefield: - print("Please be aware that resetting the Bluefield may take several minutes. Exiting the process in the middle of the waiting period will not halt the reset") + print("Please be aware that resetting the Bluefield may take several minutes. Exiting the process in the middle of the waiting period will not halt the reset.") + if mfrl.is_arm_reset(reset_type): + print("The ARM side will be restarted, and it will be unavailable for a while.") AskUser("Continue with reset", args.yes) execResLvl(device, devicesSD, reset_level, diff --git a/tools_crypto/Makefile.am b/tools_crypto/Makefile.am index 9c1b53f5..21795747 100644 --- a/tools_crypto/Makefile.am +++ b/tools_crypto/Makefile.am @@ -33,7 +33,7 @@ # Makefile.am -- Process this file with automake to produce Makefile.in USER_DIR = $(top_srcdir) AM_CPPFLAGS = -I$(USER_DIR) -I$(USER_DIR)/common $(COMPILER_FPIC) -AM_CFLAGS = -MD -pipe -Wall -W -DMST_UL -g $(COMPILER_FPIC) +AM_CFLAGS = -MD -pipe -Wall -W -DMST_UL -g $(COMPILER_FPIC) -Wno-deprecated-declarations noinst_LIBRARIES = libtools_crypto.a libtools_crypto_a_SOURCES = tools_md5.c tools_md5.h diff --git a/tools_layouts/adb/prm/hca/ext/register_access_table.adb b/tools_layouts/adb/prm/hca/ext/register_access_table.adb index a94d3e63..cbc74c46 100644 --- a/tools_layouts/adb/prm/hca/ext/register_access_table.adb +++ b/tools_layouts/adb/prm/hca/ext/register_access_table.adb @@ -121,7 +121,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -177,8 +177,17 @@ + + + + + + + + + - + @@ -192,6 +201,7 @@ + @@ -214,7 +224,7 @@ - + @@ -244,6 +254,7 @@ + @@ -275,7 +286,7 @@ - + @@ -291,6 +302,7 @@ + @@ -319,6 +331,11 @@ + + + + + @@ -365,7 +382,7 @@ - + @@ -459,7 +476,7 @@ - + @@ -844,7 +861,7 @@ - + @@ -858,18 +875,18 @@ - + - + - + - - + + @@ -882,7 +899,7 @@ - + @@ -901,9 +918,10 @@ + - + @@ -916,9 +934,9 @@ - - - + + + @@ -942,7 +960,7 @@ - + @@ -985,7 +1003,7 @@ - + @@ -993,18 +1011,18 @@ - - + + - + - + @@ -1046,6 +1064,12 @@ + + + + + + @@ -1079,12 +1103,13 @@ + - + @@ -1100,10 +1125,10 @@ - - - - + + + + @@ -1131,16 +1156,19 @@ + - + + + @@ -1184,14 +1212,14 @@ - + - + @@ -1250,11 +1278,11 @@ - + - + @@ -1303,7 +1331,7 @@ - + @@ -1357,17 +1385,17 @@ - + - + - - - - + + + + @@ -1543,7 +1571,7 @@ - + @@ -1577,7 +1605,7 @@ - + @@ -1607,7 +1635,7 @@ - + @@ -1675,9 +1703,9 @@ - - - + + + @@ -1688,15 +1716,15 @@ - + - + - + @@ -1778,7 +1806,7 @@ - + @@ -1881,13 +1909,14 @@ + - + @@ -1905,16 +1934,16 @@ - - - - - + + + + + - - + + @@ -1944,7 +1973,7 @@ - + @@ -1957,7 +1986,7 @@ - + @@ -1999,7 +2028,7 @@ - + @@ -2009,8 +2038,8 @@ - - + + @@ -2163,9 +2192,9 @@ - + - + @@ -2191,7 +2220,7 @@ - + @@ -2265,20 +2294,22 @@ - + + - + - - + + - + + @@ -2345,11 +2376,12 @@ - + - - + + + @@ -2444,8 +2476,8 @@ - - + + @@ -2471,19 +2503,19 @@ - + - - + + - + @@ -2507,7 +2539,7 @@ - + @@ -2543,7 +2575,7 @@ - + @@ -2571,20 +2603,14 @@ - + - - - - - - @@ -2664,11 +2690,12 @@ - + + @@ -2679,12 +2706,12 @@ - - + + - + @@ -2700,7 +2727,7 @@ - + @@ -2715,8 +2742,7 @@ - - + @@ -2726,7 +2752,7 @@ - + @@ -2757,13 +2783,27 @@ + + + + + + + + + + + + + + - - + + @@ -2784,7 +2824,7 @@ - + @@ -2806,7 +2846,7 @@ - + @@ -2856,7 +2896,7 @@ - + @@ -2901,10 +2941,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2940,7 +3059,7 @@ - + @@ -2982,7 +3101,7 @@ - + @@ -2997,7 +3116,7 @@ - + @@ -3038,6 +3157,7 @@ + @@ -3050,11 +3170,11 @@ - + - + - + @@ -3090,7 +3210,7 @@ - + diff --git a/tools_layouts/adb/prm/switch/ext/register_access_table.adb b/tools_layouts/adb/prm/switch/ext/register_access_table.adb index 22057ca2..ab8e1df9 100644 --- a/tools_layouts/adb/prm/switch/ext/register_access_table.adb +++ b/tools_layouts/adb/prm/switch/ext/register_access_table.adb @@ -35,7 +35,7 @@ - + @@ -59,12 +59,12 @@ - + - + @@ -203,6 +203,11 @@ + + + + + @@ -211,14 +216,15 @@ - + - - - + + + + @@ -229,15 +235,74 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -281,7 +346,9 @@ - + + + @@ -289,11 +356,11 @@ - + - + @@ -305,7 +372,7 @@ - + @@ -317,7 +384,7 @@ - + @@ -327,16 +394,16 @@ - + - + - + @@ -394,24 +461,31 @@ - + + + + + + + - + + - + @@ -419,6 +493,7 @@ + @@ -477,18 +552,19 @@ + + - - + @@ -552,7 +628,7 @@ - + @@ -576,6 +652,8 @@ + + @@ -593,13 +671,17 @@ + - + + + + @@ -624,7 +706,8 @@ - + + @@ -826,7 +909,7 @@ - + @@ -899,13 +982,22 @@ + + + + + + + + + - + - - + + @@ -971,7 +1063,7 @@ - + @@ -1065,7 +1157,7 @@ - + @@ -1138,21 +1230,11 @@ - - - - - - - - - - - + - + @@ -1160,7 +1242,7 @@ - + @@ -1177,7 +1259,7 @@ - + @@ -1214,9 +1296,9 @@ - - - + + + @@ -1523,14 +1605,6 @@ - - - - - - - - @@ -1546,7 +1620,7 @@ - + @@ -1557,7 +1631,7 @@ - + @@ -1583,6 +1657,21 @@ + + + + + + + + + + + + + + + @@ -1645,13 +1734,13 @@ - + - + @@ -1676,7 +1765,7 @@ - + @@ -1687,7 +1776,7 @@ - + @@ -1710,10 +1799,10 @@ - - - - + + + + @@ -1726,21 +1815,21 @@ - - - + + + - + - + @@ -1748,11 +1837,11 @@ - - - - - + + + + + @@ -1804,7 +1893,7 @@ - + @@ -1818,7 +1907,7 @@ - + @@ -1841,7 +1930,7 @@ - + @@ -1851,7 +1940,7 @@ - + @@ -1859,22 +1948,6 @@ - - - - - - - - - - - - - - - - @@ -1888,8 +1961,8 @@ - - + + @@ -1966,7 +2039,7 @@ - + @@ -1976,7 +2049,7 @@ - + @@ -1996,12 +2069,12 @@ - + - + - - + + @@ -2014,7 +2087,7 @@ - + @@ -2026,17 +2099,17 @@ - - + + - + - + - + @@ -2050,7 +2123,7 @@ - + @@ -2072,16 +2145,16 @@ - - + + - + - + @@ -2109,9 +2182,16 @@ - - - + + + + + + + + + + @@ -2136,27 +2216,27 @@ - + - + - + - + - + @@ -2200,12 +2280,12 @@ - + - + @@ -2225,16 +2305,16 @@ - + - + - + @@ -2242,14 +2322,14 @@ - + - + @@ -2272,13 +2352,13 @@ - + - + - + @@ -2297,7 +2377,7 @@ - + @@ -2323,24 +2403,19 @@ - + - - - - - - + - + @@ -2363,7 +2438,7 @@ - + @@ -2376,7 +2451,7 @@ - + @@ -2386,7 +2461,7 @@ - + @@ -2404,13 +2479,13 @@ - + - + @@ -2426,7 +2501,7 @@ - + @@ -2436,11 +2511,11 @@ - + - + @@ -2457,6 +2532,10 @@ + + + + @@ -2464,7 +2543,7 @@ - + @@ -2472,7 +2551,7 @@ - + @@ -2485,7 +2564,7 @@ - + @@ -2521,8 +2600,8 @@ - - + + @@ -2601,7 +2680,7 @@ - + @@ -2609,14 +2688,14 @@ - - + + - + @@ -2632,7 +2711,7 @@ - + @@ -2682,7 +2761,7 @@ - + @@ -2705,7 +2784,7 @@ - + @@ -2802,6 +2881,12 @@ + + + + + + @@ -2809,39 +2894,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2927,7 +2979,7 @@ - + @@ -2948,7 +3000,7 @@ - + @@ -2964,10 +3016,10 @@ - - - - + + + + @@ -2995,17 +3047,18 @@ + - - + + - + @@ -3030,8 +3083,8 @@ - - + + @@ -3041,7 +3094,7 @@ - + @@ -3050,7 +3103,7 @@ - + @@ -3081,10 +3134,10 @@ - + - + @@ -3103,7 +3156,7 @@ - + @@ -3125,7 +3178,7 @@ - + @@ -3145,18 +3198,18 @@ - + - + - + @@ -3169,7 +3222,7 @@ - + @@ -3184,15 +3237,19 @@ + - + - + - + + + + @@ -3223,8 +3280,12 @@ + + + + - + @@ -3314,7 +3375,7 @@ - + @@ -3324,9 +3385,9 @@ - - - + + + @@ -3341,7 +3402,7 @@ - + @@ -3353,7 +3414,7 @@ - + @@ -3362,7 +3423,7 @@ - + @@ -3410,7 +3471,7 @@ - + @@ -3429,7 +3490,7 @@ - + @@ -3442,7 +3503,7 @@ - + @@ -3457,10 +3518,10 @@ - + - + @@ -3472,10 +3533,10 @@ - - - - + + + + @@ -3516,7 +3577,7 @@ - + @@ -3559,16 +3620,16 @@ - + - + - + @@ -3584,7 +3645,7 @@ - + @@ -3609,8 +3670,8 @@ - - + + @@ -3638,16 +3699,16 @@ - + - + - - - + + + @@ -3663,8 +3724,8 @@ - - + + @@ -3676,8 +3737,8 @@ - - + + @@ -3692,8 +3753,8 @@ - - + + @@ -3707,19 +3768,19 @@ - + - - - + + + - + @@ -3739,7 +3800,7 @@ - + @@ -3749,7 +3810,7 @@ - + @@ -3757,12 +3818,13 @@ - - - - - + + + + + + @@ -3796,6 +3858,11 @@ + + + + + @@ -3807,7 +3874,7 @@ - + @@ -3821,14 +3888,14 @@ - + - + @@ -3931,6 +3998,7 @@ + @@ -3976,7 +4044,7 @@ - + @@ -3988,12 +4056,12 @@ - + - - + + @@ -4025,7 +4093,7 @@ - + @@ -4039,7 +4107,7 @@ - + @@ -4071,18 +4139,18 @@ - + - + - + @@ -4114,9 +4182,9 @@ - - - + + + @@ -4127,7 +4195,7 @@ - + @@ -4136,17 +4204,17 @@ - + - + - + @@ -4310,13 +4378,14 @@ + - + @@ -4334,16 +4403,16 @@ - - - - - + + + + + - - + + @@ -4373,7 +4442,7 @@ - + @@ -4386,7 +4455,7 @@ - + @@ -4396,7 +4465,7 @@ - + @@ -4417,7 +4486,7 @@ - + @@ -4431,7 +4500,7 @@ - + @@ -4439,8 +4508,8 @@ - - + + @@ -4485,14 +4554,14 @@ - + - + @@ -4538,7 +4607,7 @@ - + @@ -4554,8 +4623,8 @@ - - + + @@ -4573,7 +4642,7 @@ - + @@ -4589,25 +4658,25 @@ - - + + - - + + - - + + - - + + @@ -4615,7 +4684,7 @@ - + @@ -4634,7 +4703,7 @@ - + @@ -4710,8 +4779,8 @@ - - + + @@ -4750,7 +4819,7 @@ - + @@ -4762,7 +4831,7 @@ - + @@ -4879,9 +4948,9 @@ - + - + @@ -4936,7 +5005,7 @@ - + @@ -4961,7 +5030,7 @@ - + @@ -5052,20 +5121,22 @@ - + + - + - - + + - + + @@ -5100,7 +5171,7 @@ - + @@ -5171,14 +5242,25 @@ - + - - + + + + + + + + + + + + + @@ -5221,9 +5303,9 @@ - - - + + + @@ -5235,7 +5317,7 @@ - + @@ -5243,8 +5325,8 @@ - - + + @@ -5328,8 +5410,8 @@ - - + + @@ -5367,7 +5449,7 @@ - + @@ -5391,7 +5473,7 @@ - + @@ -5427,7 +5509,7 @@ - + @@ -5458,7 +5540,7 @@ - + @@ -5473,20 +5555,14 @@ - + - - - - - - @@ -5506,12 +5582,19 @@ - + + + + + + + + @@ -5535,6 +5618,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5563,6 +5685,21 @@ + + + + + + + + + + + + + + + @@ -5598,9 +5735,9 @@ - + - + @@ -5620,13 +5757,13 @@ - + - - - + + + @@ -5638,6 +5775,7 @@ + @@ -5647,6 +5785,15 @@ + + + + + + + + + @@ -5655,8 +5802,8 @@ - - + + @@ -5665,8 +5812,8 @@ - - + + @@ -5674,10 +5821,10 @@ - - + + - + @@ -5691,10 +5838,10 @@ - - + + - + @@ -5702,8 +5849,8 @@ - - + + @@ -5720,17 +5867,17 @@ - + - - + + - + @@ -5746,7 +5893,7 @@ - + @@ -5755,7 +5902,7 @@ - + @@ -5768,7 +5915,6 @@ - @@ -5779,7 +5925,7 @@ - + @@ -5804,7 +5950,7 @@ - + @@ -5848,7 +5994,7 @@ - + @@ -5880,13 +6026,13 @@ - + - - + + @@ -5954,25 +6100,25 @@ - + - + - + - + @@ -6008,7 +6154,7 @@ - + @@ -6067,7 +6213,7 @@ - + @@ -6079,7 +6225,7 @@ - + @@ -6091,7 +6237,7 @@ - + @@ -6146,7 +6292,7 @@ - + @@ -6161,8 +6307,15 @@ + + + + + + + - + @@ -6171,12 +6324,12 @@ - - + + - - - + + + @@ -6220,14 +6373,14 @@ - + - + @@ -6250,9 +6403,9 @@ - + - + @@ -6282,9 +6435,9 @@ - + - + @@ -6307,7 +6460,7 @@ - + @@ -6328,7 +6481,7 @@ - + @@ -6384,35 +6537,35 @@ - + - + - - - + + + - + - + - + @@ -6429,21 +6582,21 @@ - - - + + + - + - - + + @@ -6463,7 +6616,7 @@ - + @@ -6475,16 +6628,17 @@ + - + - + @@ -6494,7 +6648,7 @@ - + @@ -6551,15 +6705,15 @@ - + - + - + @@ -6573,9 +6727,9 @@ - - - + + + @@ -6584,9 +6738,9 @@ - + - + @@ -6594,7 +6748,7 @@ - + @@ -6609,16 +6763,23 @@ - + + + + + + + + - + @@ -6628,26 +6789,27 @@ + - - - + + + - + - + - + @@ -6656,11 +6818,6 @@ - - - - - @@ -6684,13 +6841,13 @@ - + - - - - + + + + @@ -6716,9 +6873,9 @@ - - - + + + @@ -6748,9 +6905,9 @@ - - - + + + @@ -6759,7 +6916,7 @@ - + @@ -6803,7 +6960,7 @@ - + @@ -6815,7 +6972,7 @@ - + @@ -6825,7 +6982,7 @@ - + @@ -6848,7 +7005,7 @@ - + @@ -6875,7 +7032,7 @@ - + @@ -6902,9 +7059,9 @@ - + - + @@ -6920,7 +7077,7 @@ - + @@ -6928,18 +7085,18 @@ - + - + - + @@ -6968,7 +7125,7 @@ - + @@ -6992,7 +7149,7 @@ - + @@ -7061,13 +7218,13 @@ - + - - + + @@ -7112,17 +7269,17 @@ - + - - + + - - + + @@ -7134,8 +7291,8 @@ - - + + @@ -7144,10 +7301,10 @@ - + - + @@ -7155,7 +7312,7 @@ - + @@ -7167,21 +7324,21 @@ - + - + - + - + @@ -7241,8 +7398,8 @@ - - + + @@ -7254,7 +7411,7 @@ - + @@ -7269,29 +7426,49 @@ - + - + - + - - + + - + - + + + + + + + + + + + + + + + + + + + + + @@ -7300,7 +7477,7 @@ - + @@ -7311,25 +7488,30 @@ - + - + - - + + - + - - + + + + + + + @@ -7340,7 +7522,7 @@ - + @@ -7356,9 +7538,9 @@ - + - + @@ -7366,9 +7548,9 @@ - + - + @@ -7387,9 +7569,9 @@ - - - + + + @@ -7402,17 +7584,17 @@ - + - - + + - + @@ -7421,11 +7603,16 @@ - + - + + + + + + @@ -7434,7 +7621,7 @@ - + @@ -7444,13 +7631,13 @@ - + - + @@ -7480,7 +7667,6 @@ - @@ -7524,7 +7710,7 @@ - + @@ -7566,7 +7752,7 @@ - + @@ -7581,7 +7767,7 @@ - + @@ -7622,6 +7808,7 @@ + @@ -7634,11 +7821,11 @@ - + - + @@ -7653,22 +7840,22 @@ - + - + - + - + @@ -7691,7 +7878,7 @@ - + @@ -7700,7 +7887,7 @@ - + @@ -7731,7 +7918,7 @@ - + @@ -7752,7 +7939,7 @@ - + @@ -7776,7 +7963,7 @@ - + @@ -7786,14 +7973,14 @@ - + - + @@ -7802,7 +7989,7 @@ - + @@ -7839,7 +8026,7 @@ - + @@ -7867,8 +8054,8 @@ - - + + @@ -7895,13 +8082,13 @@ - + - - - + + + @@ -7931,38 +8118,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -7970,7 +8126,7 @@ - + @@ -7984,19 +8140,19 @@ - + - + - - + + - + @@ -8034,7 +8190,7 @@ - + @@ -8043,7 +8199,7 @@ - + @@ -8051,16 +8207,16 @@ - + - + - + - - + + @@ -8084,17 +8240,17 @@ - + - - - - + + + + @@ -8110,7 +8266,7 @@ - + @@ -8132,11 +8288,11 @@ - + - + @@ -8155,12 +8311,12 @@ - - + + - + @@ -8173,11 +8329,11 @@ - + - + - + @@ -8192,12 +8348,12 @@ - + - + @@ -8240,11 +8396,11 @@ - + - + @@ -8289,7 +8445,7 @@ - + @@ -8424,7 +8580,7 @@ - + @@ -8461,9 +8617,9 @@ - + - + @@ -8492,10 +8648,10 @@ - + - + @@ -8516,7 +8672,7 @@ - + diff --git a/tools_layouts/icmd_hca_layouts.h b/tools_layouts/icmd_hca_layouts.h index 85a9d2ef..909b4ab7 100755 --- a/tools_layouts/icmd_hca_layouts.h +++ b/tools_layouts/icmd_hca_layouts.h @@ -33,9 +33,9 @@ /*** - *** This file was generated at "2023-07-19 14:43:13" + *** This file was generated at "2024-01-15 23:07:25" *** by: - *** > [REDACTED]/adb2pack.py --input adb/tools/icmd_hca.adb --file-prefix icmd_hca --prefix icmd_hca_ --no-adb-utils + *** > adb2pack.py --input adb/tools/icmd_hca.adb --file-prefix icmd_hca --prefix icmd_hca_ --no-adb-utils -o user/tools_layouts ***/ #ifndef ICMD_HCA_LAYOUTS_H #define ICMD_HCA_LAYOUTS_H @@ -126,12 +126,12 @@ struct icmd_hca_debug_cap { /* 0x0.16 - 0x0.20 */ u_int8_t log_min_resource_dump_eq; /* Description - If set, Resource_dump register is supported. -See Table 1383, "RESOURCE_DUMP Register Layout," on page 1853 */ +See Table 1439, "RESOURCE_DUMP Register Layout," on page 1726 */ /* 0x0.22 - 0x0.22 */ u_int8_t resource_dump; /* Description - Log(base 2) of the size in granularity of 4KB to be allocated by host in order to accommodate cr_dump. 0 means feature is not supported. -See Table 1381, "CORE_DUMP Register Layout," on page 1851 */ +See Table 1437, "CORE_DUMP Register Layout," on page 1724 */ /* 0x0.23 - 0x0.27 */ u_int8_t log_cr_dump_to_mem_size; /* Description - If set, Core dump of type of specific QP is supported. @@ -226,7 +226,7 @@ struct icmd_hca_icmd_query_cap_general { /* 0x0.13 - 0x0.13 */ u_int8_t nic_cap_reg; /* Description - If set, port_state_behavior register is supported. -See Section 26.2.27, "PORT_STATE_BEHAVIOR Register", on page 1864 */ +See Section 25.2.27, "PORT_STATE_BEHAVIOR Register", on page 1513 */ /* 0x0.14 - 0x0.14 */ u_int8_t port_state_behavior; /* Description - When set, virtual node GUID can be set/queried using ICMD_SET/QUERY_VIRTUAL_MAC */ @@ -235,10 +235,10 @@ See Section 26.2.27, "PORT_STATE_BEHAVIOR Register", on page 1864 */ /* Description - If set, NCFG register is supported. */ /* 0x0.16 - 0x0.16 */ u_int8_t ncfg_reg; - /* Description - If set, CWCAM register is supported. Table 1993, "CWCAM - Congestion WRED Capabilities Mask Register Layout," on page 2545 */ + /* Description - If set, CWCAM register is supported. Table 1934, "CWCAM - Congestion WRED Capabilities Mask Register Layout," on page 2242 */ /* 0x0.17 - 0x0.17 */ u_int8_t cwcam_reg; - /* Description - If set, SBCAM register is supported. See Table 2051, "SBCAM - Shared Buffer Capabilities Mask Register Layout," on page 2591 */ + /* Description - If set, SBCAM register is supported. See Table 1992, "SBCAM - Shared Buffer Capabilities Mask Register Layout," on page 2285 */ /* 0x0.18 - 0x0.18 */ u_int8_t sbcam_reg; /* Description - When set, the command supports capability groups in addition to the General Capability group */ @@ -253,16 +253,16 @@ See Section 26.2.27, "PORT_STATE_BEHAVIOR Register", on page 1864 */ /* Description - If set, CAPI is supported. */ /* 0x0.24 - 0x0.24 */ u_int8_t capi; - /* Description - If set, QCAM register is supported. Table 980, "QCAM - QoS Capabilities Mask Register Layout," on page 1341. */ + /* Description - If set, QCAM register is supported. Table 990, "QCAM - QoS Capabilities Mask Register Layout," on page 1187. */ /* 0x0.25 - 0x0.25 */ u_int8_t qcam_reg; - /* Description - If set, MCAM register is supported. Table 2264, "MCAM - Management Capabilities Mask Register Layout," on page 2768. */ + /* Description - If set, MCAM register is supported. Table 2233, "MCAM - Management Capabilities Mask Register Layout," on page 2474. */ /* 0x0.26 - 0x0.26 */ u_int8_t mcam_reg; - /* Description - If set, PCAM register is supported. Table 1434, "PCAM - Ports Capabilities Mask Register Layout," on page 1897 */ + /* Description - If set, PCAM register is supported. Table 1341, "PCAM - Ports Capabilities Mask Register Layout," on page 1546 */ /* 0x0.27 - 0x0.27 */ u_int8_t pcam_reg; - /* Description - When set, multi-host synchronization through the device is supported. Section 28.4.3, "ICMD_MH_SYNC - Multi-Host Synchronization," on page 3749. */ + /* Description - When set, multi-host synchronization through the device is supported. Section 27.4.3, "ICMD_MH_SYNC - Multi-Host Synchronization," on page 3402. */ /* 0x0.28 - 0x0.28 */ u_int8_t mh_sync; /* Description - If set, ICMD_ACCESS_REGISTER supports every register. (in the past it supported some of them). */ @@ -330,11 +330,11 @@ other values are reserved. */ /* Size in bytes - 16 */ struct icmd_hca_icmd_query_diagnostic_cntrs_in { /*---------------- DWORD[2] (Offset 0x8) ----------------*/ - /* Description - The sample_index is the first sample index. The sample index shall be in the range of 0 2^HCA_CAP.log_number_of_samples. See Section 27.3.4.11, "Debug Capabilities", on page 3048. */ + /* Description - The sample_index is the first sample index. The sample index shall be in the range of 0 2^HCA_CAP.log_number_of_samples. See Section 26.3.4.11, "Debug Capabilities", on page 2763. */ /* 0x8.0 - 0x8.15 */ u_int16_t sample_index; /* Description - The number of samples to return. -Device might return up to the configured value HCA_CAP.log_number_of_samples. (See Section 27.3.4.11, "Debug Capabilities", on page 3048). +Device might return up to the configured value HCA_CAP.log_number_of_samples. (See Section 26.3.4.11, "Debug Capabilities", on page 2763). Note that the device can perform roll over when reaching number_of_samples. For example: if the user asks for 256 samples starting from index 128, the result will be: 128, ,255,0, ,127. */ /* 0x8.16 - 0x8.31 */ u_int16_t num_of_samples; @@ -345,7 +345,7 @@ Note that the device can perform roll over when reaching number_of_samples. For struct icmd_hca_icmd_query_diagnostic_params_out { /*---------------- DWORD[2] (Offset 0x8) ----------------*/ /* Description - Diagnostic parameters context. -Table 3605, "DIAGNOSTIC_PARAMS_CONTEXT Input Structure Layout," on page 3626 */ +Table 3596, "DIAGNOSTIC_PARAMS_CONTEXT Input Structure Layout," on page 3345 */ /* 0x8.0 - 0x20.31 */ struct icmd_hca_diagnostic_params_context diagnostic_params_context; }; @@ -355,7 +355,7 @@ Table 3605, "DIAGNOSTIC_PARAMS_CONTEXT Input Structure Layout," on page 3626 * struct icmd_hca_icmd_set_diagnostic_params_in { /*---------------- DWORD[2] (Offset 0x8) ----------------*/ /* Description - Diagnostic parameters context. -Table 3605, "DIAGNOSTIC_PARAMS_CONTEXT Input Structure Layout," on page 3626 */ +Table 3596, "DIAGNOSTIC_PARAMS_CONTEXT Input Structure Layout," on page 3345 */ /* 0x8.0 - 0x20.31 */ struct icmd_hca_diagnostic_params_context diagnostic_params_context; }; diff --git a/tools_layouts/image_layout_layouts.c b/tools_layouts/image_layout_layouts.c index 41a74276..2aa42030 100644 --- a/tools_layouts/image_layout_layouts.c +++ b/tools_layouts/image_layout_layouts.c @@ -1702,6 +1702,8 @@ void image_layout_image_info_pack(const struct image_layout_image_info *ptr_stru image_layout_image_size_pack(&(ptr_struct->image_size), ptr_buff + offset / 8); offset = 2200; adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->synced_reset_downtime); + offset = 2192; + adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->dtoc_offset); offset = 2176; adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->toc_copy_ofst); for (i = 0; i < 4; ++i) { @@ -1799,6 +1801,8 @@ void image_layout_image_info_unpack(struct image_layout_image_info *ptr_struct, image_layout_image_size_unpack(&(ptr_struct->image_size), ptr_buff + offset / 8); offset = 2200; ptr_struct->synced_reset_downtime = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); + offset = 2192; + ptr_struct->dtoc_offset = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); offset = 2176; ptr_struct->toc_copy_ofst = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16); for (i = 0; i < 4; ++i) { @@ -1898,6 +1902,8 @@ void image_layout_image_info_print(const struct image_layout_image_info *ptr_str adb2c_add_indentation(fd, indent_level); fprintf(fd, "synced_reset_downtime : " UH_FMT "\n", ptr_struct->synced_reset_downtime); adb2c_add_indentation(fd, indent_level); + fprintf(fd, "dtoc_offset : " UH_FMT "\n", ptr_struct->dtoc_offset); + adb2c_add_indentation(fd, indent_level); fprintf(fd, "toc_copy_ofst : " UH_FMT "\n", ptr_struct->toc_copy_ofst); for (i = 0; i < 4; ++i) { adb2c_add_indentation(fd, indent_level); diff --git a/tools_layouts/image_layout_layouts.h b/tools_layouts/image_layout_layouts.h index 44cd4441..e29d6b1c 100644 --- a/tools_layouts/image_layout_layouts.h +++ b/tools_layouts/image_layout_layouts.h @@ -760,6 +760,10 @@ struct image_layout_image_info { /* Description - The needed 10s of ms timeout between the PCI link disable and PCI link enable. */ /* 0x110.0 - 0x110.7 */ u_int8_t synced_reset_downtime; +/*---------------- DWORD[68] (Offset 0x110) ----------------*/ + /* Description - */ + /* 0x110.8 - 0x110.15 */ + u_int8_t dtoc_offset; /*---------------- DWORD[68] (Offset 0x110) ----------------*/ /* Description - indication for tool where to locate toc header copy */ /* 0x110.16 - 0x110.31 */ diff --git a/tools_layouts/reg_access_hca_layouts.c b/tools_layouts/reg_access_hca_layouts.c index 1bc859ed..08b17224 100644 --- a/tools_layouts/reg_access_hca_layouts.c +++ b/tools_layouts/reg_access_hca_layouts.c @@ -30,6 +30,11 @@ * SOFTWARE. */ +/*** + *** This file was generated at "2024-01-15 23:07:24" + *** by: + *** > adb2pack.py --input adb/prm/hca/ext/reg_access_hca.adb --file-prefix reg_access_hca --prefix reg_access_hca_ --no-adb-utils -o user/tools_layouts + ***/ #include "reg_access_hca_layouts.h" void reg_access_hca_configuration_item_type_class_file_ext_pack(const struct reg_access_hca_configuration_item_type_class_file_ext *ptr_struct, u_int8_t *ptr_buff) @@ -1279,6 +1284,8 @@ void reg_access_hca_mgir_fw_info_ext_pack(const struct reg_access_hca_mgir_fw_in adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sec_boot); offset = 444; adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->encryption); + offset = 434; + adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->issu_able); } void reg_access_hca_mgir_fw_info_ext_unpack(struct reg_access_hca_mgir_fw_info_ext *ptr_struct, const u_int8_t *ptr_buff) @@ -1336,6 +1343,8 @@ void reg_access_hca_mgir_fw_info_ext_unpack(struct reg_access_hca_mgir_fw_info_e ptr_struct->sec_boot = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); offset = 444; ptr_struct->encryption = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); + offset = 434; + ptr_struct->issu_able = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); } void reg_access_hca_mgir_fw_info_ext_print(const struct reg_access_hca_mgir_fw_info_ext *ptr_struct, FILE *fd, int indent_level) @@ -1395,6 +1404,8 @@ void reg_access_hca_mgir_fw_info_ext_print(const struct reg_access_hca_mgir_fw_i fprintf(fd, "sec_boot : " UH_FMT "\n", ptr_struct->sec_boot); adb2c_add_indentation(fd, indent_level); fprintf(fd, "encryption : " UH_FMT "\n", ptr_struct->encryption); + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "issu_able : " UH_FMT "\n", ptr_struct->issu_able); } unsigned int reg_access_hca_mgir_fw_info_ext_size(void) @@ -1425,6 +1436,10 @@ void reg_access_hca_mgir_hardware_info_ext_pack(const struct reg_access_hca_mgir adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->hw_dev_id); offset = 144; adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->manufacturing_base_mac_47_32); + offset = 138; + adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->ga); + offset = 132; + adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->chip_type); offset = 160; adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->manufacturing_base_mac_31_0); offset = 224; @@ -1449,6 +1464,10 @@ void reg_access_hca_mgir_hardware_info_ext_unpack(struct reg_access_hca_mgir_har ptr_struct->hw_dev_id = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16); offset = 144; ptr_struct->manufacturing_base_mac_47_32 = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16); + offset = 138; + ptr_struct->ga = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6); + offset = 132; + ptr_struct->chip_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4); offset = 160; ptr_struct->manufacturing_base_mac_31_0 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4); offset = 224; @@ -1475,6 +1494,10 @@ void reg_access_hca_mgir_hardware_info_ext_print(const struct reg_access_hca_mgi adb2c_add_indentation(fd, indent_level); fprintf(fd, "manufacturing_base_mac_47_32 : " UH_FMT "\n", ptr_struct->manufacturing_base_mac_47_32); adb2c_add_indentation(fd, indent_level); + fprintf(fd, "ga : " UH_FMT "\n", ptr_struct->ga); + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "chip_type : " UH_FMT "\n", ptr_struct->chip_type); + adb2c_add_indentation(fd, indent_level); fprintf(fd, "manufacturing_base_mac_31_0 : " U32H_FMT "\n", ptr_struct->manufacturing_base_mac_31_0); adb2c_add_indentation(fd, indent_level); fprintf(fd, "uptime : " U32H_FMT "\n", ptr_struct->uptime); @@ -2160,6 +2183,8 @@ void reg_access_hca_mcia_ext_pack(const struct reg_access_hca_mcia_ext *ptr_stru adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->slot_index); offset = 8; adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->module); + offset = 2; + adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pnv); offset = 0; adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->l); offset = 48; @@ -2195,6 +2220,8 @@ void reg_access_hca_mcia_ext_unpack(struct reg_access_hca_mcia_ext *ptr_struct, ptr_struct->slot_index = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4); offset = 8; ptr_struct->module = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); + offset = 2; + ptr_struct->pnv = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); offset = 0; ptr_struct->l = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); offset = 48; @@ -2233,6 +2260,8 @@ void reg_access_hca_mcia_ext_print(const struct reg_access_hca_mcia_ext *ptr_str adb2c_add_indentation(fd, indent_level); fprintf(fd, "module : " UH_FMT "\n", ptr_struct->module); adb2c_add_indentation(fd, indent_level); + fprintf(fd, "pnv : " UH_FMT "\n", ptr_struct->pnv); + adb2c_add_indentation(fd, indent_level); fprintf(fd, "l : " UH_FMT "\n", ptr_struct->l); adb2c_add_indentation(fd, indent_level); fprintf(fd, "device_address : " UH_FMT "\n", ptr_struct->device_address); @@ -2845,6 +2874,8 @@ void reg_access_hca_mfsv_reg_ext_pack(const struct reg_access_hca_mfsv_reg_ext * adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->fw_sec_ver_stat); offset = 28; adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->efuses_prog_method); + offset = 22; + adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->fuse_failure); offset = 32; adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->img_sec_ver); offset = 64; @@ -2861,6 +2892,8 @@ void reg_access_hca_mfsv_reg_ext_unpack(struct reg_access_hca_mfsv_reg_ext *ptr_ ptr_struct->fw_sec_ver_stat = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); offset = 28; ptr_struct->efuses_prog_method = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); + offset = 22; + ptr_struct->fuse_failure = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); offset = 32; ptr_struct->img_sec_ver = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4); offset = 64; @@ -2879,6 +2912,8 @@ void reg_access_hca_mfsv_reg_ext_print(const struct reg_access_hca_mfsv_reg_ext adb2c_add_indentation(fd, indent_level); fprintf(fd, "efuses_prog_method : " UH_FMT "\n", ptr_struct->efuses_prog_method); adb2c_add_indentation(fd, indent_level); + fprintf(fd, "fuse_failure : " UH_FMT "\n", ptr_struct->fuse_failure); + adb2c_add_indentation(fd, indent_level); fprintf(fd, "img_sec_ver : " U32H_FMT "\n", ptr_struct->img_sec_ver); adb2c_add_indentation(fd, indent_level); fprintf(fd, "efuses_sec_ver : " U32H_FMT "\n", ptr_struct->efuses_sec_ver); @@ -4791,8 +4826,6 @@ void reg_access_hca_ptys_reg_ext_pack(const struct reg_access_hca_ptys_reg_ext * adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->lp_msb); offset = 8; adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->local_port); - offset = 7; - adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->force_tx_aba_param); offset = 4; adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->tx_ready_e); offset = 3; @@ -4865,8 +4898,6 @@ void reg_access_hca_ptys_reg_ext_unpack(struct reg_access_hca_ptys_reg_ext *ptr_ ptr_struct->lp_msb = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); offset = 8; ptr_struct->local_port = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); - offset = 7; - ptr_struct->force_tx_aba_param = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1); offset = 4; ptr_struct->tx_ready_e = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); offset = 3; @@ -4941,8 +4972,6 @@ void reg_access_hca_ptys_reg_ext_print(const struct reg_access_hca_ptys_reg_ext adb2c_add_indentation(fd, indent_level); fprintf(fd, "local_port : " UH_FMT "\n", ptr_struct->local_port); adb2c_add_indentation(fd, indent_level); - fprintf(fd, "force_tx_aba_param : " UH_FMT "\n", ptr_struct->force_tx_aba_param); - adb2c_add_indentation(fd, indent_level); fprintf(fd, "tx_ready_e : " UH_FMT "\n", ptr_struct->tx_ready_e); adb2c_add_indentation(fd, indent_level); fprintf(fd, "ee_tx_ready : " UH_FMT "\n", ptr_struct->ee_tx_ready); @@ -5304,4 +5333,3 @@ void reg_access_hca_reg_access_hca_Nodes_dump(const union reg_access_hca_reg_acc { reg_access_hca_reg_access_hca_Nodes_print(ptr_struct, fd, 0); } - diff --git a/tools_layouts/reg_access_hca_layouts.h b/tools_layouts/reg_access_hca_layouts.h index 00314c91..06476235 100644 --- a/tools_layouts/reg_access_hca_layouts.h +++ b/tools_layouts/reg_access_hca_layouts.h @@ -33,9 +33,9 @@ /*** - *** This file was generated at "2023-07-19 14:43:11" + *** This file was generated at "2024-01-15 23:07:24" *** by: - *** > [REDACTED]/adb2pack.py --input adb/prm/hca/ext/reg_access_hca.adb --file-prefix reg_access_hca --prefix reg_access_hca_ --no-adb-utils + *** > adb2pack.py --input adb/prm/hca/ext/reg_access_hca.adb --file-prefix reg_access_hca --prefix reg_access_hca_ --no-adb-utils -o user/tools_layouts ***/ #ifndef REG_ACCESS_HCA_LAYOUTS_H #define REG_ACCESS_HCA_LAYOUTS_H @@ -270,7 +270,7 @@ Read and write access must be aligned to the word size. Write access must be don /* Description - Only signed components are accepted. */ /* 0x10.30 - 0x10.30 */ u_int8_t signed_updates_only; - /* Description - When set, this components may be read, see Section 10.3.4, "Read Flow", on page 873. */ + /* Description - When set, this components may be read, see Section 10.3.4, "Read Flow", on page 837. */ /* 0x10.31 - 0x10.31 */ u_int8_t rd_en; }; @@ -384,11 +384,11 @@ struct reg_access_hca_mcqi_version_ext { /* 0x4.0 - 0x4.31 */ u_int32_t version; /*---------------- DWORD[2] (Offset 0x8) ----------------*/ - /* Description - Time of component creation. Valid only if build_time_valid is set. See Table 2256, "Date-Time Layout," on page 2613 */ + /* Description - Time of component creation. Valid only if build_time_valid is set. See Table 2180, "Date-Time Layout," on page 2437 */ /* 0x8.0 - 0xc.31 */ struct reg_access_hca_date_time_layout_ext build_time; /*---------------- DWORD[4] (Offset 0x10) ----------------*/ - /* Description - User-defined time assigned to the component version. Valid only if user_defined_time_valid is set. See Table 2256, "Date-Time Layout," on page 2613 */ + /* Description - User-defined time assigned to the component version. Valid only if user_defined_time_valid is set. See Table 2180, "Date-Time Layout," on page 2437 */ /* 0x10.0 - 0x14.31 */ struct reg_access_hca_date_time_layout_ext user_defined_time; /*---------------- DWORD[6] (Offset 0x18) ----------------*/ @@ -484,14 +484,14 @@ The priority is set by either: u_int8_t priority; /*---------------- DWORD[1] (Offset 0x4) ----------------*/ /* Description - Configuration item index according to its type_class. -Table 2337, "Configuration Item Data Type Class Global Layout," on page 2675 -Table 2339, "Configuration Item Data Type Class Physical Port Layout," on page 2675 -Table 2341, "Configuration Item Data Type Class Per Host-PF Layout," on page 2676 -Table 2343, "Configuration Item Data Type Class Log Layout," on page 2676 -Table 2345, "Configuration Item Data Type Class File Layout," on page 2677 -Table 2347, "Configuration Item Data Type Class Host Layout," on page 2677 - -Table 2349, "Configuration Item Data Type Class Module Layout," on page 2678 */ +Table 2267, "Configuration Item Data Type Class Global Layout," on page 2502 +Table 2269, "Configuration Item Data Type Class Physical Port Layout," on page 2502 +Table 2271, "Configuration Item Data Type Class Per Host-PF Layout," on page 2503 +Table 2273, "Configuration Item Data Type Class Log Layout," on page 2503 +Table 2275, "Configuration Item Data Type Class File Layout," on page 2504 +Table 2277, "Configuration Item Data Type Class Host Layout," on page 2504 + +Table 2279, "Configuration Item Data Type Class Module Layout," on page 2505 */ /* 0x4.0 - 0x4.31 */ union reg_access_hca_config_item_type_auto_ext type; }; @@ -699,6 +699,15 @@ The total number of tiles can be derived through MGPIR register. */ 1: Enable */ /* 0x34.3 - 0x34.3 */ u_int8_t encryption; + /* Description - [DWIP] +ISSU-able: +0: not ISSUable +1: ISSUable +Supported from Quantum-3 and on +Supported for Retimers +Based on FW decisions: fuse, INI, NV and version on flash vs. running version */ + /* 0x34.13 - 0x34.13 */ + u_int8_t issu_able; }; /* Description - */ @@ -708,7 +717,7 @@ struct reg_access_hca_mgir_hardware_info_ext { /* Description - PCI device ID. */ /* 0x0.0 - 0x0.15 */ u_int16_t device_id; - /* Description - See Table 2278, "Device HW Revision Descriptions," on page 2629 */ + /* Description - See Table 2202, "Device HW Revision Descriptions," on page 2455 */ /* 0x0.16 - 0x0.31 */ u_int16_t device_hw_revision; /*---------------- DWORD[1] (Offset 0x4) ----------------*/ @@ -740,6 +749,24 @@ For Retimer: returns the number of data path manufacturing_base_mac of value 0 means field is not supported. */ /* 0x10.0 - 0x10.15 */ u_int16_t manufacturing_base_mac_47_32; + /* Description - [DWIP] +Geographical Address +0: ASIC 0 +1: ASIC 1 +2: ASIC 2 +3: ASIC 3 +Valid for multi ASIC platforms only */ + /* 0x10.16 - 0x10.21 */ + u_int8_t ga; + /* Description - [DWIP] +Chip Type +0: Real chip +1: Emulation +2: ChipSim +3: SimX +Supported from Quantum-3 and ArcusE */ + /* 0x10.24 - 0x10.27 */ + u_int8_t chip_type; /*---------------- DWORD[5] (Offset 0x14) ----------------*/ /* Description - LSB of the "base" MAC address of the NIC that was allocate during manufacturing. The NIC derives the MAC addresses for the different PCI PFs from this MAC address. This parameter can be used as a canonical unique identifier of the NIC. manufacturing_base_mac of value 0 means field is not supported. */ @@ -903,12 +930,12 @@ struct reg_access_hca_debug_cap { /* 0x0.16 - 0x0.20 */ u_int8_t log_min_resource_dump_eq; /* Description - If set, Resource_dump register is supported. -See Table 1406, "RESOURCE_DUMP Register Layout," on page 1698 */ +See Table 1439, "RESOURCE_DUMP Register Layout," on page 1726 */ /* 0x0.22 - 0x0.22 */ u_int8_t resource_dump; /* Description - Log(base 2) of the size in granularity of 4KB to be allocated by host in order to accommodate cr_dump. 0 means feature is not supported. -See Table 1404, "CORE_DUMP Register Layout," on page 1696 */ +See Table 1437, "CORE_DUMP Register Layout," on page 1724 */ /* 0x0.23 - 0x0.27 */ u_int8_t log_cr_dump_to_mem_size; /* Description - If set, Core dump of type of specific QP is supported. @@ -1066,13 +1093,14 @@ Bit 49: If set, MCQS.identifier support CRCS and CRDT tokens Bit 51: If set, MTUTC.freq_adj_units=2 is supported Bit 53: If set, Mlx mlxfwreset with downstream port is supported by FW [Internal]: NIC only, FW rejects reset till user committed that traffic is disabled + */ /* 0x28.0 - 0x34.31 */ u_int32_t mng_feature_cap_mask[4]; }; /* Description - */ -/* Size in bytes - 32 */ +/* Size in bytes - 28 */ struct reg_access_hca_mcc_reg_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - Command to be executed by the FSM @@ -1106,14 +1134,14 @@ UPDATE_COMPONENT, ACTIVATE_COMPONENET, READ_COMPONENT and READ_PENDING_COMPONENT u_int16_t component_index; /*---------------- DWORD[2] (Offset 0x8) ----------------*/ /* Description - Token representing the current flow executed by the FSM. -See Section 10.2.1, "Component Update State", on page 870. */ +See Section 10.2.1, "Component Update State", on page 834. */ /* 0x8.0 - 0x8.23 */ u_int32_t update_handle; /* Description - Auto-update to all matching downstream devices is requested. */ /* 0x8.31 - 0x8.31 */ u_int8_t auto_update; /*---------------- DWORD[3] (Offset 0xc) ----------------*/ - /* Description - Current Update FSM state, see Section 10.3.8, "FSM States," on page 874 + /* Description - Current Update FSM state, see Section 10.3.8, "FSM States," on page 838 0x0: IDLE 0x1: LOCKED 0x2: INITIALIZE @@ -1127,7 +1155,7 @@ See Section 10.2.1, "Component Update State", on page 870. */ Other values are reserved */ /* 0xc.0 - 0xc.3 */ u_int8_t control_state; - /* Description - Indicates the successful completion of the instruction, or the reason it failed. See Section 10.3.7, "Error Handling," on page 873 + /* Description - Indicates the successful completion of the instruction, or the reason it failed. See Section 10.3.7, "Error Handling," on page 837 0x0: OK 0x1: ERROR 0x2: REJECTED_DIGEST_ERR @@ -1153,6 +1181,22 @@ Other values are reserved */ 0x16: REJECTED_INCOMPATIBLE_FLASH 0x17: REJECTED_TOKEN_ALREADY_APPLIED 0x18: REJECTED_FW_BURN_DRAM_NOT_AVAILABLE +0x19: FW_BURN_REJECTED_INVALID_SECURITY_VERSION +0x1A: FW_BURN_REJECTED_CERT_CER509 +0x1B: FW_BURN_REJECTED_CERT_SIGNATURE +0x1C: FW_BURN_REJECTED_CERT_METADATA +0x1D: FW_BURN_REJECTED_CERT_INTERNAL_ERROR_0 +0x1E: FW_BURN_REJECTED_CERT_NO_PLACE +0x1F: FW_BURN_REJECTED_CERT_REMOVAL_NO_MATCH_CERT_UIDD +0x20: FW_BURN_REJECTED_CERTI_INTERNAL_ERROR_1 +0x21: FW_BURN_REJECTED_CERT_INTERNAL_ERROR_2 0x22: FW_BURN_REJECTED_CERT_OF_NUM_OF_SWAP +0x23: FW_BURN_REJECTED_CERT_INTERNAL_ERROR_3 +0x24: FW_BURN_REJECTED_CERT_INTERNAL_ERROR_4 +0x25: FW_BURN_REJECTED_CERT_NOT_ALLOWED_SAME_CERT_UIDD +0x26: FW_BURN_REJECTED_CERTIFICATE_INTERNAL_ERROR_5 +0x27: FW_BURN_REJECTED_CERTIFICATE_INTERNAL_ERROR_6 +0x28: REJECTED_FLASH_WP + Other values should be treated as an unknown error. */ /* 0xc.8 - 0xc.15 */ u_int8_t error_code; @@ -1208,7 +1252,7 @@ struct reg_access_hca_mcda_reg_ext { /* 0x0.0 - 0x0.23 */ u_int32_t update_handle; /*---------------- DWORD[1] (Offset 0x4) ----------------*/ - /* Description - Offset of accessed address relative to component start. Accesses must be in accordance to log_mcda_word_size in Table 2252, "MCQI CAPABILITIES Info Layout," on page 2610 */ + /* Description - Offset of accessed address relative to component start. Accesses must be in accordance to log_mcda_word_size in Table 2176, "MCQI CAPABILITIES Info Layout," on page 2434 */ /* 0x4.0 - 0x4.31 */ u_int32_t offset; /*---------------- DWORD[2] (Offset 0x8) ----------------*/ @@ -1245,6 +1289,12 @@ NIC: Range 0 .. MGPIR.num_of_modules -1 */ /* 0x0.16 - 0x0.23 */ u_int8_t module; + /* Description - [DWIP]: +Page Number Valid +0: write page number +1: don't write page number */ + /* 0x0.29 - 0x0.29 */ + u_int8_t pnv; /* Description - Lock Page bit. When bit is set, FW can access the last accessed page. After boot and ISSU, default value is 0. @@ -1257,7 +1307,7 @@ After boot and ISSU, default value is 0. /* 0x4.0 - 0x4.15 */ u_int16_t device_address; /* Description - Page number -Reserved when MCIA.l = 1 */ +Reserved when MCIA.l = 1 or when MCIA.pnv = 0 */ /* 0x4.16 - 0x4.23 */ u_int8_t page_number; /* Description - I2C device address @@ -1347,11 +1397,11 @@ If size is invalid, FW will return an error. */ u_int16_t data_size; /*---------------- DWORD[6] (Offset 0x18) ----------------*/ /* Description - Properties set structure according to info_type. -CAPABILITIES - See Table 2252, "MCQI CAPABILITIES Info Layout," on page 2610 -VERSION - See Table 2254, "MCQI VERSION Info Layout," on page 2612 -ACTIVATION_METHOD - See Table 2258, "MCQI ACTIVATION_METHOD Info Layout," on page 2614 -LINKX_PROPERTIES - See Table 2260, "MCQI LINKX_PROPERTIES Info Layout," on page 2615 -CLOCK_SOURCE_PROPERTIES - See Table 2262, "MCQI CLOCK_SOURCE_PROPERTIES Layout," on page 2617 */ +CAPABILITIES - See Table 2176, "MCQI CAPABILITIES Info Layout," on page 2434 +VERSION - See Table 2178, "MCQI VERSION Info Layout," on page 2436 +ACTIVATION_METHOD - See Table 2182, "MCQI ACTIVATION_METHOD Info Layout," on page 2438 +LINKX_PROPERTIES - See Table 2184, "MCQI LINKX_PROPERTIES Info Layout," on page 2439 +CLOCK_SOURCE_PROPERTIES - See Table 2186, "MCQI CLOCK_SOURCE_PROPERTIES Layout," on page 2441 */ /* 0x18.0 - 0x90.31 */ union reg_access_hca_mcqi_reg_data_auto_ext data; }; @@ -1360,7 +1410,7 @@ CLOCK_SOURCE_PROPERTIES - See Table 2262, "MCQI CLOCK_SOURCE_PROPERTIES Layout," /* Size in bytes - 16 */ struct reg_access_hca_mcqs_reg_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ - /* Description - Component Index. Values range from 1 to the last component indicated by last_index_flag. */ + /* Description - Component Index. Values range from 0 to the last component indicated by last_index_flag. */ /* 0x0.0 - 0x0.15 */ u_int16_t component_index; /* Description - Device number. @@ -1392,7 +1442,7 @@ Other values are reserved */ /* 0x4.0 - 0x4.15 */ u_int16_t identifier; /*---------------- DWORD[2] (Offset 0x8) ----------------*/ - /* Description - Component state in update flow, see Section 10.2.1, "Component Update State," on page 870: + /* Description - Component state in update flow, see Section 10.2.1, "Component Update State," on page 834: 0x0: IDLE 0x1: IN_PROGRESS 0x2: APPLIED @@ -1623,6 +1673,13 @@ struct reg_access_hca_mfsv_reg_ext { /* Description - EFUSEs programming method.0: manually. Upon boot, if FW indicates that FW_sec_ver_stat is 1 and only if EFUSEs_prog_en is 1, it will program the EFUSEs as needed.1: automatically. Upon boot, if FW indicates that FW_sec_ver_stat is 1, it will program the EFUSEs as needed. */ /* 0x0.3 - 0x0.3 */ u_int8_t efuses_prog_method; + /* Description - [NIC Only] +0:N/A - No info about fuse failure +1: No failure +2: Failure identified +3: Reserved */ + /* 0x0.8 - 0x0.9 */ + u_int8_t fuse_failure; /*---------------- DWORD[1] (Offset 0x4) ----------------*/ /* Description - Image security version value */ /* 0x4.0 - 0x4.31 */ @@ -1637,20 +1694,20 @@ struct reg_access_hca_mfsv_reg_ext { /* Size in bytes - 160 */ struct reg_access_hca_mgir_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ - /* Description - Hardware Information, see Table 2276, "Hardware Info Layout," on page 2628 */ + /* Description - Hardware Information, see Table 2200, "Hardware Info Layout," on page 2453 */ /* 0x0.0 - 0x1c.31 */ struct reg_access_hca_mgir_hardware_info_ext hw_info; /*---------------- DWORD[8] (Offset 0x20) ----------------*/ - /* Description - Firmware Information, see Table 2279, "Firmware Info Layout," on page 2631 */ + /* Description - Firmware Information, see Table 2203, "Firmware Info Layout," on page 2456 */ /* 0x20.0 - 0x5c.31 */ struct reg_access_hca_mgir_fw_info_ext fw_info; /*---------------- DWORD[24] (Offset 0x60) ----------------*/ - /* Description - Software Information, see Table 2281, "Software Info Layout," on page 2633 + /* Description - Software Information, see Table 2205, "Software Info Layout," on page 2459 This field indicates the oldest software version compatible with the current firmware */ /* 0x60.0 - 0x7c.31 */ struct reg_access_hca_mgir_sw_info_ext sw_info; /*---------------- DWORD[32] (Offset 0x80) ----------------*/ - /* Description - Development Information, see Table 2285, "Development Info Layout," on page 2637 */ + /* Description - Development Information, see Table 2209, "Development Info Layout," on page 2462 */ /* 0x80.0 - 0x98.31 */ struct reg_access_hca_mgir_dev_info_ext dev_info; }; @@ -1730,7 +1787,7 @@ struct reg_access_hca_mnvia_reg_ext { /* 0x0.0 - 0x0.2 */ u_int8_t target; /* Description - The entity which perform the invalidate. -The encoding same as writer_id in Configuration Item register (See Table 2335, "Configuration Item Header Layout," on page 2671). */ +The encoding same as writer_id in Configuration Item register (See Table 2265, "Configuration Item Header Layout," on page 2498). */ /* 0x0.4 - 0x0.8 */ u_int8_t writer_id; }; @@ -1740,14 +1797,14 @@ The encoding same as writer_id in Configuration Item register (See Table 2335, " struct reg_access_hca_mnvqc_reg_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - Configuration item type according to its class. -Table 2337, "Configuration Item Data Type Class Global Layout," on page 2675 -Table 2339, "Configuration Item Data Type Class Physical Port Layout," on page 2675 -Table 2341, "Configuration Item Data Type Class Per Host-PF Layout," on page 2676 -Table 2343, "Configuration Item Data Type Class Log Layout," on page 2676 -Table 2345, "Configuration Item Data Type Class File Layout," on page 2677 -Table 2347, "Configuration Item Data Type Class Host Layout," on page 2677 - -Table 2349, "Configuration Item Data Type Class Module Layout," on page 2678 */ +Table 2267, "Configuration Item Data Type Class Global Layout," on page 2502 +Table 2269, "Configuration Item Data Type Class Physical Port Layout," on page 2502 +Table 2271, "Configuration Item Data Type Class Per Host-PF Layout," on page 2503 +Table 2273, "Configuration Item Data Type Class Log Layout," on page 2503 +Table 2275, "Configuration Item Data Type Class File Layout," on page 2504 +Table 2277, "Configuration Item Data Type Class Host Layout," on page 2504 + +Table 2279, "Configuration Item Data Type Class Module Layout," on page 2505 */ /* 0x0.0 - 0x0.31 */ u_int32_t type; /*---------------- DWORD[1] (Offset 0x4) ----------------*/ @@ -2187,7 +2244,7 @@ struct reg_access_hca_mtrc_cap_reg_ext { /* 0x0.0 - 0x0.3 */ u_int8_t num_string_db; /* Description - Indicates the version of the tracing mechanism. -See Section 25.3.4.1, "Timestamp Event Traces", on page 1598 +See Section 24.3.4.1, "Timestamp Event Traces", on page 1396 0x0: VER_0 0x1: VER_1 Other values are reserved. @@ -2317,7 +2374,7 @@ struct reg_access_hca_nic_cap_ext_reg_ext { u_int16_t cap_group; /*---------------- DWORD[4] (Offset 0x10) ----------------*/ /* Description - Capability information according to cap_group. -For DPA_CAP See Table 1440, "DPA_CAP Capability Layout," on page 1722 */ +For DPA_CAP See Table 1326, "DPA_CAP Capability Layout," on page 1526 */ /* 0x10.0 - 0x7c.31 */ u_int32_t cap_data[28]; }; @@ -2595,6 +2652,7 @@ NOTE: setting reset while module is plugged-in will result in transition of oper [DWIP] 0xf: Boot_error [DWIP] 0x10: Recovery_error +[DWIP] 0x11: Submodule_failure Valid only when oper_status = 4'b0011 */ /* 0x4.8 - 0x4.12 */ u_int8_t error_type; @@ -2697,14 +2755,11 @@ Other values are reserved. */ /* Description - Local port number */ /* 0x0.16 - 0x0.23 */ u_int8_t local_port; - /* Description - When AN is disabled, use aba TX set. - */ - /* 0x0.24 - 0x0.24 */ - u_int8_t force_tx_aba_param; /* Description - Valid only when ee_tx_ready is set, otherwise field is ignored. 0: do_not_generate_event Bit 0: generate_tx_ready_event - When set, PTSE register will generate event when Transmitter is generating valid signal on the line -Bit 1: generate_tx_not_ready_event - when set, PTSE will generate event when the transmitter stopped transmitting after Tx_ready was set. */ +Bit 1: generate_tx_not_ready_event - when set, PTSE will generate event when the transmitter stopped transmitting after Tx_ready was set. +Note: if both tx_not_ready and tx_ready are set, one toggle event may be received instead of 2 consecutive events of not ready --> ready. */ /* 0x0.26 - 0x0.27 */ u_int8_t tx_ready_e; /* Description - Event Enable for tx_ready_e. @@ -2808,7 +2863,6 @@ Bit 0 - SGMII */ u_int32_t eth_proto_capability; /*---------------- DWORD[4] (Offset 0x10) ----------------*/ /* Description - InfiniBand port speed supported (bitmask) -ib_link_speed <= ib_proto_capability[7:0] Bit 0: SDR Bit 1: DDR Bit 2: QDR @@ -2908,7 +2962,7 @@ Note: Ignored when an_disable_admin is not set */ /* Size in bytes - 256 */ struct reg_access_hca_resource_dump_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ - /* Description - See Section 25.10, "Resource Dump", on page 1609. */ + /* Description - See Section 24.10, "Resource Dump", on page 1407. */ /* 0x0.0 - 0x0.15 */ u_int16_t segment_type; /* Description - Sequence number. 0 on first call of dump and incremented on each more dump. */ @@ -3010,7 +3064,7 @@ union reg_access_hca_reg_access_hca_Nodes { /* 0x0.0 - 0x78.31 */ struct reg_access_hca_mcqi_activation_method_ext mcqi_activation_method_ext; /* Description - */ - /* 0x0.0 - 0x1c.31 */ + /* 0x0.0 - 0x18.31 */ struct reg_access_hca_mcc_reg_ext mcc_reg_ext; /* Description - */ /* 0x0.0 - 0x7c.31 */ @@ -3332,7 +3386,7 @@ void reg_access_hca_mcc_reg_ext_pack(const struct reg_access_hca_mcc_reg_ext *pt void reg_access_hca_mcc_reg_ext_unpack(struct reg_access_hca_mcc_reg_ext *ptr_struct, const u_int8_t *ptr_buff); void reg_access_hca_mcc_reg_ext_print(const struct reg_access_hca_mcc_reg_ext *ptr_struct, FILE *fd, int indent_level); unsigned int reg_access_hca_mcc_reg_ext_size(void); -#define REG_ACCESS_HCA_MCC_REG_EXT_SIZE (0x20) +#define REG_ACCESS_HCA_MCC_REG_EXT_SIZE (0x1c) void reg_access_hca_mcc_reg_ext_dump(const struct reg_access_hca_mcc_reg_ext *ptr_struct, FILE *fd); /* mcda_reg_ext */ void reg_access_hca_mcda_reg_ext_pack(const struct reg_access_hca_mcda_reg_ext *ptr_struct, u_int8_t *ptr_buff); diff --git a/tools_layouts/reg_access_switch_layouts.c b/tools_layouts/reg_access_switch_layouts.c index 75ad45bc..d264d1fd 100644 --- a/tools_layouts/reg_access_switch_layouts.c +++ b/tools_layouts/reg_access_switch_layouts.c @@ -33,9 +33,9 @@ /*** - *** This file was generated at "2023-07-16 15:06:38" + *** This file was generated at "2024-01-14 09:35:17" *** by: - *** > [REDACTED]/adb2pack.py --input adb/prm/switch/ext/reg_access_switch.adb --file-prefix reg_access_switch --prefix reg_access_switch_ --no-adb-utils + *** > adb2pack.py --input adb/prm/switch/ext/reg_access_switch.adb --file-prefix reg_access_switch --prefix reg_access_switch_ --no-adb-utils -o user/tools_layouts ***/ #include "reg_access_switch_layouts.h" @@ -135,7 +135,7 @@ void reg_access_switch_crspace_access_payload_ext_dump(const struct reg_access_s reg_access_switch_crspace_access_payload_ext_print(ptr_struct, fd, 0); } -void reg_access_switch_device_info_ext_pack(const struct reg_access_switch_device_info_ext *ptr_struct, u_int8_t *ptr_buff) +void reg_access_switch_mddq_device_info_ext_pack(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, u_int8_t *ptr_buff) { u_int32_t offset; int i; @@ -170,7 +170,7 @@ void reg_access_switch_device_info_ext_pack(const struct reg_access_switch_devic } } -void reg_access_switch_device_info_ext_unpack(struct reg_access_switch_device_info_ext *ptr_struct, const u_int8_t *ptr_buff) +void reg_access_switch_mddq_device_info_ext_unpack(struct reg_access_switch_mddq_device_info_ext *ptr_struct, const u_int8_t *ptr_buff) { u_int32_t offset; int i; @@ -205,12 +205,12 @@ void reg_access_switch_device_info_ext_unpack(struct reg_access_switch_device_in } } -void reg_access_switch_device_info_ext_print(const struct reg_access_switch_device_info_ext *ptr_struct, FILE *fd, int indent_level) +void reg_access_switch_mddq_device_info_ext_print(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, FILE *fd, int indent_level) { int i; adb2c_add_indentation(fd, indent_level); - fprintf(fd, "======== reg_access_switch_device_info_ext ========\n"); + fprintf(fd, "======== reg_access_switch_mddq_device_info_ext ========\n"); adb2c_add_indentation(fd, indent_level); fprintf(fd, "device_index : " UH_FMT "\n", ptr_struct->device_index); @@ -242,80 +242,17 @@ void reg_access_switch_device_info_ext_print(const struct reg_access_switch_devi } } -unsigned int reg_access_switch_device_info_ext_size(void) +unsigned int reg_access_switch_mddq_device_info_ext_size(void) { - return REG_ACCESS_SWITCH_DEVICE_INFO_EXT_SIZE; + return REG_ACCESS_SWITCH_MDDQ_DEVICE_INFO_EXT_SIZE; } -void reg_access_switch_device_info_ext_dump(const struct reg_access_switch_device_info_ext *ptr_struct, FILE *fd) +void reg_access_switch_mddq_device_info_ext_dump(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, FILE *fd) { - reg_access_switch_device_info_ext_print(ptr_struct, fd, 0); + reg_access_switch_mddq_device_info_ext_print(ptr_struct, fd, 0); } -void reg_access_switch_prm_register_payload_ext_pack(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, u_int8_t *ptr_buff) -{ - u_int32_t offset; - int i; - - offset = 16; - adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->register_id); - offset = 8; - adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->method); - offset = 0; - adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->status); - for (i = 0; i < 64; ++i) { - offset = adb2c_calc_array_field_address(32, 32, i, 2080, 1); - adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->register_data[i]); - } -} - -void reg_access_switch_prm_register_payload_ext_unpack(struct reg_access_switch_prm_register_payload_ext *ptr_struct, const u_int8_t *ptr_buff) -{ - u_int32_t offset; - int i; - - offset = 16; - ptr_struct->register_id = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16); - offset = 8; - ptr_struct->method = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); - offset = 0; - ptr_struct->status = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); - for (i = 0; i < 64; ++i) { - offset = adb2c_calc_array_field_address(32, 32, i, 2080, 1); - ptr_struct->register_data[i] = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4); - } -} - -void reg_access_switch_prm_register_payload_ext_print(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, FILE *fd, int indent_level) -{ - int i; - - adb2c_add_indentation(fd, indent_level); - fprintf(fd, "======== reg_access_switch_prm_register_payload_ext ========\n"); - - adb2c_add_indentation(fd, indent_level); - fprintf(fd, "register_id : " UH_FMT "\n", ptr_struct->register_id); - adb2c_add_indentation(fd, indent_level); - fprintf(fd, "method : " UH_FMT "\n", ptr_struct->method); - adb2c_add_indentation(fd, indent_level); - fprintf(fd, "status : " UH_FMT "\n", ptr_struct->status); - for (i = 0; i < 64; ++i) { - adb2c_add_indentation(fd, indent_level); - fprintf(fd, "register_data_%03d : " U32H_FMT "\n", i, ptr_struct->register_data[i]); - } -} - -unsigned int reg_access_switch_prm_register_payload_ext_size(void) -{ - return REG_ACCESS_SWITCH_PRM_REGISTER_PAYLOAD_EXT_SIZE; -} - -void reg_access_switch_prm_register_payload_ext_dump(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, FILE *fd) -{ - reg_access_switch_prm_register_payload_ext_print(ptr_struct, fd, 0); -} - -void reg_access_switch_slot_info_ext_pack(const struct reg_access_switch_slot_info_ext *ptr_struct, u_int8_t *ptr_buff) +void reg_access_switch_mddq_slot_info_ext_pack(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, u_int8_t *ptr_buff) { u_int32_t offset; @@ -335,7 +272,7 @@ void reg_access_switch_slot_info_ext_pack(const struct reg_access_switch_slot_in adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->card_type); } -void reg_access_switch_slot_info_ext_unpack(struct reg_access_switch_slot_info_ext *ptr_struct, const u_int8_t *ptr_buff) +void reg_access_switch_mddq_slot_info_ext_unpack(struct reg_access_switch_mddq_slot_info_ext *ptr_struct, const u_int8_t *ptr_buff) { u_int32_t offset; @@ -355,10 +292,10 @@ void reg_access_switch_slot_info_ext_unpack(struct reg_access_switch_slot_info_e ptr_struct->card_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); } -void reg_access_switch_slot_info_ext_print(const struct reg_access_switch_slot_info_ext *ptr_struct, FILE *fd, int indent_level) +void reg_access_switch_mddq_slot_info_ext_print(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, FILE *fd, int indent_level) { adb2c_add_indentation(fd, indent_level); - fprintf(fd, "======== reg_access_switch_slot_info_ext ========\n"); + fprintf(fd, "======== reg_access_switch_mddq_slot_info_ext ========\n"); adb2c_add_indentation(fd, indent_level); fprintf(fd, "active : " UH_FMT "\n", ptr_struct->active); @@ -376,17 +313,17 @@ void reg_access_switch_slot_info_ext_print(const struct reg_access_switch_slot_i fprintf(fd, "card_type : " UH_FMT "\n", ptr_struct->card_type); } -unsigned int reg_access_switch_slot_info_ext_size(void) +unsigned int reg_access_switch_mddq_slot_info_ext_size(void) { - return REG_ACCESS_SWITCH_SLOT_INFO_EXT_SIZE; + return REG_ACCESS_SWITCH_MDDQ_SLOT_INFO_EXT_SIZE; } -void reg_access_switch_slot_info_ext_dump(const struct reg_access_switch_slot_info_ext *ptr_struct, FILE *fd) +void reg_access_switch_mddq_slot_info_ext_dump(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, FILE *fd) { - reg_access_switch_slot_info_ext_print(ptr_struct, fd, 0); + reg_access_switch_mddq_slot_info_ext_print(ptr_struct, fd, 0); } -void reg_access_switch_slot_name_ext_pack(const struct reg_access_switch_slot_name_ext *ptr_struct, u_int8_t *ptr_buff) +void reg_access_switch_mddq_slot_name_ext_pack(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, u_int8_t *ptr_buff) { u_int32_t offset; int i; @@ -397,7 +334,7 @@ void reg_access_switch_slot_name_ext_pack(const struct reg_access_switch_slot_na } } -void reg_access_switch_slot_name_ext_unpack(struct reg_access_switch_slot_name_ext *ptr_struct, const u_int8_t *ptr_buff) +void reg_access_switch_mddq_slot_name_ext_unpack(struct reg_access_switch_mddq_slot_name_ext *ptr_struct, const u_int8_t *ptr_buff) { u_int32_t offset; int i; @@ -408,12 +345,12 @@ void reg_access_switch_slot_name_ext_unpack(struct reg_access_switch_slot_name_e } } -void reg_access_switch_slot_name_ext_print(const struct reg_access_switch_slot_name_ext *ptr_struct, FILE *fd, int indent_level) +void reg_access_switch_mddq_slot_name_ext_print(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, FILE *fd, int indent_level) { int i; adb2c_add_indentation(fd, indent_level); - fprintf(fd, "======== reg_access_switch_slot_name_ext ========\n"); + fprintf(fd, "======== reg_access_switch_mddq_slot_name_ext ========\n"); for (i = 0; i < 20; ++i) { adb2c_add_indentation(fd, indent_level); @@ -421,24 +358,87 @@ void reg_access_switch_slot_name_ext_print(const struct reg_access_switch_slot_n } } -unsigned int reg_access_switch_slot_name_ext_size(void) +unsigned int reg_access_switch_mddq_slot_name_ext_size(void) { - return REG_ACCESS_SWITCH_SLOT_NAME_EXT_SIZE; + return REG_ACCESS_SWITCH_MDDQ_SLOT_NAME_EXT_SIZE; } -void reg_access_switch_slot_name_ext_dump(const struct reg_access_switch_slot_name_ext *ptr_struct, FILE *fd) +void reg_access_switch_mddq_slot_name_ext_dump(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, FILE *fd) { - reg_access_switch_slot_name_ext_print(ptr_struct, fd, 0); + reg_access_switch_mddq_slot_name_ext_print(ptr_struct, fd, 0); +} + +void reg_access_switch_prm_register_payload_ext_pack(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, u_int8_t *ptr_buff) +{ + u_int32_t offset; + int i; + + offset = 16; + adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->register_id); + offset = 8; + adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->method); + offset = 0; + adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->status); + for (i = 0; i < 64; ++i) { + offset = adb2c_calc_array_field_address(32, 32, i, 2080, 1); + adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->register_data[i]); + } +} + +void reg_access_switch_prm_register_payload_ext_unpack(struct reg_access_switch_prm_register_payload_ext *ptr_struct, const u_int8_t *ptr_buff) +{ + u_int32_t offset; + int i; + + offset = 16; + ptr_struct->register_id = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16); + offset = 8; + ptr_struct->method = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2); + offset = 0; + ptr_struct->status = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8); + for (i = 0; i < 64; ++i) { + offset = adb2c_calc_array_field_address(32, 32, i, 2080, 1); + ptr_struct->register_data[i] = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4); + } +} + +void reg_access_switch_prm_register_payload_ext_print(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, FILE *fd, int indent_level) +{ + int i; + + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "======== reg_access_switch_prm_register_payload_ext ========\n"); + + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "register_id : " UH_FMT "\n", ptr_struct->register_id); + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "method : " UH_FMT "\n", ptr_struct->method); + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "status : " UH_FMT "\n", ptr_struct->status); + for (i = 0; i < 64; ++i) { + adb2c_add_indentation(fd, indent_level); + fprintf(fd, "register_data_%03d : " U32H_FMT "\n", i, ptr_struct->register_data[i]); + } +} + +unsigned int reg_access_switch_prm_register_payload_ext_size(void) +{ + return REG_ACCESS_SWITCH_PRM_REGISTER_PAYLOAD_EXT_SIZE; +} + +void reg_access_switch_prm_register_payload_ext_dump(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, FILE *fd) +{ + reg_access_switch_prm_register_payload_ext_print(ptr_struct, fd, 0); } void reg_access_switch_mddq_data_auto_ext_pack(const union reg_access_switch_mddq_data_auto_ext *ptr_struct, u_int8_t *ptr_buff) { - reg_access_switch_slot_name_ext_pack(&(ptr_struct->slot_name_ext), ptr_buff); + reg_access_switch_mddq_slot_name_ext_pack(&(ptr_struct->mddq_slot_name_ext), ptr_buff); } void reg_access_switch_mddq_data_auto_ext_unpack(union reg_access_switch_mddq_data_auto_ext *ptr_struct, const u_int8_t *ptr_buff) { - reg_access_switch_slot_name_ext_unpack(&(ptr_struct->slot_name_ext), ptr_buff); + reg_access_switch_mddq_slot_name_ext_unpack(&(ptr_struct->mddq_slot_name_ext), ptr_buff); } void reg_access_switch_mddq_data_auto_ext_print(const union reg_access_switch_mddq_data_auto_ext *ptr_struct, FILE *fd, int indent_level) @@ -447,14 +447,14 @@ void reg_access_switch_mddq_data_auto_ext_print(const union reg_access_switch_md fprintf(fd, "======== reg_access_switch_mddq_data_auto_ext ========\n"); adb2c_add_indentation(fd, indent_level); - fprintf(fd, "slot_info_ext:\n"); - reg_access_switch_slot_info_ext_print(&(ptr_struct->slot_info_ext), fd, indent_level + 1); + fprintf(fd, "mddq_slot_info_ext:\n"); + reg_access_switch_mddq_slot_info_ext_print(&(ptr_struct->mddq_slot_info_ext), fd, indent_level + 1); adb2c_add_indentation(fd, indent_level); - fprintf(fd, "device_info_ext:\n"); - reg_access_switch_device_info_ext_print(&(ptr_struct->device_info_ext), fd, indent_level + 1); + fprintf(fd, "mddq_device_info_ext:\n"); + reg_access_switch_mddq_device_info_ext_print(&(ptr_struct->mddq_device_info_ext), fd, indent_level + 1); adb2c_add_indentation(fd, indent_level); - fprintf(fd, "slot_name_ext:\n"); - reg_access_switch_slot_name_ext_print(&(ptr_struct->slot_name_ext), fd, indent_level + 1); + fprintf(fd, "mddq_slot_name_ext:\n"); + reg_access_switch_mddq_slot_name_ext_print(&(ptr_struct->mddq_slot_name_ext), fd, indent_level + 1); } unsigned int reg_access_switch_mddq_data_auto_ext_size(void) @@ -668,15 +668,15 @@ void reg_access_switch_mddq_ext_pack(const struct reg_access_switch_mddq_ext *pt switch (ptr_struct->query_type) { case 0x1: offset = 128; - reg_access_switch_slot_info_ext_pack(&(ptr_struct->data.slot_info_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_slot_info_ext_pack(&(ptr_struct->data.mddq_slot_info_ext), ptr_buff + offset / 8); break; case 0x2: offset = 128; - reg_access_switch_device_info_ext_pack(&(ptr_struct->data.device_info_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_device_info_ext_pack(&(ptr_struct->data.mddq_device_info_ext), ptr_buff + offset / 8); break; case 0x3: offset = 128; - reg_access_switch_slot_name_ext_pack(&(ptr_struct->data.slot_name_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_slot_name_ext_pack(&(ptr_struct->data.mddq_slot_name_ext), ptr_buff + offset / 8); break; default: break; @@ -705,15 +705,15 @@ void reg_access_switch_mddq_ext_unpack(struct reg_access_switch_mddq_ext *ptr_st switch (ptr_struct->query_type) { case 0x1: offset = 128; - reg_access_switch_slot_info_ext_unpack(&(ptr_struct->data.slot_info_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_slot_info_ext_unpack(&(ptr_struct->data.mddq_slot_info_ext), ptr_buff + offset / 8); break; case 0x2: offset = 128; - reg_access_switch_device_info_ext_unpack(&(ptr_struct->data.device_info_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_device_info_ext_unpack(&(ptr_struct->data.mddq_device_info_ext), ptr_buff + offset / 8); break; case 0x3: offset = 128; - reg_access_switch_slot_name_ext_unpack(&(ptr_struct->data.slot_name_ext), ptr_buff + offset / 8); + reg_access_switch_mddq_slot_name_ext_unpack(&(ptr_struct->data.mddq_slot_name_ext), ptr_buff + offset / 8); break; default: break; @@ -742,18 +742,18 @@ void reg_access_switch_mddq_ext_print(const struct reg_access_switch_mddq_ext *p switch (ptr_struct->query_type) { case 0x1: adb2c_add_indentation(fd, indent_level); - fprintf(fd, "slot_info_ext:\n"); - reg_access_switch_slot_info_ext_print(&(ptr_struct->data.slot_info_ext), fd, indent_level + 1); + fprintf(fd, "mddq_slot_info_ext:\n"); + reg_access_switch_mddq_slot_info_ext_print(&(ptr_struct->data.mddq_slot_info_ext), fd, indent_level + 1); break; case 0x2: adb2c_add_indentation(fd, indent_level); - fprintf(fd, "device_info_ext:\n"); - reg_access_switch_device_info_ext_print(&(ptr_struct->data.device_info_ext), fd, indent_level + 1); + fprintf(fd, "mddq_device_info_ext:\n"); + reg_access_switch_mddq_device_info_ext_print(&(ptr_struct->data.mddq_device_info_ext), fd, indent_level + 1); break; case 0x3: adb2c_add_indentation(fd, indent_level); - fprintf(fd, "slot_name_ext:\n"); - reg_access_switch_slot_name_ext_print(&(ptr_struct->data.slot_name_ext), fd, indent_level + 1); + fprintf(fd, "mddq_slot_name_ext:\n"); + reg_access_switch_mddq_slot_name_ext_print(&(ptr_struct->data.mddq_slot_name_ext), fd, indent_level + 1); break; default: break; diff --git a/tools_layouts/reg_access_switch_layouts.h b/tools_layouts/reg_access_switch_layouts.h index 3dd4b390..67e7ba54 100644 --- a/tools_layouts/reg_access_switch_layouts.h +++ b/tools_layouts/reg_access_switch_layouts.h @@ -33,9 +33,9 @@ /*** - *** This file was generated at "2023-07-16 15:06:38" + *** This file was generated at "2024-01-14 09:35:17" *** by: - *** > [REDACTED]/adb2pack.py --input adb/prm/switch/ext/reg_access_switch.adb --file-prefix reg_access_switch --prefix reg_access_switch_ --no-adb-utils + *** > adb2pack.py --input adb/prm/switch/ext/reg_access_switch.adb --file-prefix reg_access_switch --prefix reg_access_switch_ --no-adb-utils -o user/tools_layouts ***/ #ifndef REG_ACCESS_SWITCH_LAYOUTS_H #define REG_ACCESS_SWITCH_LAYOUTS_H @@ -70,7 +70,7 @@ struct reg_access_switch_crspace_access_payload_ext { /* Description - */ /* Size in bytes - 32 */ -struct reg_access_switch_device_info_ext { +struct reg_access_switch_mddq_device_info_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - Device index The first device should number 0 */ @@ -121,34 +121,9 @@ Note: this bit is not an indication to validity of the fields related to the spe u_int8_t device_type_name[8]; }; -/* Description - */ -/* Size in bytes - 260 */ -struct reg_access_switch_prm_register_payload_ext { -/*---------------- DWORD[0] (Offset 0x0) ----------------*/ - /* Description - Register ID */ - /* 0x0.0 - 0x0.15 */ - u_int16_t register_id; - /* Description - 0: Query -1: Write */ - /* 0x0.22 - 0x0.23 */ - u_int8_t method; - /* Description - Return code of the Downstream Device to the register that was sent. -0x0: OK - Operation was successfully executed -0x1: BUSY -0x4: NOT_SUPP_REG - The Switch register requested is not supported on that device -0x7: BAD_PARAM - Incomplete or erroneous parameter set -0x70: INTERNAL_ERR - Internal error */ - /* 0x0.24 - 0x0.31 */ - u_int8_t status; -/*---------------- DWORD[1] (Offset 0x4) ----------------*/ - /* Description - Register data */ - /* 0x4.0 - 0x100.31 */ - u_int32_t register_data[64]; -}; - /* Description - */ /* Size in bytes - 32 */ -struct reg_access_switch_slot_info_ext { +struct reg_access_switch_mddq_slot_info_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - If set, the FW has completed the MDDC.device_enable command */ /* 0x0.27 - 0x0.27 */ @@ -187,7 +162,7 @@ Valid only when active or lc_ready are '1'. */ /* Description - */ /* Size in bytes - 32 */ -struct reg_access_switch_slot_name_ext { +struct reg_access_switch_mddq_slot_name_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - Slot's ASCII name. Up to 20 chars */ @@ -195,19 +170,44 @@ struct reg_access_switch_slot_name_ext { u_int8_t slot_ascii_name[20]; }; +/* Description - */ +/* Size in bytes - 260 */ +struct reg_access_switch_prm_register_payload_ext { +/*---------------- DWORD[0] (Offset 0x0) ----------------*/ + /* Description - Register ID */ + /* 0x0.0 - 0x0.15 */ + u_int16_t register_id; + /* Description - 0: Query +1: Write */ + /* 0x0.22 - 0x0.23 */ + u_int8_t method; + /* Description - Return code of the Downstream Device to the register that was sent. +0x0: OK - Operation was successfully executed +0x1: BUSY +0x4: NOT_SUPP_REG - The Switch register requested is not supported on that device +0x7: BAD_PARAM - Incomplete or erroneous parameter set +0x70: INTERNAL_ERR - Internal error */ + /* 0x0.24 - 0x0.31 */ + u_int8_t status; +/*---------------- DWORD[1] (Offset 0x4) ----------------*/ + /* Description - Register data */ + /* 0x4.0 - 0x100.31 */ + u_int32_t register_data[64]; +}; + /* Description - */ /* Size in bytes - 32 */ union reg_access_switch_mddq_data_auto_ext { /*---------------- DWORD[0] (Offset 0x0) ----------------*/ /* Description - */ /* 0x0.0 - 0x1c.31 */ - struct reg_access_switch_slot_info_ext slot_info_ext; + struct reg_access_switch_mddq_slot_info_ext mddq_slot_info_ext; /* Description - */ /* 0x0.0 - 0x1c.31 */ - struct reg_access_switch_device_info_ext device_info_ext; + struct reg_access_switch_mddq_device_info_ext mddq_device_info_ext; /* Description - */ /* 0x0.0 - 0x1c.31 */ - struct reg_access_switch_slot_name_ext slot_name_ext; + struct reg_access_switch_mddq_slot_name_ext mddq_slot_name_ext; }; /* Description - */ @@ -312,9 +312,9 @@ Note: This field is not reflecting any validity of the data while accessing a no u_int8_t data_valid; /*---------------- DWORD[4] (Offset 0x10) ----------------*/ /* Description - Properties of that field are based on query_type. -For slot information query_type data - see Table 483, "MDDQ slot_info Layout," on page 719 -For devices on slot query_type data - see Table 485, "MDDQ device_info Register Layout," on page 720 -For slot name query_type data - see Table 487, "MDDQ slot_name Layout," on page 722 */ +For slot information query_type data - see Table 443, "MDDQ slot_info Layout," on page 776 +For devices on slot query_type data - see Table 445, "MDDQ device_info Register Layout," on page 777 +For slot name query_type data - see Table 447, "MDDQ slot_name Layout," on page 779 */ /* 0x10.0 - 0x2c.31 */ union reg_access_switch_mddq_data_auto_ext data; }; @@ -343,9 +343,9 @@ struct reg_access_switch_mddt_reg_ext { u_int8_t read_size; /*---------------- DWORD[3] (Offset 0xc) ----------------*/ /* Description - Payload -For PRM Register type payload - See Table 475, "PRM Register Payload Layout," on page 715 -For Command type payload - See Table 477, "Command Payload Layout," on page 715 -For CrSpace type payload - See Table 479, "CrSpace access Payload Layout," on page 716 */ +For PRM Register type payload - See Table 435, "PRM Register Payload Layout," on page 772 +For Command type payload - See Table 437, "Command Payload Layout," on page 772 +For CrSpace type payload - See Table 439, "CrSpace access Payload Layout," on page 773 */ /* 0xc.0 - 0x10c.31 */ union reg_access_switch_mddt_reg_payload_auto_ext payload; }; @@ -659,6 +659,7 @@ NOTE: setting reset while module is plugged-in will result in transition of oper [DWIP] 0xf: Boot_error [DWIP] 0x10: Recovery_error +[DWIP] 0x11: Submodule_failure Valid only when oper_status = 4'b0011 */ /* 0x4.8 - 0x4.12 */ u_int8_t error_type; @@ -741,13 +742,27 @@ void reg_access_switch_crspace_access_payload_ext_print(const struct reg_access_ unsigned int reg_access_switch_crspace_access_payload_ext_size(void); #define REG_ACCESS_SWITCH_CRSPACE_ACCESS_PAYLOAD_EXT_SIZE (0x104) void reg_access_switch_crspace_access_payload_ext_dump(const struct reg_access_switch_crspace_access_payload_ext *ptr_struct, FILE *fd); -/* device_info_ext */ -void reg_access_switch_device_info_ext_pack(const struct reg_access_switch_device_info_ext *ptr_struct, u_int8_t *ptr_buff); -void reg_access_switch_device_info_ext_unpack(struct reg_access_switch_device_info_ext *ptr_struct, const u_int8_t *ptr_buff); -void reg_access_switch_device_info_ext_print(const struct reg_access_switch_device_info_ext *ptr_struct, FILE *fd, int indent_level); -unsigned int reg_access_switch_device_info_ext_size(void); -#define REG_ACCESS_SWITCH_DEVICE_INFO_EXT_SIZE (0x20) -void reg_access_switch_device_info_ext_dump(const struct reg_access_switch_device_info_ext *ptr_struct, FILE *fd); +/* mddq_device_info_ext */ +void reg_access_switch_mddq_device_info_ext_pack(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, u_int8_t *ptr_buff); +void reg_access_switch_mddq_device_info_ext_unpack(struct reg_access_switch_mddq_device_info_ext *ptr_struct, const u_int8_t *ptr_buff); +void reg_access_switch_mddq_device_info_ext_print(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, FILE *fd, int indent_level); +unsigned int reg_access_switch_mddq_device_info_ext_size(void); +#define REG_ACCESS_SWITCH_MDDQ_DEVICE_INFO_EXT_SIZE (0x20) +void reg_access_switch_mddq_device_info_ext_dump(const struct reg_access_switch_mddq_device_info_ext *ptr_struct, FILE *fd); +/* mddq_slot_info_ext */ +void reg_access_switch_mddq_slot_info_ext_pack(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, u_int8_t *ptr_buff); +void reg_access_switch_mddq_slot_info_ext_unpack(struct reg_access_switch_mddq_slot_info_ext *ptr_struct, const u_int8_t *ptr_buff); +void reg_access_switch_mddq_slot_info_ext_print(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, FILE *fd, int indent_level); +unsigned int reg_access_switch_mddq_slot_info_ext_size(void); +#define REG_ACCESS_SWITCH_MDDQ_SLOT_INFO_EXT_SIZE (0x20) +void reg_access_switch_mddq_slot_info_ext_dump(const struct reg_access_switch_mddq_slot_info_ext *ptr_struct, FILE *fd); +/* mddq_slot_name_ext */ +void reg_access_switch_mddq_slot_name_ext_pack(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, u_int8_t *ptr_buff); +void reg_access_switch_mddq_slot_name_ext_unpack(struct reg_access_switch_mddq_slot_name_ext *ptr_struct, const u_int8_t *ptr_buff); +void reg_access_switch_mddq_slot_name_ext_print(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, FILE *fd, int indent_level); +unsigned int reg_access_switch_mddq_slot_name_ext_size(void); +#define REG_ACCESS_SWITCH_MDDQ_SLOT_NAME_EXT_SIZE (0x20) +void reg_access_switch_mddq_slot_name_ext_dump(const struct reg_access_switch_mddq_slot_name_ext *ptr_struct, FILE *fd); /* prm_register_payload_ext */ void reg_access_switch_prm_register_payload_ext_pack(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, u_int8_t *ptr_buff); void reg_access_switch_prm_register_payload_ext_unpack(struct reg_access_switch_prm_register_payload_ext *ptr_struct, const u_int8_t *ptr_buff); @@ -755,20 +770,6 @@ void reg_access_switch_prm_register_payload_ext_print(const struct reg_access_sw unsigned int reg_access_switch_prm_register_payload_ext_size(void); #define REG_ACCESS_SWITCH_PRM_REGISTER_PAYLOAD_EXT_SIZE (0x104) void reg_access_switch_prm_register_payload_ext_dump(const struct reg_access_switch_prm_register_payload_ext *ptr_struct, FILE *fd); -/* slot_info_ext */ -void reg_access_switch_slot_info_ext_pack(const struct reg_access_switch_slot_info_ext *ptr_struct, u_int8_t *ptr_buff); -void reg_access_switch_slot_info_ext_unpack(struct reg_access_switch_slot_info_ext *ptr_struct, const u_int8_t *ptr_buff); -void reg_access_switch_slot_info_ext_print(const struct reg_access_switch_slot_info_ext *ptr_struct, FILE *fd, int indent_level); -unsigned int reg_access_switch_slot_info_ext_size(void); -#define REG_ACCESS_SWITCH_SLOT_INFO_EXT_SIZE (0x20) -void reg_access_switch_slot_info_ext_dump(const struct reg_access_switch_slot_info_ext *ptr_struct, FILE *fd); -/* slot_name_ext */ -void reg_access_switch_slot_name_ext_pack(const struct reg_access_switch_slot_name_ext *ptr_struct, u_int8_t *ptr_buff); -void reg_access_switch_slot_name_ext_unpack(struct reg_access_switch_slot_name_ext *ptr_struct, const u_int8_t *ptr_buff); -void reg_access_switch_slot_name_ext_print(const struct reg_access_switch_slot_name_ext *ptr_struct, FILE *fd, int indent_level); -unsigned int reg_access_switch_slot_name_ext_size(void); -#define REG_ACCESS_SWITCH_SLOT_NAME_EXT_SIZE (0x20) -void reg_access_switch_slot_name_ext_dump(const struct reg_access_switch_slot_name_ext *ptr_struct, FILE *fd); /* mddq_data_auto_ext */ void reg_access_switch_mddq_data_auto_ext_pack(const union reg_access_switch_mddq_data_auto_ext *ptr_struct, u_int8_t *ptr_buff); void reg_access_switch_mddq_data_auto_ext_unpack(union reg_access_switch_mddq_data_auto_ext *ptr_struct, const u_int8_t *ptr_buff);