[Pkg-ofed-commits] [mstflint] 01/10: Imported Upstream version 4.4.0+1.12.gd1edd58

Benjamin Drung bdrung at moszumanska.debian.org
Tue Aug 16 14:47:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

bdrung pushed a commit to branch master
in repository mstflint.

commit 72fc16c6f3c2a6d6c3f80dfdcd319ce07b0298df
Author: Benjamin Drung <benjamin.drung at profitbricks.com>
Date:   Tue Aug 16 16:00:43 2016 +0200

    Imported Upstream version 4.4.0+1.12.gd1edd58
---
 Makefile.am                                        |     4 +-
 Makefile.in                                        |    11 +-
 README                                             |     1 -
 aclocal.m4                                         |    59 +
 autom4te.cache/output.0                            |   246 +-
 autom4te.cache/output.1                            |   246 +-
 autom4te.cache/requests                            |     4 +-
 autom4te.cache/traces.0                            |   271 +-
 autom4te.cache/traces.1                            |   446 +-
 cmdif/Makefile.am                                  |     4 +-
 cmdif/Makefile.in                                  |    10 +-
 cmdif/icmd_cif_common.c                            |   136 +
 cmdif/icmd_cif_common.h                            |   101 +
 cmdif/icmd_cif_macros.h                            |    90 +
 .../mflash_access_layer.h => cmdif/icmd_cif_open.c |    36 +-
 .../mflash_access_layer.h => cmdif/icmd_cif_open.h |    42 +-
 cmdparser/Makefile.am                              |     2 -
 cmdparser/Makefile.in                              |     2 +-
 {cmdparser => common}/Makefile.am                  |     8 +-
 {mstdump/mstdump_dbs => common}/Makefile.in        |   226 +-
 common/gitversion.h                                |     2 +-
 config/ar-lib                                      |   270 +
 configure                                          |   246 +-
 configure.ac                                       |    31 +-
 dev_mgt/Makefile.am                                |     2 +-
 dev_mgt/Makefile.in                                |     3 +-
 dev_mgt/tools_dev_types.c                          |   480 +-
 dev_mgt/tools_dev_types.h                          |    65 +-
 flint/Makefile.am                                  |    10 +-
 flint/Makefile.in                                  |    14 +-
 flint/cmd_line_parser.cpp                          |    73 +-
 flint/err_msgs.h                                   |    13 +-
 flint/flint.cpp                                    |     8 +
 flint/flint_params.cpp                             |     2 +-
 flint/flint_params.h                               |     8 +-
 flint/subcommands.cpp                              |  1251 +-
 flint/subcommands.h                                |    83 +-
 include/mtcr_ul/mtcr.h                             |   176 +-
 include/mtcr_ul/mtcr_com_defs.h                    |   293 +
 include/mtcr_ul/mtcr_mf.h                          |   134 +
 man/mstconfig.1                                    |   249 +
 man/mstflint.1                                     |    58 +-
 man/mstmcra.1                                      |    34 +
 man/mstmread.1                                     |    10 +
 man/mstmtserver.1                                  |    16 +
 man/mstmwrite.1                                    |    10 +
 man/mstregdump.1                                   |    23 +
 man/mstvpd.1                                       |    37 +
 mflash/Makefile.am                                 |     6 +-
 mflash/Makefile.in                                 |    58 +-
 mflash/mflash.c                                    |   295 +-
 mflash/mflash.h                                    |    25 +-
 mflash/mflash_access_layer.c                       |    45 +-
 mflash/mflash_access_layer.h                       |    11 +-
 mflash/mflash_common_structs.h                     |    28 +-
 mflash/mflash_pack_layer.c                         |    30 +-
 mflash/mflash_pack_layer.h                         |    27 +-
 mflash/mflash_types.h                              |    17 +-
 mft_utils/Makefile.am                              |     4 +-
 mft_utils/Makefile.in                              |    10 +-
 mft_utils/calc_hw_crc.c                            |    90 +
 .../calc_hw_crc.h                                  |    31 +-
 mft_utils/mft_sig_handler.c                        |    15 +
 mft_utils/mft_sig_handler.h                        |     4 +
 mft_utils/mlarge_buffer.cpp                        |   174 +
 mft_utils/mlarge_buffer.h                          |    80 +
 mlxconfig/Makefile.am                              |     4 +-
 mlxconfig/Makefile.in                              |     5 +-
 mlxconfig/mlxcfg_lib.cpp                           |   169 +-
 mlxconfig/mlxcfg_lib.h                             |    21 +-
 mlxconfig/mlxcfg_param_lib.cpp                     |  2004 ++-
 mlxconfig/mlxcfg_param_lib.h                       |   558 +-
 mlxconfig/mlxcfg_parser.cpp                        |   751 +-
 mlxconfig/mlxcfg_status.h                          |    10 +-
 mlxconfig/mlxcfg_ui.cpp                            |   199 +-
 mlxconfig/mlxcfg_ui.h                              |   109 +-
 mlxfwops/Makefile.in                               |     1 +
 mlxfwops/lib/Makefile.am                           |    12 +-
 mlxfwops/lib/Makefile.in                           |    15 +-
 mlxfwops/lib/aux_tlv_ops.cpp                       |   545 +
 mlxfwops/lib/aux_tlv_ops.h                         |   165 +
 mlxfwops/lib/flint_base.cpp                        |    21 +-
 mlxfwops/lib/flint_base.h                          |    42 +-
 mlxfwops/lib/flint_io.cpp                          |   181 +-
 mlxfwops/lib/flint_io.h                            |    44 +-
 mlxfwops/lib/fs2_ops.cpp                           |   235 +-
 mlxfwops/lib/fs2_ops.h                             |     9 +-
 mlxfwops/lib/fs3_ops.cpp                           |  1016 +-
 mlxfwops/lib/fs3_ops.h                             |   136 +-
 mlxfwops/lib/fw_ops.cpp                            |   373 +-
 mlxfwops/lib/fw_ops.h                              |    69 +-
 mlxfwops/lib/mlxfwops.cpp                          |    16 +-
 mlxfwops/lib/mlxfwops.h                            |     3 +
 mlxfwops/lib/mlxfwops_com.h                        |    62 +-
 mstdump/Makefile.in                                |     1 +
 mstdump/crd_lib/Makefile.am                        |     2 +-
 mstdump/crd_lib/Makefile.in                        |     3 +-
 mstdump/crd_lib/crdump.c                           |    17 +-
 mstdump/crd_main/Makefile.am                       |     4 +-
 mstdump/crd_main/Makefile.in                       |    27 +-
 mstdump/crd_main/mstdump.c                         |    20 +-
 mstdump/mstdump_dbs/BridgeX.csv                    |  1463 ---
 mstdump/mstdump_dbs/ConnectX.csv                   |  2301 ----
 mstdump/mstdump_dbs/ConnectX4.csv                  |    96 -
 mstdump/mstdump_dbs/Makefile.in                    |     1 +
 mstdump/mstdump_dbs/Spectrum.csv                   |   626 +-
 mstdump/mstdump_dbs/SwitchIB2.csv                  | 13081 +++++++++++++++++++
 mstflint.spec                                      |    36 +-
 mstflint.spec.in                                   |    32 +-
 mtcr_ul/Makefile.am                                |    11 +-
 mtcr_ul/Makefile.in                                |   118 +-
 mtcr_ul/mtcr_ib.h                                  |     4 +-
 mtcr_ul/mtcr_ib_ofed.c                             |    76 +-
 mtcr_ul/mtcr_ib_res_mgt.c                          |   194 +
 .../mtcr_ib_res_mgt.h                              |    42 +-
 mtcr_ul/mtcr_icmd_cif.h                            |    15 +-
 mtcr_ul/mtcr_int_defs.h                            |    44 +-
 mtcr_ul/mtcr_tools_cif.c                           |     2 +
 mtcr_ul/mtcr_tools_cif.h                           |     7 +-
 mtcr_ul/mtcr_ul.c                                  |  2359 +---
 mtcr_ul/{mtcr_ul.c => mtcr_ul_com.c}               |  1692 +--
 mtcr_ul/mtcr_ul_com.h                              |   143 +
 mtcr_ul/mtcr_ul_icmd_cif.c                         |    63 +-
 reg_access/Makefile.am                             |     6 +-
 reg_access/Makefile.in                             |    49 +-
 reg_access/reg_access.c                            |    74 +-
 reg_access/reg_access.h                            |     3 +
 small_utils/Makefile.am                            |     2 +-
 small_utils/Makefile.in                            |     3 +-
 small_utils/hca_self_test.ofed                     |    39 +-
 small_utils/mcra.c                                 |    23 +-
 small_utils/vpd.c                                  |    24 +-
 {mft_utils => tools_crypto}/Makefile.am            |    14 +-
 {cmdif => tools_crypto}/Makefile.in                |    47 +-
 .../tools_md5.c                                    |    30 +-
 .../tools_md5.h                                    |    32 +-
 tools_layouts/Makefile.am                          |     8 +-
 tools_layouts/Makefile.in                          |    67 +-
 tools_layouts/adb_to_c_utils.c                     |    14 +-
 tools_layouts/adb_to_c_utils.h                     |     2 +-
 tools_layouts/connectib_layouts.c                  |   214 +
 tools_layouts/connectib_layouts.h                  |   108 +
 tools_layouts/cx4fw_layouts.c                      |     1 -
 tools_layouts/register_access_open_layouts.c       |   203 +-
 tools_layouts/register_access_open_layouts.h       |    21 +-
 tools_layouts/tools_open_layouts.c                 |  4315 ++++--
 tools_layouts/tools_open_layouts.h                 |   635 +-
 tools_res_mgmt/Makefile.am                         |     8 +-
 tools_res_mgmt/Makefile.in                         |    13 +-
 tools_res_mgmt/tools_res_mgmt.c                    |   279 +-
 tools_res_mgmt/tools_res_mgmt.h                    |    28 +-
 .../tools_time.c                                   |    37 +-
 .../tools_time.h                                   |    35 +-
 153 files changed, 29565 insertions(+), 12520 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4244974..2da1619 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,9 +30,9 @@
 # SOFTWARE.
 #--
 
-SUBDIRS = mft_utils tools_layouts mtcr_ul reg_access cmdif dev_mgt tools_res_mgmt mflash mlxconfig mlxfwops cmdparser flint small_utils mstdump 
+SUBDIRS = common mft_utils $(TOOLS_CRYPTO) tools_layouts mtcr_ul reg_access cmdif dev_mgt tools_res_mgmt mflash mlxconfig mlxfwops cmdparser flint small_utils mstdump
 
-man_MANS = man/mstflint.1
+man_MANS = man/mstflint.1 man/mstconfig.1 man/mstmcra.1 man/mstmread.1 man/mstmwrite.1 man/mstmtserver.1 man/mstregdump.1 man/mstvpd.1
 
 EXTRA_DIST = \
 	mstflint.spec \
diff --git a/Makefile.in b/Makefile.in
index cabacab..92ae1be 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -113,9 +113,9 @@ subdir = .
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) \
 	$(srcdir)/config.h.in $(srcdir)/mstflint.spec.in COPYING \
-	README config/config.guess config/config.sub config/install-sh \
-	config/missing config/ltmain.sh \
-	$(top_srcdir)/config/config.guess \
+	README config/ar-lib config/config.guess config/config.sub \
+	config/install-sh config/missing config/ltmain.sh \
+	$(top_srcdir)/config/ar-lib $(top_srcdir)/config/config.guess \
 	$(top_srcdir)/config/config.sub \
 	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
 	$(top_srcdir)/config/missing
@@ -326,6 +326,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -380,8 +381,8 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = mft_utils tools_layouts mtcr_ul reg_access cmdif dev_mgt tools_res_mgmt mflash mlxconfig mlxfwops cmdparser flint small_utils mstdump 
-man_MANS = man/mstflint.1
+SUBDIRS = common mft_utils $(TOOLS_CRYPTO) tools_layouts mtcr_ul reg_access cmdif dev_mgt tools_res_mgmt mflash mlxconfig mlxfwops cmdparser flint small_utils mstdump
+man_MANS = man/mstflint.1 man/mstconfig.1 man/mstmcra.1 man/mstmread.1 man/mstmwrite.1 man/mstmtserver.1 man/mstregdump.1 man/mstvpd.1
 EXTRA_DIST = \
 	mstflint.spec \
 	small_utils/hca_self_test.ofed \
diff --git a/README b/README
index 917aa31..a81450f 100644
--- a/README
+++ b/README
@@ -173,4 +173,3 @@ MSTFLINT Package - Firmware Burning and Diagnostics Tools
         mstflint -d 02:00.0 q
         mstvpd 02:00.0
 
-
diff --git a/aclocal.m4 b/aclocal.m4
index 1e06079..4716707 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -8647,6 +8647,65 @@ m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed.  If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+  [am_cv_ar_interface=ar
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+        AC_TRY_EVAL([am_ar_try])
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     ])
+   ])
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
+
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0
index 9f050df..0d885ad 100644
--- a/autom4te.cache/output.0
+++ b/autom4te.cache/output.0
@@ -1,6 +1,6 @@
 @%:@! /bin/sh
 @%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.69 for mstflint 4.1.0.
+@%:@ Generated by GNU Autoconf 2.69 for mstflint 4.4.0.
 @%:@
 @%:@ Report bugs to <adrianc at mellanox.co.il>.
 @%:@ 
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mstflint'
 PACKAGE_TARNAME='mstflint'
-PACKAGE_VERSION='4.1.0'
-PACKAGE_STRING='mstflint 4.1.0'
+PACKAGE_VERSION='4.4.0'
+PACKAGE_STRING='mstflint 4.4.0'
 PACKAGE_BUGREPORT='adrianc at mellanox.co.il'
 PACKAGE_URL=''
 
@@ -636,6 +636,9 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIB@&t at OBJS
+ENABLE_OPENSSL_FALSE
+ENABLE_OPENSSL_TRUE
+TOOLS_CRYPTO
 ENABLE_INBAND_FALSE
 ENABLE_INBAND_TRUE
 ENABLE_DC
@@ -650,8 +653,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 RANLIB
-ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -672,6 +673,8 @@ build_vendor
 build_cpu
 build
 LIBTOOL
+ac_ct_AR
+AR
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
@@ -775,6 +778,7 @@ with_sysroot
 enable_libtool_lock
 enable_dc
 enable_inband
+enable_cs
 enable_static_libstdcpp
 enable_dynamic_ld
 '
@@ -1331,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mstflint 4.1.0 to adapt to many kinds of systems.
+\`configure' configures mstflint 4.4.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1401,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mstflint 4.1.0:";;
+     short | recursive ) echo "Configuration of mstflint 4.4.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1422,6 +1426,7 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-dc            Disable mstflint "dc" command. Eliminates zlib dependency
   --disable-inband        Disable inabnd access. Prevents FW updtes for Mellanox SwitchX and ConnectIB devices. Eliminates infiniband/mad.h dependency
+  --enable-cs          Enable mstflint "checksum" command, dependant of openssl library
   --enable-static-libstdcpp 
                           Enable link static to libstdc++
   --enable-dynamic-ld     Enable dynamic link to ld64.so
@@ -1514,7 +1519,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mstflint configure 4.1.0
+mstflint configure 4.4.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2004,7 +2009,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mstflint $as_me 4.1.0, which was
+It was created by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2362,7 +2367,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-@%:@define VERSION "4.1.0"
+@%:@define VERSION "4.4.0"
 _ACEOF
 
 
@@ -2882,9 +2887,8 @@ fi
 
 
 # Define the identity of the package.
-
- PACKAGE=mstflint
- VERSION=4.1.0
+ PACKAGE='mstflint'
+ VERSION='4.4.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4301,6 +4305,167 @@ else
 fi
 
 
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar lib "link -lib"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar lib "link -lib"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  am_cv_ar_interface=ar
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+  ;;
+esac
+
 case `pwd` in
   *\ * | *\	*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -5891,7 +6056,6 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
     
 
 
-
 if test -n "$ac_tool_prefix"; then
   for ac_prog in ar
   do
@@ -15100,6 +15264,8 @@ fi
 
 
 
+TOOLS_CRYPTO=""
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-dc argument" >&5
 $as_echo_n "checking --enable-dc argument... " >&6; }
 @%:@ Check whether --enable-dc was given.
@@ -15210,6 +15376,38 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cs argument" >&5
+$as_echo_n "checking --enable-cs argument... " >&6; }
+@%:@ Check whether --enable-cs was given.
+if test "${enable_cs+set}" = set; then :
+  enableval=$enable_cs; enable_cs="yes"
+else
+  enable_cs="no"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cs" >&5
+$as_echo "$enable_cs" >&6; }
+if test "x$enable_cs" = "xyes"; then
+  ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
+  
+else
+  as_fn_error $? "cannot find openssl/md5.h . remove --enable-openssl to remove this dependaency or install openssl" "$LINENO" 5
+fi
+
+
+  TOOLS_CRYPTO="tools_crypto"
+fi
+
+ if test  "x$enable_cs" = "xyes"; then
+  ENABLE_OPENSSL_TRUE=
+  ENABLE_OPENSSL_FALSE='#'
+else
+  ENABLE_OPENSSL_TRUE='#'
+  ENABLE_OPENSSL_FALSE=
+fi
+
+
 @%:@ Check whether --enable-static_libstdcpp was given.
 if test "${enable_static_libstdcpp+set}" = set; then :
   enableval=$enable_static_libstdcpp; 
@@ -15240,7 +15438,14 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
 ac_config_files="$ac_config_files mstflint.spec"
 
 
-ac_config_files="$ac_config_files Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
+if test "x$enable_cs" = "xyes"; then :
+  
+        ac_config_files="$ac_config_files tools_crypto/Makefile"
+
+    
+fi
+
+ac_config_files="$ac_config_files Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -15387,6 +15592,10 @@ if test -z "${ENABLE_INBAND_TRUE}" && test -z "${ENABLE_INBAND_FALSE}"; then
   as_fn_error $? "conditional \"ENABLE_INBAND\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_OPENSSL_TRUE}" && test -z "${ENABLE_OPENSSL_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_OPENSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -15784,7 +15993,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mstflint $as_me 4.1.0, which was
+This file was extended by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15850,7 +16059,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mstflint config.status 4.1.0
+mstflint config.status 4.4.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16358,7 +16567,9 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "mstflint.spec") CONFIG_FILES="$CONFIG_FILES mstflint.spec" ;;
+    "tools_crypto/Makefile") CONFIG_FILES="$CONFIG_FILES tools_crypto/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
     "mft_utils/Makefile") CONFIG_FILES="$CONFIG_FILES mft_utils/Makefile" ;;
     "mtcr_ul/Makefile") CONFIG_FILES="$CONFIG_FILES mtcr_ul/Makefile" ;;
     "dev_mgt/Makefile") CONFIG_FILES="$CONFIG_FILES dev_mgt/Makefile" ;;
@@ -17900,4 +18111,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1
index 5bf80c3..45ca802 100644
--- a/autom4te.cache/output.1
+++ b/autom4te.cache/output.1
@@ -1,6 +1,6 @@
 @%:@! /bin/sh
 @%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.69 for mstflint 4.1.0.
+@%:@ Generated by GNU Autoconf 2.69 for mstflint 4.4.0.
 @%:@
 @%:@ Report bugs to <adrianc at mellanox.co.il>.
 @%:@ 
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mstflint'
 PACKAGE_TARNAME='mstflint'
-PACKAGE_VERSION='4.1.0'
-PACKAGE_STRING='mstflint 4.1.0'
+PACKAGE_VERSION='4.4.0'
+PACKAGE_STRING='mstflint 4.4.0'
 PACKAGE_BUGREPORT='adrianc at mellanox.co.il'
 PACKAGE_URL=''
 
@@ -636,6 +636,9 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIB@&t at OBJS
+ENABLE_OPENSSL_FALSE
+ENABLE_OPENSSL_TRUE
+TOOLS_CRYPTO
 ENABLE_INBAND_FALSE
 ENABLE_INBAND_TRUE
 ENABLE_DC
@@ -650,8 +653,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 RANLIB
-ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -672,6 +673,8 @@ build_vendor
 build_cpu
 build
 LIBTOOL
+ac_ct_AR
+AR
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
@@ -775,6 +778,7 @@ with_sysroot
 enable_libtool_lock
 enable_dc
 enable_inband
+enable_cs
 enable_static_libstdcpp
 enable_dynamic_ld
 '
@@ -1331,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mstflint 4.1.0 to adapt to many kinds of systems.
+\`configure' configures mstflint 4.4.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1401,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mstflint 4.1.0:";;
+     short | recursive ) echo "Configuration of mstflint 4.4.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1422,6 +1426,7 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-dc            Disable mstflint "dc" command. Eliminates zlib dependency
   --disable-inband        Disable inabnd access. Prevents FW updtes for Mellanox SwitchX and ConnectIB devices. Eliminates infiniband/mad.h dependency
+  --enable-cs          Enable mstflint "checksum" command, dependant of openssl library
   --enable-static-libstdcpp 
                           Enable link static to libstdc++
   --enable-dynamic-ld     Enable dynamic link to ld64.so
@@ -1514,7 +1519,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mstflint configure 4.1.0
+mstflint configure 4.4.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2004,7 +2009,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mstflint $as_me 4.1.0, which was
+It was created by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2362,7 +2367,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-@%:@define VERSION "4.1.0"
+@%:@define VERSION "4.4.0"
 _ACEOF
 
 
@@ -2882,9 +2887,8 @@ fi
 
 
 # Define the identity of the package.
-
- PACKAGE=mstflint
- VERSION=4.1.0
+ PACKAGE='mstflint'
+ VERSION='4.4.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4301,6 +4305,167 @@ else
 fi
 
 
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar lib "link -lib"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar lib "link -lib"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  am_cv_ar_interface=ar
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+  ;;
+esac
+
 case `pwd` in
   *\ * | *\	*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -5891,7 +6056,6 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
     
 
 
-
 if test -n "$ac_tool_prefix"; then
   for ac_prog in ar
   do
@@ -15096,6 +15260,8 @@ fi
 
 
 
+TOOLS_CRYPTO=""
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-dc argument" >&5
 $as_echo_n "checking --enable-dc argument... " >&6; }
 @%:@ Check whether --enable-dc was given.
@@ -15206,6 +15372,38 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cs argument" >&5
+$as_echo_n "checking --enable-cs argument... " >&6; }
+@%:@ Check whether --enable-cs was given.
+if test "${enable_cs+set}" = set; then :
+  enableval=$enable_cs; enable_cs="yes"
+else
+  enable_cs="no"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cs" >&5
+$as_echo "$enable_cs" >&6; }
+if test "x$enable_cs" = "xyes"; then
+  ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
+  
+else
+  as_fn_error $? "cannot find openssl/md5.h . remove --enable-openssl to remove this dependaency or install openssl" "$LINENO" 5
+fi
+
+
+  TOOLS_CRYPTO="tools_crypto"
+fi
+
+ if test  "x$enable_cs" = "xyes"; then
+  ENABLE_OPENSSL_TRUE=
+  ENABLE_OPENSSL_FALSE='#'
+else
+  ENABLE_OPENSSL_TRUE='#'
+  ENABLE_OPENSSL_FALSE=
+fi
+
+
 @%:@ Check whether --enable-static_libstdcpp was given.
 if test "${enable_static_libstdcpp+set}" = set; then :
   enableval=$enable_static_libstdcpp; 
@@ -15236,7 +15434,14 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
 ac_config_files="$ac_config_files mstflint.spec"
 
 
-ac_config_files="$ac_config_files Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
+if test "x$enable_cs" = "xyes"; then :
+  
+        ac_config_files="$ac_config_files tools_crypto/Makefile"
+
+    
+fi
+
+ac_config_files="$ac_config_files Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -15383,6 +15588,10 @@ if test -z "${ENABLE_INBAND_TRUE}" && test -z "${ENABLE_INBAND_FALSE}"; then
   as_fn_error $? "conditional \"ENABLE_INBAND\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_OPENSSL_TRUE}" && test -z "${ENABLE_OPENSSL_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_OPENSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -15780,7 +15989,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mstflint $as_me 4.1.0, which was
+This file was extended by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15846,7 +16055,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mstflint config.status 4.1.0
+mstflint config.status 4.4.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16354,7 +16563,9 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "mstflint.spec") CONFIG_FILES="$CONFIG_FILES mstflint.spec" ;;
+    "tools_crypto/Makefile") CONFIG_FILES="$CONFIG_FILES tools_crypto/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
     "mft_utils/Makefile") CONFIG_FILES="$CONFIG_FILES mft_utils/Makefile" ;;
     "mtcr_ul/Makefile") CONFIG_FILES="$CONFIG_FILES mtcr_ul/Makefile" ;;
     "dev_mgt/Makefile") CONFIG_FILES="$CONFIG_FILES dev_mgt/Makefile" ;;
@@ -17896,4 +18107,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
diff --git a/autom4te.cache/requests b/autom4te.cache/requests
index 997429e..92fe2d3 100644
--- a/autom4te.cache/requests
+++ b/autom4te.cache/requests
@@ -21,6 +21,7 @@
                         '/usr/share/aclocal/ltversion.m4',
                         '/usr/share/aclocal/lt~obsolete.m4',
                         '/usr/share/aclocal-1.13/amversion.m4',
+                        '/usr/share/aclocal-1.13/ar-lib.m4',
                         '/usr/share/aclocal-1.13/auxdir.m4',
                         '/usr/share/aclocal-1.13/cond.m4',
                         '/usr/share/aclocal-1.13/depend.m4',
@@ -44,8 +45,8 @@
                         'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
                         '_LT_AC_SHELL_INIT' => 1,
                         'AC_DEFUN' => 1,
-                        'AC_PROG_LIBTOOL' => 1,
                         '_LT_AC_LANG_CXX_CONFIG' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
                         'AM_AUTOMAKE_VERSION' => 1,
                         'AM_SUBST_NOTMAKE' => 1,
                         'AM_MISSING_PROG' => 1,
@@ -117,6 +118,7 @@
                         'LT_AC_PROG_SED' => 1,
                         'AM_ENABLE_SHARED' => 1,
                         'LTDL_INSTALLABLE' => 1,
+                        'AM_PROG_AR' => 1,
                         '_LT_AC_LANG_GCJ_CONFIG' => 1,
                         'AC_ENABLE_SHARED' => 1,
                         'AC_ENABLE_STATIC' => 1,
diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0
index 10891ee..20daebd 100644
--- a/autom4te.cache/traces.0
+++ b/autom4te.cache/traces.0
@@ -1581,6 +1581,52 @@ m4trace:/usr/share/aclocal-1.13/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AU
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+m4trace:/usr/share/aclocal-1.13/ar-lib.m4:13: -1- AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+  [am_cv_ar_interface=ar
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+        AC_TRY_EVAL([am_ar_try])
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     ])
+   ])
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
 m4trace:/usr/share/aclocal-1.13/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
 AC_PREREQ([2.50])dnl
 # expand $ac_aux_dir to an absolute path
@@ -2301,7 +2347,7 @@ m4trace:configure.ac:5: -1- m4_pattern_allow([^PROJECT$])
 m4trace:configure.ac:6: -1- m4_pattern_allow([^PROJECT$])
 m4trace:configure.ac:8: -1- m4_pattern_allow([^VERSION$])
 m4trace:configure.ac:9: -1- m4_pattern_allow([^VERSION$])
-m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE([mstflint], [4.1.0])
+m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE
 m4trace:configure.ac:13: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
 m4trace:configure.ac:13: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
 m4trace:configure.ac:13: -1- AM_AUTOMAKE_VERSION([1.13.4])
@@ -2312,8 +2358,7 @@ m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_DATA$])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^am__isrc$])
 m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__isrc])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^CYGPATH_W$])
-m4trace:configure.ac:13: -1- _m4_warn([obsolete], [AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.], [/usr/share/aclocal-1.13/init.m4:23: AM_INIT_AUTOMAKE is expanded from...
-configure.ac:13: the top level])
+m4trace:configure.ac:13: -1- _AM_SET_OPTIONS([])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$])
 m4trace:configure.ac:13: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
@@ -2435,119 +2480,129 @@ m4trace:configure.ac:17: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
 m4trace:configure.ac:17: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
 m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
 m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
-m4trace:configure.ac:18: -1- AC_PROG_LIBTOOL
-m4trace:configure.ac:18: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete.
-You should run autoupdate.], [/usr/share/aclocal/libtool.m4:107: AC_PROG_LIBTOOL is expanded from...
-configure.ac:18: the top level])
-m4trace:configure.ac:18: -1- LT_INIT
-m4trace:configure.ac:18: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
-m4trace:configure.ac:18: -1- LTOPTIONS_VERSION
-m4trace:configure.ac:18: -1- LTSUGAR_VERSION
-m4trace:configure.ac:18: -1- LTVERSION_VERSION
-m4trace:configure.ac:18: -1- LTOBSOLETE_VERSION
-m4trace:configure.ac:18: -1- _LT_PROG_LTMAIN
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LIBTOOL$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_cpu$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_vendor$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_os$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_cpu$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_vendor$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_os$])
-m4trace:configure.ac:18: -1- _LT_PREPARE_SED_QUOTE_VARS
-m4trace:configure.ac:18: -1- _LT_PROG_ECHO_BACKSLASH
-m4trace:configure.ac:18: -1- LT_PATH_LD
-m4trace:configure.ac:18: -1- m4_pattern_allow([^SED$])
-m4trace:configure.ac:18: -1- AC_PROG_EGREP
-m4trace:configure.ac:18: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^EGREP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^FGREP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LD$])
-m4trace:configure.ac:18: -1- LT_PATH_NM
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DUMPBIN$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DUMPBIN$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^NM$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LN_S$])
-m4trace:configure.ac:18: -1- LT_CMD_MAX_LEN
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OBJDUMP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OBJDUMP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DLLTOOL$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:18: -1- AM_PROG_AR
 m4trace:configure.ac:18: -1- m4_pattern_allow([^AR$])
 m4trace:configure.ac:18: -1- m4_pattern_allow([^ac_ct_AR$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.ac:18: -1- _LT_WITH_SYSROOT
-m4trace:configure.ac:18: -1- m4_pattern_allow([LT_OBJDIR])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LT_OBJDIR$])
-m4trace:configure.ac:18: -1- _LT_CC_BASENAME([$compiler])
-m4trace:configure.ac:18: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH])
-m4trace:configure.ac:18: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH])
-m4trace:configure.ac:18: -1- LT_SUPPORTED_TAG([CC])
-m4trace:configure.ac:18: -1- _LT_COMPILER_BOILERPLATE
-m4trace:configure.ac:18: -1- _LT_LINKER_BOILERPLATE
-m4trace:configure.ac:18: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"])
-m4trace:configure.ac:18: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t at m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in
+m4trace:configure.ac:18: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:19: -1- AC_PROG_LIBTOOL
+m4trace:configure.ac:19: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete.
+You should run autoupdate.], [/usr/share/aclocal/libtool.m4:107: AC_PROG_LIBTOOL is expanded from...
+configure.ac:19: the top level])
+m4trace:configure.ac:19: -1- LT_INIT
+m4trace:configure.ac:19: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
+m4trace:configure.ac:19: -1- LTOPTIONS_VERSION
+m4trace:configure.ac:19: -1- LTSUGAR_VERSION
+m4trace:configure.ac:19: -1- LTVERSION_VERSION
+m4trace:configure.ac:19: -1- LTOBSOLETE_VERSION
+m4trace:configure.ac:19: -1- _LT_PROG_LTMAIN
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LIBTOOL$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:19: -1- _LT_PREPARE_SED_QUOTE_VARS
+m4trace:configure.ac:19: -1- _LT_PROG_ECHO_BACKSLASH
+m4trace:configure.ac:19: -1- LT_PATH_LD
+m4trace:configure.ac:19: -1- m4_pattern_allow([^SED$])
+m4trace:configure.ac:19: -1- AC_PROG_EGREP
+m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^FGREP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
+m4trace:configure.ac:19: -1- LT_PATH_NM
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^NM$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.ac:19: -1- LT_CMD_MAX_LEN
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_AR$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:19: -1- _LT_WITH_SYSROOT
+m4trace:configure.ac:19: -1- m4_pattern_allow([LT_OBJDIR])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LT_OBJDIR$])
+m4trace:configure.ac:19: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.ac:19: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.ac:19: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CC])
+m4trace:configure.ac:19: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.ac:19: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.ac:19: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"])
+m4trace:configure.ac:19: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t at m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in
      "" | " "*) ;;
      *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;;
      esac], [_LT_TAGVAR(lt_prog_compiler_pic, )=
      _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no])
-m4trace:configure.ac:18: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^MANIFEST_TOOL$])
-m4trace:configure.ac:18: -1- _LT_REQUIRED_DARWIN_CHECKS
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DSYMUTIL$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^NMEDIT$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LIPO$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OTOOL$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OTOOL64$])
-m4trace:configure.ac:18: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])
-m4trace:configure.ac:18: -1- LT_SYS_DLOPEN_SELF
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^STDC_HEADERS$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
-m4trace:configure.ac:18: -1- LT_LANG([CXX])
-m4trace:configure.ac:18: -1- LT_SUPPORTED_TAG([CXX])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.ac:18: -1- _LT_COMPILER_BOILERPLATE
-m4trace:configure.ac:18: -1- _LT_LINKER_BOILERPLATE
-m4trace:configure.ac:18: -1- _LT_CC_BASENAME([$compiler])
-m4trace:configure.ac:18: -1- LT_PATH_LD
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LD$])
-m4trace:configure.ac:18: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, CXX) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, CXX)], [$_LT_TAGVAR(lt_prog_compiler_pic, CXX)@&t at m4_if([CXX],[],[ -DPIC],[m4_if([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, CXX) in
+m4trace:configure.ac:19: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^MANIFEST_TOOL$])
+m4trace:configure.ac:19: -1- _LT_REQUIRED_DARWIN_CHECKS
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DSYMUTIL$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^NMEDIT$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LIPO$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL64$])
+m4trace:configure.ac:19: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])
+m4trace:configure.ac:19: -1- LT_SYS_DLOPEN_SELF
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
+m4trace:configure.ac:19: -1- LT_LANG([CXX])
+m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CXX])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:19: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.ac:19: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.ac:19: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.ac:19: -1- LT_PATH_LD
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
+m4trace:configure.ac:19: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, CXX) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, CXX)], [$_LT_TAGVAR(lt_prog_compiler_pic, CXX)@&t at m4_if([CXX],[],[ -DPIC],[m4_if([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, CXX) in
      "" | " "*) ;;
      *) _LT_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_TAGVAR(lt_prog_compiler_pic, CXX)" ;;
      esac], [_LT_TAGVAR(lt_prog_compiler_pic, CXX)=
      _LT_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no])
-m4trace:configure.ac:18: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works_CXX], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, CXX)=])
-m4trace:configure.ac:32: -1- m4_pattern_allow([^HAVE_LIBZ$])
-m4trace:configure.ac:35: -1- AM_CONDITIONAL([ENABLE_DC], [test  "x$enable_dc" = "xyes"])
-m4trace:configure.ac:35: -1- m4_pattern_allow([^ENABLE_DC_TRUE$])
-m4trace:configure.ac:35: -1- m4_pattern_allow([^ENABLE_DC_FALSE$])
-m4trace:configure.ac:35: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_TRUE])
-m4trace:configure.ac:35: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_FALSE])
-m4trace:configure.ac:36: -1- m4_pattern_allow([^ENABLE_DC$])
-m4trace:configure.ac:48: -1- AM_CONDITIONAL([ENABLE_INBAND], [test  "x$enable_inband" = "xyes"])
-m4trace:configure.ac:48: -1- m4_pattern_allow([^ENABLE_INBAND_TRUE$])
-m4trace:configure.ac:48: -1- m4_pattern_allow([^ENABLE_INBAND_FALSE$])
-m4trace:configure.ac:48: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_TRUE])
-m4trace:configure.ac:48: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_FALSE])
-m4trace:configure.ac:69: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
+m4trace:configure.ac:19: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works_CXX], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, CXX)=])
+m4trace:configure.ac:35: -1- m4_pattern_allow([^HAVE_LIBZ$])
+m4trace:configure.ac:38: -1- AM_CONDITIONAL([ENABLE_DC], [test  "x$enable_dc" = "xyes"])
+m4trace:configure.ac:38: -1- m4_pattern_allow([^ENABLE_DC_TRUE$])
+m4trace:configure.ac:38: -1- m4_pattern_allow([^ENABLE_DC_FALSE$])
+m4trace:configure.ac:38: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_TRUE])
+m4trace:configure.ac:38: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_FALSE])
+m4trace:configure.ac:39: -1- m4_pattern_allow([^ENABLE_DC$])
+m4trace:configure.ac:51: -1- AM_CONDITIONAL([ENABLE_INBAND], [test  "x$enable_inband" = "xyes"])
+m4trace:configure.ac:51: -1- m4_pattern_allow([^ENABLE_INBAND_TRUE$])
+m4trace:configure.ac:51: -1- m4_pattern_allow([^ENABLE_INBAND_FALSE$])
+m4trace:configure.ac:51: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_TRUE])
+m4trace:configure.ac:51: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_FALSE])
+m4trace:configure.ac:63: -1- m4_pattern_allow([^TOOLS_CRYPTO$])
+m4trace:configure.ac:64: -1- AM_CONDITIONAL([ENABLE_OPENSSL], [test  "x$enable_cs" = "xyes"])
+m4trace:configure.ac:64: -1- m4_pattern_allow([^ENABLE_OPENSSL_TRUE$])
+m4trace:configure.ac:64: -1- m4_pattern_allow([^ENABLE_OPENSSL_FALSE$])
+m4trace:configure.ac:64: -1- _AM_SUBST_NOTMAKE([ENABLE_OPENSSL_TRUE])
+m4trace:configure.ac:64: -1- _AM_SUBST_NOTMAKE([ENABLE_OPENSSL_FALSE])
+m4trace:configure.ac:89: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
 You should run autoupdate.], [])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^LIB@&t at OBJS$])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:69: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
-m4trace:configure.ac:69: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
-m4trace:configure.ac:69: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
-m4trace:configure.ac:69: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
-m4trace:configure.ac:69: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
-m4trace:configure.ac:69: -1- _LT_PROG_LTMAIN
+m4trace:configure.ac:89: -1- m4_pattern_allow([^LIB@&t at OBJS$])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:89: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
+m4trace:configure.ac:89: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
+m4trace:configure.ac:89: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
+m4trace:configure.ac:89: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:89: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:89: -1- _LT_PROG_LTMAIN
diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1
index a8dbf4a..025ec35 100644
--- a/autom4te.cache/traces.1
+++ b/autom4te.cache/traces.1
@@ -1,4 +1,4 @@
-m4trace:configure.ac:3: -1- AC_INIT([mstflint], [4.1.0], [adrianc at mellanox.co.il])
+m4trace:configure.ac:3: -1- AC_INIT([mstflint], [4.4.0], [adrianc at mellanox.co.il])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_])
 m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
@@ -161,7 +161,7 @@ m4trace:configure.ac:9: -1- AC_SUBST([VERSION])
 m4trace:configure.ac:9: -1- AC_SUBST_TRACE([VERSION])
 m4trace:configure.ac:9: -1- m4_pattern_allow([^VERSION$])
 m4trace:configure.ac:11: -1- AC_CONFIG_AUX_DIR([config])
-m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE([mstflint], [4.1.0])
+m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE
 m4trace:configure.ac:13: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
 m4trace:configure.ac:13: -1- AM_AUTOMAKE_VERSION([1.13.4])
 m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([install-sh])
@@ -181,12 +181,10 @@ m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__isrc])
 m4trace:configure.ac:13: -1- AC_SUBST([CYGPATH_W])
 m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CYGPATH_W])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^CYGPATH_W$])
-m4trace:configure.ac:13: -1- _m4_warn([obsolete], [AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.], [aclocal.m4:9023: AM_INIT_AUTOMAKE is expanded from...
-configure.ac:13: the top level])
-m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE], [mstflint])
+m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
 m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$])
-m4trace:configure.ac:13: -1- AC_SUBST([VERSION], [4.1.0])
+m4trace:configure.ac:13: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
 m4trace:configure.ac:13: -1- AC_SUBST_TRACE([VERSION])
 m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$])
 m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
@@ -374,231 +372,255 @@ m4trace:configure.ac:17: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
 m4trace:configure.ac:17: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
 m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
 m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
-m4trace:configure.ac:18: -1- AC_PROG_LIBTOOL
-m4trace:configure.ac:18: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete.
-You should run autoupdate.], [aclocal.m4:129: AC_PROG_LIBTOOL is expanded from...
-configure.ac:18: the top level])
-m4trace:configure.ac:18: -1- LT_INIT
-m4trace:configure.ac:18: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
-m4trace:configure.ac:18: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
-m4trace:configure.ac:18: -1- AC_SUBST([LIBTOOL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LIBTOOL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LIBTOOL$])
-m4trace:configure.ac:18: -1- AC_CANONICAL_HOST
-m4trace:configure.ac:18: -1- AC_CANONICAL_BUILD
-m4trace:configure.ac:18: -1- AC_REQUIRE_AUX_FILE([config.sub])
-m4trace:configure.ac:18: -1- AC_REQUIRE_AUX_FILE([config.guess])
-m4trace:configure.ac:18: -1- AC_SUBST([build], [$ac_cv_build])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([build])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build$])
-m4trace:configure.ac:18: -1- AC_SUBST([build_cpu], [$[1]])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([build_cpu])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_cpu$])
-m4trace:configure.ac:18: -1- AC_SUBST([build_vendor], [$[2]])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([build_vendor])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_vendor$])
-m4trace:configure.ac:18: -1- AC_SUBST([build_os])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([build_os])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^build_os$])
-m4trace:configure.ac:18: -1- AC_SUBST([host], [$ac_cv_host])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([host])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host$])
-m4trace:configure.ac:18: -1- AC_SUBST([host_cpu], [$[1]])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([host_cpu])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_cpu$])
-m4trace:configure.ac:18: -1- AC_SUBST([host_vendor], [$[2]])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([host_vendor])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_vendor$])
-m4trace:configure.ac:18: -1- AC_SUBST([host_os])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([host_os])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^host_os$])
-m4trace:configure.ac:18: -1- AC_SUBST([SED])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([SED])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^SED$])
-m4trace:configure.ac:18: -1- AC_SUBST([GREP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([GREP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.ac:18: -1- AC_SUBST([EGREP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([EGREP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^EGREP$])
-m4trace:configure.ac:18: -1- AC_SUBST([FGREP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([FGREP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^FGREP$])
-m4trace:configure.ac:18: -1- AC_SUBST([GREP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([GREP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.ac:18: -1- AC_SUBST([LD])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LD])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LD$])
-m4trace:configure.ac:18: -1- AC_SUBST([DUMPBIN])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([DUMPBIN])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DUMPBIN$])
-m4trace:configure.ac:18: -1- AC_SUBST([ac_ct_DUMPBIN])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
-m4trace:configure.ac:18: -1- AC_SUBST([DUMPBIN])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([DUMPBIN])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DUMPBIN$])
-m4trace:configure.ac:18: -1- AC_SUBST([NM])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([NM])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^NM$])
-m4trace:configure.ac:18: -1- AC_SUBST([LN_S], [$as_ln_s])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LN_S])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LN_S$])
-m4trace:configure.ac:18: -1- AC_SUBST([OBJDUMP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([OBJDUMP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OBJDUMP$])
-m4trace:configure.ac:18: -1- AC_SUBST([OBJDUMP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([OBJDUMP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OBJDUMP$])
-m4trace:configure.ac:18: -1- AC_SUBST([DLLTOOL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([DLLTOOL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DLLTOOL$])
-m4trace:configure.ac:18: -1- AC_SUBST([DLLTOOL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([DLLTOOL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:18: -1- AM_PROG_AR
+m4trace:configure.ac:18: -1- AC_REQUIRE_AUX_FILE([ar-lib])
 m4trace:configure.ac:18: -1- AC_SUBST([AR])
 m4trace:configure.ac:18: -1- AC_SUBST_TRACE([AR])
 m4trace:configure.ac:18: -1- m4_pattern_allow([^AR$])
 m4trace:configure.ac:18: -1- AC_SUBST([ac_ct_AR])
 m4trace:configure.ac:18: -1- AC_SUBST_TRACE([ac_ct_AR])
 m4trace:configure.ac:18: -1- m4_pattern_allow([^ac_ct_AR$])
-m4trace:configure.ac:18: -1- AC_SUBST([STRIP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([STRIP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.ac:18: -1- AC_SUBST([RANLIB])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.ac:18: -1- m4_pattern_allow([LT_OBJDIR])
-m4trace:configure.ac:18: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LT_OBJDIR$])
-m4trace:configure.ac:18: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
+m4trace:configure.ac:18: -1- AC_SUBST([AR])
+m4trace:configure.ac:18: -1- AC_SUBST_TRACE([AR])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:19: -1- AC_PROG_LIBTOOL
+m4trace:configure.ac:19: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete.
+You should run autoupdate.], [aclocal.m4:129: AC_PROG_LIBTOOL is expanded from...
+configure.ac:19: the top level])
+m4trace:configure.ac:19: -1- LT_INIT
+m4trace:configure.ac:19: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
+m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
+m4trace:configure.ac:19: -1- AC_SUBST([LIBTOOL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LIBTOOL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LIBTOOL$])
+m4trace:configure.ac:19: -1- AC_CANONICAL_HOST
+m4trace:configure.ac:19: -1- AC_CANONICAL_BUILD
+m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([config.sub])
+m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([config.guess])
+m4trace:configure.ac:19: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build$])
+m4trace:configure.ac:19: -1- AC_SUBST([build_cpu], [$[1]])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_cpu])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.ac:19: -1- AC_SUBST([build_vendor], [$[2]])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_vendor])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.ac:19: -1- AC_SUBST([build_os])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_os])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.ac:19: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host$])
+m4trace:configure.ac:19: -1- AC_SUBST([host_cpu], [$[1]])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_cpu])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.ac:19: -1- AC_SUBST([host_vendor], [$[2]])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_vendor])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.ac:19: -1- AC_SUBST([host_os])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_os])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.ac:19: -1- AC_SUBST([SED])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([SED])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^SED$])
+m4trace:configure.ac:19: -1- AC_SUBST([GREP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([GREP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:19: -1- AC_SUBST([EGREP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([EGREP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.ac:19: -1- AC_SUBST([FGREP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([FGREP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^FGREP$])
+m4trace:configure.ac:19: -1- AC_SUBST([GREP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([GREP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:19: -1- AC_SUBST([LD])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LD])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
+m4trace:configure.ac:19: -1- AC_SUBST([DUMPBIN])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DUMPBIN])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
+m4trace:configure.ac:19: -1- AC_SUBST([ac_ct_DUMPBIN])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
+m4trace:configure.ac:19: -1- AC_SUBST([DUMPBIN])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DUMPBIN])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
+m4trace:configure.ac:19: -1- AC_SUBST([NM])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([NM])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^NM$])
+m4trace:configure.ac:19: -1- AC_SUBST([LN_S], [$as_ln_s])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LN_S])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.ac:19: -1- AC_SUBST([OBJDUMP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OBJDUMP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
+m4trace:configure.ac:19: -1- AC_SUBST([OBJDUMP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OBJDUMP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
+m4trace:configure.ac:19: -1- AC_SUBST([DLLTOOL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DLLTOOL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:19: -1- AC_SUBST([DLLTOOL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DLLTOOL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
+m4trace:configure.ac:19: -1- AC_SUBST([AR])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([AR])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^AR$])
+m4trace:configure.ac:19: -1- AC_SUBST([ac_ct_AR])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([ac_ct_AR])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_AR$])
+m4trace:configure.ac:19: -1- AC_SUBST([STRIP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([STRIP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:19: -1- AC_SUBST([RANLIB])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([RANLIB])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([LT_OBJDIR])
+m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LT_OBJDIR$])
+m4trace:configure.ac:19: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
    */
 @%:@undef LT_OBJDIR])
-m4trace:configure.ac:18: -1- LT_SUPPORTED_TAG([CC])
-m4trace:configure.ac:18: -1- AC_SUBST([MANIFEST_TOOL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([MANIFEST_TOOL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^MANIFEST_TOOL$])
-m4trace:configure.ac:18: -1- AC_SUBST([DSYMUTIL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([DSYMUTIL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^DSYMUTIL$])
-m4trace:configure.ac:18: -1- AC_SUBST([NMEDIT])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([NMEDIT])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^NMEDIT$])
-m4trace:configure.ac:18: -1- AC_SUBST([LIPO])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LIPO])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LIPO$])
-m4trace:configure.ac:18: -1- AC_SUBST([OTOOL])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([OTOOL])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OTOOL$])
-m4trace:configure.ac:18: -1- AC_SUBST([OTOOL64])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([OTOOL64])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^OTOOL64$])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
+m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CC])
+m4trace:configure.ac:19: -1- AC_SUBST([MANIFEST_TOOL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([MANIFEST_TOOL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^MANIFEST_TOOL$])
+m4trace:configure.ac:19: -1- AC_SUBST([DSYMUTIL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DSYMUTIL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^DSYMUTIL$])
+m4trace:configure.ac:19: -1- AC_SUBST([NMEDIT])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([NMEDIT])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^NMEDIT$])
+m4trace:configure.ac:19: -1- AC_SUBST([LIPO])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LIPO])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LIPO$])
+m4trace:configure.ac:19: -1- AC_SUBST([OTOOL])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OTOOL])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL$])
+m4trace:configure.ac:19: -1- AC_SUBST([OTOOL64])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OTOOL64])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL64$])
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
 @%:@undef HAVE_DLFCN_H])
-m4trace:configure.ac:18: -1- AC_SUBST([CPP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:18: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:18: -1- AC_SUBST([CPP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.ac:18: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^STDC_HEADERS$])
-m4trace:configure.ac:18: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+m4trace:configure.ac:19: -1- AC_SUBST([CPP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:19: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:19: -1- AC_SUBST([CPP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.ac:19: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
 @%:@undef STDC_HEADERS])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
 @%:@undef HAVE_SYS_TYPES_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
 @%:@undef HAVE_SYS_STAT_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
 @%:@undef HAVE_STDLIB_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
 @%:@undef HAVE_STRING_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
 @%:@undef HAVE_MEMORY_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
 @%:@undef HAVE_STRINGS_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
 @%:@undef HAVE_INTTYPES_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
 @%:@undef HAVE_STDINT_H])
-m4trace:configure.ac:18: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
 @%:@undef HAVE_UNISTD_H])
-m4trace:configure.ac:18: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
-m4trace:configure.ac:18: -1- LT_SUPPORTED_TAG([CXX])
-m4trace:configure.ac:18: -1- AC_SUBST([CXXCPP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.ac:18: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.ac:18: -1- AC_SUBST([CXXCPP])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.ac:18: -1- AC_SUBST([LD])
-m4trace:configure.ac:18: -1- AC_SUBST_TRACE([LD])
-m4trace:configure.ac:18: -1- m4_pattern_allow([^LD$])
-m4trace:configure.ac:19: -1- AC_CONFIG_HEADERS([config.h ])
-m4trace:configure.ac:32: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
+m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
+m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CXX])
+m4trace:configure.ac:19: -1- AC_SUBST([CXXCPP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CXXCPP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:19: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:19: -1- AC_SUBST([CXXCPP])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CXXCPP])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:19: -1- AC_SUBST([LD])
+m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LD])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
+m4trace:configure.ac:20: -1- AC_CONFIG_HEADERS([config.h ])
+m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
 @%:@undef HAVE_LIBZ])
-m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
-m4trace:configure.ac:32: -1- m4_pattern_allow([^HAVE_LIBZ$])
-m4trace:configure.ac:35: -1- AM_CONDITIONAL([ENABLE_DC], [test  "x$enable_dc" = "xyes"])
-m4trace:configure.ac:35: -1- AC_SUBST([ENABLE_DC_TRUE])
-m4trace:configure.ac:35: -1- AC_SUBST_TRACE([ENABLE_DC_TRUE])
-m4trace:configure.ac:35: -1- m4_pattern_allow([^ENABLE_DC_TRUE$])
-m4trace:configure.ac:35: -1- AC_SUBST([ENABLE_DC_FALSE])
-m4trace:configure.ac:35: -1- AC_SUBST_TRACE([ENABLE_DC_FALSE])
-m4trace:configure.ac:35: -1- m4_pattern_allow([^ENABLE_DC_FALSE$])
-m4trace:configure.ac:35: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_TRUE])
-m4trace:configure.ac:35: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_FALSE])
-m4trace:configure.ac:36: -1- AC_SUBST([ENABLE_DC])
-m4trace:configure.ac:36: -1- AC_SUBST_TRACE([ENABLE_DC])
-m4trace:configure.ac:36: -1- m4_pattern_allow([^ENABLE_DC$])
-m4trace:configure.ac:48: -1- AM_CONDITIONAL([ENABLE_INBAND], [test  "x$enable_inband" = "xyes"])
-m4trace:configure.ac:48: -1- AC_SUBST([ENABLE_INBAND_TRUE])
-m4trace:configure.ac:48: -1- AC_SUBST_TRACE([ENABLE_INBAND_TRUE])
-m4trace:configure.ac:48: -1- m4_pattern_allow([^ENABLE_INBAND_TRUE$])
-m4trace:configure.ac:48: -1- AC_SUBST([ENABLE_INBAND_FALSE])
-m4trace:configure.ac:48: -1- AC_SUBST_TRACE([ENABLE_INBAND_FALSE])
-m4trace:configure.ac:48: -1- m4_pattern_allow([^ENABLE_INBAND_FALSE$])
-m4trace:configure.ac:48: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_TRUE])
-m4trace:configure.ac:48: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_FALSE])
-m4trace:configure.ac:67: -1- AC_CONFIG_FILES([mstflint.spec ])
-m4trace:configure.ac:69: -1- AC_CONFIG_FILES([Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile \
-		mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
+m4trace:configure.ac:35: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
+m4trace:configure.ac:35: -1- m4_pattern_allow([^HAVE_LIBZ$])
+m4trace:configure.ac:38: -1- AM_CONDITIONAL([ENABLE_DC], [test  "x$enable_dc" = "xyes"])
+m4trace:configure.ac:38: -1- AC_SUBST([ENABLE_DC_TRUE])
+m4trace:configure.ac:38: -1- AC_SUBST_TRACE([ENABLE_DC_TRUE])
+m4trace:configure.ac:38: -1- m4_pattern_allow([^ENABLE_DC_TRUE$])
+m4trace:configure.ac:38: -1- AC_SUBST([ENABLE_DC_FALSE])
+m4trace:configure.ac:38: -1- AC_SUBST_TRACE([ENABLE_DC_FALSE])
+m4trace:configure.ac:38: -1- m4_pattern_allow([^ENABLE_DC_FALSE$])
+m4trace:configure.ac:38: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_TRUE])
+m4trace:configure.ac:38: -1- _AM_SUBST_NOTMAKE([ENABLE_DC_FALSE])
+m4trace:configure.ac:39: -1- AC_SUBST([ENABLE_DC])
+m4trace:configure.ac:39: -1- AC_SUBST_TRACE([ENABLE_DC])
+m4trace:configure.ac:39: -1- m4_pattern_allow([^ENABLE_DC$])
+m4trace:configure.ac:51: -1- AM_CONDITIONAL([ENABLE_INBAND], [test  "x$enable_inband" = "xyes"])
+m4trace:configure.ac:51: -1- AC_SUBST([ENABLE_INBAND_TRUE])
+m4trace:configure.ac:51: -1- AC_SUBST_TRACE([ENABLE_INBAND_TRUE])
+m4trace:configure.ac:51: -1- m4_pattern_allow([^ENABLE_INBAND_TRUE$])
+m4trace:configure.ac:51: -1- AC_SUBST([ENABLE_INBAND_FALSE])
+m4trace:configure.ac:51: -1- AC_SUBST_TRACE([ENABLE_INBAND_FALSE])
+m4trace:configure.ac:51: -1- m4_pattern_allow([^ENABLE_INBAND_FALSE$])
+m4trace:configure.ac:51: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_TRUE])
+m4trace:configure.ac:51: -1- _AM_SUBST_NOTMAKE([ENABLE_INBAND_FALSE])
+m4trace:configure.ac:63: -1- AC_SUBST([TOOLS_CRYPTO])
+m4trace:configure.ac:63: -1- AC_SUBST_TRACE([TOOLS_CRYPTO])
+m4trace:configure.ac:63: -1- m4_pattern_allow([^TOOLS_CRYPTO$])
+m4trace:configure.ac:64: -1- AM_CONDITIONAL([ENABLE_OPENSSL], [test  "x$enable_cs" = "xyes"])
+m4trace:configure.ac:64: -1- AC_SUBST([ENABLE_OPENSSL_TRUE])
+m4trace:configure.ac:64: -1- AC_SUBST_TRACE([ENABLE_OPENSSL_TRUE])
+m4trace:configure.ac:64: -1- m4_pattern_allow([^ENABLE_OPENSSL_TRUE$])
+m4trace:configure.ac:64: -1- AC_SUBST([ENABLE_OPENSSL_FALSE])
+m4trace:configure.ac:64: -1- AC_SUBST_TRACE([ENABLE_OPENSSL_FALSE])
+m4trace:configure.ac:64: -1- m4_pattern_allow([^ENABLE_OPENSSL_FALSE$])
+m4trace:configure.ac:64: -1- _AM_SUBST_NOTMAKE([ENABLE_OPENSSL_TRUE])
+m4trace:configure.ac:64: -1- _AM_SUBST_NOTMAKE([ENABLE_OPENSSL_FALSE])
+m4trace:configure.ac:83: -1- AC_CONFIG_FILES([mstflint.spec ])
+m4trace:configure.ac:85: -1- AC_CONFIG_FILES([tools_crypto/Makefile])
+m4trace:configure.ac:89: -1- AC_CONFIG_FILES([Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile \
+        cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
  		small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile  mstdump/mstdump_dbs/Makefile ])
-m4trace:configure.ac:69: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
+m4trace:configure.ac:89: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
 You should run autoupdate.], [])
-m4trace:configure.ac:69: -1- AC_SUBST([LIB@&t at OBJS], [$ac_libobjs])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([LIB@&t at OBJS])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^LIB@&t at OBJS$])
-m4trace:configure.ac:69: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:69: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
-m4trace:configure.ac:69: -1- AC_SUBST([am__EXEEXT_TRUE])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
-m4trace:configure.ac:69: -1- AC_SUBST([am__EXEEXT_FALSE])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
-m4trace:configure.ac:69: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
-m4trace:configure.ac:69: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
-m4trace:configure.ac:69: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([INSTALL])
-m4trace:configure.ac:69: -1- AC_SUBST_TRACE([MKDIR_P])
-m4trace:configure.ac:69: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
+m4trace:configure.ac:89: -1- AC_SUBST([LIB@&t at OBJS], [$ac_libobjs])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([LIB@&t at OBJS])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^LIB@&t at OBJS$])
+m4trace:configure.ac:89: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:89: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
+m4trace:configure.ac:89: -1- AC_SUBST([am__EXEEXT_TRUE])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
+m4trace:configure.ac:89: -1- AC_SUBST([am__EXEEXT_FALSE])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
+m4trace:configure.ac:89: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
+m4trace:configure.ac:89: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
+m4trace:configure.ac:89: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([top_build_prefix])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.ac:89: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:89: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
diff --git a/cmdif/Makefile.am b/cmdif/Makefile.am
index 78aba47..c6315d0 100644
--- a/cmdif/Makefile.am
+++ b/cmdif/Makefile.am
@@ -34,11 +34,11 @@
 USER_DIR = $(top_srcdir)
 MTCR_DIR = $(USER_DIR)/include/mtcr_ul
 TOOLS_LAYOUTS_DIR = $(USER_DIR)/tools_layouts
-INCLUDES = -I. -I../common -I../tools_layouts  -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
+AM_CPPFLAGS = -I. -I../common -I../tools_layouts  -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
 
 AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) -DCMDIF_EXPORTS
 CMDIF_VERSION = 1
 noinst_LIBRARIES = libcmdif.a
 
-libcmdif_a_SOURCES = tools_cif.c
+libcmdif_a_SOURCES = tools_cif.c tools_cif.h icmd_cif_common.c icmd_cif_common.h icmd_cif_open.c icmd_cif_open.h
 
diff --git a/cmdif/Makefile.in b/cmdif/Makefile.in
index 048ea79..2df7f26 100644
--- a/cmdif/Makefile.in
+++ b/cmdif/Makefile.in
@@ -130,7 +130,8 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 libcmdif_a_AR = $(AR) $(ARFLAGS)
 libcmdif_a_LIBADD =
-am_libcmdif_a_OBJECTS = tools_cif.$(OBJEXT)
+am_libcmdif_a_OBJECTS = tools_cif.$(OBJEXT) icmd_cif_common.$(OBJEXT) \
+	icmd_cif_open.$(OBJEXT)
 libcmdif_a_OBJECTS = $(am_libcmdif_a_OBJECTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -264,6 +265,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -321,11 +323,11 @@ top_srcdir = @top_srcdir@
 USER_DIR = $(top_srcdir)
 MTCR_DIR = $(USER_DIR)/include/mtcr_ul
 TOOLS_LAYOUTS_DIR = $(USER_DIR)/tools_layouts
-INCLUDES = -I. -I../common -I../tools_layouts  -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
+AM_CPPFLAGS = -I. -I../common -I../tools_layouts  -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
 AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) -DCMDIF_EXPORTS
 CMDIF_VERSION = 1
 noinst_LIBRARIES = libcmdif.a
-libcmdif_a_SOURCES = tools_cif.c
+libcmdif_a_SOURCES = tools_cif.c tools_cif.h icmd_cif_common.c icmd_cif_common.h icmd_cif_open.c icmd_cif_open.h
 all: all-am
 
 .SUFFIXES:
@@ -375,6 +377,8 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/icmd_cif_common.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/icmd_cif_open.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_cif.Po at am__quote@
 
 .c.o:
diff --git a/cmdif/icmd_cif_common.c b/cmdif/icmd_cif_common.c
new file mode 100644
index 0000000..75b2fbc
--- /dev/null
+++ b/cmdif/icmd_cif_common.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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 <mtcr.h>
+#include "icmd_cif_common.h"
+
+/*
+ * get_last_err
+ */
+char* gcif_get_last_err(){
+    return "Deprecated: General Error";
+}
+
+/*
+ * gcif_err_str
+ */
+char* gcif_err_str(int rc) {
+
+    switch(rc) {
+        case GCIF_STATUS_SUCCESS :
+            return "OK";
+        case GCIF_STATUS_INVALID_OPCODE :
+            return "Invalid opcode";
+        case GCIF_STATUS_INVALID_CMD :
+            return "Invalid cmd";
+        case GCIF_STATUS_OPERATIONAL_ERROR :
+            return "Operational error";
+        case GCIF_STATUS_CR_FAIL :
+            return "cr-space access failure";
+        case GCIF_STATUS_BAD_OPCODE :
+            return "unsupported opcode was used";
+        case GCIF_STATUS_SEMAPHORE_TO :
+            return "timed out while trying to take semaphore";
+        case GCIF_STATUS_EXECUTE_TO :
+            return "timed out while waiting for command to execute";
+        case GCIF_STATUS_IFC_BUSY :
+            return "command-interface is busy executing another command";
+        case GCIF_STATUS_BAD_PARAMETERS :
+            return "bad parameter";
+        case GCIF_STATUS_ICMD_NOT_READY:
+            return "command interface not ready";
+        case GCIF_STATUS_BAD_PARAM:
+            return "command interface bad param";
+        case GCIF_STATUS_UNSUPPORTED_ICMD_VERSION:
+            return "Unsupported icmd version";
+        case GCIF_STATUS_UNKNOWN_STATUS:
+            return "Unknown ICMD Status.";
+        case GCIF_STATUS_GENERAL_ERROR :
+            return "General error";
+        case GCIF_SIZE_EXCEEDS_LIMIT:
+            return "Size exceeds limit";
+        case GCIF_ICMD_NOT_SUPPORTED:
+            return "icmd not supported";
+        case GCIF_ICMD_INIT_FAILED:
+            return "icmd initialization failed";
+        case GCIF_ICMD_BUSY:
+            return "icmd busy";
+        default:
+            return "Unknown error";
+    }
+}
+
+/*
+ * convert_rc
+ */
+
+int convert_rc(int rc) {
+    switch (rc) {
+    case ME_ICMD_STATUS_CR_FAIL:
+        return GCIF_STATUS_CR_FAIL;
+    case ME_ICMD_STATUS_SEMAPHORE_TO:
+        return GCIF_STATUS_SEMAPHORE_TO;
+    case ME_ICMD_STATUS_EXECUTE_TO:
+        return GCIF_STATUS_EXECUTE_TO;
+    case ME_ICMD_STATUS_IFC_BUSY:
+        return GCIF_STATUS_IFC_BUSY;
+    case ME_ICMD_STATUS_ICMD_NOT_READY:
+        return GCIF_STATUS_ICMD_NOT_READY;
+    case ME_ICMD_UNSUPPORTED_ICMD_VERSION:
+        return GCIF_STATUS_UNSUPPORTED_ICMD_VERSION;
+    case ME_ICMD_INVALID_OPCODE:
+        return GCIF_STATUS_INVALID_OPCODE;
+    case ME_ICMD_INVALID_CMD:
+        return GCIF_STATUS_INVALID_CMD;
+    case ME_ICMD_OPERATIONAL_ERROR:
+        return GCIF_STATUS_OPERATIONAL_ERROR;
+    case ME_ICMD_BAD_PARAM:
+        return GCIF_STATUS_BAD_PARAM;
+    case ME_ICMD_ICM_NOT_AVAIL:
+        return GCIF_STATUS_ICM_NOT_AVAIL;
+    case ME_ICMD_WRITE_PROTECT:
+        return GCIF_STATUS_WRITE_PROTECT;
+    case ME_ICMD_UNKNOWN_STATUS:
+        return GCIF_STATUS_UNKNOWN_STATUS;
+    case ME_ICMD_SIZE_EXCEEDS_LIMIT:
+        return GCIF_SIZE_EXCEEDS_LIMIT;
+    case ME_ICMD_NOT_SUPPORTED:
+        return GCIF_ICMD_NOT_SUPPORTED;
+    case ME_ICMD_INIT_FAILED:
+        return GCIF_ICMD_INIT_FAILED;
+    case ME_ICMD_BUSY:
+        return GCIF_ICMD_BUSY;
+    default:
+        break;
+    }
+    return GCIF_STATUS_GENERAL_ERROR;
+}
diff --git a/cmdif/icmd_cif_common.h b/cmdif/icmd_cif_common.h
new file mode 100644
index 0000000..bdc03c4
--- /dev/null
+++ b/cmdif/icmd_cif_common.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+#ifndef _ICMD_COMMON_
+#define _ICMD_COMMON_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* --------- Typedefs & Constants ---------------------------------- */
+
+/**
+ * Possible status values returned by the API functions.
+ * In some cases the status indicated in the cr-space may not fit
+ * any of the below enumeration values, in which case the raw status
+ * value will be returned.
+ **/
+enum {
+    GCIF_STATUS_SUCCESS = 0,
+    GCIF_STATUS_INVALID_OPCODE ,
+    GCIF_STATUS_INVALID_CMD,
+    GCIF_STATUS_OPERATIONAL_ERROR,
+    GCIF_STATUS_BAD_PARAM,
+    GCIF_STATUS_CR_FAIL ,       // cr-space access failure
+    GCIF_STATUS_BAD_OPCODE,                 // unsupported opcode was used
+    GCIF_STATUS_SEMAPHORE_TO,               // timed out while trying to take semaphore
+    GCIF_STATUS_EXECUTE_TO,                 // timed out while waiting for command to execute
+    GCIF_STATUS_IFC_BUSY,                   // command-interface is busy executing another command
+    GCIF_STATUS_BAD_PARAMETERS,
+    GCIF_STATUS_GENERAL_ERROR,
+    GCIF_STATUS_ICMD_NOT_READY,
+    GCIF_STATUS_UNSUPPORTED_ICMD_VERSION,
+    GCIF_STATUS_ICM_NOT_AVAIL,
+    GCIF_STATUS_WRITE_PROTECT,
+    GCIF_STATUS_NO_MEM,
+    GCIF_SIZE_EXCEEDS_LIMIT,
+    GCIF_ICMD_NOT_SUPPORTED,
+    GCIF_ICMD_INIT_FAILED,
+    GCIF_ICMD_BUSY,
+    GCIF_STATUS_UNKNOWN_STATUS
+};
+
+enum {
+    GET_FW_INFO             = 0x8007,
+    FLASH_REG_ACCESS        = 0x9001,
+};
+
+
+enum {
+    RW_READ  = 0x1,
+    RW_WRITE = 0x0
+};
+
+/* --------- Functional API ---------------------------------------- */
+
+/**
+  * Returns the last error message recorded by the library
+  **/
+char* gcif_get_last_err();
+
+/**
+  * Returns the error message associated with the provided return code
+  **/
+char* gcif_err_str(int rc);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/cmdif/icmd_cif_macros.h b/cmdif/icmd_cif_macros.h
new file mode 100644
index 0000000..fa7f261
--- /dev/null
+++ b/cmdif/icmd_cif_macros.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+#ifndef _ICMD_MACROS     /* guard */
+#define _ICMD_MACROS
+
+
+int convert_rc(int rc);
+
+#define IN
+#define OUT
+#define INOUT
+
+#ifdef _DEBUG_MODE
+#define DBG_PRINTF(...) fprintf(stderr, __VA_ARGS__)
+#else
+#define DBG_PRINTF(...)
+#endif
+
+/*
+ * SEND_ICMD_FLOW macro is designed for the most common icmd flow
+ * basically every command that simply packs a struct sends icmd and unpacks it should use
+ * this to save code.
+ * TODO: Adrianc- if needed separate struct_name to prefix+name in case we need to separate between different
+ * 5th gen icmd structures i.e connectib/switchib/connectx4 (use ## to paste them together in the macro)
+ */
+#define SEND_ICMD_FLOW_GENERIC(mf, op, struct_name, cmd_struct, should_pack, skip_write, pack_func, unpack_func)\
+    int _rc;\
+    int _cmd_size = struct_name##_size();\
+    u_int8_t _data[_cmd_size];\
+    memset(_data, 0, _cmd_size);\
+    if (should_pack) {\
+        pack_func(cmd_struct, _data);\
+    }\
+    _rc = icmd_send_command(mf, op, _data, _cmd_size, skip_write);\
+    if (_rc) {\
+        return convert_rc(_rc);\
+    }\
+    unpack_func(cmd_struct, _data);\
+    return GCIF_STATUS_SUCCESS
+
+#define SEND_ICMD_FLOW(mf, op, struct_name, cmd_struct, should_pack, skip_write)\
+    SEND_ICMD_FLOW_GENERIC(mf, op, struct_name, cmd_struct, should_pack, skip_write, struct_name##_pack, struct_name##_unpack)
+
+#define SEND_UNION_ICMD_FLOW(mf, op, struct_name, cmd_struct, should_pack, skip_write)\
+    int _rc;\
+    int _cmd_size = struct_name##_size();\
+    u_int8_t _data[_cmd_size];\
+    memset(_data, 0, _cmd_size);\
+    if (should_pack) {\
+        struct_name##_in_pack(&(cmd_struct->in), _data);\
+    }\
+    _rc = icmd_send_command(mf, op, _data, _cmd_size, skip_write);\
+    if (_rc) {\
+        return convert_rc(_rc);\
+    }\
+    struct_name##_unpack(cmd_struct, _data);\
+    return GCIF_STATUS_SUCCESS
+
+
+#endif
diff --git a/mflash/mflash_access_layer.h b/cmdif/icmd_cif_open.c
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to cmdif/icmd_cif_open.c
index 23931fa..84e8bb9
--- a/mflash/mflash_access_layer.h
+++ b/cmdif/icmd_cif_open.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,22 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
-
-#include <compatibility.h>
-//#include "cib_cif.h"
+#include <stdio.h>
+#include <bit_slice.h>
+#include <mtcr.h>
 
-#include "mflash_common_structs.h"
+#include "icmd_cif_common.h"
+#include "icmd_cif_open.h"
+#include "icmd_cif_macros.h"
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
-
-
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+/*
+ * gcif_get_fw_info
+ */
+int gcif_get_fw_info(mfile *mf,
+                     OUT struct connectib_icmd_get_fw_info* fw_info)
+{
+    SEND_ICMD_FLOW(mf, GET_FW_INFO, connectib_icmd_get_fw_info, fw_info, 0, 1);
+}
diff --git a/mflash/mflash_access_layer.h b/cmdif/icmd_cif_open.h
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to cmdif/icmd_cif_open.h
index 23931fa..79d9bfe
--- a/mflash/mflash_access_layer.h
+++ b/cmdif/icmd_cif_open.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,34 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
+#ifndef _ICMD_OPEN_LIB     /* guard */
+#define _ICMD_OPEN_LIB
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <mtcr.h>
+#include <common/compatibility.h>
+#include <tools_layouts/connectib_layouts.h>
+#include "icmd_cif_common.h"
 
-#include <compatibility.h>
-//#include "cib_cif.h"
+#define IN
+#define OUT
+#define INOUT
 
-#include "mflash_common_structs.h"
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+int gcif_get_fw_info(mfile *mf,
+                     OUT struct connectib_icmd_get_fw_info* fw_info);
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
+#undef IN
+#undef OUT
+#undef INOUT
 
+#ifdef __cplusplus
+}
+#endif
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+#endif
diff --git a/cmdparser/Makefile.am b/cmdparser/Makefile.am
index 9696f71..952a074 100644
--- a/cmdparser/Makefile.am
+++ b/cmdparser/Makefile.am
@@ -32,8 +32,6 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
-INCLUDES =
-
 AM_CPPFLAGS = -W  -g -MP -MD -fPIC
 
 noinst_LIBRARIES = libcmdparser.a
diff --git a/cmdparser/Makefile.in b/cmdparser/Makefile.in
index 259648d..17b88eb 100644
--- a/cmdparser/Makefile.in
+++ b/cmdparser/Makefile.in
@@ -283,6 +283,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -337,7 +338,6 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-INCLUDES = 
 AM_CPPFLAGS = -W  -g -MP -MD -fPIC
 noinst_LIBRARIES = libcmdparser.a
 libcmdparser_a_SOURCES = cmdparser.cpp my_getopt.c cmdparser.h my_getopt.h
diff --git a/cmdparser/Makefile.am b/common/Makefile.am
similarity index 90%
copy from cmdparser/Makefile.am
copy to common/Makefile.am
index 9696f71..982c5aa 100644
--- a/cmdparser/Makefile.am
+++ b/common/Makefile.am
@@ -32,11 +32,5 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
-INCLUDES =
-
-AM_CPPFLAGS = -W  -g -MP -MD -fPIC
-
-noinst_LIBRARIES = libcmdparser.a
-
-libcmdparser_a_SOURCES = cmdparser.cpp my_getopt.c cmdparser.h my_getopt.h
+noinst_HEADERS=compatibility.h bit_slice.h tools_utils.h tools_utils.h tools_version.h
 
diff --git a/mstdump/mstdump_dbs/Makefile.in b/common/Makefile.in
similarity index 80%
copy from mstdump/mstdump_dbs/Makefile.in
copy to common/Makefile.in
index 0c5c0b7..aa03634 100644
--- a/mstdump/mstdump_dbs/Makefile.in
+++ b/common/Makefile.in
@@ -14,6 +14,40 @@
 
 @SET_MAKE@
 
+#--
+# Copyright (c) 2004-2010 Mellanox Technologies LTD. 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.
+#--
+
+# Makefile.am -- Process this file with automake to produce Makefile.in
+
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
@@ -78,9 +112,9 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = mstdump/mstdump_dbs
+subdir = common
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_mstregdump_DATA)
+	$(noinst_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -108,36 +142,26 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(mstregdumpdir)"
-DATA = $(dist_mstregdump_DATA)
+HEADERS = $(noinst_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -206,6 +230,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -260,40 +285,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-
-#--
-# Copyright (c) 2004-2010 Mellanox Technologies LTD. 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.
-#--
-mstregdumpdir = $(datadir)/@PACKAGE@
-dist_mstregdump_DATA = $(srcdir)/*.csv
+noinst_HEADERS = compatibility.h bit_slice.h tools_utils.h tools_utils.h tools_version.h
 all: all-am
 
 .SUFFIXES:
@@ -306,9 +298,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mstdump/mstdump_dbs/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign mstdump/mstdump_dbs/Makefile
+	  $(AUTOMAKE) --foreign common/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -333,33 +325,58 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-dist_mstregdumpDATA: $(dist_mstregdump_DATA)
-	@$(NORMAL_INSTALL)
-	@list='$(dist_mstregdump_DATA)'; test -n "$(mstregdumpdir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mstregdumpdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mstregdumpdir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mstregdumpdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(mstregdumpdir)" || exit $$?; \
-	done
 
-uninstall-dist_mstregdumpDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(dist_mstregdump_DATA)'; test -n "$(mstregdumpdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(mstregdumpdir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -393,11 +410,8 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(DATA)
+all-am: Makefile $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(mstregdumpdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
 install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -434,7 +448,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
 	-rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-tags
 
 dvi: dvi-am
 
@@ -448,7 +462,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-dist_mstregdumpDATA
+install-data-am:
 
 install-dvi: install-dvi-am
 
@@ -492,22 +506,22 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-dist_mstregdumpDATA
+uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am \
-	install-dist_mstregdumpDATA install-dvi install-dvi-am \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
 	install-exec install-exec-am install-html install-html-am \
 	install-info install-info-am install-man install-pdf \
 	install-pdf-am install-ps install-ps-am install-strip \
 	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-dist_mstregdumpDATA
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/common/gitversion.h b/common/gitversion.h
index 6842909..6a36fd9 100644
--- a/common/gitversion.h
+++ b/common/gitversion.h
@@ -1 +1 @@
-#define TOOLS_GIT_SHA "b1cdaf7"
+#define TOOLS_GIT_SHA "d1edd58"
diff --git a/config/ar-lib b/config/ar-lib
new file mode 100755
index 0000000..fe2301e
--- /dev/null
+++ b/config/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2013 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda at lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    q*) quick=yes   ;;
+    r*) replace=yes ;;
+    s*) index=yes   ;;
+    S*)             ;; # the index is always updated implicitly
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+  yes,* | ,yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$quick$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/configure b/configure
index 4fc16f2..24acf91 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mstflint 4.1.0.
+# Generated by GNU Autoconf 2.69 for mstflint 4.4.0.
 #
 # Report bugs to <adrianc at mellanox.co.il>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mstflint'
 PACKAGE_TARNAME='mstflint'
-PACKAGE_VERSION='4.1.0'
-PACKAGE_STRING='mstflint 4.1.0'
+PACKAGE_VERSION='4.4.0'
+PACKAGE_STRING='mstflint 4.4.0'
 PACKAGE_BUGREPORT='adrianc at mellanox.co.il'
 PACKAGE_URL=''
 
@@ -636,6 +636,9 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+ENABLE_OPENSSL_FALSE
+ENABLE_OPENSSL_TRUE
+TOOLS_CRYPTO
 ENABLE_INBAND_FALSE
 ENABLE_INBAND_TRUE
 ENABLE_DC
@@ -650,8 +653,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 RANLIB
-ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -672,6 +673,8 @@ build_vendor
 build_cpu
 build
 LIBTOOL
+ac_ct_AR
+AR
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
@@ -775,6 +778,7 @@ with_sysroot
 enable_libtool_lock
 enable_dc
 enable_inband
+enable_cs
 enable_static_libstdcpp
 enable_dynamic_ld
 '
@@ -1331,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mstflint 4.1.0 to adapt to many kinds of systems.
+\`configure' configures mstflint 4.4.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1401,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mstflint 4.1.0:";;
+     short | recursive ) echo "Configuration of mstflint 4.4.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1422,6 +1426,7 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-dc            Disable mstflint "dc" command. Eliminates zlib dependency
   --disable-inband        Disable inabnd access. Prevents FW updtes for Mellanox SwitchX and ConnectIB devices. Eliminates infiniband/mad.h dependency
+  --enable-cs          Enable mstflint "checksum" command, dependant of openssl library
   --enable-static-libstdcpp
                           Enable link static to libstdc++
   --enable-dynamic-ld     Enable dynamic link to ld64.so
@@ -1514,7 +1519,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mstflint configure 4.1.0
+mstflint configure 4.4.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2004,7 +2009,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mstflint $as_me 4.1.0, which was
+It was created by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2362,7 +2367,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define VERSION "4.1.0"
+#define VERSION "4.4.0"
 _ACEOF
 
 
@@ -2882,9 +2887,8 @@ fi
 
 
 # Define the identity of the package.
-
- PACKAGE=mstflint
- VERSION=4.1.0
+ PACKAGE='mstflint'
+ VERSION='4.4.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4301,6 +4305,167 @@ else
 fi
 
 
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar lib "link -lib"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar lib "link -lib"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  am_cv_ar_interface=ar
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+  ;;
+esac
+
 case `pwd` in
   *\ * | *\	*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -5891,7 +6056,6 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
 
 
 
-
 if test -n "$ac_tool_prefix"; then
   for ac_prog in ar
   do
@@ -15096,6 +15260,8 @@ fi
 
 
 
+TOOLS_CRYPTO=""
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-dc argument" >&5
 $as_echo_n "checking --enable-dc argument... " >&6; }
 # Check whether --enable-dc was given.
@@ -15206,6 +15372,38 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cs argument" >&5
+$as_echo_n "checking --enable-cs argument... " >&6; }
+# Check whether --enable-cs was given.
+if test "${enable_cs+set}" = set; then :
+  enableval=$enable_cs; enable_cs="yes"
+else
+  enable_cs="no"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cs" >&5
+$as_echo "$enable_cs" >&6; }
+if test "x$enable_cs" = "xyes"; then
+  ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
+
+else
+  as_fn_error $? "cannot find openssl/md5.h . remove --enable-openssl to remove this dependaency or install openssl" "$LINENO" 5
+fi
+
+
+  TOOLS_CRYPTO="tools_crypto"
+fi
+
+ if test  "x$enable_cs" = "xyes"; then
+  ENABLE_OPENSSL_TRUE=
+  ENABLE_OPENSSL_FALSE='#'
+else
+  ENABLE_OPENSSL_TRUE='#'
+  ENABLE_OPENSSL_FALSE=
+fi
+
+
 # Check whether --enable-static_libstdcpp was given.
 if test "${enable_static_libstdcpp+set}" = set; then :
   enableval=$enable_static_libstdcpp;
@@ -15236,7 +15434,14 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
 ac_config_files="$ac_config_files mstflint.spec"
 
 
-ac_config_files="$ac_config_files Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
+if test "x$enable_cs" = "xyes"; then :
+
+        ac_config_files="$ac_config_files tools_crypto/Makefile"
+
+
+fi
+
+ac_config_files="$ac_config_files Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -15383,6 +15588,10 @@ if test -z "${ENABLE_INBAND_TRUE}" && test -z "${ENABLE_INBAND_FALSE}"; then
   as_fn_error $? "conditional \"ENABLE_INBAND\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_OPENSSL_TRUE}" && test -z "${ENABLE_OPENSSL_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_OPENSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -15780,7 +15989,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mstflint $as_me 4.1.0, which was
+This file was extended by mstflint $as_me 4.4.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15846,7 +16055,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mstflint config.status 4.1.0
+mstflint config.status 4.4.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16354,7 +16563,9 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "mstflint.spec") CONFIG_FILES="$CONFIG_FILES mstflint.spec" ;;
+    "tools_crypto/Makefile") CONFIG_FILES="$CONFIG_FILES tools_crypto/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
     "mft_utils/Makefile") CONFIG_FILES="$CONFIG_FILES mft_utils/Makefile" ;;
     "mtcr_ul/Makefile") CONFIG_FILES="$CONFIG_FILES mtcr_ul/Makefile" ;;
     "dev_mgt/Makefile") CONFIG_FILES="$CONFIG_FILES dev_mgt/Makefile" ;;
@@ -17896,4 +18107,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
diff --git a/configure.ac b/configure.ac
index be0f9d1..8ef242c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,26 +1,29 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(mstflint, 4.1.0, adrianc at mellanox.co.il)
+AC_INIT(mstflint, 4.4.0, adrianc at mellanox.co.il)
 
 AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.])
 AC_SUBST([PROJECT])
 
-AC_DEFINE_UNQUOTED([VERSION], ["4.1.0"], [Define the project version.])
+AC_DEFINE_UNQUOTED([VERSION], ["4.4.0"], [Define the project version.])
 AC_SUBST([VERSION])
 
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_SRCDIR([README])
-AM_INIT_AUTOMAKE(mstflint, 4.1.0)
+AM_INIT_AUTOMAKE
 
 dnl Checks for programs
 AC_PROG_CC
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_CONFIG_HEADERS( config.h )
 
 dnl Checks for headers
 AC_CHECK_HEADER(termios.h,[CXXFLAGS="${CXXFLAGS} -DHAVE_TERMIOS_H"])
 
+TOOLS_CRYPTO=""
+
 AC_MSG_CHECKING(--enable-dc argument)
 AC_ARG_ENABLE(dc,
 		    [  --disable-dc            Disable mstflint "dc" command. Eliminates zlib dependency],
@@ -47,6 +50,19 @@ fi
 
 AM_CONDITIONAL(ENABLE_INBAND, [test  "x$enable_inband" = "xyes"])
 
+AC_MSG_CHECKING(--enable-cs argument)
+AC_ARG_ENABLE(cs,
+            [  --enable-cs          Enable mstflint "checksum" command, dependant of openssl library],
+            [enable_cs="yes"],
+            [enable_cs="no"])
+AC_MSG_RESULT($enable_cs)
+if test "x$enable_cs" = "xyes"; then
+  AC_CHECK_HEADER(openssl/md5.h,,AC_MSG_ERROR([cannot find openssl/md5.h . remove --enable-openssl to remove this dependaency or install openssl]))
+  TOOLS_CRYPTO="tools_crypto"
+fi
+AC_SUBST(TOOLS_CRYPTO)
+AM_CONDITIONAL(ENABLE_OPENSSL, [test  "x$enable_cs" = "xyes"])
+
 AC_ARG_ENABLE([static_libstdcpp],
     AS_HELP_STRING([--enable-static-libstdcpp], [Enable link static to libstdc++]))
 
@@ -66,7 +82,10 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
 
 AC_CONFIG_FILES( mstflint.spec )
 
-AC_OUTPUT( Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile cmdif/Makefile tools_res_mgmt/Makefile \
-		mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
- 		small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile  mstdump/mstdump_dbs/Makefile )
+AS_IF([test "x$enable_cs" = "xyes"], [
+        AC_CONFIG_FILES(tools_crypto/Makefile)
+    ])
 
+AC_OUTPUT( Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile \
+        cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
+ 		small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile  mstdump/mstdump_dbs/Makefile )
diff --git a/dev_mgt/Makefile.am b/dev_mgt/Makefile.am
index 703a27a..147f7aa 100644
--- a/dev_mgt/Makefile.am
+++ b/dev_mgt/Makefile.am
@@ -32,7 +32,7 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
-INCLUDES = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/common  -I$(top_srcdir)/include/mtcr_ul
+AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/common  -I$(top_srcdir)/include/mtcr_ul
 
 AM_CFLAGS = -W -Wall -g -MP -MD -Wswitch-enum $(COMPILER_FPIC) -DMTCR_EXPORT
 noinst_LIBRARIES = libdev_mgt.a
diff --git a/dev_mgt/Makefile.in b/dev_mgt/Makefile.in
index 581af61..20c7b7c 100644
--- a/dev_mgt/Makefile.in
+++ b/dev_mgt/Makefile.in
@@ -265,6 +265,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -319,7 +320,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-INCLUDES = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/common  -I$(top_srcdir)/include/mtcr_ul
+AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/common  -I$(top_srcdir)/include/mtcr_ul
 AM_CFLAGS = -W -Wall -g -MP -MD -Wswitch-enum $(COMPILER_FPIC) -DMTCR_EXPORT
 noinst_LIBRARIES = libdev_mgt.a
 libdev_mgt_a_SOURCES = \
diff --git a/dev_mgt/tools_dev_types.c b/dev_mgt/tools_dev_types.c
index eac00af..eca37f9 100644
--- a/dev_mgt/tools_dev_types.c
+++ b/dev_mgt/tools_dev_types.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,11 +28,9 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -40,9 +39,12 @@
 #include "tools_dev_types.h"
 
 enum dm_dev_type {
+    DM_UNKNOWN = -1,
     DM_HCA,
     DM_SWITCH,
-    DM_BRIDGE
+    DM_BRIDGE,
+    DM_QSFP_CABLE,
+    DM_SFP_CABLE,
 };
 
 struct dev_info {
@@ -55,75 +57,47 @@ struct dev_info {
     enum dm_dev_type dev_type;
 };
 
-#define DEVID_ADDR_INFINISCALE_III          0x60014
 #define DEVID_ADDR                          0xf0014
-#define DM_INFINIHOST_III_EX_DEV_VER_ADDR   0x82600
+#define CABLEID_ADDR                        0x0
+#define SFP_51_ADDR                         92
+#define SFP_51_PAGING_ADDR                  64
+
+#ifdef CABLES_SUPP
+enum dm_dev_type getCableType(u_int8_t id) {
+    switch (id) {
+        case 0xd:
+        case 0x11:
+        case 0xe:
+        case 0xc:
+            return DM_QSFP_CABLE;
+        case 0x3:
+            return DM_SFP_CABLE;
+        default:
+            return DM_UNKNOWN;
+    }
+}
+#endif
 
 static struct dev_info g_devs_info[] = {
     {
-        .dm_id     = DeviceInfiniScale,
-        .hw_dev_id = 43132,
+        .dm_id     = DeviceInfiniScaleIV,
+        .hw_dev_id = 0x01b3,
         .hw_rev_id = -1,
         .sw_dev_id = -1,
-        .name      = "InfiniScale",
-        .port_num  = 8,
+        .name      = "InfiniScaleIV",
+        .port_num  = 36,
         .dev_type  = DM_SWITCH
     },
     {
-        .dm_id     = DeviceInfiniHost,
-        .hw_dev_id = 0x5a44,
-        .hw_rev_id = -1,
-        .sw_dev_id = -1,
-        .name      = "InfiniHost",
-        .port_num  = 2,
-        .dev_type  = DM_HCA
-    },
-    {
-        .dm_id     = DeviceInfiniHostIIIEx,
-        .hw_dev_id = 0x6278,
-        .hw_rev_id = -1,
-        .sw_dev_id = 0x6278,
-        .name      = "InfiniHostIIIEx",
-        .port_num  = 2,
-        .dev_type  = DM_HCA
-    },
-    {
-        .dm_id     = DeviceInfiniHostIIIEx_MF,
-        .hw_dev_id = 0x6278,
-        .hw_rev_id = -1,
-        .sw_dev_id = 0x6282,
-        .name      = "InfiniHostIIIEx_MF",
-        .port_num  = 2,
-        .dev_type  = DM_HCA
-    },
-    {
-        .dm_id     = DeviceInfiniScaleIII,
-        .hw_dev_id = 0xb924,
+        .dm_id     = DeviceSwitchX,
+        .hw_dev_id = 0x0245,
         .hw_rev_id = -1,
         .sw_dev_id = -1,
-        .name      = "InfiniScaleIII",
-        .port_num  = 24,
+        .name      = "SwitchX",
+        .port_num  = 64,
         .dev_type  = DM_SWITCH
     },
     {
-        .dm_id     = DeviceInfiniHostIIILx,
-        .hw_dev_id = 0x6274,
-        .hw_rev_id = -1,
-        .sw_dev_id = -1,
-        .name      = "InfiniHostIIILx",
-        .port_num  = 1,
-        .dev_type  = DM_HCA
-    },
-    {
-        .dm_id     = DeviceConnectX,
-        .hw_dev_id = 0x190,
-        .hw_rev_id = 0xa0,
-        .sw_dev_id = -1,
-        .name      = "ConnectX",
-        .port_num  = 2,
-        .dev_type  = DM_HCA
-    },
-    {
         .dm_id     = DeviceConnectX2,
         .hw_dev_id = 0x190,
         .hw_rev_id = 0xb0,
@@ -132,33 +106,7 @@ static struct dev_info g_devs_info[] = {
         .port_num  = 2,
         .dev_type  = DM_HCA
     },
-    {
-        .dm_id     = DeviceInfiniScaleIV,
-        .hw_dev_id = 0x01b3,
-        .hw_rev_id = -1,
-        .sw_dev_id = -1,
-        .name      = "InfiniScaleIV",
-        .port_num  = 36,
-        .dev_type  = DM_SWITCH
-    },
-    {
-        .dm_id     = DeviceBridgeX,
-        .hw_dev_id = 0x17d4,
-        .hw_rev_id = -1,
-        .sw_dev_id = -1,
-        .name      = "BridgeX",
-        .port_num  = 0, /* TODO */
-        .dev_type  = DM_BRIDGE
-    },
-    {
-        .dm_id     = DeviceSwitchX,
-        .hw_dev_id = 0x0245,
-        .hw_rev_id = -1,
-        .sw_dev_id = -1,
-        .name      = "SwitchX",
-        .port_num  = 64,
-        .dev_type  = DM_SWITCH
-    },
+
     {
         .dm_id     = DeviceConnectX3,
         .hw_dev_id = 0x1f5,
@@ -223,6 +171,15 @@ static struct dev_info g_devs_info[] = {
         .dev_type  = DM_HCA
     },
     {
+        .dm_id     = DeviceConnectX5,
+        .hw_dev_id = 0x20d,
+        .hw_rev_id = -1,
+        .sw_dev_id = -1,
+        .name      = "ConnectX5",
+        .port_num  = 2,
+        .dev_type  = DM_HCA
+    },
+    {
         .dm_id     = DeviceFPGA,
         .hw_dev_id = 0x600,
         .hw_rev_id = -1,
@@ -232,10 +189,123 @@ static struct dev_info g_devs_info[] = {
         .dev_type  = DM_HCA
     },
     {
-        .dm_id     = DeviceEndMarker,
+        .dm_id     = DeviceFPGANewton,
+        .hw_dev_id = 0xfff, // Dummy device ID till we have official one
+        .hw_rev_id = -1,
+        .sw_dev_id = -1,
+        .name      = "FPGA_NEWTON",
+        .port_num  = 2,
+        .dev_type  = DM_HCA
+    },
+    {
+        .dm_id     = DeviceSwitchIB2,
+        .hw_dev_id = 0x24b,
+        .hw_rev_id = -1,
+        .sw_dev_id = -1,
+        .name      = "SwitchIB2",
+        .port_num  = 36,
+        .dev_type  = DM_SWITCH
+    },
+    {
+        .dm_id     = DeviceCable,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = -1,
+        .sw_dev_id = -1,
+        .name      = "Cable",
+        .port_num  = -1,
+        .dev_type  = DM_QSFP_CABLE
+    },
+    {
+        .dm_id     = DeviceCableQSFP,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = 0,
+        .sw_dev_id = -1,
+        .name      = "CableQSFP",
+        .port_num  = -1,
+        .dev_type  = DM_QSFP_CABLE
+    },
+    {
+        .dm_id     = DeviceCableQSFPaging,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = 1,
+        .sw_dev_id = -1,
+        .name      = "CableQSFPaging",
+        .port_num  = -1,
+        .dev_type  = DM_QSFP_CABLE
+    },
+    {
+        .dm_id     = DeviceCableSFP,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = 1,
+        .sw_dev_id = -1,
+        .name      = "CableSFP",
+        .port_num  = -1,
+        .dev_type  = DM_SFP_CABLE
+    },
+    {
+        .dm_id     = DeviceCableSFP51,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = 1,
+        .sw_dev_id = -1,
+        .name      = "CableSFP51",
+        .port_num  = -1,
+        .dev_type  = DM_SFP_CABLE
+    },
+    {
+        .dm_id     = DeviceCableSFP51Paging,
+        .hw_dev_id = 0xffff,
+        .hw_rev_id = 1,
+        .sw_dev_id = -1,
+        .name      = "CableSFP51Paging",
+        .port_num  = -1,
+        .dev_type  = DM_SFP_CABLE
+    },
+    {
+        .dm_id     = DeviceDummy,
+        .hw_dev_id = 0x1,
+        .hw_rev_id = -1,
+        .sw_dev_id = -1,
+        .name      = "DummyDevice",
+        .port_num  = 2,
+        .dev_type  = DM_HCA
+    },
+    {
+        .dm_id     = DeviceUnknown,
+        .hw_dev_id = 0,
+        .hw_rev_id = 0,
+        .sw_dev_id = 0,
+        .name      = "Unknown Device",
+        .port_num  = -1,
+        .dev_type  = DM_UNKNOWN
     }
 };
 
+static const struct dev_info* get_entry(dm_dev_id_t type)
+{
+    const struct dev_info* p = g_devs_info;
+    while (p->dm_id != DeviceUnknown) {
+        if (type == p->dm_id) {
+            break;
+        }
+        p++;
+    }
+    return p;
+}
+
+static const struct dev_info* get_entry_by_dev_rev_id(u_int32_t hw_dev_id, u_int32_t hw_rev_id)
+{
+    const struct dev_info* p = g_devs_info;
+    while (p->dm_id != DeviceUnknown) {
+        if (hw_dev_id == p->hw_dev_id) {
+            if ((p->hw_rev_id == -1) ||  ((int)hw_rev_id == p->hw_rev_id)) {
+                break;
+            }
+        }
+        p++;
+    }
+    return p;
+}
+
 /**
  * Returns 0 on success and 1 on failure.
  */
@@ -245,7 +315,6 @@ int dm_get_device_id(mfile* mf,
                     u_int32_t*   ptr_hw_rev)
 {
     u_int32_t dword;
-    u_int32_t i;
     int rc;
     u_int32_t dev_flags;
 
@@ -256,17 +325,60 @@ int dm_get_device_id(mfile* mf,
         *ptr_hw_dev_id = 0x600;
         return 0;
     }
+    if (mf->tp == MST_FPGA_NEWTON) {
+       *ptr_dm_dev_id = DeviceFPGANewton;
+       *ptr_hw_dev_id = 0xfff;
+       return 0;
+    }
 #endif
-
-    #if 1
-    for (i = 0; i < DeviceEndMarker; i++) {
-        if (g_devs_info[i].dm_id != i) {
-            printf("-F- in get_device_type: Wrong index of the g_devs_info array. idx %d dev %s\n",
-                   i, g_devs_info[i].name);
-            exit(1);
+#ifdef CABLES_SUPP
+    if (mf->tp == MST_CABLE) {
+        //printf("-D- Getting cable ID\n");
+        if (mread4(mf, CABLEID_ADDR, &dword) != 4)
+        {
+            //printf("FATAL - crspace read (0x%x) failed: %s\n", DEVID_ADDR, strerror(errno));
+            return 1;
+        }
+        dword = __cpu_to_le32(dword); // Cable pages are in LE
+        *ptr_hw_dev_id = 0xffff;
+        u_int8_t id = EXTRACT(dword, 0, 8);
+        enum dm_dev_type cbl_type = getCableType(id);
+        if (cbl_type == DM_QSFP_CABLE) {
+            // Get Byte 2 bit 2 ~ bit 18
+            u_int8_t paging = EXTRACT(dword, 18, 1);
+            //printf("DWORD: %#x, paging: %d\n", dword, paging);
+            if (paging == 0) {
+                *ptr_dm_dev_id = DeviceCableQSFPaging;
+            } else {
+                *ptr_dm_dev_id = DeviceCableQSFP;
+            }
+        } else if (cbl_type == DM_SFP_CABLE) {
+            *ptr_dm_dev_id = DeviceCableSFP;
+            if (mread4(mf, SFP_51_ADDR, &dword) != 4)
+            {
+               //printf("FATAL - crspace read (0x%x) failed: %s\n", DEVID_ADDR, strerror(errno));
+               return 1;
+            }
+            u_int8_t byte = EXTRACT(dword, 6, 1); //Byte 92 bit 6
+            if (byte) {
+                *ptr_dm_dev_id = DeviceCableSFP51;
+                if (mread4(mf, SFP_51_PAGING_ADDR, &dword) != 4)
+                {
+                   //printf("FATAL - crspace read (0x%x) failed: %s\n", DEVID_ADDR, strerror(errno));
+                   return 1;
+                }
+                byte = EXTRACT(dword, 4, 1); //Byte 64 bit 4
+                if (byte) {
+                    *ptr_dm_dev_id = DeviceCableSFP51Paging;
+                }
+            }
+        } else {
+            *ptr_dm_dev_id = DeviceUnknown;
         }
+        return 0;
     }
-    #endif
+#endif
+
 
     rc = mget_mdevs_flags(mf, &dev_flags);
     if (rc) {
@@ -281,14 +393,14 @@ int dm_get_device_id(mfile* mf,
         rc = reg_access_mgir(mf, REG_ACCESS_METHOD_GET, &mgir);
         //printf("-D- RC[%s] -- REVID: %d -- DEVID: %d hw_dev_id: %d\n", m_err2str(rc), mgir.HWInfo.REVID, mgir.HWInfo.DEVID, mgir.HWInfo.hw_dev_id);
         if (rc) {
-            dword = g_devs_info[DeviceSwitchX].hw_dev_id;
+            dword = get_entry(DeviceSwitchX)->hw_dev_id;
             *ptr_hw_rev    = 0;
-            *ptr_hw_dev_id = g_devs_info[DeviceSwitchX].hw_dev_id;
+            *ptr_hw_dev_id = get_entry(DeviceSwitchX)->hw_dev_id;
         } else {
             dword = mgir.HWInfo.hw_dev_id;
             if (dword == 0) {
-                dword = g_devs_info[DeviceSwitchX].hw_dev_id;
-                *ptr_hw_dev_id = g_devs_info[DeviceSwitchX].hw_dev_id;
+                dword = get_entry(DeviceSwitchX)->hw_dev_id;
+                *ptr_hw_dev_id = get_entry(DeviceSwitchX)->hw_dev_id;
                 *ptr_hw_rev = mgir.HWInfo.REVID & 0xf;
             } else {
                 *ptr_hw_dev_id = dword;
@@ -306,54 +418,14 @@ int dm_get_device_id(mfile* mf,
         *ptr_hw_rev    = EXTRACT(dword, 16, 8);
     }
 
-    for (i = 0; i < DeviceEndMarker; i++) {
-        struct dev_info* di = &(g_devs_info[i]);
-        if (*ptr_hw_dev_id == di->hw_dev_id) {
-            if (di->hw_rev_id == -1 || (int)(*ptr_hw_rev) == di->hw_rev_id) {
-                *ptr_dm_dev_id = i;
-                break;
-            }
-        }
-    }
-
-    if (i == DeviceEndMarker) {
-        /* Special cases - InfiniHost_III_LX HW id and InfiniScale_III devid address. */
-        if (*ptr_hw_dev_id == 24204) {
-            /* Some old InfiniHost_III_LXs have hw dev is of 24204 */
-            *ptr_dm_dev_id = DeviceInfiniHostIIILx;
-        } else {
-            /* Try InfiniScale_III devid address */
-            if (mread4(mf, DEVID_ADDR_INFINISCALE_III, &dword) != 4)
-                return 1;
-            if ((int)EXTRACT(dword, 0, 16) == g_devs_info[DeviceInfiniScaleIII].hw_dev_id) {
-                *ptr_dm_dev_id = DeviceInfiniScaleIII;
-                *ptr_hw_dev_id = EXTRACT(dword, 0, 16);
-                *ptr_hw_rev    = EXTRACT(dword, 16, 8);
-            } else {
-                /* Dev id not matched in array */
-                //printf("FATAL - Can't find devid id\n");
-                return 1; // TODO - fix return vals.
-            }
-        }
-    }
+    *ptr_dm_dev_id = get_entry_by_dev_rev_id(*ptr_hw_dev_id, *ptr_hw_rev)->dm_id;
 
-    /* Special cases: For InfiniHost_III_EX we need to check the SW id as well */
-    if (*ptr_hw_dev_id == g_devs_info[DeviceInfiniHostIIIEx].hw_dev_id) {
-        if (mread4(mf, DM_INFINIHOST_III_EX_DEV_VER_ADDR, &dword) != 4)
-        {
-            //printf("FATAL - Can't read InfiniHost_III_EX dev_ver addr\n");
-            return 1;
-        }
+    if (*ptr_dm_dev_id == DeviceUnknown) {
 
-        if (EXTRACT(dword, 16, 16) == 25218 ||
-            EXTRACT(dword, 16, 16) == 25228 ||
-            EXTRACT(dword, 16, 16) == 25238) {
-            *ptr_dm_dev_id = DeviceInfiniHostIIIEx_MF;
-        } else {
-            *ptr_dm_dev_id = DeviceInfiniHostIIIEx;
-        }
+        /* Dev id not matched in array */
+        //printf("FATAL - Can't find devid id\n");
+        return 1; // TODO - fix return vals.
     }
-
     return 0;
 }
 
@@ -361,91 +433,107 @@ int dm_get_device_id_offline(u_int32_t devid,
                              u_int32_t chip_rev,
                              dm_dev_id_t* ptr_dev_type)
 {
-	dm_dev_id_t i;
-
-    for (i = 0; i < DeviceEndMarker; i++) {
-        struct dev_info* di = &(g_devs_info[i]);
-        if (devid == di->hw_dev_id) {
-            if (di->hw_rev_id == -1 || (int)(chip_rev) == di->hw_rev_id) {
-                *ptr_dev_type = i;
-                break;
-            }
-        }
-    }
-
-    return i == DeviceEndMarker;
+    *ptr_dev_type = get_entry_by_dev_rev_id(devid, chip_rev)->dm_id;
+    return *ptr_dev_type == DeviceUnknown;
 }
 
 const char* dm_dev_type2str(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].name;
-    } else {
-        return "Unknown Device";
+    return get_entry(type)->name;
+}
+
+dm_dev_id_t dm_dev_str2type(const char* str)
+{
+    const struct dev_info* p = g_devs_info;
+    if (!str) {
+        return DeviceUnknown;
     }
+    while (p->dm_id != DeviceUnknown) {
+        if (strcmp(str,p->name) == 0) {
+            return p->dm_id;
+        }
+        p++;
+    }
+    return DeviceUnknown;
 }
 
 int dm_get_hw_ports_num(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].port_num;
-    } else {
-        return -1;
-    }
+    return get_entry(type)->port_num;
 }
 
 int dm_dev_is_hca(dm_dev_id_t type) {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].dev_type == DM_HCA;
-    } else {
-        return 0;
-    }
+    return get_entry(type)->dev_type == DM_HCA;
 }
 
 int dm_dev_is_switch(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].dev_type == DM_SWITCH;
-    } else {
-        return 0;
-    }
+    return get_entry(type)->dev_type == DM_SWITCH;
 }
 
 int dm_dev_is_bridge(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].dev_type == DM_BRIDGE;
-    } else {
-        return 0;
-    }
+    return get_entry(type)->dev_type == DM_BRIDGE;
+}
+
+int dm_dev_is_cable(dm_dev_id_t type)
+{
+    return (get_entry(type)->dev_type == DM_QSFP_CABLE || get_entry(type)->dev_type == DM_SFP_CABLE);
 }
 
 u_int32_t dm_get_hw_dev_id(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].hw_dev_id;
-    } else {
-        return 0;
-    }
+    return get_entry(type)->hw_dev_id;
 }
 
 u_int32_t dm_get_hw_rev_id(dm_dev_id_t type)
 {
-    if (type < DeviceEndMarker) {
-        return g_devs_info[type].hw_rev_id;
-    } else {
-        return 0;
-    }
+    return get_entry(type)->hw_rev_id;
 }
 
 int dm_is_fpp_supported(dm_dev_id_t type)
 {
-    if (g_devs_info[type].dm_id == DeviceConnectIB ||
-        g_devs_info[type].dm_id == DeviceConnectX4 ||
-        g_devs_info[type].dm_id == DeviceConnectX4LX) {
+    const struct dev_info* dp = get_entry(type);
+    if (
+        dp->dm_id == DeviceConnectIB ||
+        dp->dm_id == DeviceConnectX4 ||
+        dp->dm_id == DeviceConnectX4LX ||
+        dp->dm_id == DeviceConnectX5) {
         return 1;
     } else {
         return 0;
     }
 }
 
+int dm_is_device_supported(dm_dev_id_t type)
+{
+    return get_entry(type)->dm_id != DeviceUnknown;
+}
+
+int dm_is_livefish_mode(mfile* mf)
+{
+    if(!mf || !mf->dinfo) {
+        return 0;
+    }
+    dm_dev_id_t devid_t;
+    u_int32_t devid = 0;
+    u_int32_t revid = 0;
+    int rc = dm_get_device_id(mf, &devid_t, &devid, &revid);
+    if (rc) {
+        // Could not detrmine , by default is not livefish
+        return 0;
+    }
+    u_int32_t swid = mf->dinfo->pci.dev_id;
+    //printf("-D- swid: %#x, devid: %#x\n", swid, devid);
+    if (devid_t == DeviceConnectX2    ||
+        devid_t == DeviceConnectX3    ||
+        devid_t == DeviceConnectX3Pro ||
+        devid_t == DeviceSwitchX        ) {
+        return (devid == swid - 1);
+    } else {
+        return (devid == swid);
+    }
+
+    return 0;
+}
+
diff --git a/dev_mgt/tools_dev_types.h b/dev_mgt/tools_dev_types.h
index e3be9ee..432dc4e 100644
--- a/dev_mgt/tools_dev_types.h
+++ b/dev_mgt/tools_dev_types.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,11 +28,9 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
+
 #ifndef TOOLS_DEV_TYPE_H
 #define TOOLS_DEV_TYPE_H
 
@@ -45,19 +44,21 @@ extern "C" {
 
 enum dm_dev_id
 {
+    DeviceUnknown = -1,       //Dummy Device - Marker for indicating error.
     DeviceStartMarker = 0,    // Dummy Device - Marker for first device
                               // to let user iterate from DeviceStartMarker to DeviceEndMarker
-
-    DeviceInfiniScale = 0,
-    DeviceInfiniHost,
-    DeviceInfiniHostIIIEx,
-    DeviceInfiniHostIIIEx_MF,
-    DeviceInfiniScaleIII,
-    DeviceInfiniHostIIILx,
-    DeviceConnectX,
-    DeviceConnectX2,
+                              // Note: Call dm_is_device_supported() to see if a device is supported by the lib.
+
+    DeviceInfiniScale = 0,  // UnSupported
+    DeviceInfiniHost,       // UnSupported
+    DeviceInfiniHostIIIEx,  // UnSupported
+    DeviceInfiniHostIIIEx_MF,// UnSupported
+    DeviceInfiniScaleIII,   // UnSupported
+    DeviceInfiniHostIIILx,  // UnSupported
+    DeviceConnectX,         // UnSupported
+    DeviceConnectX2,       
     DeviceInfiniScaleIV,
-    DeviceBridgeX,
+    DeviceBridgeX,          // UnSupported
     DeviceSwitchX,
     DeviceConnectX3,
     DeviceConnectIB,
@@ -66,9 +67,19 @@ enum dm_dev_id
     DeviceSpectrum,
     DeviceConnectX4,
     DeviceConnectX4LX,
+    DeviceConnectX5,
     DeviceFPGA,
-
-    DeviceEndMarker           // Dummy Device - Marker for indicating error and end of devices
+    DeviceSwitchIB2,
+    DeviceFPGANewton,
+    DeviceCable,
+    DeviceCableQSFP,
+    DeviceCableQSFPaging,
+    DeviceCableSFP,
+    DeviceCableSFP51,
+    DeviceCableSFP51Paging,
+    DeviceDummy,
+
+    DeviceEndMarker           // Dummy Device - Marker for indicating end of devices when iterating
 };
 
 typedef enum dm_dev_id dm_dev_id_t;
@@ -88,12 +99,24 @@ int dm_get_device_id_offline(u_int32_t devid,
                              u_int32_t chip_rev,
                              dm_dev_id_t* ptr_dev_type);
 
+
+/**
+ * Returns 1 if device is supported and 0 otherwise (library dependant)
+ */
+int dm_is_device_supported(dm_dev_id_t type);
+
+
 /**
  * Returns the device name as a "const char*"
  */
 const char* dm_dev_type2str(dm_dev_id_t type);
 
 /**
+ * Returns the device id
+ */
+dm_dev_id_t dm_dev_str2type(const char* str);
+
+/**
  * A predicate returning if the device is an hca
  */
 int dm_dev_is_hca(dm_dev_id_t type);
@@ -109,6 +132,11 @@ int dm_dev_is_switch(dm_dev_id_t type);
 int dm_dev_is_bridge(dm_dev_id_t type);
 
 /**
+ * A predicate returning if the device is a Cable
+ */
+int dm_dev_is_cable(dm_dev_id_t type);
+
+/**
  * Returns the max num of ports or -1 on error
  */
 int dm_get_hw_ports_num(dm_dev_id_t type);
@@ -129,6 +157,11 @@ u_int32_t dm_get_hw_rev_id(dm_dev_id_t type);
  */
 int dm_is_fpp_supported(dm_dev_id_t type);
 
+/*
+ * A predicate returning if the device is in LiveFish mode
+ */
+int dm_is_livefish_mode(mfile* mf);
+
 #ifdef __cplusplus
 }       /* end of 'extern "C"' */
 #endif
diff --git a/flint/Makefile.am b/flint/Makefile.am
index f001515..d2cb8c5 100755
--- a/flint/Makefile.am
+++ b/flint/Makefile.am
@@ -32,14 +32,15 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 MTCR_DIR    = $(top_srcdir)/mtcr_ul
+MTCR_INC_DIR = $(top_srcdir)/include/mtcr_ul
 MFLASH_DIR  = $(top_srcdir)/mflash
 COMMON_DIR  = $(top_srcdir)/common
 LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 MFT_UTILS_DIR = $(top_srcdir)/mft_utils
 CMDIF_DIR   = $(top_srcdir)/cmdif
 
-INCLUDES = -I$(top_srcdir) -I$(srcdir) -I$(MTCR_DIR) -I$(MFLASH_DIR) -I$(COMMON_DIR) \
-           -I$(LAYOUTS_DIR) -I$(MFT_UTILS_DIR)
+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(MTCR_DIR) -I$(MFLASH_DIR) -I$(COMMON_DIR) \
+           -I$(LAYOUTS_DIR) -I$(MFT_UTILS_DIR) -I$(MTCR_INC_DIR)
 
 mstflint_CXXFLAGS = -Wall -W -g -MP -MD -pipe -DEXTERNAL
 bin_PROGRAMS = mstflint
@@ -66,6 +67,11 @@ else
 mstflint_CXXFLAGS += -DNO_ZLIB
 endif
 
+if ENABLE_OPENSSL
+mstflint_LDADD += $(top_srcdir)/tools_crypto/libtools_crypto.a -lcrypto
+else
+endif
+
 #get mst device examples and tool name from makefile
 mstflint_CXXFLAGS+= -DFLINT_NAME=\"mstflint\" -DFLINT_DISPLAY_NAME=\"MstFlint\"
 mstflint_CXXFLAGS += -DMST_DEV_EXAMPLE1=\"03:00.0\" -DMST_DEV_EXAMPLE2=\"mlx4_0\" -DMST_DEV_EXAMPLE3=\"03:00.0\" -DMST_DEV_EXAMPLE4=\"04:00.0\"
diff --git a/flint/Makefile.in b/flint/Makefile.in
index d22cb39..4732d6a 100644
--- a/flint/Makefile.in
+++ b/flint/Makefile.in
@@ -113,6 +113,7 @@ host_triplet = @host@
 bin_PROGRAMS = mstflint$(EXEEXT)
 @ENABLE_DC_TRUE at am__append_1 = -lz
 @ENABLE_DC_FALSE at am__append_2 = -DNO_ZLIB
+ at ENABLE_OPENSSL_TRUE@am__append_3 = $(top_srcdir)/tools_crypto/libtools_crypto.a -lcrypto
 subdir = flint
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/config/depcomp
@@ -131,12 +132,14 @@ am_mstflint_OBJECTS = mstflint-flint.$(OBJEXT) \
 	mstflint-cmd_line_parser.$(OBJEXT)
 mstflint_OBJECTS = $(am_mstflint_OBJECTS)
 am__DEPENDENCIES_1 =
+ at ENABLE_OPENSSL_TRUE@am__DEPENDENCIES_2 = $(top_srcdir)/tools_crypto/libtools_crypto.a
 mstflint_DEPENDENCIES = ../mlxfwops/lib/libmlxfwops.a \
 	../cmdparser/libcmdparser.a ../mflash/libmflash.a \
 	../tools_res_mgmt/libtools_res_mgmt.a $(CMDIF_DIR)/libcmdif.a \
 	../reg_access/libreg_access.a ../dev_mgt/libdev_mgt.a \
 	../mtcr_ul/libmtcr_ul.a ../tools_layouts/libtools_layouts.a \
-	../mft_utils/libmftutils.a $(am__DEPENDENCIES_1)
+	../mft_utils/libmftutils.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_2)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -290,6 +293,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -347,13 +351,14 @@ top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 MTCR_DIR = $(top_srcdir)/mtcr_ul
+MTCR_INC_DIR = $(top_srcdir)/include/mtcr_ul
 MFLASH_DIR = $(top_srcdir)/mflash
 COMMON_DIR = $(top_srcdir)/common
 LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 MFT_UTILS_DIR = $(top_srcdir)/mft_utils
 CMDIF_DIR = $(top_srcdir)/cmdif
-INCLUDES = -I$(top_srcdir) -I$(srcdir) -I$(MTCR_DIR) -I$(MFLASH_DIR) -I$(COMMON_DIR) \
-           -I$(LAYOUTS_DIR) -I$(MFT_UTILS_DIR)
+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(MTCR_DIR) -I$(MFLASH_DIR) -I$(COMMON_DIR) \
+           -I$(LAYOUTS_DIR) -I$(MFT_UTILS_DIR) -I$(MTCR_INC_DIR)
 
 
 #get mst device examples and tool name from makefile
@@ -370,7 +375,8 @@ mstflint_LDADD = ../mlxfwops/lib/libmlxfwops.a \
 	../tools_res_mgmt/libtools_res_mgmt.a $(CMDIF_DIR)/libcmdif.a \
 	../reg_access/libreg_access.a ../dev_mgt/libdev_mgt.a \
 	../mtcr_ul/libmtcr_ul.a ../tools_layouts/libtools_layouts.a \
-	../mft_utils/libmftutils.a $(LIBSTD_CPP) -ldl $(am__append_1)
+	../mft_utils/libmftutils.a $(LIBSTD_CPP) -ldl $(am__append_1) \
+	$(am__append_3)
 all: all-am
 
 .SUFFIXES:
diff --git a/flint/cmd_line_parser.cpp b/flint/cmd_line_parser.cpp
index 028cd59..7167b4c 100644
--- a/flint/cmd_line_parser.cpp
+++ b/flint/cmd_line_parser.cpp
@@ -108,6 +108,9 @@ SubCmdMetaData::SubCmdMetaData() {
     _sCmds.push_back(new SubCmd("", "rb", SC_Rb));
     _sCmds.push_back(new SubCmd("", "clear_semaphore", SC_Clear_Sem));
     _sCmds.push_back(new SubCmd("", "fi", SC_Fix_Img));
+    _sCmds.push_back(new SubCmd("cs", "checksum", SC_Check_Sum));
+    _sCmds.push_back(new SubCmd("ts", "timestamp", SC_Time_Stamp));
+    _sCmds.push_back(new SubCmd("ci", "cache_image", SC_Cache_Image));
 }
 
 SubCmdMetaData::~SubCmdMetaData() {
@@ -181,6 +184,7 @@ FlagMetaData::FlagMetaData() {
     _flags.push_back(new Flag("v", "version", 0));
     _flags.push_back(new Flag("", "no_devid_check", 0));
     _flags.push_back(new Flag("", "use_fw", 0));
+    _flags.push_back(new Flag("", "use_dev_img_info", 0));
 }
 
 FlagMetaData::~FlagMetaData() {
@@ -284,7 +288,7 @@ bool verifyNumOfArgs(string name, string value) {
 bool strToNum(string str, u_int64_t& num, int base=0)
 {
     char *endp;
-    char* numStr = strcpy(new char[str.size()],str.c_str());
+    char* numStr = strcpy(new char[str.size() + 1],str.c_str());
     num = strtoul(numStr, &endp, base);
     if (*endp) {
         delete[] numStr;
@@ -332,54 +336,6 @@ guid_t GetBaseMac(guid_t baseGuid)
     return baseMac;
 }
 
-bool InitBxGuids(std::vector<guid_t>& user_guids, guid_t base_guid1) {
-
-    int base_index = 0;
-    guid_t base_mac, base_guid;
-    user_guids.resize(MAX_GUIDS);
-
-    for (int i = 0; i < BX_SLICES_NUM; i++) {
-        base_index = i * BX_SLICE_GUIDS;
-        base_guid = incrGuid(base_guid1, i * 8);
-        // Init Guids
-        int base_guids_index = base_index + BI_GUIDS;
-        for (int j = 0; j < BX_NP_GUIDS; j++) {
-            if (j == 0) {
-                // The node guid should be the same one on the two slices.
-                user_guids[base_guids_index + j] = incrGuid(base_guid1, j);
-            } else {
-                user_guids[base_guids_index + j] = incrGuid(base_guid, j);
-            }
-
-        }
-        // Init Macs
-        base_mac = GetBaseMac(base_guid);
-        int base_macs_index = base_index + BI_IMACS;
-        for (int j = 0; j < BX_MACS; j++) {
-            user_guids[base_macs_index + j] = incrGuid(base_mac, j);
-        }
-        // Init WWPNSs
-        int base_wwpn_index = base_index + BI_WWPNS;
-        int base_emac_index = base_index + BI_EMACS;
-
-        for (int j = 0; j < BX_WWPNS; j++) {
-            user_guids[base_wwpn_index + j].l =  user_guids[base_emac_index + j].l;
-            user_guids[base_wwpn_index + j].h = (user_guids[base_emac_index + j].h | (0x2000 << 16));
-        }
-
-        // Init WWNNS
-        int base_wwnn_index = base_index + BI_WWNNS;
-        base_emac_index = base_index + BI_EMACS;
-
-        user_guids[base_wwnn_index].l =  user_guids[base_emac_index].l;
-        user_guids[base_wwnn_index].h = (user_guids[base_emac_index].h | (0x2001 << 16));
-    }
-
-    // Init SysGuid
-    user_guids[BI_SYS_GUID] = incrGuid(base_guid1, 7);
-    return true;
-}
-
 bool parseFlashParams(string params, flash_params_t& fp)
 {
     // Step 1 split by ","
@@ -472,7 +428,7 @@ void Flint::initCmdParser() {
                 "<GUIDS...>",
                 "4 GUIDs must be specified here.\n"
                 "The specified GUIDs are assigned\n"
-                "to the following fields, repectively:\n"
+                "to the following fields, respectively:\n"
                 "node, port1, port2 and system image GUID.\n\n"
                 "Note: port2 guid must be specified even for a\n"
                 "single port HCA - The HCA ignores this value.\n"
@@ -494,7 +450,7 @@ void Flint::initCmdParser() {
                 "<MACs...>",
                 "2 MACs must be specified here.\n"
                 "The specified MACs are assigned\n"
-                "to port1, port2, repectively.\n"
+                "to port1, port2, respectively.\n"
                 "Commands affected: burn, sg\n\n"
                 "Note: -mac/-macs flags are applicable only for Mellanox\n"
                 "\tTechnologies ethernet products.");
@@ -603,6 +559,13 @@ void Flint::initCmdParser() {
                 "Do not attempt to take device data sections from device(sections will be taken from the image. FS3 Only).\n"
                 "Commands affected: burn");
 
+    AddOptions("use_dev_img_info",
+               ' ',
+                "",
+                "preserve select image info fields from the device upon FW update (FS3 Only).\n"
+                "Commands affected: burn",
+                true);
+
     AddOptions("dual_image",
                ' ',
                 "",
@@ -788,10 +751,6 @@ ParseStatus Flint::HandleOption(string name, string value)
         if (!getGUIDFromStr(value, _flintParams.baseUid)) {
             return PARSE_ERROR;
         }
-        if (!InitBxGuids( _flintParams.user_uids, _flintParams.baseUid)) {
-            printf("-E- failed to extract UIDs from UID.");
-            return PARSE_ERROR;
-        }
     } else if (name == "blank_guids") {
         _flintParams.blank_guids = true;
     } else if (name == "clear_semaphore") {
@@ -834,7 +793,9 @@ ParseStatus Flint::HandleOption(string name, string value)
         _flintParams.dual_image = true;
     } else if (name == "striped_image") {
         _flintParams.striped_image = true;
-    } else if (name == "banks") {
+    }else if (name == "use_dev_img_info") {
+        _flintParams.use_dev_img_info = true;
+    }else if (name == "banks") {
         _flintParams.banks_specified = true;
         u_int64_t banksNum;
         if (!strToNum(value, banksNum)) {
diff --git a/flint/err_msgs.h b/flint/err_msgs.h
index 5cb5cd1..6f8bc18 100644
--- a/flint/err_msgs.h
+++ b/flint/err_msgs.h
@@ -59,8 +59,8 @@ typedef enum {
 #define FLINT_PARSE_MEM_ERROR                 "Failed to allocate memory for parsing.\n "
 #define FLINT_NO_OPTIONS_FOUND_ERROR          "No options found. "
 #define FLINT_INVALID_COMMAD_ERROR            "Invalid command: %s\n"
-#define FLINT_TOO_MANY_ARGS_ERROR             "Too many arguments. Expected: %d , Recieved: %d\n"
-#define FLINT_TOO_FEW_ARGS_ERROR              "Too few arguments. Expected: %d , Recieved: %d\n"
+#define FLINT_TOO_MANY_ARGS_ERROR             "Too many arguments. Expected: %d , Received: %d\n"
+#define FLINT_TOO_FEW_ARGS_ERROR              "Too few arguments. Expected: %d , Received: %d\n"
 #define FLINT_NO_COMMAND_ERROR                "No command found."
 #define FLINT_OPEN_FWOPS_DEVICE_ERROR         "Cannot open Device: %s. %s\n"
 #define FLINT_OPEN_FWOPS_IMAGE_ERROR          "Cannot open Image: %s. %s\n"
@@ -75,8 +75,6 @@ typedef enum {
 #define FLINT_CMD_ARGS_ERROR5                 "Command \"%s\" does not require arguments\n"
 #define FLINT_INVALID_OPTION_ERROR            "Unknown option \"%s\" for the \"%s\" command. you can use %s.\n"
 #define FLINT_INVALID_FLAG_ERROR              "Invalid switch \"%s\" is specified.\n"
-#define FLINT_INVALID_UID_NUM_BX_ERROR        "Number of UIDs on BridgeX should be %d\n"
-#define FLINT_BX_BAD_MAC_FORMAT_ERROR         "Bad mac ( %4.4x%8.8x ) %s. Please re-burn with a valid MACs value.\n"
 #define FLINT_INVALID_FLAG_WITH_FLAG_ERROR    "Cannot specify \"%s\" flag with \"%s\" flag.\n"
 #define FLINT_INVALID_FLAG_WITHOUT_FLAG_ERROR "\"%s\" flag must be specified with \"%s\" flag.\n"
 #define FLINT_INVALID_FLAG_WITH_CMD_ERROR     "Cannot specify flag: %s with Command: %s\n"
@@ -103,6 +101,7 @@ typedef enum {
 #define FLINT_IMAGE_READ_ERROR                "Failed to read image. %s\n"
 #define FLINT_READ_ERROR                      "Failed to read from %s. %s\n"
 #define FLINT_WIN_NOT_SUPP_ERROR              "Command \"%s\" is not supported in windows.\n"
+#define FLINT_WIN_ONLY_SUPP_ERROR             "Command  \"%s\" is supported only in windows.\n"
 #define FLINT_GEN_COMMAND_ERROR               "Failed to execute command %s. %s\n"
 #define FLINT_FS3_BB_ERROR                    "bb command is not supported anymore in FS3 image, please use b for burning FS3 image.\n"
 #define FLINT_FS3_BURN_ERROR                  "Burning FS3 image failed: %s\n"
@@ -131,6 +130,12 @@ typedef enum {
 #define FLINT_INVALID_PASSWORD                "Invalid Password.\n"
 #define FLINT_NO_GUID_MAC_FLAGS_ERROR         "Can not set GUIDs/MACs: please run with -uid/-guid/-mac flag.\n"
 #define FLINT_NO_UID_FLAG_ERROR               "Can not set GUIDs/MACs: uid is not specified, please run with -uid flag.\n"
+#define FLINT_CHECKSUM_ERROR                  "Failed to calculate checksum on %s: %s\n"
+#define FLINT_CHECKSUM_MISSMATCH_ERROR        "Given checksum: %s does not match the checksum calculated on device FW: %s.\n"
+#define FLINT_CHECKSUM_PARSE_ERROR            "Failed to parse given checksum.\n"
+#define FLINT_CHECKSUM_LEN_ERROR              "MD5 checksum should be exactly 16 bytes long.\n"
+#define FLINT_CHECKSUM_HEX_ERROR              "MD5 checksum should contain only hexadecimal digits.\n"
+#define FLINT_CACHE_IMAGE_ERROR                 "Failed to issue image cache request to driver. %s. make sure Mellanox driver is loaded and working properly.\n"
 
 /**************************
  * Flint Warning Messages
diff --git a/flint/flint.cpp b/flint/flint.cpp
index 08b2733..dedce9d 100644
--- a/flint/flint.cpp
+++ b/flint/flint.cpp
@@ -159,6 +159,9 @@ map_sub_cmd_t_to_subcommand Flint::initSubcommandMap()
     cmdMap[SC_Wb] = new WbSubCommand();
     cmdMap[SC_Rb] = new RbSubCommand();
     cmdMap[SC_Clear_Sem] = new ClearSemSubCommand();
+    cmdMap[SC_Check_Sum] = new CheckSumSubCommand();
+    cmdMap[SC_Time_Stamp] = new TimeStampSubCommand();
+    cmdMap[SC_Cache_Image] = new CacheImageSubCommand();
     return cmdMap;
 }
 
@@ -231,6 +234,11 @@ FlintStatus Flint::run(int argc, char* argv[])
     }
     //TODO: Step 3 check flintParams for contradictions?
     //Step 4 execute command from the correct subcommand class
+    if (_subcommands.count(_flintParams.cmd) == 0) {
+        // should not be reached
+        printf("-E- FATAL: command object not found.");
+        return FLINT_FAILED;
+    }
     _subcommands[_flintParams.cmd]->setParams(_flintParams);
     return _subcommands[_flintParams.cmd]->executeCommand();
 }
diff --git a/flint/flint_params.cpp b/flint/flint_params.cpp
index beccbd9..a89ba11 100644
--- a/flint/flint_params.cpp
+++ b/flint/flint_params.cpp
@@ -48,7 +48,6 @@ FlintParams::FlintParams()
     mac_specified = false;
     macs_specified = false;
     uid_specified = false;
-    uids_specified = false;
     device_specified = false;
     blank_guids = false;
     clear_semaphore = false;
@@ -81,6 +80,7 @@ FlintParams::FlintParams()
     baseUid.l = 0;
     flash_params.num_of_flashes = 0;
     flash_params.log2size = 0;
+    use_dev_img_info = false;
 }
 
 FlintParams::~FlintParams()
diff --git a/flint/flint_params.h b/flint/flint_params.h
index 1b14eaa..0a987a0 100644
--- a/flint/flint_params.h
+++ b/flint/flint_params.h
@@ -76,7 +76,10 @@ typedef enum {
     SC_Rb,
     SC_Clear_Sem,
     SC_Fix_Img,
-    SC_Qrom
+    SC_Qrom,
+    SC_Check_Sum,
+    SC_Time_Stamp,
+    SC_Cache_Image
 } sub_cmd_t;
 
 class FlintParams {
@@ -93,9 +96,7 @@ public:
     bool macs_specified;
     std::vector<guid_t> user_macs;
     bool uid_specified;
-    bool uids_specified;
     guid_t baseUid;
-    std::vector<guid_t> user_uids;
     bool help;
     bool version;
     bool extended_help;
@@ -131,6 +132,7 @@ public:
     sub_cmd_t cmd;
     vector<string> cmd_params;
     string fullCmd;
+    bool use_dev_img_info;
 };
 
 #endif
diff --git a/flint/subcommands.cpp b/flint/subcommands.cpp
index 91400a5..71a9fbd 100644
--- a/flint/subcommands.cpp
+++ b/flint/subcommands.cpp
@@ -12,7 +12,7 @@
  *
  *     Redistribution and use in source and binary forms, with or
  *     without modification, are permitted provided that the following
- *     conditions are met:FwVerify
+ *     conditions are met:
  *
  *      - Redistributions of source code must retain the above
  *        copyright notice, this list of conditions and the following
@@ -59,6 +59,8 @@
 #ifdef __WIN__
 #include <windows.h>
 #include <ctype.h>
+
+#include <win_driver_cif.h>
 #endif
 
 #include "subcommands.h"
@@ -451,13 +453,19 @@ bool SubCommand::basicVerifyParams()
     //open log if needed
     openLog();
 
-    if (_maxCmdParamNum != -1 && (int)_flintParams.cmd_params.size() > _maxCmdParamNum) {// _maxCmdParamNum == -1 means ignore this check
+    if (_maxCmdParamNum == _minCmdParamNum && _maxCmdParamNum != -1 && (int)_flintParams.cmd_params.size() != _maxCmdParamNum) {
+        reportErr(true, FLINT_CMD_ARGS_ERROR, _name.c_str(), _maxCmdParamNum, _flintParams.cmd_params.size());
+        return false;
+    } else if (_maxCmdParamNum != -1 && (int)_flintParams.cmd_params.size() > _maxCmdParamNum) { // _maxCmdParamNum == -1 means ignore this check
         if (_maxCmdParamNum) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR2, _name.c_str(), _maxCmdParamNum, _flintParams.cmd_params.size());
+            reportErr(true, FLINT_CMD_ARGS_ERROR2, _name.c_str(), _maxCmdParamNum, _flintParams.cmd_params.size());
         } else {
             reportErr(true, FLINT_CMD_ARGS_ERROR5, _name.c_str());
         }
         return false;
+    } else if (_minCmdParamNum != -1 && (int)_flintParams.cmd_params.size() < _minCmdParamNum) { // _minCmdParamNum == -1 means ignore this check
+        reportErr(true, FLINT_CMD_ARGS_ERROR3, _name.c_str(), _minCmdParamNum, _flintParams.cmd_params.size());
+        return false;
     }
 
     switch (_v) {
@@ -824,28 +832,9 @@ bool SubCommand::printGuidLine(guid_t* new_guids, guid_t* old_guids, int guid_in
     return true;
 }
 
-bool SubCommand::printBxGuids(guid_t* new_guids, guid_t* old_guids, int index, int num_of_guids, const char* pre_str)
-{
-    int guid_index = index;
-    int _is_wwpn = ((guid_index - BI_WWPNS) % BX_SLICE_GUIDS);
-
-    for (int i = 0; i < num_of_guids; i++) {
-        printf("    G%d", (index >= BX_SLICE_GUIDS));
-        if (i == 0 && _is_wwpn) {
-           printf(" Node  %s:      ", pre_str);
-        } else {
-            int j = _is_wwpn ? i : i + 1;
-            printf(" Port%d %s:      ", j, pre_str);
-        }
-        printGuidLine(new_guids, old_guids,  guid_index);
-        guid_index++;
-    }
-    return true;
-}
-
 bool SubCommand::printMacLine(guid_t* new_guids, guid_t* old_guids, int mac_index)
 {
-    printf("    "MAC_FORMAT MAC_SPACES, new_guids[mac_index].h, new_guids[mac_index].l);
+    printf("    " MAC_FORMAT MAC_SPACES, new_guids[mac_index].h, new_guids[mac_index].l);
     if (old_guids != NULL) {
         printf(MAC_FORMAT, old_guids[mac_index].h, old_guids[mac_index].l);
     } else {
@@ -855,41 +844,6 @@ bool SubCommand::printMacLine(guid_t* new_guids, guid_t* old_guids, int mac_inde
     return true;
 }
 
-bool SubCommand::printBxMacs(guid_t* new_guids, guid_t* old_guids, int index, int num_of_guids, const char* pre_str)
-{
-    int guid_index = index;
-
-    for (int i = 0; i < num_of_guids; i++) {
-        printf("    G%d", (index >= BX_SLICE_GUIDS));
-        printf(" Port%d %s:      ", i + 1, pre_str);
-        printMacLine(new_guids, old_guids, guid_index);
-        guid_index++;
-    }
-    return true;
-}
-
-bool SubCommand::printUidsFunc(guid_t* new_guids, guid_t* old_guids)
-{
-    int base_index = 0, guid_index;
-
-    for (int i = 0; i < BX_SLICES_NUM; i++) {
-        base_index = i * BX_SLICE_GUIDS;
-        // Init Guids
-        printBxGuids(new_guids, old_guids, base_index + BI_GUIDS, BX_NP_GUIDS, "Guid");
-        printBxMacs (new_guids, old_guids, base_index + BI_IMACS, BX_IMACS,    "IMAC");
-        printBxMacs (new_guids, old_guids, base_index + BI_EMACS, BX_EMACS,    "EMAC");
-        printBxGuids(new_guids, old_guids, base_index + BI_WWNNS, BX_WWNNS,    "WWNN");
-        printBxGuids(new_guids, old_guids, base_index + BI_WWPNS, BX_WWPNS,    "WWPN");
-     }
-
-    // Init SysGuid
-    //INCR_GUID(base_guid1, user_guids[Operations::BI_SYS_GUID], 7);
-    guid_index = BI_SYS_GUID;
-    printf("    System   GUID:      ");
-    printGuidLine(new_guids, old_guids,  guid_index);
-    return true;
-}
-
 bool SubCommand::printGUIDsFunc(guid_t guids[GUIDS],guid_t macs[MACS], guid_t old_guids[GUIDS],\
         guid_t old_macs[MACS], bool print_guids, bool print_macs, int portNum, bool old_guid_fmt) {
 
@@ -921,21 +875,18 @@ bool SubCommand::printGUIDsFunc(guid_t guids[GUIDS],guid_t macs[MACS], guid_t ol
 
 bool SubCommand::reportGuidChanges(guid_t* new_guids, guid_t* new_macs,\
                                     guid_t* old_guids, guid_t* old_macs, bool printGuids,\
-                                    bool printMacs, bool printUids, int guidNum)
+                                    bool printMacs, int guidNum)
 {
     //should be used ONLY on FS2 in current implementation
     printf("    You are about to change the Guids/Macs/Uids on the %s:\n\n", _flintParams.device_specified ? "device" : "image");
     printf("                        New Values      " GUID_SPACES "Current Values\n");
-    if (printUids) {
-        printUidsFunc(new_guids, old_guids );
-    } else {
-       printGUIDsFunc(new_guids, new_macs,
-                  old_guids, old_macs,
-                  printGuids,
-                  printMacs,
-                  guidNum,
-                  guidNum < GUIDS);
-    }
+   printGUIDsFunc(new_guids, new_macs,
+              old_guids, old_macs,
+              printGuids,
+              printMacs,
+              guidNum,
+              guidNum < GUIDS);
+
     if (!askUser())
         return false;
 
@@ -1015,49 +966,37 @@ bool SubCommand::dumpFile(const char* confFile, std::vector<u_int8_t>& data, con
     return true;
 }
 
-bool SubCommand::checkGuidsFlags (chip_type_t ct, u_int16_t devType, u_int8_t fwType,
-                            bool guidsSpecified, bool macsSpecified, bool uidsSpecified, bool ibDev, bool ethDev) {
+bool SubCommand::checkGuidsFlags (u_int16_t devType, u_int8_t fwType,
+                            bool guidsSpecified, bool macsSpecified, bool uidSpecified, bool ibDev, bool ethDev) {
     (void)ibDev;
-    if (guidsSpecified || macsSpecified || uidsSpecified) {
-        if (ct == CT_BRIDGEX) {
-            if (macsSpecified || guidsSpecified) {
-                reportErr(true, "-mac(s)/-guid(s) flags is not applicable for MT%d.\n",devType);
-                return false;
-            }
-        } else {
-            if (uidsSpecified && fwType != FIT_FS3) {
-                reportErr(true, "-uid(s) flag is applicable only for BridgeX and FS3 FW.\n");
-                return false;
-            } else if (fwType != FIT_FS2 && !ethDev && macsSpecified ) {
-                reportErr(true, "-mac(s) flag is not applicable for IB MT%d device.\n", devType);
-                return false;
-            }
+    if (guidsSpecified || macsSpecified || uidSpecified) {
+        if (uidSpecified && fwType != FIT_FS3) {
+            reportErr(true, "-uid flag is applicable only for FS3 FW Only.\n");
+            return false;
+        } else if (fwType != FIT_FS2 && !ethDev && macsSpecified ) {
+            reportErr(true, "-mac(s) flag is not applicable for IB MT%d device.\n", devType);
+            return false;
         }
     }
     return true;
 }
 
-void SubCommand::printMissingGuidErr(bool ibDev, bool ethDev, bool bxDev)
+void SubCommand::printMissingGuidErr(bool ibDev, bool ethDev)
 {
     const char* missingInfo;
     const char* missingFlags;
 
-    if (bxDev) {
-        missingInfo  = "UIDs (GUIDs / MACs / WWNs)";
-        missingFlags = "-uid(s)";
+    if (ibDev && ethDev) {
+        missingInfo  = "GUIDs / MACs";
+        missingFlags = "-guid(s) / -mac(s)";
+    } else if (ibDev) {
+        missingInfo  = "GUIDs";
+        missingFlags = "-guid(s)";
     } else {
-        if (ibDev && ethDev) {
-            missingInfo  = "GUIDs / MACs";
-            missingFlags = "-guid(s) / -mac(s)";
-        } else if (ibDev) {
-            missingInfo  = "GUIDs";
-            missingFlags = "-guid(s)";
-        } else {
-            missingInfo  = "MACs";
-            missingFlags = "-mac(s)";
-        }
-
+        missingInfo  = "MACs";
+        missingFlags = "-mac(s)";
     }
+
     printf("Please specify %s (using command line flags %s ).\n", missingInfo, missingFlags);
     return;
 }
@@ -1153,13 +1092,13 @@ BurnSubCommand:: BurnSubCommand()
     _name = "burn";
     _desc = "Burn flash";
     _extendedDesc = "Burn flash \n"
-                    INDENTEX"Performs failsafe FW update from a raw binary image.";
+                    INDENTEX "Performs failsafe FW update from a raw binary image.";
     _flagLong = "burn";
     _flagShort = "b";
     _param = "";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" -i image1.bin burn\n"
-              INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE2" -guid 0x2c9000100d050 -i image1.bin b";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " -i image1.bin burn\n"
+              INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE2 " -guid 0x2c9000100d050 -i image1.bin b";
     _v = Wtv_Dev_And_Img;
     _maxCmdParamNum = 0;
     _cmdType = SC_Burn;
@@ -1179,16 +1118,16 @@ BurnSubCommand:: ~BurnSubCommand()
 
 bool BurnSubCommand::verifyParams()
 {
-    if ((_flintParams.guid_specified || _flintParams.guids_specified) && (_flintParams.uid_specified || _flintParams.uids_specified)) {
-            reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either GUIDs / UIDs (using command line flags -guid(s) / -uid(s) )");
+    if ((_flintParams.guid_specified || _flintParams.guids_specified) && (_flintParams.uid_specified)) {
+            reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either GUIDs / UID (using command line flags -guid(s) / -uid )");
             return false;
         }
-    if ((_flintParams.mac_specified || _flintParams.macs_specified) && (_flintParams.uid_specified || _flintParams.uids_specified)) {
-            reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either MACs / UIDs (using command line flags -mac(s) / -uid(s) )");
+    if ((_flintParams.mac_specified || _flintParams.macs_specified) && (_flintParams.uid_specified)) {
+            reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either MACs / UID (using command line flags -mac(s) / -uid )");
             return false;
         }
     bool GuidsFromUser = _flintParams.guid_specified || _flintParams.guids_specified ||\
-            _flintParams.uid_specified || _flintParams.uids_specified|| \
+            _flintParams.uid_specified || \
             _flintParams.mac_specified || _flintParams.macs_specified;
     if (GuidsFromUser && _flintParams.use_image_guids) {
         reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR,"GUIDs/UIDs/MACs", "-use_image_guids");
@@ -1207,10 +1146,6 @@ bool BurnSubCommand::verifyParams()
         reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR, "-macs", "-mac" );
         return false;
     }
-    if (_flintParams.uid_specified && _flintParams.uids_specified) {
-        reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR, "-uids", "-uid" );
-        return false;
-    }
     if (_flintParams.use_image_ps && _flintParams.vsd_specified) {
         reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR, "-use_image_ps", "-vsd");
         return false;
@@ -1228,11 +1163,12 @@ void BurnSubCommand::updateBurnParams()
     		_fwType == FIT_FS2? &burnCbFs2Func : &burnCbFs3Func;
     _burnParams.userGuidsSpecified = _flintParams.guids_specified || _flintParams.guid_specified;
     _burnParams.userMacsSpecified = _flintParams.macs_specified || _flintParams.mac_specified;
-    _burnParams.userUidsSpecified = _flintParams.uids_specified || _flintParams.uid_specified;
+    _burnParams.userUidSpecified = _flintParams.uid_specified;
     _burnParams.vsdSpecified = _flintParams.vsd_specified;
     _burnParams.blankGuids = _flintParams.blank_guids;
     _burnParams.burnFailsafe = !_flintParams.nofs;
     _burnParams.allowPsidChange = _flintParams.allow_psid_change;
+    _burnParams.useDevImgInfo = _flintParams.use_dev_img_info;
     _burnParams.useImagePs = _flintParams.use_image_ps;
     _burnParams.burnRomOptions = _flintParams.use_image_rom ? FwOperations::ExtBurnParams::BRO_ONLY_FROM_IMG \
                                                                 : FwOperations::ExtBurnParams::BRO_DEFAULT ;
@@ -1243,8 +1179,9 @@ void BurnSubCommand::updateBurnParams()
     if (_burnParams.userGuidsSpecified) {
         _burnParams.userUids = _flintParams.user_guids;
     }
-    if (_burnParams.userUidsSpecified) {
-        _burnParams.userUids = _flintParams.user_uids;
+    if (_burnParams.userUidSpecified) {
+        _burnParams.userUids.resize(0);
+        _burnParams.userUids.push_back(_flintParams.baseUid);
     }
     if (_burnParams.userMacsSpecified) {
         if (!_burnParams.userGuidsSpecified) {
@@ -1301,16 +1238,10 @@ bool BurnSubCommand::checkFwVersion()
     printf("\n");
     _burnParams.ignoreVersionCheck = true;
     return true;
-
 }
 
-bool BurnSubCommand::checkPSIDAndIbEth()
+bool BurnSubCommand::checkPSID()
 {
-    //bool ib_dev;
-    //bool eth_dev;
-    //setDevFlags(_devInfo, ib_dev, eth_dev);
-    //all FW now support both ETH and IB so the OLD IB/ETH FW check is not needed anymore (see old implementation of flint)
-
     if (strlen(_imgInfo.fw_info.psid) != 0  && strlen(_devInfo.fw_info.psid) != 0 &&
             strncmp( _imgInfo.fw_info.psid, _devInfo.fw_info.psid, PSID_LEN)) {
         if (_flintParams.allow_psid_change) {
@@ -1332,27 +1263,24 @@ bool BurnSubCommand::checkPSIDAndIbEth()
 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) {
+    if (_imgInfo.fw_type != FIT_FS3 && _imgInfo.fw_type != FIT_FS4) {
         reportErr(true, FLINT_IMG_DEV_COMPAT_ERROR, "FS3", "FS3");
         return FLINT_FAILED;
-        }
-
+    }
     // on FS3 burn we require query to pass
     if (!_devQueryRes && _burnParams.burnFailsafe) {
         reportErr(true, FLINT_FS3_BURN_ERROR, _fwOps->err());
         return FLINT_FAILED;
     }
-
     //check FwVersion
     if ( !checkFwVersion()) {
         return FLINT_BURN_ABORTED;
     }
     // check Psid
-    if (_devQueryRes && !checkPSIDAndIbEth()) {
+    if (_devQueryRes && !checkPSID()) {
         return FLINT_FAILED;
     }
     // deal with rom
-
     dealWithExpRom();
     bool getRomFromDev = ( _burnParams.burnRomOptions == FwOperations::ExtBurnParams::BRO_FROM_DEV_IF_EXIST);
     if (!getRomFromDev && !checkMatchingExpRomDevId(_imgInfo)) {
@@ -1373,23 +1301,11 @@ FlintStatus BurnSubCommand::burnFs3()
         }
     }
 
-    // perform some checks incase of a corrupt CX4
-    // TODO: remove this check in MFT-4.1.0
-    if(_burnParams.burnFailsafe) {
-        if (!_fwOps->CheckCX4Device()) {
-            printf(" An inconsistency was detected in the device parameters. A fix must be performed before burning FW.\n");
-            printf(" Please do not terminate the process. Operation is not failsafe.\n");
-            if (!askUser()) {
-                return FLINT_FAILED;
-            }
-        }
-    }
     if (!_fwOps->FwBurnAdvanced(_imgOps, _burnParams)) {
         reportErr(true, FLINT_FS3_BURN_ERROR, _fwOps->err());
         return FLINT_FAILED;
     }
     PRINT_PROGRESS(_burnParams.progressFunc, 101);
-
     write_result_to_log(FLINT_SUCCESS, "", _flintParams.log_specified);
     const char* resetRec = _fwOps->FwGetResetRecommandationStr();
     if (resetRec) {
@@ -1455,7 +1371,7 @@ FlintStatus BurnSubCommand::burnFs2()
         return FLINT_BURN_ABORTED;
     }
     //check Psid
-    if (_devQueryRes && !checkPSIDAndIbEth()) {
+    if (_devQueryRes && !checkPSID()) {
         return FLINT_FAILED;
     }
 
@@ -1529,22 +1445,19 @@ bool BurnSubCommand::dealWithGuids()
     bool read_guids = true;
     bool ib_dev;
     bool eth_dev;
-    bool bx_dev;
     // Get the FW types
-    bx_dev = _imgInfo.fw_info.chip_type == CT_BRIDGEX;
     FwOperations::SetDevFlags(_imgInfo.fw_info.chip_type, _imgInfo.fw_info.dev_type, (fw_img_type)_imgInfo.fw_type, ib_dev, eth_dev);
     //setDevFlags(_imgInfo, ib_dev, eth_dev);
 
     // Check if there is a need to read guids
     if (_burnParams.useImageGuids || _burnParams.blankGuids
             || (_burnParams.userGuidsSpecified && ib_dev)
-            || (_burnParams.userMacsSpecified)
-            || (_burnParams.userUidsSpecified && bx_dev)) {
+            || (_burnParams.userMacsSpecified)) {
         read_guids = false;
     }
     // Check if the burnt FW is ok and readable in order to get the GUIDs later
     if (read_guids && !_devQueryRes) {
-        //printMissingGuidErr(ib_dev, eth_dev, bx_dev);
+        //printMissingGuidErr(ib_dev, eth_dev);
         if (_burnParams.burnFailsafe) {
             reportErr(true,
                     "Can not extract GUIDs/MACs info from flash, %s\n"
@@ -1552,23 +1465,23 @@ bool BurnSubCommand::dealWithGuids()
                             "    If you want to burn in non failsafe mode, use the \"-nofs\" switch.\n", _fwOps->err());
         } else {
             reportErr(true, "Can not extract GUIDs/MACs info from flash, %s", _fwOps->err());
-            printMissingGuidErr(ib_dev, eth_dev, bx_dev);
+            printMissingGuidErr(ib_dev, eth_dev);
         }
         return false;
     }
     // Check guids flag to ensure correct patching of guids in mlxfwops
     bool is_guids_specified = _burnParams.userGuidsSpecified
             || _burnParams.userMacsSpecified
-            || _burnParams.userUidsSpecified;
+            || _burnParams.userUidSpecified;
     if (is_guids_specified) {
-        if (!checkGuidsFlags((chip_type_t)_imgInfo.fw_info.chip_type, _imgInfo.fw_info.dev_type, _fwType,\
-                _burnParams.userGuidsSpecified, _burnParams.userMacsSpecified, _burnParams.userUidsSpecified, ib_dev, eth_dev)) {
+        if (!checkGuidsFlags( _imgInfo.fw_info.dev_type, _fwType,\
+                _burnParams.userGuidsSpecified, _burnParams.userMacsSpecified, _burnParams.userUidSpecified, ib_dev, eth_dev)) {
             return false;
         }
     }
     //report guid changes if needed. and update the user_guids vector in _burnParams
      if (is_guids_specified || _flintParams.use_image_guids) {
-         guid_t* new_guids = ( _burnParams.userGuidsSpecified || _burnParams.userUidsSpecified )?\
+         guid_t* new_guids = ( _burnParams.userGuidsSpecified || _burnParams.userUidSpecified )?\
                  &_burnParams.userUids[0] : _devInfo.fs2_info.guids;
          guid_t* new_macs = _burnParams.userMacsSpecified != 0 ? &_burnParams.userUids[GUIDS] : &_devInfo.fs2_info.guids[GUIDS];
          guid_t* old_guids = !_devQueryRes ? NULL : _devInfo.fs2_info.guids;
@@ -1579,7 +1492,7 @@ bool BurnSubCommand::dealWithGuids()
          }
          //printf("-D- l=%d, h=%d\n", new_macs->l, new_macs->h);
              if (!reportGuidChanges(new_guids, new_macs, old_guids, old_macs, ib_dev,\
-                     eth_dev, bx_dev, _imgInfo.fs2_info.guid_num)) {
+                     eth_dev, _imgInfo.fs2_info.guid_num)) {
                  return false;
              }
 
@@ -1588,7 +1501,7 @@ bool BurnSubCommand::dealWithGuids()
 }
 
 #define IS_HCA(chipType) \
-    (((chipType) == CT_CONNECTX) || ((chipType) == CT_CONNECT_IB) || ((chipType) == CT_CONNECTX4) || ((chipType) == CT_CONNECTX4_LX))
+    (((chipType) == CT_CONNECTX) || ((chipType) == CT_CONNECT_IB) || ((chipType) == CT_CONNECTX4) || ((chipType) == CT_CONNECTX4_LX) || ((chipType) == CT_CONNECTX5))
 
 void BurnSubCommand::dealWithExpRom()
 {
@@ -1655,16 +1568,17 @@ FlintStatus BurnSubCommand::executeCommand()
     // query both image and device (deviceQuery can fail but we save rc)
     _devQueryRes = _fwOps->FwQuery(&_devInfo);
     if (!_imgOps->FwQuery(&_imgInfo))
-        {
-            reportErr(true, FLINT_FAILED_QUERY_ERROR, "image", _flintParams.image.c_str(), _imgOps->err());
-            return FLINT_FAILED;
-        }
+    {
+        reportErr(true, FLINT_FAILED_QUERY_ERROR, "image", _flintParams.image.c_str(), _imgOps->err());
+        return FLINT_FAILED;
+    }
     //updateBurnParams with input given by user
     updateBurnParams();
-    if (_fwType == FIT_FS3) {
-        return burnFs3();
+    if (_fwType == FIT_FS3 || _fwType == FIT_FS4) {
+
+        return burnFs3();//CodeView: change the name of this function
     } else if (_fwType == FIT_FS2) {
-    return burnFs2();
+        return burnFs2();
     }
     // unknown fw type
     reportErr(true, FLINT_UNKNOWN_FW_TYPE_ERROR);
@@ -1705,72 +1619,6 @@ bool QuerySubCommand::checkMac(u_int64_t mac, string& warrStr) {
     return true;
 }
 
-bool QuerySubCommand::reportBxGuidsQuery(const guid_t* guids, int base1, int guids_num, int index, const char* pre_str)
-{
-    int i, first_index, base, wwnns_index;
-
-    printf("G%d %-14s", index, pre_str);
-    first_index = index * BX_SLICE_GUIDS;
-    if (base1 == BI_WWPNS) {
-        wwnns_index = first_index + (BX_SLICE_GUIDS - 1);
-        printf(GUID_FORMAT " ", guids[wwnns_index].h, guids[wwnns_index].l);
-    }
-    base = first_index + base1;
-    for (i = base; i < base + guids_num; i++) {
-        int j = i;
-        // HACK
-        if (i == BI_GUIDS + BX_SLICE_GUIDS) {
-            // We display the same node guid on the two slices.
-            j = BI_GUIDS;
-        }
-        printf(GUID_FORMAT " ", guids[j].h, guids[j].l);
-    }
-    printf("\n");
-    return true;
-}
-
-
-bool QuerySubCommand::reportBxMacsQuery(const guid_t* guids, int base1, int guids_num, int index, const char* pre_str)
-{
-    int i, base;
-
-    base = index * BX_SLICE_GUIDS + base1;
-    printf("G%d %-30s", index, pre_str);
-    for (i = base; i < base + guids_num; i++) {
-            printf("     " MAC_FORMAT , guids[i].h, guids[i].l);
-    }
-    printf("\n");
-    return true;
-}
-
-bool QuerySubCommand::reportBxMacsWarnings(const guid_t* guids, int index, int warning, int user_uids)
-{
-    int i, base;
-    int is_first = 1;
-    base = index * BX_SLICE_GUIDS + BI_IMACS;
-    for (i = base; i < base + BX_MACS; i++) {
-         u_int64_t mac = (((u_int64_t)guids[i].h) << 32) | guids[i].l;
-         string warrStr;
-         if (!checkMac(mac, warrStr)) {
-             if (warning) {
-                 if (is_first) {
-                     printf("\n\n");
-                     is_first = 0;
-                 }
-                 printf(FLINT_BAD_MAC_ADRESS_WARNING, guids[i].h, guids[i].l, warrStr.c_str());
-             } else {
-                 printf(FLINT_BX_BAD_MAC_FORMAT_ERROR,
-                        guids[i].h,
-                        guids[i].l,
-                        user_uids ? "given" : "found on flash");
-                 return false;
-             }
-         }
-     }
-     return true;
-}
-
-
 bool QuerySubCommand::displayFs2Uids(const fw_info_t& fwInfo)
 {
     const char* mac_indent = "";
@@ -1779,115 +1627,104 @@ bool QuerySubCommand::displayFs2Uids(const fw_info_t& fwInfo)
     FwOperations::SetDevFlags(fwInfo.fw_info.chip_type, fwInfo.fw_info.dev_type, (fw_img_type)fwInfo.fw_type, ibDev, ethDev);
     //setDevFlags(fwInfo, ibDev, ethDev);
     int numPorts = 2;
-    if ((fwInfo.fw_info.chip_type == CT_IS4) || (fwInfo.fw_info.chip_type == CT_SWITCHX)) {
+    if ((fwInfo.fw_info.chip_type == CT_IS4 || fwInfo.fw_info.chip_type == CT_SWITCHX)) {
         numPorts = 0;
     }
     //we do not support cards with one port anymore.
 
     // GUIDS:
-
-    if (fwInfo.fw_info.chip_type == CT_BRIDGEX) {
-        int i;
-        if (fwInfo.fs2_info.guid_num != BX_ALL_GUIDS) {
-            reportErr(true, FLINT_INVALID_UID_NUM_BX_ERROR, BX_ALL_GUIDS);
-            return false;
-        }
-        printf("Description:     Node             Port1            Port2            Port3            Port4\n");
-        for (i = 0; i < BX_SLICES_NUM; i++) {
-            reportBxGuidsQuery(fwInfo.fs2_info.guids, BI_GUIDS,  BX_NP_GUIDS, i, "GUIDs:");
-            reportBxMacsQuery(fwInfo.fs2_info.guids,  BI_IMACS, BX_IMACS,    i, "IMACs:");
-            reportBxMacsQuery(fwInfo.fs2_info.guids,  BI_EMACS, BX_EMACS,    i, "EMACs:");
-            reportBxGuidsQuery(fwInfo.fs2_info.guids, BI_WWPNS, BX_WWPNS,    i, "WWNs: ");
-        }
-        printf("SYS GUID:        " GUID_FORMAT " ",\
-                fwInfo.fs2_info.guids[fwInfo.fs2_info.guid_num - 1].h,\
-                fwInfo.fs2_info.guids[fwInfo.fs2_info.guid_num - 1].l);
-        if (!fwInfo.fs2_info.blank_guids) {
-            for (i = 0; i < BX_SLICES_NUM; i++) {
-                reportBxMacsWarnings(fwInfo.fs2_info.guids, i, 1, 0);
+    if (ibDev) {
+        //report("GUID Des:        Node             Port1            ");
+        printf("Description:         Node             ");
+        if (numPorts > 0)
+            printf("Port1            ");
+        if (numPorts > 1)
+            printf("Port2            ");
+        printf( "Sys image\n");
+
+        printf("GUIDs:               ");
+        for (u_int32_t i=0; i < GUIDS; i++) {
+            if ((i == 1 && numPorts < 1) ||
+                (i == 2 && numPorts < 2)) {
+                continue;
             }
+            printf(GUID_FORMAT " ", fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l);
         }
-    } else {
-        if (ibDev) {
-            //report("GUID Des:        Node             Port1            ");
-            printf("Description:     Node             ");
-            if (numPorts > 0)
-                printf("Port1            ");
-            if (numPorts > 1)
-                printf("Port2            ");
-            printf( "Sys image\n");
-
-            printf("GUIDs:           ");
-            for (u_int32_t i=0; i < GUIDS; i++) {
-                if ((i == 1 && numPorts < 1) ||
-                    (i == 2 && numPorts < 2)) {
-                    continue;
-                }
-                printf(GUID_FORMAT " ", fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l);
+        if (numPorts > 0) {
+            mac_indent = "                 ";
+        }
+    }
+    // MACS:
+    if (ethDev) {
+        if (fwInfo.fs2_info.guid_num == 6) {
+            if (!ibDev) {
+                printf("Description:%s    Port1            Port2\n", mac_indent);
+            } else if (fwInfo.fw_info.chip_type == CT_SWITCHX) {
+                printf("\nDescription:         Base             Switch\n");
+            } else {
+                printf("\n");
             }
-            if (numPorts > 0) {
-                mac_indent = "                 ";
+            printf("MACs:        %s       ", mac_indent);
+            for (u_int32_t i=GUIDS; i < 6; i++) {
+                printf("     " MAC_FORMAT , fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l);
             }
-        }
-        // MACS:
-        if (ethDev) {
-            if (fwInfo.fs2_info.guid_num == 6) {
-                if (!ibDev) {
-                    printf("Description:%s     Port1            Port2\n", mac_indent);
-                } else if (fwInfo.fw_info.chip_type == CT_SWITCHX) {
-                    printf("\nDescription:     Base             Switch\n");
-                } else {
-                    printf("\n");
-                }
-                printf("MACs:    %s       ", mac_indent);
-                for (u_int32_t i=GUIDS; i < 6; i++) {
-                    printf("     " MAC_FORMAT , fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l);
-                }
 
-                for (u_int32_t i=GUIDS; i < 6; i++) {
-                    u_int64_t mac = (((u_int64_t)fwInfo.fs2_info.guids[i].h) << 32) | fwInfo.fs2_info.guids[i].l;
-                    string warrStr;
-                    if (!fwInfo.fs2_info.blank_guids && !checkMac(mac, warrStr)) {
-                        if (i==GUIDS) printf("\n\n");
-                        printf(FLINT_BAD_MAC_ADRESS_WARNING, fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l, warrStr.c_str());
-                    }
+            for (u_int32_t i=GUIDS; i < 6; i++) {
+                u_int64_t mac = (((u_int64_t)fwInfo.fs2_info.guids[i].h) << 32) | fwInfo.fs2_info.guids[i].l;
+                string warrStr;
+                if (!fwInfo.fs2_info.blank_guids && !checkMac(mac, warrStr)) {
+                    if (i==GUIDS) printf("\n\n");
+                    printf(FLINT_BAD_MAC_ADRESS_WARNING, fwInfo.fs2_info.guids[i].h, fwInfo.fs2_info.guids[i].l, warrStr.c_str());
                 }
-            } else {
-                printf(FLINT_MAC_ENTRIES_WARNING, 6, fwInfo.fs2_info.guid_num);
             }
+        } else {
+            printf(FLINT_MAC_ENTRIES_WARNING, 6, fwInfo.fs2_info.guid_num);
         }
     }
+
     printf("\n");
     return true;
 }
 
 #define BASE_STR "Base"
 #define PRINT_FS3_UID(uid1, str, printStep) \
-    printf("%-16s %016"U64H_FMT_GEN"        %d", str, uid1.uid, uid1.num_allocated);\
+    printf("%-16s     %016" U64H_FMT_GEN "        %d", str, uid1.uid, uid1.num_allocated);\
     if (printStep) {\
-        printf("       %d", uid1.step);\
+        printf("          %d", uid1.step);\
     }\
     printf("\n");
-#define PRINT_FS3_UIDS(uid1, uid2, str, printStep) {\
-    	PRINT_FS3_UID(uid1, BASE_STR" "str":", printStep);\
-    if (uid1.uid !=  uid2.uid || uid1.num_allocated != uid2.num_allocated  || ( printStep && uid1.step != uid2.step)) {\
-        PRINT_FS3_UID(uid2, "Orig " BASE_STR " "str":", printStep);\
-    } \
+
+static inline void printFs3Uids(struct fs3_uid_entry uid, struct fs3_uid_entry orig_uid, string guidMac, bool printStep)
+{
+    string prefix = BASE_STR + string(" ") + guidMac + ":";
+    PRINT_FS3_UID(uid, prefix.c_str(), printStep);
+    if (uid.uid !=  orig_uid.uid || uid.num_allocated != orig_uid.num_allocated  || ( printStep && uid.step != orig_uid.step)) {
+        // Print MFG UIDs as well
+        prefix = "Orig " + prefix;
+        PRINT_FS3_UID(orig_uid, prefix.c_str(), printStep);
+    }
 }
 
 bool QuerySubCommand::displayFs3Uids(const fw_info_t& fwInfo)
 {
     if (fwInfo.fs3_info.fs3_uids_info.valid_field) {
         // new GUIDs format
-        printf("Description:     UID                GuidsNumber\n");
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cx4_uids.base_guid, fwInfo.fs3_info.orig_fs3_uids_info.cx4_uids.base_guid, "GUID", false);
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cx4_uids.base_mac, fwInfo.fs3_info.orig_fs3_uids_info.cx4_uids.base_mac, "MAC", false);
+        printf("Description:         UID                GuidsNumber\n");
+        printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cx4_uids.base_guid, fwInfo.fs3_info.orig_fs3_uids_info.cx4_uids.base_guid, "GUID", false);
+        printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cx4_uids.base_mac, fwInfo.fs3_info.orig_fs3_uids_info.cx4_uids.base_mac, "MAC", false);
     } else {
-        printf("Description:     UID                GuidsNumber  Step\n");
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cib_uids.guids[0], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.guids[0], "GUID1", true);
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cib_uids.guids[1], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.guids[1], "GUID2", true);
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cib_uids.macs[0], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.macs[0], "MAC1", true);
-        PRINT_FS3_UIDS(fwInfo.fs3_info.fs3_uids_info.cib_uids.macs[1], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.macs[1], "MAC2", true);
+        printf("Description:         UID                GuidsNumber  Step\n");
+        string firstGuid = (fwInfo.fw_info.chip_type != CT_SWITCH_IB) ? "GUID1" : "GUID";
+        string firstMac = (fwInfo.fw_info.chip_type != CT_SWITCH_IB) ? "MAC1" : "MAC";
+
+        printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cib_uids.guids[0], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.guids[0], firstGuid, true);
+        if (fwInfo.fw_info.chip_type != CT_SWITCH_IB) {
+            printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cib_uids.guids[1], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.guids[1], "GUID2", true);
+        }
+        printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cib_uids.macs[0], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.macs[0], firstMac, true);
+        if (fwInfo.fw_info.chip_type != CT_SWITCH_IB) {
+            printFs3Uids(fwInfo.fs3_info.fs3_uids_info.cib_uids.macs[1], fwInfo.fs3_info.orig_fs3_uids_info.cib_uids.macs[1], "MAC2", true);
+        }
     }
     return true;
 }
@@ -1896,60 +1733,95 @@ bool QuerySubCommand::displayFs3Uids(const fw_info_t& fwInfo)
 
 FlintStatus QuerySubCommand::printInfo(const fw_info_t& fwInfo, bool fullQuery)
 {
+    //char imageTypeStr[4] = {'\0', '\0', '\0', '\0'};
     bool isFs2 = (fwInfo.fw_type == FIT_FS2) ? true : false;
+    bool isFs3 = (fwInfo.fw_type == FIT_FS3) ? true : false;
+    bool isFs4 = (fwInfo.fw_type == FIT_FS4) ? true : false;
 
-    printf("Image type:      %s\n",(isFs2)? "FS2" : "FS3");
+    /*switch(fwInfo.fw_type){
+        case FIT_FS2:
+            snprintf(imageTypeStr, 4, "FS2");
+            break;
+        case FIT_FS3:
+            snprintf(imageTypeStr, 4, "FS3");
+            break;
+        case FIT_FS4:
+            snprintf(imageTypeStr, 4, "FS4");
+            break;
+    }*/
+    printf("Image type:          %s\n", isFs2 ? "FS2" : (isFs3 ? "FS3" : isFs4 ? "FS4" : "Unknown"));
 
     if (fwInfo.fw_info.fw_ver[0] || fwInfo.fw_info.fw_ver[1] || fwInfo.fw_info.fw_ver[2]) {
         char versionStr[64] = {0};
         snprintf(versionStr, 64, VERSION_FORMAT(fwInfo.fw_info.fw_ver[1]), fwInfo.fw_info.fw_ver[0], fwInfo.fw_info.fw_ver[1],
                 fwInfo.fw_info.fw_ver[2]);
-        printf("FW Version:      %s\n", versionStr);
+        printf("FW Version:          %s\n", versionStr);
+        if ((fwInfo.fw_info.running_fw_ver[0] || fwInfo.fw_info.running_fw_ver[1] || fwInfo.fw_info.running_fw_ver[2]) && \
+                (fwInfo.fw_info.running_fw_ver[0] != fwInfo.fw_info.fw_ver[0] || \
+                        fwInfo.fw_info.running_fw_ver[1] != fwInfo.fw_info.fw_ver[1] || \
+                        fwInfo.fw_info.running_fw_ver[2] != fwInfo.fw_info.fw_ver[2])) {
+            snprintf(versionStr, 64, VERSION_FORMAT(fwInfo.fw_info.running_fw_ver[1]), fwInfo.fw_info.running_fw_ver[0], fwInfo.fw_info.running_fw_ver[1],
+                    fwInfo.fw_info.running_fw_ver[2]);
+            printf("FW Version(Running): %s\n", versionStr);
+        }
     }
 
     if (fwInfo.fw_info.fw_rel_date[0] || fwInfo.fw_info.fw_rel_date[1] || fwInfo.fw_info.fw_rel_date[2]) {
-        printf("FW Release Date: %x.%x.%x\n", fwInfo.fw_info.fw_rel_date[0], fwInfo.fw_info.fw_rel_date[1],\
+        printf("FW Release Date:     %x.%x.%x\n", fwInfo.fw_info.fw_rel_date[0], fwInfo.fw_info.fw_rel_date[1],\
                 fwInfo.fw_info.fw_rel_date[2]);
     }
 
     if (fullQuery) { // there is no full query atm just quick query
         if (fwInfo.fw_info.min_fit_ver[0] || fwInfo.fw_info.min_fit_ver[1]\
                 || fwInfo.fw_info.min_fit_ver[2]||fwInfo.fw_info.min_fit_ver[3]) {
-            printf("Min FIT Version: %d.%d.%d.%d\n", fwInfo.fw_info.min_fit_ver[0],\
+            printf("Min FIT Version:     %d.%d.%d.%d\n", fwInfo.fw_info.min_fit_ver[0],\
                     fwInfo.fw_info.min_fit_ver[1], fwInfo.fw_info.min_fit_ver[2], fwInfo.fw_info.min_fit_ver[3]);
         }
         if ((fwInfo.fw_info.mic_ver[0] || fwInfo.fw_info.mic_ver[1] || fwInfo.fw_info.mic_ver[2])) {
-            printf("MIC Version:     %d.%d.%d\n", fwInfo.fw_info.mic_ver[0],\
+            printf("MIC Version:         %d.%d.%d\n", fwInfo.fw_info.mic_ver[0],\
                     fwInfo.fw_info.mic_ver[1], fwInfo.fw_info.mic_ver[2]);
         }
         if (isFs2) {
             if (fwInfo.fs2_info.config_sectors) {
-                printf("Config Sectors:  %d\n", fwInfo.fs2_info.config_sectors);
+                printf("Config Sectors:      %d\n", fwInfo.fs2_info.config_sectors);
             }
             if (fwInfo.fs2_info.config_pad) {
-                    printf("Config Pad:      %d\n", fwInfo.fs2_info.config_pad);
+                    printf("Config Pad:          %d\n", fwInfo.fs2_info.config_pad);
             }
             if (strlen(fwInfo.fs2_info.prs_name)) {
-                printf("PRS Name:        %s\n", fwInfo.fs2_info.prs_name);
+                printf("PRS Name:            %s\n", fwInfo.fs2_info.prs_name);
+            }
+        } else { // FS3
+            if (strlen(fwInfo.fs3_info.prs_name)) {
+                printf("PRS Name:            %s\n", fwInfo.fs3_info.prs_name);
+            }
+            if (strlen(fwInfo.fs3_info.orig_prs_name)) {
+                printf("Orig PRS Name:       %s\n", fwInfo.fs3_info.orig_prs_name);
+            }
+            if (strlen(fwInfo.fs3_info.name)) {
+                printf("Part Number:         %s\n", fwInfo.fs3_info.name);
+            }
+            if (strlen(fwInfo.fs3_info.description)) {
+                printf("Description:         %s\n", fwInfo.fs3_info.description);
             }
         }
     }
 
     if (strlen(fwInfo.fw_info.product_ver)) {
-        printf("Product Version: %s\n", fwInfo.fw_info.product_ver);
+        printf("Product Version:     %s\n", fwInfo.fw_info.product_ver);
     }
 
     if (fwInfo.fw_info.roms_info.exp_rom_found) {
-        displayExpRomInfo(fwInfo.fw_info.roms_info, "Rom Info:        ");
+        displayExpRomInfo(fwInfo.fw_info.roms_info, "Rom Info:            ");
     }
 
     if (isFs2)
     {
-        printf("Device ID:       %d\n", fwInfo.fw_info.dev_type);
+        printf("Device ID:           %d\n", fwInfo.fw_info.dev_type);
     }
 
     if (isFs2 && fwInfo.fs2_info.access_key_exists) {
-        printf("HW Access Key:   ");
+        printf("HW Access Key:       ");
         if (fwInfo.fs2_info.access_key_value.l || fwInfo.fs2_info.access_key_value.h) {
             printf("Enabled\n");
         } else {
@@ -1970,15 +1842,15 @@ FlintStatus QuerySubCommand::printInfo(const fw_info_t& fwInfo, bool fullQuery)
     // VSD, PSID
     if (!fwInfo.fw_info.vsd_vendor_id || fwInfo.fw_info.vsd_vendor_id == MELLANOX_VENDOR_ID) {
         if (!isFs2) {
-            printf("Image VSD:       %s\n", fwInfo.fs3_info.image_vsd);
-            printf("Device VSD:      %s\n", fwInfo.fw_info.vsd);
-            printf("PSID:            %s\n", fwInfo.fw_info.psid);
+            printf("Image VSD:           %s\n", fwInfo.fs3_info.image_vsd);
+            printf("Device VSD:          %s\n", fwInfo.fw_info.vsd);
+            printf("PSID:                %s\n", fwInfo.fw_info.psid);
             if (strncmp(fwInfo.fw_info.psid, fwInfo.fs3_info.orig_psid, 13) != 0) {
-                printf("Orig PSID:       %s\n", fwInfo.fs3_info.orig_psid);
+                printf("Orig PSID:           %s\n", fwInfo.fs3_info.orig_psid);
             }
         } else {
-            printf("VSD:             %s\n", fwInfo.fw_info.vsd);
-            printf("PSID:            %s\n", fwInfo.fw_info.psid);
+            printf("VSD:                 %s\n", fwInfo.fw_info.vsd);
+            printf("PSID:                %s\n", fwInfo.fw_info.psid);
         }
     } else {
         printf(FLINT_NOT_MLNX_FW_WARNING, fwInfo.fw_info.vsd_vendor_id);
@@ -1996,12 +1868,12 @@ QuerySubCommand:: QuerySubCommand()
     _desc = "Query misc. flash/firmware characteristics, use \"full\"\n"
             INDENT"to get more information.";
     _extendedDesc = "Query miscellaneous FW and flash parameters \n"
-                INDENTEX"Display FW Version, GUIDs, PSID, and other info";
+                INDENTEX "Display FW Version, GUIDs, PSID, and other info";
     _flagLong = "query";
     _flagShort = "q";
     _param = "[full]";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" query";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " query";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
     _cmdType = SC_Query;
@@ -2050,7 +1922,7 @@ VerifySubCommand:: VerifySubCommand()
     _flagShort = "v";
     _param = "[showitoc]";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" v";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " v";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
     _cmdType = SC_Verify;
@@ -2122,7 +1994,7 @@ SwResetSubCommand:: SwResetSubCommand() {
     _desc = "SW reset the target un-managed switch device. This command\n"
             INDENT"is supported only in the In-Band access method.";
     _extendedDesc = "SW reset the target un-managed switch device. This command\n"
-                INDENTEX"is supported only in the In-Band access method.";
+                INDENTEX "is supported only in the In-Band access method.";
     _flagLong = "swreset";
     _flagShort = "";
     _param = "";
@@ -2171,10 +2043,11 @@ BromSubCommand:: BromSubCommand()
     _flagShort = "";
     _param = "<ROM-file>";
     _paramExp = "file: The exp-ROM file.";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" brom exp-rom.rom";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " brom exp-rom.rom";
     _v = Wtv_Dev_Or_Img;
     _cmdType = SC_Brom;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     memset(&_info, 0, sizeof(_info));
     memset(&_romsInfo, 0, sizeof(_romsInfo));
 }
@@ -2185,14 +2058,6 @@ BromSubCommand:: ~BromSubCommand()
     _fRom.close();
 }
 
-bool BromSubCommand::verifyParams() {
-    if (_flintParams.cmd_params.size() != 1) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 1, (int)_flintParams.cmd_params.size());
-        return false;
-    }
-    return true;
-}
-
 
 bool BromSubCommand::getExpRomStrVer(roms_info_t& roms_info, char* version) {
     if (roms_info.rom_info[0].exp_rom_product_id >= 0x10) {
@@ -2284,7 +2149,7 @@ DromSubCommand:: DromSubCommand()
     _flagShort = "";
     _param = "";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" drom";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " drom";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 0;
     _cmdType = SC_Drom;
@@ -2333,9 +2198,10 @@ RromSubCommand:: RromSubCommand()
     _flagShort = "";
     _param = "<out-file>";
     _paramExp = "file: filename to write the exp-ROM to.";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" rrom exp-rom.rom";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " rrom exp-rom.rom";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     _cmdType = SC_Rrom;
 }
 
@@ -2346,10 +2212,6 @@ RromSubCommand:: ~RromSubCommand()
 
 bool RromSubCommand::verifyParams()
 {
-    if (_flintParams.cmd_params.size() != 1) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 1, (int)_flintParams.cmd_params.size());
-        return false;
-    }
     FILE * file;
     if ((file = fopen(_flintParams.cmd_params[0].c_str(), "r")) != NULL) {
         fclose(file);
@@ -2391,12 +2253,12 @@ BbSubCommand:: BbSubCommand()
     _name = "bb";
     _desc = "Burn Block - Burns the given image as is. No checks are done.";
     _extendedDesc = "Burns entire flash verbatim from raw binary image. No checks are done on the flash or\n"
-                INDENTEX"on the given image file. No fields (such as VSD or Guids) are read from flash.";
+                INDENTEX "on the given image file. No fields (such as VSD or Guids) are read from flash.";
     _flagLong = "bb";
     _flagShort = "";
     _param = "";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" -i image1.bin bb";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " -i image1.bin bb";
     _v = Wtv_Dev_And_Img;
     _maxCmdParamNum = 0;
     _cmdType = SC_Bb;
@@ -2454,23 +2316,23 @@ SgSubCommand:: SgSubCommand()
     _name = "sg";
     _desc = "Set GUIDs.";
     _extendedDesc = "Set GUIDs/MACs/UIDs in the given device/image.\n"
-                INDENTEX"Use -guid(s), -mac(s) and -uid(s) flags to set the desired values.\n"
-                INDENTEX"- On pre-ConnectX devices, the sg command  is used in production to apply GUIDs/MACs values\n"
-                INDENTEX"to cards that were pre-burnt with blank GUIDs. It is not meant for\n"
-                INDENTEX"use in field.\n"
-                INDENTEX"- On 4th generation devices, this command can operate on both image file and image on flash.\n"
-                INDENTEX"If the GUIDs/MACs/UIDs in the image on flash are non-blank,\n"
-                INDENTEX"flint will re-burn the current image using the given GUIDs/MACs/UIDs.";
+                INDENTEX "Use -guid(s), -mac(s) and -uid(s) flags to set the desired values.\n"
+                INDENTEX "- On pre-ConnectX devices, the sg command  is used in production to apply GUIDs/MACs values\n"
+                INDENTEX "to cards that were pre-burnt with blank GUIDs. It is not meant for\n"
+                INDENTEX "use in field.\n"
+                INDENTEX "- On 4th generation devices, this command can operate on both image file and image on flash.\n"
+                INDENTEX "If the GUIDs/MACs/UIDs in the image on flash are non-blank,\n"
+                INDENTEX "flint will re-burn the current image using the given GUIDs/MACs/UIDs.";
     _flagLong = "sg";
     _flagShort = "";
     _param = "[guids_num=<num|num_port1,num_port2> step_size=<size|size_port1,size_port2>] | [nocrc]";
     _paramExp = "nocrc: (optional) When specified the flint would not update\n"
-                INDENTEX"the full image crc after changing the guids\n"
-                INDENTEX"guids_num: (optional) number of GUIDs to be allocated per physical port (FS3 Only)\n"
-                INDENTEX"step_size: (optional) step size between GUIDs (FS3 Only)\n"
-                INDENTEX"Note: guids_num/step_size values can be specified per port or for both ports";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" -guid 0x0002c9000100d050 sg"
-  "\n"INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE4" -guid 0x0002c9000100d050 -mac 0x0002c900d050 sg";
+                INDENTEX "the full image crc after changing the guids\n"
+                INDENTEX "guids_num: (optional) number of GUIDs to be allocated per physical port (FS3 Only)\n"
+                INDENTEX "step_size: (optional) step size between GUIDs (FS3 Only)\n"
+                INDENTEX "Note: guids_num/step_size values can be specified per port or for both ports";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " -guid 0x0002c9000100d050 sg"
+  "\n" INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE4 " -guid 0x0002c9000100d050 -mac 0x0002c900d050 sg";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 2;
     _cmdType = SC_Sg;
@@ -2501,17 +2363,17 @@ bool SgSubCommand::verifyParams()
         return false;
     }
     if (!(_flintParams.guid_specified || _flintParams.guids_specified ||\
-            _flintParams.uid_specified || _flintParams.uids_specified || \
+            _flintParams.uid_specified || \
             _flintParams.mac_specified || _flintParams.macs_specified)){
-        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "GUIDs / MACs (using command line flags -guid(s) / -mac(s) )");
+        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "GUIDs / MACs / UID (using command line flags -guid(s) / -mac(s) / -uid )");
         return false;
     }
-    if ((_flintParams.guid_specified || _flintParams.guids_specified) && (_flintParams.uid_specified || _flintParams.uids_specified)) {
-        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either GUIDs / UIDs (using command line flags -guid(s) / -uid(s) )");
+    if ((_flintParams.guid_specified || _flintParams.guids_specified) && (_flintParams.uid_specified)) {
+        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either GUIDs / UIDs (using command line flags -guid(s) / -uid )");
         return false;
     }
-    if ((_flintParams.mac_specified || _flintParams.macs_specified) && (_flintParams.uid_specified || _flintParams.uids_specified)) {
-        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either MACs / UIDs (using command line flags -mac(s) / -uid(s) )");
+    if ((_flintParams.mac_specified || _flintParams.macs_specified) && (_flintParams.uid_specified)) {
+        reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "either MACs / UIDs (using command line flags -mac(s) / -uid )");
         return false;
     }
     if (_flintParams.guid_specified && _flintParams.guids_specified) {
@@ -2522,14 +2384,10 @@ bool SgSubCommand::verifyParams()
         reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR, "-macs", "-mac" );
         return false;
     }
-    if (_flintParams.uid_specified && _flintParams.uids_specified) {
-        reportErr(true, FLINT_INVALID_FLAG_WITH_FLAG_ERROR, "-uids", "-uid" );
-        return false;
-    }
 
     _sgParams.guidsSpecified = _flintParams.guid_specified || _flintParams.guids_specified;
     _sgParams.macsSpecified = _flintParams.mac_specified || _flintParams.macs_specified;
-    _sgParams.uidsSpecified = _flintParams.uid_specified || _flintParams.uids_specified;
+    _sgParams.uidSpecified = _flintParams.uid_specified;
     _sgParams.updateCrc = !(_flintParams.cmd_params.size() == 1);
     _sgParams.stripedImage = _flintParams.striped_image;
     return true;
@@ -2553,8 +2411,9 @@ void SgSubCommand::setUserGuidsAndMacs()
         _sgParams.userGuids.push_back(_flintParams.user_macs[0]);
         _sgParams.userGuids.push_back(_flintParams.user_macs[1]);
     }
-    if (_sgParams.uidsSpecified) {
-        _sgParams.userGuids = _flintParams.user_uids;
+    if (_sgParams.uidSpecified) {
+        _sgParams.userGuids.resize(0);
+        _sgParams.userGuids.push_back(_flintParams.baseUid);
     }
     _sgParams.userGuids.resize(MAX_GUIDS);
 }
@@ -2563,18 +2422,17 @@ bool SgSubCommand::CheckSetGuidsFlags()
 {
     bool ibDev;
     bool ethDev;
-    bool bxDev = _info.fw_info.chip_type == CT_BRIDGEX;
     FwOperations::SetDevFlags(_info.fw_info.chip_type, _info.fw_info.dev_type, (fw_img_type)_info.fw_type, ibDev, ethDev);
     //setDevFlags(_info, ibDev,ethDev);
 
-    if (_sgParams.macsSpecified || _sgParams.guidsSpecified || _sgParams.uidsSpecified) {
-        if (!checkGuidsFlags((chip_type_t)_info.fw_info.chip_type, _info.fw_info.dev_type,_info.fw_type,\
-                _sgParams.guidsSpecified, _sgParams.macsSpecified, _sgParams.uidsSpecified, ibDev, ethDev)) {
+    if (_sgParams.macsSpecified || _sgParams.guidsSpecified || _sgParams.uidSpecified) {
+        if (!checkGuidsFlags(_info.fw_info.dev_type,_info.fw_type,\
+                _sgParams.guidsSpecified, _sgParams.macsSpecified, _sgParams.uidSpecified, ibDev, ethDev)) {
             return false;
         }
     } else {
         printf("-E- ");
-        printMissingGuidErr(ibDev, ethDev, bxDev);
+        printMissingGuidErr(ibDev, ethDev);
         printf("\n");
         return false;
     }
@@ -2603,15 +2461,14 @@ FlintStatus SgSubCommand::sgFs2()
         //report guid changes
         bool ethDev;
         bool ibDev;
-        bool bxDev = _info.fw_info.chip_type == CT_BRIDGEX;
         FwOperations::SetDevFlags(_info.fw_info.chip_type, _info.fw_info.dev_type, (fw_img_type)_info.fw_type, ibDev, ethDev);
         //setDevFlags(_info, ibDev, ethDev);
         //decide what are our new guids/macs
-        guid_t *new_guids = (_sgParams.guidsSpecified ||_sgParams.uidsSpecified) ? & _sgParams.userGuids[0] : &_info.fs2_info.guids[0] ;
+        guid_t *new_guids = (_sgParams.guidsSpecified ||_sgParams.uidSpecified) ? & _sgParams.userGuids[0] : &_info.fs2_info.guids[0] ;
         guid_t *new_macs =  _sgParams.macsSpecified ? &_sgParams.userGuids[GUIDS] : &_info.fs2_info.guids[GUIDS] ;
 
         if (!reportGuidChanges(new_guids, new_macs, &_info.fs2_info.guids[0], &_info.fs2_info.guids[GUIDS], ibDev,\
-                ethDev, bxDev, _info.fs2_info.guid_num)){
+                ethDev, _info.fs2_info.guid_num)){
             return FLINT_FAILED;
         }
     }
@@ -2634,7 +2491,7 @@ FlintStatus SgSubCommand::sgFs3()
     }
 
     // TODO: create method that checks the flags for FS3/FS2
-    if (_info.fw_info.chip_type == CT_CONNECT_IB || _info.fw_info.chip_type == CT_SWITCH_IB) {
+    if (_info.fw_info.chip_type == CT_CONNECT_IB || _info.fw_info.chip_type == CT_SWITCH_IB || _info.fw_info.chip_type == CT_SWITCH_IB2) {
         if (!_flintParams.uid_specified) {
             reportErr(true, FLINT_NO_UID_FLAG_ERROR);
             return FLINT_FAILED;
@@ -2692,18 +2549,18 @@ SmgSubCommand:: SmgSubCommand()
     _name = "smg";
     _desc = "Set manufacture GUIDs (For FS3 image only).";
     _extendedDesc = "Set manufacture GUID, Set manufacture GUIDs in the given FS3 image.\n"
-                INDENTEX"Use -uid flag to set the desired GUIDs, intended for production use only.";
+                INDENTEX "Use -uid flag to set the desired GUIDs, intended for production use only.";
     _flagLong = "smg";
     _flagShort = "";
     _param = "[guids_num=<num|num_port1,num_port2> step_size=<size|size_port1,size_port2>]";
     _paramExp = "guids_num: (optional) number of GUIDs to be allocated per physical port\n"
-                INDENTEX"step_size: (optional) step size between GUIDs\n"
-                INDENTEX"Note: guids_num/step_size values can be specified per port or for both ports";
-    _example = FLINT_NAME" -i fw_image.bin -uid 0x0002c9000100d050 smg"
+                INDENTEX "step_size: (optional) step size between GUIDs\n"
+                INDENTEX "Note: guids_num/step_size values can be specified per port or for both ports";
+    _example = FLINT_NAME " -i fw_image.bin -uid 0x0002c9000100d050 smg"
 #ifndef __WIN__
-    		"\n"INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE3" -uid 0x0002c9000100d050 smg (should be used when device is idle)"
+    		"\n" INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE3 " -uid 0x0002c9000100d050 smg (should be used when device is idle)"
 #endif
-    		"\n"INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE4" -guid 0x0002c9000100d050 -mac 0x0002c900d050 smg (should be used when device is idle)";
+    		"\n" INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE4 " -guid 0x0002c9000100d050 -mac 0x0002c900d050 smg (should be used when device is idle)";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 2;
     _cmdType = SC_Smg;
@@ -2726,10 +2583,6 @@ bool SmgSubCommand::verifyParams()
         reportErr(true, FLINT_COMMAND_FLAGS_ERROR, _name.c_str(), "\"-uid or -guid/-mac\" flags");
         return false;
     }
-    if (_flintParams.uids_specified) {
-        reportErr(true, FLINT_INVALID_OPTION_ERROR, "\"-uids\"", _name.c_str(), "\"-uid\"");
-        return false;
-    }
     if (_flintParams.guids_specified) {
         reportErr(true, FLINT_INVALID_OPTION_ERROR, "\"-guids\"", _name.c_str(), "\"-guid\"");
         return false;
@@ -2783,7 +2636,7 @@ FlintStatus SmgSubCommand::executeCommand()
          return FLINT_FAILED;
      }
 
-     if (_info.fw_info.chip_type == CT_CONNECT_IB || _info.fw_info.chip_type == CT_SWITCH_IB) {
+     if (_info.fw_info.chip_type == CT_CONNECT_IB || _info.fw_info.chip_type == CT_SWITCH_IB || _info.fw_info.chip_type == CT_SWITCH_IB2) {
          if (!_flintParams.uid_specified) {
          reportErr(true, "Can not set GUIDs/MACs: uid is not specified, please run with -uid flag.\n");
          return FLINT_FAILED;
@@ -2816,13 +2669,14 @@ SetVpdSubCommand:: SetVpdSubCommand()
     _flagShort = "";
     _param = "[vpd file]";
     _paramExp = "vpd file: bin file containing the vpd data";
-    _example = FLINT_NAME" -i fw_image.bin set_vpd vpd.bin"
+    _example = FLINT_NAME " -i fw_image.bin set_vpd vpd.bin"
 #ifndef __WIN__
-    			"\n"INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE3" -override_cache_replacement set_vpd vpd.bin (should be used when device is idle)"
+    			"\n" INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE3 " -override_cache_replacement set_vpd vpd.bin (should be used when device is idle)"
 #endif
     			;
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     _cmdType = SC_Set_Vpd;
 }
 
@@ -2831,15 +2685,6 @@ SetVpdSubCommand:: ~SetVpdSubCommand()
 
 }
 
-bool SetVpdSubCommand:: verifyParams()
-{
-    if( _flintParams.cmd_params.size() != 1) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR, _name.c_str(), 1, (int)_flintParams.cmd_params.size());
-        return false;
-    }
-    return true;
-}
-
 FlintStatus SetVpdSubCommand:: executeCommand()
 {
     if (preFwOps() == FLINT_FAILED) {
@@ -2861,14 +2706,14 @@ SvSubCommand:: SvSubCommand()
     _name = "sv";
     _desc = "Set the VSD.";
     _extendedDesc = "Set VSD in the given device/image.\n"
-                INDENTEX"Use -vsd flag to set the desired VSD string.";
+                INDENTEX "Use -vsd flag to set the desired VSD string.";
     _flagLong = "sv";
     _flagShort = "";
     _param = "";
     _paramExp = "None";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" -vsd VSD_STRING sv"
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " -vsd VSD_STRING sv"
 #ifndef __WIN__
-    		"\n"INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE3" -vsd VSD_STRING -override_cache_replacement sv (should be used when device is idle)\n"
+    		"\n" INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE3 " -vsd VSD_STRING -override_cache_replacement sv (should be used when device is idle)\n"
 #endif
     		;
     _v = Wtv_Dev_Or_Img;
@@ -2924,9 +2769,10 @@ RiSubCommand:: RiSubCommand()
     _flagShort = "";
     _param = "<out-file>";
     _paramExp = "file: filename to write the image to (raw binary).";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" ri file.bin";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " ri file.bin";
     _v = Wtv_Dev;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     _cmdType = SC_Ri;
 }
 
@@ -2935,14 +2781,6 @@ RiSubCommand:: ~RiSubCommand()
 
 }
 
-bool RiSubCommand::verifyParams() {
-    if (_flintParams.cmd_params.size() != 1) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 1, (int)_flintParams.cmd_params.size());
-        return false;
-    }
-    return true;
-}
-
 FlintStatus RiSubCommand::executeCommand() {
     //init fw operation object
     if (preFwOps() == FLINT_FAILED) {
@@ -2996,14 +2834,14 @@ DcSubCommand:: DcSubCommand() {
     _name = "dc";
     _desc = "Dump Configuration: print fw configuration file for the given image.";
     _extendedDesc = "Print (to screen or to a file) the FW configuration text file used by the image generation process.\n"
-                INDENTEX"This command would fail if the image does not contain a FW configuration section. Existence of this\n"
-                INDENTEX"section depends on the version of the image generation tool.";
+                INDENTEX "This command would fail if the image does not contain a FW configuration section. Existence of this\n"
+                INDENTEX "section depends on the version of the image generation tool.";
     _flagLong = "dc";
     _flagShort = "";
     _param = "[out-file]";
     _paramExp = "file: (optional) filename to write the dumped configuration to. If not given, the data\n"
-                INDENTEX"is printed to screen";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" dc";
+                INDENTEX "is printed to screen";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " dc";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
     _cmdType = SC_Dc;
@@ -3048,13 +2886,13 @@ DhSubCommand:: DhSubCommand()
     _name = "dh";
     _desc = "Dump Hash: dump the hash if it is integrated in the FW image";
     _extendedDesc = "Print (to screen or to a file) the HASH text file used by the FW.\n"
-                INDENTEX"This command would fail if the image does not contain a Hash file.";
+                INDENTEX "This command would fail if the image does not contain a Hash file.";
     _flagLong = "dh";
     _flagShort = "";
     _param = "[out-file]";
     _paramExp = "file - (optional) filename to write the dumped tracer hash file to. If not given, the data\n"
-                INDENTEX"is printed to screen";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" dh hash.csv";
+                INDENTEX "is printed to screen";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " dh hash.csv";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
     _cmdType = SC_Dh;
@@ -3107,7 +2945,7 @@ SetKeySubCommand:: SetKeySubCommand()
     _flagShort = "";
     _param = "[key]";
     _paramExp = "key: (optional) The new key you intend to set (in hex).";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" set_key 1234deaf5678";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " set_key 1234deaf5678";
     _v = Wtv_Dev;
     _maxCmdParamNum = 1;
     _cmdType = SC_Set_Key;
@@ -3198,10 +3036,10 @@ HwAccessSubCommand:: HwAccessSubCommand()
     _flagShort = "";
     _param = "<enable|disable> [key]";
     _paramExp = "<enable/disable>: Specify if you intend to disable or enable the HW access.\n"
-                INDENTEX"                   You will be asked to type a key when you try to enable HW access.\n"
-                INDENTEX"key:               (optional) The key you intend to use for enabling the HW access.\n"
-    			INDENTEX"                   Key format consists of at most 16 Hexadecimal digits.";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" hw_access enable";
+                INDENTEX "                   You will be asked to type a key when you try to enable HW access.\n"
+                INDENTEX "key:               (optional) The key you intend to use for enabling the HW access.\n"
+    			INDENTEX "                   Key format consists of at most 16 Hexadecimal digits.";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " hw_access enable";
     _v = Wtv_Dev;
     _maxCmdParamNum = 2;
     _cmdType = SC_Hw_Access;
@@ -3296,15 +3134,15 @@ HwSubCommand:: HwSubCommand()
     _flagShort = "";
     _param = "<query|set> [ATTR=VAL]";
     _paramExp = "query: query HW info\n"
-       INDENTEX"set [ATTR=VAL]: set flash attribure\n"
-       INDENTEX"Supported attributes:\n"
-       INDENTEX"    QuadEn: can be 0 or 1\n"
-       INDENTEX"    DummyCycles: can be [1..15]\n"
-       INDENTEX"    Flash[0|1|2|3].WriteProtected can be:\n"
-       INDENTEX"        <Top|Bottom>,<1|2|4|8|16|32|64>-<Sectors|SubSectors>";
-    _example = "flint -d "MST_DEV_EXAMPLE1" hw query\n"
-            INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE1" hw set QuadEn=1\n"
-            INDENTEX FLINT_NAME" -d "MST_DEV_EXAMPLE1" hw set Flash1.WriteProtected=Top,1-SubSectors";
+       INDENTEX "set [ATTR=VAL]: set flash attribure\n"
+       INDENTEX "Supported attributes:\n"
+       INDENTEX "    QuadEn: can be 0 or 1\n"
+       INDENTEX "    DummyCycles: can be [1..15]\n"
+       INDENTEX "    Flash[0|1|2|3].WriteProtected can be:\n"
+       INDENTEX "        <Top|Bottom>,<1|2|4|8|16|32|64>-<Sectors|SubSectors>";
+    _example = "flint -d " MST_DEV_EXAMPLE1 " hw query\n"
+            INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE1 " hw set QuadEn=1\n"
+            INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE1 " hw set Flash1.WriteProtected=Top,1-SubSectors";
 #else
     _name = "Hw";
     _desc = "Query HW info and flash attributes.";
@@ -3313,10 +3151,11 @@ HwSubCommand:: HwSubCommand()
     _flagShort = "";
     _param = "query";
     _paramExp = "query";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" hw query";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " hw query";
 #endif
     _v = Wtv_Dev;
     _maxCmdParamNum = 2;
+    _minCmdParamNum = 1;
     _cmdType = SC_Hw;
 }
 
@@ -3374,15 +3213,15 @@ FlintStatus HwSubCommand::printAttr(const ext_flash_attr_t& attr) {
     if (attr.quad_en_support) {
         switch (attr.mf_get_quad_en_rc) {
             case MFE_OK:
-                printf("  "QUAD_EN_PARAM"                %d\n", attr.quad_en);
+                printf("  " QUAD_EN_PARAM "                %d\n", attr.quad_en);
                 break;
             case MFE_MISMATCH_PARAM:
-                printf("-E- There is a mismatch in the "QUAD_EN_PARAM" attribute between the flashes attached to the device\n");
+                printf("-E- There is a mismatch in the " QUAD_EN_PARAM " attribute between the flashes attached to the device\n");
                 break;
             case MFE_NOT_SUPPORTED_OPERATION:
                 break;
             default:
-                printf("Failed to get "QUAD_EN_PARAM" attribute: %s (%s)",\
+                printf("Failed to get " QUAD_EN_PARAM " attribute: %s (%s)",\
                         errno == 0 ? "" : strerror(errno), mf_err2str(attr.mf_get_quad_en_rc));
                 return FLINT_FAILED;
         }
@@ -3391,15 +3230,15 @@ FlintStatus HwSubCommand::printAttr(const ext_flash_attr_t& attr) {
     if (attr.dummy_cycles_support) {
         switch (attr.mf_get_dummy_cycles_rc) {
             case MFE_OK:
-                printf("  "DUMMY_CYCLES_PARAM"           %d\n", attr.dummy_cycles);
+                printf("  " DUMMY_CYCLES_PARAM "           %d\n", attr.dummy_cycles);
                 break;
             case MFE_MISMATCH_PARAM:
-                printf("-E- There is a mismatch in the "DUMMY_CYCLES_PARAM" attribute between the flashes attached to the device\n");
+                printf("-E- There is a mismatch in the " DUMMY_CYCLES_PARAM " attribute between the flashes attached to the device\n");
                 break;
             case MFE_NOT_SUPPORTED_OPERATION:
                 break;
             default:
-                printf("Failed to get "DUMMY_CYCLES_PARAM" attribute: %s (%s)",\
+                printf("Failed to get " DUMMY_CYCLES_PARAM " attribute: %s (%s)",\
                         errno == 0 ? "" : strerror(errno), mf_err2str(attr.mf_get_dummy_cycles_rc));
                 return FLINT_FAILED;
         }
@@ -3412,7 +3251,7 @@ FlintStatus HwSubCommand::printAttr(const ext_flash_attr_t& attr) {
             write_protect_info_t protect_info = attr.protect_info_array[bank];
             rc = attr.mf_get_write_protect_rc_array[bank];
             if (rc == MFE_OK) {
-                printf("  "FLASH_NAME"%d."WRITE_PROTECT"   ", bank);
+                printf("  " FLASH_NAME "%d." WRITE_PROTECT "   ", bank);
                 if (protect_info.sectors_num != 0) {
                     printf("%s,", (protect_info.is_bottom ? WP_BOTTOM_STR : WP_TOP_STR));
                     printf("%d-", protect_info.sectors_num);
@@ -3491,9 +3330,10 @@ EraseSubCommand:: EraseSubCommand()
     _flagShort = "e";
     _param = "<addr>";
     _paramExp = "addr - address of word in sector that you want to erase.";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" erase 0x10000";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " erase 0x10000";
     _v = Wtv_Dev;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     _cmdType = SC_Erase;
 }
 
@@ -3502,15 +3342,6 @@ EraseSubCommand:: ~EraseSubCommand()
 
 }
 
-bool EraseSubCommand::verifyParams() {
-    if (_flintParams.cmd_params.size() != 1) {
-        reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 1, (int)_flintParams.cmd_params.size());
-        return false;
-    }
-    //parameter format will be checked in executeCommand.
-    return true;
-}
-
 FlintStatus EraseSubCommand::executeCommand() {
     if (preFwAccess() == FLINT_FAILED) {
         return FLINT_FAILED;
@@ -3545,9 +3376,10 @@ RwSubCommand:: RwSubCommand() {
     _flagShort = "";
     _param = "<addr>";
     _paramExp = "addr - address of word to read";
-    _example = "flint -d "MST_DEV_EXAMPLE1" rw 0x20";
+    _example = "flint -d " MST_DEV_EXAMPLE1 " rw 0x20";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 1;
+    _minCmdParamNum = 1;
     _cmdType = SC_Rw;
 }
 
@@ -3555,14 +3387,6 @@ RwSubCommand:: ~RwSubCommand() {
 
 }
 
-bool RwSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() != 1) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 1, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 FlintStatus RwSubCommand::executeCommand() {
     if (preFwAccess() == FLINT_FAILED) {
         return FLINT_FAILED;
@@ -3595,17 +3419,18 @@ WwSubCommand:: WwSubCommand()
     _name = "ww";
     _desc = "Write one dword to flash";
     _extendedDesc = "Write one dword to flash.\n"
-                INDENTEX"Note that the utility will read an entire flash sector,\n"
-                INDENTEX"modify one word and write the sector back. This may take\n"
-                INDENTEX"a few seconds.";
+                INDENTEX "Note that the utility will read an entire flash sector,\n"
+                INDENTEX "modify one word and write the sector back. This may take\n"
+                INDENTEX "a few seconds.";
     _flagLong = "ww";
     _flagShort = "";
     _param = "<addr> <data>";
     _paramExp = "addr - address of word\n"
-                INDENTEX"data - value of word";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" ww 0x10008 0x5a445a44";
+                INDENTEX "data - value of word";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " ww 0x10008 0x5a445a44";
     _v = Wtv_Dev;
     _maxCmdParamNum = 2;
+    _minCmdParamNum = 2;
     _cmdType = SC_Ww;
 }
 
@@ -3614,14 +3439,6 @@ WwSubCommand:: ~WwSubCommand()
 
 }
 
-bool WwSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() != 2) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 2, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 FlintStatus WwSubCommand::executeCommand() {
     //init fw operation object
     if (preFwAccess() == FLINT_FAILED) {
@@ -3663,18 +3480,19 @@ WwneSubCommand:: WwneSubCommand()
     _name = "wwne";
     _desc = "Write one dword to flash without sector erase";
     _extendedDesc = "Write one dword to flash without sector erase.\n"
-                INDENTEX"Note that the result of operation is undefined and depends\n"
-                INDENTEX"on flash type. Usually \"bitwise AND\" (&) between specified\n"
-                INDENTEX"word and previous flash contents will be written to\n"
-                INDENTEX"specified address.";
+                INDENTEX "Note that the result of operation is undefined and depends\n"
+                INDENTEX "on flash type. Usually \"bitwise AND\" (&) between specified\n"
+                INDENTEX "word and previous flash contents will be written to\n"
+                INDENTEX "specified address.";
     _flagLong = "wwne";
     _flagShort = "";
     _param = "<addr> <data>";
     _paramExp = "addr - address of word\n"
-                INDENTEX"data - value of word";
-    _example = "flint -d "MST_DEV_EXAMPLE1" wwne 0x10008 0x5a445a44";
+                INDENTEX "data - value of word";
+    _example = "flint -d " MST_DEV_EXAMPLE1 " wwne 0x10008 0x5a445a44";
     _v = Wtv_Dev;
     _maxCmdParamNum = 2;
+    _minCmdParamNum = 2;
     _cmdType = SC_Wwne;
 }
 
@@ -3683,14 +3501,6 @@ WwneSubCommand:: ~WwneSubCommand()
 
 }
 
-bool WwneSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() != 2) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 2, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 FlintStatus WwneSubCommand::executeCommand() {
     //init fw operation object
     if (preFwAccess() == FLINT_FAILED) {
@@ -3736,11 +3546,12 @@ WbSubCommand:: WbSubCommand() {
     _flagShort = "";
     _param = "<data-file> <addr>";
     _paramExp = "data-file - file that contains the data to be written\n"
-                INDENTEX"addr - address to write the block to\n";
+                INDENTEX "addr - address to write the block to\n";
 
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" wb myData.bin 0x0";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " wb myData.bin 0x0";
     _v = Wtv_Dev;
     _maxCmdParamNum = 2;
+    _minCmdParamNum = 2;
     _cmdType = SC_Wb;
 }
 
@@ -3748,14 +3559,6 @@ WbSubCommand:: ~WbSubCommand() {
 
 }
 
-bool WbSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() != 2) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR,_name.c_str() , 2, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 bool WbSubCommand::extractData(const std::vector<string>& cmdParams , u_int32_t* addr, std::vector<u_int8_t>& data) {
     // get address
     char *endp;
@@ -3809,11 +3612,11 @@ WbneSubCommand:: WbneSubCommand() {
     _flagShort = "";
     _param = "<addr> <size> <data ...>";
     _paramExp = "addr - address of block\n"
-                INDENTEX"size - size of data to write in bytes\n"
-                INDENTEX"data - data to write - space seperated dwords";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" wbne 0x10000 12 0x30000 0x76800 0x5a445a44";
+                INDENTEX "size - size of data to write in bytes\n"
+                INDENTEX "data - data to write - space separated dwords";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " wbne 0x10000 12 0x30000 0x76800 0x5a445a44";
     _v = Wtv_Dev;
-    _maxCmdParamNum = -1;
+    _minCmdParamNum = 3;
     _cmdType = SC_Wbne;
 }
 
@@ -3836,14 +3639,6 @@ bool WbneSubCommand::writeBlock(u_int32_t addr, std::vector<u_int32_t> dataVec)
     return true;
 }
 
-bool WbneSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() < 3) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR3,_name.c_str() , 3, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 bool WbneSubCommand::extractData(const std::vector<string>& cmdParams , u_int32_t* addr, std::vector<u_int32_t>& data) {
     char *endp;
     char* addrStr = strcpy(new char[cmdParams[0].size() + 1],cmdParams[0].c_str());
@@ -3903,12 +3698,13 @@ RbSubCommand:: RbSubCommand()
     _flagShort = "";
     _param = "<addr> <size> [out-file]";
     _paramExp = "addr - address of block\n"
-                INDENTEX"size - size of data to read in bytes\n"
-                INDENTEX"file - filename to write the block (raw binary). If not given, the data\n"
-                INDENTEX"is printed to screen";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" rb 0x10000 100 file.bin";
+                INDENTEX "size - size of data to read in bytes\n"
+                INDENTEX "file - filename to write the block (raw binary). If not given, the data\n"
+                INDENTEX "is printed to screen";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " rb 0x10000 100 file.bin";
     _v = Wtv_Dev_Or_Img;
     _maxCmdParamNum = 3;
+    _minCmdParamNum = 2;
     _cmdType = SC_Rb;
 }
 
@@ -3933,14 +3729,6 @@ bool RbSubCommand::readBlock(u_int32_t addr, std::vector<u_int8_t>& buff, bool i
     return true;
 }
 
-bool RbSubCommand::verifyParams() {
-        if (_flintParams.cmd_params.size() < 2) {
-            reportErr(true, FLINT_CMD_ARGS_ERROR3,_name.c_str() , 2, (int)_flintParams.cmd_params.size());
-            return false;
-        }
-    return true;
-}
-
 bool RbSubCommand::printToScreen(const std::vector<u_int8_t>& buff) {
     for (u_int32_t i=0; i < buff.size(); i+=4) {
         u_int32_t word = *((u_int32_t*)(&buff[0] + i));
@@ -4004,7 +3792,7 @@ ClearSemSubCommand:: ClearSemSubCommand()
     _flagShort = "";
     _param = "";
     _paramExp = "";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" -clear_semaphore";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " -clear_semaphore";
     _v = Wtv_Dev;
     _maxCmdParamNum = 0;
     _cmdType = SC_Clear_Sem;
@@ -4034,7 +3822,7 @@ RomQuerySubCommand:: RomQuerySubCommand()
     _flagShort = "";
     _param = "";
     _paramExp = "";
-    _example = FLINT_NAME" -i ROM_image.bin qrom ";
+    _example = FLINT_NAME " -i ROM_image.bin qrom ";
     _v = Wtv_Img;
     _maxCmdParamNum = 0;
     _cmdType = SC_Qrom;
@@ -4075,7 +3863,7 @@ ResetCfgSubCommand:: ResetCfgSubCommand()
     _flagShort = "r";
     _param = "";
     _paramExp = "";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" reset_cfg";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " reset_cfg";
     _v = Wtv_Dev;
     _maxCmdParamNum = 0;
     _cmdType = SC_ResetCfg;
@@ -4124,7 +3912,7 @@ FiSubCommand:: FiSubCommand()
     _flagShort = "";
     _param = "";
     _paramExp = "";
-    _example = FLINT_NAME" -d "MST_DEV_EXAMPLE1" fi";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " fi";
     _v = Wtv_Dev;
     _maxCmdParamNum = 0;
     _cmdType = SC_Fix_Img;
@@ -4154,3 +3942,414 @@ FlintStatus FiSubCommand::executeCommand()
     return FLINT_SUCCESS;
 
 }
+
+/***********************
+ *Class: CheckSum
+ **********************/
+CheckSumSubCommand:: CheckSumSubCommand()
+{
+    _name = "checksum";
+    _desc = "perform MD5 checksum on FW.";
+    _extendedDesc = "perform an MD5 checksum on relevant(non-persistent between FW upgrades) data on device/image.";
+    _flagLong = "checksum";
+    _flagShort = "cs";
+    _param = "";
+    _paramExp = "";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " checksum";
+    _v = Wtv_Dev_Or_Img;
+    _maxCmdParamNum = 0;
+    _cmdType = SC_Check_Sum;
+    memset(_checkSum, 0, sizeof(_checkSum));
+}
+
+CheckSumSubCommand:: ~CheckSumSubCommand()
+{
+
+}
+
+bool CheckSumSubCommand::extractChecksumFromStr(string str, u_int8_t checkSum[16])
+{
+    char ptr[2];
+    int i = 15;
+    if (str.size() < 2) {
+        reportErr(true, FLINT_CHECKSUM_LEN_ERROR );
+        return false;
+    }
+    if (!strncasecmp(str.c_str(), "0x", 2)) {
+        // str starts with 0x or 0X, remove prefix
+        str = &(str.c_str()[2]);
+    }
+
+    if (str.size() != 32) {
+        reportErr(true, FLINT_CHECKSUM_LEN_ERROR );
+        return false;
+    }
+    stringstream ss(str);
+    while (i >= 0) {
+        ss.read(ptr, 2);
+        if (!isxdigit(ptr[0]) || !isxdigit(ptr[1])) {
+            reportErr(true, FLINT_CHECKSUM_HEX_ERROR);
+            return false;
+        }
+        checkSum[i] = (u_int8_t)strtoul(ptr, NULL, 16);
+        if (!checkSum[i] && strncmp(ptr, "00", 2)) {
+            reportErr(true, FLINT_CHECKSUM_PARSE_ERROR);
+            return false;
+        }
+        i--;
+    }
+    return true;
+}
+
+string CheckSumSubCommand::checkSum2Str(u_int8_t chksm[16])
+{
+    stringstream ss;
+    for (int i=15; i >= 0; i--) {
+        char chunk[3];
+        snprintf(chunk, 3, "%02x", chksm[i]);
+        ss << chunk;
+    }
+    string s = ss.str();
+    return s;
+}
+
+FlintStatus CheckSumSubCommand::executeCommand()
+{
+    if (preFwOps() == FLINT_FAILED) {
+        return FLINT_FAILED;
+    }
+    FwOperations* ops = _fwOps ? _fwOps : _imgOps;
+    printf("-I- Calculating Checksum ...\n");
+    if (!ops->FwCalcMD5(_checkSum)){
+        reportErr(true, FLINT_CHECKSUM_ERROR, (_flintParams.device_specified ? "device" : "image"), ops->err());
+        return FLINT_FAILED;
+    }
+    // just print it!
+    printf("Checksum: %s\n", checkSum2Str(_checkSum).c_str());
+    return FLINT_SUCCESS;
+
+}
+
+
+/***********************
+ *Class: TimeStamp
+ **********************/
+TimeStampSubCommand:: TimeStampSubCommand()
+{
+    _name = "time stamp";
+    _desc = "FW time stamping.";
+    _extendedDesc = "set/query/reset time stamp on device/image.";
+    _flagLong = "timestamp";
+    _flagShort = "ts";
+    _param = "<set|query|reset> [timestamp] [FW version]";
+    _paramExp = "set <timestamp> [FW version] : set the specified timestamp. if set on device FW version must be specified\n"
+        INDENTEX "                               timestamp should comply with ISO 8601 format and provided with UTC timezone: YYYY-MM-DDThh:mm:ssZ\n"
+                INDENTEX "query : query device/image to view the timestamp\n"
+                INDENTEX "reset : reset the timestamp, remove the timestamp from device/image.\n";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE4 " ts set 2015-12-24T14:52:33Z 14.12.1100\n"
+      INDENTEX FLINT_NAME " -d " MST_DEV_EXAMPLE4 " ts reset\n"
+      INDENTEX FLINT_NAME " -i ./fw4115.bin ts set\n"
+      INDENTEX FLINT_NAME " -i ./fw4115.bin ts query";
+    _v = Wtv_Dev_Or_Img;
+    _maxCmdParamNum = 3;
+    _minCmdParamNum = 1;
+    _cmdType = SC_Time_Stamp;
+    memset(&_userFwVer, 0, sizeof(_userFwVer));
+    memset(&_userTsEntry, 0, sizeof(_userTsEntry));
+    _operation = TS_No_Command;
+    _ops = (FwOperations*)NULL;
+}
+
+TimeStampSubCommand:: ~TimeStampSubCommand()
+{
+
+}
+bool TimeStampSubCommand::parseFwVersion(string verStr)
+{
+    unsigned int major = 0;
+    unsigned int minor = 0;
+    unsigned int subminor = 0;
+    int count = sscanf(verStr.c_str(), "%02d.%02d.%04d", &major, &minor, &subminor);
+    if (count !=3) {
+        count = sscanf(verStr.c_str(), "%02d.%04d.%04d", &major, &minor, &subminor);
+        if (count != 3) {
+            reportErr(true, "Failed to parse FW version. expected format: MM.mm.ssss\n");
+            return false;
+        }
+    }
+    _userFwVer.fw_ver_major = major;
+    _userFwVer.fw_ver_minor = minor;
+    _userFwVer.fw_ver_subminor = subminor;
+    //printf("-D- Fw version: %d.%d.%d\n", _userFwVer.fw_ver_major, _userFwVer.fw_ver_minor, _userFwVer.fw_ver_subminor);
+    return true;
+}
+
+#define BCD2_TO_NUM(bcd)\
+    ((((bcd) >> 4 & 0xf) * 10) + ((bcd) & 0xf))
+
+#define BCD4_TO_NUM(bcd) \
+        ((BCD2_TO_NUM((bcd) >> 8 & 0xff) * 100) + (BCD2_TO_NUM((bcd) & 0xff)))
+
+#define NUM2_TO_BCD(num) \
+    ((((num) / 10) * 16) + ((num) % 10))
+
+#define NUM4_TO_BCD(num) \
+        ((NUM2_TO_BCD((num) / 100 ) * 256) + NUM2_TO_BCD((num) % 100 ))
+
+u_int8_t TimeStampSubCommand::getDaysInMonth(u_int16_t year, u_int8_t month)
+{
+    u_int8_t days = 0;
+    bool isLeapYear = year % 4 == 0; // evenly divisible by 4
+    isLeapYear &= (year % 100 != 0) || (year % 400 == 0); // not evenly divided by 100 or  evenly divisible by 400
+    switch(month) {
+    case 2:
+        days = isLeapYear ? 29 : 28;
+        break;
+    case 4:
+    case 6:
+    case 9:
+    case 11:
+        days = 30;
+        break;
+    case 1:
+    case 3:
+    case 5:
+    case 7:
+    case 8:
+    case 10:
+    case 12:
+        days = 31;
+        break;
+    default:
+        break;
+    }
+    return days;
+}
+
+void TimeStampSubCommand::getMachineUTCTime()
+{
+    time_t rawTime;
+    struct tm * timeInfo;
+    time ( &rawTime );
+    timeInfo = gmtime ( &rawTime );
+
+    _userTsEntry.ts_year = NUM4_TO_BCD(timeInfo->tm_year + 1900);
+    _userTsEntry.ts_month = NUM2_TO_BCD(timeInfo->tm_mon + 1);
+    _userTsEntry.ts_day = NUM2_TO_BCD(timeInfo->tm_mday);
+    _userTsEntry.ts_hour = NUM2_TO_BCD(timeInfo->tm_hour);
+    _userTsEntry.ts_minutes = NUM2_TO_BCD(timeInfo->tm_min);
+    _userTsEntry.ts_seconds =  NUM2_TO_BCD(timeInfo->tm_sec);
+
+    //printf("-D- timestamp: %04x-%02x-%02xT%02x:%02x:%02x\n", _userTsEntry.ts_year, _userTsEntry.ts_month,
+    //                                                        _userTsEntry.ts_day, _userTsEntry.ts_hour, _userTsEntry.ts_minutes, _userTsEntry.ts_seconds);
+    return;
+}
+
+bool TimeStampSubCommand::parseTimeStamp(string tsStr)
+{
+    unsigned int year = 0;
+    unsigned int month = 0;
+    unsigned int day = 0;
+    unsigned int hour = 0;
+    unsigned int minutes = 0;
+    unsigned int seconds = 0;
+    if (*tsStr.rbegin() != 'Z') {
+        reportErr(true, "Failed to parse timestamp: Timestamp timezone must be UTC. format should be: YYYY-MM-DDThh:mm:ssZ\n");
+        return false;
+    }
+    // scan and store
+    int count = sscanf(tsStr.c_str(), "%04d-%02d-%02dT%02d:%02d:%02dZ", &year, &month, &day, &hour, &minutes, &seconds);
+    if (count !=6) {
+        reportErr(true, "Failed to parse timestamp: input should be compliant to the following ISO 8601 format: YYYY-MM-DDThh:mm:ssZ\n");
+        return false;
+    }
+    // check time args
+    if ( month == 0 || month > 12) {
+        reportErr(true, "Failed to parse timestamp: illegal month value (%d)\n", month);
+                return false;
+    }
+    if (day > getDaysInMonth(year, month)) {
+        reportErr(true, "Failed to parse timestamp: illegal day value (%d)\n", day);
+                return false;
+    }
+    if ( hour  > 23 || minutes  > 59 || seconds  > 59 ) {
+        reportErr(true, "Failed to parse timestamp: illegal time value (%02d:%02d:%02d)\n", hour, minutes, seconds);
+                return false;
+    }
+    // store as BCD
+    _userTsEntry.ts_year = NUM4_TO_BCD(year);
+    _userTsEntry.ts_month = NUM2_TO_BCD(month);
+    _userTsEntry.ts_day = NUM2_TO_BCD(day);
+    _userTsEntry.ts_hour = NUM2_TO_BCD(hour);
+    _userTsEntry.ts_minutes = NUM2_TO_BCD(minutes);
+    _userTsEntry.ts_seconds =  NUM2_TO_BCD(seconds);
+
+    //printf("-D- timestamp: %04x-%02x-%02xT%02x:%02x:%02x\n", _userTsEntry.ts_year, _userTsEntry.ts_month,
+    //                                                        _userTsEntry.ts_day, _userTsEntry.ts_hour, _userTsEntry.ts_minutes, _userTsEntry.ts_seconds);
+    return true;
+}
+
+bool TimeStampSubCommand::verifyParams()
+{
+    if (_flintParams.cmd_params[0] == "query") {
+        if (_flintParams.cmd_params.size() > 1) {
+            reportErr(true, "query operation requires no arguments.\n");
+            return false;
+        }
+        _operation = TimeStampSubCommand::TS_Query;
+    } else if (_flintParams.cmd_params[0] == "set") {
+        if (_flintParams.image_specified && _flintParams.cmd_params.size() > 2) {
+            reportErr(true, "too many arguments for set operation on image.\n");
+            return false;
+        } else if (_flintParams.device_specified && _flintParams.cmd_params.size() != 3) {
+            reportErr(true, "set operation on device requires timestamp and FW version arguments.\n\n");
+            return false;
+        }
+        _operation = TimeStampSubCommand::TS_Set;
+        // attempt to parse timestamp and fw version
+        if (_flintParams.image_specified && _flintParams.cmd_params.size() == 1) {
+            // take time from machine
+            getMachineUTCTime();
+        } else if (!parseTimeStamp(_flintParams.cmd_params[1])) {
+            return false;
+        }
+        if (_flintParams.device_specified && !parseFwVersion(_flintParams.cmd_params[2])) {
+            return false;
+        }
+    } else if (_flintParams.cmd_params[0] == "reset") {
+        if (_flintParams.cmd_params.size() > 1) {
+            reportErr(true, "erase operation requires no arguments.\n");
+            return false;
+        }
+        _operation = TimeStampSubCommand::TS_Reset;
+    } else {
+        reportErr(true, "Unknown operation, allowed operations: query/set/reset.\n");
+        return false;
+    }
+    return true;
+}
+
+void TimeStampSubCommand::printTsAndFwVer(string prefix, struct tools_open_ts_entry& tsEntry, struct tools_open_fw_version& fwVer)
+{
+    printf("%-24s: %04x-%02x-%02xT%02x:%02x:%02xZ    %02d.%02d.%04d\n", prefix.c_str(), tsEntry.ts_year, tsEntry.ts_month, tsEntry.ts_day,
+                                                                     tsEntry.ts_hour, tsEntry.ts_minutes, tsEntry.ts_seconds,
+                                                                     fwVer.fw_ver_major, fwVer.fw_ver_minor, fwVer.fw_ver_subminor);
+}
+
+bool TimeStampSubCommand::queryTs()
+{
+    struct tools_open_ts_entry tsEntry;
+    struct tools_open_fw_version fwVer;
+    memset(&tsEntry, 0, sizeof(tsEntry));
+    memset(&fwVer, 0, sizeof(fwVer));
+    // get and Print Current Running FW TS in case of device
+    if (_flintParams.device_specified) {
+        if (!_ops->FwQueryTimeStamp(tsEntry, fwVer, true)) {
+            printf("%-24s: N/A. %s\n", "Current timestamp", _ops->err());
+        } else {
+            printTsAndFwVer("Current timestamp", tsEntry, fwVer);
+        }
+    }
+    // get and print next FW timestamp
+    if (!_ops->FwQueryTimeStamp(tsEntry, fwVer, false)) {
+        printf("%-24s: N/A. %s\n", "Next timestamp", _ops->err());
+    } else {
+        printTsAndFwVer("Next timestamp", tsEntry, fwVer);
+    }
+    return true;
+}
+
+bool TimeStampSubCommand::setTs()
+{
+    if (!_ops->FwSetTimeStamp(_userTsEntry, _userFwVer)) {
+        reportErr(false, "%s", _ops->err());
+        return false;
+    }
+    return true;
+}
+
+bool TimeStampSubCommand::resetTs()
+{
+    if (!_ops->FwResetTimeStamp()) {
+        reportErr(false, "%s", _ops->err());
+        return false;
+    }
+    return true;
+}
+
+FlintStatus TimeStampSubCommand::executeCommand()
+{
+    bool rc;
+
+    if (preFwOps() == FLINT_FAILED) {
+        return FLINT_FAILED;
+    }
+    _ops = _flintParams.device_specified ? _fwOps : _imgOps;
+    (void)_ops;
+    switch (_operation) {
+    case TimeStampSubCommand::TS_Set:
+        rc = setTs();
+        break;
+    case TimeStampSubCommand::TS_Query:
+        rc = queryTs();
+        break;
+    case TimeStampSubCommand::TS_Reset:
+        rc = resetTs();
+        break;
+    default:
+        // should not be reached
+        reportErr(true, "Failed to perform timestamp operation: Unknown Error\n");
+        return FLINT_FAILED;
+    }
+    if (!rc) {
+        printf("-E- Failed to perform timestamp %s operation. %s\n", _flintParams.cmd_params[0].c_str(), _errBuff);
+        return FLINT_FAILED;
+    }
+    return FLINT_SUCCESS;
+}
+
+
+/***********************
+ *Class: CacheImage
+ **********************/
+CacheImageSubCommand:: CacheImageSubCommand()
+{
+    _name = "cache image";
+    _desc = "cache FW image(Windows only).";
+    _extendedDesc = "cache the FW image using Mellanox driver to allow faster FW load time upon loading the driver(Windows only).";
+    _flagLong = "cache_image";
+    _flagShort = "ci";
+    _param = "";
+    _paramExp = "";
+    _example = FLINT_NAME " -d " MST_DEV_EXAMPLE1 " cache_image";
+    _v = Wtv_Dev;
+    _maxCmdParamNum = 0;
+    _minCmdParamNum = 0;
+    _cmdType = SC_Cache_Image;
+}
+
+CacheImageSubCommand:: ~CacheImageSubCommand()
+{
+
+}
+
+FlintStatus CacheImageSubCommand:: executeCommand()
+{
+#ifdef __WIN__
+    int rc;
+
+    if (preFwAccess() == FLINT_FAILED) {
+        return FLINT_FAILED;
+    }
+    rc = wdcif_send_image_cache_request(((Flash*)_io)->getMfileObj());
+    if (rc) {
+        reportErr(true, FLINT_CACHE_IMAGE_ERROR, wdcif_err_str(rc));
+        return FLINT_FAILED;
+    }
+    printf("\n-I- FW was successfully cached by driver.\n");
+    return FLINT_SUCCESS;
+#else
+    reportErr(true, FLINT_WIN_ONLY_SUPP_ERROR, _name.c_str());
+    return FLINT_FAILED;
+#endif
+}
diff --git a/flint/subcommands.h b/flint/subcommands.h
index f82d034..e066d24 100644
--- a/flint/subcommands.h
+++ b/flint/subcommands.h
@@ -42,6 +42,9 @@
 #define MAX_PASSWORD_LEN 256
 
 #include <string>
+
+#include <tools_layouts/tools_open_layouts.h>
+
 #include "flint_params.h"
 #include "mlxfwops/lib/fw_ops.h"
 #include "err_msgs.h"
@@ -73,6 +76,7 @@ protected:
     FBase* _io;
     what_to_ver_t _v;
     int _maxCmdParamNum;
+    int _minCmdParamNum;
     FlintParams _flintParams;
     //info about the Subcommand
     string _name;
@@ -114,19 +118,15 @@ protected:
     static int resetCfgCbFunc(int completion);
 
     bool printGuidLine(guid_t* new_guids, guid_t* old_guids, int guid_index);
-    bool printBxGuids(guid_t* new_guids, guid_t* old_guids, int index,\
-                        int num_of_guids, const char* pre_str);
     bool printMacLine(guid_t* new_guids, guid_t* old_guids, int mac_index);
-    bool printBxMacs(guid_t* new_guids, guid_t* old_guids, int index, int num_of_guids, const char* pre_str);
-    bool printUidsFunc(guid_t* new_guids, guid_t* old_guids);
     bool printGUIDsFunc(guid_t guids[GUIDS],guid_t macs[MACS], guid_t old_guids[GUIDS],\
             guid_t old_macs[MACS], bool print_guids, bool print_macs, int portNum, bool old_guid_fmt);
     bool reportGuidChanges(guid_t* new_guids, guid_t* new_macs,\
                                         guid_t* old_guids, guid_t* old_macs, bool printGuids,\
-                                        bool printMacs, bool printUids, int guidNum);
-    bool checkGuidsFlags(chip_type_t ct, u_int16_t devType, u_int8_t fwType,
-            bool guidsSpecified, bool macsSpecified, bool uidsSpecified, bool ibDev, bool ethDev);
-    void printMissingGuidErr(bool ibDev, bool ethDev, bool bxDev);
+                                        bool printMacs, int guidNum);
+    bool checkGuidsFlags(u_int16_t devType, u_int8_t fwType,
+            bool guidsSpecified, bool macsSpecified, bool uidSpecified, bool ibDev, bool ethDev);
+    void printMissingGuidErr(bool ibDev, bool ethDev);
 
     bool extractUIDArgs(std::vector<string>& cmdArgs, u_int8_t numOfGuids[2], u_int8_t stepSize[2]);
     bool extractValuesFromString(string valStr, u_int8_t values[2], string origArg);
@@ -148,7 +148,7 @@ protected:
 
 
 public:
-    SubCommand(): _fwOps(NULL), _imgOps(NULL), _io(NULL), _v(Wtv_Uninitilized), _maxCmdParamNum(-1)
+    SubCommand(): _fwOps(NULL), _imgOps(NULL), _io(NULL), _v(Wtv_Uninitilized), _maxCmdParamNum(-1),  _minCmdParamNum(-1)
     {
         _cmdType = SC_No_Cmd;
         memset(_errBuff, 0, sizeof(_errBuff));
@@ -178,7 +178,7 @@ private:
     FlintStatus burnFs3();
     FlintStatus burnFs2();
     bool checkFwVersion();
-    bool checkPSIDAndIbEth();
+    bool checkPSID();
     void updateBurnParams();
     void dealWithExpRom();
     bool checkMatchingExpRomDevId(const fw_info_t& info);
@@ -197,9 +197,6 @@ private:
     FlintStatus printInfo(const fw_info_t& fwInfo, bool fullQuery);
     bool displayFs3Uids(const fw_info_t& fwInfo);
     bool displayFs2Uids(const fw_info_t& fwInfo);
-    bool reportBxGuidsQuery(const guid_t* guids, int base1, int guids_num, int index, const char* pre_str);
-    bool reportBxMacsQuery(const guid_t* guids, int base1, int guids_num, int index, const char* pre_str);
-    bool reportBxMacsWarnings(const guid_t* guids, int index, int warning, int user_uids);
     bool checkMac(u_int64_t mac, string& warrStr);
 public:
     QuerySubCommand();
@@ -240,7 +237,6 @@ public:
     BromSubCommand();
     ~BromSubCommand();
     inline FlintStatus executeCommand();
-    bool verifyParams();
     bool getExpRomStrVer(roms_info_t& roms_info, char* version);
 };
 
@@ -314,7 +310,6 @@ public:
     SetVpdSubCommand();
     ~SetVpdSubCommand();
     FlintStatus executeCommand();
-    bool verifyParams();
 };
 
 class SvSubCommand : public SubCommand
@@ -335,7 +330,6 @@ public:
     RiSubCommand();
     ~RiSubCommand();
     FlintStatus executeCommand();
-    bool verifyParams();
 };
 
 class DcSubCommand : public SubCommand
@@ -401,7 +395,6 @@ public:
     EraseSubCommand();
     ~EraseSubCommand();
     inline FlintStatus executeCommand();
-    inline bool verifyParams();
 };
 class RwSubCommand : public SubCommand
 {
@@ -411,7 +404,6 @@ public:
     RwSubCommand();
     ~RwSubCommand();
     inline FlintStatus executeCommand();
-    inline bool verifyParams();
 };
 class WwSubCommand : public SubCommand
 {
@@ -421,7 +413,6 @@ public:
     WwSubCommand();
     ~WwSubCommand();
     inline FlintStatus executeCommand();
-    inline bool verifyParams();
 };
 
 class WwneSubCommand : public SubCommand
@@ -432,7 +423,6 @@ public:
     WwneSubCommand();
     ~WwneSubCommand();
     inline FlintStatus executeCommand();
-    inline bool verifyParams();
 };
 
 class WbSubCommand : public SubCommand
@@ -443,7 +433,6 @@ public:
     WbSubCommand();
     ~WbSubCommand();
     FlintStatus executeCommand();
-    bool verifyParams();
 };
 
 
@@ -456,7 +445,6 @@ public:
     WbneSubCommand();
     ~WbneSubCommand();
     FlintStatus executeCommand();
-    bool verifyParams();
 };
 
 class RbSubCommand : public SubCommand
@@ -468,7 +456,6 @@ public:
     RbSubCommand();
     ~RbSubCommand();
     FlintStatus executeCommand();
-    bool verifyParams();
 };
 
 class ClearSemSubCommand : public SubCommand
@@ -507,4 +494,54 @@ public:
     FlintStatus executeCommand();
 };
 
+class CheckSumSubCommand : public SubCommand
+{
+public:
+    CheckSumSubCommand();
+    ~CheckSumSubCommand();
+    FlintStatus executeCommand();
+private:
+    bool extractChecksumFromStr(string str, u_int8_t checkSum[16]);
+    string checkSum2Str(u_int8_t checkSum[16]);
+    u_int8_t _checkSum[16];
+};
+
+class TimeStampSubCommand : public SubCommand
+{
+public:
+    TimeStampSubCommand();
+    ~TimeStampSubCommand();
+    FlintStatus executeCommand();
+private:
+    enum {
+        TS_No_Command,
+        TS_Query,
+        TS_Set,
+        TS_Reset
+    };
+
+    bool verifyParams();
+    bool parseTimeStamp(string tsStr);
+    bool parseFwVersion(string verStr);
+    inline u_int8_t getDaysInMonth(u_int16_t year, u_int8_t month);
+    inline void printTsAndFwVer(string prefix, struct tools_open_ts_entry& tsEntry, struct tools_open_fw_version& fwVer);
+    void getMachineUTCTime();
+    bool queryTs();
+    bool setTs();
+    bool resetTs();
+
+    int _operation;
+    FwOperations* _ops;
+    struct tools_open_ts_entry _userTsEntry;
+    struct tools_open_fw_version _userFwVer;
+};
+
+class CacheImageSubCommand : public SubCommand
+{
+public:
+    CacheImageSubCommand();
+    ~CacheImageSubCommand();
+    FlintStatus executeCommand();
+};
+
 #endif
diff --git a/include/mtcr_ul/mtcr.h b/include/mtcr_ul/mtcr.h
index 4b5c6c2..5306d0e 100644
--- a/include/mtcr_ul/mtcr.h
+++ b/include/mtcr_ul/mtcr.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef MTCR_H
@@ -42,168 +40,14 @@ extern "C" {
 
 #include <sys/types.h>
 
-typedef enum MError {
-    ME_OK = 0,
-    ME_ERROR,
-    ME_BAD_PARAMS,
-    ME_CR_ERROR,
-    ME_NOT_IMPLEMENTED,
-    ME_SEM_LOCKED,
-    ME_MEM_ERROR,
-
-    ME_MAD_SEND_FAILED,
-    ME_UNKOWN_ACCESS_TYPE,
-    ME_UNSUPPORTED_DEVICE,
-    ME_REG_NOT_SUPPORTED,
-
-    ME_PCI_READ_ERROR,
-    ME_PCI_WRITE_ERROR,
-    ME_PCI_SPACE_NOT_SUPPORTED,
-    ME_PCI_IFC_TOUT,
-
-    // errors regarding REG_ACCESS
-    ME_REG_ACCESS_OK = 0,
-    ME_REG_ACCESS_BAD_STATUS_ERR = 0x100,
-    ME_REG_ACCESS_BAD_METHOD,
-    ME_REG_ACCESS_NOT_SUPPORTED,
-    ME_REG_ACCESS_DEV_BUSY,
-    ME_REG_ACCESS_VER_NOT_SUPP,
-    ME_REG_ACCESS_UNKNOWN_TLV,
-    ME_REG_ACCESS_REG_NOT_SUPP,
-    ME_REG_ACCESS_CLASS_NOT_SUPP,
-    ME_REG_ACCESS_METHOD_NOT_SUPP,
-    ME_REG_ACCESS_BAD_PARAM,
-    ME_REG_ACCESS_RES_NOT_AVLBL,
-    ME_REG_ACCESS_MSG_RECPT_ACK,
-    ME_REG_ACCESS_UNKNOWN_ERR,
-    ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT,
-    ME_REG_ACCESS_CONF_CORRUPT,
-    ME_REG_ACCESS_LEN_TOO_SMALL,
-    ME_REG_ACCESS_BAD_CONFIG,
-    ME_REG_ACCESS_ERASE_EXEEDED,
-    ME_REG_ACCESS_INTERNAL_ERROR,
-
-    // errors regarding ICMD
-    ME_ICMD_STATUS_CR_FAIL = 0x200,       // cr-space access failure
-    ME_ICMD_INVALID_OPCODE,
-    ME_ICMD_INVALID_CMD,
-    ME_ICMD_OPERATIONAL_ERROR,
-    ME_ICMD_BAD_PARAM,
-    ME_ICMD_BUSY,
-    ME_ICMD_INIT_FAILED,
-    ME_ICMD_NOT_SUPPORTED,
-    ME_ICMD_STATUS_SEMAPHORE_TO,          // timed out while trying to take semaphore
-    ME_ICMD_STATUS_EXECUTE_TO,            // timed out while waiting for command to execute
-    ME_ICMD_STATUS_IFC_BUSY,
-    ME_ICMD_STATUS_ICMD_NOT_READY,
-    ME_ICMD_UNSUPPORTED_ICMD_VERSION,
-    ME_ICMD_UNKNOWN_STATUS,
-    ME_ICMD_ICM_NOT_AVAIL,
-    ME_ICMD_WRITE_PROTECT,
-    ME_ICMD_SIZE_EXCEEDS_LIMIT,
-
-    //errors regarding Tools CMDIF
-    ME_CMDIF_BUSY = 0x300,
-    ME_CMDIF_TOUT,
-    ME_CMDIF_BAD_STATUS,
-    ME_CMDIF_BAD_OP,
-    ME_CMDIF_NOT_SUPP,
-    ME_CMDIF_BAD_SYS,
-    ME_CMDIF_UNKN_TLV,
-    ME_CMDIF_RES_STATE,
-    ME_CMDIF_UNKN_STATUS,
-
-    //errors regarding MAD IF
-    ME_MAD_BUSY = 0x400,
-    ME_MAD_REDIRECT,
-    ME_MAD_BAD_VER,
-    ME_MAD_METHOD_NOT_SUPP,
-    ME_MAD_METHOD_ATTR_COMB_NOT_SUPP,
-    ME_MAD_BAD_DATA,
-    ME_MAD_GENERAL_ERR,
-
-    ME_LAST
-} MError;
-
-typedef enum Mdevs_t {
-    MDEVS_GAMLA     = 0x01, /*  Each device that actually is a Gamla */
-    MDEVS_I2CM      = 0x02, /*  Each device that can work as I2C master */
-    MDEVS_MEM       = 0x04, /*  Each device that is a memory driver (vtop) */
-    MDEVS_TAVOR_DDR = 0x08, /*  Each device that maps to DDR */
-    MDEVS_TAVOR_UAR = 0x10, /*  Each device that maps to UAR */
-    MDEVS_TAVOR_CR  = 0x20, /*  Each device that maps to CR */
-    MDEVS_IF        = 0x40, /*  Standard device  interface */
-    MDEVS_REM       = 0x80, /*  Remote devices */
-    MDEVS_PPC       = 0x100, /*  PPC devices */
-    MDEVS_DEV_I2C   = 0x200, /* Generic linux kernel i2c device */
-    MDEVS_IB        = 0x400, /* Cr access over IB Mads */
-    MDEVS_MLNX_OS   = 0x800, /* access by CmdIf in MlnxOS */
-    MDEVS_FWCTX		= 0x900, /*access by UEFI func/context */
-    MDEVS_TAVOR     = (MDEVS_TAVOR_DDR|MDEVS_TAVOR_UAR|MDEVS_TAVOR_CR),
-    MDEVS_ALL       = 0xffffffff
-} Mdevs;
-typedef struct mfile_t mfile;
-
-typedef enum {
-    MACCESS_REG_METHOD_GET = 1,
-    MACCESS_REG_METHOD_SET = 2
-} maccess_reg_method_t;
-
-typedef enum {
-    AS_ICMD = 3,
-    AS_CR_SPACE = 2,
-    AS_SEMAPHORE = 0xa
-} address_space_t;
-
-typedef struct dev_info_t
-{
-    Mdevs         type;
-    char          dev_name[512];
-
-    union {
-        struct {
-            u_int16_t domain;
-            u_int8_t  bus;
-            u_int8_t  dev;
-            u_int8_t  func;
-
-            u_int16_t dev_id;
-            u_int16_t vend_id;
-            u_int32_t class_id;
-            u_int16_t subsys_id;
-            u_int16_t subsys_vend_id;
-
-            char      cr_dev[512];
-            char      conf_dev[512];
-            char**    net_devs;      // Null terminated array
-            char**    ib_devs;       // Null terminated array
-        } pci;
-
-        struct {
-            u_int32_t TBD;
-        } usb;
-
-        struct {
-            u_int32_t TBD;
-        } ib;
-
-        struct {
-            u_int32_t TBD;
-        } remote;
-    };
-} dev_info;
-
-typedef enum {
-    RA_MFPA=0x9010,
-    RA_MFBA=0x9011,
-    RA_MFBE=0x9012,
-} reg_access_t;
+#include "mtcr_com_defs.h"
+#include "mtcr_mf.h"
 
 typedef enum mtcr_access_method {
-    MTCR_ACCESS_ERROR  = 0x0,
-    MTCR_ACCESS_MEMORY = 0x1,
-    MTCR_ACCESS_CONFIG = 0x2,
-    MTCR_ACCESS_INBAND = 0x3
+    MTCR_ACCESS_ERROR  = MST_ERROR,
+    MTCR_ACCESS_MEMORY = MST_PCI,
+    MTCR_ACCESS_CONFIG = MST_PCICONF,
+    MTCR_ACCESS_INBAND = MST_IB
 } mtcr_access_method_t;
 /*
  * Read 4 bytes, return number of succ. read bytes or -1 on failure
@@ -254,6 +98,8 @@ mfile *mopend(const char *name, int type);
 
 mfile *mopen_fw_ctx(void* fw_cmd_context, void* fw_cmd_func, void* extra_data);
 
+mfile *mopen_adv(const char *name, MType mtype);
+
 /*
  * Close Mellanox driver
  * req. descriptor
@@ -306,6 +152,8 @@ int mget_vsec_supp(mfile* mf);
 int mget_addr_space(mfile* mf);
 int mset_addr_space(mfile* mf, int space);
 
+int mclear_pci_semaphore(const char* name);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/mtcr_ul/mtcr_com_defs.h b/include/mtcr_ul/mtcr_com_defs.h
new file mode 100644
index 0000000..7aa3a38
--- /dev/null
+++ b/include/mtcr_ul/mtcr_com_defs.h
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+
+#ifndef _MTCR_COM_DEFS_H
+#define _MTCR_COM_DEFS_H
+
+#ifdef __WIN__
+
+#include<winsock2.h>
+#include <windows.h>
+
+#ifdef MTCR_EXPORTS
+#define MTCR_API __declspec(dllexport)
+#else
+#define MTCR_API __declspec(dllimport)
+#endif
+
+typedef unsigned __int8  u_int8_t;
+typedef __int8           int8_t;
+typedef unsigned __int16 u_int16_t;
+typedef __int16          int16_t;
+typedef unsigned __int32 u_int32_t;
+typedef __int32          int32_t;
+typedef unsigned __int64 u_int64_t;
+typedef __int64          int64_t;
+
+#if defined(_WIN64)
+    typedef __int64 MT_long_ptr_t;
+    typedef unsigned __int64 MT_ulong_ptr_t;
+#else
+    typedef _W64 long MT_long_ptr_t;
+    typedef _W64 unsigned long MT_ulong_ptr_t;
+#endif
+
+#elif defined(__DJGPP__)
+
+    typedef unsigned char    u_int8_t;
+    typedef char             int8_t;
+    typedef unsigned short   u_int16_t;
+    typedef short            int16_t;
+    typedef unsigned int     u_int32_t;
+    typedef long             int32_t;
+    typedef unsigned long long u_int64_t;
+    typedef long long        int64_t;
+
+#define bswap_32(x) ntohl(x)
+#define MTCR_API
+
+#else  /* UNIX */
+
+#include <sys/types.h>
+#define MTCR_API
+
+#endif
+
+//#ifndef USE_IB_MGT
+typedef struct mib_private_t {
+        int dummy;
+} MIB_Private;
+//#else
+//#include "mtcr_ib_private.h"
+//#endif
+
+typedef enum MError {
+    ME_OK = 0,
+    ME_ERROR,
+    ME_BAD_PARAMS,
+    ME_CR_ERROR,
+    ME_NOT_IMPLEMENTED,
+
+    ME_SEM_LOCKED,
+    ME_MEM_ERROR,
+
+    ME_MAD_SEND_FAILED,
+    ME_UNKOWN_ACCESS_TYPE,
+    ME_UNSUPPORTED_DEVICE,
+    ME_REG_NOT_SUPPORTED,
+
+    ME_PCI_READ_ERROR,
+    ME_PCI_WRITE_ERROR,
+    ME_PCI_SPACE_NOT_SUPPORTED,
+    ME_PCI_IFC_TOUT,
+
+    ME_UNSUPPORTED_OPERATION,
+    ME_UNSUPPORTED_ACCESS_TYPE,
+
+    // errors regarding REG_ACCESS
+    ME_REG_ACCESS_OK = 0,
+    ME_REG_ACCESS_BAD_STATUS_ERR = 0x100,
+    ME_REG_ACCESS_BAD_METHOD,
+    ME_REG_ACCESS_NOT_SUPPORTED,
+    ME_REG_ACCESS_DEV_BUSY,
+    ME_REG_ACCESS_VER_NOT_SUPP,
+    ME_REG_ACCESS_UNKNOWN_TLV,
+    ME_REG_ACCESS_REG_NOT_SUPP,
+    ME_REG_ACCESS_CLASS_NOT_SUPP,
+    ME_REG_ACCESS_METHOD_NOT_SUPP,
+    ME_REG_ACCESS_BAD_PARAM,
+    ME_REG_ACCESS_RES_NOT_AVLBL,
+    ME_REG_ACCESS_MSG_RECPT_ACK,
+    ME_REG_ACCESS_UNKNOWN_ERR,
+    ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT,
+    ME_REG_ACCESS_CONF_CORRUPT,
+    ME_REG_ACCESS_LEN_TOO_SMALL,
+    ME_REG_ACCESS_BAD_CONFIG,
+    ME_REG_ACCESS_ERASE_EXEEDED,
+    ME_REG_ACCESS_INTERNAL_ERROR,
+
+    // errors regarding ICMD
+    ME_ICMD_STATUS_CR_FAIL = 0x200,       // cr-space access failure
+    ME_ICMD_INVALID_OPCODE,
+    ME_ICMD_INVALID_CMD,
+    ME_ICMD_OPERATIONAL_ERROR,
+    ME_ICMD_BAD_PARAM,
+    ME_ICMD_BUSY,
+    ME_ICMD_INIT_FAILED,
+    ME_ICMD_NOT_SUPPORTED,
+    ME_ICMD_STATUS_SEMAPHORE_TO,          // timed out while trying to take semaphore
+    ME_ICMD_STATUS_EXECUTE_TO,            // timed out while waiting for command to execute
+    ME_ICMD_STATUS_IFC_BUSY,
+    ME_ICMD_STATUS_ICMD_NOT_READY,
+    ME_ICMD_UNSUPPORTED_ICMD_VERSION,
+    ME_ICMD_UNKNOWN_STATUS,
+    ME_ICMD_ICM_NOT_AVAIL,
+    ME_ICMD_WRITE_PROTECT,
+    ME_ICMD_SIZE_EXCEEDS_LIMIT,
+
+    //errors regarding Tools CMDIF
+    ME_CMDIF_BUSY = 0x300,
+    ME_CMDIF_TOUT,
+    ME_CMDIF_BAD_STATUS,
+    ME_CMDIF_BAD_OP,
+    ME_CMDIF_NOT_SUPP,
+    ME_CMDIF_BAD_SYS,
+    ME_CMDIF_UNKN_TLV,
+    ME_CMDIF_RES_STATE,
+    ME_CMDIF_UNKN_STATUS,
+
+    //errors regarding MAD IF
+    ME_MAD_BUSY = 0x400,
+    ME_MAD_REDIRECT,
+    ME_MAD_BAD_VER,
+    ME_MAD_METHOD_NOT_SUPP,
+    ME_MAD_METHOD_ATTR_COMB_NOT_SUPP,
+    ME_MAD_BAD_DATA,
+    ME_MAD_GENERAL_ERR,
+
+    ME_LAST
+} MError;
+
+// typedefs for UEFI
+#ifdef UEFI_BUILD
+#include <mft_uefi_common.h>
+#endif
+typedef enum MType_t {
+    MST_ERROR = 0x0,
+    MST_FPGA = 0x1,
+    MST_MLNXOS = 0x2,
+    MST_LPC = 0x4,
+    MST_PCI = 0x8,
+    MST_PCICONF = 0x10,
+    /*MST_CALBR,*/
+    MST_USB = 0x20,
+    MST_IB = 0x40,
+    MST_IF = 0x80,
+    MST_PPC = 0x100,
+    MST_USB_DIMAX = 0x200,
+    MST_FWCTX = 0x400,
+    MST_REMOTE = 0x800,
+#ifdef ENABLE_MST_DEV_I2C
+    MST_DEV_I2C = 0x1000,
+#endif
+    // 0x2000 reserved
+    MST_FPGA_NEWTON = 0x4000,
+    MST_CABLE = 0x8000,
+    MST_DEFAULT = 0xffffffff & ~MST_FPGA & ~MST_CABLE
+} MType;
+
+typedef enum DType_t {
+    MST_GAMLA, MST_TAVOR, MST_DIMM, MST_NOADDR
+} DType;
+#define MST_ANAFA2 MST_TAVOR
+#define MST_EEPROM MST_GAMLA
+typedef enum Mdevs_t {
+    MDEVS_GAMLA = 0x01, /*  Each device that actually is a Gamla */
+    MDEVS_I2CM = 0x02, /*  Each device that can work as I2C master */
+    MDEVS_MEM = 0x04, /*  Each device that is a memory driver (vtop) */
+    MDEVS_TAVOR_DDR = 0x08, /*  Each device that maps to DDR */
+    MDEVS_TAVOR_UAR = 0x10, /*  Each device that maps to UAR */
+    MDEVS_TAVOR_CR = 0x20, /*  Each device that maps to CR */
+    MDEVS_IF = 0x40, /*  Standard device  interface */
+    MDEVS_REM = 0x80, /*  Remote devices */
+    MDEVS_PPC = 0x100, /*  PPC devices */
+    MDEVS_DEV_I2C = 0x200, /* Generic linux kernel i2c device */
+    MDEVS_IB = 0x400, /* Cr access over IB Mads */
+    MDEVS_MLNX_OS = 0x800, /* access by CmdIf in MlnxOS */
+    MDEVS_FWCTX = 0x900, /* access by func/context (like UEFI) */
+    MDEVS_LPC = 0x1000,/* Access LPC region */
+    MDEVS_FPGA = 0x2000,/* Access LPC region */
+    MDEVS_FPGA_NEWTON = 0x4000,/* Access LPC region */
+    MDEVS_CABLE = 0x8000,
+    MDEVS_TAVOR = (MDEVS_TAVOR_DDR | MDEVS_TAVOR_UAR | MDEVS_TAVOR_CR), MDEVS_ALL = 0xffffffff
+} Mdevs;
+
+typedef enum {
+    MACCESS_REG_METHOD_GET = 1,
+    MACCESS_REG_METHOD_SET = 2
+} maccess_reg_method_t;
+
+typedef enum {
+    AS_ICMD = 3, AS_CR_SPACE = 2, AS_SEMAPHORE = 0xa
+} address_space_t;
+
+typedef struct dev_info_t {
+        Mdevs type;
+        char dev_name[512];
+        int ul_mode;
+
+        union {
+                struct {
+                        u_int16_t domain;
+                        u_int8_t bus;
+                        u_int8_t dev;
+                        u_int8_t func;
+
+                        u_int16_t dev_id;
+                        u_int16_t vend_id;
+                        u_int32_t class_id;
+                        u_int16_t subsys_id;
+                        u_int16_t subsys_vend_id;
+
+                        char cr_dev[512];
+                        char conf_dev[512];
+                        char** net_devs;      // Null terminated array
+                        char** ib_devs;       // Null terminated array
+                        char numa_node[4096];     //
+                } pci;
+
+                struct {
+                        u_int32_t mtusb_serial;
+                        u_int32_t TBD;
+                } usb;
+
+                struct {
+                        u_int32_t TBD;
+                } ib;
+
+                struct {
+                        u_int32_t TBD;
+                } remote;
+        };
+} dev_info;
+
+
+typedef enum {
+    RA_MFPA=0x9010,
+    RA_MFBA=0x9011,
+    RA_MFBE=0x9012,
+} reg_access_t;
+
+typedef struct mfile_t mfile;
+
+#endif
diff --git a/include/mtcr_ul/mtcr_mf.h b/include/mtcr_ul/mtcr_mf.h
new file mode 100644
index 0000000..d2e0e5b
--- /dev/null
+++ b/include/mtcr_ul/mtcr_mf.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+#ifndef __MTCR_MF__
+#define __MTCR_MF__
+
+typedef struct icmd_params_t {
+        int icmd_opened;
+        int took_semaphore;
+        int ctrl_addr;
+        int cmd_addr;
+        u_int32_t max_cmd_size;
+        int semaphore_addr;
+        int static_cfg_not_done_addr;
+        int static_cfg_not_done_offs;
+        u_int32_t lock_key;
+        int ib_semaphore_lock_supported;
+} icmd_params;
+
+typedef struct ctx_params_t {
+        void *fw_cmd_context;
+        void *fw_cmd_func;
+} ctx_params;
+
+typedef struct io_region_t {
+        unsigned int start;
+        unsigned int end;
+} io_region;
+
+typedef struct tools_hcr_params_t {
+        int supp_cr_mbox; // 1: mbox supported , -1: mbox not supported
+} tools_hcr_params;
+
+typedef struct access_reg_params_t {
+        int max_reg_size;
+} access_reg_params;
+
+typedef void (*f_mpci_change)        (mfile *mf);
+
+/*  All fields in follow structure are not supposed to be used */
+/*  or modified by user programs. Except i2c_slave that may be */
+/*  modified before each access to target I2C slave address */
+struct mfile_t {
+        MType tp; /*  type of driver */
+        MType res_tp; /*  Will be used with HCR if need */
+        DType dtype; /*  target device to access to */
+        DType itype; /*  interface device to access via */
+        int is_i2cm; /*  use device as I2C master */
+        int is_vm; /*  if the machine is VM    */
+        int cr_access; /* If cr access is allowed in MLNXOS devices */
+        unsigned char i2c_slave;
+        io_region* iorw_regions; /* For LPC devices */
+        int regions_num;
+        char* dev_name;
+        int fd;
+        int res_fd; /*  Will be used with HCR if need*/
+        int sock; /*  in not -1 - remote interface */
+        void *ptr;
+        unsigned int map_size;
+        unsigned long long start_idx;
+        /************************ FPGA DDR3 *********************************/
+        void *ddr3_ptr;
+        unsigned long long ddr3_start_idx;
+        unsigned int ddr3_map_size;
+        /********************************************************************/
+        MIB_Private mib; /*  Data for IB interface (if relevant) */
+        void *ctx;
+        unsigned int i2c_RESERVED; /*  Reserved for internal usage (i2c internal) */
+        enum Mdevs_t flags;
+        u_int32_t connectx_wa_slot; /* apply connectx cr write workaround */
+        int connectx_wa_last_op_write;
+        u_int32_t connectx_wa_stat;
+        u_int64_t connectx_wa_max_retries;
+        u_int64_t connectx_wa_num_of_writes;
+        u_int64_t connectx_wa_num_of_retry_writes;
+        int server_ver_major;
+        int server_ver_minor;
+        unsigned int proto_type;
+        dev_info* dinfo;
+
+        //for ICMD access
+        icmd_params icmd;
+        // for UEFI
+        ctx_params context;
+        // for new pci capability
+        int old_mst;
+        int vsec_supp;
+        unsigned int vsec_addr;
+        int address_space;
+        int multifunction;
+        // for tools HCR access
+        tools_hcr_params hcr_params;
+        // for sending access registers
+        access_reg_params acc_reg_params;
+        // UL
+        void* ul_ctx;
+        // Dynamic libs Ctx
+        void* dl_context;
+        // Cables CTX
+        int is_cable;
+        void* cable_ctx;
+        f_mpci_change mpci_change;
+};
+
+#endif
diff --git a/man/mstconfig.1 b/man/mstconfig.1
new file mode 100644
index 0000000..9c600af
--- /dev/null
+++ b/man/mstconfig.1
@@ -0,0 +1,249 @@
+.TH MSTCONFIG "4.4.0" "" ""
+.SH NAME
+mstconfig
+.IP
+.SH SYNOPSIS:
+.IP
+mstconfig [\-d <mst device> ] [\-y|\-e] <s[et] <parameters to set>|q[uery]|r[eset]>
+.IP
+.SH OPTIONS:
+.TP
+\fB\-d\fR|\-\-dev <device>
+: Perform operation for a specified mst device.
+.TP
+\fB\-f\fR|\-\-file <conf_file>
+: raw configuration file.
+.TP
+\fB\-h\fR|\-\-help
+: Display help message.
+.TP
+\fB\-hh\fR|\-\-full_help
+: Display full help message.
+.TP
+\fB\-v\fR|\-\-version
+: Display version info.
+.TP
+\fB\-e\fR|\-\-show_default
+: Show default configurations.
+.TP
+\fB\-y\fR|\-\-yes
+: Answer yes in prompt.
+.IP
+.SH COMMANDS:
+.TP
+clear_semaphore
+: clear the tool semaphore.
+.TP
+q[uery]
+: query current supported configurations.
+.TP
+r[eset]
+: reset all configurations to their default value.
+.TP
+s[et]
+: set configurations to a specific device.
+.TP
+set_raw
+: set raw configuration file.(5th generation devices only.)
+.IP
+Supported Configurations:
+.IP
+\fBBoot Settings Extras:\fR These parameters are relevant only for servers using legacy BIOS PXE boot (flexboot).
+.IP
+IP_VER=<IPv4|IPv4_IPv6|IPv6|IPv6_IPv4>
+.IP
+IP_VER_P1=<IPv4|IPv4_IPv6|IPv6|IPv6_IPv4>
+.IP
+IP_VER_P2=<IPv4|IPv4_IPv6|IPv6|IPv6_IPv4>
+.IP
+\fBExternal Ports:\fR
+.IP
+ALLOW_RD_COUNTERS=<False|True>
+.IP
+PORT_OWNER=<False|True>
+.IP
+\fBIB Dynamically Connect:\fR
+.IP
+DCR_LIFO_SIZE=<SIZE>
+.IP
+LOG_DCR_HASH_TABLE_SIZE=<SIZE>
+.IP
+\fBInfiniband Boot Settings:\fR
+.IP
+BOOT_PKEY_P1=<PKEY>
+.IP
+BOOT_PKEY_P2=<PKEY>
+.IP
+\fBInternal Settings:\fR
+.IP
+INT_LOG_MAX_PAYLOAD_SIZE=<4KB|Auto>
+.IP
+\fBPCI Settings:\fR
+.IP
+FPP_EN=<False|True>
+.IP
+LOG_BAR_SIZE=<base_2_log_in_mb>
+.IP
+NUM_OF_VFS=<NUM>
+.IP
+NUM_PF_MSIX=<NUM>
+.IP
+NUM_VF_MSIX=<NUM>
+.IP
+PF_LOG_BAR_SIZE=<base_2_log_in_mb>
+.IP
+SRIOV_EN=<False|True>
+.IP
+VF_LOG_BAR_SIZE=<base_2_log_in_mb>
+.IP
+\fBPreboot Boot Settings:\fR Settings that control the legacy option ROM
+.IP
+BOOT_OPTION_ROM_EN_P1=<False|True>
+.IP
+BOOT_OPTION_ROM_EN_P2=<False|True>
+.IP
+BOOT_RETRY_CNT_P1=<0..7>
+.IP
+BOOT_RETRY_CNT_P2=<0..7>
+.IP
+BOOT_VLAN_EN_P1=<False|True>
+.IP
+BOOT_VLAN_EN_P2=<False|True>
+.IP
+BOOT_VLAN_P1=<VLAN ID>
+.IP
+BOOT_VLAN_P2=<VLAN ID>
+.IP
+LEGACY_BOOT_PROTOCOL_P1=<Both|None|PXE|iSCSI>
+.IP
+LEGACY_BOOT_PROTOCOL_P2=<Both|None|PXE|iSCSI>
+.IP
+\fBRoCE Congestion Control ECN:\fR
+.IP
+CLAMP_TGT_RATE_AFTER_TIME_INC_P1=<0|1>
+.IP
+CLAMP_TGT_RATE_AFTER_TIME_INC_P2=<0|1>
+.IP
+CLAMP_TGT_RATE_P1=<0|1>
+.IP
+CLAMP_TGT_RATE_P2=<0|1>
+.IP
+CNP_802P_PRIO_P1=<NUM>
+.IP
+CNP_802P_PRIO_P2=<NUM>
+.IP
+CNP_DSCP_P1=<0..7>
+.IP
+CNP_DSCP_P2=<0..7>
+.IP
+DCE_TCP_G_P1=<NUM>
+.IP
+DCE_TCP_G_P2=<NUM>
+.IP
+DCE_TCP_RTT_P1=<USEC>
+.IP
+DCE_TCP_RTT_P2=<USEC>
+.IP
+INITIAL_ALPHA_VALUE_P1=<NUM>
+.IP
+INITIAL_ALPHA_VALUE_P2=<NUM>
+.IP
+MIN_TIME_BETWEEN_CNPS_P1=<USEC>
+.IP
+MIN_TIME_BETWEEN_CNPS_P2=<USEC>
+.IP
+RATE_REDUCE_MONITOR_PERIOD_P1=<USEC>
+.IP
+RATE_REDUCE_MONITOR_PERIOD_P2=<USEC>
+.IP
+RATE_TO_SET_ON_FIRST_CNP_P1=<RATE_IN_MBIT>
+.IP
+RATE_TO_SET_ON_FIRST_CNP_P2=<RATE_IN_MBIT>
+.IP
+RPG_AI_RATE_P1=<RATE_IN_MBIT>
+.IP
+RPG_AI_RATE_P2=<RATE_IN_MBIT>
+.IP
+RPG_BYTE_RESET_P1=<BYTE_NUM>
+.IP
+RPG_BYTE_RESET_P2=<BYTE_NUM>
+.IP
+RPG_GD_P1=<0..15>
+.IP
+RPG_GD_P2=<0..15>
+.IP
+RPG_HAI_RATE_P1=<RATE_IN_MBIT>
+.IP
+RPG_HAI_RATE_P2=<RATE_IN_MBIT>
+.IP
+RPG_MAX_RATE_P1=<RATE_IN_MBIT>
+.IP
+RPG_MAX_RATE_P2=<RATE_IN_MBIT>
+.IP
+RPG_MIN_DEC_FAC_P1=<1..100>
+.IP
+RPG_MIN_DEC_FAC_P2=<1..100>
+.IP
+RPG_MIN_RATE_P1=<RATE_IN_MBIT>
+.IP
+RPG_MIN_RATE_P2=<RATE_IN_MBIT>
+.IP
+RPG_THRESHOLD_P1=<0..31>
+.IP
+RPG_THRESHOLD_P2=<0..31>
+.IP
+RPG_TIME_RESET_P1=<USEC>
+.IP
+RPG_TIME_RESET_P2=<USEC>
+.IP
+\fBRoCE Congestion Control Parameters:\fR
+.IP
+ROCE_CC_ALGORITHM_P1=<ECN|QCN>
+.IP
+ROCE_CC_ALGORITHM_P2=<ECN|QCN>
+.IP
+ROCE_CC_PRIO_MASK_P1=<0..255>
+.IP
+ROCE_CC_PRIO_MASK_P2=<0..255>
+.IP
+\fBRoCE V1.5 next protocol:\fR
+.IP
+ROCE_NEXT_PROTOCOL=<0..255>
+.IP
+\fBVPI Settings:\fR Control network link type
+.IP
+LINK_TYPE_P1=<ETH|IB|VPI>
+.IP
+LINK_TYPE_P2=<ETH|IB|VPI>
+.IP
+\fBWake On LAN:\R
+.IP
+WOL_MAGIC_EN=<False|True>
+.IP
+WOL_MAGIC_EN_P1=<False|True>
+.IP
+WOL_MAGIC_EN_P2=<False|True>
+.IP
+.SH Examples:
+.TP
+To query current configuration
+: mstconfig \fB\-d\fR \fI04:00.0\fP query
+.TP
+To set configuration
+: mstconfig \fB\-d\fR \fI05:00.0\fP set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1
+.TP
+To set raw configuration
+: mstconfig \fB\-d\fR \fI05:00.0\fP \fB\-f\fR conf_file set_raw
+.TP
+To reset configuration
+: mstconfig \fB\-d\fR \fI04:00.0\fP reset
+.IP
+.SH Supported devices:
+.IP
+4th Generation devices: ConnectX3, ConnectX3\-Pro (FW 2.31.5000 and above).
+.IP
+5th Generation devices: ConnectIB, ConnectX4, ConnectX4\-LX.
+.IP
+.TP
+\fBNote: query device to view supported configurations.\fR
+
diff --git a/man/mstflint.1 b/man/mstflint.1
index 6212dc4..4e87267 100644
--- a/man/mstflint.1
+++ b/man/mstflint.1
@@ -1,5 +1,5 @@
 .\"Text automatically generated by txt2man
-.TH mstflint 4.0.0  "April 2015" "" ""
+.TH mstflint 4.4.0  "May 2016" "" ""
 .SH NAME
 \fBmstflint \fP- Flash Interface
 .SH SYNOPSIS
@@ -61,7 +61,7 @@ Commands affected: burn, sg
 \fB--guids\fP <GUIDS\.\.\.>
 : 4 GUIDs must be specified here.
 The specified GUIDs are assigned
-to the following fields, repectively:
+to the following fields, respectively:
 node, port1, port2 and system image GUID.
 .RS
 .PP
@@ -95,7 +95,7 @@ Commands affected: burn, sg
 \fB--macs\fP <MACs\.\.\.>
 : 2 MACs must be specified here.
 The specified MACs are assigned
-to port1, port2, repectively.
+to port1, port2, respectively.
 Commands affected: burn, sg
 .RS
 .PP
@@ -393,6 +393,14 @@ rb
 .B
 qrom
                                 : query rom in a given image.
+ .TP
+.B
+checksum|cs                     
+                                : perform MD5 checksum on FW.
+.TP
+.B
+timestamp|ts <set|query|reset> [timestamp] [FW version] 
+                                : FW time stamping.
 .RE
 .PP
 
@@ -843,7 +851,7 @@ mstflint \fB-d\fP 04:00.0 wwne 0x10008 0x5a445a44
 .IP
 size - size of data to write in bytes
 .IP
-data - data to write - space seperated dwords
+data - data to write - space separated dwords
 .IP
 Examples:
 .IP \(bu 4
@@ -906,7 +914,49 @@ mstflint \fB-d\fP 04:00.0 rb 0x10000 100 file.bin
 \fIExamples\fP:
 .IP \(bu 4
 mstflint \fB-i\fP fw_image.bin qrom 
+."***************************************************************************************
+
+.RE
+.TP
+.B
+\fIName\fP: checksum
+.IP
+\fIDescription\fP: perform an MD5 checksum on relevant(non-persistent between FW upgrades) data on device/image.
+.IP
+\fI'Command\fP: checksum|cs
+.IP
+\fIParameters\fP: None
+.IP
+\fIExamples\fP:
+.IP \(bu 4
+mstflint \fB-d\fP 04:00.0 checksum
 
+."***************************************************************************************
+
+.RE
+.TP
+.B
+\fIName\fP: time stamp
+.IP
+\fIDescription\fP: set/query/reset time stamp on device/image.
+.IP
+\fI'Command\fP: timestamp|ts <set|query|reset> [timestamp] [FW version]
+.IP
+\fIParameters\fP: 
+        set <timestamp> [FW version] : set the specified timestamp. if set on device FW version must be specified
+                                       timestamp should comply with ISO 8601 format and provided with UTC timezone: YYYY-MM-DDThh:mm:ssZ
+        query : query device/image to view the timestamp
+        reset : reset the timestamp, remove the timestamp from device/image.
+.IP
+\fIExamples\fP:
+.IP \(bu 4
+mstflint \fB-d\fP 04:00.0 ts set 2015\-12\-24T14:52:33Z 14.12.1100
+.IP \(bu 4
+mstflint \fB-d\fP 04:00.0 ts reset
+.IP \(bu 4
+mstflint \fB-i\fP ./fw4115.bin ts set
+.IP \(bu 4
+mstflint \fB-i\fP ./fw4115.bin ts query
 
 .RE
 Return values:
diff --git a/man/mstmcra.1 b/man/mstmcra.1
new file mode 100644
index 0000000..d7a72e2
--- /dev/null
+++ b/man/mstmcra.1
@@ -0,0 +1,34 @@
+.TH MSTMCRA "4.4.0" "" ""
+.SH NAME
+mstmcra
+.IP
+.SH SYNOPSIS:
+.IP
+Mellanox Configuration Registers Access tool
+
+mstmcra [-s <i2c-slave>] [-a <adb dump>] [-v] [-h] <device>
+     <addr[.<bit offset>:<bit size>]|[,<bytes number>]> [data]
+
+    If data is given, operation is write. Otherwise it is read.
+    If a bit range is given in the address (E.G.: 0xf0014.16:8):
+          For read  - Only the requested bits are printed.
+          For write - Read-Modify-Write. Only the requested bits are changed.
+    If 'bytes number' is given in the address (E.G.: 0xf0014,16):
+          For read  - Will read a block (its size is the given bytes number).
+          For write - User need to give list of dwrods to write,
+                      number of dwords should be (bytes number/4).
+.IP
+.SH OPTIONS:
+.TP
+\fB-s\fR <i2c\-slave> : I2C slave address.
+.TP
+\fB-a\fR <dump file>  : adb dump file, used for access by path.
+.TP
+\fB-h\fR              : Print this help message.
+.TP
+\fB-v\fR              : Display version info
+.IP
+.SH Environment Vairables:
+.TP
+ADB_DUMP              : Holds the path to adb dump, used for access by path (can be overriden by "\-a").
+.TP
diff --git a/man/mstmread.1 b/man/mstmread.1
new file mode 100644
index 0000000..5946cc1
--- /dev/null
+++ b/man/mstmread.1
@@ -0,0 +1,10 @@
+.TH MSTMREAD "4.4.0" "" ""
+.SH NAME
+mstmread
+.IP
+.SH SYNOPSIS:
+.IP
+Mellanox Read Configuration Register Tool
+
+mstmread <device> <addr>
+.IP
diff --git a/man/mstmtserver.1 b/man/mstmtserver.1
new file mode 100644
index 0000000..bccd186
--- /dev/null
+++ b/man/mstmtserver.1
@@ -0,0 +1,16 @@
+.TH MSTMTSERVER "4.4.0" "" ""
+.SH NAME
+mstmtserver
+.IP
+.SH SYNOPSIS:
+.IP
+mstmtserver [options]
+.IP
+.SH OPTIONS:
+.TP
+\fB-p\fR[ort] <port> - Listen to specify port (default is 23108).
+.TP
+\fB-d\fR[ebug]       - Print all socket traffic (for debuging only).
+.TP
+\fB-h\fR[elp]        - Print help message.
+.TP
diff --git a/man/mstmwrite.1 b/man/mstmwrite.1
new file mode 100644
index 0000000..9a1464d
--- /dev/null
+++ b/man/mstmwrite.1
@@ -0,0 +1,10 @@
+.TH MSTMWRITE "4.4.0" "" ""
+.SH NAME
+mstmwrite
+.IP
+.SH SYNOPSIS:
+.IP
+Mellanox Write Configuration Register Tool
+
+mstmread <device> <addr> <value>
+.IP
diff --git a/man/mstregdump.1 b/man/mstregdump.1
new file mode 100644
index 0000000..bf29abd
--- /dev/null
+++ b/man/mstregdump.1
@@ -0,0 +1,23 @@
+.TH MSTREGDUMP "4.4.0" "" ""
+.SH NAME
+mstregdump
+.IP
+.SH SYNOPSIS:
+.IP
+Mellanox mstdump utility, dumps device internal configuration data
+
+mstregdump [-full] <device> [i2c-slave] [-v[ersion] [-h[elp]]]
+.IP
+.SH OPTIONS:
+.TP
+\fB-full\fR           : Dump more expanded list of addresses
+         \fBNote\fR : be careful when using this flag, None safe addresses might be read.
+.TP
+\fB-h\fR              : Print this help message.
+.TP
+\fB-v\fR              : Display version info
+.IP
+.SH EXAMPLE:
+.TP
+mstregdump 04:00.0
+.TP
diff --git a/man/mstvpd.1 b/man/mstvpd.1
new file mode 100644
index 0000000..2f69f81
--- /dev/null
+++ b/man/mstvpd.1
@@ -0,0 +1,37 @@
+.TH MSTVPD "4.4.0" "" ""
+.SH NAME
+mstvpd
+.IP
+.SH SYNOPSIS:
+.IP
+Mellanox VPD read tool
+
+mstvpd [-m|-n] [-t ##] <file> [\-- keyword ...]
+.IP
+.SH OPTIONS:
+.TP
+\fB-h\fR      :Print this help.
+.TP
+\fB-v\fR      :Print tool version.
+.TP
+\fB-m\fR      :Dump raw VPD data to stdout.
+.TP
+\fB-n\fR      :Do not validate check sum.
+.TP
+\fB-r\fR      :Do not check and display the VPD_W tag in the vpd data.
+.TP
+\fB-t\fR ##   :Time out after ## seconds. (Default is 30.)
+.IP
+.SH File:
+.TP
+The PCI id number of the HCA (for example, "2:00.0"),
+.TP
+the device name (such as "mlx4_0")
+.TP
+the absolute path to the device ("/sys/class/infiniband/mlx4_0/device")
+.TP
+or '-' to read VPD data from the standard input.
+.IP
+.SH Keyword(s):
+.TP
+Only display the requested information. (ID, PN, EC, SN, etc...)
diff --git a/mflash/Makefile.am b/mflash/Makefile.am
index 950cabd..44ac7cc 100644
--- a/mflash/Makefile.am
+++ b/mflash/Makefile.am
@@ -31,13 +31,15 @@
 #--
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES= -I. -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common -I$(top_srcdir)/tools_layouts -I$(top_srcdir)/reg_access \
+AM_CPPFLAGS = -I. -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common -I$(top_srcdir)/tools_layouts -I$(top_srcdir)/reg_access \
           -I$(top_srcdir)/cmdif -I$(top_srcdir)/tools_res_mgmt
 
 AM_CFLAGS = -MD -pipe -Wall -W -DMST_UL -g ${MFLASH_INBAND_FLAG}
 
-noinst_LIBRARIES = libmflash.a
+noinst_LTLIBRARIES = libmflash.a
 
 libmflash_a_SOURCES =  mflash.c mflash.h\
 			mflash_pack_layer.c mflash_pack_layer.h mflash_access_layer.c mflash_access_layer.h\
 			mflash_types.h mlash_common_structs.h
+
+noinst_HEADERS = mflash.h mflash_types.h mflash_common_structs.h
diff --git a/mflash/Makefile.in b/mflash/Makefile.in
index 5eea432..c3ddd44 100644
--- a/mflash/Makefile.in
+++ b/mflash/Makefile.in
@@ -46,6 +46,7 @@
 # SOFTWARE.
 #--
 
+
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
@@ -112,7 +113,7 @@ build_triplet = @build@
 host_triplet = @host@
 subdir = mflash
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/config/depcomp
+	$(top_srcdir)/config/depcomp $(noinst_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -121,17 +122,15 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_ at AM_V@)
-am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
-am__v_AR_0 = @echo "  AR      " $@;
-am__v_AR_1 = 
-libmflash_a_AR = $(AR) $(ARFLAGS)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
 libmflash_a_LIBADD =
-am_libmflash_a_OBJECTS = mflash.$(OBJEXT) mflash_pack_layer.$(OBJEXT) \
-	mflash_access_layer.$(OBJEXT)
+am_libmflash_a_OBJECTS = mflash.lo mflash_pack_layer.lo \
+	mflash_access_layer.lo
 libmflash_a_OBJECTS = $(am_libmflash_a_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -150,10 +149,6 @@ am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
@@ -177,6 +172,7 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+HEADERS = $(noinst_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -264,6 +260,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -320,15 +317,16 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I. -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common -I$(top_srcdir)/tools_layouts -I$(top_srcdir)/reg_access \
+AM_CPPFLAGS = -I. -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common -I$(top_srcdir)/tools_layouts -I$(top_srcdir)/reg_access \
           -I$(top_srcdir)/cmdif -I$(top_srcdir)/tools_res_mgmt
 
 AM_CFLAGS = -MD -pipe -Wall -W -DMST_UL -g ${MFLASH_INBAND_FLAG}
-noinst_LIBRARIES = libmflash.a
+noinst_LTLIBRARIES = libmflash.a
 libmflash_a_SOURCES = mflash.c mflash.h\
 			mflash_pack_layer.c mflash_pack_layer.h mflash_access_layer.c mflash_access_layer.h\
 			mflash_types.h mlash_common_structs.h
 
+noinst_HEADERS = mflash.h mflash_types.h mflash_common_structs.h
 all: all-am
 
 .SUFFIXES:
@@ -364,13 +362,19 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
-clean-noinstLIBRARIES:
-	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
 
 libmflash.a: $(libmflash_a_OBJECTS) $(libmflash_a_DEPENDENCIES) $(EXTRA_libmflash_a_DEPENDENCIES) 
-	$(AM_V_at)-rm -f libmflash.a
-	$(AM_V_AR)$(libmflash_a_AR) libmflash.a $(libmflash_a_OBJECTS) $(libmflash_a_LIBADD)
-	$(AM_V_at)$(RANLIB) libmflash.a
+	$(AM_V_CCLD)$(LINK)  $(libmflash_a_OBJECTS) $(libmflash_a_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -378,9 +382,9 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash_access_layer.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash_pack_layer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash_access_layer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mflash_pack_layer.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -493,7 +497,7 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
 install: install-am
 install-exec: install-exec-am
@@ -527,7 +531,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
 	mostlyclean-am
 
 distclean: distclean-am
@@ -599,7 +603,7 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
 	ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
diff --git a/mflash/mflash.c b/mflash/mflash.c
index c039127..299441c 100644
--- a/mflash/mflash.c
+++ b/mflash/mflash.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -28,8 +29,6 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- *  Version: $Id$
- *
  */
 
 #ifdef IRISC
@@ -46,7 +45,10 @@
 #include <common/bit_slice.h>
 #include <mtcr.h>
 #include <reg_access.h>
+
+#ifndef UEFI_BUILD
 #include <tools_cif.h>
+#endif
 
 #include "mflash_pack_layer.h"
 #include "mflash_access_layer.h"
@@ -201,16 +203,18 @@ int release_semaphore(mflash* mfl, int ignore_writer_lock);
 #define CPUMODE_SHIFT  30
 #define CPUMODE        0xf0150
 
+#define IS4_HW_ID 0x1b3
 #define SWITCHX_HW_ID 0x245
 #define CONNECTX_HW_ID  0x190
 #define CX3_PRO_HW_ID 0x1F7
 #define CX3_HW_ID     0x1F5
 #define CX4_HW_ID	  0x209
 #define CX4LX_HW_ID   0x20b
-
+#define CX5_HW_ID     0x20d
 #define CONNECT_IB_HW_ID 0x1FF
 #define SWITCH_IB_HW_ID 0x247
 #define SPECTRUM_HW_ID 0x249
+#define SWITCH_IB2_HW_ID 0x24b
 
 /*
  * Device IDs Macros:
@@ -218,32 +222,32 @@ int release_semaphore(mflash* mfl, int ignore_writer_lock);
 
 #define IS_CONNECTX_4TH_GEN_FAMILY(dev_id) \
         (((dev_id) == CONNECTX_HW_ID) || ((dev_id) == CX3_HW_ID) || ((dev_id) == CX3_PRO_HW_ID))
+#define IS_IS4_FAMILY(dev_id) \
+    (((dev_id) == IS4_HW_ID))
 #define IS_SX(dev_id) \
         ((dev_id) == SWITCHX_HW_ID)
 #define IS_SIB(dev_id) \
         ((dev_id) == SWITCH_IB_HW_ID)
+#define IS_SIB2(dev_id) \
+        ((dev_id) == SWITCH_IB2_HW_ID)
 #define IS_SEN(dev_id) \
         ((dev_id) == SPECTRUM_HW_ID)
-#define IS_IS4_FAMILY(dev_id) \
-    (((dev_id) == 435) || ((dev_id) == 6100)) // 435 == InfiniScaleIV, 6100 == BridgeX
 #define IS_CONNECT_IB(dev_id) \
-        ((dev_id) ==CONNECT_IB_HW_ID)
+        ((dev_id) == CONNECT_IB_HW_ID)
 #define IS_CONNECTX4(dev_id) \
-        ((dev_id) ==CX4_HW_ID)
+        ((dev_id) == CX4_HW_ID)
 #define IS_CONNECTX4LX(dev_id) \
-        ((dev_id) ==CX4LX_HW_ID)
+        ((dev_id) == CX4LX_HW_ID)
+#define IS_CONNECTX5(dev_id) \
+        ((dev_id) == CX5_HW_ID)
 #define HAS_TOOLS_CMDIF(dev_id) \
     ((((dev_id) == CX3_HW_ID) || ((dev_id) == CX3_PRO_HW_ID)))
 #define HAS_ICMD_IF(dev_id) \
-    ((IS_CONNECT_IB(dev_id)) || (IS_SIB(dev_id)) || (IS_CONNECTX4(dev_id)) || (IS_CONNECTX4LX(dev_id)) || (IS_SEN(dev_id)))
+    ((IS_CONNECT_IB(dev_id)) || (IS_SIB(dev_id)) || (IS_CONNECTX4(dev_id)) || (IS_CONNECTX4LX(dev_id)) || (IS_SEN(dev_id)) || (IS_SIB2(dev_id)) || (IS_CONNECTX5(dev_id)))
 #define IS_SWITCH(dev_id) \
-       ((IS_IS4_FAMILY(dev_id)) || (IS_SX(dev_id)) || (IS_SIB(dev_id)) || (IS_SEN(dev_id)))
-#define IS_REALLY_OLD_DEVICE(dev_id) \
-        (((dev_id) == 23108) || ((dev_id) == 25208) || ((dev_id) == 24204) || ((dev_id) == 25204))
-#define IS_OLD_DEVICE(dev_id) \
-    ((IS_REALLY_OLD_DEVICE(dev_id)) || (IS_CONNECTX_4TH_GEN_FAMILY(dev_id)))
+       ((IS_IS4_FAMILY(dev_id)) || (IS_SX(dev_id)) || (IS_SIB(dev_id)) || (IS_SEN(dev_id)) || (IS_SIB2(dev_id)))
 #define SUPPORTS_SW_RESET(devid)\
-        (((devid) == 435) || ((devid) == SWITCHX_HW_ID) || ((devid) == SWITCH_IB_HW_ID))
+        (((devid) == IS4_HW_ID) || ((devid) == SWITCHX_HW_ID) || ((devid) == SWITCH_IB_HW_ID) || ((devid) == SWITCH_IB2_HW_ID))
 
 
 // Write/Erase delays
@@ -347,6 +351,9 @@ int cntx_spi_write_status_reg(mflash* mfl, u_int32_t status_reg, u_int8_t write_
 
 int spi_get_num_of_flashes(int prev_num_of_flashes);
 
+#ifndef UEFI_BUILD
+static int trm2mfe_err(trm_sts rc);
+#endif
 
 int my_memset(void* dst, u_int8_t data, u_int32_t len) {
     u_int32_t i;
@@ -513,6 +520,8 @@ enum StFlashCommand {
     SFC_RDSR2 = 0x35,
     SFC_WREN  = 0x06,
     SFC_READ  = 0x03,
+    SFC_FAST_READ  = 0x3B,
+    SFC_QUAD_READ  = 0x3B,
     SFC_RES   = 0xAB,
     SFC_JEDEC = 0x9F,
     SFC_RDNVR = 0xB5,
@@ -520,19 +529,6 @@ enum StFlashCommand {
     SFC_WRSR  = 0x01
 };
 
-typedef struct flash_info {
-    const char *name;
-    u_int8_t vendor;
-    u_int8_t type;
-    int command_set;
-    int erase_command;
-    int sector_size;
-    u_int8_t quad_en_support;
-    u_int8_t write_protected_support;
-    u_int8_t protect_sub_and_sector;
-    u_int8_t dummy_cycles_support;
-} flash_info_t;
-
 #define SST_FLASH_NAME   "SST25VFxx"
 #define WINBOND_NAME     "W25QxxBV"
 #define WINBOND_W25X     "W25Xxx"
@@ -564,16 +560,16 @@ typedef enum flash_memory_type {
 
 flash_info_t g_flash_info_arr[] =
 {
-        {"M25PXxx",      FV_ST,      FMT_ST_M25PX,     MCS_STSPI,  SFC_SSE, 0x1000,  0, 0, 0, 0},
-        {"M25Pxx",       FV_ST,      FMT_ST_M25P,      MCS_STSPI,  SFC_SE,  0x10000, 0, 0, 0, 0},
-        {"N25Q0XX",      FV_ST,      FMT_N25QXXX,      MCS_STSPI,  SFC_SSE, 0x1000,  1, 1, 0, 1},
-        {SST_FLASH_NAME, FV_SST,     FMT_SST_25,       MCS_SSTSPI, SFC_SE,  0x10000, 0, 0, 0, 0},
-        {WINBOND_NAME,   FV_WINBOND, FMT_WINBOND,      MCS_STSPI,  SFC_SSE, 0x1000,  1, 1, 1, 0},
-        {WINBOND_W25X,   FV_WINBOND, FMT_WINBOND_W25X, MCS_STSPI,  SFC_SSE, 0x1000,  0, 0, 0, 0},
-        {ATMEL_NAME,     FV_ATMEL,   FMT_ATMEL,        MCS_STSPI,  SFC_SSE, 0x1000,  0, 0, 0, 0},
-        {S25FLXXXP_NAME, FV_S25FLXXXX, FMT_S25FLXXXP,  MCS_STSPI,  SFC_SE,  0x10000, 0, 0, 0, 0},
-        {S25FL116K_NAME, FV_S25FLXXXX, FMT_S25FL116K, MCS_STSPI, SFC_SSE,   0x1000,  0, 0, 0, 0}, // this flash actually supports quad and write protect but we dont need it at this moment
-        {MACRONIX_NAME, FV_MX25K16XXX, FMT_ST_M25P, MCS_STSPI, SFC_SSE,     0x1000,  0, 0, 0, 0}, // this flash actually supports write protection but we dont use it at this time
+        {"M25PXxx",      FV_ST,      FMT_ST_M25PX,     MCS_STSPI,  SFC_SSE, FSS_4KB,  1, 0, 0, 0, 0},
+        {"M25Pxx",       FV_ST,      FMT_ST_M25P,      MCS_STSPI,  SFC_SE,  FSS_64KB, 0, 0, 0, 0, 0},
+        {"N25Q0XX",      FV_ST,      FMT_N25QXXX,      MCS_STSPI,  SFC_SSE, FSS_4KB,  1, 1, 1, 0, 1},
+        {SST_FLASH_NAME, FV_SST,     FMT_SST_25,       MCS_SSTSPI, SFC_SE,  FSS_64KB, 0, 0, 0, 0, 0},
+        {WINBOND_NAME,   FV_WINBOND, FMT_WINBOND,      MCS_STSPI,  SFC_SSE, FSS_4KB,  1, 1, 1, 1, 0},
+        {WINBOND_W25X,   FV_WINBOND, FMT_WINBOND_W25X, MCS_STSPI,  SFC_SSE, FSS_4KB,  0, 0, 0, 0, 0},
+        {ATMEL_NAME,     FV_ATMEL,   FMT_ATMEL,        MCS_STSPI,  SFC_SSE, FSS_4KB,  0, 0, 0, 0, 0},
+        {S25FLXXXP_NAME, FV_S25FLXXXX, FMT_S25FLXXXP,  MCS_STSPI,  SFC_SE,  FSS_64KB, 0, 0, 0, 0, 0},
+        {S25FL116K_NAME, FV_S25FLXXXX, FMT_S25FL116K, MCS_STSPI,   SFC_SSE, FSS_4KB,  1, 1, 1, 1, 0}, // this flash actually supports quad and write protect but we dont need it at this moment
+        {MACRONIX_NAME,  FV_MX25K16XXX, FMT_ST_M25P, MCS_STSPI,    SFC_SSE, FSS_4KB,  0, 0, 0, 0, 0}, // this flash actually supports write protection but we dont use it at this time
 };
 
 int cntx_sst_get_log2size(u_int8_t capacity, int* log2spi_size)
@@ -687,11 +683,12 @@ int get_flash_info_by_res(mflash* mfl, unsigned *type_index, int *log2size, u_in
     return MFE_OK;
 }
 
-int cntx_get_flash_info(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash)
+int cntx_get_flash_info(mflash* mfl, flash_info_t *f_info, int *log2size, u_int8_t *no_flash)
 {
     int rc;
     u_int8_t type = 0, capacity = 0, vendor = 0, no_flash_res = 0, no_flash_rdid = 0;
     unsigned char es = 0;
+    unsigned type_index = 0;
     // Assume there is a flash.
     *no_flash = 0;
 
@@ -699,24 +696,24 @@ int cntx_get_flash_info(mflash* mfl, unsigned *type_index, int *log2size, u_int8
     no_flash_rdid = is_no_flash_detected(type, vendor, capacity);
     // printf("-D- cntx_spi_get_type: rc: %#x, vendor=%#x, type=%#x, capacity=%#x\n", rc, vendor, type, capacity);
     // printf("-D- rc = %d, no_flash_rdid = %d\n", rc, no_flash_rdid);
-    if (get_type_index_by_vendor_and_type(vendor, type, type_index) == MFE_OK) {
+    if (get_type_index_by_vendor_and_type(vendor, type, &type_index) == MFE_OK) {
         // RDID Succeded.
         // Get the capacity
-        if (get_log2size_by_capcity(*type_index, capacity, log2size) != MFE_OK) {
+        if (get_log2size_by_capcity(type_index, capacity, log2size) != MFE_OK) {
             printf("-E- SST SPI flash #%d (vendor: %#x, type: %#x, capacity:%#x) is not supported.\n", get_bank_int(mfl), vendor,
                     type, capacity);
-            return MFE_UNSUPPORTED_FLASH_TOPOLOGY;
+            rc = MFE_UNSUPPORTED_FLASH_TOPOLOGY;
         }
-         return MFE_OK;
-    }
+         rc = MFE_OK;
+    } else if (no_flash_rdid) {
     // printf("-D- no support for rdid\n");
     // RDID Failed due to:
     // 1- RDID is not supported but RES is - Old flashes.
     // 2- There is no Flash
     // 3- Flash is not supported
-    if (no_flash_rdid) {
+
         // Trying RES
-        rc = get_flash_info_by_res(mfl, type_index, log2size, &no_flash_res, &es);
+        rc = get_flash_info_by_res(mfl, &type_index, log2size, &no_flash_res, &es);
         if (rc == 0 && no_flash_res == 1) {
             // RES Succeeded due to: no flash, unsupported flash or old flash.
                 *no_flash = 1;
@@ -730,6 +727,9 @@ int cntx_get_flash_info(mflash* mfl, unsigned *type_index, int *log2size, u_int8
         printf("-E- SPI flash #%d (vendor: %#x, memory type: %#x, es: %#x) is not supported.\n", get_bank_int(mfl), vendor, type, es);
     }
     // printf("-D- rc = %d, no_flash_res = %d, type_index = %d.\n", rc, no_flash_res, *type_index);
+    if (rc == MFE_OK && *no_flash == 0) {
+        memcpy(f_info, &g_flash_info_arr[type_index], sizeof(flash_info_t));
+    }
     return rc;
 }
 
@@ -768,13 +768,15 @@ int get_num_of_banks_int(mflash *mfl) {
     return mfl->opts[MFO_NUM_OF_BANKS];
 }
 
-int get_flash_params(mflash* mfl, flash_params_t *flash_params, unsigned *type_index)
+int get_flash_params(mflash* mfl, flash_params_t *flash_params, flash_info_t *flash_info)
 {
     int num_of_flashes = get_num_of_banks_int(mfl);
     int spi_sel, rc;
     int params_were_set = 0;
-    flash_info_t *flash_info;
+    flash_info_t tmp_flash_info;
     memset(flash_params, 0, sizeof(flash_params_t));
+    memset (flash_info, 0, sizeof(flash_info_t));
+    memset (&tmp_flash_info, 0, sizeof(flash_info_t));
 
     // if number of flash banks is zero exit with error
     if (num_of_flashes == 0) {
@@ -786,7 +788,7 @@ int get_flash_params(mflash* mfl, flash_params_t *flash_params, unsigned *type_i
             u_int8_t no_flash = 0;
             const char *type_name;
             rc = set_bank(mfl, spi_sel); CHECK_RC(rc);
-            rc = mfl->f_get_info(mfl, type_index, &log2size, &no_flash); CHECK_RC(rc);
+            rc = mfl->f_get_info(mfl, &tmp_flash_info, &log2size, &no_flash); CHECK_RC(rc);
             //printf("-D- spi_sel = %d, num_of_flashes = %d, rc = %d, no_flash = %d\n", spi_sel, num_of_flashes, rc, no_flash);
 
             if (no_flash == 1) {
@@ -797,12 +799,12 @@ int get_flash_params(mflash* mfl, flash_params_t *flash_params, unsigned *type_i
                 }
                 break;
             }
-            flash_info = &(g_flash_info_arr[*type_index]);
 
-            type_name = flash_info->name;
+            type_name = tmp_flash_info.name;
             if (params_were_set == 0) {
                 flash_params->type_name = type_name;
                 flash_params->log2size  = log2size;
+                memcpy(flash_info, &tmp_flash_info, sizeof(flash_info_t));
                 params_were_set = 1;
             } else {
                 rc = compare_flash_params(flash_params, spi_sel, type_name, log2size); CHECK_RC(rc);
@@ -821,25 +823,19 @@ int get_flash_params(mflash* mfl, flash_params_t *flash_params, unsigned *type_i
     return MFE_OK;
 }
 
-int spi_fill_attr_from_params(mflash* mfl, flash_params_t* flash_params, unsigned type_index)
+int spi_fill_attr_from_params(mflash* mfl, flash_params_t* flash_params, flash_info_t *flash_info)
 {
-    flash_info_t *flash_info = &(g_flash_info_arr[type_index]);
-
     mfl->attr.log2_bank_size = flash_params->log2size;
     mfl->attr.bank_size      = 1 << flash_params->log2size;
     mfl->attr.size           = mfl->attr.bank_size * flash_params->num_of_flashes;
     mfl->attr.block_write                = 16; // In SPI context, this is the transaction size. Max is 16.
-    mfl->attr.num_erase_blocks           = 1;
-    // HACK: Use fw_sector size only in CX3 family devices for now 
+    // HACK: Use fw_sector size as the sector size only in CX3 family devices for now
+    // TODO: adrianc : this sould be in sx_get_flash_info_by_type()
     if (HAS_TOOLS_CMDIF(mfl->attr.hw_dev_id)) {
-        mfl->attr.erase_block[0].sector_size = mfl->attr.fw_flash_sector_sz ? mfl->attr.fw_flash_sector_sz : (u_int32_t)flash_info->sector_size;
-    } else {
-        mfl->attr.erase_block[0].sector_size = (u_int32_t)flash_info->sector_size;
+        flash_info->sector_size = mfl->attr.fw_flash_sector_sz ? mfl->attr.fw_flash_sector_sz : flash_info->sector_size;
     }
-
-    mfl->attr.erase_block[0].sector_mask = ~(mfl->attr.erase_block[0].sector_size - 1);
-    mfl->attr.sector_size = mfl->attr.erase_block[0].sector_size;
-
+    mfl->attr.sector_size = flash_info->sector_size;
+    mfl->attr.support_sub_and_sector = flash_info->support_sub_and_sector;
     mfl->attr.command_set   = flash_info->command_set;
     mfl->attr.erase_command = flash_info->erase_command;
     mfl->attr.type_str      = flash_info->name;
@@ -859,6 +855,7 @@ int spi_fill_attr_from_params(mflash* mfl, flash_params_t* flash_params, unsigne
 int st_spi_fill_attr(mflash* mfl, flash_params_t* flash_params) {
     int rc;
     flash_params_t *cur_flash_params, tmp_flash_params;
+    flash_info_t flash_info;
     unsigned type_index;
 
     // printf("-D- st_spi_fill_attr: ignore_detect = %d, log2size = %#x.\n", mfl->ignore_flash_detect, mfl->user_attr.log2size);
@@ -868,7 +865,7 @@ int st_spi_fill_attr(mflash* mfl, flash_params_t* flash_params) {
         cur_flash_params = &tmp_flash_params;
 
         while (i < GET_FLASH_RETRY) {
-            rc = get_flash_params(mfl, cur_flash_params, &type_index);
+            rc = get_flash_params(mfl, cur_flash_params, &flash_info);
             if (rc != MFE_NO_FLASH_DETECTED) {
                 break;
             }
@@ -879,11 +876,11 @@ int st_spi_fill_attr(mflash* mfl, flash_params_t* flash_params) {
     } else {
         // Get the flash params from the user.
         rc = get_type_index_by_name(flash_params->type_name, &type_index); CHECK_RC(rc);
+        memcpy(&flash_info, &(g_flash_info_arr[type_index]), sizeof(flash_info_t));
         cur_flash_params = flash_params;
     }
-
     // Init the flash attr according to the flash parameters (which was wither given by the user or read from the flash)
-    rc = spi_fill_attr_from_params(mfl, cur_flash_params, type_index); CHECK_RC(rc);
+    rc = spi_fill_attr_from_params(mfl, cur_flash_params, &flash_info); CHECK_RC(rc);
     // printf("-D- spi_size = %#x,  log2spi_size = %#x, bank_size = %#x, flashes_num = %d\n", mfl->attr.size, mfl->attr.log2_bank_size,
     //       mfl->attr.bank_size, cur_flash_params->num_of_flashes);
     return MFE_OK;
@@ -1104,7 +1101,7 @@ int empty_set_bank(mflash* mfl, u_int32_t bank) {
 }
 
 int cntx_exec_cmd(mflash* mfl, u_int32_t gw_cmd, char* msg) {
-    if (!IS_OLD_DEVICE(mfl->attr.hw_dev_id)) {
+    if (!IS_CONNECTX_4TH_GEN_FAMILY(mfl->attr.hw_dev_id)) {
         // for old devices lock bit is separate from the flash HW ifc
         //for new devices need to make sure this bit remains locked when writing the dword
         gw_cmd = MERGE(gw_cmd,              1,       31,                       1);
@@ -1410,7 +1407,7 @@ int spi_update_num_of_banks(mflash* mfl, int prev_num_of_flashes)
 
     num_of_banks = spi_get_num_of_flashes(prev_num_of_flashes);
     if (num_of_banks == -1) {
-        if (IS_SX(mfl->attr.hw_dev_id) || IS_SIB(mfl->attr.hw_dev_id) || IS_SEN(mfl->attr.hw_dev_id)) {
+        if (IS_SX(mfl->attr.hw_dev_id) || IS_SIB(mfl->attr.hw_dev_id) || IS_SEN(mfl->attr.hw_dev_id) || IS_SIB2(mfl->attr.hw_dev_id)) {
             mfl->opts[MFO_NUM_OF_BANKS] = 2;
         } else {
             mfl->opts[MFO_NUM_OF_BANKS] = 1;
@@ -1943,6 +1940,10 @@ int check_cache_replacement_gaurd(mflash* mfl, u_int8_t *needs_cache_replacement
 
     // When we access via command interface, we assume there is a cache replacement!
     if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_MLNXOS_CMDIF) {
+        if (mfl->opts[MFO_IGNORE_CASHE_REP_GUARD]) {
+            // dont allow overidding cache replacement in mellanox OS env
+            return MFE_OCR_NOT_SUPPORTED;
+        }
         *needs_cache_replacement = 1;
         return MFE_OK;
     }
@@ -1974,7 +1975,7 @@ int mfl_com_lock(mflash* mfl)
 {
     int rc;
     // if we already locked the semaphore we dont want to re-lock it
-    if (mfl->is_locked) {
+    if (mfl->is_locked && (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] != ATBM_INBAND || mfl->opts[MFO_IGNORE_CASHE_REP_GUARD] == 1)) { // on inband w/o ocr we need to extend the lock
         return MFE_OK;
     }
     rc = mfl->f_lock(mfl, 1);
@@ -1986,6 +1987,11 @@ int mfl_com_lock(mflash* mfl)
     return MFE_OK;
 }
 
+int     mf_release_semaphore(mflash* mfl)
+{
+    return release_semaphore(mfl, 1);
+}
+
 int release_semaphore(mflash* mfl, int ignore_writer_lock) {
     int rc;
     if (mfl->is_locked && mfl->f_lock && (!mfl->writer_lock || ignore_writer_lock)) {
@@ -2037,8 +2043,9 @@ int gen4_flash_init_com(mflash* mfl, flash_params_t* flash_params, u_int8_t init
 
 }
 
-int is4_flash_init(mflash* mfl, flash_params_t* flash_params) {
-
+int is4_flash_init(mflash* mfl, flash_params_t* flash_params)
+{
+    mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] = ATBM_NO;
     mfl->f_lock           = is4_flash_lock;
     return gen4_flash_init_com(mfl, flash_params, 0);
 }
@@ -2051,24 +2058,24 @@ int sx_flash_init_direct_access(mflash* mfl, flash_params_t* flash_params)
 
 int fifth_gen_init_direct_access(mflash* mfl, flash_params_t* flash_params)
 {
-
     mfl->f_lock           = connectib_flash_lock;
     return gen4_flash_init_com(mfl, flash_params, 0);
 }
 
+/*
 typedef int (*f_sx_flash_lock)      (mflash* mfl, int lock_state);
 typedef int (*f_sx_erase_sect)      (mflash* mfl, u_int32_t addr);
 typedef int (*f_sx_block_access)    (mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
 typedef int (*f_sx_get_flash_info)  (mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
+*/
 
 
-
-int sx_get_flash_info(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash)
+int sx_get_flash_info(mflash* mfl, flash_info_t* f_info, int *log2size, u_int8_t *no_flash)
 {
     int rc;
     int sem_rc;
     sem_rc = mfl_com_lock(mfl); CHECK_RC(sem_rc);
-    rc = sx_get_flash_info_by_type(mfl, type_index, log2size, no_flash);
+    rc = sx_get_flash_info_by_type(mfl, f_info, log2size, no_flash);
     sem_rc = release_semaphore(mfl, 0); CHECK_RC(sem_rc);
     return rc;
 }
@@ -2104,7 +2111,7 @@ int sx_erase_sect(mflash* mfl, u_int32_t addr)
     int rc;
     int sem_rc;
     sem_rc = mfl_com_lock(mfl); CHECK_RC(sem_rc);
-    rc = sx_erase_sect_by_type(mfl, addr);
+    rc = sx_erase_sect_by_type(mfl, addr, mfl->attr.sector_size);
     sem_rc = release_semaphore(mfl, 0); CHECK_RC(sem_rc);
     return rc;
 }
@@ -2159,7 +2166,7 @@ int flash_init_inband_access(mflash* mfl, flash_params_t* flash_params)
     mfl->supp_sr_mod = 0;
 
     // Get the flash attribute
-    rc = st_spi_fill_attr(mfl, flash_params);   CHECK_RC(rc);
+    rc = st_spi_fill_attr(mfl, flash_params); CHECK_RC(rc);
     update_max_write_size(mfl); CHECK_RC(rc);
     return MFE_OK;
 }
@@ -2270,7 +2277,12 @@ int cntx_flash_init(mflash* mfl, flash_params_t* flash_params)
     if ( mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_TOOLS_CMDIF &&\
          mfl->opts[MFO_IGNORE_CASHE_REP_GUARD] == 0 &&\
          mfl->opts[MFO_CX3_FW_ACCESS_EN]) {
+        #ifdef UEFI_BUILD
+        // tools CMDIF not supported in UEFI
+        rc = ME_NOT_IMPLEMENTED;
+        #else
         rc = tcif_cr_mbox_supported(mfl->mf);
+        #endif
         // init with direct access if not supported
         if (rc == ME_NOT_IMPLEMENTED || rc == ME_CMDIF_NOT_SUPP ) {
             mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] = ATBM_NO;
@@ -2314,14 +2326,43 @@ int     mf_write       (mflash* mfl, u_int32_t addr, u_int32_t len, u_int8_t* da
     return mfl->f_write(mfl, addr, len, data);
 }
 
-int     mf_erase_sector(mflash* mfl, u_int32_t addr) {
+static int erase_com(mflash* mfl, u_int32_t addr, unsigned int sector_size, int erase_cmd)
+{
+    int rc;
+    u_int32_t backup_sector_size;
+    int backup_erase_command;
     if (addr >= mfl->attr.size) {
         return MFE_OUT_OF_RANGE;
     }
     // Locking semaphore for the entire existence of the mflash obj for write and erase only.
-    int rc = mfl_com_lock(mfl); CHECK_RC(rc);
+    rc = mfl_com_lock(mfl); CHECK_RC(rc);
     mfl->writer_lock = 1;
-    return mfl->f_erase_sect(mfl, addr);
+    backup_sector_size = mfl->attr.sector_size;
+    backup_erase_command = mfl->attr.erase_command;
+    mfl->attr.sector_size = sector_size;
+    mfl->attr.erase_command = erase_cmd;
+    rc = mfl->f_erase_sect(mfl, addr);
+    mfl->attr.sector_size = backup_sector_size;
+    mfl->attr.erase_command = backup_erase_command;
+    return rc;
+}
+
+int     mf_erase(mflash* mfl, u_int32_t addr) {
+    return erase_com(mfl, addr, mfl->attr.sector_size, mfl->attr.erase_command);
+}
+
+int     mf_erase_64k_sector(mflash* mfl, u_int32_t addr) {
+    if (!mfl->attr.support_sub_and_sector) {
+        return MFE_UNSUPPORTED_ERASE_OPERATION;
+    }
+    return erase_com(mfl, addr, FSS_64KB, SFC_SE);
+}
+
+int     mf_erase_4k_sector(mflash* mfl, u_int32_t addr) {
+    if (!mfl->attr.support_sub_and_sector) {
+        return MFE_UNSUPPORTED_ERASE_OPERATION;
+    }
+    return erase_com(mfl, addr, FSS_4KB, SFC_SSE);
 }
 
 int mf_open_ignore_lock(mflash* mfl) {
@@ -2352,6 +2393,7 @@ int get_dev_info(mflash* mfl)
     // get hw id
     // Special case for MLNX OS getting dev_id using REG MGIR
     if (dev_flags & MDEVS_MLNX_OS) {
+    #ifndef UEFI_BUILD
         reg_access_status_t rc;
         struct register_access_sib_mgir mgir;
         memset(&mgir, 0, sizeof(mgir));
@@ -2372,6 +2414,11 @@ int get_dev_info(mflash* mfl)
                 mfl->attr.rev_id = 0; //WA: MGIR should have also hw_rev_id and then we can use it.
             }
         }
+    #else
+        // no MLNX_OS in UEFI, no mgir register in UEFI package
+        // we should never reach here
+        return MFE_UNKOWN_ACCESS_TYPE;
+    #endif
     } else {
         MREAD4(HW_DEV_ID, &dev_id);
         if (dev_id == CR_LOCK_HW_ID) {
@@ -2384,7 +2431,7 @@ int get_dev_info(mflash* mfl)
     if (dev_flags & MDEVS_MLNX_OS) {
           mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] = ATBM_MLNXOS_CMDIF;
     } else if (dev_flags & MDEVS_IB){
-              mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] = ATBM_INBAND;
+          mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] = ATBM_INBAND;
     } else { // not mlnxOS or IB device - check HW ID to determine Access type
          if (HAS_ICMD_IF(mfl->attr.hw_dev_id)){
              if (mfl->opts[MFO_IGNORE_CASHE_REP_GUARD] == 0) {
@@ -2403,7 +2450,6 @@ int get_dev_info(mflash* mfl)
 int mf_open_fw(mflash* mfl, flash_params_t* flash_params, int num_of_banks)
 {
     int rc;
-
     if (!mfl) {
         return MFE_BAD_PARAMS;
     }
@@ -2411,12 +2457,18 @@ int mf_open_fw(mflash* mfl, flash_params_t* flash_params, int num_of_banks)
     if (mfl->access_type == MFAT_MFILE ) {
         rc = get_dev_info(mfl); CHECK_RC(rc);
 
+#ifndef UEFI_BUILD
+        trm_sts trm_rc;
+        trm_rc = trm_create(&(mfl->trm), mfl->mf);
+        if (trm_rc) {
+            return trm2mfe_err(trm_rc);
+        }
+#endif
+
         mfl->opts[MFO_NUM_OF_BANKS] = spi_get_num_of_flashes(num_of_banks);
         rc = spi_update_num_of_banks(mfl, num_of_banks);CHECK_RC(rc);
 
-        if (mfl->attr.hw_dev_id == 23108 || mfl->attr.hw_dev_id == 25208 || mfl->attr.hw_dev_id == 24204 || mfl->attr.hw_dev_id == 25204) {
-            rc = MFE_OLD_DEVICE_TYPE;
-        } else if (IS_CONNECTX_4TH_GEN_FAMILY(mfl->attr.hw_dev_id)) {
+        if (IS_CONNECTX_4TH_GEN_FAMILY(mfl->attr.hw_dev_id)) {
             rc = cntx_flash_init(mfl, flash_params);
         } else if (IS_IS4_FAMILY(mfl->attr.hw_dev_id)) {
             rc = is4_flash_init(mfl, flash_params);
@@ -2461,7 +2513,6 @@ int     mf_opend_int       (mflash** pmfl, void* access_dev, int num_of_banks, f
     	// open mfile as uefi
         if (!((*pmfl)->mf = mopen_fw_ctx(access_dev, ((uefi_dev_extra_t*)dev_extra)->fw_cmd_func,\
                 ((uefi_dev_extra_t*)dev_extra)->dev_info)) ){
-    		free((*pmfl));
     		return MFE_NOMEM;
     	}
     	// fill some device information
@@ -2470,7 +2521,6 @@ int     mf_opend_int       (mflash** pmfl, void* access_dev, int num_of_banks, f
     		(*pmfl)->attr.rev_id = ((uefi_dev_extra_t*)dev_extra)->dev_info->rev_id;
     	}
     }
-
     rc = mf_open_fw(*pmfl, flash_params, num_of_banks);
     return rc;
 }
@@ -2541,7 +2591,12 @@ void     mf_close       (mflash* mfl) {
     if (mfl->mf && (mfl)->opts[MFO_CLOSE_MF_ON_EXIT]) {
         mclose(mfl->mf);
     }
-
+#ifndef UEFI_BUILD
+    if (mfl->trm) {
+        trm_destroy(mfl->trm);
+        mfl->trm = (trm_ctx)NULL;
+    }
+#endif
     free(mfl);
     return;
 }
@@ -2626,6 +2681,10 @@ const char*   mf_err2str (int err_code) {
         return "MFE_CMDIF_TIMEOUT_ERR";
     case MFE_CMDIF_GO_BIT_BUSY:
         return "MFE_CMDIF_GO_BIT_BUSY";
+    case MFE_CMDIF_BAD_OP:
+        return "MFE_CMDIF_BAD_OP";
+    case MFE_MISSING_KEY:
+        return "No key was set";
     case MFE_MISMATCH_KEY:
         return "The given key is incorrect";
     case MFE_UNKNOWN_REG:
@@ -2650,6 +2709,8 @@ const char*   mf_err2str (int err_code) {
         return "MFE_UNKOWN_ACCESS_TYPE";
     case MFE_UNSUPPORTED_DEVICE:
         return "MFE_UNSUPPORTED_DEVICE";
+    case MFE_UNSUPPORTED_ERASE_OPERATION:
+        return "MFE_UNSUPPORTED_ERASE_OPERATION";
     case MFE_OLD_DEVICE_TYPE:
         return "MFE_OLD_DEVICE_TYPE";
     case MFE_ICMD_INIT_FAILED:
@@ -2698,11 +2759,29 @@ const char*   mf_err2str (int err_code) {
         return "Access to device should be through configuration cycles.";
     case MFE_ILLEGAL_BANK_NUM:
         return "MFE_ILLEGAL_BANK_NUM";
+    case MFE_OCR_NOT_SUPPORTED:
+        return "Direct flash access is not supported.";
     default:
         return "Unknown error";
     }
 }
 
+#ifndef UEFI_BUILD
+int trm2mfe_err(trm_sts rc)
+{
+    switch (rc) {
+    case TRM_STS_DEV_NOT_SUPPORTED:
+        return MFE_UNSUPPORTED_DEVICE;
+    case TRM_STS_CR_ACCESS_ERR:
+        return MFE_CR_ERROR;
+    case TRM_STS_MEM_ERROR:
+        return MFE_NOMEM;
+    default:
+        return MFE_ERROR;
+    }
+}
+#endif
+
 int     mf_set_opt     (mflash* mfl, MfOpt opt, int  val) {
     if ((int)opt < 0 || opt >= MFO_LAST) {
         return MFE_BAD_PARAMS;
@@ -2751,7 +2830,8 @@ int     mf_read_modify_status_winbond (mflash *mfl, u_int8_t bank_num, u_int8_t
     int rc;
 
     rc = set_bank_int(mfl, bank_num); CHECK_RC(rc);
-    if ( mfl->attr.vendor == FV_WINBOND &&  mfl->attr.type == FMT_WINBOND) {
+    if ( (mfl->attr.vendor == FV_WINBOND &&  mfl->attr.type == FMT_WINBOND) ||
+         (mfl->attr.vendor ==  FV_S25FLXXXX && mfl->attr.type == FMT_S25FL116K)) {
         /*
          * if we have 2 status registers, winbond are allowing us to write both of them
          * in a single command WRSR  status_reg1 located in MSB, status_reg2 after status_reg1
@@ -2861,7 +2941,7 @@ int     mf_set_quad_en (mflash *mfl, u_int8_t quad_en)
         return MFE_NOT_SUPPORTED_OPERATION;
     }
     for (bank = 0; bank < mfl->attr.banks_num; bank++) {
-        if (mfl->attr.vendor == FV_WINBOND) {
+        if (mfl->attr.vendor == FV_WINBOND ||  mfl->attr.vendor == FV_S25FLXXXX) {
             rc = mf_read_modify_status_winbond(mfl, bank, 0, quad_en, QUAD_EN_OFFSET, 1); CHECK_RC(rc);
         } else if (mfl->attr.vendor == FV_ST) {
             rc = mf_read_modify_status_new(mfl, bank, SFC_RDNVR, SFC_WRNVR, !quad_en, QUAD_EN_OFFSET_ST, 1, 2); CHECK_RC(rc);
@@ -2879,7 +2959,7 @@ int mf_get_quad_en(mflash* mfl, u_int8_t *quad_en_p)
         return MFE_NOT_SUPPORTED_OPERATION;
     }
 
-    if (mfl->attr.vendor == FV_WINBOND) {
+    if (mfl->attr.vendor == FV_WINBOND || mfl->attr.vendor == FV_S25FLXXXX) {
         return  mf_get_param_int(mfl, quad_en_p, SFC_RDSR2, QUAD_EN_OFFSET, 1, 1, 1);
     } else if (mfl->attr.vendor == FV_ST) {
         return  mf_get_param_int(mfl, quad_en_p, SFC_RDNVR, QUAD_EN_OFFSET_ST, 1, 2, 0);
@@ -2970,18 +3050,45 @@ int     mf_get_write_protect(mflash *mfl, u_int8_t bank_num, write_protect_info_
 
 int mf_enable_hw_access(mflash* mfl, u_int64_t key)
 {
+#ifndef UEFI_BUILD
     int rc;
     rc = tcif_hw_access(mfl->mf, key, 0 /* Unlock */);
     return (rc == ME_CMDIF_UNKN_TLV) ? MFE_MISMATCH_KEY : MError2MfError(rc);
-
+#else
+    (void)mfl;
+    (void)key;
+    return MFE_NOT_SUPPORTED_OPERATION;
+#endif
 }
 
 int mf_disable_hw_access(mflash* mfl)
 {
+#ifndef UEFI_BUILD
     int rc;
     // We need to release the semaphore because we will not have any access to semaphore after disabling the HW access
     rc = release_semaphore(mfl, 1); CHECK_RC(rc);
     rc = tcif_hw_access(mfl->mf, 0, 1 /* Lock */);
-    return (rc == ME_CMDIF_UNKN_TLV) ? MFE_MISMATCH_KEY : MError2MfError(rc);
+    // translate to operation specific errors
+    switch (rc) {
+    case ME_CMDIF_UNKN_TLV:
+        rc = MFE_MISMATCH_KEY;
+        break;
+    case ME_CMDIF_BAD_OP:
+        rc = MFE_MISSING_KEY;
+        break;
+    default:
+        rc =  MError2MfError(rc);
+        break;
+    }
+    return rc;
+#else
+    (void)mfl;
+    return MFE_NOT_SUPPORTED_OPERATION;
+#endif
+}
+
+mfile* mf_get_mfile(mflash* mfl)
+{
+    return mfl->mf;
 }
 
diff --git a/mflash/mflash.h b/mflash/mflash.h
index bcaba6f..f0b255a 100644
--- a/mflash/mflash.h
+++ b/mflash/mflash.h
@@ -1,4 +1,9 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ *
+ * mflash.h - Mellanox Technilogies LTD. Flash access lib heared file
+ * ==================================================================
+ *
+ * Copyright (c) 2005 Mellanox Technologies Ltd.  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
@@ -28,14 +33,14 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- *  Version: $Id$
+ *  Version: $Id: $
  *
  */
-
 #ifndef MFLASH_H
 #define MFLASH_H
 
 #include <compatibility.h>
+#include <mtcr.h>
 #include "mflash_types.h"
 #include "mflash_common_structs.h"
 
@@ -121,7 +126,14 @@ void     mf_close       (mflash* mfl);
 //
 int     mf_read        (mflash* mfl, u_int32_t addr, u_int32_t len, u_int8_t* data);
 int     mf_write       (mflash* mfl, u_int32_t addr, u_int32_t len, u_int8_t* data);
-int     mf_erase_sector(mflash* mfl, u_int32_t addr);
+// mf_erase performs an erase on the smallest block
+int     mf_erase(mflash* mfl, u_int32_t addr);
+// adv erasing
+int     mf_erase_64k_sector(mflash* mfl, u_int32_t addr);
+int     mf_erase_4k_sector(mflash* mfl, u_int32_t addr);
+
+// swap between erasing 4KB or 64KB chunks (performance optimization)
+
 
 //
 // Crspace access through mflash:
@@ -154,7 +166,10 @@ int     mf_get_opt     (mflash* mfl, MfOpt opt, int *val);
 
 int     mf_enable_hw_access(mflash* mfl, u_int64_t key);
 int     mf_disable_hw_access(mflash* mfl);
-int     mf_release_semaphore();
+int     mf_release_semaphore(mflash* mfl);
+
+// get mfile object
+mfile* mf_get_mfile(mflash* mfl);
 
 //
 // err code to string translation for printing.
diff --git a/mflash/mflash_access_layer.c b/mflash/mflash_access_layer.c
index 76f9af9..f5e6836 100755
--- a/mflash/mflash_access_layer.c
+++ b/mflash/mflash_access_layer.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #include <stdio.h>
@@ -39,14 +37,12 @@
 #include <mtcr.h>
 #include <reg_access.h>
 
-#ifndef UEFI_BUILD
-#include <tools_res_mgmt.h>
-#endif
-
 #include "mflash_types.h"
 #include "mflash_pack_layer.h"
 #include "mflash_access_layer.h"
 
+extern flash_info_t g_flash_info_arr[];
+
  // On windows we don't support cmdIf access!
 int check_access_type(mflash* mfl)
 //TODO: re-write in a more elegant way.
@@ -74,14 +70,17 @@ int check_access_type(mflash* mfl)
 }
 
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash)
+int sx_get_flash_info_by_type(mflash* mfl, flash_info_t *f_info, int *log2size, u_int8_t *no_flash)
 {
     int rc;
     u_int8_t vendor, type, capacity;
     u_int32_t jedec_id;
+    unsigned type_index = 0;
+    u_int8_t support_sub_and_sector = 0;
+
 
     rc = check_access_type( mfl); CHECK_RC(rc);
-    rc = com_get_jedec(mfl->mf, get_bank_int(mfl), &jedec_id, &(mfl->attr.fw_flash_sector_sz)); CHECK_RC(rc);
+    rc = com_get_jedec(mfl->mf, get_bank_int(mfl), &jedec_id, &(mfl->attr.fw_flash_sector_sz), &support_sub_and_sector); CHECK_RC(rc);
     //printf("-D- jedec_id = %#x\n", jedec_id);
     rc = get_info_from_jededc_id(jedec_id, &vendor, &type, &capacity); CHECK_RC(rc);
     // Return there is no flash when all the params are 0xff
@@ -89,10 +88,12 @@ int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size,
         *no_flash = 1;
         return MFE_OK;
     }
-    rc = get_type_index_by_vendor_and_type(vendor, type, type_index); CHECK_RC(rc);
-    rc = get_log2size_by_capcity(*type_index, capacity, log2size);    CHECK_RC(rc);
-    return MFE_OK;
+    rc = get_type_index_by_vendor_and_type(vendor, type, &type_index); CHECK_RC(rc);
+    rc = get_log2size_by_capcity(type_index, capacity, log2size);    CHECK_RC(rc);
 
+    memcpy(f_info, &(g_flash_info_arr[type_index]), sizeof(flash_info_t));
+    f_info->support_sub_and_sector = support_sub_and_sector;
+    return MFE_OK;
 }
 
 int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data)
@@ -133,13 +134,13 @@ static int lock_flash_programing_sem(mflash* mfl)
 {
 #ifndef UEFI_BUILD
     int rc;
-    if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_ICMD) {
-        rc = trm_lock(mfl->mf, TRM_RES_FLASH_PROGRAMING, MAX_FLASH_PROG_SEM_RETRY_CNT);
+    if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_ICMD || mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_INBAND) {
+        rc = trm_lock(mfl->trm, TRM_RES_FLASH_PROGRAMING, MAX_FLASH_PROG_SEM_RETRY_CNT);
         if (rc && rc != TRM_STS_RES_NOT_SUPPORTED) {
             return MFE_SEM_LOCKED;
         }
     } else if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_TOOLS_CMDIF) {
-        rc = trm_lock(mfl->mf, TRM_RES_HCR_FLASH_PROGRAMING, MAX_FLASH_PROG_SEM_RETRY_CNT);
+        rc = trm_lock(mfl->trm, TRM_RES_HCR_FLASH_PROGRAMING, MAX_FLASH_PROG_SEM_RETRY_CNT);
         if (rc && rc != TRM_STS_RES_NOT_SUPPORTED) {
             return MFE_SEM_LOCKED;
         }
@@ -152,13 +153,13 @@ static int unlock_flash_programing_sem(mflash* mfl)
 {
 #ifndef UEFI_BUILD
     int rc;
-    if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_ICMD) {
-        rc = trm_unlock(mfl->mf, TRM_RES_FLASH_PROGRAMING);
+    if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_ICMD || mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_INBAND) {
+        rc = trm_unlock(mfl->trm, TRM_RES_FLASH_PROGRAMING);
         if (rc && rc != TRM_STS_RES_NOT_SUPPORTED) {
             return MFE_SEM_LOCKED;
         }
     } else if (mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_TOOLS_CMDIF) {
-        rc = trm_unlock(mfl->mf, TRM_RES_HCR_FLASH_PROGRAMING);
+        rc = trm_unlock(mfl->trm, TRM_RES_HCR_FLASH_PROGRAMING);
         if (rc && rc != TRM_STS_RES_NOT_SUPPORTED) {
             return MFE_SEM_LOCKED;
         }
@@ -182,14 +183,14 @@ int sx_flash_lock_by_type(mflash* mfl, int lock_state)
     return rc;
 }
 
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr)
+int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr, u_int32_t erase_size)
 {
     int rc, bank;
     u_int32_t flash_addr;
 
     rc = mfl_get_bank_info(mfl, addr, &flash_addr, &bank); CHECK_RC(rc);
     rc = check_access_type( mfl); CHECK_RC(rc);
-    rc = common_erase_sector(mfl->mf, flash_addr, bank); CHECK_RC(rc);
+    rc = common_erase_sector(mfl->mf, flash_addr, bank, erase_size); CHECK_RC(rc);
     return MFE_OK;
 }
 
@@ -198,7 +199,7 @@ int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr)
     int rc;
     if (mfl->access_type == MFAT_UEFI || mfl->opts[MFO_FW_ACCESS_TYPE_BY_MFILE] == ATBM_MLNXOS_CMDIF) {
         // No CR-Space access - use mfpa register
-        rc = run_mfpa_command(mfl->mf, REG_ACCESS_METHOD_SET, get_bank_int(mfl), boot_addr, NULL, NULL, NULL); CHECK_RC(rc);
+        rc = run_mfpa_command(mfl->mf, REG_ACCESS_METHOD_SET, get_bank_int(mfl), boot_addr, NULL, NULL, NULL, NULL); CHECK_RC(rc);
     }
     return MFE_OK;
 }
diff --git a/mflash/mflash_access_layer.h b/mflash/mflash_access_layer.h
index 23931fa..622e79e 100755
--- a/mflash/mflash_access_layer.h
+++ b/mflash/mflash_access_layer.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,26 +28,22 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef MFLASH_ACCESS_LAYER_H_
 #define MFLASH_ACCESS_LAYER_H_
 
 #include <compatibility.h>
-//#include "cib_cif.h"
 
 #include "mflash_common_structs.h"
 
 #define BOOT_CR_SPACE_ADDR 0xf0000
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
+int sx_get_flash_info_by_type(mflash* mfl, flash_info_t* type_index, int *log2size, u_int8_t *no_flash);
 int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
 int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
 int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
+int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr, u_int32_t erase_size);
 int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
 
 
diff --git a/mflash/mflash_common_structs.h b/mflash/mflash_common_structs.h
index 5d7894b..f03a089 100644
--- a/mflash/mflash_common_structs.h
+++ b/mflash/mflash_common_structs.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef MFLASH_COMMON_STRUCTS_H
@@ -84,11 +82,6 @@ typedef struct flash_attr {
     u_int32_t sector_size;
 
     int       num_erase_blocks;         // Number of sector defs.
-    struct {
-        unsigned long sector_size;      // Byte size of sector
-        int           num_sectors;      // Num sectors of this size
-        u_int32_t     sector_mask;      // Sector mask
-    } erase_block[8];
 
     //
     // bank_size:   Different bank means a different chip sellect or gpio settings is needed when crossing
@@ -127,9 +120,26 @@ typedef struct flash_attr {
     // the flash sector size as seen by FW
     u_int32_t fw_flash_sector_sz;
 
+    u_int8_t support_sub_and_sector; // true if flash can work in both 64KB and 4KB sectors
+
 
 } flash_attr;
 
+typedef struct flash_info {
+    const char *name;
+    u_int8_t vendor;
+    u_int8_t type;
+    int command_set;
+    int erase_command;
+    u_int32_t sector_size;
+    u_int8_t support_sub_and_sector;
+    u_int8_t quad_en_support;
+    u_int8_t write_protected_support;
+    u_int8_t protect_sub_and_sector;
+    u_int8_t dummy_cycles_support;
+} flash_info_t;
+
+
 #endif // MFLASH_COMMON_STRUCTS_H
 
 
diff --git a/mflash/mflash_pack_layer.c b/mflash/mflash_pack_layer.c
index b9d6f9c..e9ecdb8 100755
--- a/mflash/mflash_pack_layer.c
+++ b/mflash/mflash_pack_layer.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #include <stdio.h>
@@ -86,17 +84,23 @@ int sx_st_block_access(mfile *mf, u_int32_t flash_addr, u_int8_t bank, u_int32_t
 }
 
 
-int common_erase_sector(mfile *mf, u_int32_t addr, u_int8_t flash_bank)
+int common_erase_sector(mfile *mf, u_int32_t addr, u_int8_t flash_bank, u_int32_t erase_size)
 {
 	struct register_access_mfbe    mfbe;
-
+    if (addr & (erase_size-1)) {
+        return MFE_ERASE_ERROR;
+    }
     memset(&mfbe, 0, sizeof(mfbe));
     mfbe.address = addr;
     mfbe.fs      = flash_bank;
+    if (erase_size == FSS_64KB) {
+        mfbe.bulk_64kb_erase = 1;
+    }
     return MError2MfError(reg_access_mfbe (mf, REG_ACCESS_METHOD_SET, &mfbe));
 }
 
-int run_mfpa_command(mfile *mf, u_int8_t access_cmd, u_int8_t flash_bank, u_int32_t boot_address, u_int32_t *jedec_p, int *num_of_banks, u_int32_t* fw_sector_size)
+int run_mfpa_command(mfile *mf, u_int8_t access_cmd, u_int8_t flash_bank, u_int32_t boot_address,\
+                     u_int32_t *jedec_p, int *num_of_banks, u_int32_t* fw_sector_size, u_int8_t* support_sub_and_sector)
 {
 	struct register_access_mfpa    mfpa;
     int rc;
@@ -138,22 +142,26 @@ int run_mfpa_command(mfile *mf, u_int8_t access_cmd, u_int8_t flash_bank, u_int3
         }
     }
 
+    if (support_sub_and_sector != NULL) {
+        *support_sub_and_sector = mfpa.bulk_64kb_erase_en;
+    }
+
     return MFE_OK;
 }
 
 int get_num_of_banks(mfile *mf)
 {
     int num_of_banks;
-    int rc = run_mfpa_command(mf, REG_ACCESS_METHOD_GET, 0, 0, NULL, &num_of_banks, NULL);
+    int rc = run_mfpa_command(mf, REG_ACCESS_METHOD_GET, 0, 0, NULL, &num_of_banks, NULL, NULL);
     if (rc) {
         return -1;
     }
     return num_of_banks;
 }
 
-int com_get_jedec(mfile *mf, u_int8_t flash_bank, u_int32_t *jedec_p, u_int32_t* fw_flash_sector_size)
+int com_get_jedec(mfile *mf, u_int8_t flash_bank, u_int32_t *jedec_p, u_int32_t* fw_flash_sector_size, u_int8_t* supp_sub_and_sector)
 {
-    return run_mfpa_command(mf, REG_ACCESS_METHOD_GET, flash_bank, 0, jedec_p, NULL, fw_flash_sector_size);
+    return run_mfpa_command(mf, REG_ACCESS_METHOD_GET, flash_bank, 0, jedec_p, NULL, fw_flash_sector_size, supp_sub_and_sector);
 }
 
 /*
@@ -293,6 +301,8 @@ MfError MError2MfError(MError rc) {
 
    case ME_CMDIF_UNKN_TLV:
        return MFE_CMDIF_UNKN_TLV;
+   case ME_CMDIF_BAD_OP:
+       return MFE_CMDIF_BAD_OP;
    default:
 	   break;
    }
diff --git a/mflash/mflash_pack_layer.h b/mflash/mflash_pack_layer.h
index 5bdaf4e..f36859c 100755
--- a/mflash/mflash_pack_layer.h
+++ b/mflash/mflash_pack_layer.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,13 @@
  * 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.
+ */
+
+/*
+ * mflash_inband.h
  *
- *  Version: $Id$
- *
+ *  Created on: Jul 6, 2011
+ *      Author: mohammad
  */
 
 #ifndef MFLASH_COMMON_H_
@@ -38,6 +43,12 @@
 #include "mflash_types.h"
 #include "mflash_common_structs.h"
 
+#ifndef UEFI_BUILD
+#include <tools_res_mgmt.h>
+#else
+typedef void* trm_ctx;
+#endif
+
 // TODO: use: (int)log2((float)num)  
 #define NEAREST_POW2(num)\
 	(num) < (256) ? ((num) < (128) ? ((num) < (64) ? ((num) < (32) ? ((num) < (16) ? ((num) < (8) ? (4) : (8)): (16)): (32)): (64)): (128)): (256)
@@ -64,7 +75,7 @@ typedef int (*f_mf_erase_sect)(mflash* mfl, u_int32_t addr);
 typedef int (*f_mf_reset)     (mflash* mfl);
 
 typedef int (*f_st_spi_status)(mflash* mfl, u_int8_t op_type, u_int8_t* status);
-typedef int (*f_mf_get_info)  (mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
+typedef int (*f_mf_get_info)  (mflash* mfl, flash_info_t *f_info, int *log2size, u_int8_t *no_flash);
 /////////////////////////////////////////////
 //
 // MFlash struct
@@ -104,6 +115,7 @@ struct mflash {
 	char            last_err_str[MFLASH_ERR_STR_SIZE];
 
 	u_int8_t   access_type; //0 = mfile , 1 = uefi
+	trm_ctx trm;
 
 };
 
@@ -184,11 +196,12 @@ int sx_st_block_access(mfile *mf, u_int32_t flash_addr, u_int8_t bank, u_int32_t
 		u_int8_t method);
 
 
-int common_erase_sector(mfile *mf, u_int32_t addr, u_int8_t flash_bank);
+int common_erase_sector(mfile *mf, u_int32_t addr, u_int8_t flash_bank, u_int32_t erase_size);
 
-int run_mfpa_command(mfile *mf, u_int8_t access_cmd, u_int8_t flash_bank, u_int32_t boot_address, u_int32_t *jedec_p, int *num_of_banks, u_int32_t* fw_flash_sector_sz);
+int run_mfpa_command(mfile *mf, u_int8_t access_cmd, u_int8_t flash_bank, u_int32_t boot_address,\
+                    u_int32_t *jedec_p, int *num_of_banks, u_int32_t* fw_flash_sector_sz, u_int8_t* supp_sub_and_sector);
 
-int com_get_jedec(mfile *mf, u_int8_t flash_bank, u_int32_t *jedec_p, u_int32_t* fw_flash_sector_sz);
+int com_get_jedec(mfile *mf, u_int8_t flash_bank, u_int32_t *jedec_p, u_int32_t* fw_flash_sector_sz, u_int8_t* supp_sub_and_sector);
 int get_num_of_banks(mfile *mf);
 int get_info_from_jededc_id(u_int32_t jededc_id, u_int8_t *vendor, u_int8_t* type, u_int8_t* capacity);
 int get_type_index_by_vendor_and_type(u_int8_t vendor, u_int8_t type, unsigned *type_index);
diff --git a/mflash/mflash_types.h b/mflash/mflash_types.h
index 2572adc..f9ff938 100644
--- a/mflash/mflash_types.h
+++ b/mflash/mflash_types.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,14 +28,17 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef MFLASH_TYPES_H
 #define MFLASH_TYPES_H
 
+typedef enum {
+    FSS_4KB = 0x1000,
+    FSS_64KB = 0x10000
+} Flash_Sector_Size_t;
+
+
 typedef enum MfError {
     MFE_OK = 0,
     MFE_ERROR,
@@ -63,7 +67,9 @@ typedef enum MfError {
     MFE_CMDIF_TIMEOUT_ERR,
     MFE_CMDIF_GO_BIT_BUSY,
     MFE_CMDIF_UNKN_TLV,
+    MFE_CMDIF_BAD_OP,
     MFE_MISMATCH_KEY,
+    MFE_MISSING_KEY,
     MFE_UNKNOWN_REG,
     MFE_DIRECT_FW_ACCESS_DISABLED,
     MFE_MANAGED_SWITCH_NOT_SUPPORTED,
@@ -75,6 +81,7 @@ typedef enum MfError {
     MFE_SECTORS_NUM_NOT_POWER_OF_TWO,
     MFE_UNKOWN_ACCESS_TYPE,
     MFE_UNSUPPORTED_DEVICE,
+    MFE_UNSUPPORTED_ERASE_OPERATION,
     MFE_OLD_DEVICE_TYPE,
     MFE_ICMD_INIT_FAILED,
     MFE_ICMD_NOT_SUPPORTED,
@@ -100,7 +107,7 @@ typedef enum MfError {
     MFE_REG_ACCESS_SIZE_EXCCEEDS_LIMIT,
     MFE_PCICONF,
     MFE_ILLEGAL_BANK_NUM,
-
+    MFE_OCR_NOT_SUPPORTED,
 
     MFE_LAST
 } MfError;
diff --git a/mft_utils/Makefile.am b/mft_utils/Makefile.am
index ad9ad8e..43df9fe 100644
--- a/mft_utils/Makefile.am
+++ b/mft_utils/Makefile.am
@@ -32,7 +32,7 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 USER_DIR = $(top_srcdir)
-INCLUDES = -I. -I$(USER_DIR)/common
+AM_CPPFLAGS = -I. -I$(USER_DIR)/common
 
 AM_CFLAGS = -MD -pipe -Wall -W -Werror
 
@@ -40,5 +40,5 @@ noinst_HEADERS = mft_sig_handler.h errmsg.h
 
 noinst_LIBRARIES = libmftutils.a
 
-libmftutils_a_SOURCES =  mft_sig_handler.c errmsg.cpp
+libmftutils_a_SOURCES =  mft_sig_handler.c errmsg.cpp calc_hw_crc.c mlarge_buffer.cpp
 
diff --git a/mft_utils/Makefile.in b/mft_utils/Makefile.in
index d6a56b5..a70f1cc 100644
--- a/mft_utils/Makefile.in
+++ b/mft_utils/Makefile.in
@@ -130,7 +130,8 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 libmftutils_a_AR = $(AR) $(ARFLAGS)
 libmftutils_a_LIBADD =
-am_libmftutils_a_OBJECTS = mft_sig_handler.$(OBJEXT) errmsg.$(OBJEXT)
+am_libmftutils_a_OBJECTS = mft_sig_handler.$(OBJEXT) errmsg.$(OBJEXT) \
+	calc_hw_crc.$(OBJEXT) mlarge_buffer.$(OBJEXT)
 libmftutils_a_OBJECTS = $(am_libmftutils_a_OBJECTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -283,6 +284,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -340,11 +342,11 @@ top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 USER_DIR = $(top_srcdir)
-INCLUDES = -I. -I$(USER_DIR)/common
+AM_CPPFLAGS = -I. -I$(USER_DIR)/common
 AM_CFLAGS = -MD -pipe -Wall -W -Werror
 noinst_HEADERS = mft_sig_handler.h errmsg.h
 noinst_LIBRARIES = libmftutils.a
-libmftutils_a_SOURCES = mft_sig_handler.c errmsg.cpp
+libmftutils_a_SOURCES = mft_sig_handler.c errmsg.cpp calc_hw_crc.c mlarge_buffer.cpp
 all: all-am
 
 .SUFFIXES:
@@ -394,8 +396,10 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/calc_hw_crc.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/errmsg.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mft_sig_handler.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mlarge_buffer.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/mft_utils/calc_hw_crc.c b/mft_utils/calc_hw_crc.c
new file mode 100644
index 0000000..115000d
--- /dev/null
+++ b/mft_utils/calc_hw_crc.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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 "stdio.h"
+#include "string.h"
+#include <stdlib.h>
+
+#include "calc_hw_crc.h"
+
+u_int16_t crc16table2[256] = {
+            0x0000, 0x1BA1, 0x3742, 0x2CE3, 0x6E84, 0x7525, 0x59C6, 0x4267,
+            0xDD08, 0xC6A9, 0xEA4A, 0xF1EB, 0xB38C, 0xA82D, 0x84CE, 0x9F6F,
+            0x1A01, 0x01A0, 0x2D43, 0x36E2, 0x7485, 0x6F24, 0x43C7, 0x5866,
+            0xC709, 0xDCA8, 0xF04B, 0xEBEA, 0xA98D, 0xB22C, 0x9ECF, 0x856E,
+            0x3402, 0x2FA3, 0x0340, 0x18E1, 0x5A86, 0x4127, 0x6DC4, 0x7665,
+            0xE90A, 0xF2AB, 0xDE48, 0xC5E9, 0x878E, 0x9C2F, 0xB0CC, 0xAB6D,
+            0x2E03, 0x35A2, 0x1941, 0x02E0, 0x4087, 0x5B26, 0x77C5, 0x6C64,
+            0xF30B, 0xE8AA, 0xC449, 0xDFE8, 0x9D8F, 0x862E, 0xAACD, 0xB16C,
+            0x6804, 0x73A5, 0x5F46, 0x44E7, 0x0680, 0x1D21, 0x31C2, 0x2A63,
+            0xB50C, 0xAEAD, 0x824E, 0x99EF, 0xDB88, 0xC029, 0xECCA, 0xF76B,
+            0x7205, 0x69A4, 0x4547, 0x5EE6, 0x1C81, 0x0720, 0x2BC3, 0x3062,
+            0xAF0D, 0xB4AC, 0x984F, 0x83EE, 0xC189, 0xDA28, 0xF6CB, 0xED6A,
+            0x5C06, 0x47A7, 0x6B44, 0x70E5, 0x3282, 0x2923, 0x05C0, 0x1E61,
+            0x810E, 0x9AAF, 0xB64C, 0xADED, 0xEF8A, 0xF42B, 0xD8C8, 0xC369,
+            0x4607, 0x5DA6, 0x7145, 0x6AE4, 0x2883, 0x3322, 0x1FC1, 0x0460,
+            0x9B0F, 0x80AE, 0xAC4D, 0xB7EC, 0xF58B, 0xEE2A, 0xC2C9, 0xD968,
+            0xD008, 0xCBA9, 0xE74A, 0xFCEB, 0xBE8C, 0xA52D, 0x89CE, 0x926F,
+            0x0D00, 0x16A1, 0x3A42, 0x21E3, 0x6384, 0x7825, 0x54C6, 0x4F67,
+            0xCA09, 0xD1A8, 0xFD4B, 0xE6EA, 0xA48D, 0xBF2C, 0x93CF, 0x886E,
+            0x1701, 0x0CA0, 0x2043, 0x3BE2, 0x7985, 0x6224, 0x4EC7, 0x5566,
+            0xE40A, 0xFFAB, 0xD348, 0xC8E9, 0x8A8E, 0x912F, 0xBDCC, 0xA66D,
+            0x3902, 0x22A3, 0x0E40, 0x15E1, 0x5786, 0x4C27, 0x60C4, 0x7B65,
+            0xFE0B, 0xE5AA, 0xC949, 0xD2E8, 0x908F, 0x8B2E, 0xA7CD, 0xBC6C,
+            0x2303, 0x38A2, 0x1441, 0x0FE0, 0x4D87, 0x5626, 0x7AC5, 0x6164,
+            0xB80C, 0xA3AD, 0x8F4E, 0x94EF, 0xD688, 0xCD29, 0xE1CA, 0xFA6B,
+            0x6504, 0x7EA5, 0x5246, 0x49E7, 0x0B80, 0x1021, 0x3CC2, 0x2763,
+            0xA20D, 0xB9AC, 0x954F, 0x8EEE, 0xCC89, 0xD728, 0xFBCB, 0xE06A,
+            0x7F05, 0x64A4, 0x4847, 0x53E6, 0x1181, 0x0A20, 0x26C3, 0x3D62,
+            0x8C0E, 0x97AF, 0xBB4C, 0xA0ED, 0xE28A, 0xF92B, 0xD5C8, 0xCE69,
+            0x5106, 0x4AA7, 0x6644, 0x7DE5, 0x3F82, 0x2423, 0x08C0, 0x1361,
+            0x960F, 0x8DAE, 0xA14D, 0xBAEC, 0xF88B, 0xE32A, 0xCFC9, 0xD468,
+            0x4B07, 0x50A6, 0x7C45, 0x67E4, 0x2583, 0x3E22, 0x12C1, 0x0960};
+
+u_int16_t calc_hw_crc(u_int8_t* d, int size) {
+    int i;
+    u_int8_t* data = (u_int8_t*) malloc(sizeof(u_int8_t) * size);
+
+    memcpy(data, d, size);
+    data[0] = ~data[0];
+    data[1] = ~data[1];
+
+    unsigned crc = 0xffff;
+    for (i = 0; i < size; i++) {
+        int table_index = ((crc ^ data[i]) & 0xff);
+        crc = ((crc >> 8) ^ crc16table2[table_index]);
+    };
+    crc = ((crc << 8) & 0xff00) | ((crc >> 8) & 0xff);
+
+    free(data);
+    return crc;
+}
diff --git a/mflash/mflash_access_layer.h b/mft_utils/calc_hw_crc.h
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to mft_utils/calc_hw_crc.h
index 23931fa..b1627ec
--- a/mflash/mflash_access_layer.h
+++ b/mft_utils/calc_hw_crc.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,21 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
-
-#include <compatibility.h>
-//#include "cib_cif.h"
+#ifndef MFT_CALC_HW_CRC
+#define MFT_CALC_HW_CRC
 
-#include "mflash_common_structs.h"
+#include <tools_utils.h>
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
+u_int16_t calc_hw_crc(u_int8_t* data, int size);
 
+#ifdef __cplusplus
+}
+#endif
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+#endif
diff --git a/mft_utils/mft_sig_handler.c b/mft_utils/mft_sig_handler.c
index 449899e..6f5c47c 100644
--- a/mft_utils/mft_sig_handler.c
+++ b/mft_utils/mft_sig_handler.c
@@ -142,3 +142,18 @@ void mft_signal_set_msg(char* msg)
     s_interrupt_message = msg;
 }
 
+void mft_restore_and_raise()
+{
+    int sig;
+    sig = mft_signal_is_fired();
+    if (sig) {
+        // reset recieved signal
+        mft_signal_set_fired(0);
+        // retore prev handler
+        mft_signal_set_handling(0);
+        //raise signal to let the previous handle deal with it.
+        raise(sig);
+    }
+    mft_signal_set_handling(0);
+    return;
+}
diff --git a/mft_utils/mft_sig_handler.h b/mft_utils/mft_sig_handler.h
index e76b4a0..5ae7f1a 100644
--- a/mft_utils/mft_sig_handler.h
+++ b/mft_utils/mft_sig_handler.h
@@ -82,6 +82,10 @@ void mft_signal_set_fired(int is_fired);
  */
 void mft_signal_set_msg(char* msg);
 
+/**
+ * @brief Deal with signals, if got signal - raise, otherwise restore it
+ */
+void mft_restore_and_raise();
 #ifdef __cplusplus
 }
 #endif
diff --git a/mft_utils/mlarge_buffer.cpp b/mft_utils/mlarge_buffer.cpp
new file mode 100644
index 0000000..1dde732
--- /dev/null
+++ b/mft_utils/mlarge_buffer.cpp
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ *
+ *
+ * mlarge_buffer.cpp
+ *
+ *  Created on: Mar 9, 2016
+ *      Author: adrianc
+ */
+
+#include <string.h>
+
+#include "mlarge_buffer.h"
+
+
+#define MFT_MIN(x,y) ((x) < (y) ? (x) : (y))
+#define MFT_MAX(x,y) ((x) > (y) ? (x) : (y))
+
+#ifdef _DEBUG_MODE
+#define DBG_PRINTF(...) fprintf(stderr, __VA_ARGS__)
+#else
+#define DBG_PRINTF(...)
+#endif
+
+MBufferUnit& operator <<(MBufferUnit& a, MBufferUnit& b)
+{
+    if (!a.intersects(b) ) {
+        return a;
+    }
+    u_int32_t newSize = MFT_MAX(a.offset() + a.size(), b.offset() + b.size()) - MFT_MIN(a.offset(), b.offset());
+    u_int32_t newOffset = MFT_MIN(a.offset(), b.offset());
+    std::vector<u_int8_t> newData(newSize, 0);
+
+    // merge b onto a
+    u_int32_t relativeOffsInBuffer = a.offset() - newOffset;
+    memcpy(&newData[0] + relativeOffsInBuffer, &(a.data()[0]), a.size());
+    relativeOffsInBuffer = b.offset() - newOffset;
+    memcpy(&newData[0] + relativeOffsInBuffer, &(b.data()[0]), b.size());
+    a = MBufferUnit(newData, newOffset);
+    return a;
+}
+
+MBufferUnit& MBufferUnit::operator=(const MBufferUnit& other)
+{
+    if (this != &other) {
+        this->_data = other._data;
+        this->_offset = other._offset;
+    }
+    return *this;
+}
+
+bool MBufferUnit::intersects( const MBufferUnit& other) const
+{
+    if (this->offset() > (other.offset() + other.size()) || (this->offset() + this->size()) < other.offset() ) {
+        return false;
+    }
+    return true;
+}
+
+void MlargeBuffer::add(const std::vector<u_int8_t>& data, u_int32_t offset)
+{
+    if (data.size() == 0) {
+        return;
+    }
+    DBG_PRINTF("-D- adding chunk: 0x%08x - 0x%08x (0x%08x)\n", offset, (unsigned)data.size() + offset, (unsigned)data.size());
+    // create MBufferUnit
+    MBufferUnit bufferUnit(data, offset);
+    bool unitInserted = false;
+    bool unitIntersects = false;
+    unsigned intersecIdx = 0;
+    unsigned bSize = _bData.size();
+    for (unsigned idx = 0; idx < bSize; idx++) {
+        if (unitIntersects) {
+            if (_bData[idx].intersects(_bData[intersecIdx])) {
+                // merge element in intersecIdx onto it
+                _bData[idx] << _bData[intersecIdx];
+                _bData.erase(_bData.begin() + intersecIdx);
+                intersecIdx = --idx;
+                bSize--;
+            } else {
+                break; // done :)
+            }
+        }else if (bufferUnit.offset() + bufferUnit.size() <_bData[idx].offset()) {// check if we can insert before
+            _bData.insert(_bData.begin() + idx, bufferUnit);
+            unitInserted = true;
+            break;
+        } else if (bufferUnit.intersects(_bData[idx])) {
+            unitIntersects = true;
+            unitInserted = true;
+            _bData[idx] << bufferUnit;
+            intersecIdx = idx;
+            continue;
+        }
+    }
+
+    if (!unitInserted) {
+        _bData.push_back(bufferUnit);
+    }
+    DBG_PRINTF("-D- bData size: %d\n", (int)_bData.size());
+
+#ifdef _DEBUG_MODE
+    std::vector<MBufferUnit>::iterator it = _bData.begin();
+    for (; it != _bData.end(); it++) {
+        DBG_PRINTF("-D- chunk : 0x%08x - 0x%08x (0x%08x)\n", it->offset(), it->size() + it->offset(), it->size());
+    }
+#endif
+}
+void MlargeBuffer::add(const u_int8_t* data, u_int32_t offset, u_int32_t size)
+{
+    std::vector<u_int8_t> dataVec(data, data+size);
+    return add(dataVec, offset);
+}
+
+u_int8_t MlargeBuffer::operator[] (const u_int32_t offset)
+{
+    u_int8_t data;
+    get(&data, offset, 1);
+    return data;
+}
+void MlargeBuffer::get(std::vector<u_int8_t>& data, u_int32_t offset, u_int32_t size)
+{
+    data.resize(size);
+    return get(&data[0], offset, size);
+}
+
+void MlargeBuffer::get(u_int8_t* data, u_int32_t offset, u_int32_t size)
+{
+    DBG_PRINTF("-D- get request on offset: 0x%08x with size 0x%x\n", offset, size);
+    if (!data || size == 0) {
+        return;
+    }
+    memset(data, _defaultValue, size);
+    u_int8_t* ptr = data;
+    for (std::vector<MBufferUnit>::iterator it = _bData.begin(); it != _bData.end(); it++) {
+        if (offset < (it->offset() + it->size()) && (offset + size) > it->offset()) {
+            // intersects with current MBufferUnit
+            u_int32_t offsetInBuffer = ((long int)it->offset() - (long int)offset) < 0 ? 0 :  it->offset() - offset;
+            u_int32_t copySize = MFT_MIN(offset + size,  it->offset() + it->size()) - MFT_MAX(offset, it->offset());
+            u_int32_t offsetInData = ((long int)offset - (long int)it->offset()) < 0 ? 0 : offset - it->offset();
+            DBG_PRINTF("-D- getting from chunk at offset 0x%08x , size: 0x%x\n",  it->offset(), (unsigned)it->size() );
+            DBG_PRINTF("-D- integrating at buffer offset : 0x%08x size: 0x%x, offset in data: 0x%08x\n", offsetInBuffer, copySize, offsetInData);
+            memcpy(ptr + offsetInBuffer, &(it->data())[0] + offsetInData , copySize);
+        }
+    }
+    return;
+}
diff --git a/mft_utils/mlarge_buffer.h b/mft_utils/mlarge_buffer.h
new file mode 100644
index 0000000..335a46b
--- /dev/null
+++ b/mft_utils/mlarge_buffer.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ *
+ *
+ * mlarge_buffer.h
+ *
+ *  Created on: Mar 9, 2016
+ *      Author: adrianc
+ */
+
+#ifndef USER_MFT_UTILS_MLARGE_BUFFER_H_
+#define USER_MFT_UTILS_MLARGE_BUFFER_H_
+
+#include <vector>
+
+#include <compatibility.h>
+
+class MBufferUnit {
+public:
+    MBufferUnit(const std::vector<u_int8_t>& data, u_int32_t offset) : _data(data), _offset(offset) {}
+    u_int32_t size() const {return (u_int32_t)_data.size();}
+    u_int32_t offset() const {return _offset;}
+    std::vector<u_int8_t>& data() { return _data; }
+    u_int8_t& operator[] (const u_int32_t idx) { return _data[idx]; }
+    MBufferUnit& operator=(const MBufferUnit& other);
+    bool intersects( const MBufferUnit& other) const;
+private:
+    std::vector<u_int8_t> _data;
+    u_int32_t _offset;
+};
+
+MBufferUnit& operator<<(MBufferUnit& a, MBufferUnit& b);
+
+/*
+ * Large buffer with minimal memory footprint
+ */
+class MlargeBuffer {
+public:
+    MlargeBuffer(u_int8_t defaultVal = 0x0) : _defaultValue(defaultVal){}
+    void add(const std::vector<u_int8_t>& data, u_int32_t offset);
+    void add(const u_int8_t* data, u_int32_t offset, u_int32_t size);
+    u_int8_t operator[] (const u_int32_t offset); // for read only
+    void get(std::vector<u_int8_t>& data, u_int32_t offset, u_int32_t size);
+    void get(std::vector<u_int8_t>& data, u_int32_t size) {return get(data, 0, size);}
+    void get(u_int8_t* data, u_int32_t offset, u_int32_t size);
+    void get(u_int8_t* data, u_int32_t size) {return get(data, 0, size);}
+private:
+    u_int8_t _defaultValue;
+    std::vector<MBufferUnit> _bData;
+};
+
+#endif /* USER_MFT_UTILS_MLARGE_BUFFER_H_ */
diff --git a/mlxconfig/Makefile.am b/mlxconfig/Makefile.am
index f4ce674..c9189aa 100755
--- a/mlxconfig/Makefile.am
+++ b/mlxconfig/Makefile.am
@@ -42,8 +42,8 @@ UTILS_LIB = $(USER_DIR)/mft_utils/libmftutils.a
 CMDIF_DIR = $(USER_DIR)/cmdif
 
 
-INCLUDES = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
-           -I$(MFT_EXT_LIBS_INC_DIR) -I $(LAYOUTS_DIR) -I$(MFT_EXT_LIBS_INC_DIR)/zlib -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
+AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
+           -I $(LAYOUTS_DIR) -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
 
 AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe
 bin_PROGRAMS = mstconfig
diff --git a/mlxconfig/Makefile.in b/mlxconfig/Makefile.in
index b354a81..7bf3c2d 100644
--- a/mlxconfig/Makefile.in
+++ b/mlxconfig/Makefile.in
@@ -281,6 +281,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -346,8 +347,8 @@ DEV_MGT_DIR = $(top_srcdir)/dev_mgt
 LAYOUTS_LIB = $(LAYOUTS_DIR)/libtools_layouts.a
 UTILS_LIB = $(USER_DIR)/mft_utils/libmftutils.a
 CMDIF_DIR = $(USER_DIR)/cmdif
-INCLUDES = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
-           -I$(MFT_EXT_LIBS_INC_DIR) -I $(LAYOUTS_DIR) -I$(MFT_EXT_LIBS_INC_DIR)/zlib -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
+AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
+           -I $(LAYOUTS_DIR) -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
 
 
 #get mst device examples and tool name from makefile
diff --git a/mlxconfig/mlxcfg_lib.cpp b/mlxconfig/mlxcfg_lib.cpp
index 68ebe40..eb1d02e 100644
--- a/mlxconfig/mlxcfg_lib.cpp
+++ b/mlxconfig/mlxcfg_lib.cpp
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,12 @@
  * 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.
+ */
+/*
+ * mlxcfg_lib.cpp
  *
- *  Version: $Id$
- *
+ *  Created on: Feb 17, 2014
+ *      Author: adrianc
  */
 
 #include <set>
@@ -93,7 +97,7 @@ MlxCfgOps::MlxCfgOps()
 
     updateErrCodes(errmap);
     _mf = NULL;
-    _deviceId = DeviceEndMarker;
+    _deviceId = DeviceUnknown;
     _suppVec = 0;
     _isFifthGen = false;
     return;
@@ -190,12 +194,48 @@ int MlxCfgOps::supportsNVData()
     return MCE_SUCCESS;
 }
 
+int MlxCfgOps::isDefaultSupported(bool &defaultSupported)
+{
+    struct tools_open_nvqgc nvqgcTlv;
+
+    if(!_isFifthGen){
+        defaultSupported = true;
+        return ME_OK;
+    }
+
+    memset(&nvqgcTlv, 0, sizeof(struct tools_open_nvqgc));
+    MError rc;
+
+    mft_signal_set_handling(1);
+    rc = reg_access_nvqgc(_mf, REG_ACCESS_METHOD_GET, &nvqgcTlv);
+    dealWithSignal();
+    if (rc == ME_REG_ACCESS_BAD_PARAM || rc == ME_REG_ACCESS_INTERNAL_ERROR) {
+        defaultSupported = 0;
+        return ME_OK;
+    } else if(rc == ME_OK){
+        defaultSupported = nvqgcTlv.read_factory_settings_support;
+        return ME_OK;
+    }
+    return rc;
+}
+
 int MlxCfgOps::openComChk()
 {
     bool rc;
     int ret;
+    u_int32_t type = 0;
     // check if we support Tools HCR and update _suppVec
     if (_isFifthGen) {
+        rc = mget_mdevs_type(_mf, &type);
+        #ifndef MST_UL
+            if (type != MST_PCICONF && type != MST_PCI) {
+                return errmsg(MCE_PCI);
+            }
+        #else
+            if (type != MTCR_ACCESS_CONFIG && type != MTCR_ACCESS_MEMORY) {
+                return errmsg(MCE_PCI);
+            }
+        #endif
         rc = supportsNVData(); CHECK_RC(rc);
     } else {
         rc = supportsToolsHCR(); CHECK_RC(rc);
@@ -251,6 +291,10 @@ int MlxCfgOps::opend(mfile* mf, bool forceClearSem)
         return errmsg(MCE_UNSUPPORTED_DEVICE);
     }
 
+    if(dm_is_livefish_mode(mf)) {
+        return errmsg("Device in Livefish mode is not supported.");
+    }
+
     // init _cfgList, _param2TypeMap
     if (_isFifthGen) {
         // Wake On LAN
@@ -266,6 +310,10 @@ int MlxCfgOps::opend(mfile* mf, bool forceClearSem)
         _param2TypeMap[Mcp_Sriov_En] = Mct_Pci;
         _param2TypeMap[Mcp_Num_Of_Vfs] = Mct_Pci;
         _param2TypeMap[Mcp_Fpp_En] = Mct_Pci;
+        _param2TypeMap[Mcp_PF_Log_Bar_Size] = Mct_Pci;
+        _param2TypeMap[Mcp_VF_Log_Bar_Size] = Mct_Pci;
+        _param2TypeMap[Mcp_Num_Pf_Msix] = Mct_Pci;
+        _param2TypeMap[Mcp_Num_Vf_Msix] = Mct_Pci;
         // TPT settings
         _cfgList[Mct_Tpt] = new TptParams5thGen();
         _param2TypeMap[Mcp_Log_Tpt_Size] = Mct_Tpt;
@@ -273,12 +321,6 @@ int MlxCfgOps::opend(mfile* mf, bool forceClearSem)
         _cfgList[Mct_Dc] = new IBDCParams5thGen();
         _param2TypeMap[Mcp_Log_Dcr_Hash_Table_Size] = Mct_Dc;
         _param2TypeMap[Mcp_Dcr_Lifo_Size] = Mct_Dc;
-        // Port Boot State
-        /*_cfgList[Mct_Boot_State_P1] = new PortBootStateParams5thGen(1);
-        _cfgList[Mct_Boot_State_P2] = new PortBootStateParams5thGen(2);
-        _param2TypeMap[Mcp_Boot_State_P1] = Mct_Boot_State_P1;
-        _param2TypeMap[Mcp_Boot_State_P2] = Mct_Boot_State_P2;
-        */
         // RoCE v1.5 next protocol
         _cfgList[Mct_RoCE_Next_Protocol] = new RoCENextProtocolParams5thGen();
         _param2TypeMap[Mcp_RoCE_Next_Protocol] = Mct_RoCE_Next_Protocol;
@@ -332,6 +374,38 @@ int MlxCfgOps::opend(mfile* mf, bool forceClearSem)
         _param2TypeMap[Mcp_Cnp_Dscp_P2] = Mct_RoCE_CC_Ecn_P2;
         _param2TypeMap[Mcp_Cnp_802p_Prio_P2] = Mct_RoCE_CC_Ecn_P2;
 
+        _cfgList[Mct_External_Port] = new ExternalPort5thGen();
+        _param2TypeMap[Mcp_Port_Owner] = Mct_External_Port;
+        _param2TypeMap[Mcp_Allow_Rd_Counters] = Mct_External_Port;
+
+        _cfgList[Mct_Boot_Settings_Extras_5thGen] = new BootSettingsExtParams5thGen();
+        _param2TypeMap[Mcp_Boot_Settings_Ext_IP_Ver] = Mct_Boot_Settings_Extras_5thGen;
+
+        _cfgList[Mct_QoS_P1] = new QoS(1);
+        _cfgList[Mct_QoS_P2] = new QoS(2);
+        _param2TypeMap[Mcp_QoS_Num_of_TC_P1] = Mct_QoS_P1;
+        _param2TypeMap[Mcp_QoS_Num_of_VL_P1] = Mct_QoS_P1;
+        _param2TypeMap[Mcp_QoS_Num_of_TC_P2] = Mct_QoS_P2;
+        _param2TypeMap[Mcp_QoS_Num_of_VL_P2] = Mct_QoS_P2;
+
+        _cfgList[Mct_LLDP_Client_Settings_P1] = new LLDPClientSettings(1);
+        _cfgList[Mct_LLDP_Client_Settings_P2] = new LLDPClientSettings(2);
+        _param2TypeMap[Mcp_LLDP_NB_RX_Mode_P1] = Mct_LLDP_Client_Settings_P1;
+        _param2TypeMap[Mcp_LLDP_NB_TX_Mode_P1] = Mct_LLDP_Client_Settings_P1;
+        _param2TypeMap[Mcp_LLDP_NB_DCBX_P1] = Mct_LLDP_Client_Settings_P1;
+        _param2TypeMap[Mcp_LLDP_NB_RX_Mode_P2] = Mct_LLDP_Client_Settings_P2;
+        _param2TypeMap[Mcp_LLDP_NB_TX_Mode_P2] = Mct_LLDP_Client_Settings_P2;
+        _param2TypeMap[Mcp_LLDP_NB_DCBX_P2] = Mct_LLDP_Client_Settings_P2;
+
+        _cfgList[Mct_DCBX_P1] = new DCBX(1);
+        _cfgList[Mct_DCBX_P2] = new DCBX(2);
+        _param2TypeMap[Mcp_DCBX_IEEE_EN_P1] = Mct_DCBX_P1;
+        _param2TypeMap[Mcp_DCBX_CEE_EN_P1] = Mct_DCBX_P1;
+        _param2TypeMap[Mcp_DCBX_WILLING_P1] = Mct_DCBX_P1;
+        _param2TypeMap[Mcp_DCBX_IEEE_EN_P2] = Mct_DCBX_P2;
+        _param2TypeMap[Mcp_DCBX_CEE_EN_P2] = Mct_DCBX_P2;
+        _param2TypeMap[Mcp_DCBX_WILLING_P2] = Mct_DCBX_P2;
+
     } else {
         // SR-IOV
         _cfgList[Mct_Sriov] = new SriovParams4thGen();
@@ -369,6 +443,11 @@ int MlxCfgOps::opend(mfile* mf, bool forceClearSem)
         _param2TypeMap[Mcp_Boot_Retry_Cnt_P2] = Mct_Preboot_Boot_Settings_P2;
         _param2TypeMap[Mcp_Legacy_Boot_Protocol_P2] = Mct_Preboot_Boot_Settings_P2;
         _param2TypeMap[Mcp_Boot_Vlan_P2] = Mct_Preboot_Boot_Settings_P2;
+
+        _cfgList[Mct_Boot_Settings_Extras_4thGen_P1] = new BootSettingsExtParams4thGen(1);
+        _cfgList[Mct_Boot_Settings_Extras_4thGen_P2] = new BootSettingsExtParams4thGen(2);
+        _param2TypeMap[Mcp_Boot_Settings_Ext_IP_Ver_P1] = Mct_Boot_Settings_Extras_4thGen_P1;
+        _param2TypeMap[Mcp_Boot_Settings_Ext_IP_Ver_P2] = Mct_Boot_Settings_Extras_4thGen_P2;
     }
 
 
@@ -403,7 +482,7 @@ bool MlxCfgOps::supportsParam(mlxCfgParam param)
     return _cfgList[cfgParam2Type(param)]->cfgSupported(_mf, param);
 }
 
-int MlxCfgOps::getCfg(mlxCfgParam cfgParam, u_int32_t& val)
+int MlxCfgOps::getCfg(mlxCfgParam cfgParam, u_int32_t& val, bool getDefault)
 {
     if (!isLegal(cfgParam)) {
         return MCE_BAD_PARAMS;
@@ -413,11 +492,16 @@ int MlxCfgOps::getCfg(mlxCfgParam cfgParam, u_int32_t& val)
         return errmsg(MCE_UNSUPPORTED_CFG);
     }
 
-    int rc = _cfgList[cfgParam2Type(cfgParam)]->getFromDev(_mf);
-    if (rc) {
-        return errmsgConcatMsg(rc,*_cfgList[cfgParam2Type(cfgParam)]);
+    if (getDefault) {
+        val = (_cfgList[cfgParam2Type(cfgParam)])->getDefaultParam(cfgParam);
+    } else {
+        int rc;
+        rc = _cfgList[cfgParam2Type(cfgParam)]->getFromDev(_mf);
+        if (rc) {
+            return errmsgConcatMsg(rc,*_cfgList[cfgParam2Type(cfgParam)]);
+        }
+        val = (_cfgList[cfgParam2Type(cfgParam)])->getParam(cfgParam);
     }
-    val = (_cfgList[cfgParam2Type(cfgParam)])->getParam(cfgParam);
     return MCE_SUCCESS;
 }
 
@@ -455,7 +539,7 @@ int MlxCfgOps::setCfg(mlxCfgParam cfgParam, u_int32_t val)
     return MCE_SUCCESS;
 }
 
-int MlxCfgOps::setCfg(const std::vector<cfgInfo>& infoVec)
+int MlxCfgOps::setCfg(const std::vector<cfgInfo>& infoVec, mlxCfgParam& failedParam)
 {
     // set params
     std::set<CfgParams*> CfgToSet;
@@ -466,6 +550,7 @@ int MlxCfgOps::setCfg(const std::vector<cfgInfo>& infoVec)
             return MCE_BAD_PARAMS;
         }
         if (!supportsParam(it->first)) {
+            failedParam = it->first;
             return errmsg(MCE_UNSUPPORTED_CFG);
         }
         // get configuration from device first (if preset) in case of multiple params per type
@@ -506,18 +591,26 @@ int MlxCfgOps::invalidateCfgs4thGen()
 {
     struct tools_open_mnvia mnviaTlv;
     u_int8_t buffer[TOOLS_OPEN_MNVIA_SIZE] = {0};
+    int rc;
     memset(&mnviaTlv, 0, sizeof(struct tools_open_mnvia));
     tools_open_mnvia_pack(&mnviaTlv, buffer);
-    return reg_access_mnvia(_mf, REG_ACCESS_METHOD_SET, &mnviaTlv);
+    mft_signal_set_handling(1);
+    rc = reg_access_mnvia(_mf, REG_ACCESS_METHOD_SET, &mnviaTlv);
+    dealWithSignal();
+    return rc;
 }
 
 int MlxCfgOps::invalidateCfgs5thGen()
 {
     struct tools_open_nvia nviaTlv;
     u_int8_t buffer[TOOLS_OPEN_NVIA_SIZE] = {0};
+    int rc;
     memset(&nviaTlv, 0, sizeof(struct tools_open_nvia));
     tools_open_nvia_pack(&nviaTlv, buffer);
-    return reg_access_nvia(_mf, REG_ACCESS_METHOD_SET, &nviaTlv);
+    mft_signal_set_handling(1);
+    rc = reg_access_nvia(_mf, REG_ACCESS_METHOD_SET, &nviaTlv);
+    dealWithSignal();
+    return rc;
 }
 
 int MlxCfgOps::invalidateCfgs()
@@ -534,6 +627,42 @@ int MlxCfgOps::invalidateCfgs()
     return MCE_SUCCESS;
 }
 
+int MlxCfgOps::backupCfgs(vector< pair< u_int32_t, vector<u_int8_t> > >& cfgsMap)
+{
+    int rc;
+    int status = 0;
+    u_int32_t ptr = 0;
+    struct tools_open_mnvgn mnvgnTlv;
+    do {
+        memset(&mnvgnTlv, 0, sizeof(struct tools_open_mnvgn));
+        mnvgnTlv.nv_pointer = ptr;
+        mft_signal_set_handling(1);
+        rc = reg_access_mnvgn(_mf, REG_ACCESS_METHOD_GET, &mnvgnTlv, &status);
+        dealWithSignal();
+        if (rc) {
+            if(status == ME_NOT_IMPLEMENTED) {
+                return errmsg("Firmware does not support backup command");
+            }
+            return errmsg("failed to backup configurations, %s.", m_err2str((MError)rc));
+        }
+        ptr = mnvgnTlv.nv_pointer;
+        if (ptr != 0) {
+            u_int32_t k = mnvgnTlv.nv_hdr.type.tlv_type_dw.tlv_type_dw;
+            vector<u_int8_t> v;
+            v.resize(TOOLS_OPEN_NV_HDR_FIFTH_GEN_SIZE + mnvgnTlv.nv_hdr.length);
+            //Copy header:
+            tools_open_nv_hdr_fifth_gen_pack(&mnvgnTlv.nv_hdr, v.data());
+            //Copy data:
+            memcpy(v.data() + TOOLS_OPEN_NV_HDR_FIFTH_GEN_SIZE,
+                    &mnvgnTlv.nv_data,
+                    mnvgnTlv.nv_hdr.length);
+            cfgsMap.push_back(make_pair(k, v));
+        }
+    } while (ptr != 0);
+
+    return rc;
+}
+
 bool MlxCfgOps::isLegal(mlxCfgType cfg)
 {
     if (_cfgList.find(cfg) != _cfgList.end()) {
@@ -561,7 +690,9 @@ const char* MlxCfgOps::loadConfigurationGetStr()
     if (_isFifthGen && (_deviceId == DeviceConnectX4 || _deviceId == DeviceConnectX4LX)) {
         // send warm boot (bit 6)
         mfrl.reset_level = 1 << 6;
+        mft_signal_set_handling(1);
         rc = reg_access_mfrl(_mf,REG_ACCESS_METHOD_SET, &mfrl);
+        dealWithSignal();
         if (rc) {
             return "Please power cycle machine to load new configurations.";
         }
@@ -581,7 +712,7 @@ mlxCfgType MlxCfgOps::cfgParam2Type(mlxCfgParam param)
 int MlxCfgOps::setRawCfg(std::vector<u_int32_t> rawTlvVec)
 {
     if (!_isFifthGen) {
-        return errmsg("Setting Raw Configuration is supported for 5th Generation devices only.");
+        return errmsg("Setting Raw Configuration is supported for " FIFTH_GENERATION_LIST " devices only.");
     }
     RawCfgParams5thGen rawTlv;
     if (rawTlv.setRawData(rawTlvVec)) {
diff --git a/mlxconfig/mlxcfg_lib.h b/mlxconfig/mlxcfg_lib.h
index 8722435..169a1c8 100644
--- a/mlxconfig/mlxcfg_lib.h
+++ b/mlxconfig/mlxcfg_lib.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,12 @@
  * 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.
+ */
+/*
+ * mlxcfg_lib.h
  *
- *  Version: $Id$
- *
+ *  Created on: Feb 17, 2014
+ *      Author: adrianc
  */
 
 #ifndef MLXCFG_LIB_H_
@@ -45,6 +49,9 @@
 #include "mlxcfg_status.h"
 #include "mlxcfg_param_lib.h"
 
+#define FIFTH_GENERATION_LIST "Connect-IB/Connect-X4/LX"
+#define FOURTH_GENERATION_LIST "ConnectX3/Pro"
+
 class MlxCfgOps : public ErrMsg {
 public:
     MlxCfgOps();
@@ -57,11 +64,11 @@ public:
     bool supportsCfg(mlxCfgType cfg);
     bool supportsParam(mlxCfgParam param);
 
-    int getCfg(mlxCfgParam cfgParam, u_int32_t& val);
+    int getCfg(mlxCfgParam cfgParam, u_int32_t& val, bool getDefault = false);
     int getCfg(std::vector<cfgInfo>& infoVec);
 
     int setCfg(mlxCfgParam cfgParam, u_int32_t val);
-    int setCfg(const std::vector<cfgInfo>& infoVec);
+    int setCfg(const std::vector<cfgInfo>& infoVec, mlxCfgParam& cfgParam);
 
     int setRawCfg(std::vector<u_int32_t> rawTlvVec);
 
@@ -78,6 +85,10 @@ public:
 
     const char* loadConfigurationGetStr();
 
+    int isDefaultSupported(bool &defaultSupported);
+
+    int backupCfgs(std::vector<std::pair<u_int32_t, std::vector<u_int8_t> > >& cfgs);
+
 private:
     int openComChk();
     int supportsToolsHCR();
diff --git a/mlxconfig/mlxcfg_param_lib.cpp b/mlxconfig/mlxcfg_param_lib.cpp
index d5481ee..1028e67 100644
--- a/mlxconfig/mlxcfg_param_lib.cpp
+++ b/mlxconfig/mlxcfg_param_lib.cpp
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,12 @@
  * 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.
+ */
+/*
+ * mlxcfg_param_lib.cpp
  *
- *  Version: $Id$
- *
+ *  Created on: Mar 22, 2015
+ *      Author: adrianc
  */
 
 #include <signal.h>
@@ -79,7 +83,7 @@ enum {
     printf("-I- Data Sent:\n");\
     tools_open_##struct_name##_print(data_struct, stdout, 1)
 # define DEBUG_PRINT_RECIEVE(data_struct, struct_name)\
-    printf("-I- Data Recieved:\n");\
+    printf("-I- Data Received:\n");\
     tools_open_##struct_name##_print(data_struct, stdout, 1)
 #else
 # define DEBUG_PRINT_SEND(data_struct, struct_name)
@@ -126,6 +130,25 @@ enum {
         _updated = false;\
         return MCE_SUCCESS
 
+#define GET_DEFAULT_5TH_GEN(mf, tlvStructName, tlvNameStr) \
+        MError __mRc;\
+        int __tlvBuffSize = tlvStructName##_size();\
+        u_int8_t __tlvBuff[__tlvBuffSize];\
+        memset(__tlvBuff, 0, __tlvBuffSize);\
+        struct tlvStructName __tlvStruct;\
+        memset(&__tlvStruct, 0, sizeof(__tlvStruct));\
+        __mRc = mnvaCom5thGen(mf, &__tlvBuff[0], __tlvBuffSize, getTlvTypeBe(), REG_ACCESS_METHOD_GET, true);\
+        if (__mRc) {\
+            if (__mRc == ME_REG_ACCESS_RES_NOT_AVLBL) {\
+                return MCE_SUCCESS;\
+            }\
+            return errmsg("Failed to get %s settings: %s", tlvNameStr, m_err2str(__mRc));\
+        }\
+        tlvStructName##_unpack(&__tlvStruct, &__tlvBuff[0]);\
+        updateClassDefaultAttrFromTlv((void*)&__tlvStruct);\
+        updateClassAttrFromDefaultParams();\
+       return MCE_SUCCESS
+
 #define GET_FROM_DEV_5TH_GEN(mf, tlvStructName, tlvNameStr) \
         MError __mRc;\
         int __tlvBuffSize = tlvStructName##_size();\
@@ -237,7 +260,7 @@ MError mnvaCom4thGen(mfile* mf, u_int8_t* buff, u_int16_t len, u_int16_t tlvType
     return ME_OK;
 }
 
-MError mnvaCom5thGen(mfile* mf, u_int8_t* buff, u_int16_t len, u_int32_t tlvType, reg_access_method_t method)
+MError mnvaCom5thGen(mfile* mf, u_int8_t* buff, u_int16_t len, u_int32_t tlvType, reg_access_method_t method, bool getDefault=false)
 {
     struct tools_open_nvda mnvaTlv;
     memset(&mnvaTlv, 0, sizeof(struct tools_open_nvda));
@@ -245,6 +268,9 @@ MError mnvaCom5thGen(mfile* mf, u_int8_t* buff, u_int16_t len, u_int32_t tlvType
     mnvaTlv.nv_hdr.length = len;
     mnvaTlv.nv_hdr.rd_en = 0;
     mnvaTlv.nv_hdr.over_en = 1;
+    if (getDefault) {
+        mnvaTlv.nv_hdr.default_ = 1;
+    }
     // tlvType should be in the correct endianess
     mnvaTlv.nv_hdr.type.tlv_type_dw.tlv_type_dw =  __be32_to_cpu(tlvType);
     memcpy(mnvaTlv.data, buff, len);
@@ -289,11 +315,20 @@ MError nvqcCom5thGen(mfile* mf, u_int32_t tlvType, bool& suppRead, bool& suppWri
 /*
  * RawCfgParams5thGen Class implementation
  */
+RawCfgParams5thGen::RawCfgParams5thGen() {
+    memset(&_nvdaTlv, 0, sizeof(struct tools_open_nvda));
+}
 
 int RawCfgParams5thGen::setRawData(const std::vector<u_int32_t>& tlvBuff) {
+    if(tlvBuff.size() * 4 > TOOLS_OPEN_NVDA_SIZE){
+        return errmsg(MCE_BAD_PARAM_VAL, "TLV size exceeds maximal limit. Maximum size is 0x%x bytes, actual length is 0x%x bytes", TOOLS_OPEN_NVDA_SIZE, (u_int32_t)(tlvBuff.size() * 4));
+    }
     _tlvBuff = tlvBuff;
     memset(&_nvdaTlv, 0, sizeof(struct tools_open_nvda));
     std::vector<u_int32_t> tlvBuffBe = _tlvBuff;
+    tlvBuffBe.resize(TOOLS_OPEN_NVDA_SIZE >> 2);
+    memset(&tlvBuffBe[0], 0, TOOLS_OPEN_NVDA_SIZE);
+    tlvBuffBe.insert(tlvBuffBe.begin(), _tlvBuff.begin(), _tlvBuff.end());
     for (std::vector<u_int32_t>::iterator it = tlvBuffBe.begin(); it != tlvBuffBe.end(); it++ ) {
         *it = __cpu_to_be32(*it);
     }
@@ -361,7 +396,9 @@ CfgParams::CfgParams(mlxCfgType t, u_int32_t tlvT) {
 
 int CfgParams::getDefaultParams4thGen(mfile* mf, struct tools_open_query_def_params_global* global_params)
 {
+    mft_signal_set_handling(1);
     MError rc  = tcif_query_global_def_params(mf, global_params);
+    dealWithSignal();
     if (rc) {
         return errmsg(MCE_BAD_STATUS, "Failed to get default parameters: %s", tcif_err2str(rc));
     }
@@ -370,7 +407,9 @@ int CfgParams::getDefaultParams4thGen(mfile* mf, struct tools_open_query_def_par
 
 int CfgParams::getDefaultParams4thGen(mfile* mf, int port, struct tools_open_query_def_params_per_port* port_params)
 {
+    mft_signal_set_handling(1);
     MError rc  = tcif_query_per_port_def_params(mf, port, port_params);
+    dealWithSignal();
     if (rc) {
         return errmsg(MCE_BAD_STATUS, "Failed to get default parameters: %s", tcif_err2str(rc));
     }
@@ -413,10 +452,265 @@ void CfgParams::setIgnoreHardLimits(bool val)
 }
 
 /*
- * SriovParam Class implementation:
+ * BootSettingsExtParams Class implementation:
+ */
+bool BootSettingsExtParams::hardLimitCheck()
+{
+    if(_ipVer > 3) {
+        errmsg("illegal IP Ver parameter value. can be 0..3");
+        return false;
+    }
+    return true;
+}
+
+void BootSettingsExtParams::setParams(u_int32_t ipVer)
+{
+    _ipVer = ipVer;
+}
+
+/*
+ * BootSettingsExtParams4thGen Class implementation:
+ */
+
+u_int32_t BootSettingsExtParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver_P1 ||
+            paramType == Mcp_Boot_Settings_Ext_IP_Ver_P2) {
+        return _ipVerDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void BootSettingsExtParams4thGen::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver_P1 ||
+            paramType == Mcp_Boot_Settings_Ext_IP_Ver_P2) {
+        _ipVer = val;
+    }
+}
+
+u_int32_t BootSettingsExtParams4thGen::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver_P1 ||
+            paramType == Mcp_Boot_Settings_Ext_IP_Ver_P2) {
+        return _ipVer;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+bool BootSettingsExtParams4thGen::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    (void)param;
+    struct tools_open_query_def_params_global params;
+    int rc;
+    rc = getDefaultParams4thGen(mf, &params);
+    if (rc) {
+        return false;
+    }
+    return params.boot_ip_ver;
+}
+
+int BootSettingsExtParams4thGen::getDefaultParams(mfile* mf)
+{
+    struct tools_open_query_def_params_per_port params;
+    int rc;
+    rc = getDefaultParams4thGen(mf, _port, &params);
+    if (rc) {
+        return false;
+    }
+    _ipVerDefault = params.boot_ip_ver;
+    setParams(_ipVerDefault);
+    return MCE_SUCCESS;
+}
+
+int BootSettingsExtParams4thGen::getFromDev(mfile* mf)
+{
+    if (_updated) {
+        return MCE_SUCCESS;
+    }
+    MError rc;
+    // prep tlv
+    u_int8_t buff[tools_open_sriov_size()];
+    struct tools_open_boot_settings_ext bootSettingsExtTlv;
+    memset(buff, 0, tools_open_boot_settings_ext_size());
+    memset(&bootSettingsExtTlv, 0, sizeof(struct tools_open_boot_settings_ext));
+    // pack it
+    tools_open_boot_settings_ext_pack(&bootSettingsExtTlv, buff);
+    // send it
+    DEBUG_PRINT_SEND(&bootSettingsExtTlv, boot_settings_ext);
+    rc = mnvaCom4thGen(mf, buff, tools_open_boot_settings_ext_size(), tlvTypeIdx, REG_ACCESS_METHOD_GET, _port);
+    // check rc
+    DEBUG_PRINT_RECIEVE(&bootSettingsExtTlv, boot_settings_ext);
+    if (rc) {// when attempting to get a nv_cfg tlv from device ME_REG_ACCESS_RES_NOT_AVLBL means - no valid
+             // tlv found. i.e default configuration are on.
+        if (rc == ME_REG_ACCESS_RES_NOT_AVLBL) {
+            return MCE_SUCCESS;
+        }
+        return errmsg(MCE_BAD_STATUS, "Failed to get Boot Settings Extras configuration: %s", m_err2str(rc));
+    }
+    // unpack and update
+    tools_open_boot_settings_ext_unpack(&bootSettingsExtTlv, buff);
+    setParams(bootSettingsExtTlv.ip_ver);
+    _updated = true;
+
+    return MCE_SUCCESS;
+}
+
+int BootSettingsExtParams4thGen::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    if (_ipVer == MLXCFG_UNKNOWN) {
+        return errmsg("%s please specify all parameters for Boot Settings Extras.", err() ? err() : "");
+    }
+    if (!ignoreCheck && !checkCfg(mf)) {
+        return MCE_BAD_PARAMS;
+    }
+
+    // prep tlv
+    MError ret;
+    u_int8_t buff[tools_open_boot_settings_ext_size()];
+    struct tools_open_boot_settings_ext bootSettingsExtTlv;
+
+    memset(buff, 0, tools_open_boot_settings_ext_size());
+    memset(&bootSettingsExtTlv, 0, sizeof(struct tools_open_boot_settings_ext));
+    bootSettingsExtTlv.ip_ver = _ipVer;
+    // pack it
+    tools_open_boot_settings_ext_pack(&bootSettingsExtTlv, buff);
+    // send it
+    ret = mnvaCom4thGen(mf, buff, tools_open_boot_settings_ext_size(), tlvTypeIdx, REG_ACCESS_METHOD_SET, _port);
+    // check rc
+    if (ret) {
+        return errmsg("failed to set Boot Settings Extras params: %s",m_err2str(ret));
+    }
+    _updated = false;
+    return MCE_SUCCESS;
+}
+
+/*
+ * BootSettingsExtParams5thGen Class implementation:
+ */
+
+u_int32_t BootSettingsExtParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver) {
+        return _ipVerDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void BootSettingsExtParams5thGen::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver) {
+        _ipVer = val;
+    }
+}
+
+u_int32_t BootSettingsExtParams5thGen::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Boot_Settings_Ext_IP_Ver) {
+        return _ipVer;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t BootSettingsExtParams5thGen::getBootSettingsExtCapabilitiesTlvTypeBe()
+{
+    struct tools_open_global_type type;
+    u_int32_t tlvType = 0;
+
+    type.param_class = CLASS_GLOBAL;
+    type.param_idx = BOOT_SETTINGS_EXTRAS_GEN5_CAP;
+    tools_open_global_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+bool BootSettingsExtParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    MError rc;
+    (void)param;
+    u_int8_t tlvCapBuff[TOOLS_OPEN_OPTION_ROM_CAPABILITY_SIZE] = {0};
+    struct tools_open_option_rom_capability optionRomCapabilitesTlv;
+    bool suppRead, suppWrite;
+    rc = nvqcCom5thGen(mf, getBootSettingsExtCapabilitiesTlvTypeBe(), suppRead, suppWrite);
+    if (rc) {
+        return false;
+    }
+    memset(&optionRomCapabilitesTlv, 0, sizeof(optionRomCapabilitesTlv));
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_OPTION_ROM_CAPABILITY_SIZE, getBootSettingsExtCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    if (rc) {
+        return errmsg("Failed to get Boot Settings Ext capabilities parameter. %s", m_err2str(rc));
+    }
+    tools_open_option_rom_capability_unpack(&optionRomCapabilitesTlv, tlvCapBuff);
+    return optionRomCapabilitesTlv.ip_ver;
+}
+
+int BootSettingsExtParams5thGen::getFromDev(mfile* mf)
+{
+    GET_FROM_DEV_5TH_GEN(mf, tools_open_boot_settings_ext, "Boot Settings Ext");
+}
+
+void BootSettingsExtParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_ipVerDefault);
+}
+
+int BootSettingsExtParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_boot_settings_ext, "Boot Settings Ext");
+}
+
+u_int32_t BootSettingsExtParams5thGen::getTlvTypeBe()
+{
+    struct tools_open_per_host_type type;
+    u_int32_t tlvType = 0;
+
+    type.param_class = CLASS_PER_HOST;
+    type.param_idx = tlvTypeIdx;
+    type.function = 0; // currently support only host 0 (FW should fill this field with correct func)
+    type.host = 0; // currently support only host 0 (FW should fill this field with correct host)
+    tools_open_per_host_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+void BootSettingsExtParams5thGen::updateTlvFromClassAttr(void* tlv)
+{
+    struct tools_open_boot_settings_ext* bootSettingsExt = (struct tools_open_boot_settings_ext*)tlv;
+    bootSettingsExt->ip_ver = _ipVer;
+    return;
+}
+void BootSettingsExtParams5thGen::updateClassAttrFromTlv(void* tlv)
+{
+    struct tools_open_boot_settings_ext* bootSettingsExt = (struct tools_open_boot_settings_ext*)tlv;
+    setParams(bootSettingsExt->ip_ver);
+    return;
+}
+
+void BootSettingsExtParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_boot_settings_ext* bootSettingsExt = (struct tools_open_boot_settings_ext*)tlv;
+    _ipVerDefault = bootSettingsExt->ip_ver;
+    return;
+}
+
+int BootSettingsExtParams5thGen::getDefaultParamsAux(mfile* mf)
+{
+    GET_DEFAULT_5TH_GEN(mf, tools_open_boot_settings_ext, "Boot Settings Extras");
+}
+
+int BootSettingsExtParams5thGen::getDefaultParams(mfile* mf)
+{
+    int rc = getDefaultParamsAux(mf);
+    if(!rc || _ipVerDefault == MLXCFG_UNKNOWN){
+        _ipVerDefault = 0;
+        setParams(_ipVerDefault);
+    }
+    return MCE_SUCCESS;
+}
+
+/*
+ * SriovParams4thGen Class implementation:
  */
 
-void SriovParams::setParam(mlxCfgParam paramType, u_int32_t val)
+void SriovParams4thGen::setParam(mlxCfgParam paramType, u_int32_t val)
 {
     if (paramType == Mcp_Sriov_En) {
         _sriovEn = val;
@@ -425,7 +719,7 @@ void SriovParams::setParam(mlxCfgParam paramType, u_int32_t val)
     }
 }
 
-u_int32_t SriovParams::getParam(mlxCfgParam paramType)
+u_int32_t SriovParams4thGen::getParam(mlxCfgParam paramType)
 {
     if (paramType == Mcp_Sriov_En) {
         return _sriovEn;
@@ -435,7 +729,17 @@ u_int32_t SriovParams::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
-bool SriovParams::hardLimitCheck()
+u_int32_t SriovParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Sriov_En) {
+        return _sriovEnDefault;
+    } else if (paramType == Mcp_Num_Of_Vfs) {
+        return _numOfVfsDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+bool SriovParams4thGen::hardLimitCheck()
 {
     if ((_numOfVfs > _maxVfs)) {
         errmsg("Number of VFs exceeds limit (%d).", _maxVfs);
@@ -467,14 +771,21 @@ int SriovParams4thGen::getDefaultParams(mfile* mf)
     rc = updateMaxVfs(mf); CHECK_RC(rc);
     rc = getDefaultParams4thGen(mf, &global_params);
     if (rc == MCE_SUCCESS) {
-        _sriovEn = global_params.sriov_en;
-        _numOfVfs = global_params.num_vfs;
+        _sriovEnDefault = global_params.sriov_en;
+        _numOfVfsDefault = global_params.num_vfs;
+        setParams(_sriovEnDefault, _numOfVfsDefault);
     } else {
         rc = MCE_GET_DEFAULT_PARAMS;
     }
     return rc;
 }
 
+void SriovParams4thGen::setParams(u_int32_t sriovEn, u_int32_t numOfVfs)
+{
+    _sriovEn = sriovEn;
+    _numOfVfs = numOfVfs;
+}
+
 int SriovParams4thGen::getFromDev(mfile* mf)
 {
     if (_updated) {
@@ -496,15 +807,13 @@ int SriovParams4thGen::getFromDev(mfile* mf)
     if (rc) {// when attempting to get a nv_cfg tlv from device ME_REG_ACCESS_RES_NOT_AVLBL means - no valid
              // tlv found. i.e default configuration are on.
         if (rc == ME_REG_ACCESS_RES_NOT_AVLBL) {
-
             return MCE_SUCCESS;
         }
         return errmsg(MCE_BAD_STATUS, "Failed to get SRIOV configuration: %s", m_err2str(rc));
     }
     // unpack and update
     tools_open_sriov_unpack(&sriovTlv, buff);
-    _sriovEn = sriovTlv.sriov_en;
-    _numOfVfs = sriovTlv.total_vfs;
+    setParams(sriovTlv.sriov_en, sriovTlv.total_vfs);
     _updated = true;
 
     return MCE_SUCCESS;
@@ -603,6 +912,11 @@ bool WolParams::hardLimitCheck()
     return false;
 }
 
+void WolParams::setParams(u_int32_t wolMagicEn)
+{
+    _wolMagicEn = wolMagicEn;
+}
+
 /*
  * WolParams4thGen Class implementation :
  */
@@ -622,6 +936,14 @@ u_int32_t WolParams4thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t WolParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ((paramType == Mcp_Wol_Magic_En_P1  && _port == 1) || (paramType == Mcp_Wol_Magic_En_P2 && _port == 2)) {
+        return _wolMagicEnDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
 bool WolParams4thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 {
     (void)mf;
@@ -634,7 +956,8 @@ int WolParams4thGen::getDefaultParams(mfile* mf)
     struct tools_open_query_def_params_per_port port_params;
     int rc = getDefaultParams4thGen(mf, _port , &port_params);
     if (rc == MCE_SUCCESS) {
-        _wolMagicEn = port_params.default_en_wol_magic;
+        _wolMagicEnDefault = port_params.default_en_wol_magic;
+        setParams(_wolMagicEnDefault);
     } else {
         rc = MCE_GET_DEFAULT_PARAMS;
     }
@@ -665,7 +988,7 @@ int WolParams4thGen::getFromDev(mfile* mf)
     }
     // unpack and update
     tools_open_wol_unpack(&wolTlv, buff);
-    _wolMagicEn = wolTlv.en_wol_magic;
+    setParams(wolTlv.en_wol_magic);
     _updated = true;
 
     return MCE_SUCCESS;
@@ -719,6 +1042,14 @@ u_int32_t WolParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t WolParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Wol_Magic_En) {
+        return _wolMagicEnDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
 bool WolParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 {
     MError rc;
@@ -734,7 +1065,12 @@ bool WolParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 
 int WolParams5thGen::getDefaultParams(mfile* mf)
 {
-    return getFromDev(mf);
+    GET_DEFAULT_5TH_GEN(mf, tools_open_wol, "Wake On LAN");
+}
+
+void WolParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_wolMagicEnDefault);
 }
 
 int WolParams5thGen::getFromDev(mfile* mf)
@@ -769,11 +1105,16 @@ void WolParams5thGen::updateTlvFromClassAttr(void* tlv)
 void WolParams5thGen::updateClassAttrFromTlv(void* tlv)
 {
     struct tools_open_wol* wolTlv = (struct tools_open_wol*)tlv;
-    _wolMagicEn = wolTlv->en_wol_magic;
+    setParams(wolTlv->en_wol_magic);
     return;
 }
 
-
+void WolParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_wol* wolTlv = (struct tools_open_wol*)tlv;
+    _wolMagicEnDefault = wolTlv->en_wol_magic;
+    return;
+}
 /*
  * BarSzParams Class implementation :
  */
@@ -794,6 +1135,13 @@ u_int32_t BarSzParams::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t BarSzParams::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Log_Bar_Size) {
+        return _logBarSzDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
 
 bool BarSzParams::hardLimitCheck()
 {
@@ -804,6 +1152,10 @@ bool BarSzParams::hardLimitCheck()
     return true;
 }
 
+void BarSzParams::setParams(u_int32_t logBarSz)
+{
+    _logBarSz = logBarSz;
+}
 /*
  * BarSzParams4thGen Class implementation :
  */
@@ -820,8 +1172,9 @@ int BarSzParams4thGen::getDefaultParams(mfile* mf)
     struct tools_open_query_def_params_global global_params;
     int rc = getDefaultParams4thGen(mf, &global_params);
     if ((rc == MCE_SUCCESS) & 0) { //TODO: adrianc: remove the & 0 when FW displays thesee parameters correctly in QUERY_DEF_PARAMS command
-        _logBarSz = global_params.uar_bar_size;
+        _logBarSzDefault = global_params.uar_bar_size;
         _maxLogBarSz = global_params.max_uar_bar_size;
+        setParams(_logBarSzDefault);
     } else {
         // attempt to take from query_dev_cap
         rc = getDefaultBarSz(mf);
@@ -844,7 +1197,8 @@ int BarSzParams4thGen::getDefaultBarSz(mfile* mf)
         return errmsg(MCE_BAD_STATUS,"Failed to query device capabilities. %s", tcif_err2str(rc));
     }
 
-    _logBarSz = EXTRACT64(data, 16, 6) + 1; //adrianc: this field reports only half of the bar size (i.e without the blue flame)
+    _logBarSzDefault = EXTRACT64(data, 16, 6) + 1; //adrianc: this field reports only half of the bar size (i.e without the blue flame)
+    setParams(_logBarSzDefault);
     return MCE_SUCCESS;
 }
 
@@ -872,7 +1226,7 @@ int BarSzParams4thGen::getFromDev(mfile* mf)
     }
     // unpack and update
     tools_open_bar_size_unpack(&barSzTlv, buff);
-    _logBarSz = barSzTlv.log_uar_bar_size;
+    setParams(barSzTlv.log_uar_bar_size);
     _updated = true;
 
     return MCE_SUCCESS;
@@ -974,13 +1328,18 @@ int VpiParams::getFromDevComPost(MError mnvaComRC)
      }
      // unpack and update
      tools_open_vpi_settings_unpack(&_vpiTlv, &_tlvBuff[0]);
-     _linkType = _vpiTlv.network_link_type;
-     _defaultLinkType = _vpiTlv.default_link_type;
+     setParams(_vpiTlv.network_link_type, _vpiTlv.default_link_type);
      _updated = true;
      return MCE_SUCCESS;
 
 }
 
+void VpiParams::setParams(u_int32_t linkType, u_int32_t defaultLinkType)
+{
+    _linkType = linkType;
+    _defaultLinkType = defaultLinkType;
+}
+
 int VpiParams::setOnDevComPre(bool ignoreCheck)
 {
     if (_linkType == MLXCFG_UNKNOWN || _defaultLinkType == MLXCFG_UNKNOWN) {
@@ -1026,6 +1385,14 @@ u_int32_t VpiParams4thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t VpiParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ((paramType == Mcp_Link_Type_P1 && _port == 1 ) || (paramType == Mcp_Link_Type_P2 && _port == 2) ) {
+        return _linkTypeDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
 bool VpiParams4thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 {
     (void)mf;
@@ -1036,14 +1403,15 @@ bool VpiParams4thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 int VpiParams4thGen::getDefaultParams(mfile* mf)
 {
     struct tools_open_query_def_params_per_port port_params;
-    _defaultLinkType = 0; // not used for 4th gen devices , we give it a default value
+    _defaultLinkTypeDefault = 0; // not used for 4th gen devices , we give it a default value
     int rc = getDefaultParams4thGen(mf, _port , &port_params);
     if (rc) {
         return MCE_GET_DEFAULT_PARAMS;
     }
     if (port_params.default_network_link_type) {
-        _linkType = port_params.default_network_link_type;
+        _linkTypeDefault = port_params.default_network_link_type;
     }
+    setParams(_linkTypeDefault, _defaultLinkTypeDefault);
     return MCE_SUCCESS;
 }
 
@@ -1101,6 +1469,14 @@ u_int32_t VpiParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t VpiParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ((paramType == Mcp_Link_Type_P1 && _port == 1 ) || (paramType == Mcp_Link_Type_P2 && _port == 2) ) {
+        return _defaultLinkTypeDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
 u_int32_t VpiParams5thGen::getTlvTypeBe()
 {
     struct tools_open_per_port_type type;
@@ -1123,7 +1499,7 @@ bool VpiParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
     bool suppRead, suppWrite;
     rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
     if (rc) {
-        errmsg("Failed to get VPI params capabilites. %s", m_err2str(rc));
+        errmsg("Failed to get VPI params capabilities. %s", m_err2str(rc));
         return false;
     }
     return suppRead && suppWrite;
@@ -1131,24 +1507,51 @@ bool VpiParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
 
 int VpiParams5thGen::getDefaultParams(mfile* mf)
 {
-    // if configuration is supported then network link type must be 3
-    _linkType = 3;
-    return getFromDev(mf);
-}
-
-int VpiParams5thGen::getFromDev(mfile* mf)
-{
     MError mRc;
     int rc;
 
-    if (_updated) {
-        return MCE_SUCCESS;
-    }
+    // if configuration is supported then network link type must be 3
+    _linkTypeDefault = 3;
+
     if((rc = getFromDevComPre())) {
         return rc;
     }
-    mRc = mnvaCom5thGen(mf, &_tlvBuff[0], TOOLS_OPEN_VPI_SETTINGS_SIZE, getTlvTypeBe(), REG_ACCESS_METHOD_GET);
-    return getFromDevComPost(mRc);
+
+    mRc = mnvaCom5thGen(mf, &_tlvBuff[0], TOOLS_OPEN_VPI_SETTINGS_SIZE, getTlvTypeBe(), REG_ACCESS_METHOD_GET, true);
+
+    if (mRc) {
+        if (mRc == ME_REG_ACCESS_RES_NOT_AVLBL) {
+            return MCE_SUCCESS;
+        }
+        return errmsg("Failed to get VPI port%d configuration: %s", _port, m_err2str(mRc));
+    }
+
+    // unpack and update
+    tools_open_vpi_settings_unpack(&_vpiTlv, &_tlvBuff[0]);
+    _linkTypeDefault = _vpiTlv.network_link_type;
+    _defaultLinkTypeDefault = _vpiTlv.default_link_type;
+    setParams(_linkTypeDefault, _defaultLinkTypeDefault);
+    return MCE_SUCCESS;
+
+}
+
+int VpiParams5thGen::getFromDev(mfile* mf)
+{
+    MError mRc;
+    int rc;
+
+    if (_updated) {
+        return MCE_SUCCESS;
+    }
+    if((rc = getFromDevComPre())) {
+        return rc;
+    }
+    mRc = mnvaCom5thGen(mf, &_tlvBuff[0], TOOLS_OPEN_VPI_SETTINGS_SIZE, getTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    rc = getFromDevComPost(mRc);
+
+    _updated = true;
+
+    return rc;
 }
 
 int VpiParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
@@ -1210,7 +1613,15 @@ bool PciParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
     case Mcp_Fpp_En:
         return _fppSupported;
     case Mcp_Last:
-        return (_sriovSupported && _fppSupported);
+        return true;
+    case Mcp_PF_Log_Bar_Size:
+        return _pfLogBarSizeSuppored;
+    case Mcp_VF_Log_Bar_Size:
+        return _vfLogBarSizeSuppored;
+    case Mcp_Num_Pf_Msix:
+        return _numPfMsixSupported;
+    case Mcp_Num_Vf_Msix:
+        return _numVfMsixSupported;
     default:
         return false;
     }
@@ -1227,6 +1638,18 @@ void PciParams5thGen::setParam(mlxCfgParam paramType, u_int32_t val)
     } else if (paramType == Mcp_Fpp_En) {
         _fppEn = val;
         _userSpecifiedFPP = true;
+    } else if(paramType == Mcp_PF_Log_Bar_Size) {
+        _pfLogBarSize = val;
+        _userSpecifiedPfLogBarSize = true;
+    } else if(paramType == Mcp_VF_Log_Bar_Size) {
+        _vfLogBarSize = val;
+        _userSpecifiedVfLogBarSize = true;
+    } else if(paramType == Mcp_Num_Pf_Msix) {
+        _numPfMsix = val;
+        _userSpecifiedNumPfMsix = true;
+    } else if(paramType == Mcp_Num_Vf_Msix) {
+        _numVfMsix = val;
+        _userSpecifiedNumVfMsix = true;
     }
 }
 
@@ -1238,6 +1661,35 @@ u_int32_t PciParams5thGen::getParam(mlxCfgParam paramType)
         return _numOfVfs;
     } else if (paramType == Mcp_Fpp_En) {
         return _fppEn;
+    } else if(paramType == Mcp_PF_Log_Bar_Size) {
+        return _pfLogBarSize;
+    } else if(paramType == Mcp_VF_Log_Bar_Size) {
+        return _vfLogBarSize;
+    } else if(paramType == Mcp_Num_Pf_Msix) {
+        return _numPfMsix;
+    } else if(paramType == Mcp_Num_Vf_Msix) {
+        return _numVfMsix;
+    }
+
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t PciParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Sriov_En) {
+        return _sriovEnDefault;
+    } else if (paramType == Mcp_Num_Of_Vfs) {
+        return _numOfVfsDefault;
+    } else if (paramType == Mcp_Fpp_En) {
+        return _fppEnDefault;
+    } else if(paramType == Mcp_PF_Log_Bar_Size) {
+        return _pfLogBarSizeDefault;
+    } else if(paramType == Mcp_VF_Log_Bar_Size) {
+        return _vfLogBarSizeDefault;
+    } else if(paramType == Mcp_Num_Pf_Msix) {
+        return _numPfMsixDefault;
+    } else if(paramType == Mcp_Num_Vf_Msix) {
+        return _numVfMsixDefault;
     }
 
     return MLXCFG_UNKNOWN;
@@ -1253,7 +1705,6 @@ int PciParams5thGen::getFromDev(mfile* mf)
     if (_updated) {
         return MCE_SUCCESS;
     }
-
     mRc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_PCI_CONFIGURATION_SIZE, getPciSettingsTlvTypeBe(), REG_ACCESS_METHOD_GET);
 
     if (mRc) {
@@ -1271,7 +1722,22 @@ int PciParams5thGen::getFromDev(mfile* mf)
     if (pciSettingsTlv.fpp_valid) {
         _fppEn = pciSettingsTlv.fpp_en;
     }
-
+    if(pciSettingsTlv.pf_bar_size_valid) {
+        _pfLogBarSize = pciSettingsTlv.log_pf_uar_bar_size;
+    }
+    if(pciSettingsTlv.vf_bar_size_valid) {
+        _vfLogBarSize = pciSettingsTlv.log_vf_uar_bar_size;
+    }
+    if(pciSettingsTlv.num_pfs_valid){
+        _numOfPfs = pciSettingsTlv.num_pfs;
+        _numOfPfsValid = true;
+    }
+    if(pciSettingsTlv.num_pfs_msix_valid){
+        _numPfMsix = pciSettingsTlv.num_pf_msix;
+    }
+    if(pciSettingsTlv.num_vfs_msix_valid){
+        _numVfMsix = pciSettingsTlv.num_vf_msix;
+    }
     _updated = true;
 
    return MCE_SUCCESS;
@@ -1309,9 +1775,29 @@ int PciParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
         pciSettingsTlv.fpp_valid = 1;
     }
 
+    if (_pfLogBarSizeSuppored && _userSpecifiedPfLogBarSize) {
+        pciSettingsTlv.log_pf_uar_bar_size = _pfLogBarSize;
+        pciSettingsTlv.pf_bar_size_valid = 1;
+    }
+
+    if (_vfLogBarSizeSuppored && _userSpecifiedVfLogBarSize) {
+        pciSettingsTlv.log_vf_uar_bar_size = _vfLogBarSize;
+        pciSettingsTlv.vf_bar_size_valid = 1;
+    }
+
     if (pciSettingsTlv.sriov_en && !pciSettingsTlv.fpp_en) {
         return errmsg("FPP should be enabled while SRIOV is enabled");
     }
+
+    if(_numPfMsixSupported && _userSpecifiedNumPfMsix) {
+        pciSettingsTlv.num_pf_msix = _numPfMsix;
+        pciSettingsTlv.num_pfs_msix_valid = 1;
+    }
+
+    if(_numVfMsixSupported && _userSpecifiedNumVfMsix) {
+        pciSettingsTlv.num_vf_msix = _numVfMsix;
+        pciSettingsTlv.num_vfs_msix_valid = 1;
+    }
     // pack it
     tools_open_pci_configuration_pack(&pciSettingsTlv, tlvBuff);
 
@@ -1327,23 +1813,94 @@ int PciParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
 
 int PciParams5thGen::getDefaultParams(mfile* mf)
 {
-    return getDefaultsAndCapabilities(mf);
+    int rc = getDefaultsAndCapabilities(mf);
+
+    setParams(
+     _sriovEnDefault,
+     _numOfVfsDefault,
+     _fppEnDefault,
+     _pfLogBarSizeDefault,
+     _vfLogBarSizeDefault,
+     _numOfPfs,
+     _numPfMsixDefault,
+     _numVfMsixDefault);
+
+    return rc;
+}
+
+void PciParams5thGen::setParams(u_int32_t sriovEn, u_int32_t numOfVfs, u_int32_t fppEn, u_int32_t pfLogBarSize,
+            u_int32_t vfLogBarSize, u_int32_t numOfPfs, u_int32_t numPfMsix, u_int32_t numVfMsix)
+{
+    _sriovEn = sriovEn;
+    _numOfVfs = numOfVfs;
+    _fppEn = fppEn;
+    _pfLogBarSize = pfLogBarSize;
+    _vfLogBarSize = vfLogBarSize;
+    _numOfPfs = numOfPfs;
+    _numPfMsix = numPfMsix;
+    _numVfMsix = numVfMsix;
 }
 
 int PciParams5thGen::getDefaultsAndCapabilities(mfile* mf)
 {
     MError rc;
-    u_int8_t tlvBuff[TOOLS_OPEN_PCI_CAPABILITIES_SIZE] = {0};
+    u_int8_t tlvCapBuff[TOOLS_OPEN_PCI_CAPABILITIES_SIZE] = {0};
     struct tools_open_pci_capabilities pciCapabilitesTlv;
     memset(&pciCapabilitesTlv, 0, sizeof(pciCapabilitesTlv));
-    rc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_PCI_CAPABILITIES_SIZE, getPciCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_PCI_CAPABILITIES_SIZE, getPciCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
     if (rc) {
         return errmsg("Failed to get PCI capabilities parameter. %s", m_err2str(rc));
     }
-    tools_open_pci_capabilities_unpack(&pciCapabilitesTlv, tlvBuff);
+    tools_open_pci_capabilities_unpack(&pciCapabilitesTlv, tlvCapBuff);
     _sriovSupported = pciCapabilitesTlv.sriov_support;
     _maxVfsPerPf = pciCapabilitesTlv.max_vfs_per_pf_valid ? pciCapabilitesTlv.max_vfs_per_pf : 0;
     _fppSupported = pciCapabilitesTlv.fpp_support;
+    _pfLogBarSizeSuppored = pciCapabilitesTlv.pf_bar_size_supported;
+    _vfLogBarSizeSuppored = pciCapabilitesTlv.vf_bar_size_supported;
+    _numPfMsixSupported = pciCapabilitesTlv.num_pf_msix_supported;
+    _numVfMsixSupported = pciCapabilitesTlv.num_vf_msix_supported;
+    _maxLogPfBarSize = pciCapabilitesTlv.log_max_pf_uar_bar_size1;
+    _maxLogVfBarSize = pciCapabilitesTlv.log_max_vf_uar_bar_size;
+    _maxTotalBarValid = pciCapabilitesTlv.max_total_bar_valid;
+    _maxTotalBar = pciCapabilitesTlv.max_total_bar;
+    _maxNumPfMsix = pciCapabilitesTlv.max_num_pf_msix;
+    _maxNumVfMsix = pciCapabilitesTlv.max_num_vf_msix;
+    _maxTotalMsixValid = pciCapabilitesTlv.max_total_msix_valid;
+    _maxTotalMsix = pciCapabilitesTlv.max_total_msix;
+
+    u_int8_t tlvBuff[TOOLS_OPEN_PCI_CONFIGURATION_SIZE] = {0};
+    struct tools_open_pci_configuration pciSettingsTlv;
+    memset(&pciSettingsTlv, 0, sizeof(pciSettingsTlv));
+
+    rc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_PCI_CONFIGURATION_SIZE, getPciSettingsTlvTypeBe(), REG_ACCESS_METHOD_GET, true);
+
+    if (rc) {
+        if (rc == ME_REG_ACCESS_RES_NOT_AVLBL) {
+            return MCE_SUCCESS;
+        }
+        return errmsg("Failed to get PCI configuration: %s", m_err2str(rc));
+    }
+    // unpack and update
+    tools_open_pci_configuration_unpack(&pciSettingsTlv, &tlvBuff[0]);
+    if (pciSettingsTlv.sriov_valid) {
+        _sriovEnDefault = pciSettingsTlv.sriov_en;
+        _numOfVfsDefault = pciSettingsTlv.total_vfs;
+    }
+    if (pciSettingsTlv.fpp_valid) {
+        _fppEnDefault = pciSettingsTlv.fpp_en;
+    }
+    if(pciSettingsTlv.pf_bar_size_valid) {
+        _pfLogBarSizeDefault = pciSettingsTlv.log_pf_uar_bar_size;
+    }
+    if(pciSettingsTlv.vf_bar_size_valid) {
+        _vfLogBarSizeDefault = pciSettingsTlv.log_vf_uar_bar_size;
+    }
+    if(pciSettingsTlv.num_pfs_msix_valid) {
+        _numPfMsixDefault = pciSettingsTlv.num_pf_msix;
+    }
+    if(pciSettingsTlv.num_vfs_msix_valid) {
+        _numVfMsixDefault = pciSettingsTlv.num_vf_msix;
+    }
 
     return MCE_SUCCESS;
 }
@@ -1390,9 +1947,135 @@ bool PciParams5thGen::hardLimitCheck()
             return false;
         }
     }
+
+    if (_pfLogBarSizeSuppored && _userSpecifiedPfLogBarSize) {
+        if (_pfLogBarSize > _maxLogPfBarSize) {
+            errmsg("Illegal PF_LOG_BAR_SIZE parameter value, Max allowed value is %d", _maxLogPfBarSize);
+            return false;
+        }
+    }
+
+    if (_vfLogBarSizeSuppored && _userSpecifiedVfLogBarSize) {
+        if (_vfLogBarSize > _maxLogVfBarSize) {
+            errmsg("Illegal VF_LOG_BAR_SIZE parameter value, Max allowed value is %d", _maxLogVfBarSize);
+            return false;
+        }
+    }
+
+    if(_numPfMsixSupported && _userSpecifiedNumPfMsix) {
+        if(_numPfMsix > _maxNumPfMsix) {
+            errmsg("Illegal NUM_PF_MSIX parameter value, Max allowed value is %d", _maxNumPfMsix);
+            return false;
+        }
+    }
+
+    if(_numVfMsixSupported && _userSpecifiedNumVfMsix) {
+        if(_numVfMsix > _maxNumVfMsix) {
+            errmsg("Illegal NUM_VF_MSIX parameter value, Max allowed value is %d", _maxNumVfMsix);
+            return false;
+        }
+    }
+
+    return true;
+}
+
+//waiting for arch to correct the constraint formula
+u_int32_t PciParams5thGen::calcNumOfVfs()
+{
+    if(_fppEn == 1){
+        return (_maxTotalBar / _numOfPfs - (1 << _pfLogBarSize))/ (1 << _vfLogBarSize);
+    } else {
+        return (_maxTotalBar - (1 << _pfLogBarSize)) / (1 << _vfLogBarSize);
+    }
+}
+
+u_int32_t PciParams5thGen::calcVfLogBarSize()
+{
+    if(_fppEn == 1){
+        return static_cast<unsigned int>(log2((_maxTotalBar / _numOfPfs - (1 << _pfLogBarSize)) / _numOfVfs));
+    } else {
+        return static_cast<unsigned int>(log2((_maxTotalBar - (1 << _pfLogBarSize)) / _numOfVfs));
+    }
+}
+
+u_int32_t PciParams5thGen::calcPfLogBarSize()
+{
+    if(_fppEn == 1){
+        return static_cast<unsigned int>(log2((_maxTotalBar / _numOfPfs - (1 << _vfLogBarSize) * _numOfVfs)));
+    } else {
+        return static_cast<unsigned int>(log2((_maxTotalBar - (1 << _vfLogBarSize) * _numOfVfs)));
+    }
+}
+
+u_int32_t PciParams5thGen::calcTotalBar()
+{
+    if(_fppEn == 1){
+        return (_numOfPfs * ((1 << _pfLogBarSize) + (1 << _vfLogBarSize) * _numOfVfs));
+    } else {
+        return ((1 << _pfLogBarSize) + (1 << _vfLogBarSize) * _numOfVfs);
+    }
+}
+
+bool PciParams5thGen::softLimitCheck(mfile* mf)
+{
+    (void)mf;
+    if (_maxTotalBarValid == 1 && _maxTotalBar != 0 && _sriovEn == 1) {
+        if(_userSpecifiedSRIOV || _userSpecifiedPfLogBarSize || _userSpecifiedVfLogBarSize){
+            if(_fppEn == 1){
+                if(!_numOfPfsValid){
+                    errmsg("Cannot perform advanced calculations, cannot extract number of physical functions from Firmware.");
+                    return false;
+                }
+               if(calcTotalBar() > _maxTotalBar) {
+                   if(_userSpecifiedSRIOV) {
+                       errmsg("Given the specified parameter: NUM_OF_VFS, the maximum allowed values is %d",calcNumOfVfs());
+                   } else if(_userSpecifiedVfLogBarSize) {
+                       errmsg("Given the specified parameter: VF_Log_Bar_Size, the maximum allowed values is %d",calcVfLogBarSize());
+                   } else if(_userSpecifiedPfLogBarSize) {
+                       errmsg("Given the specified parameter: PF_Log_Bar_Size, the maximum allowed values is %d",calcPfLogBarSize());
+                   }
+                   return false;
+               }
+            } else {
+                if(calcTotalBar() > _maxTotalBar) {
+                    if(_userSpecifiedSRIOV){
+                       errmsg("Given the specified parameter: NUM_OF_VFS, the maximum allowed values is %d",calcNumOfVfs());
+                    } else if(_userSpecifiedVfLogBarSize) {
+                      errmsg("Given the specified parameter: VF_Log_Bar_Size, the maximum allowed values is %d",calcVfLogBarSize());
+                    } else if(_userSpecifiedPfLogBarSize) {
+                      errmsg("Given the specified parameter: PF_Log_Bar_Size, the maximum allowed values is %d",calcPfLogBarSize());
+                    }
+                    return false;
+                }
+            }
+        }
+    }
+
+    if (_maxTotalMsixValid == 1) {
+        if (_userSpecifiedSRIOV || _userSpecifiedNumPfMsix || _userSpecifiedNumVfMsix) {
+            if (!_numOfPfsValid){
+                errmsg("Cannot perform advanced calculations, cannot extract number of physical functions from Firmware.");
+                return false;
+            }
+        }
+        if ((_numOfPfs * (_numPfMsix + _numOfVfs * _numVfMsix)) > _maxTotalMsix){
+            if(_userSpecifiedSRIOV){
+               errmsg("Given the specified parameter: NUM_OF_VFS, the maximum allowed values is %d",
+                                       (((_maxTotalMsix / _numOfPfs) - _numPfMsix) / _numVfMsix));
+            } else if(_userSpecifiedNumPfMsix){
+                errmsg("Given the specified parameter: NUM_PF_MSIX, the maximum allowed values is %d",
+                                       ((_maxTotalMsix / _numOfPfs) - (_numOfVfs * _numVfMsix)));
+            } else if(_userSpecifiedNumVfMsix){
+                errmsg("Given the specified parameter: NUM_VF_MSIX, the maximum allowed values is %d",
+                                       (((_maxTotalMsix / _numOfPfs) - _numPfMsix) /_numOfVfs));
+            }
+        }
+    }
+
     return true;
 }
 
+
 /*
  * TptParams5thGen Class implementation:
  */
@@ -1442,6 +2125,15 @@ u_int32_t TptParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t TptParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Log_Tpt_Size) {
+        return _logMaxPayloadSizeDefault;
+    }
+
+    return MLXCFG_UNKNOWN;
+}
+
 int TptParams5thGen::getFromDev(mfile* mf)
 {
     MError mRc;
@@ -1464,6 +2156,7 @@ int TptParams5thGen::getFromDev(mfile* mf)
     // unpack and update
     tools_open_tpt_configuration_unpack(&tptSettingsTlv, &tlvBuff[0]);
     _logMaxPayloadSize = tptSettingsTlv.log_max_payload_size;
+
     _updated = true;
 
    return MCE_SUCCESS;
@@ -1504,22 +2197,45 @@ int TptParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
 
 int TptParams5thGen::getDefaultParams(mfile* mf)
 {
-    return getDefaultsAndCapabilities(mf);
+    int rc = getDefaultsAndCapabilities(mf);
+    setParams(_logMaxPayloadSizeDefault);
+    return rc;
+}
+
+void TptParams5thGen::setParams(u_int32_t logMaxPayloadSize)
+{
+    _logMaxPayloadSize = logMaxPayloadSize;
 }
 
 int TptParams5thGen::getDefaultsAndCapabilities(mfile* mf)
 {
     MError rc;
-    u_int8_t tlvBuff[TOOLS_OPEN_TPT_CAPABILITIES_SIZE] = {0};
+    u_int8_t tlvCapBuff[TOOLS_OPEN_TPT_CAPABILITIES_SIZE] = {0};
     struct tools_open_tpt_capabilities tptCapabilitesTlv;
     memset(&tptCapabilitesTlv, 0, sizeof(tptCapabilitesTlv));
-    rc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_TPT_CAPABILITIES_SIZE, getTptCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_TPT_CAPABILITIES_SIZE, getTptCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
     if (rc) {
         return errmsg("Failed to get TPT capabilities parameter. %s", m_err2str(rc));
     }
-    tools_open_tpt_capabilities_unpack(&tptCapabilitesTlv, tlvBuff);
+    tools_open_tpt_capabilities_unpack(&tptCapabilitesTlv, tlvCapBuff);
     _logMaxPayloadSizeSupported = tptCapabilitesTlv.log_max_payload_size_supported;
 
+    u_int8_t tlvBuff[TOOLS_OPEN_TPT_CONFIGURATION_SIZE] = {0};
+    struct tools_open_tpt_configuration tptSettingsTlv;
+    memset(&tptSettingsTlv, 0, sizeof(tptSettingsTlv));
+
+    rc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_TPT_CONFIGURATION_SIZE, getTptSettingsTlvTypeBe(), REG_ACCESS_METHOD_GET, true);
+
+    if (rc) {
+        if (rc == ME_REG_ACCESS_RES_NOT_AVLBL) {
+            return MCE_SUCCESS;
+        }
+        return errmsg("Failed to get TPT default configuration: %s", m_err2str(rc));
+    }
+    // unpack and update
+    tools_open_tpt_configuration_unpack(&tptSettingsTlv, &tlvBuff[0]);
+    _logMaxPayloadSizeDefault = tptSettingsTlv.log_max_payload_size;
+
     return MCE_SUCCESS;
 }
 
@@ -1585,6 +2301,15 @@ u_int32_t InfinibandBootSettingsParams4thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t InfinibandBootSettingsParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ((paramType == Mcp_Boot_Pkey_P1 && _port == 1) || (paramType == Mcp_Boot_Pkey_P2 && _port == 2)) {
+        return _bootPkeyDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+
 int InfinibandBootSettingsParams4thGen::getFromDev(mfile* mf)
 {
     MError mRc;
@@ -1644,13 +2369,19 @@ int InfinibandBootSettingsParams4thGen::getDefaultParams(mfile* mf)
     int rc;
     rc = getDefaultParams4thGen(mf, _port, &portParams);
     if (rc == MCE_SUCCESS) {
-        _bootPkey = portParams.default_boot_pkey;
+        _bootPkeyDefault = portParams.default_boot_pkey;
+        setParams(_bootPkeyDefault);
     } else {
         rc = MCE_GET_DEFAULT_PARAMS;
     }
     return rc;
 }
 
+void InfinibandBootSettingsParams4thGen::setParams(u_int32_t bootPkey)
+{
+    _bootPkey = bootPkey;
+}
+
 bool InfinibandBootSettingsParams4thGen::hardLimitCheck()
 {
     if (_bootPkey >= (1 << 16)) {
@@ -1711,6 +2442,30 @@ u_int32_t IBDCParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t IBDCParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Log_Dcr_Hash_Table_Size) {
+        return _logDcrHashTableSizeDefault;
+    }
+    if (paramType == Mcp_Dcr_Lifo_Size) {
+        return _dcrLifoSizeDefault;
+    }
+
+    return MLXCFG_UNKNOWN;
+}
+
+void IBDCParams5thGen::setParams(u_int32_t logDcrHashTableSize, u_int32_t dcrLifoSize)
+{
+    _logDcrHashTableSize = logDcrHashTableSize;
+    _dcrLifoSize = dcrLifoSize;
+}
+
+void IBDCParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_logDcrHashTableSizeDefault,
+            _dcrLifoSizeDefault);
+}
+
 int IBDCParams5thGen::getFromDev(mfile* mf)
 {
     GET_FROM_DEV_5TH_GEN(mf, tools_open_infiniband_dc_settings, "IB Dynamically Connected");
@@ -1729,19 +2484,20 @@ int IBDCParams5thGen::getDefaultParams(mfile* mf)
 int IBDCParams5thGen::getDefaultsAndCapabilities(mfile* mf)
 {
     MError rc;
-    u_int8_t tlvBuff[TOOLS_OPEN_INFINIBAND_DC_CAPABILITIES_SIZE] = {0};
+    u_int8_t tlvCapBuff[TOOLS_OPEN_INFINIBAND_DC_CAPABILITIES_SIZE] = {0};
     struct tools_open_infiniband_dc_capabilities dcCapabilitesTlv;
     memset(&dcCapabilitesTlv, 0, sizeof(dcCapabilitesTlv));
-    rc = mnvaCom5thGen(mf, &tlvBuff[0], TOOLS_OPEN_INFINIBAND_DC_CAPABILITIES_SIZE, getDcCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_INFINIBAND_DC_CAPABILITIES_SIZE, getDcCapabilitiesTlvTypeBe(), REG_ACCESS_METHOD_GET);
     if (rc) {
         return errmsg("Failed to get Infiniband DC capabilities parameter. %s", m_err2str(rc));
     }
-    tools_open_infiniband_dc_capabilities_unpack(&dcCapabilitesTlv, tlvBuff);
+    tools_open_infiniband_dc_capabilities_unpack(&dcCapabilitesTlv, tlvCapBuff);
     _minLogDcrHashTableSize = dcCapabilitesTlv.min_log_dcr_hash_table_size;
     _maxLogDcrHashTableSize = dcCapabilitesTlv.max_log_dcr_hash_table_size;
     _minDcrLifoSize = dcCapabilitesTlv.min_dcr_lifo_size;
     _maxDcrLifoSize = dcCapabilitesTlv.max_dcr_lifo_size;
-    return MCE_SUCCESS;
+
+    GET_DEFAULT_5TH_GEN(mf, tools_open_infiniband_dc_settings, "IB Dynamically Connected");
 }
 
 u_int32_t IBDCParams5thGen::getTlvTypeBe()
@@ -1795,89 +2551,11 @@ void IBDCParams5thGen::updateClassAttrFromTlv(void* tlv)
     return;
 }
 
-/*
- * PortBootStateParams5thGen Class implementation
- */
-
-bool PortBootStateParams5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
-{
-    MError rc;
-    (void)param;
-    bool suppRead, suppWrite;
-    rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
-    if (rc) {
-        errmsg("Failed to get port boot state parameter capabilities. %s", m_err2str(rc));
-        return false;
-    }
-    if (!suppRead || !suppWrite) {
-        return false;
-    }
-    return true;
-}
-
-void PortBootStateParams5thGen::setParam(mlxCfgParam paramType, u_int32_t val)
-{
-    if ((paramType == Mcp_Boot_State_P1 && _port == 1) || (paramType == Mcp_Boot_State_P2 && _port == 2)) {
-        _portBootState = val;
-    }
-    return;
-}
-
-u_int32_t PortBootStateParams5thGen::getParam(mlxCfgParam paramType)
-{
-    if ((paramType == Mcp_Boot_State_P1 && _port == 1) || (paramType == Mcp_Boot_State_P2 && _port == 2)) {
-        return _portBootState;
-    }
-    return MLXCFG_UNKNOWN;
-}
-
-int PortBootStateParams5thGen::getFromDev(mfile* mf)
-{
-    GET_FROM_DEV_5TH_GEN(mf, tools_open_port_boot_state, "Port Boot State");
-}
-
-int PortBootStateParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
-{
-    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_port_boot_state, "Port Boot State");
-}
-
-int PortBootStateParams5thGen::getDefaultParams(mfile* mf)
-{
-        return getFromDev(mf);
-}
-
-bool PortBootStateParams5thGen::hardLimitCheck()
-{
-    if (_portBootState > 3) {
-        errmsg("Illegal BOOT_STATE_P%d parameter value (0=Normal Operation, 1=SFP power off, 2=SERDES power off, 3=Admin linkdown)", _port);
-        return false;
-    }
-    return true;
-}
-
-u_int32_t PortBootStateParams5thGen::getTlvTypeBe()
-{
-    struct tools_open_per_port_type type;
-    u_int32_t tlvType = 0;
-
-    type.param_class = CLASS_PHYS_PORT;
-    type.param_idx = tlvTypeIdx;
-    type.port = _port;
-    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
-    return tlvType;
-}
-
-void PortBootStateParams5thGen::updateTlvFromClassAttr(void* tlv)
-{
-    struct tools_open_port_boot_state* portBootStateTlv = (struct tools_open_port_boot_state*)tlv;
-    portBootStateTlv->port_boot_state = _portBootState;
-    return;
-}
-
-void PortBootStateParams5thGen::updateClassAttrFromTlv(void* tlv)
+void IBDCParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
 {
-    struct tools_open_port_boot_state* portBootStateTlv = (struct tools_open_port_boot_state*)tlv;
-    _portBootState = portBootStateTlv->port_boot_state;
+    struct tools_open_infiniband_dc_settings* ibDcTlv = (struct tools_open_infiniband_dc_settings*)tlv;
+    _dcrLifoSizeDefault = ibDcTlv->dcr_lifo_size;
+    _logDcrHashTableSizeDefault = ibDcTlv->log_dcr_hash_table_size;
     return;
 }
 
@@ -1918,6 +2596,24 @@ u_int32_t RoCENextProtocolParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t RoCENextProtocolParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ( paramType == Mcp_RoCE_Next_Protocol) {
+        return _nextProtocolDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void RoCENextProtocolParams5thGen::setParams(u_int32_t nextProtocol)
+{
+    _nextProtocol = nextProtocol;
+}
+
+void RoCENextProtocolParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_nextProtocolDefault);
+}
+
 int RoCENextProtocolParams5thGen::getFromDev(mfile* mf)
 {
    GET_FROM_DEV_5TH_GEN(mf, tools_open_roce_v_1_5_next_protocol, "RoCE Next Protocol");
@@ -1930,7 +2626,7 @@ int RoCENextProtocolParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
 
 int RoCENextProtocolParams5thGen::getDefaultParams(mfile* mf)
 {
-        return getFromDev(mf);
+    GET_DEFAULT_5TH_GEN(mf, tools_open_roce_v_1_5_next_protocol, "RoCE Next Protocol");
 }
 
 bool RoCENextProtocolParams5thGen::hardLimitCheck()
@@ -1967,7 +2663,14 @@ void RoCENextProtocolParams5thGen::updateClassAttrFromTlv(void* tlv)
     return;
 }
 
-/*
+void RoCENextProtocolParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_roce_v_1_5_next_protocol* roceNpTlv = (struct tools_open_roce_v_1_5_next_protocol*)tlv;
+    _nextProtocolDefault = roceNpTlv->roce_over_ip_next_protocol;
+    return;
+}
+
+/*
  * RoCECCParams5thGen Class implementation
  */
 
@@ -2010,6 +2713,30 @@ u_int32_t RoCECCParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t RoCECCParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ( (paramType == Mcp_RoCE_CC_Algorithm_P1 && _port == 1) || (paramType == Mcp_RoCE_CC_Algorithm_P2 && _port == 2)) {
+        return _roceCcAlgorithmDefault;
+    }
+    if ( (paramType == Mcp_RoCE_CC_Prio_Mask_P1 && _port == 1) || (paramType == Mcp_RoCE_CC_Prio_Mask_P2 && _port == 2)) {
+        return _roceCcPrioMaskDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void RoCECCParams5thGen::setParams(u_int32_t roceCcAlgorithm, u_int32_t roceCcPrioMask)
+{
+    _roceCcAlgorithm = roceCcAlgorithm;
+    _roceCcPrioMask = roceCcPrioMask;
+}
+
+void RoCECCParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(
+        _roceCcAlgorithmDefault,
+        _roceCcPrioMaskDefault);
+}
+
 int RoCECCParams5thGen::getFromDev(mfile* mf)
 {
     GET_FROM_DEV_5TH_GEN(mf, tools_open_roce_cc, "RoCE CC");
@@ -2021,7 +2748,7 @@ int RoCECCParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
 }
 int RoCECCParams5thGen::getDefaultParams(mfile* mf)
 {
-        return getFromDev(mf);
+    GET_DEFAULT_5TH_GEN(mf, tools_open_roce_cc, "RoCE CC");
 }
 
 bool RoCECCParams5thGen::hardLimitCheck()
@@ -2064,6 +2791,14 @@ void RoCECCParams5thGen::updateClassAttrFromTlv(void* tlv)
     return;
 }
 
+void RoCECCParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_roce_cc* roceCcTlv = (struct tools_open_roce_cc*)tlv;
+    _roceCcAlgorithmDefault = roceCcTlv->roce_cc_algorithm;
+    _roceCcPrioMaskDefault = roceCcTlv->roce_cc_enable_priority;
+    return;
+}
+
 /*
  * RoCECCEcnParams5thGen Class implementation
  */
@@ -2309,6 +3044,147 @@ u_int32_t RoCECCEcnParams5thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t RoCECCEcnParams5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    // adrianc: consider moving to MAP on large scale TLVs
+    if (_port == 1) {
+        switch (paramType) {
+        case Mcp_Clamp_Tgt_Rate_P1:
+            return _clampTgtRateDefault;
+        case Mcp_Clamp_Tgt_Rate_After_Time_Inc_P1:
+            return _clampTgtRateAfterTimeIncDefault;
+        case Mcp_Rpg_Time_Reset_P1:
+            return _rpgTimeResetDefault;
+        case Mcp_Rpg_Byte_Reset_P1:
+            return _rpgByteResetDefault;
+        case Mcp_Rpg_Threshold_P1:
+            return _rpgThresholdDefault;
+        case Mcp_Rpg_Max_Rate_P1:
+            return _rpgMaxRateDefault;
+        case Mcp_Rpg_Ai_Rate_P1:
+            return _rpgAiRateDefault;
+        case Mcp_Rpg_Hai_Rate_P1:
+            return _rpgHaiRateDefault;
+        case Mcp_Rpg_Gd_P1:
+            return _rpgGdDefault;
+        case Mcp_Rpg_Min_Dec_Fac_P1:
+            return _rpgMinDecFacDefault;
+        case Mcp_Rpg_Min_Rate_P1:
+            return _rpgMinRateDefault;
+        case Mcp_Rate_To_Set_On_First_Cnp_P1:
+            return _rateToSetOnFirstCnpDefault;
+        case Mcp_Dce_Tcp_G_P1:
+            return _dceTcpGDefault;
+        case Mcp_Dce_Tcp_Rtt_P1:
+            return _dceTcpRttDefault;
+        case Mcp_Rate_Reduce_Monitor_Period_P1:
+            return _rateReduceMonitorPeriodDefault;
+        case Mcp_Initial_Alpha_Value_P1:
+            return _initialAlphaValueDefault;
+        case Mcp_Min_Time_Between_Cnps_P1:
+            return _minTimeBetweenCnpsDefault;
+        case Mcp_Cnp_Dscp_P1:
+            return _cnpDscpDefault;
+        case Mcp_Cnp_802p_Prio_P1:
+            return _cnp802pPrioDefault;
+        default:
+            break;
+        }
+    } else if (_port == 2) {
+        switch (paramType) {
+        case Mcp_Clamp_Tgt_Rate_P2:
+            return _clampTgtRateDefault;
+        case Mcp_Clamp_Tgt_Rate_After_Time_Inc_P2:
+            return _clampTgtRateAfterTimeIncDefault;
+        case Mcp_Rpg_Time_Reset_P2:
+            return _rpgTimeResetDefault;
+        case Mcp_Rpg_Byte_Reset_P2:
+            return _rpgByteResetDefault;
+        case Mcp_Rpg_Threshold_P2:
+            return _rpgThresholdDefault;
+        case Mcp_Rpg_Max_Rate_P2:
+            return _rpgMaxRateDefault;
+        case Mcp_Rpg_Ai_Rate_P2:
+            return _rpgAiRateDefault;
+        case Mcp_Rpg_Hai_Rate_P2:
+            return _rpgHaiRateDefault;
+        case Mcp_Rpg_Gd_P2:
+            return _rpgGdDefault;
+        case Mcp_Rpg_Min_Dec_Fac_P2:
+            return _rpgMinDecFacDefault;
+        case Mcp_Rpg_Min_Rate_P2:
+            return _rpgMinRateDefault;
+        case Mcp_Rate_To_Set_On_First_Cnp_P2:
+            return _rateToSetOnFirstCnpDefault;
+        case Mcp_Dce_Tcp_G_P2:
+            return _dceTcpGDefault;
+        case Mcp_Dce_Tcp_Rtt_P2:
+            return _dceTcpRttDefault;
+        case Mcp_Rate_Reduce_Monitor_Period_P2:
+            return _rateReduceMonitorPeriodDefault;
+        case Mcp_Initial_Alpha_Value_P2:
+            return _initialAlphaValueDefault;
+        case Mcp_Min_Time_Between_Cnps_P2:
+            return _minTimeBetweenCnpsDefault;
+        case Mcp_Cnp_Dscp_P2:
+            return _cnpDscpDefault;
+        case Mcp_Cnp_802p_Prio_P2:
+            return _cnp802pPrioDefault;
+        default:
+            break;
+        }
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void RoCECCEcnParams5thGen::setParams(u_int32_t clampTgtRate, u_int32_t clampTgtRateAfterTimeInc, u_int32_t rpgTimeReset, u_int32_t rpgByteReset,
+            u_int32_t rpgThreshold, u_int32_t rpgMaxRate, u_int32_t rpgAiRate, u_int32_t rpgHaiRate,
+            u_int32_t rpgGd, u_int32_t rpgMinDecFac, u_int32_t rpgMinRate, u_int32_t rateToSetOnFirstCnp,
+            u_int32_t dceTcpG, u_int32_t dceTcpRtt, u_int32_t rateReduceMonitorPeriod, u_int32_t initialAlphaValue,
+            u_int32_t minTimeBetweenCnps, u_int32_t cnpDscp, u_int32_t cnp802pPrio){
+    _clampTgtRate = clampTgtRate;
+    _clampTgtRateAfterTimeInc = clampTgtRateAfterTimeInc;
+    _rpgTimeReset = rpgTimeReset;
+    _rpgByteReset = rpgByteReset;
+    _rpgThreshold = rpgThreshold;
+    _rpgMaxRate = rpgMaxRate;
+    _rpgAiRate = rpgAiRate;
+    _rpgHaiRate = rpgHaiRate;
+    _rpgGd = rpgGd;
+    _rpgMinDecFac = rpgMinDecFac;
+    _rpgMinRate = rpgMinRate;
+    _rateToSetOnFirstCnp = rateToSetOnFirstCnp;
+    _dceTcpG = dceTcpG;
+    _dceTcpRtt = dceTcpRtt;
+    _rateReduceMonitorPeriod = rateReduceMonitorPeriod;
+    _initialAlphaValue = initialAlphaValue;
+    _minTimeBetweenCnps = minTimeBetweenCnps;
+    _cnpDscp = cnpDscp;
+    _cnp802pPrio = cnp802pPrio;
+}
+
+void RoCECCEcnParams5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_clampTgtRateDefault,_clampTgtRateAfterTimeIncDefault,
+     _rpgTimeResetDefault,
+     _rpgByteResetDefault,
+     _rpgThresholdDefault,
+     _rpgMaxRateDefault,
+     _rpgAiRateDefault,
+     _rpgHaiRateDefault,
+     _rpgGdDefault,
+     _rpgMinDecFacDefault,
+     _rpgMinRateDefault,
+     _rateToSetOnFirstCnpDefault,
+     _dceTcpGDefault,
+     _dceTcpRttDefault,
+     _rateReduceMonitorPeriodDefault,
+     _initialAlphaValueDefault,
+     _minTimeBetweenCnpsDefault,
+     _cnpDscpDefault,
+     _cnp802pPrioDefault);
+}
+
 int RoCECCEcnParams5thGen::getFromDev(mfile* mf)
 {
     GET_FROM_DEV_5TH_GEN(mf, tools_open_roce_cc_ecn, "RoCE CC ECN");
@@ -2320,7 +3196,7 @@ int RoCECCEcnParams5thGen::setOnDev(mfile* mf, bool ignoreCheck)
 }
 int RoCECCEcnParams5thGen::getDefaultParams(mfile* mf)
 {
-        return getFromDev(mf);
+    GET_DEFAULT_5TH_GEN(mf, tools_open_roce_cc_ecn, "RoCE CC ECN");
 }
 
 u_int32_t _dceTcpG;
@@ -2343,28 +3219,28 @@ bool RoCECCEcnParams5thGen::hardLimitCheck()
         return false;
     }
 
-    if ( _rpgTimeReset >= (1 << 16)) {
-        errmsg("Illegal RPG_TIME_RESET_P%d parameter value(%d), value should be [0..%d]", _port, _rpgTimeReset, (1 << 16) - 1);
+    if ( _rpgTimeReset >= (1 << 17)) {
+        errmsg("Illegal RPG_TIME_RESET_P%d parameter value(%d), value should be [0..%d]", _port, _rpgTimeReset, (1 << 17) - 1);
         return false;
     }
 
-    if (_rpgByteReset >= (1 << 14)) {
-        errmsg("Illegal RPG_BYTE_RESET_P%d parameter value(%d), value should be [0..%d]", _port, _rpgByteReset, (1 << 14) - 1);
+    if (_rpgByteReset >= (1 << 15)) {
+        errmsg("Illegal RPG_BYTE_RESET_P%d parameter value(%d), value should be [0..%d]", _port, _rpgByteReset, (1 << 15) - 1);
         return false;
     }
 
-    if (_rpgThreshold >= (1 << 4)) {
-        errmsg("Illegal RPG_THRESHOLD_P%d parameter value(%d), value should be [0..%d]", _port, _rpgThreshold, (1 << 4) - 1);
+    if (_rpgThreshold >= (1 << 5)) {
+        errmsg("Illegal RPG_THRESHOLD_P%d parameter value(%d), value should be [0..%d]", _port, _rpgThreshold, (1 << 5) - 1);
         return false;
     }
 
-    if ( _rpgAiRate >= (1 << 16)) {
-        errmsg("Illegal RPG_AI_RATE_P%d parameter value(%d), value should be [0..%d]", _port, _rpgAiRate, (1 << 16) - 1);
+    if ( _rpgAiRate >= (1 << 17)) {
+        errmsg("Illegal RPG_AI_RATE_P%d parameter value(%d), value should be [0..%d]", _port, _rpgAiRate, (1 << 17) - 1);
         return false;
     }
 
-    if ( _rpgHaiRate >= (1 << 16)) {
-        errmsg("Illegal RPG_HAI_RATE_P%d parameter value(%d), value should be [0..%d]", _port, _rpgHaiRate, (1 << 16) - 1);
+    if ( _rpgHaiRate >= (1 << 17)) {
+        errmsg("Illegal RPG_HAI_RATE_P%d parameter value(%d), value should be [0..%d]", _port, _rpgHaiRate, (1 << 17) - 1);
         return false;
     }
 
@@ -2378,48 +3254,48 @@ bool RoCECCEcnParams5thGen::hardLimitCheck()
         return false;
     }
 
-    if (_rpgMinRate >= (1 << 16)) {
-        errmsg("Illegal RPG_MIN_RATE_P%d parameters value(%d), value should be [1..%d]", _port, _rpgMinRate, (1 << 16) - 1);
+    if (_rpgMinRate >= (1 << 17)) {
+        errmsg("Illegal RPG_MIN_RATE_P%d parameters value(%d), value should be [0..%d]", _port, _rpgMinRate, (1 << 17) - 1);
         return false;
     }
 
-    if (_rateToSetOnFirstCnp >= (1 << 16)) {
-        errmsg("Illegal RATE_TO_SET_ON_FIRST_CNP_P%d parameters value(%d), value should be [1..%d]", _port, _rateToSetOnFirstCnp, (1 << 16) - 1);
+    if (_rateToSetOnFirstCnp >= (1 << 17)) {
+        errmsg("Illegal RATE_TO_SET_ON_FIRST_CNP_P%d parameters value(%d), value should be [0..%d]", _port, _rateToSetOnFirstCnp, (1 << 17) - 1);
         return false;
     }
 
-    if (_dceTcpG >= (1 << 9)) {
-        errmsg("Illegal DCE_TCP_G_P%d parameters value(%d), value should be [1..%d]", _port, _dceTcpG, (1 << 9) - 1);
+    if (_dceTcpG == 0 || _dceTcpG >= (1 << 10)) {
+        errmsg("Illegal DCE_TCP_G_P%d parameters value(%d), value should be [1..%d]", _port, _dceTcpG, (1 << 10) - 1);
         return false;
     }
 
-    if (_dceTcpRtt >= (1 << 16)) {
-        errmsg("Illegal DCE_TCP_RTT_P%d parameters value(%d), value should be [1..%d]", _port, _dceTcpRtt, (1 << 16) - 1);
+    if (_dceTcpRtt == 0 || _dceTcpRtt >= (1 << 17)) {
+        errmsg("Illegal DCE_TCP_RTT_P%d parameters value(%d), value should be [1..%d]", _port, _dceTcpRtt, (1 << 17) - 1);
         return false;
     }
 
-    if (_rateReduceMonitorPeriod >= (1 << 16)) {
-        errmsg("Illegal RATE_REDUCE_MONITOR_PERIOD_P%d parameters value(%d), value should be [1..%d]", _port, _rateReduceMonitorPeriod, (1 << 16) - 1);
+    if (_rateReduceMonitorPeriod == 0 || _rateReduceMonitorPeriod >= (1 << 17)) {
+        errmsg("Illegal RATE_REDUCE_MONITOR_PERIOD_P%d parameters value(%d), value should be [1..%d]", _port, _rateReduceMonitorPeriod, (1 << 17) - 1);
         return false;
     }
 
-    if (_initialAlphaValue >= (1 << 9)) {
-        errmsg("Illegal INITIAL_ALPHA_VALUE_P%d parameters value(%d), value should be [1..%d]", _port, _initialAlphaValue, (1 << 9) - 1);
+    if (_initialAlphaValue >= (1 << 10)) {
+        errmsg("Illegal INITIAL_ALPHA_VALUE_P%d parameters value(%d), value should be [0..%d]", _port, _initialAlphaValue, (1 << 10) - 1);
         return false;
     }
 
-    if (_minTimeBetweenCnps >= (1 << 16)) {
-        errmsg("Illegal MIN_TIME_BETWEEN_CNPS_P%d parameters value(%d), value should be [1..%d]", _port, _minTimeBetweenCnps, (1 << 16) - 1);
+    if (_minTimeBetweenCnps >= (1 << 17)) {
+        errmsg("Illegal MIN_TIME_BETWEEN_CNPS_P%d parameters value(%d), value should be [0..%d]", _port, _minTimeBetweenCnps, (1 << 17) - 1);
         return false;
     }
 
-    if (_cnpDscp > 7) {
-        errmsg("Illegal CNP_DSCP_P%d parameters value(%d), value should be [0..7]", _port, _cnpDscp);
+    if (_cnpDscp >= (1 << 6)) {
+        errmsg("Illegal CNP_DSCP_P%d parameters value(%d), value should be [0..%d]", _port, _cnpDscp, (1 << 6) - 1);
         return false;
     }
 
-    if (_cnp802pPrio >= (1 << 6)) {
-        errmsg("Illegal CNP_802P_PRIO_P%d parameters value(%d), value should be [1..%d]", _port, _cnp802pPrio, (1 << 6) - 1);
+    if (_cnp802pPrio >= (1 << 3)) {
+        errmsg("Illegal CNP_802P_PRIO_P%d parameters value(%d), value should be [0..%d]", _port, _cnp802pPrio, (1 << 3) - 1);
         return false;
     }
     return true;
@@ -2487,6 +3363,30 @@ void RoCECCEcnParams5thGen::updateClassAttrFromTlv(void* tlv)
     return;
 }
 
+void RoCECCEcnParams5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_roce_cc_ecn* roceCcEcnTlv = (struct tools_open_roce_cc_ecn*)tlv;
+    _clampTgtRateDefault = roceCcEcnTlv->clamp_tgt_rate;
+    _clampTgtRateAfterTimeIncDefault = roceCcEcnTlv->clamp_tgt_rate_after_time_inc;
+    _cnp802pPrioDefault = roceCcEcnTlv->cnp_802p_prio;
+    _cnpDscpDefault = roceCcEcnTlv->cnp_dscp;
+    _dceTcpGDefault = roceCcEcnTlv->dce_tcp_g;
+    _dceTcpRttDefault = roceCcEcnTlv->dce_tcp_rtt;
+    _initialAlphaValueDefault = roceCcEcnTlv->initial_alpha_value;
+    _minTimeBetweenCnpsDefault = roceCcEcnTlv->min_time_between_cnps;
+    _rateReduceMonitorPeriodDefault = roceCcEcnTlv->rate_reduce_monitor_period;
+    _rateToSetOnFirstCnpDefault = roceCcEcnTlv->rate_to_set_on_first_cnp;
+    _rpgAiRateDefault = roceCcEcnTlv->rpg_ai_rate;
+    _rpgByteResetDefault = roceCcEcnTlv->rpg_byte_reset;
+    _rpgGdDefault = roceCcEcnTlv->rpg_gd;
+    _rpgHaiRateDefault = roceCcEcnTlv->rpg_hai_rate;
+    _rpgMaxRateDefault = roceCcEcnTlv->rpg_max_rate;
+    _rpgMinDecFacDefault = roceCcEcnTlv->rpg_min_dec_fac;
+    _rpgMinRateDefault = roceCcEcnTlv->rpg_min_rate;
+    _rpgThresholdDefault = roceCcEcnTlv->rpg_threshold;
+    _rpgTimeResetDefault = roceCcEcnTlv->rpg_time_reset;
+    return;
+}
 
 /*
  * PrebootBootSettingsParams4thGen Class implementation:
@@ -2552,6 +3452,47 @@ u_int32_t PrebootBootSettingsParams4thGen::getParam(mlxCfgParam paramType)
     return MLXCFG_UNKNOWN;
 }
 
+u_int32_t PrebootBootSettingsParams4thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if ((paramType == Mcp_Boot_Option_Rom_En_P1 && _port == 1) || (paramType == Mcp_Boot_Option_Rom_En_P2 && _port == 2)) {
+        return _bootOptionRomEnDefault;
+    }
+
+    if ((paramType == Mcp_Boot_Vlan_En_P1 && _port == 1) || (paramType == Mcp_Boot_Vlan_En_P2 && _port == 2)) {
+        return _bootVlanEnDefault;
+    }
+
+    if ((paramType == Mcp_Boot_Retry_Cnt_P1 && _port == 1) || (paramType == Mcp_Boot_Retry_Cnt_P2 && _port == 2)) {
+        return _bootRetryCntDefault;
+    }
+
+    if ((paramType == Mcp_Legacy_Boot_Protocol_P1 && _port == 1) || (paramType == Mcp_Legacy_Boot_Protocol_P2 && _port == 2)) {
+        return _legacyBootProtocolDefault;
+    }
+
+    if ((paramType == Mcp_Boot_Vlan_P1 && _port == 1) || (paramType == Mcp_Boot_Vlan_P2 && _port == 2)) {
+        return _bootVlanDefault;
+    }
+
+    return MLXCFG_UNKNOWN;
+}
+
+void PrebootBootSettingsParams4thGen::setParams(u_int32_t bootOptionRomEn, u_int32_t bootVlanEn, u_int32_t bootRetryCnt,
+            u_int32_t legacyBootProtocol, u_int32_t bootVlan)
+{
+    _bootOptionRomEn = bootOptionRomEn;
+    _bootVlanEn = bootVlanEn;
+    _bootRetryCnt = bootRetryCnt;
+    _legacyBootProtocol = legacyBootProtocol;
+    _bootVlan = bootVlan;
+}
+
+void PrebootBootSettingsParams4thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(_bootOptionRomEnDefault, _bootVlanEnDefault, _bootRetryCntDefault,
+            _legacyBootProtocolDefault, _bootVlanDefault);
+}
+
 int PrebootBootSettingsParams4thGen::getFromDev(mfile* mf)
 {
     GET_FROM_DEV_4TH_GEN(mf, tools_open_preboot_boot_settings, "Preboot Boot Settings", _port);
@@ -2584,17 +3525,28 @@ void PrebootBootSettingsParams4thGen::updateClassAttrFromTlv(void* tlv)
     _bootVlan = prebootTlv->boot_vlan;
 }
 
+void PrebootBootSettingsParams4thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_preboot_boot_settings* prebootTlv = (struct tools_open_preboot_boot_settings*)tlv;
+    _bootOptionRomEnDefault = prebootTlv->boot_option_rom_en;
+    _bootVlanEnDefault = prebootTlv->boot_vlan_en;
+    _bootRetryCntDefault = prebootTlv->boot_retry_count;
+    _legacyBootProtocolDefault = prebootTlv->legacy_boot_protocol;
+    _bootVlanDefault = prebootTlv->boot_vlan;
+}
+
 int PrebootBootSettingsParams4thGen::getDefaultParams(mfile* mf)
 {
     struct tools_open_query_def_params_per_port portParams;
     int rc;
     rc = getDefaultParams4thGen(mf, _port, &portParams);
     if (rc == MCE_SUCCESS) {
-        _bootOptionRomEn = portParams.default_boot_option_rom_en;
-        _bootVlanEn = portParams.default_boot_vlan_en;
-        _bootRetryCnt = portParams.default_boot_retry_cnt;
-        _legacyBootProtocol = portParams.default_boot_protocol;
-        _bootVlan = portParams.default_boot_vlan;
+        _bootOptionRomEnDefault = portParams.default_boot_option_rom_en;
+        _bootVlanEnDefault = portParams.default_boot_vlan_en;
+        _bootRetryCntDefault = portParams.default_boot_retry_cnt;
+        _legacyBootProtocolDefault = portParams.default_boot_protocol;
+        _bootVlanDefault = portParams.default_boot_vlan;
+        updateClassAttrFromDefaultParams();
     } else {
         rc = MCE_GET_DEFAULT_PARAMS;
     }
@@ -2625,3 +3577,707 @@ bool PrebootBootSettingsParams4thGen::hardLimitCheck()
     }
     return true;
 }
+
+/*
+ * ExternalPort5thGen Class implementation
+ */
+
+
+bool ExternalPort5thGen::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    MError rc;
+    (void)param;
+    bool suppRead, suppWrite;
+    rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
+    if (rc) {
+        errmsg("Failed to get External Port parameter capabilities. %s", m_err2str(rc));
+        return false;
+    }
+    if (!suppRead || !suppWrite) {
+        return false;
+    }
+    return true;
+}
+
+void ExternalPort5thGen::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_Port_Owner) {
+        _portOwner = val;
+    }
+    if (paramType == Mcp_Allow_Rd_Counters) {
+        _allowRdCounters = val;
+    }
+    return;
+}
+
+u_int32_t ExternalPort5thGen::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Port_Owner) {
+        return _portOwner;
+    }
+    if (paramType == Mcp_Allow_Rd_Counters) {
+        return _allowRdCounters;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t ExternalPort5thGen::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_Port_Owner) {
+        return _portOwnerDefault;
+    }
+    if (paramType == Mcp_Allow_Rd_Counters) {
+        return _allowRdCountersDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void ExternalPort5thGen::setParams(u_int32_t portOwner, u_int32_t allowRdCounters)
+{
+    _portOwner = portOwner;
+    _allowRdCounters = allowRdCounters;
+}
+
+void ExternalPort5thGen::updateClassAttrFromDefaultParams()
+{
+    setParams(
+            _portOwnerDefault,
+            _allowRdCounters);
+}
+
+int ExternalPort5thGen::getFromDev(mfile* mf)
+{
+    GET_FROM_DEV_5TH_GEN(mf, tools_open_external_port, "External Port");
+}
+
+int ExternalPort5thGen::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_external_port, "External Port");
+}
+int ExternalPort5thGen::getDefaultParams(mfile* mf)
+{
+    GET_DEFAULT_5TH_GEN(mf, tools_open_external_port, "External Port");
+}
+
+bool ExternalPort5thGen::hardLimitCheck()
+{
+    if (_portOwner > 1) {
+        errmsg("Illegal PORT_OWNER parameter value(%d), value should be 0 or 1", _portOwner);
+        return false;
+    }
+    if (_allowRdCounters > 1) {
+        errmsg("Illegal ALLOW_RD_COUNTERS parameter value(%d), value should be 0 or 1", _allowRdCounters);
+        return false;
+    }
+    return true;
+}
+
+u_int32_t ExternalPort5thGen::getTlvTypeBe()
+{
+    struct tools_open_per_host_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PER_HOST;
+    type.param_idx = tlvTypeIdx;
+    type.function = 0;
+    type.host = 0;
+    tools_open_per_host_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+void ExternalPort5thGen::updateTlvFromClassAttr(void* tlv)
+{
+    struct tools_open_external_port* externalPortTlv = (struct tools_open_external_port*)tlv;
+    externalPortTlv->port_owner = _portOwner;
+    externalPortTlv->allow_rd_counters = _allowRdCounters;
+    return;
+}
+
+void ExternalPort5thGen::updateClassAttrFromTlv(void* tlv)
+{
+    struct tools_open_external_port* externalPortTlv = (struct tools_open_external_port*)tlv;
+    _portOwner = externalPortTlv->port_owner;
+    _allowRdCounters = externalPortTlv->allow_rd_counters;
+    return;
+}
+
+void ExternalPort5thGen::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_external_port* externalPortTlv = (struct tools_open_external_port*)tlv;
+    _portOwnerDefault = externalPortTlv->port_owner;
+    _allowRdCountersDefault = externalPortTlv->allow_rd_counters;
+    return;
+}
+
+/*
+ * QoS Class implementation
+ */
+
+bool QoS::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    MError rc;
+    (void)param;
+    bool suppRead, suppWrite;
+    rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
+    if (rc) {
+        errmsg("Failed to get QoS capabilities. %s", m_err2str(rc));
+        return false;
+    }
+    if (!suppRead || !suppWrite) {
+        return false;
+    }
+
+    if (!getCap(mf)) {
+        return false;
+    }
+
+    return true;
+}
+
+void QoS::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_QoS_Num_of_TC_P1 || paramType == Mcp_QoS_Num_of_TC_P2) {
+        _numOfTC = val;
+    }
+
+    if (paramType == Mcp_QoS_Num_of_VL_P1 || paramType == Mcp_QoS_Num_of_VL_P2) {
+        _numOfVL = val;
+    }
+    return;
+}
+
+u_int32_t QoS::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_QoS_Num_of_TC_P1 || paramType == Mcp_QoS_Num_of_TC_P2) {
+        return _numOfTC;
+    }
+    if (paramType == Mcp_QoS_Num_of_VL_P1 || paramType == Mcp_QoS_Num_of_VL_P2) {
+        return _numOfVL;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t QoS::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_QoS_Num_of_TC_P1 || paramType == Mcp_QoS_Num_of_TC_P2) {
+        return _numOfTCDefault;
+    }
+    if (paramType == Mcp_QoS_Num_of_VL_P1 || paramType == Mcp_QoS_Num_of_VL_P2) {
+        return _numOfVLDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void QoS::setParams(u_int32_t numOfTC, u_int32_t numOfVL)
+{
+    _numOfTC = numOfTC;
+    _numOfVL = numOfVL;
+}
+
+void QoS::updateClassAttrFromDefaultParams()
+{
+    setParams(
+            _numOfTC,
+            _numOfVL);
+}
+
+int QoS::getFromDev(mfile* mf)
+{
+    GET_FROM_DEV_5TH_GEN(mf, tools_open_qos, "QoS Conf");
+}
+
+int QoS::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_qos, "QoS Conf");
+}
+
+int QoS::getDefaultParams(mfile* mf)
+{
+    GET_DEFAULT_5TH_GEN(mf, tools_open_qos, "QoS Conf");
+}
+
+bool QoS::getCap(mfile *mf)
+{
+    MError rc;
+    u_int8_t tlvCapBuff[TOOLS_OPEN_QOS_CAP_SIZE] = {0};
+    struct tools_open_qos_cap qosCapTlv;
+    memset(&qosCapTlv, 0, sizeof(qosCapTlv));
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_QOS_CAP_SIZE, getQoSCapTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    if (rc) {
+        return false;
+    }
+    tools_open_qos_cap_unpack(&qosCapTlv, tlvCapBuff);
+    _maxNumOfTC = qosCapTlv.max_num_of_tc;
+    _maxNumOfVL = qosCapTlv.max_num_of_vl;
+    return true;
+}
+
+bool QoS::hardLimitCheckAux(u_int32_t maxNumOfX, u_int32_t numOfX,const char *x)
+{
+    u_int32_t minVal;
+    u_int32_t maxVal;
+    // 0 and 8 have the same maxNumOfX meaning (they both indicate max 8 TCs which translates to the value 0)
+    minVal = (maxNumOfX == 0 || maxNumOfX >= 8) ? 0 : 1;
+    maxVal = (maxNumOfX == 0 || maxNumOfX == 8) ? 7 : maxNumOfX;
+    if ((numOfX < minVal) || numOfX > maxVal) {
+        errmsg("Illegal %s parameter value(%d), max allowed value is (%d), min allowed value is (%d)",
+                x,
+                numOfX,
+                maxVal,
+                minVal);
+        return false;
+    }
+
+    return true;
+}
+
+bool QoS::hardLimitCheck()
+{
+    if(!hardLimitCheckAux(_maxNumOfTC, _numOfTC, _port == 1 ? "NUM_OF_TC_P1" : "NUM_OF_TC_P2")) {
+        return false;
+    }
+
+    if(_numOfVL < 1 || _numOfVL > _maxNumOfVL){
+        errmsg("Illegal %s parameter value(%x), max allowed value is (%x), min allowed value is (%x)",
+            _port == 1 ? "NUM_OF_VL_P1" : "NUM_OF_VL_P2",
+            _numOfVL,
+            _maxNumOfVL,
+            1);
+        return false;
+    }
+
+    return true;
+}
+
+u_int32_t QoS::getTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = tlvTypeIdx;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+void QoS::updateTlvFromClassAttr(void* tlv)
+{
+    struct tools_open_qos* qosPortTlv = (struct tools_open_qos*)tlv;
+    qosPortTlv->num_of_tc = _numOfTC;
+    qosPortTlv->num_of_vl = _numOfVL;
+    return;
+}
+
+void QoS::updateClassAttrFromTlv(void* tlv)
+{
+    struct tools_open_qos* qosPortTlv = (struct tools_open_qos*)tlv;
+    _numOfTC = qosPortTlv->num_of_tc;
+    _numOfVL = qosPortTlv->num_of_vl;
+    return;
+}
+
+void QoS::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_qos* qosPortTlv = (struct tools_open_qos*)tlv;
+    _numOfTCDefault = qosPortTlv->num_of_tc;
+    _numOfVLDefault = qosPortTlv->num_of_vl;
+    return;
+}
+
+u_int32_t QoS::getQoSCapTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = QOS_CAP;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+
+/*
+ * LLDP Client Settings Class implementation
+ */
+
+bool LLDPClientSettings::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    MError rc;
+    (void)param;
+    bool suppRead, suppWrite;
+    rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
+    if (rc) {
+        errmsg("Failed to get LLDP Client Settings capabilities. %s", m_err2str(rc));
+        return false;
+    }
+    if (!suppRead || !suppWrite) {
+        return false;
+    }
+
+    if (!getCap(mf)) {
+        return false;
+    }
+
+    return true;
+}
+
+void LLDPClientSettings::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_LLDP_NB_RX_Mode_P1|| paramType == Mcp_LLDP_NB_RX_Mode_P2) {
+        _userSpecifiedRx = true;
+        _lldpNbRxMode = val;
+    }
+    if (paramType == Mcp_LLDP_NB_TX_Mode_P1|| paramType == Mcp_LLDP_NB_TX_Mode_P2) {
+        _userSpecifiedTx = true;
+        _lldpNbTxMode = val;
+    }
+    if (paramType == Mcp_LLDP_NB_DCBX_P1|| paramType == Mcp_LLDP_NB_DCBX_P2) {
+        _userSpecifiedDcbx = true;
+        _lldpNbDcbx = val;
+    }
+    return;
+}
+
+u_int32_t LLDPClientSettings::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_LLDP_NB_RX_Mode_P1|| paramType == Mcp_LLDP_NB_RX_Mode_P2) {
+        return _lldpNbRxMode;
+    }
+    if (paramType == Mcp_LLDP_NB_TX_Mode_P1|| paramType == Mcp_LLDP_NB_TX_Mode_P2) {
+        return _lldpNbTxMode;
+    }
+    if (paramType == Mcp_LLDP_NB_DCBX_P1|| paramType == Mcp_LLDP_NB_DCBX_P2) {
+        return _lldpNbDcbx;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t LLDPClientSettings::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_LLDP_NB_RX_Mode_P1|| paramType == Mcp_LLDP_NB_RX_Mode_P2) {
+        return _lldpNbRxModeDefault;
+    }
+    if (paramType == Mcp_LLDP_NB_TX_Mode_P1|| paramType == Mcp_LLDP_NB_TX_Mode_P2) {
+        return _lldpNbTxModeDefault;
+    }
+    if (paramType == Mcp_LLDP_NB_DCBX_P1|| paramType == Mcp_LLDP_NB_DCBX_P2) {
+        return _lldpNbDcbxDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void LLDPClientSettings::setParams(u_int32_t lldpNbRxMode, u_int32_t lldpNbTxMode, u_int32_t lldpNbDcbx)
+{
+    _lldpNbRxMode = lldpNbRxMode;
+    _lldpNbTxMode = lldpNbTxMode;
+    _lldpNbDcbx = lldpNbDcbx;
+}
+
+void LLDPClientSettings::updateClassAttrFromDefaultParams()
+{
+    setParams(
+            _lldpNbRxModeDefault,
+            _lldpNbTxModeDefault,
+            _lldpNbDcbxDefault);
+}
+
+int LLDPClientSettings::getFromDev(mfile* mf)
+{
+    GET_FROM_DEV_5TH_GEN(mf, tools_open_lldp_client_settings, "LLDP Client Settings");
+}
+
+int LLDPClientSettings::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_lldp_client_settings, "LLDP Client Settings");
+}
+
+int LLDPClientSettings::getDefaultParams(mfile* mf)
+{
+    GET_DEFAULT_5TH_GEN(mf, tools_open_lldp_client_settings, "LLDP Client Settings");
+}
+
+bool LLDPClientSettings::getCap(mfile *mf)
+{
+    MError rc;
+    u_int8_t tlvCapBuff[TOOLS_OPEN_LLDP_NB_CAP_SIZE] = {0};
+    struct tools_open_lldp_nb_cap lldpNbCapTlv;
+    memset(&lldpNbCapTlv, 0, sizeof(lldpNbCapTlv));
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_LLDP_NB_CAP_SIZE, getLLDPNBCapTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    if (rc) {
+        return false;
+    }
+    tools_open_lldp_nb_cap_unpack(&lldpNbCapTlv, tlvCapBuff);
+    _lldpNbTxCap = lldpNbCapTlv.lldp_nb_tx_cap;
+    _lldpNbRxCap = lldpNbCapTlv.lldp_nb_rx_cap;
+    _lldpNbDcbxEn = lldpNbCapTlv.lldp_nb_dcbx_en;
+    return true;
+}
+
+bool LLDPClientSettings::hardLimitCheck()
+{
+    if (_userSpecifiedRx && _lldpNbRxCap == 0) {
+        errmsg("The LLDP_NB_RX_MODE parameter cannot be set");
+        return false;
+    }
+
+    if (_lldpNbRxMode > _lldpNbRxCap) {
+        errmsg("Illegal LLDP_NB_RX_MODE parameter value(%d), max allowed value is (%d)", _lldpNbRxMode, _lldpNbRxCap);
+        return false;
+    }
+
+    if (_userSpecifiedTx && _lldpNbTxCap == 0) {
+        errmsg("The LLDP_NB_TX_MODE parameter cannot be set");
+        return false;
+    }
+
+    if (_lldpNbTxMode > _lldpNbTxCap) {
+        errmsg("Illegal LLDP_NB_TX_MODE parameter value(%d), max allowed value is (%d)", _lldpNbTxMode, _lldpNbTxCap);
+        return false;
+    }
+
+    if (_userSpecifiedDcbx && _lldpNbDcbxEn == 0) {
+        errmsg("LLDP_NB_RX_MODE parameter can not be set.");
+        return false;
+    }
+
+    if (_lldpNbDcbx > 1) {
+        errmsg("Illegal LLDP_NB_RX_MODE parameter value(%d), value must be False(0) or True(1)", _lldpNbDcbx);
+        return false;
+    }
+
+    return true;
+}
+
+u_int32_t LLDPClientSettings::getTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = tlvTypeIdx;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+void LLDPClientSettings::updateTlvFromClassAttr(void* tlv)
+{
+    struct tools_open_lldp_client_settings* lldpClientSettingsPortTlv = (struct tools_open_lldp_client_settings*)tlv;
+    lldpClientSettingsPortTlv->lldp_nb_dcbx = _lldpNbDcbx;
+    lldpClientSettingsPortTlv->lldp_nb_rx_mode = _lldpNbRxMode;
+    lldpClientSettingsPortTlv->lldp_nb_tx_mode = _lldpNbTxMode;
+    return;
+}
+
+void LLDPClientSettings::updateClassAttrFromTlv(void* tlv)
+{
+    struct tools_open_lldp_client_settings* lldpClientSettingsPortTlv = (struct tools_open_lldp_client_settings*)tlv;
+    _lldpNbDcbx = lldpClientSettingsPortTlv->lldp_nb_dcbx;
+    _lldpNbRxMode = lldpClientSettingsPortTlv->lldp_nb_rx_mode;
+    _lldpNbTxMode = lldpClientSettingsPortTlv->lldp_nb_tx_mode;
+    return;
+}
+
+void LLDPClientSettings::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_lldp_client_settings* lldpClientSettingsPortTlv = (struct tools_open_lldp_client_settings*)tlv;
+    _lldpNbDcbxDefault = lldpClientSettingsPortTlv->lldp_nb_dcbx;
+    _lldpNbRxModeDefault = lldpClientSettingsPortTlv->lldp_nb_rx_mode;
+    _lldpNbTxModeDefault = lldpClientSettingsPortTlv->lldp_nb_tx_mode;
+    return;
+}
+
+u_int32_t LLDPClientSettings::getLLDPNBCapTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = LLDP_NB_CAPABILITIES_TYPE;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+
+/*
+ * LLDP NB DCBX Class implementation
+ */
+
+bool DCBX::cfgSupported(mfile* mf, mlxCfgParam param)
+{
+    MError rc;
+    (void)param;
+    bool suppRead, suppWrite;
+    rc = nvqcCom5thGen(mf, getTlvTypeBe(), suppRead, suppWrite);
+    if (rc) {
+        errmsg("Failed to get LLDP NB DCBX capabilities. %s", m_err2str(rc));
+        return false;
+    }
+    if (!suppRead || !suppWrite) {
+        return false;
+    }
+
+    if (!getCap(mf)) {
+        return false;
+    }
+
+    return true;
+}
+
+void DCBX::setParam(mlxCfgParam paramType, u_int32_t val)
+{
+    if (paramType == Mcp_DCBX_IEEE_EN_P1|| paramType == Mcp_DCBX_IEEE_EN_P2) {
+        _ieee = val;
+    }
+    if (paramType == Mcp_DCBX_CEE_EN_P1|| paramType == Mcp_DCBX_CEE_EN_P2) {
+        _cee = val;
+    }
+    if (paramType == Mcp_DCBX_WILLING_P1|| paramType == Mcp_DCBX_WILLING_P2) {
+        _willing = val;
+    }
+    return;
+}
+
+u_int32_t DCBX::getParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_DCBX_IEEE_EN_P1|| paramType == Mcp_DCBX_IEEE_EN_P2) {
+        return _ieee;
+    }
+    if (paramType == Mcp_DCBX_CEE_EN_P1|| paramType == Mcp_DCBX_CEE_EN_P2) {
+        return _cee;
+    }
+    if (paramType == Mcp_DCBX_WILLING_P1|| paramType == Mcp_DCBX_WILLING_P2) {
+        return _willing;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+u_int32_t DCBX::getDefaultParam(mlxCfgParam paramType)
+{
+    if (paramType == Mcp_DCBX_IEEE_EN_P1|| paramType == Mcp_DCBX_IEEE_EN_P2) {
+        return _ieeeDefault;
+    }
+    if (paramType == Mcp_DCBX_CEE_EN_P1|| paramType == Mcp_DCBX_CEE_EN_P2) {
+        return _ceeDefault;
+    }
+    if (paramType == Mcp_DCBX_WILLING_P1|| paramType == Mcp_DCBX_WILLING_P2) {
+        return _willingDefault;
+    }
+    return MLXCFG_UNKNOWN;
+}
+
+void DCBX::setParams(u_int32_t ieee, u_int32_t cee, u_int32_t willing)
+{
+    _ieee = ieee;
+    _cee = cee;
+    _willing = willing;
+}
+
+void DCBX::updateClassAttrFromDefaultParams()
+{
+    setParams(
+            _ieeeDefault,
+            _ceeDefault,
+            _willingDefault);
+}
+
+int DCBX::getFromDev(mfile* mf)
+{
+    GET_FROM_DEV_5TH_GEN(mf, tools_open_lldp_nb_dcbx, "LLDP NB DCBX");
+}
+
+int DCBX::setOnDev(mfile* mf, bool ignoreCheck)
+{
+    SET_ON_DEV_5TH_GEN(mf, ignoreCheck, tools_open_lldp_nb_dcbx, "LLDP NB DCBX");
+}
+
+int DCBX::getDefaultParams(mfile* mf)
+{
+    GET_DEFAULT_5TH_GEN(mf, tools_open_lldp_nb_dcbx, "LLDP NB DCBX");
+}
+
+bool DCBX::hardLimitCheck()
+{
+    if (_lldpNbDcbxEn == 0) {
+        errmsg("DCBX parameters cannot be set");
+        return false;
+    }
+    if (_ieee > 1) {
+        errmsg("Illegal %s parameter value(%d)", _port == 1 ?
+                "DCBX_IEEE_P1" : "DCBX_IEEE_P2", _ieee);
+        return false;
+    }
+    if (_cee > 1) {
+        errmsg("Illegal %s parameter value(%d)", _port == 1 ?
+                "DCBX_CEE_P1" : "DCBX_CEE_P2", _cee);
+        return false;
+    }
+    if (_willing > 1) {
+        errmsg("Illegal %s parameter value(%d)", _port == 1 ?
+                "DCBX_WILLING_P1" : "DCBX_WILLING_P2", _willing);
+        return false;
+    }
+    return true;
+}
+
+u_int32_t DCBX::getTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = tlvTypeIdx;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+u_int32_t DCBX::getLLDPNBCapTlvTypeBe()
+{
+    struct tools_open_per_port_type type;
+    u_int32_t tlvType = 0;
+    type.param_class = CLASS_PHYS_PORT;
+    type.param_idx = LLDP_NB_CAPABILITIES_TYPE;
+    type.port = _port;
+    tools_open_per_port_type_pack(&type, (u_int8_t*)&tlvType);
+    return tlvType;
+}
+
+void DCBX::updateTlvFromClassAttr(void* tlv)
+{
+    struct tools_open_lldp_nb_dcbx* DCBXPortTlv = (struct tools_open_lldp_nb_dcbx*)tlv;
+    DCBXPortTlv->ieee_dcbx_en = _ieee;
+    DCBXPortTlv->cee_dcbx_en = _cee;
+    DCBXPortTlv->dcbx_willing = _willing;
+    return;
+}
+
+void DCBX::updateClassAttrFromTlv(void* tlv)
+{
+    struct tools_open_lldp_nb_dcbx* lldpClientSettingsPortTlv = (struct tools_open_lldp_nb_dcbx*)tlv;
+    _ieee = lldpClientSettingsPortTlv->ieee_dcbx_en;
+    _cee = lldpClientSettingsPortTlv->cee_dcbx_en;
+    _willing = lldpClientSettingsPortTlv->dcbx_willing;
+    return;
+}
+
+void DCBX::updateClassDefaultAttrFromTlv(void* tlv)
+{
+    struct tools_open_lldp_nb_dcbx* lldpClientSettingsPortTlv = (struct tools_open_lldp_nb_dcbx*)tlv;
+    _ieeeDefault = lldpClientSettingsPortTlv->ieee_dcbx_en;
+    _ceeDefault = lldpClientSettingsPortTlv->cee_dcbx_en;
+    _willingDefault = lldpClientSettingsPortTlv->dcbx_willing;
+    return;
+}
+
+bool DCBX::getCap(mfile *mf)
+{
+    MError rc;
+    u_int8_t tlvCapBuff[TOOLS_OPEN_LLDP_NB_CAP_SIZE] = {0};
+    struct tools_open_lldp_nb_cap lldpNbCapTlv;
+    memset(&lldpNbCapTlv, 0, sizeof(lldpNbCapTlv));
+    rc = mnvaCom5thGen(mf, &tlvCapBuff[0], TOOLS_OPEN_LLDP_NB_CAP_SIZE, getLLDPNBCapTlvTypeBe(), REG_ACCESS_METHOD_GET);
+    if (rc) {
+        return false;
+    }
+    tools_open_lldp_nb_cap_unpack(&lldpNbCapTlv, tlvCapBuff);
+    _lldpNbDcbxEn = lldpNbCapTlv.lldp_nb_dcbx_en;
+    return true;
+}
diff --git a/mlxconfig/mlxcfg_param_lib.h b/mlxconfig/mlxcfg_param_lib.h
index 3c1257b..7eeec44 100644
--- a/mlxconfig/mlxcfg_param_lib.h
+++ b/mlxconfig/mlxcfg_param_lib.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,12 @@
  * 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.
+ */
+/*
+ * mlxcfg_param_lib.h
  *
- *  Version: $Id$
- *
+ *  Created on: Mar 22, 2015
+ *      Author: adrianc
  */
 
 #ifndef MLXCFG_PARAM_LIB_H_
@@ -60,8 +64,15 @@
 #define ROCE_NEXT_PROTOCOL_TYPE 0x10
 #define ROCE_CC_TYPE 0x107
 #define ROCE_CC_ECN_TYPE 0x108
-#define LLDP_NB_SETTINGS_TYPE 0x10a
+#define LLDP_CLIENT_SETTINGS_TYPE 0x10a
 #define LLDP_NB_CAPABILITIES_TYPE 0x10b
+#define EXTERNAL_PORT 0x192
+#define BOOT_SETTINGS_EXTRAS_GEN4 0x2001
+#define BOOT_SETTINGS_EXTRAS_GEN5 0x195
+#define BOOT_SETTINGS_EXTRAS_GEN5_CAP 0x101
+#define QOS 0x192
+#define QOS_CAP 0x193
+#define LLDP_NB_DCBX 0x18E
 
 typedef enum {
     // SRIOV
@@ -85,9 +96,6 @@ typedef enum {
     Mct_Boot_Settings_P2,
     // IB dynamically connected (5th gen)
     Mct_Dc,
-    // Port Boot State (5th gen)
-    Mct_Boot_State_P1,
-    Mct_Boot_State_P2,
     // RoCE v1.5 next protocol (5th gen)
     Mct_RoCE_Next_Protocol,
     // RoCE congestion control (5th gen)
@@ -99,6 +107,17 @@ typedef enum {
     // Preboot Boot Settings (4th Gen)
     Mct_Preboot_Boot_Settings_P1,
     Mct_Preboot_Boot_Settings_P2,
+    Mct_External_Port,
+    //TODO: Boot Settings Extras
+    Mct_Boot_Settings_Extras_5thGen,
+    Mct_Boot_Settings_Extras_4thGen_P1,
+    Mct_Boot_Settings_Extras_4thGen_P2,
+    Mct_QoS_P1,
+    Mct_QoS_P2,
+    Mct_LLDP_Client_Settings_P1,
+    Mct_LLDP_Client_Settings_P2,
+    Mct_DCBX_P1,
+    Mct_DCBX_P2,
     Mct_Last
 } mlxCfgType;
 
@@ -107,6 +126,10 @@ typedef enum {
     Mcp_Sriov_En = 0,
     Mcp_Num_Of_Vfs,
     Mcp_Fpp_En,
+    Mcp_PF_Log_Bar_Size,
+    Mcp_VF_Log_Bar_Size,
+    Mcp_Num_Pf_Msix,
+    Mcp_Num_Vf_Msix,
     // Wake On LAN 4th Gen Port 1
     Mcp_Wol_Magic_En_P1,
     // Wake On LAN 4th Gen Port 2
@@ -128,10 +151,6 @@ typedef enum {
     // IB Dynamically connected
     Mcp_Log_Dcr_Hash_Table_Size,
     Mcp_Dcr_Lifo_Size,
-    // Port Boot state Port 1
-    Mcp_Boot_State_P1,
-    // Port Boot state Port 2
-    Mcp_Boot_State_P2,
     // RoCE v1.5 Next protocol
     Mcp_RoCE_Next_Protocol,
     // RoCE Congestion Control Parameters Port 1
@@ -192,6 +211,29 @@ typedef enum {
     Mcp_Boot_Retry_Cnt_P2,
     Mcp_Legacy_Boot_Protocol_P2,
     Mcp_Boot_Vlan_P2,
+    //External port
+    Mcp_Port_Owner,
+    Mcp_Allow_Rd_Counters,
+    //Boot Settings Ext
+    Mcp_Boot_Settings_Ext_IP_Ver,
+    Mcp_Boot_Settings_Ext_IP_Ver_P1,
+    Mcp_Boot_Settings_Ext_IP_Ver_P2,
+    Mcp_QoS_Num_of_TC_P1,
+    Mcp_QoS_Num_of_VL_P1,
+    Mcp_QoS_Num_of_TC_P2,
+    Mcp_QoS_Num_of_VL_P2,
+    Mcp_LLDP_NB_RX_Mode_P1,
+    Mcp_LLDP_NB_TX_Mode_P1,
+    Mcp_LLDP_NB_DCBX_P1,
+    Mcp_LLDP_NB_RX_Mode_P2,
+    Mcp_LLDP_NB_TX_Mode_P2,
+    Mcp_LLDP_NB_DCBX_P2,
+    Mcp_DCBX_IEEE_EN_P1,
+    Mcp_DCBX_CEE_EN_P1,
+    Mcp_DCBX_WILLING_P1,
+    Mcp_DCBX_IEEE_EN_P2,
+    Mcp_DCBX_CEE_EN_P2,
+    Mcp_DCBX_WILLING_P2,
     Mcp_Last
 } mlxCfgParam;
 
@@ -208,7 +250,7 @@ typedef std::pair<mlxCfgParam, u_int32_t> cfgInfo;
 class RawCfgParams5thGen : public ErrMsg
 {
 public:
-    RawCfgParams5thGen(){}
+    RawCfgParams5thGen();
     ~RawCfgParams5thGen() {}
     int setRawData(const std::vector<u_int32_t>& tlvBuff);
     int setOnDev(mfile* mf);
@@ -231,6 +273,7 @@ public:
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val) = 0;
     virtual u_int32_t getParam(mlxCfgParam paramType) = 0;
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType) = 0;
 
     virtual int getDefaultAndFromDev(mfile* mf);
     virtual int getFromDev(mfile* mf) = 0;
@@ -254,6 +297,7 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv) {(void)tlv; throw std::logic_error("Function Not Implemented");}
     virtual void updateClassAttrFromTlv(void* tlv) {(void)tlv; throw std::logic_error("Function Not Implemented");}
+    virtual void updateClassDefaultAttrFromTlv(void* tlv) {(void)tlv; throw std::logic_error("Function Not Implemented");}
 
     u_int64_t _devCapVec; // relevant for 4th gen devices
     bool _updated; // set true on get and false on set
@@ -265,43 +309,106 @@ protected:
  * SRIOV param classes:
  */
 
-class SriovParams : public CfgParams
+class SriovParams4thGen : public CfgParams
 {
 public:
-    SriovParams() : CfgParams(Mct_Sriov, SRIOV_TYPE) , _sriovEn(MLXCFG_UNKNOWN), _numOfVfs(MLXCFG_UNKNOWN), _maxVfs(1) {}
-    ~SriovParams() {};
+    SriovParams4thGen() : CfgParams(Mct_Sriov, SRIOV_TYPE) , _sriovEn(MLXCFG_UNKNOWN), _numOfVfs(MLXCFG_UNKNOWN),
+                _sriovEnDefault(MLXCFG_UNKNOWN), _numOfVfsDefault(MLXCFG_UNKNOWN), _maxVfs(1) {}
+    ~SriovParams4thGen() {};
 
-    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last) = 0;
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
+
+    virtual int getFromDev(mfile* mf);
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
+    virtual int getDefaultParams(mfile* mf);
 
 protected:
     virtual bool hardLimitCheck();
-    virtual bool softLimitCheck(mfile* mf=NULL) = 0;
+
+    virtual int updateMaxVfs(mfile* mf);
+    virtual bool softLimitCheck(mfile* mf=NULL);
+    void setParams(u_int32_t sriovEn, u_int32_t numOfVfs);
 
     u_int32_t _sriovEn;
     u_int32_t _numOfVfs;
+    u_int32_t _sriovEnDefault;
+    u_int32_t _numOfVfsDefault;
     u_int32_t _maxVfs;
 };
 
-class SriovParams4thGen : public SriovParams
+/*
+ * Boot Settings Extras param classes:
+ */
+
+class BootSettingsExtParams : public CfgParams
 {
 public:
-    SriovParams4thGen() : SriovParams() {}
-    ~SriovParams4thGen() {};
+    BootSettingsExtParams(mlxCfgType t, u_int32_t tlvT) : CfgParams(t, tlvT), _ipVer(MLXCFG_UNKNOWN), _ipVerDefault(MLXCFG_UNKNOWN){}
+    virtual ~BootSettingsExtParams() {}
 
-    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last) = 0;
+
+    virtual void setParam(mlxCfgParam paramType, u_int32_t val) = 0;
+    virtual u_int32_t getParam(mlxCfgParam paramType) = 0;
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType) = 0;
+
+    virtual int getFromDev(mfile* mf) = 0;
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false) = 0;
+    virtual int getDefaultParams(mfile* mf)=0;
 
-    virtual int getFromDev(mfile* mf);
-    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
-    virtual int getDefaultParams(mfile* mf);
 protected:
-    virtual int updateMaxVfs(mfile* mf);
-    virtual bool softLimitCheck(mfile* mf=NULL);
+    bool hardLimitCheck();
+    void setParams(u_int32_t _ipVer);
+
+    u_int32_t _ipVer;
+    u_int32_t _ipVerDefault;
+};
 
+class BootSettingsExtParams4thGen : public BootSettingsExtParams
+{
+public:
+    BootSettingsExtParams4thGen(int port) : BootSettingsExtParams((port == 1) ? Mct_Boot_Settings_Extras_4thGen_P1 : Mct_Boot_Settings_Extras_4thGen_P2,
+            BOOT_SETTINGS_EXTRAS_GEN4),
+        _port(port){}
+    ~BootSettingsExtParams4thGen() {}
+
+    u_int32_t getDefaultParam(mlxCfgParam paramType);
+    void setParam(mlxCfgParam paramType, u_int32_t val);
+    u_int32_t getParam(mlxCfgParam paramType);
+    bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+    int getDefaultParams(mfile* mf);
+
+    int getFromDev(mfile* mf);
+    int setOnDev(mfile* mf, bool ignoreCheck=false);
+private:
+    int _port;
 };
 
+class BootSettingsExtParams5thGen : public BootSettingsExtParams
+{
+public:
+    BootSettingsExtParams5thGen() : BootSettingsExtParams(Mct_Boot_Settings_Extras_5thGen, BOOT_SETTINGS_EXTRAS_GEN5) {}
+    ~BootSettingsExtParams5thGen() {}
+
+    u_int32_t getBootSettingsExtCapabilitiesTlvTypeBe();
+    bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+    u_int32_t getParam(mlxCfgParam paramType);
+    u_int32_t getDefaultParam(mlxCfgParam paramType);
+    void setParam(mlxCfgParam paramType, u_int32_t val);
+    int getFromDev(mfile* mf);
+    int setOnDev(mfile* mf, bool ignoreCheck=false);
+    void updateClassAttrFromDefaultParams();
+    void updateTlvFromClassAttr(void* tlv);
+    void updateClassAttrFromTlv(void* tlv);
+    void updateClassDefaultAttrFromTlv(void* tlv);
+    u_int32_t getTlvTypeBe();
+    int getDefaultParams(mfile* mf);
+    int getDefaultParamsAux(mfile* mf);
+};
 /*
  * WOL param classes:
  */
@@ -309,13 +416,14 @@ protected:
 class WolParams : public CfgParams
 {
 public:
-    WolParams() : CfgParams(Mct_Last, WOL_TYPE), _wolMagicEn(MLXCFG_UNKNOWN) {}
+    WolParams() : CfgParams(Mct_Last, WOL_TYPE), _wolMagicEn(MLXCFG_UNKNOWN), _wolMagicEnDefault(MLXCFG_UNKNOWN) {}
     virtual ~WolParams() {}
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last) = 0;
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val) = 0;
     virtual u_int32_t getParam(mlxCfgParam paramType) = 0;
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType) = 0;
 
     virtual int getFromDev(mfile* mf) = 0;
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false) = 0;
@@ -323,9 +431,11 @@ public:
 
 protected:
     virtual bool hardLimitCheck();
+    void setParams(u_int32_t wolMagicEn);
     // Wake on magic packet (atm this is the only mode which is supported)
 
     u_int32_t _wolMagicEn;
+    u_int32_t _wolMagicEnDefault;
 };
 
 class WolParams4thGen : public WolParams
@@ -338,6 +448,7 @@ public:
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -356,15 +467,19 @@ public:
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
     virtual int getDefaultParams(mfile* mf);
+
 protected:
     u_int32_t getTlvTypeBe();
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
 };
 
 
@@ -375,7 +490,11 @@ protected:
 class VpiParams : public CfgParams
 {
 public:
-    VpiParams(int port) : CfgParams(port == 1 ? Mct_Vpi_P1 : Mct_Vpi_P2, VPI_TYPE), _port(port), _linkType(MLXCFG_UNKNOWN), _defaultLinkType(MLXCFG_UNKNOWN){}
+    VpiParams(int port) : CfgParams(port == 1 ? Mct_Vpi_P1 : Mct_Vpi_P2, VPI_TYPE), _port(port), _linkType(MLXCFG_UNKNOWN), _defaultLinkType(MLXCFG_UNKNOWN)
+    , _linkTypeDefault(MLXCFG_UNKNOWN), _defaultLinkTypeDefault(MLXCFG_UNKNOWN){
+        _vpiTlv.default_link_type = 0;
+        _vpiTlv.network_link_type = 0;
+    }
     ~VpiParams() {}
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last) = 0;
@@ -389,10 +508,13 @@ protected:
     int getFromDevComPost(MError mnvaComRC);
     int setOnDevComPre(bool ignoreCheck);
     int setOnDevComPost(MError mnvaComRC);
+    void setParams(u_int32_t _linkType, u_int32_t _defaultLinkType);
 
     int _port;
     u_int32_t _linkType;
     u_int32_t _defaultLinkType;
+    u_int32_t _linkTypeDefault;
+    u_int32_t _defaultLinkTypeDefault;
     // FW TLV (used when actually setting/getting the TLV from FW)
     std::vector<u_int8_t> _tlvBuff;
     struct tools_open_vpi_settings _vpiTlv;
@@ -409,6 +531,7 @@ public:
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
     virtual bool hardLimitCheck();
 
     virtual int getFromDev(mfile* mf);
@@ -425,6 +548,7 @@ public:
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
     virtual bool hardLimitCheck();
 
     virtual int getFromDev(mfile* mf);
@@ -441,13 +565,14 @@ protected:
 class BarSzParams : public CfgParams
 {
 public:
-    BarSzParams() : CfgParams(Mct_Bar_Size, BAR_SIZE_TYPE) ,_maxLogBarSz(1), _logBarSz(MLXCFG_UNKNOWN) {}
+    BarSzParams() : CfgParams(Mct_Bar_Size, BAR_SIZE_TYPE) ,_maxLogBarSz(1), _logBarSz(MLXCFG_UNKNOWN), _logBarSzDefault(MLXCFG_UNKNOWN) {}
     ~BarSzParams() {}
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last) = 0;
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf) = 0;
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false) = 0;
@@ -457,8 +582,10 @@ protected:
     virtual bool hardLimitCheck();
     virtual bool softLimitCheck(mfile* mf=NULL) = 0;
     virtual int getDefaultBarSz(mfile* mf) = 0;
+    void setParams(u_int32_t logBarSz);
     u_int32_t _maxLogBarSz;
     u_int32_t _logBarSz;
+    u_int32_t _logBarSzDefault;
 
 };
 
@@ -487,14 +614,23 @@ class PciParams5thGen : public CfgParams
 {
 public:
     PciParams5thGen() : CfgParams(Mct_Pci, PCI_SETTINGS_TYPE) , _sriovEn(MLXCFG_UNKNOWN), _numOfVfs(MLXCFG_UNKNOWN),\
-                        _fppEn(MLXCFG_UNKNOWN), _sriovSupported(false), _maxVfsPerPf(0), _fppSupported(false),\
-                        _userSpecifiedSRIOV(false), _userSpecifiedFPP(false){}
+                        _fppEn(MLXCFG_UNKNOWN), _pfLogBarSize(MLXCFG_UNKNOWN), _vfLogBarSize(MLXCFG_UNKNOWN),\
+                        _numPfMsix(MLXCFG_UNKNOWN), _numVfMsix(MLXCFG_UNKNOWN), _sriovEnDefault(MLXCFG_UNKNOWN),\
+                        _numOfVfsDefault(MLXCFG_UNKNOWN), _fppEnDefault(MLXCFG_UNKNOWN), _pfLogBarSizeDefault(MLXCFG_UNKNOWN),\
+                        _vfLogBarSizeDefault(MLXCFG_UNKNOWN), _numPfMsixDefault(MLXCFG_UNKNOWN), _numVfMsixDefault(MLXCFG_UNKNOWN),\
+                        _numOfPfs(MLXCFG_UNKNOWN), _numOfPfsValid(0), _sriovSupported(false),_maxVfsPerPf(0),\
+                        _fppSupported(false), _pfLogBarSizeSuppored(false), _vfLogBarSizeSuppored(false),\
+                        _numPfMsixSupported(false), _numVfMsixSupported(false),_maxLogPfBarSize(0), _maxLogVfBarSize(0),\
+                        _maxTotalBarValid(0), _maxTotalBar(1), _maxNumPfMsix(0), _maxNumVfMsix(0),_maxTotalMsixValid(0),\
+                        _maxTotalMsix(0), _userSpecifiedSRIOV(false), _userSpecifiedFPP(false),_userSpecifiedPfLogBarSize(false),\
+                        _userSpecifiedVfLogBarSize(false),_userSpecifiedNumPfMsix(false),_userSpecifiedNumVfMsix(false){}
     ~PciParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -502,22 +638,63 @@ public:
 
 protected:
     virtual bool hardLimitCheck();
+    virtual bool softLimitCheck(mfile* mf=NULL);
     int getDefaultsAndCapabilities(mfile* mf);
     u_int32_t getPciSettingsTlvTypeBe();
     u_int32_t getPciCapabilitiesTlvTypeBe();
+    void setParams(u_int32_t sriovEn, u_int32_t numOfVfs, u_int32_t fppEn, u_int32_t pfLogBarSize,
+            u_int32_t vfLogBarSize, u_int32_t numOfPfs, u_int32_t numPfMsix, u_int32_t numVfMsix);
+
+private:
+    u_int32_t calcVfLogBarSize();
+    u_int32_t calcPfLogBarSize();
+    u_int32_t calcTotalBar();
+    u_int32_t calcNumOfVfs();
 
     u_int32_t _sriovEn;
     u_int32_t _numOfVfs;
     u_int32_t _fppEn;
+    u_int32_t _pfLogBarSize;
+    u_int32_t _vfLogBarSize;
+    u_int32_t _numPfMsix;
+    u_int32_t _numVfMsix;
+
+    u_int32_t _sriovEnDefault;
+    u_int32_t _numOfVfsDefault;
+    u_int32_t _fppEnDefault;
+    u_int32_t _pfLogBarSizeDefault;
+    u_int32_t _vfLogBarSizeDefault;
+    u_int32_t _numPfMsixDefault;
+    u_int32_t _numVfMsixDefault;
+
+    u_int32_t _numOfPfs;
+    u_int32_t _numOfPfsValid;
+
 
     // defaults and capabilities
     bool      _sriovSupported;
     u_int32_t _maxVfsPerPf;
     bool      _fppSupported;
+    bool      _pfLogBarSizeSuppored;
+    bool      _vfLogBarSizeSuppored;
+    bool      _numPfMsixSupported;
+    bool      _numVfMsixSupported;
+    u_int32_t _maxLogPfBarSize;
+    u_int32_t _maxLogVfBarSize;
+    u_int32_t _maxTotalBarValid;
+    u_int32_t _maxTotalBar;
+    u_int32_t _maxNumPfMsix;
+    u_int32_t _maxNumVfMsix;
+    u_int32_t _maxTotalMsixValid;
+    u_int32_t _maxTotalMsix;
 
     // class members used for indication
     bool _userSpecifiedSRIOV;
     bool _userSpecifiedFPP;
+    bool _userSpecifiedPfLogBarSize;
+    bool _userSpecifiedVfLogBarSize;
+    bool _userSpecifiedNumPfMsix;
+    bool _userSpecifiedNumVfMsix;
 
 };
 
@@ -528,15 +705,19 @@ protected:
 class TptParams5thGen : public CfgParams
 {
 public:
-    TptParams5thGen() : CfgParams(Mct_Tpt, TPT_SETTINGS_TYPE) , _logMaxPayloadSize(MLXCFG_UNKNOWN), _logMaxPayloadSizeSupported(false) {}
+    TptParams5thGen() : CfgParams(Mct_Tpt, TPT_SETTINGS_TYPE) , _logMaxPayloadSize(MLXCFG_UNKNOWN),
+    _logMaxPayloadSizeDefault(MLXCFG_UNKNOWN), _logMaxPayloadSizeSupported(false)
+    {}
     ~TptParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
+    int getFromDev(mfile* mf, bool getDefault);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
     virtual int getDefaultParams(mfile* mf);
 
@@ -545,8 +726,10 @@ protected:
     int getDefaultsAndCapabilities(mfile* mf);
     u_int32_t getTptSettingsTlvTypeBe();
     u_int32_t getTptCapabilitiesTlvTypeBe();
+    void setParams(u_int32_t logMaxPayloadSize);
 
     u_int32_t _logMaxPayloadSize;
+    u_int32_t _logMaxPayloadSizeDefault;
 
     // defaults and capabilities
     bool      _logMaxPayloadSizeSupported;
@@ -559,13 +742,14 @@ class InfinibandBootSettingsParams4thGen : public CfgParams
 {
 public:
     InfinibandBootSettingsParams4thGen(int port) : CfgParams((port == 1 ? Mct_Boot_Settings_P1 : Mct_Boot_Settings_P2),
-            INFINIBAND_BOOT_SETTINGS_TYPE) , _port(port), _bootPkey(MLXCFG_UNKNOWN) {}
+            INFINIBAND_BOOT_SETTINGS_TYPE) , _port(port), _bootPkey(MLXCFG_UNKNOWN), _bootPkeyDefault(MLXCFG_UNKNOWN) {}
     ~InfinibandBootSettingsParams4thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -573,9 +757,11 @@ public:
 
 protected:
     virtual bool hardLimitCheck();
+    void setParams(u_int32_t bootPkey);
 
     int _port;
     u_int32_t _bootPkey;
+    u_int32_t _bootPkeyDefault;
 
 };
 
@@ -587,15 +773,18 @@ class IBDCParams5thGen : public CfgParams
 {
 public:
     IBDCParams5thGen() : CfgParams(Mct_Dc, INFINIBAND_DC_SETTINGS_TYPE) , _logDcrHashTableSize(MLXCFG_UNKNOWN), _dcrLifoSize(MLXCFG_UNKNOWN),
-                        _minLogDcrHashTableSize(0), _maxLogDcrHashTableSize(0), _minDcrLifoSize(0), _maxDcrLifoSize(0){}
+        _logDcrHashTableSizeDefault(MLXCFG_UNKNOWN), _dcrLifoSizeDefault(MLXCFG_UNKNOWN), _minLogDcrHashTableSize(0),
+        _maxLogDcrHashTableSize(0), _minDcrLifoSize(0), _maxDcrLifoSize(0){}
     ~IBDCParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
+    int getFromDev(mfile* mf, bool getDefault);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
     virtual int getDefaultParams(mfile* mf);
 
@@ -607,10 +796,16 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t logDcrHashTableSize, u_int32_t dcrLifoSize);
 
     u_int32_t _logDcrHashTableSize;
     u_int32_t _dcrLifoSize;
 
+    u_int32_t _logDcrHashTableSizeDefault;
+    u_int32_t _dcrLifoSizeDefault;
+
     // defaults and capabilities
     u_int32_t _minLogDcrHashTableSize;
     u_int32_t _maxLogDcrHashTableSize;
@@ -619,49 +814,21 @@ protected:
 };
 
 /*
- * Port boot state Class (5thGen devices only)
- */
-
-class PortBootStateParams5thGen : public CfgParams
-{
-public:
-    PortBootStateParams5thGen(int port) : CfgParams((port == 1 ? Mct_Boot_State_P1 : Mct_Boot_State_P2), PORT_BOOT_STATE_TYPE) , _portBootState(MLXCFG_UNKNOWN), _port(port) {}
-    ~PortBootStateParams5thGen() {};
-
-    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
-
-    virtual void setParam(mlxCfgParam paramType, u_int32_t val);
-    virtual u_int32_t getParam(mlxCfgParam paramType);
-
-    virtual int getFromDev(mfile* mf);
-    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
-    virtual int getDefaultParams(mfile* mf);
-
-protected:
-    virtual bool hardLimitCheck();
-    u_int32_t getTlvTypeBe();
-
-    virtual void updateTlvFromClassAttr(void* tlv);
-    virtual void updateClassAttrFromTlv(void* tlv);
-
-    u_int32_t _portBootState;
-    int _port;
-};
-
-/*
  * RoCE v1.5 next protocol Class (5thGen devices only)
  */
 
 class RoCENextProtocolParams5thGen : public CfgParams
 {
 public:
-    RoCENextProtocolParams5thGen() : CfgParams(Mct_RoCE_Next_Protocol, ROCE_NEXT_PROTOCOL_TYPE) , _nextProtocol(MLXCFG_UNKNOWN) {}
+    RoCENextProtocolParams5thGen() : CfgParams(Mct_RoCE_Next_Protocol, ROCE_NEXT_PROTOCOL_TYPE) , _nextProtocol(MLXCFG_UNKNOWN)
+                                    , _nextProtocolDefault(MLXCFG_UNKNOWN){}
     ~RoCENextProtocolParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -673,8 +840,13 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t nextProtocol);
 
     u_int32_t _nextProtocol;
+
+    u_int32_t _nextProtocolDefault;
 };
 
 /*
@@ -685,13 +857,15 @@ class RoCECCParams5thGen : public CfgParams
 {
 public:
     RoCECCParams5thGen(int port) : CfgParams((port == 1 ? Mct_RoCE_CC_P1 : Mct_RoCE_CC_P2), ROCE_CC_TYPE),
-                                   _port(port), _roceCcAlgorithm(MLXCFG_UNKNOWN), _roceCcPrioMask(MLXCFG_UNKNOWN) {}
+                                   _port(port), _roceCcAlgorithm(MLXCFG_UNKNOWN), _roceCcPrioMask(MLXCFG_UNKNOWN)
+                                    , _roceCcAlgorithmDefault(MLXCFG_UNKNOWN), _roceCcPrioMaskDefault(MLXCFG_UNKNOWN){}
     ~RoCECCParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -703,10 +877,16 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t roceCcAlgorithm, u_int32_t roceCcPrioMask);
 
     int _port;
     u_int32_t _roceCcAlgorithm;
     u_int32_t _roceCcPrioMask;
+
+    u_int32_t _roceCcAlgorithmDefault;
+    u_int32_t _roceCcPrioMaskDefault;
 };
 
 /*
@@ -723,13 +903,21 @@ public:
                                     _rpgGd(MLXCFG_UNKNOWN), _rpgMinDecFac(MLXCFG_UNKNOWN), _rpgMinRate(MLXCFG_UNKNOWN),
                                     _rateToSetOnFirstCnp(MLXCFG_UNKNOWN), _dceTcpG(MLXCFG_UNKNOWN), _dceTcpRtt(MLXCFG_UNKNOWN),
                                     _rateReduceMonitorPeriod(MLXCFG_UNKNOWN), _initialAlphaValue(MLXCFG_UNKNOWN),
-                                    _minTimeBetweenCnps(MLXCFG_UNKNOWN), _cnpDscp(MLXCFG_UNKNOWN), _cnp802pPrio(MLXCFG_UNKNOWN){};
+                                    _minTimeBetweenCnps(MLXCFG_UNKNOWN), _cnpDscp(MLXCFG_UNKNOWN), _cnp802pPrio(MLXCFG_UNKNOWN)
+                                    , _clampTgtRateDefault(MLXCFG_UNKNOWN), _clampTgtRateAfterTimeIncDefault(MLXCFG_UNKNOWN),
+                                    _rpgTimeResetDefault(MLXCFG_UNKNOWN), _rpgByteResetDefault(MLXCFG_UNKNOWN), _rpgThresholdDefault(MLXCFG_UNKNOWN),
+                                    _rpgMaxRateDefault(MLXCFG_UNKNOWN), _rpgAiRateDefault(MLXCFG_UNKNOWN), _rpgHaiRateDefault(MLXCFG_UNKNOWN),
+                                    _rpgGdDefault(MLXCFG_UNKNOWN), _rpgMinDecFacDefault(MLXCFG_UNKNOWN), _rpgMinRateDefault(MLXCFG_UNKNOWN),
+                                    _rateToSetOnFirstCnpDefault(MLXCFG_UNKNOWN), _dceTcpGDefault(MLXCFG_UNKNOWN), _dceTcpRttDefault(MLXCFG_UNKNOWN),
+                                    _rateReduceMonitorPeriodDefault(MLXCFG_UNKNOWN), _initialAlphaValueDefault(MLXCFG_UNKNOWN),
+                                    _minTimeBetweenCnpsDefault(MLXCFG_UNKNOWN), _cnpDscpDefault(MLXCFG_UNKNOWN), _cnp802pPrioDefault(MLXCFG_UNKNOWN){};
     ~RoCECCEcnParams5thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -741,6 +929,13 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t clampTgtRate, u_int32_t clampTgtRateAfterTimeInc, u_int32_t rpgTimeReset, u_int32_t rpgByteReset,
+            u_int32_t rpgThreshold, u_int32_t rpgMaxRate, u_int32_t rpgAiRate, u_int32_t rpgHaiRate,
+            u_int32_t rpgGd, u_int32_t rpgMinDecFac, u_int32_t rpgMinRate, u_int32_t rateToSetOnFirstCnp,
+            u_int32_t dceTcpG, u_int32_t dceTcpRtt, u_int32_t rateReduceMonitorPeriod, u_int32_t initialAlphaValue,
+            u_int32_t minTimeBetweenCnps, u_int32_t cnpDscp, u_int32_t cnp802pPrio);
 
     int _port;
 
@@ -763,6 +958,26 @@ protected:
     u_int32_t _minTimeBetweenCnps;
     u_int32_t _cnpDscp;
     u_int32_t _cnp802pPrio;
+
+    u_int32_t _clampTgtRateDefault;
+    u_int32_t _clampTgtRateAfterTimeIncDefault;
+    u_int32_t _rpgTimeResetDefault;
+    u_int32_t _rpgByteResetDefault;
+    u_int32_t _rpgThresholdDefault;
+    u_int32_t _rpgMaxRateDefault;
+    u_int32_t _rpgAiRateDefault;
+    u_int32_t _rpgHaiRateDefault;
+    u_int32_t _rpgGdDefault;
+    u_int32_t _rpgMinDecFacDefault;
+    u_int32_t _rpgMinRateDefault;
+    u_int32_t _rateToSetOnFirstCnpDefault;
+    u_int32_t _dceTcpGDefault;
+    u_int32_t _dceTcpRttDefault;
+    u_int32_t _rateReduceMonitorPeriodDefault;
+    u_int32_t _initialAlphaValueDefault;
+    u_int32_t _minTimeBetweenCnpsDefault;
+    u_int32_t _cnpDscpDefault;
+    u_int32_t _cnp802pPrioDefault;
 };
 
 
@@ -775,13 +990,17 @@ class PrebootBootSettingsParams4thGen : public CfgParams
 public:
     PrebootBootSettingsParams4thGen(int port) : CfgParams((port == 1 ? Mct_Preboot_Boot_Settings_P1 : Mct_Preboot_Boot_Settings_P2), PREBOOT_BOOT_SETTINGS_TYPE),
                                                 _bootOptionRomEn(MLXCFG_UNKNOWN), _bootVlanEn(MLXCFG_UNKNOWN), _bootRetryCnt(MLXCFG_UNKNOWN),
-                                                _legacyBootProtocol(MLXCFG_UNKNOWN), _bootVlan(MLXCFG_UNKNOWN), _port(port) {}
+                                                _legacyBootProtocol(MLXCFG_UNKNOWN), _bootVlan(MLXCFG_UNKNOWN),
+                                                _bootOptionRomEnDefault(MLXCFG_UNKNOWN), _bootVlanEnDefault(MLXCFG_UNKNOWN), _bootRetryCntDefault(MLXCFG_UNKNOWN),
+                                                _legacyBootProtocolDefault(MLXCFG_UNKNOWN), _bootVlanDefault(MLXCFG_UNKNOWN),
+                                                _port(port) {}
     ~PrebootBootSettingsParams4thGen() {};
 
     virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
 
     virtual void setParam(mlxCfgParam paramType, u_int32_t val);
     virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
 
     virtual int getFromDev(mfile* mf);
     virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
@@ -792,14 +1011,217 @@ protected:
 
     virtual void updateTlvFromClassAttr(void* tlv);
     virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t bootOptionRomEn, u_int32_t bootVlanEn, u_int32_t bootRetryCnt,
+            u_int32_t legacyBootProtocol, u_int32_t bootVlan);
 
     u_int32_t _bootOptionRomEn;
     u_int32_t _bootVlanEn;
     u_int32_t _bootRetryCnt;
     u_int32_t _legacyBootProtocol;
     u_int32_t _bootVlan;
+
+    u_int32_t _bootOptionRomEnDefault;
+    u_int32_t _bootVlanEnDefault;
+    u_int32_t _bootRetryCntDefault;
+    u_int32_t _legacyBootProtocolDefault;
+    u_int32_t _bootVlanDefault;
+
     int _port;
 };
 
+/*
+ * ExternalPort5thGen parameters Class (5thGen devices only)
+ */
 
+class ExternalPort5thGen : public CfgParams
+{
+public:
+    ExternalPort5thGen() : CfgParams(Mct_External_Port, EXTERNAL_PORT),
+        _portOwner(MLXCFG_UNKNOWN), _allowRdCounters(MLXCFG_UNKNOWN),
+        _portOwnerDefault(MLXCFG_UNKNOWN), _allowRdCountersDefault(MLXCFG_UNKNOWN){}
+    ~ExternalPort5thGen() {};
+
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+
+    virtual void setParam(mlxCfgParam paramType, u_int32_t val);
+    virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
+
+    virtual int getFromDev(mfile* mf);
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
+    virtual int getDefaultParams(mfile* mf);
+
+protected:
+    virtual bool hardLimitCheck();
+    u_int32_t getTlvTypeBe();
+
+    virtual void updateTlvFromClassAttr(void* tlv);
+    virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t portOwner, u_int32_t allowRdCounters);
+
+    u_int32_t _portOwner;
+    u_int32_t _allowRdCounters;
+
+    u_int32_t _portOwnerDefault;
+    u_int32_t _allowRdCountersDefault;
+
+};
+
+/*
+ * QoS parameters Class
+ */
+
+class QoS : public CfgParams
+{
+public:
+    QoS(int port) : CfgParams(port == 1 ? Mct_QoS_P1 : Mct_QoS_P2, QOS),
+        _port(port), _numOfTC(MLXCFG_UNKNOWN), _numOfVL(MLXCFG_UNKNOWN),
+        _numOfTCDefault(MLXCFG_UNKNOWN), _numOfVLDefault(MLXCFG_UNKNOWN),
+        _maxNumOfTC(MLXCFG_UNKNOWN), _maxNumOfVL(MLXCFG_UNKNOWN){}
+    ~QoS() {};
+
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+
+    virtual void setParam(mlxCfgParam paramType, u_int32_t val);
+    virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
+
+    virtual int getFromDev(mfile* mf);
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
+    virtual int getDefaultParams(mfile* mf);
+    bool getCap(mfile *mf);
+    u_int32_t getQoSCapTlvTypeBe();
+
+protected:
+    bool hardLimitCheckAux(u_int32_t maxNumOfX, u_int32_t numOfX,const char *x);
+    virtual bool hardLimitCheck();
+    u_int32_t getTlvTypeBe();
+
+    virtual void updateTlvFromClassAttr(void* tlv);
+    virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t numOfTCDefault, u_int32_t numOfVLDefault);
+
+    int _port;
+
+    u_int32_t _numOfTC;
+    u_int32_t _numOfVL;
+
+    u_int32_t _numOfTCDefault;
+    u_int32_t _numOfVLDefault;
+
+    u_int32_t _maxNumOfTC;
+    u_int32_t _maxNumOfVL;
+};
+
+/*
+ * LLDP Client Settings Class
+ */
+
+class LLDPClientSettings : public CfgParams
+{
+public:
+    LLDPClientSettings(int port) : CfgParams(port == 1 ?
+            Mct_LLDP_Client_Settings_P1 : Mct_LLDP_Client_Settings_P2, LLDP_CLIENT_SETTINGS_TYPE),
+        _port(port), _lldpNbTxMode(MLXCFG_UNKNOWN), _lldpNbRxMode(MLXCFG_UNKNOWN), _lldpNbDcbx(MLXCFG_UNKNOWN),
+        _userSpecifiedRx(false), _userSpecifiedTx(false), _userSpecifiedDcbx(false),
+        _lldpNbTxModeDefault(MLXCFG_UNKNOWN), _lldpNbRxModeDefault(MLXCFG_UNKNOWN),
+        _lldpNbDcbxDefault(MLXCFG_UNKNOWN), _lldpNbTxCap(MLXCFG_UNKNOWN),
+        _lldpNbRxCap(MLXCFG_UNKNOWN), _lldpNbDcbxEn(MLXCFG_UNKNOWN){}
+    ~LLDPClientSettings() {};
+
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+
+    virtual void setParam(mlxCfgParam paramType, u_int32_t val);
+    virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
+
+    virtual int getFromDev(mfile* mf);
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
+    virtual int getDefaultParams(mfile* mf);
+    bool getCap(mfile *mf);
+    u_int32_t getLLDPNBCapTlvTypeBe();
+
+protected:
+    virtual bool hardLimitCheck();
+    u_int32_t getTlvTypeBe();
+
+    virtual void updateTlvFromClassAttr(void* tlv);
+    virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t lldpNbRxMode, u_int32_t lldpNbTxMode, u_int32_t lldpNbDcbx);
+
+    int _port;
+
+    u_int32_t _lldpNbTxMode;
+    u_int32_t _lldpNbRxMode;
+    u_int32_t _lldpNbDcbx;
+
+    bool _userSpecifiedRx;
+    bool _userSpecifiedTx;
+    bool _userSpecifiedDcbx;
+
+    u_int32_t _lldpNbTxModeDefault;
+    u_int32_t _lldpNbRxModeDefault;
+    u_int32_t _lldpNbDcbxDefault;
+
+    u_int32_t _lldpNbTxCap;
+    u_int32_t _lldpNbRxCap;
+    u_int32_t _lldpNbDcbxEn;
+};
+
+/*
+ * LLDP NB DCBX Class
+ */
+
+class DCBX : public CfgParams
+{
+public:
+    DCBX(int port) : CfgParams(port == 1 ?
+            Mct_DCBX_P1 : Mct_DCBX_P2, LLDP_NB_DCBX),
+        _port(port), _ieee(MLXCFG_UNKNOWN), _cee(MLXCFG_UNKNOWN), _willing(MLXCFG_UNKNOWN),
+        _lldpNbDcbxEn(MLXCFG_UNKNOWN),
+        _ieeeDefault(MLXCFG_UNKNOWN), _ceeDefault(MLXCFG_UNKNOWN), _willingDefault(MLXCFG_UNKNOWN){}
+    ~DCBX() {};
+
+    virtual bool cfgSupported(mfile* mf, mlxCfgParam param=Mcp_Last);
+
+    virtual void setParam(mlxCfgParam paramType, u_int32_t val);
+    virtual u_int32_t getParam(mlxCfgParam paramType);
+    virtual u_int32_t getDefaultParam(mlxCfgParam paramType);
+
+    virtual int getFromDev(mfile* mf);
+    virtual int setOnDev(mfile* mf, bool ignoreCheck=false);
+    virtual int getDefaultParams(mfile* mf);
+
+protected:
+    virtual bool hardLimitCheck();
+    u_int32_t getTlvTypeBe();
+    u_int32_t getLLDPNBCapTlvTypeBe();
+
+    virtual void updateTlvFromClassAttr(void* tlv);
+    virtual void updateClassAttrFromTlv(void* tlv);
+    virtual void updateClassDefaultAttrFromTlv(void* tlv);
+    void updateClassAttrFromDefaultParams();
+    void setParams(u_int32_t lldpNbRxMode, u_int32_t lldpNbTxMode, u_int32_t lldpNbDcbx);
+    bool getCap(mfile* m);
+
+    int _port;
+
+    u_int32_t _ieee;
+    u_int32_t _cee;
+    u_int32_t _willing;
+
+    u_int32_t _lldpNbDcbxEn;
+
+    u_int32_t _ieeeDefault;
+    u_int32_t _ceeDefault;
+    u_int32_t _willingDefault;
+};
 #endif /* MLXCFG_PARAM_LIB_H_ */
diff --git a/mlxconfig/mlxcfg_parser.cpp b/mlxconfig/mlxcfg_parser.cpp
index 8ace497..d0681b1 100644
--- a/mlxconfig/mlxcfg_parser.cpp
+++ b/mlxconfig/mlxcfg_parser.cpp
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -28,12 +29,11 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- *  Version: $Id$
- *
  */
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <sstream>
 #include <algorithm>
 #include <errno.h>
 #include <utility>
@@ -57,28 +57,12 @@ static void printFlagLine(string flag_s, string flag_l, string param, string des
     printf(IDENT2"-%s|--%s", flag_s.c_str(), flag_l.c_str());
     if (param.length()) {
         printf(" <%s>", param.c_str());
-    } else {
+    } else if (flag_l.length() < 8){
         printf("\t");
     }
     printf(IDENT3": %s\n", desc.c_str());
 }
 
-static void printConfigurationHeader(string confName, string extraInfo="")
-{
-    printf(IDENT2"%s: %s\n", confName.c_str(), extraInfo.c_str());
-}
-
-static void printConfigurationParameter(string param, string extraInfo)
-{
-    printf(IDENT4"%-36s : %s\n", param.c_str(), extraInfo.c_str());
-}
-
-
-static void printConfigurationParameter(string param)
-{
-    printf(IDENT4"%-36s\n", param.c_str());
-}
-
 #ifdef MTCR_UL
 #define DEVICE_NAME "device"
 #else
@@ -89,9 +73,9 @@ void MlxCfg::printHelp()
 {
     // print opening
     printf(IDENT"NAME:\n"
-           IDENT2   MLXCFG_NAME"\n"
+           IDENT2   MLXCFG_NAME "\n"
            IDENT"SYNOPSIS:\n"
-           IDENT2    MLXCFG_NAME " [-d <%s> ] [-y] <s[et] <parameters to set>|q[uery]|r[eset]>\n", DEVICE_NAME);
+           IDENT2    MLXCFG_NAME " [-d <%s> ] [-y|-e] <s[et] <parameters to set>|q[uery]|r[eset]|[ -f <filename> backup|set_raw]>\n", DEVICE_NAME);
 
     // print options
     printf("\n");
@@ -100,6 +84,7 @@ void MlxCfg::printHelp()
     printFlagLine("f", "file", "conf_file", "raw configuration file.");
     printFlagLine("h", "help", "", "Display help message.");
     printFlagLine("v", "version", "", "Display version info.");
+    printFlagLine("e", "show_default", "", "Show default configurations.");
     printFlagLine("y", "yes", "", "Answer yes in prompt.");
 
     //print commands
@@ -109,113 +94,23 @@ void MlxCfg::printHelp()
     printf(IDENT2"%-24s : %s\n","q[uery]", "query current supported configurations.");
     printf(IDENT2"%-24s : %s\n","r[eset]", "reset all configurations to their default value.");
     printf(IDENT2"%-24s : %s\n","s[et]", "set configurations to a specific device.");
-    printf(IDENT2"%-24s : %s\n","set_raw", "set raw configuration file.(5th generation devices only.)");
+    printf(IDENT2"%-24s : %s\n","set_raw", "set raw configuration file.(only " FIFTH_GENERATION_LIST ".)");
+    printf(IDENT2"%-24s : %s\n","backup", "backup configurations to a file (only " FIFTH_GENERATION_LIST ".). Use set_raw command to restore file.");
 
     // print supported commands
     printf("\n");
     printf(IDENT"Supported Configurations:\n");
     printf("\n");
-    printConfigurationHeader("PCI Settings");
-    printConfigurationParameter("FPP_EN=<1|0>", "enable function per port.");
-    printConfigurationParameter("LOG_BAR_SIZE=<base_2_log_in_mb>", "example: for 8Mb bar size set LOG_BAR_SIZE=3.");
-    printConfigurationParameter("NUM_OF_VFS=<NUM>", "desired amount of virtual functions.");
-    printConfigurationParameter("SRIOV_EN=<0|1>", "enable SR-IOV.");
-    printf("\n");
-    printConfigurationHeader("IB Dynamically Connect");
-    printConfigurationParameter("DCR_LIFO_SIZE=<SIZE>", "The amount of total DCRs available to join linked-lists after hash DCRs.");
-    printConfigurationParameter("LOG_DCR_HASH_TABLE_SIZE=<SIZE>", "log2 of the hash table size minus 1.");
-    printf("\n");
-    printConfigurationHeader("Infiniband Boot Settings");
-    printConfigurationParameter("BOOT_PKEY_P1=<PKEY>", "partition key to be used by PXE boot (ConnectX3, ConnectX3-Pro Only).");
-    printConfigurationParameter("BOOT_PKEY_P2=<PKEY>", "set 0 for default.");
-    printf("\n");
-    printConfigurationHeader("Internal Settings");
-    printConfigurationParameter("INT_LOG_MAX_PAYLOAD_SIZE=<0|12>", "0=Auto 12=4KB Burst length.");
-    printf("\n");
-    /*
-    printConfigurationHeader("Port Boot State", "Port power settings on boot");
-    printConfigurationParameter("BOOT_STATE_P1=<0..3>", "0=Normal operation, 1=SFP power off, 2=SERDES power off, 3=Admin linkDown");
-    printConfigurationParameter("BOOT_STATE_P2=<0..3>");
-    printf("\n");
-    */
-    printConfigurationHeader("Preboot Boot Settings", "Settings that control the legacy option ROM.");
-    printConfigurationParameter("BOOT_OPTION_ROM_EN_P1=<0|1>", "Disable/Enable boot option ROM.");
-    printConfigurationParameter("BOOT_OPTION_ROM_EN_P2=<0|1>");
-    printConfigurationParameter("BOOT_VLAN_EN_P1=<0|1>", "Disable/Enable VLAN mode for network boot.");
-    printConfigurationParameter("BOOT_VLAN_EN_P2=<0|1>");
-    printConfigurationParameter("BOOT_RETRY_CNT_P1=<0..7>", "Number of retries to attempt in case of boot failure.");
-    printConfigurationParameter("BOOT_RETRY_CNT_P2=<0..7>", "7 indicates infinite retries.");
-    printConfigurationParameter("LEGACY_BOOT_PROTOCOL_P1=<0..3>", "0=None(disable legacy boot), 1=PXE(DHCP/TFTP boot), 2=iSCSI, 3=PXE + iSCSI.");
-    printConfigurationParameter("LEGACY_BOOT_PROTOCOL_P2=<0..3>");
-    printConfigurationParameter("BOOT_VLAN_P1=<VLAN ID>", "VLAN ID for the network boot.");
-    printConfigurationParameter("BOOT_VLAN_P2=<VLAN ID>");
-    printf("\n");
-    printConfigurationHeader("RoCE Congestion Control ECN");
-    printConfigurationParameter("CLAMP_TGT_RATE_AFTER_TIME_INC_P1=<0|1>", "When receiving an CNP, the target rate should be updated if the transmission rate was increased");
-    printConfigurationParameter("CLAMP_TGT_RATE_AFTER_TIME_INC_P2=<0|1>", "due to the timer, and not only due to the byte counter. Default=1.");
-    printConfigurationParameter("CLAMP_TGT_RATE_P1=<0|1>", "If set, whenever a CNP is processed, the target rate is updated to be the current rate.");
-    printConfigurationParameter("CLAMP_TGT_RATE_P2=<0|1>", "Default=1");
-    printConfigurationParameter("CNP_DSCP_P1=<0..7>", "The DiffServ Code Point of the generated CNP for this port.");
-    printConfigurationParameter("CNP_DSCP_P2=<0..7>", "Default=0.");
-    printConfigurationParameter("CNP_802P_PRIO_P1=<NUM>", "The 802.1p priority value of the generated CNP for this port.");
-    printConfigurationParameter("CNP_802P_PRIO_P2=<NUM>", "Default=7.");
-    printConfigurationParameter("DCE_TCP_G_P1=<NUM>", "Used to update the congestion estimator (alpha) once every dce_tcp_rtt microseconds.");
-    printConfigurationParameter("DCE_TCP_G_P2=<NUM>", "Default=64.");
-    printConfigurationParameter("DCE_TCP_RTT_P1=<USEC>", "The time between updates of the alpha value, in microseconds.");
-    printConfigurationParameter("DCE_TCP_RTT_P2=<USEC>", "Default=2.");
-    printConfigurationParameter("INITIAL_ALPHA_VALUE_P1=<NUM>", "The initial value of alpha to use when receiving the first CNP for a flow.");
-    printConfigurationParameter("INITIAL_ALPHA_VALUE_P2=<NUM>", "Expressed in a fixed point fraction of 2^10.");
-    printConfigurationParameter("MIN_TIME_BETWEEN_CNPS_P1=<USEC>", "Minimum time between sending cnps from the port, in microseconds.");
-    printConfigurationParameter("MIN_TIME_BETWEEN_CNPS_P2=<USEC>", "Default=0.");
-    printConfigurationParameter("RATE_TO_SET_ON_FIRST_CNP_P1=<RATE_IN_MBIT>", "The rate that is set for the flow when a rate limiter is allocated to it upon first CNP received, in Mbps.");
-    printConfigurationParameter("RATE_TO_SET_ON_FIRST_CNP_P2=<RATE_IN_MBIT>", "Default=0.");
-    printConfigurationParameter("RATE_REDUCE_MONITOR_PERIOD_P1=<USEC>", "The minimum time between 2 consecutive rate reductions for a single flow.");
-    printConfigurationParameter("RATE_REDUCE_MONITOR_PERIOD_P2=<USEC>", "Rate reduction will occur only if a CNP is received during the relevant time interval. Default=2.");
-    printConfigurationParameter("RPG_AI_RATE_P1=<RATE_IN_MBIT>", "The rate, in Mbits per second, used to increase rpTargetRate in the RPR_ACTIVE_INCREASE state.");
-    printConfigurationParameter("RPG_AI_RATE_P2=<RATE_IN_MBIT>", "Default=10.");
-    printConfigurationParameter("RPG_BYTE_RESET_P1=<BYTE_NUM>", "Transmitted data between rate increases if no CNPs are received. Given in Bytes.");
-    printConfigurationParameter("RPG_BYTE_RESET_P2=<BYTE_NUM>", "Disabled=0, Default=150.");
-    printConfigurationParameter("RPG_GD_P1=<0..15>", "If a CNP is received, the flow rate is reduced at the beginning of the next rate_reduce_monitor_period interval to,");
-    printConfigurationParameter("RPG_GD_P2=<0..15>", "(1-Alpha/Gd)*CurrentRate. RPG_GD is given as log2(Gd), where Gd may only be powers of 2. Default=7.");
-    printConfigurationParameter("RPG_HAI_RATE_P1=<RATE_IN_MBIT>", "The rate, in Mbits per second, used to increase rpTargetRate in the RPR_HYPER_INCREASE state.");
-    printConfigurationParameter("RPG_HAI_RATE_P2=<RATE_IN_MBIT>", "Default=50.");
-    printConfigurationParameter("RPG_MAX_RATE_P1=<RATE_IN_MBIT>", "The maximum rate, in Mbits per second, at which an RP can transmit.");
-    printConfigurationParameter("RPG_MAX_RATE_P2=<RATE_IN_MBIT>", "Once this limit is reached, the RP rate limited is released and");
-    printConfigurationParameter(" ", "the flow is not rate limited any more. Default=0 (Full port speed).");
-    printConfigurationParameter("RPG_MIN_DEC_FAC_P1=<1..100>", "The minimum factor by which the current transmit rate can be changed when processing a CNP.");
-    printConfigurationParameter("RPG_MIN_DEC_FAC_P2=<1..100>", "Value is given as a percentage (1-100). Default=50.");
-    printConfigurationParameter("RPG_MIN_RATE_P1=<RATE_IN_MBIT>", "The minimum value, in Mb per second, for rate to limit.");
-    printConfigurationParameter("RPG_MIN_RATE_P2=<RATE_IN_MBIT>", "Default=2000.");
-    printConfigurationParameter("RPG_THRESHOLD_P1=<0..31>", "The number of times rpByteStage or rpTimeStage can count before the RP rate control state machine advances states.");
-    printConfigurationParameter("RPG_THRESHOLD_P2=<0..31>", "Default=5.");
-    printConfigurationParameter("RPG_TIME_RESET_P1=<USEC>", "Time between rate increases if no CNPs are received. Given in u-seconds");
-    printConfigurationParameter("RPG_TIME_RESET_P2=<USEC>", "Default=2.");
 
-    printf("\n");
-    printConfigurationHeader("RoCE Congestion Control Parameters");
-    printConfigurationParameter("ROCE_CC_ALGORITHM_P1=<0|1>", "Congestion control algorithm. 0=ECN, 1=QCN.");
-    printConfigurationParameter("ROCE_CC_ALGORITHM_P2=<0|1>");
-    printConfigurationParameter("ROCE_CC_PRIO_MASK_P1=<0..255>", "Per priority enable disable bitmask. default 0.");
-    printConfigurationParameter("ROCE_CC_PRIO_MASK_P2=<0..255>");
-    printf("\n");
-    printConfigurationHeader("RoCE V1.5 next protocol");
-    printConfigurationParameter("ROCE_NEXT_PROTOCOL=<0..255>", "The next protocol value set in the IPv4/IPv6 packets for RoCE v1.5. The default is 0xFE.");
-    printf("\n");
-    printConfigurationHeader("VPI Settings", "Control network link type");
-    printConfigurationParameter("LINK_TYPE_P1=<1|2|3>", "1=Infiniband 2=Ethernet 3=VPI(auto-sense).");
-    printConfigurationParameter("LINK_TYPE_P2=<1|2|3>");
-    printf("\n");
-    printConfigurationHeader("Wake On LAN");
-    printConfigurationParameter("WOL_MAGIC_EN=<0|1>", "5th generation devices only (per physical function).");
-    printConfigurationParameter("WOL_MAGIC_EN_P1=<0|1>", "enable wake on magic packet(per port.)");
-    printConfigurationParameter("WOL_MAGIC_EN_P2=<0|1>", "4th generation devices only.");
-    printf("\n");
+    _allInfo.printLongDesc();
+
     // print usage examples
+    printf("\n");
     printf(IDENT"Examples:\n");
-    printf(IDENT2"%-35s: %s\n", "To query current configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" query");
-    printf(IDENT2"%-35s: %s\n", "To set configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1");
-    printf(IDENT2"%-35s: %s\n", "To set raw configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE2" -f conf_file set_raw");
-    printf(IDENT2"%-35s: %s\n", "To reset configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" reset");
+    printf(IDENT2"%-35s: %s\n", "To query current configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " query");
+    printf(IDENT2"%-35s: %s\n", "To set configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1");
+    printf(IDENT2"%-35s: %s\n", "To set raw configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE2 " -f conf_file set_raw");
+    printf(IDENT2"%-35s: %s\n", "To reset configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " reset");
     printf("\n");
     printf(IDENT"Supported devices:\n");
     printf(IDENT2"4th Generation devices: ConnectX3, ConnectX3-Pro (FW 2.31.5000 and above).\n");
@@ -231,8 +126,8 @@ void MlxCfg::printVersion()
 }
 
 void MlxCfg::printUsage() {
-    printf("\n"IDENT"Usage:\n"
-           IDENT2    MLXCFG_NAME " [-d <%s> ] [-y] <s[et] <parameters to set>|q[uery]|r[eset]>\n\n", DEVICE_NAME);
+    printf("\n" IDENT "Usage:\n"
+           IDENT2 MLXCFG_NAME " [-d <%s> ] [-y|-e] <s[et] <parameters to set>|q[uery]|r[eset]|[ -f <filename> backup|set_raw]>\n\n", DEVICE_NAME);
 }
 
 bool MlxCfg::tagExsists(mlxCfgParam tag) {
@@ -267,7 +162,7 @@ mlxCfgStatus MlxCfg::processArg(string tag, u_int32_t val)
 static bool strToNum(string str, u_int32_t& num, int base=0)
 {
     char *endp;
-    char* numStr = strcpy(new char[str.size()],str.c_str());
+    char* numStr = strcpy(new char[str.size() + 1],str.c_str());
     num = strtoul(numStr, &endp, base);
     if (*endp) {
         delete[] numStr;
@@ -287,6 +182,7 @@ mlxCfgStatus MlxCfg::extractCfgArgs(int argc, char* argv[])
     string tag;
     string valstr;
     u_int32_t val = 0;
+    mlxCfgParam param = Mcp_Last;
     for (;i < argc;i++) {
         char* ptr;
         // get the tag
@@ -304,14 +200,19 @@ mlxCfgStatus MlxCfg::extractCfgArgs(int argc, char* argv[])
         if (strtok(NULL, "=")) {
             return err(true, "Invalid Configuration argument %s", argv[i]);
         }
-        //printf("-D- %s %s\n", tag.c_str(), valstr.c_str());
-        if (!strToNum(valstr, val, 0)) {
-            return err(true, "Failed to parse %s=%s", tag.c_str(), valstr.c_str());
+
+        if(_allInfo.parseParam(tag, valstr, val, param)) {
+            if(param == Mcp_Last) {
+                return err(true, "Unknown Parameter: %s", tag.c_str());
+            } else {
+                return err(true, "Failed to parse %s=%s", tag.c_str(), valstr.c_str());
+            }
         }
-        // store val in the correct place in  mlxconfig Params
-        if (processArg(tag, val)) {
-            return MLX_CFG_ERROR;
+
+        if(tagExsists(param)) {
+            return err(true, "Duplicate parameter, %s.", tag.c_str());
         }
+        _mlxParams.params.push_back(cfgInfo((mlxCfgParam)param, val));
     }
     return MLX_CFG_OK;
 }
@@ -329,7 +230,7 @@ mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[])
         } else if (arg == "-h" || arg == "--help"){
             printHelp();
             return MLX_CFG_OK_EXIT;
-        }else if (arg == "-d" || arg == "--dev") {
+        } else if (arg == "-d" || arg == "--dev") {
             if (++i == argc) {
                 return err(true, "missing device name");
             }
@@ -341,6 +242,8 @@ mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[])
                 return err(true, "missing file name");
             }
             _mlxParams.rawTlvFile = argv[i];
+        } else if (arg == "-e" || arg == "--show_default") {
+            _mlxParams.showDefault = true;
         }else if (arg == "set" || arg == "s") {
             _mlxParams.cmd = Mc_Set;
             break;
@@ -359,8 +262,11 @@ mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[])
         } else if (arg == "set_raw") {
             _mlxParams.cmd = Mc_Set_Raw;
             break;
+        } else if (arg == "backup") {
+            _mlxParams.cmd = Mc_Backup;
+            break;
         // hidden flag --force used to ignore parameter checks
-        }else if (arg == "--force"){
+        } else if (arg == "--force"){
             _mlxParams.force = true;
         } else {
             return err(true, "invalid argument: %s", arg.c_str());
@@ -368,24 +274,593 @@ mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[])
     }
     i++;
     if (_mlxParams.cmd == Mc_UnknownCmd) {
-        return err(true, "No command found. For more information please run "MLXCFG_NAME" -h|--help.");
+        return err(true, "No command found. For more information please run " MLXCFG_NAME " -h|--help.");
     }
     // we parsed input until the set/query/reset cmd
     if (i == argc && _mlxParams.cmd == Mc_Set) {
-        return err(true, "missing configuration arguments. For more information please run "MLXCFG_NAME" -h|--help.");
+        return err(true, "missing configuration arguments. For more information please run " MLXCFG_NAME " -h|--help.");
     }
     if (i != argc && (_mlxParams.cmd == Mc_Reset || _mlxParams.cmd == Mc_Query)) {
-        return err(true, "%s command expects no argument but %d argument recieved", (_mlxParams.cmd == Mc_Reset) ? "reset" : "query", argc -i);
+        return err(true, "%s command expects no argument but %d argument received", (_mlxParams.cmd == Mc_Reset) ? "reset" : "query", argc -i);
     }
-    if ((_mlxParams.cmd == Mc_Set || _mlxParams.cmd == Mc_Clr_Sem || _mlxParams.cmd == Mc_Set_Raw) && _mlxParams.device.length() == 0) {
-        return err(true, "%s command expects device to be specified.", _mlxParams.cmd == Mc_Set ? "set" : _mlxParams.cmd == Mc_Set_Raw ? "set_raw" : "clear_semaphore");
+    if ((_mlxParams.cmd == Mc_Set || _mlxParams.cmd == Mc_Clr_Sem || _mlxParams.cmd == Mc_Set_Raw || _mlxParams.cmd == Mc_Backup) && _mlxParams.device.length() == 0) {
+        return err(true, "%s command expects device to be specified.",
+                _mlxParams.cmd == Mc_Set ?
+                        "set" : _mlxParams.cmd == Mc_Set_Raw ?
+                                "set_raw" : _mlxParams.cmd == Mc_Clr_Sem ?
+                                        "clear_semaphore" : "backup");
     }
     if ((_mlxParams.cmd == Mc_Set_Raw && _mlxParams.rawTlvFile.size() == 0 )) {
         return err(true, "set_raw command expects raw TLV file to be specified.");
     }
-    if ((_mlxParams.cmd != Mc_Set_Raw && _mlxParams.rawTlvFile.size() != 0 )) {
+    if ((_mlxParams.cmd == Mc_Backup && _mlxParams.rawTlvFile.size() == 0 )) {
+        return err(true, "backup command expects file to be specified.");
+    }
+    if (((_mlxParams.cmd != Mc_Set_Raw && _mlxParams.cmd != Mc_Backup) &&
+            _mlxParams.rawTlvFile.size() != 0 )) {
         return err(true, "raw TLV file can only be specified with set_raw command.");
     }
 
     return extractCfgArgs(argc-i, &(argv[i]));
 }
+
+mlxCfgStatus MlxCfgParamParser::parseUserInput(string input, u_int32_t& val)
+{
+    std::map<string, u_int32_t>::iterator it;
+    //first check if it is a numeric value
+    if(strToNum(input, val, 0)) {
+        if(val == MLXCFG_UNKNOWN) {
+            return MLX_CFG_ERROR;
+        }
+        return MLX_CFG_OK;
+    }
+    for(it = _strMap.begin(); it != _strMap.end(); it++){
+        if(compareVal(it->first, input)){
+            val = it->second;
+            return MLX_CFG_OK;
+        }
+    }
+    return MLX_CFG_ERROR;
+}
+
+string MlxCfgParamParser::getShortDescStrAux()
+{
+    string s;
+    std::map<string, u_int32_t>::iterator it;
+
+    s = _name + "=<";
+
+    if(_strMap.size() == 0) {
+        s += _allowedValues;
+    } else {
+        //printf first str
+        it = _strMap.begin();
+        s += it->first;
+        it++;
+        for(; it != _strMap.end(); it++)
+        {
+            s += "|";
+            s += it->first;
+        }
+    }
+
+    s += ">";
+    return s;
+}
+
+void MlxCfgParamParser::printShortDesc()
+{
+    printf(IDENT4"%s\n", getShortDescStrAux().c_str());
+}
+
+void MlxCfgParamParser::splitAndPrintDesc(string desc)
+{
+    if(desc.length() > 129) {
+        //find index of last space in first 129 chars and split there
+        int i = desc.substr(0, 129).find_last_of(' ');
+        string desc2 = desc.substr(i, (desc.length() - i));
+        printf(IDENT4"%-46s   %s\n", "", desc.substr(0, i).c_str());
+        splitAndPrintDesc(desc2);
+    } else {
+        printf(IDENT4"%-46s   %s\n", "", desc.c_str());
+    }
+}
+
+bool MlxCfgParamParser::compareVal(string a, string b)
+{
+    if(a.length() != b.length()){
+        return false;
+    }
+
+    for(unsigned int i = 0; i < a.length(); i++) {
+        if(tolower(a[i]) != tolower(b[i])){
+            return false;
+        }
+    }
+
+    return true;
+}
+
+void MlxCfgParamParser::printLongDesc()
+{
+    string shortDesc = getShortDescStrAux();
+    if(_desc.length() > 129) {
+        //find index of last space in first 129 chars and split there
+        int i = _desc.substr(0, 129).find_last_of(' ');
+        string desc2 = _desc.substr(i, (_desc.length() - i));
+        printf(IDENT4"%-46s : %s\n", shortDesc.c_str(), _desc.substr(0, i).c_str());
+        splitAndPrintDesc(desc2);
+    } else {
+        printf(IDENT4"%-46s : %s\n", shortDesc.c_str(), _desc.c_str());
+    }
+}
+
+string MlxCfgParamParser::getStrVal(u_int32_t val){
+    std::map<string, u_int32_t>::iterator it;
+    if(val == MLXCFG_UNKNOWN) {
+        return "MLXCFG_UNKNOWN";
+    }
+    if(_strMap.size() == 0) {
+        return "";
+    } else {
+        for(it = _strMap.begin(); it != _strMap.end(); it++){
+            if(val == it->second){
+                return it->first;
+            }
+        }
+        //not a legal value, print it as it
+        return "";
+    }
+}
+
+bool mlxCfgParamParserCompare(MlxCfgParamParser a, MlxCfgParamParser b)
+{
+    return a.getName() < b.getName();
+}
+
+vector<MlxCfgParamParser> MlxCfgInfo::getParamsMapValues()
+{
+    vector<MlxCfgParamParser> vals;
+    std::map<mlxCfgParam, MlxCfgParamParser>::iterator it;
+    for(it = _params.begin(); it != _params.end(); it++)
+    {
+        vals.push_back(it->second);
+    }
+    return vals;
+}
+
+void MlxCfgInfo::printShortDesc()
+{
+    printf("\n");
+    printf(IDENT2"%s: %s\n",_name.c_str(), _title.c_str());
+
+    vector<MlxCfgParamParser> vals = getParamsMapValues();
+    std::sort(vals.begin(), vals.end(), mlxCfgParamParserCompare);
+
+    for(unsigned int i = 0; i < vals.size(); i++)
+    {
+        vals[i].printShortDesc();
+    }
+}
+
+void MlxCfgInfo::printLongDesc()
+{
+    printf("\n");
+    printf(IDENT2"%s: %s\n",_name.c_str(), _title.c_str());
+
+    vector<MlxCfgParamParser> vals = getParamsMapValues();
+    std::sort(vals.begin(), vals.end(), mlxCfgParamParserCompare);
+
+    for(unsigned int i = 0; i < vals.size(); i++)
+    {
+        vals[i].printLongDesc();
+    }
+}
+
+mlxCfgStatus MlxCfgInfo::getParamParser(mlxCfgParam p, MlxCfgParamParser& paramParser)
+{
+    std::map<mlxCfgParam, MlxCfgParamParser>::iterator it = _params.find(p);
+    if(it == _params.end()) {
+        return MLX_CFG_ERROR;
+    }
+    paramParser = it->second;
+    return MLX_CFG_OK;
+}
+
+mlxCfgStatus MlxCfgInfo::getParamParser(string name, MlxCfgParamParser& paramParser)
+{
+    std::map<mlxCfgParam, MlxCfgParamParser>::iterator it;
+    for(it = _params.begin(); it != _params.end(); it++)
+    {
+        if(name == it->second.getName()) {
+            paramParser = it->second;
+            return MLX_CFG_OK;
+        }
+    }
+    return MLX_CFG_ERROR;
+}
+
+MlxCfgInfo MlxCfgAllInfo::createPciSettings()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+    paramMap["True"] = 1;
+    paramMap["False"] = 0;
+    params[Mcp_Fpp_En] = MlxCfgParamParser(Mcp_Fpp_En, "FPP_EN", "Enable function per port", paramMap);
+    params[Mcp_Log_Bar_Size] = MlxCfgParamParser(Mcp_Log_Bar_Size, "LOG_BAR_SIZE", "example: for 8Mb bar size set LOG_BAR_SIZE=3 (only " FOURTH_GENERATION_LIST ")", "base_2_log_in_mb");
+    params[Mcp_Sriov_En] = MlxCfgParamParser(Mcp_Sriov_En, "SRIOV_EN", "Enable SR-IOV", paramMap);
+    params[Mcp_PF_Log_Bar_Size] = MlxCfgParamParser(Mcp_PF_Log_Bar_Size, "PF_LOG_BAR_SIZE", "example: for 8Mb bar size set PF_LOG_BAR_SIZE=3 (only " FIFTH_GENERATION_LIST ")", "base_2_log_in_mb");
+    params[Mcp_VF_Log_Bar_Size] = MlxCfgParamParser(Mcp_VF_Log_Bar_Size, "VF_LOG_BAR_SIZE", "example: for 8Mb bar size set VF_LOG_BAR_SIZE=3 (only " FIFTH_GENERATION_LIST ")", "base_2_log_in_mb");
+    params[Mcp_Num_Of_Vfs] = MlxCfgParamParser(Mcp_Num_Of_Vfs, "NUM_OF_VFS", "desired amount of virtual functions", "NUM");
+    params[Mcp_Num_Pf_Msix] = MlxCfgParamParser(Mcp_Num_Pf_Msix, "NUM_PF_MSIX", "Number of MSI-X vectors and EQs per PF (only " FIFTH_GENERATION_LIST ")", "NUM");
+    params[Mcp_Num_Vf_Msix] = MlxCfgParamParser(Mcp_Num_Vf_Msix, "NUM_VF_MSIX", "Number of MSI-X vectors and EQs per VF (only " FIFTH_GENERATION_LIST ")", "NUM");
+    return MlxCfgInfo("PCI Settings", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createIBDynamicallyConnect()
+{
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //IB Dynamically Connect
+    params[Mcp_Dcr_Lifo_Size] = MlxCfgParamParser(Mcp_Dcr_Lifo_Size, "DCR_LIFO_SIZE", "The amount of total DCRs available to join linked-lists after hash DCRs", "SIZE");
+    params[Mcp_Log_Dcr_Hash_Table_Size] = MlxCfgParamParser(Mcp_Log_Dcr_Hash_Table_Size, "LOG_DCR_HASH_TABLE_SIZE", "log2 of the hash table size minus 1", "SIZE");
+    return MlxCfgInfo("IB Dynamically Connect", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createInfinibandBootSettings()
+{
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //Infiniband Boot Settings
+    params[Mcp_Boot_Pkey_P1] = MlxCfgParamParser(Mcp_Boot_Pkey_P1, "BOOT_PKEY_P1", "partition key to be used by PXE boot (ConnectX3, ConnectX3-Pro Only)", "PKEY");
+    params[Mcp_Boot_Pkey_P2] = MlxCfgParamParser(Mcp_Boot_Pkey_P2, "BOOT_PKEY_P2", "set 0 for default", "PKEY");
+    return MlxCfgInfo("Infiniband Boot Settings", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createInternalSettings()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //Internal Settings
+    paramMap["Auto"] = 0;
+    paramMap["4KB"] = 12;
+    params[Mcp_Log_Tpt_Size] = MlxCfgParamParser(Mcp_Log_Tpt_Size, "INT_LOG_MAX_PAYLOAD_SIZE", """Burst length", paramMap);
+    return MlxCfgInfo("Internal Settings", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createPrebootBootSettings()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //Preboot Boot Settings
+    paramMap["True"] = 1;
+    paramMap["False"] = 0;
+    params[Mcp_Boot_Option_Rom_En_P1] = MlxCfgParamParser(Mcp_Boot_Option_Rom_En_P1, "BOOT_OPTION_ROM_EN_P1", "Disable/Enable boot option ROM", paramMap);
+    params[Mcp_Boot_Option_Rom_En_P2] = MlxCfgParamParser(Mcp_Boot_Option_Rom_En_P2, "BOOT_OPTION_ROM_EN_P2", "", paramMap);
+    params[Mcp_Boot_Vlan_En_P1] = MlxCfgParamParser(Mcp_Boot_Vlan_En_P1, "BOOT_VLAN_EN_P1", "Disable/Enable VLAN mode for network boot", paramMap);
+    params[Mcp_Boot_Vlan_En_P2] = MlxCfgParamParser(Mcp_Boot_Vlan_En_P2, "BOOT_VLAN_EN_P2", "", paramMap);
+    params[Mcp_Boot_Retry_Cnt_P1] = MlxCfgParamParser(Mcp_Boot_Retry_Cnt_P1, "BOOT_RETRY_CNT_P1", "Number of retries to attempt in case of boot failure. 7 indicates infinite retries.", "0..7");
+    params[Mcp_Boot_Retry_Cnt_P2] = MlxCfgParamParser(Mcp_Boot_Retry_Cnt_P2, "BOOT_RETRY_CNT_P2", "", "0..7");
+    paramMap.clear();
+    paramMap["None"] = 0;
+    paramMap["PXE"] = 1;
+    paramMap["iSCSI"] = 2;
+    paramMap["Both"] = 3;
+    params[Mcp_Legacy_Boot_Protocol_P1] = MlxCfgParamParser(Mcp_Legacy_Boot_Protocol_P1, "LEGACY_BOOT_PROTOCOL_P1", "None: disable legacy boot. PXE: DHCP/TFTP boot. Both: PXE and iSCSI", paramMap);
+    params[Mcp_Legacy_Boot_Protocol_P2] = MlxCfgParamParser(Mcp_Legacy_Boot_Protocol_P2, "LEGACY_BOOT_PROTOCOL_P2", "", paramMap);
+    params[Mcp_Boot_Vlan_P1] = MlxCfgParamParser(Mcp_Boot_Vlan_P1, "BOOT_VLAN_P1", "VLAN ID for the network boot", "VLAN ID");
+    params[Mcp_Boot_Vlan_P2] = MlxCfgParamParser(Mcp_Boot_Vlan_P2, "BOOT_VLAN_P2", "", "VLAN ID");
+    return MlxCfgInfo("Preboot Boot Settings", "Settings that control the legacy option ROM", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createRoCECongestionControlECN()
+{
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //RoCE Congestion Control ECN
+    params[Mcp_Clamp_Tgt_Rate_P1] = MlxCfgParamParser(Mcp_Clamp_Tgt_Rate_P1, "CLAMP_TGT_RATE_P1","If set, whenever a CNP is processed,"
+                  " the target rate is updated to be the current rate. Default=1"
+              ,"0|1");
+    params[Mcp_Clamp_Tgt_Rate_P2] = MlxCfgParamParser(Mcp_Clamp_Tgt_Rate_P2, "CLAMP_TGT_RATE_P2","","0|1");
+    params[Mcp_Clamp_Tgt_Rate_After_Time_Inc_P1] = MlxCfgParamParser(Mcp_Clamp_Tgt_Rate_After_Time_Inc_P1, "CLAMP_TGT_RATE_AFTER_TIME_INC_P1",
+                "When receiving an CNP, the target rate should"
+                    " be updated if the transmission rate was increased"
+                    " due to the timer, and not only due to the byte counter"". Default=1"
+                ,"0|1");
+    params[Mcp_Clamp_Tgt_Rate_After_Time_Inc_P2] = MlxCfgParamParser(Mcp_Clamp_Tgt_Rate_After_Time_Inc_P2, "CLAMP_TGT_RATE_AFTER_TIME_INC_P2","","0|1");
+    params[Mcp_Rpg_Time_Reset_P1] = MlxCfgParamParser(Mcp_Rpg_Time_Reset_P1, "RPG_TIME_RESET_P1"
+              ,"Time between rate increases if no CNPs are received. Given in u-seconds. Default=2"
+              ,"USEC");
+    params[Mcp_Rpg_Time_Reset_P2] = MlxCfgParamParser(Mcp_Rpg_Time_Reset_P2, "RPG_TIME_RESET_P2","","USEC");
+    params[Mcp_Rpg_Byte_Reset_P1] = MlxCfgParamParser(Mcp_Rpg_Byte_Reset_P1, "RPG_BYTE_RESET_P1"
+              ,"Transmitted data between rate increases if no CNPs are received. Given in Bytes. "
+               "Disabled=0, Default=150"
+              ,"BYTE_NUM");
+    params[Mcp_Rpg_Byte_Reset_P2] = MlxCfgParamParser(Mcp_Rpg_Byte_Reset_P2, "RPG_BYTE_RESET_P2","","BYTE_NUM");
+    params[Mcp_Rpg_Threshold_P1] = MlxCfgParamParser(Mcp_Rpg_Threshold_P1, "RPG_THRESHOLD_P1"
+             ,"The number of times rpByteStage or rpTimeStage can count before the RP rate control "
+              "state machine advances states. Default=5"
+             ,"0..31");
+    params[Mcp_Rpg_Threshold_P2] = MlxCfgParamParser(Mcp_Rpg_Threshold_P2, "RPG_THRESHOLD_P2","","0..31");
+    params[Mcp_Rpg_Max_Rate_P1] = MlxCfgParamParser(Mcp_Rpg_Max_Rate_P1, "RPG_MAX_RATE_P1"
+            ,"The maximum rate, in Mbits per second, at which an RP can transmit. "
+             "Once this limit is reached, the RP rate limited is released and "
+             "the flow is not rate limited any more. Default=0 (Full port speed)."
+            ,"RATE_IN_MBIT");
+    params[Mcp_Rpg_Max_Rate_P2] = MlxCfgParamParser(Mcp_Rpg_Max_Rate_P2, "RPG_MAX_RATE_P2","","RATE_IN_MBIT");
+    params[Mcp_Rpg_Ai_Rate_P1] = MlxCfgParamParser(Mcp_Rpg_Ai_Rate_P1, "RPG_AI_RATE_P1","The rate, in Mbits per second,"
+            " used to increase rpTargetRate in the RPR_ACTIVE_INCREASE state."
+            " Default=10."
+           ,"RATE_IN_MBIT");
+    params[Mcp_Rpg_Ai_Rate_P2] = MlxCfgParamParser(Mcp_Rpg_Ai_Rate_P2, "RPG_AI_RATE_P2","","RATE_IN_MBIT");
+    params[Mcp_Rpg_Hai_Rate_P1] = MlxCfgParamParser(Mcp_Rpg_Hai_Rate_P1, "RPG_HAI_RATE_P1"
+            ,"The rate, in Mbits per second, used to increase rpTargetRate in the RPR_HYPER_INCREASE state."
+             " Default=50"
+            ,"RATE_IN_MBIT");
+    params[Mcp_Rpg_Hai_Rate_P2] = MlxCfgParamParser(Mcp_Rpg_Hai_Rate_P2, "RPG_HAI_RATE_P2","","RATE_IN_MBIT");
+    params[Mcp_Rpg_Gd_P1] = MlxCfgParamParser(Mcp_Rpg_Gd_P1, "RPG_GD_P1"
+            ,"If a CNP is received, the flow rate is reduced at the beginning of the next rate_reduce_monitor_period interval to,"
+             "(1-Alpha/Gd)*CurrentRate. RPG_GD is given as log2(Gd), where Gd may only be powers of 2. Default=7."
+            ,"0..15");
+    params[Mcp_Rpg_Gd_P2] = MlxCfgParamParser(Mcp_Rpg_Gd_P2, "RPG_GD_P2","","0..15");
+    params[Mcp_Rpg_Min_Dec_Fac_P1] = MlxCfgParamParser(Mcp_Rpg_Min_Dec_Fac_P1, "RPG_MIN_DEC_FAC_P1"
+            ,"The minimum factor by which the current transmit rate can be changed when processing a CNP."
+             "Value is given as a percentage (1-100). Default=50."
+            ,"1..100");
+    params[Mcp_Rpg_Min_Dec_Fac_P2] = MlxCfgParamParser(Mcp_Rpg_Min_Dec_Fac_P2, "RPG_MIN_DEC_FAC_P2","","1..100");
+    params[Mcp_Rpg_Min_Rate_P1] = MlxCfgParamParser(Mcp_Rpg_Min_Rate_P1, "RPG_MIN_RATE_P1"
+            ,"The minimum value, in Mb per second, for rate to limit. Default=2000"
+            ,"RATE_IN_MBIT");
+    params[Mcp_Rpg_Min_Rate_P2] = MlxCfgParamParser(Mcp_Rpg_Min_Rate_P2, "RPG_MIN_RATE_P2","","RATE_IN_MBIT");
+    params[Mcp_Rate_To_Set_On_First_Cnp_P1] = MlxCfgParamParser(Mcp_Rate_To_Set_On_First_Cnp_P1, "RATE_TO_SET_ON_FIRST_CNP_P1"
+            ,"The rate that is set for the flow when a rate limiter is allocated to it upon first CNP received, in Mbps. "
+             "Default=0"
+            ,"RATE_IN_MBIT");
+    params[Mcp_Rate_To_Set_On_First_Cnp_P2] = MlxCfgParamParser(Mcp_Rate_To_Set_On_First_Cnp_P2, "RATE_TO_SET_ON_FIRST_CNP_P2","","RATE_IN_MBIT");
+    params[Mcp_Dce_Tcp_G_P1] = MlxCfgParamParser(Mcp_Dce_Tcp_G_P1, "DCE_TCP_G_P1"
+            ,"Used to update the congestion estimator (alpha) once every dce_tcp_rtt microseconds. Default=64"
+            ,"NUM");
+    params[Mcp_Dce_Tcp_G_P2] = MlxCfgParamParser(Mcp_Dce_Tcp_G_P2, "DCE_TCP_G_P2","","NUM");
+    params[Mcp_Dce_Tcp_Rtt_P1] = MlxCfgParamParser(Mcp_Dce_Tcp_Rtt_P1, "DCE_TCP_RTT_P1"
+            ,"The time between updates of the alpha value, in microseconds. Default=2"
+            ,"USEC");
+    params[Mcp_Dce_Tcp_Rtt_P2] = MlxCfgParamParser(Mcp_Dce_Tcp_Rtt_P2, "DCE_TCP_RTT_P2","","USEC");
+    params[Mcp_Rate_Reduce_Monitor_Period_P1] = MlxCfgParamParser(Mcp_Rate_Reduce_Monitor_Period_P1, "RATE_REDUCE_MONITOR_PERIOD_P1"
+            ,"The minimum time between 2 consecutive rate reductions for a single flow. "
+             "Rate reduction will occur only if a CNP is received during the relevant time interval. Default=2."
+            ,"USEC");
+    params[Mcp_Rate_Reduce_Monitor_Period_P2] = MlxCfgParamParser(Mcp_Rate_Reduce_Monitor_Period_P2, "RATE_REDUCE_MONITOR_PERIOD_P2","","USEC");
+    params[Mcp_Initial_Alpha_Value_P1] = MlxCfgParamParser(Mcp_Initial_Alpha_Value_P1, "INITIAL_ALPHA_VALUE_P1"
+            ,"The initial value of alpha to use when receiving the first CNP for a flow. "
+             "Expressed in a fixed point fraction of 2^10."
+            ,"NUM");
+    params[Mcp_Initial_Alpha_Value_P2] = MlxCfgParamParser(Mcp_Initial_Alpha_Value_P2, "INITIAL_ALPHA_VALUE_P2","","NUM");
+    params[Mcp_Min_Time_Between_Cnps_P1] = MlxCfgParamParser(Mcp_Min_Time_Between_Cnps_P1, "MIN_TIME_BETWEEN_CNPS_P1"
+            ,"Minimum time between sending cnps from the port, in microseconds. Default=0"
+            ,"USEC");
+    params[Mcp_Min_Time_Between_Cnps_P2] = MlxCfgParamParser(Mcp_Min_Time_Between_Cnps_P2, "MIN_TIME_BETWEEN_CNPS_P2","","USEC");
+    params[Mcp_Cnp_Dscp_P1] = MlxCfgParamParser(Mcp_Cnp_Dscp_P1, "CNP_DSCP_P1"
+            ,"The DiffServ Code Point of the generated CNP for this port. Default=0"
+            ,"0..7");
+    params[Mcp_Cnp_Dscp_P2] = MlxCfgParamParser(Mcp_Cnp_Dscp_P2, "CNP_DSCP_P2","","0..7");
+    params[Mcp_Cnp_802p_Prio_P1] = MlxCfgParamParser(Mcp_Cnp_802p_Prio_P1, "CNP_802P_PRIO_P1"
+            ,"The 802.1p priority value of the generated CNP for this port. Default=7"
+            ,"NUM");
+    params[Mcp_Cnp_802p_Prio_P2] = MlxCfgParamParser(Mcp_Cnp_802p_Prio_P2, "CNP_802P_PRIO_P2","","NUM");
+    return MlxCfgInfo("RoCE Congestion Control ECN", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createRoCEV1_5NextProtocol()
+{
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //RoCE V1.5 next protocol
+    params[Mcp_RoCE_Next_Protocol] = MlxCfgParamParser(Mcp_RoCE_Next_Protocol, "ROCE_NEXT_PROTOCOL",
+            "The next protocol value set in the IPv4/IPv6 packets for RoCE v1.5. The default is 0xFE.", "0..255");
+
+    return MlxCfgInfo("RoCE V1.5 next protocol", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createRoCECongestionControlParameters()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //RoCE Congestion Control Parameters
+    paramMap["ECN"] = 0;
+    paramMap["QCN"] = 1;
+    params[Mcp_RoCE_CC_Algorithm_P1] = MlxCfgParamParser(Mcp_RoCE_CC_Algorithm_P1, "ROCE_CC_ALGORITHM_P1", "Congestion control algorithm.", paramMap);
+    params[Mcp_RoCE_CC_Algorithm_P2] = MlxCfgParamParser(Mcp_RoCE_CC_Algorithm_P2, "ROCE_CC_ALGORITHM_P2", "", paramMap);
+    params[Mcp_RoCE_CC_Prio_Mask_P1] = MlxCfgParamParser(Mcp_RoCE_CC_Prio_Mask_P1, "ROCE_CC_PRIO_MASK_P1", "Per priority enable disable bitmask. default 0", "0..255");
+    params[Mcp_RoCE_CC_Prio_Mask_P2] = MlxCfgParamParser(Mcp_RoCE_CC_Prio_Mask_P2, "ROCE_CC_PRIO_MASK_P2", "", "0..255");
+    return MlxCfgInfo("RoCE Congestion Control Parameters", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createVPISettings()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //VPI Settings
+    paramMap["IB"] = 1;
+    paramMap["ETH"] = 2;
+    paramMap["VPI"] = 3;
+    params[Mcp_Link_Type_P1] = MlxCfgParamParser(Mcp_Link_Type_P1, "LINK_TYPE_P1", "", paramMap);
+    params[Mcp_Link_Type_P2] = MlxCfgParamParser(Mcp_Link_Type_P2, "LINK_TYPE_P2", "", paramMap);
+    return MlxCfgInfo("VPI Settings", "Control network link type", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createWakeOnLAN()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //Wake On LAN
+    paramMap["True"] = 1;
+    paramMap["False"] = 0;
+    params[Mcp_Wol_Magic_En] = MlxCfgParamParser(Mcp_Wol_Magic_En, "WOL_MAGIC_EN", "only " FIFTH_GENERATION_LIST " (per physical function)", paramMap);
+    params[Mcp_Wol_Magic_En_P1] = MlxCfgParamParser(Mcp_Wol_Magic_En_P1, "WOL_MAGIC_EN_P1", "enable wake on magic packet(per port.)", paramMap);
+    params[Mcp_Wol_Magic_En_P2] = MlxCfgParamParser(Mcp_Wol_Magic_En_P2, "WOL_MAGIC_EN_P2", "only " FOURTH_GENERATION_LIST, paramMap);
+    return MlxCfgInfo("Wake On LAN", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createExternalPort()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    paramMap["False"] = 0;
+    paramMap["True"] = 1;
+
+    //External ports
+    params[Mcp_Port_Owner] = MlxCfgParamParser(Mcp_Port_Owner, "PORT_OWNER", "If Set, Indicates this function of this host own the external physical port.", paramMap);
+    params[Mcp_Allow_Rd_Counters] = MlxCfgParamParser(Mcp_Allow_Rd_Counters, "ALLOW_RD_COUNTERS", "If Set, Indicates this function of this host allowed to rd counters of external physical port.", paramMap);
+    return MlxCfgInfo("External Ports", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createBootSettingsExt()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    //Boot Settings Extras
+    paramMap["IPv4"] = 0;
+    paramMap["IPv6"] = 1;
+    paramMap["IPv4_IPv6"] = 2;
+    paramMap["IPv6_IPv4"] = 3;
+    params[Mcp_Boot_Settings_Ext_IP_Ver] = MlxCfgParamParser(Mcp_Boot_Settings_Ext_IP_Ver, "IP_VER", "Select which IP protocol version will be used by flexboot. only " FIFTH_GENERATION_LIST ".", paramMap);
+    params[Mcp_Boot_Settings_Ext_IP_Ver_P1] = MlxCfgParamParser(Mcp_Boot_Settings_Ext_IP_Ver_P1, "IP_VER_P1", "Select which IP protocol version will be used by flexboot, only "  FOURTH_GENERATION_LIST " (per port).", paramMap);
+    params[Mcp_Boot_Settings_Ext_IP_Ver_P2] = MlxCfgParamParser(Mcp_Boot_Settings_Ext_IP_Ver_P2, "IP_VER_P2", "", paramMap);
+    return MlxCfgInfo("Boot Settings Extras", "These parameters are relevant only for servers using legacy BIOS PXE boot (flexboot).", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createQoS()
+{
+    map<string, u_int32_t> vlParamMap;
+    map<string, u_int32_t> tcParamMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    tcParamMap["8_TCS"] = 0;
+    tcParamMap["1_TC"] = 1;
+    tcParamMap["2_TCS"] = 2;
+    tcParamMap["3_TCS"] = 3;
+    tcParamMap["4_TCS"] = 4;
+    tcParamMap["5_TCS"] = 5;
+    tcParamMap["6_TCS"] = 6;
+    tcParamMap["7_TCS"] = 7;
+
+    vlParamMap["1_VL"] = 1;
+    vlParamMap["2_VLS"] = 2;
+    vlParamMap["4_VLS"] = 3;
+    vlParamMap["8_VLS"] = 4;
+    vlParamMap["15_VLS"] = 5;
+
+    params[Mcp_QoS_Num_of_TC_P1] = MlxCfgParamParser(Mcp_QoS_Num_of_TC_P1, "NUM_OF_TC_P1", "Number of traffic classes, when DCB-X is enabled, this is the maximum number of TC that can negotiated with the remote peer.", tcParamMap);
+    params[Mcp_QoS_Num_of_TC_P2] = MlxCfgParamParser(Mcp_QoS_Num_of_TC_P2, "NUM_OF_TC_P2", "", tcParamMap);
+    params[Mcp_QoS_Num_of_VL_P1] = MlxCfgParamParser(Mcp_QoS_Num_of_VL_P1, "NUM_OF_VL_P1", "Number of Infiniband Virtual Lanes for this port.", vlParamMap);
+    params[Mcp_QoS_Num_of_VL_P2] = MlxCfgParamParser(Mcp_QoS_Num_of_VL_P2, "NUM_OF_VL_P2", "", vlParamMap);
+    return MlxCfgInfo("QoS", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createLLDPClientSettings()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    paramMap["False"] = 0;
+    paramMap["True"] = 1;
+
+    params[Mcp_LLDP_NB_RX_Mode_P1] = MlxCfgParamParser(Mcp_LLDP_NB_RX_Mode_P1, "LLDP_NB_RX_MODE_P1", "Enable the internal LLDP client, and define which TLV it will process.", "0..2");
+    params[Mcp_LLDP_NB_TX_Mode_P1] = MlxCfgParamParser(Mcp_LLDP_NB_TX_Mode_P1, "LLDP_NB_TX_MODE_P1", "Select which LLDP TLV will be generated by the NIC.", "0..2");
+    params[Mcp_LLDP_NB_DCBX_P1] = MlxCfgParamParser(Mcp_LLDP_NB_DCBX_P1, "LLDP_NB_DCBX_P1", "Enable DCBX (applicable when LLDP_NB_TX_MODE and LLDP_NB_RX_MODE are in ALL mode)", paramMap);
+    params[Mcp_LLDP_NB_RX_Mode_P2] = MlxCfgParamParser(Mcp_LLDP_NB_RX_Mode_P2, "LLDP_NB_RX_MODE_P2", "", "0..2");
+    params[Mcp_LLDP_NB_TX_Mode_P2] = MlxCfgParamParser(Mcp_LLDP_NB_TX_Mode_P2, "LLDP_NB_TX_MODE_P2", "", "0..2");
+    params[Mcp_LLDP_NB_DCBX_P2] = MlxCfgParamParser(Mcp_LLDP_NB_DCBX_P2, "LLDP_NB_DCBX_P2", "", paramMap);
+    return MlxCfgInfo("LLDP Client Settings", "", params);
+}
+
+MlxCfgInfo MlxCfgAllInfo::createLLDPNBDCBX()
+{
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    paramMap["False"] = 0;
+    paramMap["True"] = 1;
+
+    params[Mcp_DCBX_IEEE_EN_P1] = MlxCfgParamParser(Mcp_DCBX_IEEE_EN_P1, "DCBX_IEEE_P1", "Enable DCBX in IEEE mode.", paramMap);
+    params[Mcp_DCBX_CEE_EN_P1] = MlxCfgParamParser(Mcp_DCBX_CEE_EN_P1, "DCBX_CEE_P1", "Enable DCBX in CEE mode.", paramMap);
+    params[Mcp_DCBX_WILLING_P1] = MlxCfgParamParser(Mcp_DCBX_WILLING_P1, "DCBX_WILLING_P1", "Allow the NIC to accept DCBX configuration from the remote peer.", paramMap);
+    params[Mcp_DCBX_IEEE_EN_P2] = MlxCfgParamParser(Mcp_DCBX_IEEE_EN_P2, "DCBX_IEEE_P2", "", paramMap);
+    params[Mcp_DCBX_CEE_EN_P2] = MlxCfgParamParser(Mcp_DCBX_CEE_EN_P2, "DCBX_CEE_P2", "", paramMap);
+    params[Mcp_DCBX_WILLING_P2] = MlxCfgParamParser(Mcp_DCBX_WILLING_P2, "DCBX_WILLING_P2", "", paramMap);
+    return MlxCfgInfo("LLDP NB DCBX", "", params);
+}
+
+bool sortCfg(MlxCfgInfo a, MlxCfgInfo b)
+{
+    return a.getName() < b.getName();
+}
+
+MlxCfgAllInfo::MlxCfgAllInfo()
+{
+    //Initialize all the configurations
+    map<string, u_int32_t> paramMap;
+    map<mlxCfgParam, MlxCfgParamParser> params;
+
+    _allInfo.push_back(createPciSettings());
+    _allInfo.push_back(createIBDynamicallyConnect());
+    _allInfo.push_back(createInfinibandBootSettings());
+    _allInfo.push_back(createInternalSettings());
+    _allInfo.push_back(createPrebootBootSettings());
+    _allInfo.push_back(createRoCECongestionControlECN());
+    _allInfo.push_back(createRoCEV1_5NextProtocol());
+    _allInfo.push_back(createRoCECongestionControlParameters());
+    _allInfo.push_back(createVPISettings());
+    _allInfo.push_back(createWakeOnLAN());
+    _allInfo.push_back(createExternalPort());
+    _allInfo.push_back(createBootSettingsExt());
+    _allInfo.push_back(createQoS());
+    _allInfo.push_back(createLLDPClientSettings());
+    _allInfo.push_back(createLLDPNBDCBX());
+    std::sort(_allInfo.begin(), _allInfo.end(), sortCfg);
+}
+
+void MlxCfgAllInfo::printShortDesc()
+{
+    for(u_int32_t i = 0; i < _allInfo.size(); i++){
+        _allInfo[i].printShortDesc();
+    }
+}
+
+void MlxCfgAllInfo::printLongDesc()
+{
+    for(u_int32_t i = 0; i < _allInfo.size(); i++){
+        _allInfo[i].printLongDesc();
+    }
+}
+
+mlxCfgStatus MlxCfgAllInfo::getParamParser(mlxCfgParam p, MlxCfgParamParser& paramParser)
+{
+    for(u_int32_t j = 0; j < _allInfo.size(); j++){
+        if(_allInfo[j].getParamParser(p, paramParser) == MLX_CFG_OK) {
+            return MLX_CFG_OK;
+        }
+    }
+    return MLX_CFG_ERROR;
+}
+
+mlxCfgStatus MlxCfgAllInfo::parseParam(string tag, string strVal, u_int32_t& val, mlxCfgParam& param)
+{
+    MlxCfgParamParser paramParser;
+    for(u_int32_t j = 0; j < _allInfo.size(); j++){
+        if(_allInfo[j].getParamParser(tag, paramParser) == MLX_CFG_OK) {
+            param = paramParser.getParam();
+            return (paramParser.parseUserInput(strVal, val)) ?
+                    MLX_CFG_ERROR :
+                    MLX_CFG_OK;
+        }
+    }
+    return MLX_CFG_ERROR;
+}
diff --git a/mlxconfig/mlxcfg_status.h b/mlxconfig/mlxcfg_status.h
index ba50807..72b9385 100644
--- a/mlxconfig/mlxcfg_status.h
+++ b/mlxconfig/mlxcfg_status.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,12 @@
  * 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.
+ */
+/*
+ * mlxcfg_status.h
  *
- *  Version: $Id$
- *
+ *  Created on: Mar 23, 2015
+ *      Author: adrianc
  */
 
 #ifndef MLXCFG_STATUS_H_
diff --git a/mlxconfig/mlxcfg_ui.cpp b/mlxconfig/mlxcfg_ui.cpp
index f78132a..a83df79 100644
--- a/mlxconfig/mlxcfg_ui.cpp
+++ b/mlxconfig/mlxcfg_ui.cpp
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #include <stdlib.h>
@@ -127,6 +125,8 @@ void initHandler()
 
 // TODO: adrianc: change to map<mlxCfgParam, string>
 std::string MlxCfgParams::param2str[Mcp_Last]= {"SRIOV_EN", "NUM_OF_VFS", "FPP_EN",
+                                                "PF_LOG_BAR_SIZE", "VF_LOG_BAR_SIZE",
+                                                "NUM_PF_MSIX", "NUM_VF_MSIX",
                                                 "WOL_MAGIC_EN_P1", "WOL_MAGIC_EN_P2",
                                                 "WOL_MAGIC_EN",
                                                 "LINK_TYPE_P1", "LINK_TYPE_P2",
@@ -134,7 +134,6 @@ std::string MlxCfgParams::param2str[Mcp_Last]= {"SRIOV_EN", "NUM_OF_VFS", "FPP_E
                                                 "INT_LOG_MAX_PAYLOAD_SIZE",
                                                 "BOOT_PKEY_P1", "BOOT_PKEY_P2",
                                                 "LOG_DCR_HASH_TABLE_SIZE", "DCR_LIFO_SIZE",
-                                                 "PORT_BOOT_STATE_P1", "PORT_BOOT_STATE_P2",
                                                  "ROCE_NEXT_PROTOCOL",
                                                  "ROCE_CC_ALGORITHM_P1", "ROCE_CC_PRIO_MASK_P1", "ROCE_CC_ALGORITHM_P2", "ROCE_CC_PRIO_MASK_P2",
                                                  "CLAMP_TGT_RATE_P1", "CLAMP_TGT_RATE_AFTER_TIME_INC_P1", "RPG_TIME_RESET_P1",
@@ -150,6 +149,13 @@ std::string MlxCfgParams::param2str[Mcp_Last]= {"SRIOV_EN", "NUM_OF_VFS", "FPP_E
                                                  "INITIAL_ALPHA_VALUE_P2", "MIN_TIME_BETWEEN_CNPS_P2", "CNP_DSCP_P2", "CNP_802P_PRIO_P2",
                                                  "BOOT_OPTION_ROM_EN_P1", "BOOT_VLAN_EN_P1", "BOOT_RETRY_CNT_P1", "LEGACY_BOOT_PROTOCOL_P1", "BOOT_VLAN_P1",
                                                  "BOOT_OPTION_ROM_EN_P2", "BOOT_VLAN_EN_P2", "BOOT_RETRY_CNT_P2", "LEGACY_BOOT_PROTOCOL_P2", "BOOT_VLAN_P2",
+                                                 "PORT_OWNER", "ALLOW_RD_COUNTERS", "IP_VER", "IP_VER_P1", "IP_VER_P2",
+                                                 "NUM_OF_TC_P1", "NUM_OF_VL_P1",
+                                                 "NUM_OF_TC_P2", "NUM_OF_VL_P2",
+                                                 "LLDP_NB_RX_MODE_P1", "LLDP_NB_TX_MODE_P1", "LLDP_NB_DCBX_P1",
+                                                 "LLDP_NB_RX_MODE_P2", "LLDP_NB_TX_MODE_P2", "LLDP_NB_DCBX_P2",
+                                                 "DCBX_IEEE_P1", "DCBX_CEE_P1", "DCBX_WILLING_P1",
+                                                 "DCBX_IEEE_P2", "DCBX_CEE_P2", "DCBX_WILLING_P2"
                                                   };
 
 u_int32_t MlxCfgParams::getParamVal(mlxCfgParam p)
@@ -252,25 +258,47 @@ mlxCfgStatus MlxCfg::queryDevsCfg()
     return shouldFail? MLX_CFG_ERROR : MLX_CFG_OK;
 }
 
-static void printParam(u_int32_t param)
+static void printParam(string param, u_int32_t val)
 {
-    if (param == MLXCFG_UNKNOWN) {
+    if (val == MLXCFG_UNKNOWN) {
             printf("%-16s", "N/A");
         } else {
-            printf("%-16u", param);
+            if(param == "") {
+                printf("%-16d", val);
+            } else {
+                stringstream convert;
+                convert << val;
+                param += "(" + convert.str() + ")";
+                printf("%-16s", param.c_str());
+            }
         }
     return;
 }
 
-static void printOneParam(const char* name, u_int32_t currVal, bool printNewCfg=false, u_int32_t newVal= MLXCFG_UNKNOWN)
+static void printOneParam(const char* name, u_int32_t currVal, string currStrVal, bool showDefault=false, u_int32_t defaultVal=MLXCFG_UNKNOWN,
+        string defaultStrVal="MLXCFG_UNKNOWN", bool printNewCfg=false, u_int32_t newVal=MLXCFG_UNKNOWN, string newStrVal= "MLXCFG_UNKNOWN")
 {
     printf("         %-36s", name);
-    printParam(currVal);
+    if (showDefault) {
+        printParam(defaultStrVal, defaultVal);
+    }
+    printParam(currStrVal, currVal);
+    if (showDefault &&
+            currVal != defaultVal) {
+        printf("*");
+    }
     if (printNewCfg) {
         if (newVal == MLXCFG_UNKNOWN) {
-            printParam(currVal);
+            printParam(currStrVal, currVal);
         } else {
-            printf("%-16u", newVal);
+            if(newStrVal == "") {
+                printf("%-16d", newVal);
+            } else {
+                stringstream convert;
+                convert << newVal;
+                newStrVal += "(" + convert.str() + ")";
+                printf("%-16s", newStrVal.c_str());
+            }
         }
     }
     printf("\n");
@@ -302,6 +330,7 @@ mlxCfgStatus MlxCfg::queryDevCfg(const char* dev,const char* pci, int devIndex,
     bool rc;
     bool failedToGetCfg = false;
     bool nothingSupported = true;
+    bool isParamsDiffer = false;
     (void) pci;
     // print opening
     printf("\nDevice #%d:\n", devIndex);
@@ -320,17 +349,49 @@ mlxCfgStatus MlxCfg::queryDevCfg(const char* dev,const char* pci, int devIndex,
     }
 
     //print configuration Header
-    printf("%-16s%36s","Configurations:","Current");
+    if (_mlxParams.showDefault) {
+        printf("%-16s%36s%16s","Configurations:","Default","Current");
+    } else {
+        printf("%-16s%36s","Configurations:","Current");
+    }
     if (printNewCfg) {
         printf("         %s", "New");
     }
     printf("\n");
 
+    bool defaultSupported = false;
+    if (_mlxParams.showDefault){
+        if(ops.isDefaultSupported(defaultSupported)) {
+                return err(false, "Error when checked if Firmware supports querying default configurations or not.");
+        } else {
+            if(!defaultSupported){
+                return err(false, "Firmware does not support querying default configurations");
+            }
+        }
+    }
+
     for (int p = (int)Mcp_Sriov_En ; p < (int)Mcp_Last; ++p) {
+        if (printNewCfg) {
+            // display only cfgs we wanted to set (can be done more efficient)
+            std::vector<cfgInfo>::iterator it;
+            for (it = _mlxParams.params.begin(); it != _mlxParams.params.end(); it++) {
+                if (it->first == (mlxCfgParam)p) {
+                    break;
+                }
+            }
+            if (it == _mlxParams.params.end()) {
+                continue;
+            }
+        }
         if (!ops.supportsParam((mlxCfgParam)p)) {
+            if (_mlxParams.cmd == Mc_Set) {
+                err(false, "Device doesn't support %s configuration.", MlxCfgParams::param2str[p].c_str());
+                return MLX_CFG_ERROR_EXIT;
+            }
             continue;
         }
         nothingSupported= false;
+        u_int32_t defaultParam = MLXCFG_UNKNOWN;
         u_int32_t currentParam = MLXCFG_UNKNOWN ;
         u_int32_t newParam = _mlxParams.getParamVal((mlxCfgParam)p);
         rc = ops.getCfg((mlxCfgParam)p, currentParam);
@@ -338,13 +399,35 @@ mlxCfgStatus MlxCfg::queryDevCfg(const char* dev,const char* pci, int devIndex,
             failedToGetCfg = true;
             printf("         %-16s%-16s %s\n", MlxCfgParams::param2str[p].c_str(), "failed to get current configuration.",\
                     ops.err());
-            err(false, "Failed to query device configuration");
+            err(false, "Failed to query device current configuration");
         } else {
-            printOneParam(MlxCfgParams::param2str[p].c_str(), currentParam, printNewCfg, newParam);
+            if (_mlxParams.showDefault) {
+                rc = ops.getCfg((mlxCfgParam)p, defaultParam, true);
+                if (rc) {
+                    failedToGetCfg = true;
+                    err(false, "Failed to query device default configuration");
+                } else {
+                    isParamsDiffer |= (defaultParam != currentParam);
+                }
+            }
+            MlxCfgParamParser paramParser;
+            if(_allInfo.getParamParser((mlxCfgParam)p, paramParser) == MLX_CFG_OK){
+                string defaultParamStr = paramParser.getStrVal(defaultParam);
+                string currentParamStr = paramParser.getStrVal(currentParam);
+                string newParamStr = paramParser.getStrVal(newParam);
+                printOneParam(MlxCfgParams::param2str[p].c_str(), currentParam, currentParamStr, _mlxParams.showDefault,
+                        defaultParam, defaultParamStr, printNewCfg, newParam, newParamStr);
+            } else {
+                failedToGetCfg = true;
+                err(false, "Internal Error");
+            }
         }
     }
+    if(isParamsDiffer) {
+        printf("The '*' shows parameters with current value different from default value.\n");
+    }
     if (nothingSupported) {
-        err(false, "Device Doesn't support any configuration changes.");
+        err(false, "Device doesn't support any configuration changes.");
         return MLX_CFG_ERROR_EXIT;
     }
     return failedToGetCfg ? MLX_CFG_ERROR : MLX_CFG_OK;
@@ -371,7 +454,8 @@ mlxCfgStatus MlxCfg::setDevCfg()
 
     // write cfgs
     MlxCfgOps ops;
-    bool rc;
+    int rc;
+    mlxCfgParam p;
 
     rc = ops.open(_mlxParams.device.c_str());
     if (rc) {
@@ -383,10 +467,14 @@ mlxCfgStatus MlxCfg::setDevCfg()
 
     printf("Applying... ");
     // set Configuration
-    rc = ops.setCfg(_mlxParams.params);
+    rc = ops.setCfg(_mlxParams.params, p);
     if (rc) {
         printf("Failed!\n");
-        err(true, "Failed to set configuration: %s", ops.err());
+        if (rc == MCE_UNSUPPORTED_CFG) {
+            err(true, "Unsupported Configuration: %s", MlxCfgParams::param2str[p].c_str());
+        } else {
+            err(true, "Failed to set configuration: %s", ops.err());
+        }
         return MLX_CFG_ERROR;
     }
 
@@ -461,7 +549,7 @@ mlxCfgStatus MlxCfg::clrDevSem()
     MlxCfgOps ops;
     bool rc;
 
-    printf("-W- Forcefully clearing device Semaphore(47)...");
+    printf("-W- Forcefully clearing device Semaphore...");
 
     rc = ops.open(_mlxParams.device.c_str(), true);
     if (rc) {
@@ -537,6 +625,50 @@ mlxCfgStatus MlxCfg::setDevRawCfg()
     return MLX_CFG_OK;
 }
 
+mlxCfgStatus MlxCfg::backupCfg()
+{
+    MlxCfgOps ops;
+    bool rc;
+    vector<pair<u_int32_t, vector<u_int8_t> > > cfgsMap;
+    FILE * file;
+
+    rc = ops.open(_mlxParams.device.c_str(), true);
+    if (rc) {
+        printf(" Failed!\n");
+        return err(true, "Failed to open device: %s. %s", _mlxParams.device.c_str(), ops.err());
+    }
+
+    printf("Collecting...\n");
+    if (ops.backupCfgs(cfgsMap)) {
+        printf(" Failed!\n");
+        return err(true, "Failed to backup the configurations: %s", ops.err());
+    }
+
+    // open file
+    printf("Saving output...\n");
+    file = fopen(_mlxParams.rawTlvFile.c_str(), "w");
+    if (file == NULL) {
+        return err(true, "Failed to open file: %s", _mlxParams.rawTlvFile.c_str());
+    }
+
+    fprintf(file, "%s\n", MLNX_RAW_TLV_FILE_SIG);
+
+    for(std::vector<pair<u_int32_t, vector<u_int8_t> > >::iterator it = cfgsMap.begin();
+            it != cfgsMap.end(); it++) {
+        fprintf(file, "%% TLV Type: 0x%08x\n", it->first);
+        vector<u_int8_t> v = it->second;
+        for(size_t i = 0; i < v.size() / 4; i++) {
+            fprintf(file, "0x%08x ", __cpu_to_be32(((u_int32_t*)v.data())[i]));
+        }
+        fprintf(file, "\n");
+    }
+
+    fclose(file);
+
+    printf("Done!\n");
+    return MLX_CFG_OK;
+}
+
 mlxCfgStatus MlxCfg::tlvLine2DwVec(const std::string& tlvStringLine, std::vector<u_int32_t>& tlvVec) {
     tlvVec.resize(0);
     std::string dwStr;
@@ -603,6 +735,9 @@ mlxCfgStatus MlxCfg::execute(int argc, char* argv[])
     case Mc_Set_Raw:
         ret = setDevRawCfg();
         break;
+    case Mc_Backup:
+        ret = backupCfg();
+        break;
     default:
         // should not reach here.
         return err(true, "invalid command.");
@@ -610,30 +745,6 @@ mlxCfgStatus MlxCfg::execute(int argc, char* argv[])
     return ret;
 }
 
-mlxCfgStatus MlxCfg::test(const char* dev)
-{
-    bool rc;
-    MlxCfgOps ops;
-    rc = ops.open(dev);
-    if (rc) {
-        return err(true, "Failed to open device: %s. %s", dev, ops.err());
-    }
-    u_int32_t val;
-    rc =ops.invalidateCfgs();
-    printf("after invalidate all : rc = %d\n", rc);
-    rc =ops.getCfg(Mcp_Wol_Magic_En_P1, val);
-    printf("get sriov_en get before set : rc = %d , val = %d\n", rc,val);
-    rc = ops.setCfg(_mlxParams.params);
-    printf("get sriov_en set : rc = %d , val = %d\n", rc,val);
-    rc =ops.getCfg(Mcp_Wol_Magic_En_P1, val);
-    printf("get sriov_en get after set : rc = %d , val = %d\n", rc,val);
-    if (rc) {
-        printf("-D- %s\n",ops.err());
-    }
-    return MLX_CFG_OK;
-}
-
-
 int main(int argc, char* argv[])
 {
     try
diff --git a/mlxconfig/mlxcfg_ui.h b/mlxconfig/mlxcfg_ui.h
index a83f2b1..04a9fd8 100644
--- a/mlxconfig/mlxcfg_ui.h
+++ b/mlxconfig/mlxcfg_ui.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef MLXCFG_UI_H_
@@ -48,6 +46,7 @@ typedef enum {
     Mc_Reset,
     Mc_Clr_Sem,
     Mc_Set_Raw,
+    Mc_Backup,
     Mc_UnknownCmd
 } mlxCfgCmd;
 
@@ -59,11 +58,103 @@ typedef enum {
     MLX_CFG_ERROR_EXIT
 } mlxCfgStatus;
 
+using namespace std;
+
+class MlxCfgParamParser
+{
+public:
+    MlxCfgParamParser(): _param(Mcp_Last), _name(), _desc(){}
+    MlxCfgParamParser(mlxCfgParam param, string name, string desc, map<string, u_int32_t> strMap)
+        : _param(param), _name(name), _desc(desc), _strMap(strMap){}
+    MlxCfgParamParser(mlxCfgParam param, string name, string desc, string allowedValues) : _param(param),
+            _name(name), _desc(desc), _allowedValues(allowedValues){}
+
+    ~MlxCfgParamParser() {}
+
+    mlxCfgStatus parseUserInput(string input, u_int32_t& val);
+
+    void printShortDesc();
+    void printLongDesc();
+
+    string getName() {return _name;}
+    mlxCfgParam getParam() {return _param;}
+
+    string getStrVal(u_int32_t val);
+
+private:
+    mlxCfgParam _param;
+    string _name; //param name for example: LINK_TYPE_P1
+    string _desc; //for example: 4th generation devices only
+    string _allowedValues;
+    map<string, u_int32_t> _strMap; //map strings to values, for example: {{'InfiniBand',1},{'Ethernet',2},{'VPI',3}}
+
+
+    void printShortDescAux();
+    string getShortDescStrAux();
+    void splitAndPrintDesc(string desc);
+    bool compareVal(string a, string b);
+
+};
+
+class MlxCfgInfo
+{
+public:
+    MlxCfgInfo(string name, string title, map<mlxCfgParam, MlxCfgParamParser> params) :
+        _name(name), _title(title), _params(params){};
+
+    ~MlxCfgInfo() {}
+
+    void printShortDesc();
+    void printLongDesc();
+
+    mlxCfgStatus getParamParser(mlxCfgParam, MlxCfgParamParser&);
+    mlxCfgStatus getParamParser(string, MlxCfgParamParser&);
+    string getName() { return _name; }
+
+private:
+    string _name; //for example: VPI Settings
+    string _title; //for example: Control network link type
+    map<mlxCfgParam, MlxCfgParamParser> _params; //for example: {{LINK_TYPE_P1,*},{LINK_TYPE_P2,*}}
+    vector<MlxCfgParamParser> getParamsMapValues();
+};
+
+class MlxCfgAllInfo
+{
+public:
+    MlxCfgAllInfo();
+
+    ~MlxCfgAllInfo() {}
+
+    void printShortDesc();
+    void printLongDesc();
+
+    mlxCfgStatus parseParam(string tag, string strval, u_int32_t& val, mlxCfgParam& param);
+    mlxCfgStatus getParamParser(mlxCfgParam p, MlxCfgParamParser& paramParser);
+
+    vector<MlxCfgInfo> _allInfo;
+
+private:
+    MlxCfgInfo createPciSettings();
+    MlxCfgInfo createIBDynamicallyConnect();
+    MlxCfgInfo createInfinibandBootSettings();
+    MlxCfgInfo createInternalSettings();
+    MlxCfgInfo createPrebootBootSettings();
+    MlxCfgInfo createRoCECongestionControlECN();
+    MlxCfgInfo createRoCEV1_5NextProtocol();
+    MlxCfgInfo createRoCECongestionControlParameters();
+    MlxCfgInfo createVPISettings();
+    MlxCfgInfo createWakeOnLAN();
+    MlxCfgInfo createExternalPort();
+    MlxCfgInfo createBootSettingsExt();
+    MlxCfgInfo createQoS();
+    MlxCfgInfo createLLDPClientSettings();
+    MlxCfgInfo createLLDPNBDCBX();
+};
 
 class MlxCfgParams
 {
 public:
-    MlxCfgParams() : device(), rawTlvFile(), cmd(Mc_UnknownCmd), yes(false), force(false) {}
+    MlxCfgParams() : device(), rawTlvFile(), cmd(Mc_UnknownCmd), yes(false), force(false), showDefault(false) {}
     ~MlxCfgParams() {}
 
     std::string device;
@@ -73,6 +164,7 @@ public:
     std::vector<cfgInfo> params;
     static std::string param2str[Mcp_Last];
     bool force;// ignore parameter checks
+    bool showDefault;
 
     u_int32_t getParamVal(mlxCfgParam p);
 };
@@ -81,7 +173,7 @@ public:
 class MlxCfg
 {
 public:
-    MlxCfg() : _mlxParams(), _errStr(){}
+    MlxCfg() : _mlxParams(), _errStr(), _allInfo(){}
     ~MlxCfg() {};
     mlxCfgStatus execute(int argc, char* argv[]);
 private:
@@ -108,11 +200,10 @@ private:
     mlxCfgStatus resetDevCfg(const char* dev);
     // Set Raw TLV file
     mlxCfgStatus setDevRawCfg();
+    mlxCfgStatus backupCfg();
     mlxCfgStatus tlvLine2DwVec(const std::string& tlvStringLine, std::vector<u_int32_t>& tlvVec);
 
     mlxCfgStatus clrDevSem();
-    //
-    mlxCfgStatus test(const char* dev);
 
     bool askUser(const char* question);
     mlxCfgStatus err(bool report, const char* errMsg, ...);
@@ -120,6 +211,8 @@ private:
     // data members
     MlxCfgParams _mlxParams;
     std::string _errStr;
+    MlxCfgAllInfo _allInfo;
+
 };
 
 
diff --git a/mlxfwops/Makefile.in b/mlxfwops/Makefile.in
index a5915f1..ac49486 100644
--- a/mlxfwops/Makefile.in
+++ b/mlxfwops/Makefile.in
@@ -269,6 +269,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
diff --git a/mlxfwops/lib/Makefile.am b/mlxfwops/lib/Makefile.am
index 050c2fc..a3e5bac 100755
--- a/mlxfwops/lib/Makefile.am
+++ b/mlxfwops/lib/Makefile.am
@@ -40,13 +40,18 @@ LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 UTILS_LIB = $(top_srcdir)/mft_utils
 UEFI_COMMON_DIR = $(top_srcdir)/mlxfwops/uefi_c
 
-INCLUDES = -I$(srcdir) -I$(MTCR_INC_DIR) -I$(MFLASH_DIR) -I$(top_srcdir)/ext_libs/json -I$(MINIXZ_DIR)\
-           -I$(COMMON_DIR) -I$(MFT_EXT_LIBS_INC_DIR)/zlib -I $(LAYOUTS_DIR) -I$(top_srcdir)/common -I$(UTILS_LIB) -I$(UEFI_COMMON_DIR)
+AM_CPPFLAGS = -I$(srcdir) -I$(MTCR_INC_DIR) -I$(MFLASH_DIR) -I$(top_srcdir)/ext_libs/json -I$(MINIXZ_DIR)\
+           -I$(COMMON_DIR) -I$(LAYOUTS_DIR) -I$(top_srcdir)/common -I$(UTILS_LIB) -I$(UEFI_COMMON_DIR)
 
 MLXFWOPS_VERSION = 1
 
 AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe -DNO_MFA_SUPPORT
 
+if ENABLE_OPENSSL
+else
+AM_CXXFLAGS += -DNO_OPEN_SSL
+endif
+
 noinst_LIBRARIES = libmlxfwops.a
 
 libmlxfwops_a_SOURCES = flint_base.cpp \
@@ -55,5 +60,6 @@ libmlxfwops_a_SOURCES = flint_base.cpp \
                fs2_ops.cpp fs2_ops.h \
                fs3_ops.cpp fs3_ops.h \
                mlxfwops.cpp mlxfwops.h \
-               mlxfwops_com.h mlxfwops.h fw_ops.h flint_base.h flint_io.h
+               mlxfwops_com.h mlxfwops.h fw_ops.h flint_base.h flint_io.h\
+               aux_tlv_ops.h aux_tlv_ops.cpp
 
diff --git a/mlxfwops/lib/Makefile.in b/mlxfwops/lib/Makefile.in
index b26c0a4..1f944e2 100644
--- a/mlxfwops/lib/Makefile.in
+++ b/mlxfwops/lib/Makefile.in
@@ -110,6 +110,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+ at ENABLE_OPENSSL_FALSE@am__append_1 = -DNO_OPEN_SSL
 subdir = mlxfwops/lib
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/config/depcomp
@@ -131,7 +132,7 @@ libmlxfwops_a_AR = $(AR) $(ARFLAGS)
 libmlxfwops_a_LIBADD =
 am_libmlxfwops_a_OBJECTS = flint_base.$(OBJEXT) flint_io.$(OBJEXT) \
 	fw_ops.$(OBJEXT) fs2_ops.$(OBJEXT) fs3_ops.$(OBJEXT) \
-	mlxfwops.$(OBJEXT)
+	mlxfwops.$(OBJEXT) aux_tlv_ops.$(OBJEXT)
 libmlxfwops_a_OBJECTS = $(am_libmlxfwops_a_OBJECTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -283,6 +284,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -347,11 +349,12 @@ COMMON_DIR = $(top_srcdir)/common
 LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 UTILS_LIB = $(top_srcdir)/mft_utils
 UEFI_COMMON_DIR = $(top_srcdir)/mlxfwops/uefi_c
-INCLUDES = -I$(srcdir) -I$(MTCR_INC_DIR) -I$(MFLASH_DIR) -I$(top_srcdir)/ext_libs/json -I$(MINIXZ_DIR)\
-           -I$(COMMON_DIR) -I$(MFT_EXT_LIBS_INC_DIR)/zlib -I $(LAYOUTS_DIR) -I$(top_srcdir)/common -I$(UTILS_LIB) -I$(UEFI_COMMON_DIR)
+AM_CPPFLAGS = -I$(srcdir) -I$(MTCR_INC_DIR) -I$(MFLASH_DIR) -I$(top_srcdir)/ext_libs/json -I$(MINIXZ_DIR)\
+           -I$(COMMON_DIR) -I$(LAYOUTS_DIR) -I$(top_srcdir)/common -I$(UTILS_LIB) -I$(UEFI_COMMON_DIR)
 
 MLXFWOPS_VERSION = 1
-AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe -DNO_MFA_SUPPORT
+AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe -DNO_MFA_SUPPORT \
+	$(am__append_1)
 noinst_LIBRARIES = libmlxfwops.a
 libmlxfwops_a_SOURCES = flint_base.cpp \
                flint_io.cpp \
@@ -359,7 +362,8 @@ libmlxfwops_a_SOURCES = flint_base.cpp \
                fs2_ops.cpp fs2_ops.h \
                fs3_ops.cpp fs3_ops.h \
                mlxfwops.cpp mlxfwops.h \
-               mlxfwops_com.h mlxfwops.h fw_ops.h flint_base.h flint_io.h
+               mlxfwops_com.h mlxfwops.h fw_ops.h flint_base.h flint_io.h\
+               aux_tlv_ops.h aux_tlv_ops.cpp
 
 all: all-am
 
@@ -410,6 +414,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aux_tlv_ops.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flint_base.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flint_io.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fs2_ops.Po at am__quote@
diff --git a/mlxfwops/lib/aux_tlv_ops.cpp b/mlxfwops/lib/aux_tlv_ops.cpp
new file mode 100644
index 0000000..a580c78
--- /dev/null
+++ b/mlxfwops/lib/aux_tlv_ops.cpp
@@ -0,0 +1,545 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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 <reg_access/reg_access.h>
+
+#include "flint_base.h"
+#include "aux_tlv_ops.h"
+
+/*
+ * ImageTlvOps class implementation
+ */
+
+
+#define AUX_DATA_SIG_SIZE 0x10
+#define SIG3 0x080d1522
+#define SIG2 0x01020305
+#define SIG1 0x6548bc86
+#define SIG0 0x4155583a
+
+bool ImageTlvOps::test()
+{
+    printf("-I- ImageTlvOps Class test");
+    u_int32_t data0[] = {0x12345678, 0xabcdef01, 0xab0dab10, 0xcafaba1a, 0x0cafee1e1, 0x12345678, 0x23456789, 0x3456789a};
+    u_int32_t data1[] = {0x12345678, 0xabcdef01, 0xab0dab1, 0xcafaba1a, 0x0cafee1e1, 0x12345678, 0x23456789, 0x3456789a};
+    u_int8_t data2[] =  {1, 2, 3, 4, 5, 6 ,7 ,8, 9, 0xa};
+    // run init
+    if (!init(true)) {
+        printf("-E- failed on init");
+    }
+    // add all tlvs and update file
+    aux_tlv tlv;
+    memset(&tlv.hdr, 0x0, sizeof(tlv.hdr));
+    tlv.hdr.header_type = 0;
+    tlv.hdr.type = 0;
+    tlv.hdr.length = 0x10;
+    tlv.data.resize(tlv.hdr.length);
+    memcpy(&tlv.data[0], data0, tlv.hdr.length);
+    addTLV(tlv);
+
+    tlv.hdr.header_type = 1;
+    tlv.hdr.type = 0;
+    tlv.hdr.length = 0x3;
+    tlv.data.resize(tlv.hdr.length);
+    memcpy(&tlv.data[0], data1, tlv.hdr.length);
+    addTLV(tlv);
+
+    tlv.hdr.header_type = 0;
+    tlv.hdr.type = 3;
+    tlv.hdr.length = 0xa;
+    tlv.data.resize(tlv.hdr.length);
+    memcpy(&tlv.data[0], data2, tlv.hdr.length);
+    addTLV(tlv);
+
+    if (!updateFile()) {
+        printf("-E- failed to update file\n");
+    }
+    removeTlv(3,0);
+    removeTlv(0,0);
+    removeTlv(0,1);
+
+    if (!updateFile()) {
+        printf("-E- failed to update file\n");
+    }
+    printf("-I- Done Successfully");
+
+    return true;
+}
+
+Tlv_Status_t ImageTlvOps::getFileSize(FILE* fd, long int& fileSize)
+{
+    // Get the file size:
+     if (fseek(fd, 0, SEEK_END) < 0) {
+         fclose(fd);
+         return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_OPEN_FILE, "Can not get file size for \"%s\"", _fname);
+     }
+     fileSize = ftell(fd);
+     if (fileSize < 0) {
+         fclose(fd);
+         return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_OPEN_FILE, "Can not get file size for \"%s\"", _fname);
+     }
+     rewind(fd);
+     return TS_OK;
+}
+
+Tlv_Status_t ImageTlvOps::init(u_int32_t startPos, bool force)
+{
+    if (!force && _initialized) {
+        return TS_OK;
+    }
+    long int fsize;
+    _tlvSectionFound = false;
+    _tlvSectionFilePos = 0;
+    _tlvVec.resize(0);
+
+    if (_fname) {
+        _rawFileBuff.resize(0);
+        FILE* fd = fopen(_fname, "rb");
+        if (!fd) {
+            return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_OPEN_FILE, "Failed to open file of reading");
+        }
+        // get file size
+        if (getFileSize(fd, fsize)) {
+            return TS_FAILED_TO_OPEN_FILE;
+        }
+        // read the file
+        long int readCnt;
+        _rawFileBuff.resize(fsize);
+        if ((readCnt = fread(&_rawFileBuff[0], 1, fsize, fd)) != fsize) {
+            fclose(fd);
+            if (readCnt < 0) {
+                return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_READ_FILE, "Read error on file \"%s\"",_fname);
+            } else {
+                return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_READ_FILE, "Read error on file \"%s\" - read only %ld bytes (from %ld)",
+                              _fname, readCnt, (unsigned long)fsize);
+            }
+        }
+        fclose(fd);
+    }
+    fsize = _rawFileBuff.size();
+    for (long int i = startPos; i < fsize; i += 4) {
+        std::vector<u_int8_t> possibleSig(_rawFileBuff.begin() + i , _rawFileBuff.begin() + i + 16);
+        TOCPUn(&possibleSig[0], 4);
+        if (checkSig(possibleSig)) {
+            _tlvSectionFound = true;
+            _tlvSectionFilePos = i;
+        }
+    }
+    if (_tlvSectionFound) {
+        // parse TLVs
+        return parseTlvs();
+    }
+    _initialized = true;
+    return TS_OK;
+
+}
+
+Tlv_Status_t ImageTlvOps::resetTlvSection()
+{
+    if (_tlvSectionFound) {
+        _tlvVec.resize(0);
+        return updateFile();
+    }
+    return TS_OK;
+}
+
+void ImageTlvOps::addTLV(aux_tlv& tlv)
+{
+    // remove it if its present then push back
+    removeTlv(tlv.hdr.type, tlv.hdr.header_type);
+    // calc tlv CRC
+    tlv.hdr.crc = calcTlvCrc(tlv);
+    _tlvVec.push_back(tlv);
+    return;
+}
+
+Tlv_Status_t ImageTlvOps::removeTlv(u_int16_t tlvType, u_int8_t headerType)
+{
+    for(std::vector<aux_tlv>::iterator it = _tlvVec.begin(); it != _tlvVec.end(); it++) {
+        if (it->hdr.header_type == headerType && it->hdr.type == tlvType) {
+            _tlvVec.erase(it);
+            return TS_OK;
+        }
+    }
+    return (Tlv_Status_t)errmsgWCode(TS_TLV_NOT_FOUND, "TLV(0x%x) with type(0x%x) not found", tlvType, headerType);
+}
+
+Tlv_Status_t ImageTlvOps::queryTlv(u_int16_t tlvType, u_int8_t headerType, aux_tlv& tlv)
+{
+    for(std::vector<aux_tlv>::iterator it = _tlvVec.begin(); it != _tlvVec.end(); it++) {
+        if (it->hdr.header_type == headerType && it->hdr.type == tlvType) {
+            tlv = *it;
+            return TS_OK;
+        }
+    }
+    return (Tlv_Status_t)errmsgWCode(TS_TLV_NOT_FOUND, "TLV(0x%x) with type(0x%x) not found", tlvType, headerType);
+}
+
+std::vector<aux_tlv> ImageTlvOps::queryTlvs()
+{
+    return _tlvVec;
+}
+
+bool ImageTlvOps::checkSig(std::vector<u_int8_t>& signature)
+{
+    u_int32_t * sigPtr = (u_int32_t*)&signature[0];
+    return  *(sigPtr + 3)  == SIG3 && \
+            *(sigPtr + 2) == SIG2 && \
+            *(sigPtr + 1) == SIG1 && \
+            *(sigPtr) == SIG0;
+}
+
+Tlv_Status_t ImageTlvOps::updateFile()
+{
+    std::vector<u_int32_t> signature(4, 0x0);
+    signature[3] = SIG3;
+    signature[2] = SIG2;
+    signature[1] = SIG1;
+    signature[0] = SIG0;
+
+    if (_readOnly) {
+        return (Tlv_Status_t)errmsgWCode(TS_READ_ONLY_MODE, "Image TLV object is read only.");
+    }
+    if (!_tlvSectionFound && _tlvVec.size() == 0) { // no tlv section and no tlvs
+        // nothing to do
+        return TS_OK;
+    } else if (_tlvSectionFound && _tlvVec.size() == 0) { // tlv section without tlvs
+        // remove signature from file
+        _rawFileBuff.resize(_tlvSectionFilePos);
+        _tlvSectionFilePos = 0;
+        _tlvSectionFound = false;
+    } else if (!_tlvSectionFound && _tlvVec.size() != 0) { // no tlv section with tlvs
+        // add signature and TLVs
+        TOCPUn(&signature[0], 4);
+        _tlvSectionFound = true;
+        _tlvSectionFilePos = _rawFileBuff.size();
+        for (unsigned int i =0; i < signature.size() << 2 ; i++) {
+            _rawFileBuff.push_back(*(((u_int8_t*)&signature[0]) + i));
+        }
+        pushTlvsToRawBuffer();
+    } else {
+        _rawFileBuff.resize(_tlvSectionFilePos + AUX_DATA_SIG_SIZE);
+        pushTlvsToRawBuffer();
+    }
+    return writeBufferAsFile();
+}
+
+Tlv_Status_t ImageTlvOps::writeBufferAsFile()
+{
+    if (_tlvVec.size()) {
+        // push end marker
+        std::vector<u_int8_t> endMarker(TOOLS_OPEN_AUX_TLV_HEADER_SIZE, 0xff);
+        _rawFileBuff.insert(_rawFileBuff.end(), endMarker.begin(), endMarker.end());
+    }
+    // TODO: check the need to : write the file under a different name then delete original and rename
+    FILE* fd = fopen(_fname, "wb");
+    if (!fd) {
+        return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_OPEN_FILE, "Failed to open file for writing: %s", _fname);
+    }
+    int cnt = fwrite(&_rawFileBuff[0], 1, _rawFileBuff.size(), fd);
+    fclose(fd);
+    if (cnt != (int)_rawFileBuff.size()) {
+        return (Tlv_Status_t)errmsgWCode(TS_FAILED_TO_WRITE_FILE, "Failed to re-write file: %s", _fname);
+    }
+    return TS_OK;
+}
+
+void ImageTlvOps::pushTlvsToRawBuffer()
+{
+    // called from updateFile. assuming raw data already contains signature.
+    if (_tlvVec.size() != 0) {
+        std::vector<u_int8_t> tlvBuffer;
+        tlvBuffer.resize(0);
+        for (std::vector<aux_tlv>::iterator it = _tlvVec.begin(); it != _tlvVec.end(); it ++) {
+            // push header
+            std::vector<u_int8_t> hdrBuf(TOOLS_OPEN_AUX_TLV_HEADER_SIZE, 0x0);
+            tools_open_aux_tlv_header_pack(&(it->hdr), &hdrBuf[0]);
+            tlvBuffer.insert(tlvBuffer.end(), hdrBuf.begin(), hdrBuf.end());
+            // push data
+            tlvBuffer.insert(tlvBuffer.end(), it->data.begin(), it->data.end());
+            // pad to DW aligned address with 0x0 if needed
+            if (it->data.size() & 3) {
+                std::vector<u_int8_t> padding(4 - (it->data.size() & 3), 0x0);
+                tlvBuffer.insert(tlvBuffer.end(), padding.begin(), padding.end());
+            }
+        }
+        // update raw buffer and write the file
+        _rawFileBuff.insert(_rawFileBuff.end(), tlvBuffer.begin(), tlvBuffer.end());
+    }
+    return;
+}
+
+Tlv_Status_t ImageTlvOps::parseTlvs()
+{
+    if(!_tlvSectionFound) {
+        // nothing to parse
+        return TS_OK;
+    }
+
+    if (!_tlvSectionFilePos) {
+        return (Tlv_Status_t)errmsgWCode(TS_GENERAL_ERROR, "Internal Error. unexpected file position.");
+    }
+
+    // while not end TLV or EOF
+    u_int32_t nextTlvOffs = _tlvSectionFilePos + AUX_DATA_SIG_SIZE;
+    u_int32_t bufferSize = (u_int32_t)_rawFileBuff.size();
+    do {
+        aux_tlv tlv;
+        // read next TLV header
+        if (nextTlvOffs == bufferSize) {
+            return (Tlv_Status_t)errmsgWCode(TS_TLV_PARSE_ERROR, "failed to parse TLVs : expected to find End marker before end of file");
+        }
+        if (nextTlvOffs + TOOLS_OPEN_AUX_TLV_HEADER_SIZE > bufferSize) {
+            return (Tlv_Status_t)errmsgWCode(TS_TLV_PARSE_ERROR, "failed to parse TLVs : unexpected End of extended data section");
+        }
+        u_int8_t hdrBuf[TOOLS_OPEN_AUX_TLV_HEADER_SIZE] = {0};
+        memcpy(hdrBuf, &_rawFileBuff[nextTlvOffs], TOOLS_OPEN_AUX_TLV_HEADER_SIZE);
+        tools_open_aux_tlv_header_unpack(&tlv.hdr, hdrBuf);
+        // check for END TLV
+        if (tlv.hdr.header_type == 0xf && tlv.hdr.type == 0xff) {
+            break;
+        }
+        // read next TLV data
+        if (nextTlvOffs + TOOLS_OPEN_AUX_TLV_HEADER_SIZE + tlv.hdr.length  > bufferSize) {
+            return (Tlv_Status_t)errmsgWCode(TS_TLV_PARSE_ERROR, "failed to parse TLVs : unexpected End of extended data section");
+        }
+        u_int32_t vecSizeDwAligned = ((tlv.hdr.length + 3) /4) * 4;
+        tlv.data.resize(tlv.hdr.length);
+        memset(&tlv.data[0], 0x0, tlv.data.size());
+        memcpy(&tlv.data[0], &_rawFileBuff[nextTlvOffs + TOOLS_OPEN_AUX_TLV_HEADER_SIZE], tlv.hdr.length);
+        if (tlv.hdr.header_type == 0x0) { // only know how to deal with header of type 0x0
+            // check CRC and store
+            if (tlv.hdr.crc != calcTlvCrc(tlv)) {
+                return (Tlv_Status_t)errmsgWCode(TS_TLV_CRC_MISSMATCH, "Failed to parse TLVs, CRC missmatch for TLV type 0x%x", tlv.hdr.type);
+            }
+            // store it
+            _tlvVec.push_back(tlv);
+        }
+        // next TLV is located at the first DW aligned offset after the current TLV
+        nextTlvOffs += (TOOLS_OPEN_AUX_TLV_HEADER_SIZE + vecSizeDwAligned);
+    } while (true);
+    return TS_OK;
+}
+
+u_int16_t ImageTlvOps::calcTlvCrc(aux_tlv& tlv)
+{
+    struct tools_open_aux_tlv_header tempHdr;
+    u_int32_t dataSize = (u_int32_t)tlv.data.size();
+    Crc16 crc;
+    tempHdr = tlv.hdr;
+    tempHdr.crc = 0xffff;
+    u_int8_t tlvHdrBuf[TOOLS_OPEN_AUX_TLV_HEADER_SIZE] = {0};
+    tools_open_aux_tlv_header_pack(&tempHdr, tlvHdrBuf);
+    // restore CPU endianess
+    TOCPUn(tlvHdrBuf, TOOLS_OPEN_AUX_TLV_HEADER_SIZE >> 2);
+    // calc crc on modified header
+    CRCn(crc, tlvHdrBuf, TOOLS_OPEN_AUX_TLV_HEADER_SIZE >> 2);
+    // calc crc on the data
+    TOCPUn(&tlv.data[0], dataSize >> 2);
+    CRCn(crc, &tlv.data[0], dataSize >> 2);
+    // we might have missed the last DW as it need not be DW aligned
+    u_int32_t remaining = dataSize & 3;
+    if (remaining) {
+        u_int32_t lastDw = 0x0;
+        memcpy(&lastDw, &tlv.data[dataSize - remaining], remaining);
+        crc << lastDw;
+    }
+    TOCPUn(&tlv.data[0], dataSize >> 2);
+    crc.finish();
+    return crc.get();
+}
+
+
+/*
+ * TimeStampIFC class implementation
+ */
+
+
+TimeStampIFC* TimeStampIFC::getIFC(mfile* mf)
+{
+    return new DeviceTimeStamp(mf);
+}
+
+TimeStampIFC* TimeStampIFC::getIFC(const char* fname, u_int32_t lastFwAddr)
+{
+    return new ImageTimeStamp(fname, lastFwAddr);
+}
+
+TimeStampIFC* TimeStampIFC::getIFC(u_int8_t* buff, unsigned int size, u_int32_t lastFwAddr)
+{
+    return new ImageTimeStamp(buff, size, lastFwAddr);
+}
+
+
+/*
+ * ImageTimeStamp class implementation
+ */
+
+Tlv_Status_t ImageTimeStamp::init()
+{
+    Tlv_Status_t rc = _imgTlvOps.init(_lastFwAddr);
+    return  rc ? (Tlv_Status_t)errmsgWCode(rc, "%s", _imgTlvOps.err()) : TS_OK;
+};
+
+Tlv_Status_t ImageTimeStamp::setTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer)
+{
+    aux_tlv tsTlv;
+    memset(&tsTlv, 0, sizeof(tsTlv));
+    tsTlv.hdr.header_type = ImageTimeStamp::TS_Header_Type;
+    tsTlv.hdr.type = ImageTimeStamp::TS_Tlv_Type;
+    tsTlv.hdr.length = TOOLS_OPEN_TIMESTAMP_SIZE;
+    tsTlv.data.resize(tsTlv.hdr.length);
+    memset(&tsTlv.data[0], 0, tsTlv.hdr.length);
+    struct tools_open_timestamp tsData;
+    tsData.fw_version = fwVer;
+    tsData.ts_entry = timestamp;
+    tools_open_timestamp_pack(&tsData, &tsTlv.data[0]);
+    _imgTlvOps.addTLV(tsTlv);
+    bool rc = _imgTlvOps.updateFile();
+    if (!rc) {
+        return (Tlv_Status_t)errmsgWCode(rc, "%s", _imgTlvOps.err());
+    }
+    return TS_OK;
+}
+
+Tlv_Status_t ImageTimeStamp::queryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning)
+{
+    (void)queryRunning;
+    aux_tlv tsTlv;
+    struct tools_open_timestamp tsData;
+    memset(&tsTlv, 0, sizeof(tsTlv));
+    Tlv_Status_t rc = _imgTlvOps.queryTlv(ImageTimeStamp::TS_Tlv_Type, ImageTimeStamp::TS_Header_Type, tsTlv);
+    if (rc) {
+        return (Tlv_Status_t)errmsgWCode(rc, "Failed to query timestamp, Data not found in image");
+    }
+    if (tsTlv.hdr.major_version != 0) {
+        return (Tlv_Status_t)errmsgWCode(TS_UNKNOWN_TLV_VERSION, "Failed to query timestamp, Unknown timestamp TLV version");
+    }
+    tools_open_timestamp_unpack(&tsData, &tsTlv.data[0]);
+    timestamp = tsData.ts_entry;
+    fwVer = tsData.fw_version;
+    return TS_OK;
+}
+Tlv_Status_t ImageTimeStamp::resetTimeStamp()
+{
+    Tlv_Status_t rc = _imgTlvOps.removeTlv(ImageTimeStamp::TS_Tlv_Type, ImageTimeStamp::TS_Header_Type);
+    if (rc == TS_OK) {
+        Tlv_Status_t rc = _imgTlvOps.updateFile();
+        if (!rc) {
+            return (Tlv_Status_t)errmsgWCode(rc, "Failed to reset Timestamp on image, %s", _imgTlvOps.err());
+        }
+    }
+    return TS_OK;
+}
+
+/*
+ * DeviceTimeStamp class implementation
+ */
+
+Tlv_Status_t DeviceTimeStamp::init()
+{
+    int rc ;
+    // attempt to get running FW TS
+    struct tools_open_mvts mvts;
+    memset(&mvts, 0, sizeof(mvts));
+    mvts.running_flag = 1;
+    rc = reg_access_mvts(_mf, REG_ACCESS_METHOD_GET, &mvts);
+    if (rc == ME_OK || rc == ME_REG_ACCESS_BAD_CONFIG) {
+        return TS_OK;
+    }
+    return (Tlv_Status_t)errmsgWCode(TS_TIMESTAMPING_NOT_SUPPORTED, "Time stamping not supported by FW");
+}
+
+
+Tlv_Status_t DeviceTimeStamp::setTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer)
+{
+    struct tools_open_mvts mvts;
+    memset(&mvts, 0, sizeof(mvts));
+    mvts.timestamp.fw_version = fwVer;
+    mvts.timestamp.ts_entry = timestamp;
+    int rc = reg_access_mvts(_mf, REG_ACCESS_METHOD_SET, &mvts);
+    rc = (int)convertRc((MError)rc, REG_ACCESS_METHOD_SET);
+    if (rc) {
+        return (Tlv_Status_t)errmsgWCode(rc, "Failed to set timestamp on device, %s", err());
+    }
+    return TS_OK;
+}
+
+
+Tlv_Status_t DeviceTimeStamp::queryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning)
+{
+    struct tools_open_mvts mvts;
+    memset(&mvts, 0, sizeof(mvts));
+    mvts.running_flag = queryRunning;
+    int rc = reg_access_mvts(_mf, REG_ACCESS_METHOD_GET, &mvts);
+    rc = (int)convertRc((MError)rc, REG_ACCESS_METHOD_GET);
+    if (rc) {
+        return (Tlv_Status_t)errmsgWCode(rc, "Failed to query %s timestamp on device, %s\n", queryRunning ? "current" : "next", err());
+    }
+    // if timestamp and fw ver are zero entry is invalid
+    struct tools_open_timestamp timestampZeroes;
+    memset(&timestampZeroes, 0x0, sizeof(timestampZeroes));
+    if (!memcmp(&(mvts.timestamp), &timestampZeroes, sizeof(mvts.timestamp))) {
+        return (Tlv_Status_t)errmsgWCode(TS_NO_VALID_TIMESTAMP, "Failed to query %s timestamp, No valid timestamp found", queryRunning ? "current" : "next");
+    }
+    fwVer = mvts.timestamp.fw_version;
+    timestamp = mvts.timestamp.ts_entry;
+    return TS_OK;
+}
+
+Tlv_Status_t DeviceTimeStamp::resetTimeStamp()
+{
+    struct tools_open_mvts mvts;
+    memset(&mvts, 0, sizeof(mvts));
+    mvts.clear_all_ts_flag = 1;
+    int rc = reg_access_mvts(_mf, REG_ACCESS_METHOD_SET, &mvts);
+    rc = (int)convertRc((MError)rc, REG_ACCESS_METHOD_SET);
+    if (rc) { // bad params means command not supported
+        return (Tlv_Status_t)errmsgWCode(rc, "Failed to reset timestamp on device, %s", rc == ME_REG_ACCESS_BAD_CONFIG ? "Bad configuration" : err());
+    }
+    return TS_OK;
+}
+
+inline Tlv_Status_t DeviceTimeStamp::convertRc(MError rc, int regMethod)
+{
+    if (rc == ME_OK) {
+        return TS_OK;
+    }
+    if (rc == ME_REG_ACCESS_BAD_PARAM || rc == ME_ICMD_OPERATIONAL_ERROR) {
+         return (Tlv_Status_t)errmsgWCode(TS_TIMESTAMPING_NOT_SUPPORTED, "Time stamping not supported by FW");
+    } else if (rc == ME_REG_ACCESS_BAD_CONFIG) {
+        return (Tlv_Status_t)errmsgWCode(TS_NO_VALID_TIMESTAMP, regMethod == REG_ACCESS_METHOD_GET ? "No valid timestamp found" : "Timestamp is too old");
+    } else if (rc == ME_ICMD_UNSUPPORTED_ICMD_VERSION) {
+         return(Tlv_Status_t)errmsgWCode(TS_UNSUPPORTED_ICMD_VERSION, "Unsupported ICMD version");
+    }
+    return (Tlv_Status_t)errmsgWCode(TS_GENERAL_ERROR, "%s",  reg_access_err2str((MError)rc));
+}
diff --git a/mlxfwops/lib/aux_tlv_ops.h b/mlxfwops/lib/aux_tlv_ops.h
new file mode 100644
index 0000000..e139d20
--- /dev/null
+++ b/mlxfwops/lib/aux_tlv_ops.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+#ifndef AUX_TLV_OPS_H
+#define AUX_TLV_OPS_H
+
+#include <mtcr.h>
+#include <tools_layouts/tools_open_layouts.h>
+#include <tools_layouts/register_access_open_layouts.h>
+
+typedef enum {
+    TS_OK = 0,
+    TS_GENERAL_ERROR,
+    // device related errors
+    TS_TIMESTAMPING_NOT_SUPPORTED,
+    TS_NO_VALID_TIMESTAMP,
+    TS_OLD_TIMESTAMP,
+    TS_UNSUPPORTED_ICMD_VERSION,
+    // image related errors,
+    TS_TLV_CRC_MISSMATCH,
+    TS_TLV_PARSE_ERROR,
+    TS_NO_TLV_SECTION_FOUND,
+    TS_FAILED_TO_OPEN_FILE,
+    TS_FAILED_TO_WRITE_FILE,
+    TS_FAILED_TO_READ_FILE,
+    TS_TLV_NOT_FOUND,
+    TS_READ_ONLY_MODE,
+    TS_HANDLE_NOT_SUPPORTED,
+    TS_UNKNOWN_TLV_VERSION,
+} Tlv_Status_t;
+
+typedef struct aux_tlv {
+    struct tools_open_aux_tlv_header hdr;
+    std::vector<u_int8_t> data;  // data in big endian
+} aux_tlv_t;
+
+
+class ImageTlvOps : public FlintErrMsg
+{
+public:
+    ImageTlvOps(const char* fname, bool readOnly=false) : FlintErrMsg() , _fname(fname), _tlvSectionFound(false),
+                                                          _tlvSectionFilePos(0), _initialized(false),
+                                                          _readOnly(readOnly){}
+    ImageTlvOps(u_int8_t* buf, unsigned int size) : FlintErrMsg() , _fname((const char*)NULL),
+                                                    _tlvSectionFound(false), _tlvSectionFilePos(0),
+                                                    _initialized(false), _readOnly(true)
+                                                    {
+                                                        if (!buf) {
+                                                            // Adrianc: should not be reached, consider using exceptions
+                                                            _rawFileBuff.resize(0);
+                                                        } else {
+                                                            _rawFileBuff.resize(size);
+                                                            memcpy(&_rawFileBuff[0], buf, size);
+                                                        }
+                                                    }
+    ~ImageTlvOps() {}
+
+    Tlv_Status_t init(u_int32_t startPos, bool force=false);
+    void addTLV(aux_tlv& tlv);
+    Tlv_Status_t removeTlv(u_int16_t tlvType, u_int8_t headerType=0);
+    std::vector<aux_tlv> queryTlvs();
+    Tlv_Status_t queryTlv(u_int16_t tlvType, u_int8_t headerType, aux_tlv& tlv);
+    Tlv_Status_t resetTlvSection();
+    Tlv_Status_t updateFile();
+    bool test(); // test method
+private:
+    void pushTlvsToRawBuffer();
+    Tlv_Status_t getFileSize(FILE* fd, long int& fileSize);
+    Tlv_Status_t writeBufferAsFile();
+    Tlv_Status_t parseTlvs();
+    u_int16_t calcTlvCrc(aux_tlv& tlv);
+    bool checkSig(std::vector<u_int8_t>& signature);
+
+    const char* _fname;
+    bool _tlvSectionFound;
+    u_int32_t _tlvSectionFilePos;
+    bool _initialized;
+    bool _readOnly;
+    std::vector<aux_tlv> _tlvVec;
+    std::vector<u_int8_t> _rawFileBuff;
+};
+
+
+class TimeStampIFC : public FlintErrMsg
+{
+public:
+    TimeStampIFC() : FlintErrMsg() {};
+    virtual ~TimeStampIFC(){};
+    static TimeStampIFC* getIFC(mfile* mf);
+    static TimeStampIFC* getIFC(const char* fname, u_int32_t lastFWAddr=0);
+    static TimeStampIFC* getIFC(u_int8_t* buff, unsigned int size,u_int32_t lastFwAddr=0);
+    virtual Tlv_Status_t init() {return TS_OK;};
+    virtual Tlv_Status_t setTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer) = 0;
+    virtual Tlv_Status_t queryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning=false) = 0;
+    virtual Tlv_Status_t resetTimeStamp() = 0;
+};
+
+
+class ImageTimeStamp : public TimeStampIFC
+{
+public:
+    ImageTimeStamp(const char* fname, u_int32_t lastFwAddr) : TimeStampIFC(), _lastFwAddr(lastFwAddr), _imgTlvOps(fname) {};
+    ImageTimeStamp(u_int8_t* buf, unsigned int size, u_int32_t lastFwAddr) : TimeStampIFC(), _lastFwAddr(lastFwAddr), _imgTlvOps(buf, size) {};
+    ~ImageTimeStamp() {};
+    virtual Tlv_Status_t init();
+
+    virtual Tlv_Status_t setTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer);
+    virtual Tlv_Status_t queryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning=false);
+    virtual Tlv_Status_t resetTimeStamp();
+private:
+    enum {
+        TS_Header_Type = 0x0,
+        TS_Tlv_Type = 0x1,
+    };
+    u_int32_t _lastFwAddr;
+    ImageTlvOps _imgTlvOps;
+};
+
+
+class DeviceTimeStamp : public TimeStampIFC
+{
+public:
+    DeviceTimeStamp(mfile* mf) : TimeStampIFC(), _mf(mf) {};
+    ~DeviceTimeStamp() {};
+    virtual Tlv_Status_t init();
+
+    virtual Tlv_Status_t setTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer);
+    virtual Tlv_Status_t queryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning=false);
+    virtual Tlv_Status_t resetTimeStamp();
+private:
+    inline Tlv_Status_t convertRc(MError rc, int regMethod );
+    mfile* _mf;
+};
+
+
+#endif
diff --git a/mlxfwops/lib/flint_base.cpp b/mlxfwops/lib/flint_base.cpp
index 9546574..578f407 100755
--- a/mlxfwops/lib/flint_base.cpp
+++ b/mlxfwops/lib/flint_base.cpp
@@ -41,7 +41,7 @@
 
 
 
-void ErrMsg::err_clear(){
+void FlintErrMsg::err_clear(){
     delete [] _err;
     _err = 0;
 }
@@ -159,7 +159,7 @@ void report_warn(const char *format, ...)
 #endif
 }
 
-bool ErrMsg::errmsg(const char *format, ...) {
+bool FlintErrMsg::errmsg(const char *format, ...) {
     va_list   args;
 
     char* prev_err = _err;
@@ -173,7 +173,7 @@ bool ErrMsg::errmsg(const char *format, ...) {
     return false;
 }
 
-bool ErrMsg::errmsg(int errorCode, const char *format, ...) {
+bool FlintErrMsg::errmsg(int errorCode, const char *format, ...) {
     va_list   args;
 
     char* prev_err = _err;
@@ -187,7 +187,7 @@ bool ErrMsg::errmsg(int errorCode, const char *format, ...) {
     return false;
 }
 
-bool ErrMsg::errmsgAdv(bool showAdv, const char *normalFmt, const char *AdvFmt, ...) {
+bool FlintErrMsg::errmsgAdv(bool showAdv, const char *normalFmt, const char *AdvFmt, ...) {
 	// args should only apply to advanced format (i.e normalFmt does not contain %<char>)
     va_list   args;
     char errFmt[1024];
@@ -211,6 +211,19 @@ bool ErrMsg::errmsgAdv(bool showAdv, const char *normalFmt, const char *AdvFmt,
     return false;
 }
 
+int FlintErrMsg::errmsgWCode(int errorCode, const char *format, ...) {
+    va_list   args;
+
+    char* prev_err = _err;
+
+    va_start(args, format);
+    _err = vprint(format, args);
+    va_end(args);
+
+    delete[] prev_err;
+    _errCode = errorCode;
+    return errorCode;
+}
 
 ////////////////////////////////////////////////////////////////////////
 void Crc16::add(u_int32_t o)
diff --git a/mlxfwops/lib/flint_base.h b/mlxfwops/lib/flint_base.h
index 4c7f34a..cb39c14 100755
--- a/mlxfwops/lib/flint_base.h
+++ b/mlxfwops/lib/flint_base.h
@@ -46,6 +46,10 @@
     #include "uefi_c.h"
 #endif
 
+#if defined __FreeBSD__
+    #include <stdarg.h>
+#endif
+
 #include <signal.h>
 #include "tools_version.h"
 
@@ -182,32 +186,36 @@ namespace std {}; using namespace std;
 		return false; }} while (0)
 #define READBUF(f,o,d,l,p) do { if (!f.read(o,d,l)) { \
     return errmsg("%s - read error (%s)\n", p, f.err()); }} while (0)
+#define READALLOCBUF(f,o,d,l,p) do {\
+    d = (u_int8_t*) malloc(sizeof(u_int8_t) * l);\
+    if (!f.read(o,d,l)) { \
+        free(d);\
+        return errmsg("%s - read error (%s)\n", p, f.err());\
+    }\
+} while (0)
 
 #define FS2_BOOT_START   0x38
 #define FS_DATA_OFF      0x28
 #define SWITCHX_HW_ID    581
 #define SWITCH_IB_HW_ID  583
-#define SPECTRUM_HW_ID  585
+#define SPECTRUM_HW_ID   585
+#define SWITCH_IB2_HW_ID 587
+
 
 #define CX4_HW_ID         521
 #define CX4LX_HW_ID       523
+#define CX5_HW_ID         525
+#define CX2_HW_ID         400
 #define CX3_HW_ID         501
 #define CX3_PRO_HW_ID     503
-#define CX_HW_ID          400
-#define IS_HW_ID          435
-#define CONNECT_IB_HW_ID  511
-#define BRIDGEX_HW_ID     6100
 #define IS4_HW_ID         435
-#define INFINIHOST_HW_ID            23108
-#define INFINIHOST_III_EX_HW_ID     25208
-#define INFINIHOST_III_LX_HW_ID     25204
+#define CONNECT_IB_HW_ID  511
 #define CONNECT_IB_SW_ID  4113
 
 // FS3 defines
 #define FS3_BOOT_START        FS2_BOOT_START
 #define FS3_BOOT_START_IN_DW  FS3_BOOT_START/4
 
-
 #define CRC_CHECK_OLD "%s /0x%08x-0x%08x (0x%06x)/ (%s"
 
 #define MAX_NUM_SUPP_HW_IDS 200
@@ -296,11 +304,13 @@ typedef enum fs3_section {
     FS3_NV_DATA2      = 0xe4,
     FS3_FW_NV_LOG     = 0xe5,
     FS3_NV_DATA0      = 0xe6, // replaces FS3_NV_DATA1
+    FS4_HW_PTR        = 0xfb,
+    FS4_TOOLS_AREA    = 0xfc,
     FS3_ITOC          = 0xfd,
+    FS3_DTOC          = 0xfe,
     FS3_END           = 0xff,
 } fs3_section_t;
 
-
 enum CommandType {
     CMD_UNKNOWN,
     CMD_BURN,
@@ -374,10 +384,10 @@ void report_repair_msg(const char* common_msg);
 //                  BASE CLASSES
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-class MLXFWOP_API ErrMsg {
+class MLXFWOP_API FlintErrMsg {
 public:
-    ErrMsg() : _err(0), _errCode(0){}
-    ~ErrMsg()                { err_clear();}
+    FlintErrMsg() : _err(0), _errCode(0){}
+    ~FlintErrMsg()                { err_clear();}
     const char *err() const  { return _err;}
     void err_clear();
     int getErrorCode() {return _errCode;}
@@ -421,6 +431,12 @@ protected:
 #endif
     ;
 
+    int errmsgWCode(int errorCode, const char *format, ...)
+#ifdef __GNUC__
+    __attribute__ ((format (printf, 3, 4)))
+#endif
+    ;
+
 private:
 
     char       *_err;
diff --git a/mlxfwops/lib/flint_io.cpp b/mlxfwops/lib/flint_io.cpp
index 5cb77c5..db5b9ec 100755
--- a/mlxfwops/lib/flint_io.cpp
+++ b/mlxfwops/lib/flint_io.cpp
@@ -62,9 +62,7 @@ bool FImage::open(const char *fname, bool read_only, bool advErr)
 {
 
 #ifndef UEFI_BUILD
-//#ifndef 1
     int                fsize;
-    int                r_cnt;
     FILE              *fh;
 
     (void)read_only;  // FImage can be opened only for read so we ignore compiler warnings
@@ -96,18 +94,9 @@ bool FImage::open(const char *fname, bool read_only, bool advErr)
                       fname);
     }
 
-    _buf = new u_int32_t[fsize/4];
-    if ((r_cnt = fread(_buf, 1, fsize, fh)) != fsize) {
-        fclose(fh);
-        if (r_cnt < 0) {
-            return errmsg("Read error on file \"%s\" - %s",fname, strerror(errno));
-        } else {
-            return errmsg("Read error on file \"%s\" - read only %d bytes (from %ld)",
-                          fname, r_cnt, (unsigned long)fsize);
-        }
-    }
-
+    _fname = fname;
     _len = fsize;
+    _isFile = true;
     fclose(fh);
     return true;
 #else
@@ -130,6 +119,44 @@ void FImage::close()
     _buf = 0;
 } // FImage::close
 
+/////////////////////////////////////////////////////////////////////////
+u_int32_t* FImage::getBuf()
+{
+    if (_isFile) {
+        // Read the entire file on demand
+        FILE* fh = fopen(_fname, "rb");
+        int r_cnt;
+        u_int32_t* retBuf;
+        if (!fh) {
+            errmsg("Can not open file \"%s\" - %s", _fname, strerror(errno));
+            return (u_int32_t*)NULL;
+        }
+        _buf = new u_int32_t[_len/4];
+        if ((r_cnt = fread(_buf, 1, _len, fh)) != (int)_len) {
+            if (r_cnt < 0) {
+                errmsg("Read error on file \"%s\" - %s",_fname, strerror(errno));
+                retBuf = (u_int32_t*)NULL;
+                goto cleanup;
+            } else {
+                errmsg("Read error on file \"%s\" - read only %d bytes (from %ld)",
+                        _fname, r_cnt, (unsigned long)_len);
+                retBuf = (u_int32_t*)NULL;
+                goto cleanup;
+            }
+        }
+        _isFile = false;
+        retBuf = _buf;
+    cleanup:
+        fclose(fh);
+        if (!retBuf) {
+            delete[] _buf;
+        }
+        return retBuf;
+    } else {
+        return _buf;
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////
 bool FImage::read(u_int32_t addr, u_int32_t *data)
 {
@@ -146,7 +173,7 @@ bool FImage::read(u_int32_t addr, void *data, int len, bool, const char*)
     if (len & 0x3) {
         return errmsg("Length should be 4-bytes aligned.");
     }
-    if (!_buf) {
+    if (!_isFile && !_buf) {
         return errmsg("read() when not opened");
     }
 
@@ -164,10 +191,22 @@ bool FImage::read(u_int32_t addr, void *data, int len, bool, const char*)
     align.Init (addr, len);
     while (align.GetNextChunk(chunk_addr, chunk_size)) {
         u_int32_t phys_addr = cont2phys(chunk_addr);
-
-        memcpy((u_int8_t*)data + (chunk_addr - addr),
+        if (_isFile) {
+            FILE* fh = fopen(_fname, "rb");
+            if (!fh) {
+                return errmsg("Can not open file \"%s\" - %s", _fname, strerror(errno));
+            }
+            fseek(fh, phys_addr, SEEK_SET);
+            if (fread((u_int8_t*)data + (chunk_addr - addr), chunk_size, 1, fh) != 1) {
+                fclose(fh);
+                return errmsg("Failed to read from FW file, offset: %#x - %s", phys_addr, strerror(errno));
+            }
+            fclose(fh);
+        } else {
+            memcpy((u_int8_t*)data + (chunk_addr - addr),
                (u_int8_t*)_buf +  phys_addr,
                chunk_size);
+        }
     }
 
     return true;
@@ -217,7 +256,7 @@ bool Flash::open_com_checks(const char *device, int rc, bool force_lock)
 
     if (rc != MFE_OK) {
         if (rc == MFE_SEM_LOCKED) {
-            return errmsgAdv(_advErrors, "Can not obtain Flash semaphore (63).", "You can run \"flint -clear_semaphore -d <device>\" to force semaphore unlock. See help for details.");
+            return errmsgAdv(_advErrors, "Can not obtain Flash semaphore.", "You can run \"flint -clear_semaphore -d <device>\" to force semaphore unlock. See help for details.");
         }
         if (rc == MFE_LOCKED_CRSPACE) {
             _cr_space_locked = 1;
@@ -237,6 +276,7 @@ bool Flash::open_com_checks(const char *device, int rc, bool force_lock)
     if (rc != MFE_OK) {
         return errmsg("Failed getting flash attributes for device %s: %s", device,  mf_err2str(rc));
     }
+    _curr_sector_size = _attr.sector_size;
 
     rc = mf_set_opt(_mfl, MFO_NO_VERIFY, _no_flash_verify? 1: 0);
     if (rc != MFE_OK) {
@@ -244,10 +284,8 @@ bool Flash::open_com_checks(const char *device, int rc, bool force_lock)
     }
 
 
-    if (_attr.hw_dev_id == 435 || _attr.hw_dev_id == SWITCHX_HW_ID) {
+    if (_attr.hw_dev_id == IS4_HW_ID || _attr.hw_dev_id == SWITCHX_HW_ID) {
         _port_num = 0;
-    } else if (_attr.hw_dev_id == 25204 || _attr.hw_dev_id == 24204) {
-        _port_num = 1;
     } else {
         _port_num = 2;
     }
@@ -255,15 +293,14 @@ bool Flash::open_com_checks(const char *device, int rc, bool force_lock)
 }
 
 bool Flash::set_no_flash_verify(bool val) {
-
-	_no_flash_verify = val;
-	int rc;
-	if (_mfl) {
-		rc = mf_set_opt(_mfl, MFO_NO_VERIFY, val? 1: 0);
-		if (rc != MFE_OK) {
-			return errmsg("Failed setting no flash verify on device: %s", mf_err2str(rc));
-			}
-	}
+    int rc;
+    if (_mfl) {
+        rc = mf_set_opt(_mfl, MFO_NO_VERIFY, val? 1: 0);
+        if (rc != MFE_OK) {
+            return errmsg("Failed setting no flash verify on device: %s", mf_err2str(rc));
+            }
+    }
+    _no_flash_verify = val;
     return true;
 }
 
@@ -423,9 +460,23 @@ bool Flash::write_phy(u_int32_t phy_addr, void* data, int cnt, bool noerase)
 {
     // Avoid warning
     (void)noerase;
+    NATIVE_PHY_ADDR_FUNC(write, (phy_addr, data, cnt));
+}
+
+bool Flash::read_modify_write_phy(u_int32_t phy_addr, void* data, int cnt, bool noerase)
+{
+    // Avoid warning
+    (void)noerase;
     NATIVE_PHY_ADDR_FUNC(write_with_erase, (phy_addr, data, cnt));
 }
 
+bool Flash::read_modify_write(u_int32_t phy_addr, void* data, int cnt, bool noerase)
+{
+    // Avoid warning
+    (void)noerase;
+    return write_with_erase(phy_addr, data, cnt);
+}
+
 bool Flash::erase_sector_phy  (u_int32_t phy_addr)
 {
     NATIVE_PHY_ADDR_FUNC(erase_sector, (phy_addr));
@@ -438,7 +489,6 @@ bool Flash::write  (u_int32_t addr,
                     int       cnt,
                     bool      noerase)
 {
-
     // FIX:
     noerase = _no_erase || noerase;
 
@@ -459,7 +509,7 @@ bool Flash::write  (u_int32_t addr,
     }
 
     u_int8_t         *p = (u_int8_t *)data;
-    u_int32_t sect_size = get_sector_size();
+    u_int32_t sect_size = get_current_sector_size();
 
     u_int32_t chunk_addr;
     u_int32_t chunk_size;
@@ -544,8 +594,7 @@ bool Flash::write(u_int32_t addr, u_int32_t data)
 
 bool Flash::write_sector_with_erase(u_int32_t addr, void *data, int cnt)
 {
-
-    u_int32_t sector_size = _attr.sector_size;
+    u_int32_t sector_size = get_current_sector_size();
     u_int32_t sector_mask = ~(sector_size - 1);
 
     u_int32_t sector = addr & sector_mask;
@@ -560,9 +609,8 @@ bool Flash::write_sector_with_erase(u_int32_t addr, void *data, int cnt)
     if (!read(sector, &buff[0] , sector_size)) {
         return false;
     }
-
     if (!erase_sector(sector)) {
-        return false;
+            return false;
     }
 
     memcpy(&buff[word_in_sector], data, cnt);
@@ -578,8 +626,9 @@ bool Flash::write_with_erase(u_int32_t addr, void *data, int cnt)
     u_int32_t currAddr = addr;
     u_int32_t alreadyWritten = 0;
     u_int32_t sizeUntillEndOfSector = 0;
+    u_int32_t sector_size = get_current_sector_size();
     while (towrite > 0) {
-        sizeUntillEndOfSector = _attr.sector_size - (currAddr & (_attr.sector_size - 1));
+        sizeUntillEndOfSector = sector_size - (currAddr & (sector_size - 1));
         currSize = towrite >  sizeUntillEndOfSector ? sizeUntillEndOfSector : towrite;
         if (!write_sector_with_erase(currAddr, ((u_int8_t*)data + alreadyWritten), currSize)) {
             return false;
@@ -593,10 +642,15 @@ bool Flash::write_with_erase(u_int32_t addr, void *data, int cnt)
 
 bool Flash::erase_sector  (u_int32_t addr) {
     int rc;
-
     u_int32_t phys_addr = cont2phys(addr);
     mft_signal_set_handling(1);
-    rc = mf_erase_sector(_mfl, phys_addr);
+    if (_flash_working_mode == Flash::Fwm_4KB) {
+        rc = mf_erase_4k_sector(_mfl, phys_addr);
+    } else if (_flash_working_mode == Flash::Fwm_64KB) {
+        rc = mf_erase_64k_sector(_mfl, phys_addr);
+    } else {
+        rc = mf_erase(_mfl, phys_addr);
+    }
     deal_with_signal();
     if (rc != MFE_OK) {
         if (rc == MFE_REG_ACCESS_RES_NOT_AVLBL || rc == MFE_REG_ACCESS_BAD_PARAM) {
@@ -697,7 +751,7 @@ const char* Flash::getFlashType() {
     } else if (!strcmp(param_in, second_op)) {\
         out = 0;\
     } else {\
-        return errmsg("bad argument (%s) it can be "first_op" or " second_op"", param_in);\
+        return errmsg("bad argument (%s) it can be " first_op " or " second_op "", param_in);\
     }\
 }
 bool  Flash::set_attr(char *param_name, char *param_val_str)
@@ -709,11 +763,11 @@ bool  Flash::set_attr(char *param_name, char *param_val_str)
         u_int8_t quad_en_val;
         quad_en_val = strtoul(param_val_str, &endp, 0);
         if (*endp != '\0' || quad_en_val > 1) {
-            return errmsg("Bad "QUAD_EN_PARAM" value (%s), it can be 0 or 1\n", param_val_str);
+            return errmsg("Bad " QUAD_EN_PARAM " value (%s), it can be 0 or 1\n", param_val_str);
         }
         rc = mf_set_quad_en(_mfl, quad_en_val);
         if (rc != MFE_OK) {
-            return errmsg("Setting "QUAD_EN_PARAM" failed: (%s)", mf_err2str(rc));
+            return errmsg("Setting " QUAD_EN_PARAM " failed: (%s)", mf_err2str(rc));
         }
     } else if (!strcmp(param_name, DUMMY_CYCLES_PARAM)) {
         char* endp;
@@ -721,11 +775,11 @@ bool  Flash::set_attr(char *param_name, char *param_val_str)
         dummy_cycles_val = strtoul(param_val_str, &endp, 0);
         if (*endp != '\0' || dummy_cycles_val < 1 || dummy_cycles_val > 15) {
         	// value is actually [0.15] but val=0 and val=15 indicate default state (thus they are the same so no need for both values to be accepted)
-            return errmsg("Bad "DUMMY_CYCLES_PARAM" value (%s), it can be [1..15]\n", param_val_str);
+            return errmsg("Bad " DUMMY_CYCLES_PARAM " value (%s), it can be [1..15]\n", param_val_str);
         }
         rc = mf_set_dummy_cycles(_mfl, dummy_cycles_val);
         if (rc != MFE_OK) {
-            return errmsg("Setting "DUMMY_CYCLES_PARAM" failed: (%s)", mf_err2str(rc));
+            return errmsg("Setting " DUMMY_CYCLES_PARAM " failed: (%s)", mf_err2str(rc));
         }
     } else if (strstr(param_name, FLASH_NAME) == param_name) {
         char *flash_param, *param_str, *endp, *bank_num_str;
@@ -747,7 +801,7 @@ bool  Flash::set_attr(char *param_name, char *param_val_str)
                 num_str = strtok((char*)NULL, "-");
                 sec = strtok((char*)NULL, "");
                 if (tb == NULL || num_str == NULL || sec == NULL) {
-                    return errmsg("missing parameters for setting the "WRITE_PROTECT" attribute, see help for more info.");
+                    return errmsg("missing parameters for setting the " WRITE_PROTECT " attribute, see help for more info.");
                 }
                 GET_IN_PARAM(tb, protect_info.is_bottom, WP_BOTTOM_STR, WP_TOP_STR);
                 GET_IN_PARAM(sec, protect_info.is_subsector, WP_SUBSEC_STR, WP_SEC_STR);
@@ -759,7 +813,7 @@ bool  Flash::set_attr(char *param_name, char *param_val_str)
            }
             rc = mf_set_write_protect(_mfl, bank_num, &protect_info);
             if (rc != MFE_OK) {
-                return errmsg("Setting "WRITE_PROTECT" failed: (%s)", mf_err2str(rc));
+                return errmsg("Setting " WRITE_PROTECT " failed: (%s)", mf_err2str(rc));
             }
         } else {
             return errmsg("Unknown attribute %s.%s", flash_param, param_str);
@@ -811,4 +865,39 @@ void Flash::deal_with_signal()
     return;
 }
 
-
+#define FLINT_ERASE_SIZE_HOOK "FLINT_ERASE_SIZE"
+bool Flash::set_flash_working_mode(int mode)
+{
+    if (!_attr.support_sub_and_sector && mode != Flash::Fwm_Default) {
+        return errmsg("Changing Flash IO working mode not supported.");
+    }
+    // Verification Hook
+    if (_attr.support_sub_and_sector) {
+        char* flint_io_env = getenv(FLINT_ERASE_SIZE_HOOK);
+        if (flint_io_env) {
+            int num =  strtoul(flint_io_env, (char**)NULL, 0);
+            if (num == 0x1000 || num == 0x10000) {
+                _curr_sector_size = (u_int32_t)num;
+                _flash_working_mode = _curr_sector_size == 0x1000 ? Flash::Fwm_4KB : Flash::Fwm_64KB;
+                _curr_sector = _curr_sector & ~(_curr_sector_size - 1);
+                return true;
+            }
+        }
+    }
+    // Verification Hook end
+
+    if (mode == Flash::Fwm_Default) {
+        _curr_sector_size = _attr.sector_size;
+        _flash_working_mode = Flash::Fwm_Default;
+    } else if (mode == Flash::Fwm_4KB) {
+        _curr_sector_size = 0x1000;
+        _flash_working_mode = Flash::Fwm_4KB;
+    } else if (mode == Flash::Fwm_64KB) {
+        _curr_sector_size = 0x10000;
+        _flash_working_mode = Flash::Fwm_64KB;
+    } else {
+        return errmsg("Unknown Flash IO working mode: 0x%x", mode);
+    }
+    _curr_sector = _curr_sector & ~(_curr_sector_size - 1);
+    return true;
+}
diff --git a/mlxfwops/lib/flint_io.h b/mlxfwops/lib/flint_io.h
index e4ff181..e23c3ce 100755
--- a/mlxfwops/lib/flint_io.h
+++ b/mlxfwops/lib/flint_io.h
@@ -67,7 +67,7 @@ typedef struct ext_flash_attr {
     u_int32_t rev_id;
     char*   type_str; // NULL if not available
     u_int32_t size;
-    u_int32_t sector_size;
+    u_int32_t sector_size; // minimal sec
     int block_write;
     int command_set;
     u_int8_t quad_en_support;
@@ -87,7 +87,7 @@ typedef struct ext_flash_attr {
 } ext_flash_attr_t;
 
 // Common base class for Flash and for FImage
-class MLXFWOP_API FBase : public ErrMsg {
+class MLXFWOP_API FBase : public FlintErrMsg {
 public:
     FBase(bool is_flash) :
     _is_image_in_odd_chunks(false),
@@ -129,6 +129,9 @@ public:
         return phys_addr;
     }
 
+    u_int32_t   get_log2_chunk_size(){return _log2_chunk_size;}
+    bool        get_is_image_in_odd_chunks(){return _is_image_in_odd_chunks;}
+
     enum {
         MAX_FLASH = 4*1048576
     };
@@ -185,11 +188,13 @@ class MLXFWOP_API FImage : public FBase {
 public:
     FImage() :
     FBase(false),
+    _fname(0),
     _buf(0),
+    _isFile(false),
     _len(0) {}
     virtual ~FImage() { close();}
 
-    u_int32_t    *getBuf()      { return _buf;}
+    u_int32_t    *getBuf();
     u_int32_t    getBufLength() { return _len;}
     virtual bool open(const char *fname, bool read_only = false, bool advErr = true);
     using FBase::open;
@@ -203,7 +208,9 @@ public:
     virtual u_int32_t get_dev_id()   { return  0;}
     virtual u_int32_t get_rev_id()   { return  0;}
 private:
+    const char*     _fname;
     u_int32_t *_buf;
+    bool      _isFile;
     u_int32_t _len;
 };
 
@@ -225,8 +232,10 @@ public:
     _no_flash_verify(false),
     _ignore_cache_replacement(false),
     _curr_sector(0xffffffff),
+    _curr_sector_size(0),
     _port_num(0),
-    _cr_space_locked(0)
+    _cr_space_locked(0),
+    _flash_working_mode(Flash::Fwm_Default)
     {
         memset(&_attr, 0, sizeof(_attr));
     }
@@ -260,8 +269,9 @@ public:
                                 int       len,
                                 bool      verbose = false,
                                 const char* message = "");
-    bool write_phy(u_int32_t phy_addr, void* data, int cnt, bool noerase = false);
-    bool write_phy(u_int32_t phy_addr, u_int32_t data);
+    bool write_phy(u_int32_t phy_addr, void* data, int cnt, bool noerase = false); // read modify write
+    bool read_modify_write_phy(u_int32_t phy_addr, void* data, int cnt, bool noerase = false); // read modify write
+    bool write_phy(u_int32_t phy_addr, u_int32_t data); // read modify write
     bool erase_sector_phy  (u_int32_t phy_addr);
 
     bool         update_boot_addr (u_int32_t boot_addr)
@@ -270,7 +280,8 @@ public:
     // Flash Interface
     //
 
-    u_int32_t get_sector_size        ()  {return _attr.sector_size;}
+    u_int32_t get_current_sector_size ()  {return _curr_sector_size;}
+    u_int32_t get_sector_size()          {return _attr.sector_size;}
     u_int32_t get_size               ()  {return _attr.size;}
 
     u_int32_t get_dev_id             ()  {return _attr.hw_dev_id; }
@@ -293,6 +304,8 @@ public:
                                 int       cnt,
                                 bool      noerase = false);
 
+    bool read_modify_write(u_int32_t phy_addr, void* data, int cnt, bool noerase=false);
+
     virtual bool write         (u_int32_t addr,
                                 u_int32_t data);
 
@@ -307,13 +320,26 @@ public:
     bool         set_attr(char *param_name,
                           char *param_val_str);
 
+    bool flash_working_mode_supported() {return _attr.support_sub_and_sector;}
+    int get_flash_working_mode() {return _flash_working_mode;}
+    bool set_flash_working_mode(int mode=Flash::Fwm_Default);
+
     bool is_flash_write_protected();
     static void  deal_with_signal();
 
+    mfile* getMfileObj() {return mf_get_mfile(_mfl);}
+    mflash* getMflashObj() {return _mfl;}
+
     enum {
         TRANS = 4096
     };
 
+    enum {
+        Fwm_Default = 0,
+        Fwm_4KB = 1,
+        Fwm_64KB = 2
+    };
+
     bool open_com_checks(const char *device,
                          int rc,
                          bool force_lock);
@@ -329,9 +355,7 @@ public:
 #define WP_SUBSEC_STR "SubSectors"
 #define WP_DISABLED_STR "Disabled"
 
-#ifndef _MSC_VER
 protected:
-#endif
     bool write_sector_with_erase(u_int32_t addr, void *data, int cnt);
     bool write_with_erase(u_int32_t addr, void *data, int cnt);
 
@@ -342,8 +366,10 @@ protected:
     bool _ignore_cache_replacement; // for FS3 devices flash access.
 
     u_int32_t  _curr_sector;
+    u_int32_t  _curr_sector_size; // can work with both 4KB and 64KB sectors
     u_int32_t  _port_num;
     u_int8_t   _cr_space_locked;
+    int        _flash_working_mode;
 };
 
 #endif
diff --git a/mlxfwops/lib/fs2_ops.cpp b/mlxfwops/lib/fs2_ops.cpp
index c3151ad..7268ee3 100644
--- a/mlxfwops/lib/fs2_ops.cpp
+++ b/mlxfwops/lib/fs2_ops.cpp
@@ -31,8 +31,15 @@
  */
 
 
+#if !defined(UEFI_BUILD) && !defined(NO_OPEN_SSL)
+#include <tools_crypto/tools_md5.h>
+#endif
+#include <cibfw_layouts.h>
 #include "fs2_ops.h"
-// #include "flint_ops.h"
+
+#ifdef __WIN__
+#include <win_driver_cif.h>
+#endif
 
 #define PRE_CRC_OUTPUT   "    "
 #define CRC_CHECK_OUTPUT  CRC_CHECK_OLD")"
@@ -446,7 +453,7 @@ bool Fs2Operations::Fs2Verify(VerifyCallBack verifyCallBackFunc, bool is_striped
 
     // printf("-D- VerifyFs2 = ok\n");
     // Look for image in "physical addresses
-    CntxFindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num);
+    FindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num, _cntx_magic_pattern);
     if (cntx_image_num == 0) {
         return errmsg(MLXFW_NO_VALID_IMAGE_ERR, "No valid image found");
     } else if (cntx_image_num > 2) {
@@ -743,6 +750,11 @@ bool Fs2Operations::Fs2IntQuery(bool readRom, bool isStripedImage)
         return false;
     }
     _fwImgInfo.ext_info.chip_type = getChipType();
+
+    // get running FW version
+    if (_ioAccess->is_flash() && _fwImgInfo.ext_info.chip_type != CT_UNKNOWN) {
+        getRunningFwVer();
+    }
     return true;
 }
 
@@ -758,6 +770,46 @@ bool Fs2Operations::FwQuery(fw_info_t *fwInfo, bool readRom, bool isStripedImage
     return true;
 }
 
+#define CX3_FW_VER_CR_ADDR 0x1f064
+#define SX_FW_VER_CR_ADDR 0x60040
+
+bool Fs2Operations::getRunningFwVer()
+{
+#ifndef UEFI_BUILD
+    u_int32_t fwVerBaseAddr = 0x0;
+    u_int32_t mflags;
+    struct cibfw_FW_VERSION fwVer;
+    u_int8_t buff[CIBFW_FW_VERSION_SIZE] = {0};
+    memset(&fwVer, 0, sizeof(fwVer));
+    // make sure its not mellanox OS
+    if (mget_mdevs_flags(((Flash*)_ioAccess)->getMfileObj(), &mflags)) {
+        return errmsg("Failed to get device access type");
+    }
+    if (mflags & MDEVS_MLNX_OS) {
+        return true;
+    }
+    switch (_fwImgInfo.ext_info.chip_type) {
+    case CT_CONNECTX:
+        fwVerBaseAddr = CX3_FW_VER_CR_ADDR;
+        break;
+    case CT_SWITCHX:
+        fwVerBaseAddr = SX_FW_VER_CR_ADDR;
+        break;
+    default:
+        return errmsg("Unsupported chip type.");
+    }
+
+    if (mread_buffer(((Flash*)_ioAccess)->getMfileObj(), fwVerBaseAddr, buff, CIBFW_FW_VERSION_SIZE) != CIBFW_FW_VERSION_SIZE) {
+        return errmsg("Failed to extract FW version from device. CR_ERROR\n");
+    }
+    cibfw_FW_VERSION_unpack(&fwVer, buff);
+    _fwImgInfo.ext_info.running_fw_ver[0] = fwVer.MAJOR;
+    _fwImgInfo.ext_info.running_fw_ver[1] = fwVer.MINOR;
+    _fwImgInfo.ext_info.running_fw_ver[2] = fwVer.SUBMINOR;
+#endif
+    return true;
+}
+
 #define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
 #define CX_DFLT_SECTOR_SIZE 0x10000
 #define SX_DFLT_SECTOR_SIZE 0x1000
@@ -772,7 +824,7 @@ u_int32_t Fs2Operations::getDefaultSectorSz()
     // an older mlxburn the fw_sector_size wount be available
     u_int32_t devid = _ioAccess->get_dev_id();
     switch (devid) {
-    case CX_HW_ID:
+    case CX2_HW_ID:
     case CX3_HW_ID:
     case CX3_PRO_HW_ID:
         return CX_DFLT_SECTOR_SIZE;
@@ -943,7 +995,7 @@ bool Fs2Operations::Fs2FailSafeBurn(Fs2Operations &imageOps,
             u_int32_t cntx_image_start[CNTX_START_POS_SIZE];
             u_int32_t cntx_image_num;
 
-            CntxFindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num);
+            FindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num, _cntx_magic_pattern);
             // Address convertor is disabled now - use phys addresses
             for (u_int32_t i = 0; i < cntx_image_num; i++) {
                 if (cntx_image_start[i] != new_image_start) {
@@ -966,15 +1018,18 @@ bool Fs2Operations::Fs2FailSafeBurn(Fs2Operations &imageOps,
         report_warn("Failed to update FW boot address. Power cycle the device in order to load the new FW.\n");
     }
 
+    // on windows send caching command to driver (best effort)
+#ifdef __WIN__
+    mf_release_semaphore(((Flash*)_ioAccess)->getMflashObj());
+    wdcif_send_image_cache_request(((Flash*)_ioAccess)->getMfileObj());
+#endif
     return true;
 }
 
 
 bool Fs2Operations::preFS2PatchGUIDs(bool      patch_macs,
-        bool      patch_uids,
         bool      user_guids,
         bool      user_macs,
-        bool      user_uids,
         guid_t    new_guids[MAX_GUIDS],
         guid_t    old_guids[MAX_GUIDS],
         guid_t    **used_guids_p,
@@ -987,95 +1042,63 @@ bool Fs2Operations::preFS2PatchGUIDs(bool      patch_macs,
         // if only guids or only macs are specified by user, keep the other
         // as currently set of flash. This is in order to simplify transitions between
         // burning IB and ETH FW.
-        if (!patch_uids) {
-            if (old_guids && !user_guids) {
-                for (int i = 0; i < GUIDS; i++) {
-                    new_guids[i] = old_guids[i];
-                }
+        if (old_guids && !user_guids) {
+            for (int i = 0; i < GUIDS; i++) {
+                new_guids[i] = old_guids[i];
             }
+        }
 
-            if (old_guids && !user_macs) {
-                for (int i = GUIDS; i < MAX_GUIDS; i++) {
-                    new_guids[i] = old_guids[i];
-                }
+        if (old_guids && !user_macs) {
+            for (int i = GUIDS; i < MAX_GUIDS; i++) {
+                new_guids[i] = old_guids[i];
             }
         }
         *used_guids_p = new_guids;
     }
     used_guids = *used_guids_p;
 
-    if (!patch_uids) {
-        if (patch_macs) {
-
-            // To ease upgrade from 4 GUIDS format to 4+2 format, or to move from IB to ETH,
-            // if macs are not
-            // explicitly set in flash, they are derived from the GUIDs according to
-            // Mellanox methodology - 48 bit MAC == 64 bit GUID without the middle 16 bits.
-
-            if (old_guids && ((num_of_old_guids == 4) ||
-                              (num_of_old_guids == 6 &&
-                               (old_guids[GUIDS  ].h & 0xffff)     == 0xffff     &&
-                               (old_guids[GUIDS  ].l & 0xffffffff) == 0xffffffff &&
-                               (old_guids[GUIDS+1].h & 0xffff)     == 0xffff     &&
-                               (old_guids[GUIDS+1].l & 0xffffffff) == 0xffffffff))) {
-                for (int i = 0 ; i < MACS; i++) {
-                    u_int64_t mac  =  old_guids[i+1].h >> 8;
-                    mac <<= 24;
-                    mac |= (old_guids[i+1].l & 0xffffff);
-
-                    old_guids[GUIDS+i].h = u_int32_t(mac >> 32);
-                    old_guids[GUIDS+i].l = u_int32_t(mac  & 0xffffffff);
-
-                    // printf("-D- Guid " GUID_FORMAT " to MAC "MAC_FORMAT"\n", old_guids[i+1].h, old_guids[i+1].l, old_guids[i+GUIDS].h,old_guids[i+GUIDS].l  );
-                }
-            }
+    if (patch_macs) {
 
-            guid_t* macs = &used_guids[4];
+        // To ease upgrade from 4 GUIDS format to 4+2 format, or to move from IB to ETH,
+        // if macs are not
+        // explicitly set in flash, they are derived from the GUIDs according to
+        // Mellanox methodology - 48 bit MAC == 64 bit GUID without the middle 16 bits.
 
-            for (int i = 0 ; i < MACS ; i++) {
-                u_int64_t mac = (((u_int64_t)macs[i].h) << 32) | macs[i].l;
-                if (!_burnBlankGuids && !CheckMac(mac)) {
-                    return errmsg("Bad mac (" MAC_FORMAT ") %s: %s. Please re-burn with a valid -mac flag value.", macs[i].h,
-                           macs[i].l,
-                           user_macs ? "given" : "found on flash", err());
-                }
+        if (old_guids && ((num_of_old_guids == 4) ||
+                          (num_of_old_guids == 6 &&
+                           (old_guids[GUIDS  ].h & 0xffff)     == 0xffff     &&
+                           (old_guids[GUIDS  ].l & 0xffffffff) == 0xffffffff &&
+                           (old_guids[GUIDS+1].h & 0xffff)     == 0xffff     &&
+                           (old_guids[GUIDS+1].l & 0xffffffff) == 0xffffffff))) {
+            for (int i = 0 ; i < MACS; i++) {
+                u_int64_t mac  =  old_guids[i+1].h >> 8;
+                mac <<= 24;
+                mac |= (old_guids[i+1].l & 0xffffff);
+
+                old_guids[GUIDS+i].h = u_int32_t(mac >> 32);
+                old_guids[GUIDS+i].l = u_int32_t(mac  & 0xffffffff);
 
+                // printf("-D- Guid " GUID_FORMAT " to MAC "MAC_FORMAT"\n", old_guids[i+1].h, old_guids[i+1].l, old_guids[i+GUIDS].h,old_guids[i+GUIDS].l  );
             }
         }
-    } else {
-        if (!_burnBlankGuids) {
-            for (int i = 0; i < BX_SLICES_NUM; i++ ) {
-                if (CheckBxMacsFormat(used_guids, i, user_uids) == false) {
-                    return false;
-                }
+
+        guid_t* macs = &used_guids[4];
+
+        for (int i = 0 ; i < MACS ; i++) {
+            u_int64_t mac = (((u_int64_t)macs[i].h) << 32) | macs[i].l;
+            if (!_burnBlankGuids && !CheckMac(mac)) {
+                return errmsg("Bad mac (" MAC_FORMAT ") %s: %s. Please re-burn with a valid -mac flag value.", macs[i].h,
+                       macs[i].l,
+                       user_macs ? "given" : "found on flash", err());
             }
-        }
 
+        }
     }
-    // Avoid warnings
-    user_uids = true;
 
     return true;
 }
 
 
-bool Fs2Operations::CheckBxMacsFormat(guid_t* guids, int index, int user_uids)
-{
-    int base;
-    base = index * BX_SLICE_GUIDS + BI_IMACS;
-    for (int i = base; i < base + BX_MACS; i++) {
-         u_int64_t mac = (((u_int64_t)guids[i].h) << 32) | guids[i].l;
-         if (!CheckMac(mac)) {
-             return errmsg("Bad mac (" MAC_FORMAT ") %s: %s. Please re-burn with a valid MACs flag value.", guids[i].h,
-                     guids[i].l,
-                     user_uids ? "given" : "found on flash", err());
-
-         }
-     }
-     return true;
-}
-
-////////////////////////////////////////////////////////////////////////
 void Fs2Operations::patchGUIDsSection(u_int32_t *buf, u_int32_t ind, guid_t guids[MAX_GUIDS], int nguids)
 {
     u_int32_t       new_buf[MAX_GUIDS*2] = {0};
@@ -1105,10 +1128,8 @@ void Fs2Operations::patchGUIDsSection(u_int32_t *buf, u_int32_t ind, guid_t guid
 
 bool Fs2Operations::patchGUIDs (Fs2Operations&   imageOps,
                              bool      patch_macs,
-                             bool      patch_uids,
                              bool      user_guids,
                              bool      user_macs,
-                             bool      user_uids,
                              guid_t    new_guids[MAX_GUIDS],
                              guid_t    old_guids[MAX_GUIDS],
                              u_int32_t num_of_old_guids)
@@ -1117,17 +1138,13 @@ bool Fs2Operations::patchGUIDs (Fs2Operations&   imageOps,
     u_int32_t       *buf = ((FImage*)imageOps._ioAccess)->getBuf();
 
     // Call common function
-    if (!preFS2PatchGUIDs(patch_macs, patch_uids, user_guids, user_macs, user_uids, new_guids, old_guids, &used_guids, num_of_old_guids)) {
+    if (!preFS2PatchGUIDs(patch_macs, user_guids, user_macs, new_guids, old_guids, &used_guids, num_of_old_guids)) {
         return false;
     }
     // Path GUIDs section
     if (imageOps._fs2ImgInfo.guidPtr) {
         patchGUIDsSection(buf, imageOps._fwImgInfo.imgStart + imageOps._fs2ImgInfo.guidPtr, used_guids, imageOps._fs2ImgInfo.ext_info.guid_num);
     }
-
-
-    // Avoid warnings
-    user_uids = true;
     return true;
 }
 
@@ -1417,19 +1434,16 @@ bool Fs2Operations::Fs2Burn(Fs2Operations &imageOps, ExtBurnParams& burnParams)
 
     // Guids patch
     _burnBlankGuids = burnParams.blankGuids;
-    bool  isGuidsSpecified  =  burnParams.userMacsSpecified || burnParams.userGuidsSpecified ||
-            burnParams.userUidsSpecified;
+    bool  isGuidsSpecified  =  burnParams.userMacsSpecified || burnParams.userGuidsSpecified;
     if (isGuidsSpecified) {
         // Get the GUIDS/MACsUIDs from the user input
-        bool isBridgeX = (_fwImgInfo.ext_info.chip_type == CT_BRIDGEX);
-        bool isMacAvailable = Fs2IsMacAvailable();
-        if (!patchGUIDs(imageOps, isMacAvailable, isBridgeX, burnParams.userGuidsSpecified, burnParams.userMacsSpecified, burnParams.userUidsSpecified,
+        if (!patchGUIDs(imageOps, true, burnParams.userGuidsSpecified, burnParams.userMacsSpecified,
                 (guid_t*)(&(burnParams.userUids[0])), _fs2ImgInfo.ext_info.guids, _fs2ImgInfo.ext_info.guid_num)) {
             return false;
         }
     } else if (!burnParams.useImageGuids) {
         // Get the GUIDS/MACsUIDs from the device
-        if (!patchGUIDs(imageOps, true, false, false, false, false, (guid_t*)NULL,
+        if (!patchGUIDs(imageOps, true, false, false, (guid_t*)NULL,
                 _fs2ImgInfo.ext_info.guids, _fs2ImgInfo.ext_info.guid_num)) {
             return false;
         }
@@ -1443,7 +1457,6 @@ bool Fs2Operations::Fs2Burn(Fs2Operations &imageOps, ExtBurnParams& burnParams)
     return Fs2FailSafeBurn(imageOps, !burnParams.burnFailsafe, "", burnParams.progressFunc);
 }
 
-
 bool Fs2Operations::Fs2IsMacAvailable()
 {
 
@@ -1452,6 +1465,7 @@ bool Fs2Operations::Fs2IsMacAvailable()
     }
     return true;
 }
+
 bool Fs2Operations::FwBurn(FwOperations *imageOps, u_int8_t forceVersion, ProgressCallBack progressFunc)
 {
     if (imageOps == NULL) {
@@ -1735,9 +1749,8 @@ bool Fs2Operations::Fs2SetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc
     // avoid compiler warrnings
     (void)callBackFunc;
     //
-    bool ib_dev, eth_dev, bx_dev;
+    bool ib_dev, eth_dev;
     // Get the FW types
-    bx_dev = _fwImgInfo.ext_info.chip_type == CT_BRIDGEX;
     SetDevFlags(_fwImgInfo.ext_info.chip_type, _fwImgInfo.ext_info.dev_type, FIT_FS2, ib_dev, eth_dev);
     guid_t* old_guids = _fwImgInfo.imageOk ? _fs2ImgInfo.ext_info.guids : (guid_t*)NULL;
     guid_t* used_guids;
@@ -1747,7 +1760,7 @@ bool Fs2Operations::Fs2SetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc
         //resize our user guids vector to MAX_GUIDS
     sgParam.userGuids.resize(MAX_GUIDS);
 
-    if (!preFS2PatchGUIDs(eth_dev, bx_dev, sgParam.guidsSpecified, sgParam.macsSpecified, sgParam.uidsSpecified, &sgParam.userGuids[0],
+    if (!preFS2PatchGUIDs(eth_dev, sgParam.guidsSpecified, sgParam.macsSpecified, &sgParam.userGuids[0],
                         old_guids, &used_guids, _fs2ImgInfo.ext_info.guid_num)) {
         return false;
     }
@@ -1789,9 +1802,9 @@ bool Fs2Operations::FwBurnRom(FImage* romImg, bool ignoreProdIdCheck, bool ignor
 
     u_int32_t cntx_image_start[CNTX_START_POS_SIZE];
     u_int32_t cntx_image_num;
-    CntxFindAllImageStart(romImg, cntx_image_start, &cntx_image_num);
+    FindAllImageStart(romImg, cntx_image_start, &cntx_image_num, _cntx_magic_pattern);
     if (cntx_image_num != 0) {
-        return errmsg("Expecting an expansion ROM image, Recieved Mellanox FW image.");
+        return errmsg("Expecting an expansion ROM image, Received Mellanox FW image.");
     }
 
     if (!Fs2IntQuery()) {
@@ -2018,6 +2031,7 @@ bool Fs2Operations::FwResetNvData()
 			//_fs2ImgInfo.ext_info.config_sectors, _fs2ImgInfo.ext_info.config_pad, fwSectorSz,configBaseAddr, availFlashSize);
 
 	//erase addresses : [configBaseAddr..AvailFlashSize]
+    ((Flash*)_ioAccess)->set_flash_working_mode(Flash::Fwm_Default);
     u_int32_t sectorSize = _ioAccess->get_sector_size();
     u_int32_t configEndAddr = availFlashSize - (_fs2ImgInfo.ext_info.config_pad * fwSectorSz);
 	for (u_int32_t eraseAddr=configBaseAddr; eraseAddr < configEndAddr; eraseAddr+=sectorSize ) {
@@ -2052,3 +2066,38 @@ const char* Fs2Operations::FwGetResetRecommandationStr()
     }
     return (const char*)NULL;
 }
+
+bool Fs2Operations::FwCalcMD5(u_int8_t md5sum[16])
+{
+#if defined(UEFI_BUILD) || defined(NO_OPEN_SSL)
+    (void)md5sum;
+    return errmsg("Operation not supported");
+#else
+    // no support for striped image ATM
+    if (!Fs2IntQuery(true, false)) {
+        return false;
+    }
+    if (_fwImgInfo.ext_info.is_failsafe && _fwImgInfo.actuallyFailsafe) {
+        _ioAccess->set_address_convertor(_fwImgInfo.cntxLog2ChunkSize, _fwImgInfo.imgStart != 0);
+    } else {
+        _ioAccess->set_address_convertor(0, 0);
+    }
+    // read entire flash
+    std::vector<u_int8_t> md5buff;
+    md5buff.resize(_fwImgInfo.lastImageAddr);
+    READBUF((*_ioAccess), 0, &md5buff[0], _fwImgInfo.lastImageAddr, "Calculate MD5");
+    // mask out image CRC, GUIDs, VSD, ImageInfo CRC
+    // full image CRC DW
+    memset(&md5buff[0x20], 0xff, 4);
+    // GUIDs
+    memset(&md5buff[_fs2ImgInfo.guidPtr - 0x10], 0xff, 0x44);
+    // VSD
+    memset(&md5buff[_fs2ImgInfo.infoSectPtr + _fs2ImgInfo.infoOffs[II_VSD]], 0xff, 0xd0);
+    // Image Info CRC
+    u_int32_t infoSectSize = __be32_to_cpu(*(u_int32_t*)&md5buff[_fs2ImgInfo.infoSectPtr - sizeof(GPH) + 0x4]) << 2;
+    memset(&md5buff[_fs2ImgInfo.infoSectPtr + infoSectSize], 0xff, 4);
+    // calc md5 sum
+    tools_md5(&md5buff[0], md5buff.size(), md5sum);
+    return true;
+#endif
+}
diff --git a/mlxfwops/lib/fs2_ops.h b/mlxfwops/lib/fs2_ops.h
index 0dd183c..bc87ecf 100644
--- a/mlxfwops/lib/fs2_ops.h
+++ b/mlxfwops/lib/fs2_ops.h
@@ -76,6 +76,7 @@ public:
     virtual bool FwInit();
     virtual bool FwReadData(void* image, u_int32_t* image_size);
     virtual bool FwReadRom(std::vector<u_int8_t>& romSect);
+    virtual bool FwCalcMD5(u_int8_t md5sum[16]);
 
 
 private:
@@ -143,9 +144,9 @@ private:
     bool Fs2FailSafeBurn(Fs2Operations &imageOps, bool allow_nofs, const char* pre_message,
             ProgressCallBack progressFunc);
     bool ModifyGuidSection(guid_t *user_guids, ProgressCallBack progressFunc=(ProgressCallBack)NULL);
-    bool preFS2PatchGUIDs(bool patch_macs, bool patch_uids, bool user_guids, bool user_macs,
-            bool user_uids, guid_t new_guids[MAX_GUIDS], guid_t old_guids[MAX_GUIDS], guid_t **used_guids_p, u_int32_t num_of_old_guids);
-    bool patchGUIDs (Fs2Operations& imageOps, bool patch_macs, bool patch_uids, bool user_guids, bool user_macs, bool user_uids,
+    bool preFS2PatchGUIDs(bool patch_macs, bool user_guids, bool user_macs,
+            guid_t new_guids[MAX_GUIDS], guid_t old_guids[MAX_GUIDS], guid_t **used_guids_p, u_int32_t num_of_old_guids);
+    bool patchGUIDs (Fs2Operations& imageOps, bool patch_macs, bool user_guids, bool user_macs,
                                  guid_t new_guids[MAX_GUIDS], guid_t old_guids[MAX_GUIDS], u_int32_t num_of_old_guids);
     void patchGUIDsSection(u_int32_t *buf, u_int32_t ind, guid_t guids[MAX_GUIDS], int nguids);
     bool patchImageVsd(Fs2Operations &imgFwOps, const char* userVsd=(char*)NULL);
@@ -162,7 +163,6 @@ private:
     bool ModifyKeySection(guid_t access_key, ProgressCallBack callBackFunc=(ProgressCallBack)NULL);
     void PatchKeySect(u_int32_t* buff, u_int32_t keyOff, guid_t hw_key);
     bool Fs2IsMacAvailable();
-    bool CheckBxMacsFormat(guid_t* guids, int index, int user_uids);
 
     bool ModifyVSDSection(const char *vsd, ProgressCallBack callBackFunc=(ProgressCallBack)NULL);
     bool ReburnNewImage(u_int8_t *data, const char *feature_name, ProgressCallBack callBackFunc=(ProgressCallBack)NULL);
@@ -170,6 +170,7 @@ private:
                               bool needs_repack, u_int32_t cntxLog2ChunkSize);
     bool Fs2SetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc=(PrintCallBack)NULL, ProgressCallBack progressFunc=(ProgressCallBack)NULL);
     bool Fs2SetGuidsForBlank(sg_params_t& sgParam);
+    bool getRunningFwVer();
 
 
     Fs2ImgInfo _fs2ImgInfo;
diff --git a/mlxfwops/lib/fs3_ops.cpp b/mlxfwops/lib/fs3_ops.cpp
index f60cdb6..0f65f2b 100644
--- a/mlxfwops/lib/fs3_ops.cpp
+++ b/mlxfwops/lib/fs3_ops.cpp
@@ -40,6 +40,18 @@
 #include <mtcr.h>
 #include <reg_access/reg_access.h>
 
+#ifdef MST_UL
+#include <cmdif/icmd_cif_open.h>
+#else
+#ifndef UEFI_BUILD
+#include <cmdif/cib_cif.h>
+#endif
+#endif
+
+#if !defined(UEFI_BUILD) && !defined(NO_OPEN_SSL)
+#include <tools_crypto/tools_md5.h>
+#endif
+
 #include "fs3_ops.h"
 
 #define FS3_FLASH_SIZE 0x400000
@@ -51,16 +63,7 @@
 #define DEFAULT_GUID_NUM 0xff
 #define DEFAULT_STEP DEFAULT_GUID_NUM
 
-// FW Binary version
-
-// max supported major version
-// first time breaking compatibility remove the check if the version is not initialized
-#define FS3_MAX_BIN_VER_MAJOR 1
-
-// min supported version
-#define FS3_MIN_BIN_VER_MAJOR 1
-#define FS3_MIN_BIN_VER_MINOR 1
-
+//fs4 use the same itoc signatures, please double check
 const u_int32_t Fs3Operations::_itocSignature[4] = {
         ITOC_ASCII,   // Ascii of "MTFW"
         TOC_RAND1,   // Random data
@@ -100,19 +103,17 @@ const Fs3Operations::SectionInfo Fs3Operations::_fs3SectionsInfoArr[] = {
     {FS3_NV_DATA0,      "NV_DATA"},
     {FS3_FW_NV_LOG,     "FW_NV_LOG"},
     {FS3_NV_DATA0,      "NV_DATA"},
+    {FS3_DTOC,          "DTOC_Header"},
+    {FS4_HW_PTR,        "HW Pointers"},
+    {FS4_TOOLS_AREA,    "Tools Area"}
 };
 
 bool Fs3Operations::Fs3UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size)
 {
-    // vector<u_int8_t>::iterator it;
-    u_int32_t min_required_size = addr + size;
-
-    if (_fs3ImgInfo.imageCache.size() < min_required_size) {
-        _fs3ImgInfo.imageCache.resize(min_required_size);
-    }
-    for (u_int32_t i = 0; i < size; i++) {
-        _fs3ImgInfo.imageCache.at(addr + i) = buff[i];
+    if (size == 0) { // empty
+        return true;
     }
+    _imageCache.add(buff, addr, size);
     return true;
 }
 
@@ -193,6 +194,14 @@ bool Fs3Operations::GetMfgInfo(u_int8_t *buff)
     } else {
         return errmsg(MLXFW_UNKNOWN_SECT_VER_ERR, "Unknown MFG_INFO format version (%d.%d).", cib_mfg_info.major_version, cib_mfg_info.minor_version);
     }
+
+    if (cib_mfg_info.minor_version == 1) {
+        //get orig_prs name
+        struct tools_open_mfg_info tools_mfg_info;
+        memset(&tools_mfg_info, 0, sizeof(tools_mfg_info));
+        tools_open_mfg_info_unpack(&tools_mfg_info, buff);
+        strncpy(_fs3ImgInfo.ext_info.orig_prs_name, tools_mfg_info.orig_prs_name, FS3_PRS_NAME_LEN - 1);
+    }
     return true;
 
 }
@@ -243,11 +252,20 @@ bool Fs3Operations::GetImageInfo(u_int8_t *buff)
     strcpy(_fs3ImgInfo.ext_info.image_vsd, image_info.vsd);
     strcpy(_fwImgInfo.ext_info.psid, image_info.psid);
     strcpy(_fwImgInfo.ext_info.product_ver, image_info.prod_ver);
+    if (IIMinor == 2) {
+        // get name, prs name and description
+        struct tools_open_image_info tools_image_info;
+        memset(&tools_image_info, 0, sizeof(tools_image_info));
+        tools_open_image_info_unpack(&tools_image_info, buff);
+        strncpy(_fs3ImgInfo.ext_info.name, tools_image_info.name, NAME_LEN - 1);
+        strncpy(_fs3ImgInfo.ext_info.description, tools_image_info.description, DESCRIPTION_LEN - 1);
+        strncpy(_fs3ImgInfo.ext_info.prs_name, tools_image_info.prs_name, FS3_PRS_NAME_LEN - 1);
+    }
     return true;
 }
 
 #define CHECK_DEV_INFO_NEW_FORMAT(info_st)\
-        (info_st.major_version == 2)
+        (info_st.major_version == 2 )
 #define CHECK_DEV_INFO_OLD_FORMAT(info_st)\
         (info_st.major_version == 1)
 bool Fs3Operations::GetDevInfo(u_int8_t *buff)
@@ -328,11 +346,16 @@ bool Fs3Operations::IsFs3SectionReadable(u_int8_t type, QueryOptions queryOption
         }
         return false;
 
-    } else if (queryOptions.quickQuery) {
-        if ( IsGetInfoSupported(type)) {
-            return true;
+    } else{
+        if (!queryOptions.readRom && type == FS3_ROM_CODE) {
+            return false;
+        }
+        if (queryOptions.quickQuery) {
+            if ( IsGetInfoSupported(type)) {
+                return true;
+            }
+            return false;
         }
-        return false;
     }
     return true;
 }
@@ -404,14 +427,13 @@ bool Fs3Operations::VerifyTOC(u_int32_t dtoc_addr, bool& bad_signature, VerifyCa
                     _fs3ImgInfo.sizeOfImgData = (_fs3ImgInfo.sizeOfImgData > currSizeOfImgdata) ? _fs3ImgInfo.sizeOfImgData : phys_addr;
                 }
                 section_last_addr = phys_addr + entry_size_in_bytes;
-                _fwImgInfo.lastImageAddr = (_fwImgInfo.lastImageAddr >= phys_addr + section_last_addr) ? _fwImgInfo.lastImageAddr : section_last_addr;
+                _fwImgInfo.lastImageAddr = (_fwImgInfo.lastImageAddr >= section_last_addr) ? _fwImgInfo.lastImageAddr : section_last_addr;
 
                 if (IsFs3SectionReadable(toc_entry.type, queryOptions)) {
 
                     // Only when we have full verify or the info of this section should be collected for query
                     std::vector<u_int8_t> buffv(entry_size_in_bytes);
                     u_int8_t *buff = (u_int8_t*)(&(buffv[0]));
-
                     if (show_itoc) {
                         cibfw_itoc_entry_dump(&toc_entry, stdout);
                         DumpFs3CRCCheck(toc_entry.type, phys_addr, entry_size_in_bytes, 0, 0, true, verifyCallBackFunc);
@@ -420,8 +442,8 @@ bool Fs3Operations::VerifyTOC(u_int32_t dtoc_addr, bool& bad_signature, VerifyCa
                         Fs3UpdateImgCache(buff, flash_addr, entry_size_in_bytes);
                         u_int32_t sect_crc = CalcImageCRC((u_int32_t*)buff, toc_entry.size);
 
-                       // printf("-D- flash_addr: %#x, toc_entry_size = %#x, actual sect = %#x, from itoc: %#x np_crc = %s\n", flash_addr, toc_entry.size, sect_crc,
-                       //         toc_entry.section_crc, toc_entry.no_crc ? "yes" : "no");
+                        //printf("-D- flash_addr: %#x, toc_entry_size = %#x, actual sect = %#x, from itoc: %#x np_crc = %s\n", flash_addr, toc_entry.size, sect_crc,
+                            //    toc_entry.section_crc, toc_entry.no_crc ? "yes" : "no");
                         if (!DumpFs3CRCCheck(toc_entry.type, phys_addr, entry_size_in_bytes, sect_crc, toc_entry.section_crc, toc_entry.no_crc, verifyCallBackFunc)) {
                             if (toc_entry.device_data) {
                                 _badDevDataSections = true;
@@ -460,7 +482,7 @@ bool Fs3Operations::VerifyTOC(u_int32_t dtoc_addr, bool& bad_signature, VerifyCa
 
     if (!mfg_exists) {
         _badDevDataSections = true;
-        return errmsg(MLXFW_NO_MFG_ERR, "No \""MFG_INFO"\" info section.");
+        return errmsg(MLXFW_NO_MFG_ERR, "No \"" MFG_INFO "\" info section.");
     }
     return ret_val;
 }
@@ -474,7 +496,7 @@ bool Fs3Operations::FwVerify(VerifyCallBack verifyCallBackFunc, bool isStripedIm
     queryOptions.readRom = true;
     queryOptions.quickQuery = false;
 
-    return Fs3Verify(verifyCallBackFunc, showItoc, queryOptions);
+    return FsVerifyAux(verifyCallBackFunc, showItoc, queryOptions);
 }
 
 #define BOOT_RECORD_SIZE 0x10
@@ -517,25 +539,7 @@ bool Fs3Operations::checkPreboot(u_int32_t* prebootBuff, u_int32_t size, VerifyC
     return true;
 }
 
-bool Fs3Operations::CheckBinVersion(u_int8_t binVerMajor, u_int8_t binVerMinor)
-{
-    if (binVerMajor == 0 && binVerMinor == 0) {
-        return true;
-    }
-
-    if (binVerMajor > FS3_MAX_BIN_VER_MAJOR) {
-        return errmsg(MLXFW_UNSUPPORTED_BIN_VER_ERR, "Unsupported binary version (%d.%d) please update to latest MFT package", binVerMajor, binVerMinor);
-    }
-
-    if (binVerMajor < FS3_MIN_BIN_VER_MAJOR || (binVerMajor == FS3_MIN_BIN_VER_MAJOR && binVerMinor < FS3_MIN_BIN_VER_MINOR)) {
-        return errmsg(MLXFW_UNSUPPORTED_BIN_VER_ERR, "Unsupported binary version (%d.%d) minimal supported version (%d.%d)", \
-                binVerMajor, binVerMinor, FS3_MIN_BIN_VER_MAJOR, FS3_MIN_BIN_VER_MINOR);
-    }
-
-    return true;
-}
-
-bool Fs3Operations::Fs3Verify(VerifyCallBack verifyCallBackFunc, bool show_itoc, struct QueryOptions queryOptions)
+bool Fs3Operations::FsVerifyAux(VerifyCallBack verifyCallBackFunc, bool show_itoc, struct QueryOptions queryOptions)
 {
     u_int32_t cntx_image_start[CNTX_START_POS_SIZE];
     u_int32_t cntx_image_num;
@@ -544,7 +548,7 @@ bool Fs3Operations::Fs3Verify(VerifyCallBack verifyCallBackFunc, bool show_itoc,
     u_int8_t binVerMajor = 0, binVerMinor = 0;
     bool bad_signature;
 
-    CntxFindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num);
+    FindAllImageStart(_ioAccess, cntx_image_start, &cntx_image_num, _cntx_magic_pattern);
     if (cntx_image_num == 0) {
         return errmsg(MLXFW_NO_VALID_IMAGE_ERR, "No valid FS3 image found");
     }
@@ -586,10 +590,12 @@ bool Fs3Operations::Fs3Verify(VerifyCallBack verifyCallBackFunc, bool show_itoc,
     _fs3ImgInfo.firstItocIsEmpty = false;
     // printf("-D- image_start = %#x\n", image_start);
     // Go over the ITOC entries
-    u_int32_t sector_size = (_ioAccess->is_flash()) ? _ioAccess->get_sector_size() : FS3_DEFAULT_SECTOR_SIZE;
+    // adrianc: need to have the sector size hardcoded in the FW binary (since its determined in the image generation process)
+    u_int32_t sector_size = FS3_DEFAULT_SECTOR_SIZE;
     offset = (offset % sector_size == 0) ? offset : (offset + sector_size - offset % 0x1000);
     while (offset < _ioAccess->get_size())
     {
+
         if (VerifyTOC(offset, bad_signature, verifyCallBackFunc, show_itoc, queryOptions)) {
             return true;
         } else {
@@ -605,13 +611,13 @@ bool Fs3Operations::Fs3Verify(VerifyCallBack verifyCallBackFunc, bool show_itoc,
 }
 
 
-bool Fs3Operations::Fs3IntQuery(bool readRom, bool quickQuery)
+bool Fs3Operations::FsIntQueryAux(bool readRom, bool quickQuery)
 {
     struct QueryOptions queryOptions;
     queryOptions.readRom = readRom;
     queryOptions.quickQuery = quickQuery;
 
-    if (!Fs3Verify((VerifyCallBack)NULL, 0, queryOptions)) {
+    if (!FsVerifyAux((VerifyCallBack)NULL, 0, queryOptions)) {
         return false;
     }
     // get chip type and device sw id, from device/image
@@ -621,7 +627,33 @@ bool Fs3Operations::Fs3IntQuery(bool readRom, bool quickQuery)
             return false;
         }
         _fwImgInfo.ext_info.dev_type = swId[0];
+        if (!_fwParams.ignoreCacheRep) {
+            getRunningFwVersion();
+        }
+    } else if(_fwImgInfo.supportedHwIdNum > 0){ // image
+        if (!getInfoFromHwDevid(_fwImgInfo.supportedHwId[0], _fwImgInfo.ext_info.chip_type, &swId)) {
+            return false;
+        }
+        _fwImgInfo.ext_info.dev_type = swId[0];
+    }
+    return true;
+}
+
+bool Fs3Operations::getRunningFwVersion()
+{
+#ifndef UEFI_BUILD
+    struct connectib_icmd_get_fw_info fwVer;
+    memset(&fwVer, 0, sizeof(fwVer));
+    int rc =  gcif_get_fw_info(((Flash*)_ioAccess)->getMfileObj(), &fwVer);
+    if (rc && rc != GCIF_STATUS_UNSUPPORTED_ICMD_VERSION && rc != GCIF_STATUS_INVALID_OPCODE && rc != GCIF_ICMD_NOT_SUPPORTED) {
+        return errmsg("Failed to get running FW version. %s", gcif_err_str(rc));
     }
+    if (!rc) {
+        _fwImgInfo.ext_info.running_fw_ver[0] = fwVer.fw_version.MAJOR;
+        _fwImgInfo.ext_info.running_fw_ver[1] = fwVer.fw_version.MINOR;
+        _fwImgInfo.ext_info.running_fw_ver[2] = fwVer.fw_version.SUBMINOR;
+    }
+#endif
     return true;
 }
 
@@ -630,21 +662,13 @@ bool Fs3Operations::FwQuery(fw_info_t *fwInfo, bool readRom, bool isStripedImage
     //isStripedImage flag is not needed in FS3 image format
     // Avoid warning - no striped image in FS3
     (void)isStripedImage;
-    if (!Fs3IntQuery(readRom)) {
+    if (!FsIntQueryAux(readRom)) {
         return false;
     }
-    //adrianc:  best effort to get chip_type for image on image since it can "theoretically" be used on more than one device , take the first one.
-    if (!_ioAccess->is_flash()) {
-        const u_int32_t* swId = (u_int32_t*)NULL;
-        if (!getInfoFromHwDevid(_fwImgInfo.supportedHwId[0], _fwImgInfo.ext_info.chip_type, &swId)) {
-            return false;
-        }
-        _fwImgInfo.ext_info.dev_type = swId[0];
-    }
 
     memcpy(&(fwInfo->fw_info),  &(_fwImgInfo.ext_info),  sizeof(fw_info_com_t));
     memcpy(&(fwInfo->fs3_info), &(_fs3ImgInfo.ext_info), sizeof(fs3_info_t));
-    fwInfo->fw_type = FIT_FS3;
+    fwInfo->fw_type = FwType();
     return true;
 }
 
@@ -662,31 +686,12 @@ bool Fs3Operations::FwInit()
     return true;
 }
 
-bool Fs3Operations::DevDataHackCheck(struct cibfw_itoc_entry *devTocEntry)
-{
-    if (_fwImgInfo.ext_info.chip_type != CT_CONNECT_IB) {
-        return false;
-    }
-    switch(devTocEntry->type) {
-    case FS3_NV_DATA2 :
-    case FS3_FW_NV_LOG :
-    case FS3_NV_DATA0 :
-        if (devTocEntry->device_data == 0 && devTocEntry->no_crc == 0 && devTocEntry->relative_addr == 1) {
-            return true;
-        }
-        break;
-    default :
-        break;
-    }
-    return false;
-}
-
 #define GET_DIFFER_STR(flash_toc_entry, image_toc_entry) \
         (flash_toc_entry->device_data != image_toc_entry->device_data) ? "device_data" : \
                 (flash_toc_entry->no_crc != image_toc_entry->no_crc)   ? "no_crc" : \
                         (flash_toc_entry->relative_addr != image_toc_entry->relative_addr) ? "relative_addr" : ""
 
-bool Fs3Operations::UpdateDevDataITOC(u_int8_t *image_data, struct toc_info *image_toc_info_entry, struct toc_info *flash_toc_arr, int flash_toc_size)
+bool Fs3Operations::UpdateDevDataITOC(Fs3Operations &imageOps, struct toc_info *image_toc_info_entry, struct toc_info *flash_toc_arr, int flash_toc_size)
 {
     u_int8_t itoc_data[CIBFW_ITOC_ENTRY_SIZE];
     struct cibfw_itoc_entry *image_toc_entry = &image_toc_info_entry->toc_entry;
@@ -699,28 +704,20 @@ bool Fs3Operations::UpdateDevDataITOC(u_int8_t *image_data, struct toc_info *ima
             if ( (flash_toc_entry->device_data != image_toc_entry->device_data) || \
                  (flash_toc_entry->no_crc != image_toc_entry->no_crc) || \
                  (flash_toc_entry->relative_addr != image_toc_entry->relative_addr)) {
-                /* HACK: adrianc:remove at MFT-4.1.0
-                 * if we encounter NV_DATA0/NV_DATA1/FW_NV_LOG that are marked in the device as non dev data
-                 * it means a corrupt binary was burnt on device. take those entries from the image
-                 */
-                if (DevDataHackCheck(flash_toc_entry)) {
-                    // perform HACK : i.e keep itoc entry as is in the image
-                    continue;
-                } else {
                     return errmsg(MLXFW_DEVICE_IMAGE_MISSMATCH_ERR, "An inconsistency was found in %s section attributes. %s ITOC attribute differs",\
                             GetSectionNameByType(image_toc_entry->type), GET_DIFFER_STR(flash_toc_entry, image_toc_entry));
-                }
             }
             // replace itoc entry in the image
             memset(itoc_data, 0, CIBFW_ITOC_ENTRY_SIZE);
             cibfw_itoc_entry_pack(flash_toc_entry, itoc_data);
-            memcpy(&image_data[image_toc_info_entry->entry_addr], itoc_data, CIBFW_ITOC_ENTRY_SIZE);
-            cibfw_itoc_entry_unpack(&image_toc_info_entry->toc_entry, &image_data[image_toc_info_entry->entry_addr]);
+            imageOps.Fs3UpdateImgCache(itoc_data, image_toc_info_entry->entry_addr, CIBFW_ITOC_ENTRY_SIZE);
+            cibfw_itoc_entry_unpack(&image_toc_info_entry->toc_entry, itoc_data);
         }
     }
     return true;
 }
 
+
 // add an itoc entry to the image  (just the entry no the section itself)
 bool Fs3Operations::AddDevDataITOC(struct toc_info *flash_toc_entry, u_int8_t *image_data, struct toc_info *image_toc_arr, int& image_toc_size)
 {
@@ -783,34 +780,8 @@ bool Fs3Operations::CheckFs3ImgSize(Fs3Operations& imageOps, bool useImageDevDat
     return true;
 }
 
-bool Fs3Operations::GetMaxImageSize(u_int32_t flash_size, bool image_is_fs, u_int32_t &max_image_size)
-{
-	// max image size is calculated as the following :
-	// for failsafe image :   flash_size/2 - 6*sector_size
-	// for nonfailsafe image: flash_size - 6*sector_size
-	// the 6*sector_size is for the last two sections on the flash (DEV_INFO and MFG_INFO) which are not part of the image burnt.
-
-    u_int32_t sector_size = _ioAccess->get_sector_size();
-    if (image_is_fs) {
-        max_image_size = (flash_size / 2) - (6 * sector_size);
-    } else {
-        // For non FS image,
-        max_image_size = flash_size - (6 * sector_size);
-    }
-
-return true;
-}
-
 #define SUPPORTS_ISFU(chip_type) \
-    (chip_type == CT_CONNECT_IB || chip_type == CT_CONNECTX4 || chip_type == CT_CONNECTX4_LX)
-
-#define FLASH_RESTORE(origFlashObj) \
-        if (origFlashObj) {\
-            _ioAccess->close();\
-            delete _ioAccess;\
-            _ioAccess = origFlashObj;\
-            _fwParams.ignoreCacheRep = 0;\
-        }
+    (chip_type == CT_CONNECT_IB || chip_type == CT_CONNECTX4 || chip_type == CT_CONNECTX4_LX || chip_type == CT_CONNECTX5)
 
 bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
                                   ExtBurnParams& burnParams)
@@ -818,11 +789,11 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
     u_int8_t  is_curr_image_in_odd_chunks;
     u_int32_t new_image_start;
     u_int32_t total_img_size = 0;
-    u_int32_t sector_size = (_ioAccess->is_flash()) ? _ioAccess->get_sector_size() : FS3_DEFAULT_SECTOR_SIZE;
-
+    u_int32_t sector_size = FS3_DEFAULT_SECTOR_SIZE;
+    u_int8_t imageSignature[16];
     Flash    *f     = (Flash*)(this->_ioAccess);
     FImage   *fim   = (FImage*)(imageOps._ioAccess);
-    u_int8_t *data8 = (u_int8_t *) fim->getBuf();
+    u_int8_t *data8;
 
     if (_fwImgInfo.imgStart != 0 || (!burnParams.burnFailsafe && ((Flash*)_ioAccess)->get_ignore_cache_replacment())) {
         // if the burn is not failsafe and with -ocr, the image is burnt at 0x0
@@ -832,9 +803,8 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
         is_curr_image_in_odd_chunks = 0;
         new_image_start = (1 << imageOps._fwImgInfo.cntxLog2ChunkSize);
     }
-    /*printf("-D- new_image_start = %#x, is_curr_image_in_odd_chunks = %#x\n", new_image_start, is_curr_image_in_odd_chunks);
-    printf("-D- num_of_itocs = %d\n", image_info->num_of_itocs);
-    */
+    /*printf("-D- new_image_start = %#x, is_curr_image_in_odd_chunks = %#x\n", new_image_start, is_curr_image_in_odd_chunks);*/
+
 
     // take chunk size from image in case of a non failsafe burn (in any case they should be the same)
     f->set_address_convertor(imageOps._fwImgInfo.cntxLog2ChunkSize, !is_curr_image_in_odd_chunks);
@@ -850,10 +820,10 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
         struct toc_info *itoc_info_p = &imageOps._fs3ImgInfo.tocArr[i];
         struct cibfw_itoc_entry *toc_entry = &itoc_info_p->toc_entry;
 
-        if (toc_entry->device_data) {// updare dev_data itoc with the device's dev_data section addr
+        if (toc_entry->device_data) {// update dev_data itoc with the device's dev_data section addr
             if (burnParams.burnFailsafe || !burnParams.useImgDevData) {
                 // we update the device data entires if : a. we burn failsafe or b. we burn non-failsafe but we take the device data anyway
-                if(!UpdateDevDataITOC(data8, itoc_info_p, _fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs)){
+                if(!UpdateDevDataITOC(imageOps, itoc_info_p, _fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs)){
                     return false;
                 }
             }
@@ -875,6 +845,7 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
             continue;
         }
     }
+
     // add boot section, itoc array (wo signature)
     total_img_size += imageOps._fs3ImgInfo.itocAddr + sector_size - FS3_FW_SIGNATURE_SIZE;
 
@@ -882,20 +853,27 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
         return errmsg("Failed to burn FW. Internal error.");
     }
 
-    u_int32_t  zeroes     = 0;
     // write the image
     int alreadyWrittenSz=0;
+
+    /* Write begining of image: up to and including ITOCs  W/O signature */
+    u_int32_t beginingWithoutSignatureSize =  imageOps._fs3ImgInfo.itocAddr + sector_size - FS3_FW_SIGNATURE_SIZE;
+    data8 = new u_int8_t[beginingWithoutSignatureSize];
+    imageOps._imageCache.get(data8, FS3_FW_SIGNATURE_SIZE, beginingWithoutSignatureSize);
     // write boot section, itoc array (wo signature)
     if (!writeImage(burnParams.progressFunc,
                     FS3_FW_SIGNATURE_SIZE,
-                    data8 + FS3_FW_SIGNATURE_SIZE,
-                    imageOps._fs3ImgInfo.itocAddr + sector_size - FS3_FW_SIGNATURE_SIZE,
+                    data8,
+                    beginingWithoutSignatureSize,
+                    false,
                     false,
                     total_img_size,
                     alreadyWrittenSz)) {
+        delete[] data8;
         return false;
     }
-    alreadyWrittenSz += imageOps._fs3ImgInfo.itocAddr + sector_size - FS3_FW_SIGNATURE_SIZE;
+    delete[] data8;
+    alreadyWrittenSz += beginingWithoutSignatureSize;
     // write itoc entries data
     for (int i = 0; i < imageOps._fs3ImgInfo.numOfItocs; i++) {
         struct toc_info *itoc_info_p = &imageOps._fs3ImgInfo.tocArr[i];
@@ -906,7 +884,7 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
         }
 
         if (writeSection) {
-            if (!writeImage(burnParams.progressFunc, toc_entry->flash_addr << 2 , &(itoc_info_p->section_data[0]), itoc_info_p->section_data.size(), !toc_entry->relative_addr, total_img_size, alreadyWrittenSz)) {
+            if (!writeImage(burnParams.progressFunc, toc_entry->flash_addr << 2 , &(itoc_info_p->section_data[0]), itoc_info_p->section_data.size(), !toc_entry->relative_addr, false, total_img_size, alreadyWrittenSz)) {
                 return false;
             }
             alreadyWrittenSz += itoc_info_p->section_data.size();
@@ -916,66 +894,30 @@ bool Fs3Operations::BurnFs3Image(Fs3Operations &imageOps,
     if (!f->is_flash()) {
         return true;
     }
+    fim->read(0, imageSignature, 16);
     // Write new signature
-    if (!f->write(0, data8, 16, true)) {
+    if (!f->write(0, imageSignature, 16, true)) {
         return false;
     }
-    bool boot_address_was_updated = true;
-
-    // if we access without cache replacement or the burn was non failsafe, update YU bootloaders.
-    // if we access with cache replacement notify currently running fw of new image start address to crspace (for SW reset)
-    //TODO: add SwitchIB, Spectrum when we have support for ISFU
-    if (!SUPPORTS_ISFU(_fwImgInfo.ext_info.chip_type) || !burnParams.burnFailsafe || f->get_ignore_cache_replacment()) {
-        boot_address_was_updated = f->update_boot_addr(new_image_start);
-    } else {
-        _isfuSupported = Fs3IsfuActivateImage(new_image_start);
-        boot_address_was_updated = _isfuSupported;
-    }
-
-    if (imageOps._fwImgInfo.ext_info.is_failsafe) {
-        if (!burnParams.burnFailsafe) {
-            // When burning in nofs, remnant of older image with different chunk size
-            // may reside on the flash -
-            // Invalidate all images marking on flash except the one we've just burnt
-
-            u_int32_t cntx_image_start[CNTX_START_POS_SIZE];
-            u_int32_t cntx_image_num;
-
-            CntxFindAllImageStart(f, cntx_image_start, &cntx_image_num);
-            // Address convertor is disabled now - use phys addresses
-            for (u_int32_t i = 0; i < cntx_image_num; i++) {
-                if (cntx_image_start[i] != new_image_start) {
-                    if (!f->write(cntx_image_start[i], &zeroes, sizeof(zeroes), true)) {
-                        return errmsg(MLXFW_FLASH_WRITE_ERR, "Failed to invalidate old fw signature: %s", f->err());
-                    }
-                }
-            }
-        } else {
-            // invalidate previous signature
-            f->set_address_convertor(imageOps._fwImgInfo.cntxLog2ChunkSize, is_curr_image_in_odd_chunks);
-            if (!f->write(0, &zeroes, sizeof(zeroes), true)) {
-                return errmsg(MLXFW_FLASH_WRITE_ERR, "Failed to invalidate old fw signature: %s", f->err());
-            }
-        }
-    }
-    if (boot_address_was_updated == false) {
-        report_warn("Failed to update FW boot address. Power cycle the device in order to load the new FW.\n");
-    }
-    return true;
+    return DoAfterBurnJobs(_cntx_magic_pattern, imageOps, burnParams, f,
+            new_image_start, is_curr_image_in_odd_chunks);
 }
-bool Fs3Operations::Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams)
+
+bool Fs3Operations::FsBurnAux(FwOperations *imgops, ExtBurnParams& burnParams)
 {
+    Fs3Operations& imageOps = * ((Fs3Operations *) imgops);
+
     if (imageOps.FwType() != FIT_FS3) {
         return errmsg(MLXFW_IMAGE_FORMAT_ERR, "FW image type is not FS3\n");
     }
-    bool devIntQueryRes = Fs3IntQuery();
+    bool devIntQueryRes = FsIntQueryAux();
 
     if (!devIntQueryRes && burnParams.burnFailsafe) {
         return false;
     }
 
     // for image we execute full verify to bring all the information needed for ROM Patch
-    if (!imageOps.Fs3IntQuery(true, false)) {
+    if (!imageOps.FsIntQueryAux(true, false)) {
           return false;
     }
     // Check Matching device ID
@@ -1024,27 +966,10 @@ bool Fs3Operations::Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams)
         }
     }
 
-    Fs3Operations *imgToBurn = &imageOps;
-    bool createNewImg = false;
-    std::vector<u_int8_t> newImageData(imageOps._fwImgInfo.lastImageAddr);
-
     if (devIntQueryRes && !CheckPSID(imageOps, burnParams.allowPsidChange)) {
         return false;
     }
 
-    // no access to flash parameters under uefi
-#ifndef UEFI_BUILD
-    // TODO: adrianc: remove this in MFT-4.1.0
-    if(burnParams.burnFailsafe) {
-        if(!CheckAndFixCX4(false)) {
-            return false;
-        }
-        if(!FixCX4WriteProtection(false)) {
-            return false;
-        }
-    }
-#endif
-
     if (burnParams.burnFailsafe) {
         // Check image and device chunk sizes are Ok
         if (_fwImgInfo.cntxLog2ChunkSize != imageOps._fwImgInfo.cntxLog2ChunkSize) {
@@ -1066,6 +991,11 @@ bool Fs3Operations::Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams)
             return false;
         }
 
+        // Check TimeStamp
+        if (!TestAndSetTimeStamp(imageOps)) {
+            return false;
+        }
+
         // ROM patchs
         if (((burnParams.burnRomOptions == ExtBurnParams::BRO_FROM_DEV_IF_EXIST) && (_fwImgInfo.ext_info.roms_info.exp_rom_found)) || // There is ROM in device and user choses to keep it
                 ((burnParams.burnRomOptions == ExtBurnParams::BRO_DEFAULT) && (!imageOps._fwImgInfo.ext_info.roms_info.exp_rom_found && _fwImgInfo.ext_info.roms_info.exp_rom_found))) { // No ROM in image and ROM in device
@@ -1074,15 +1004,14 @@ bool Fs3Operations::Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams)
             // 1. use Fs3ModifySection to integrate _romSect buff with the image , newImageData contains the modified image buffer
             std::vector<u_int8_t> romSect = _romSect;
             TOCPUn((u_int32_t*)&romSect[0], romSect.size()/4);
-            if (!imageOps.Fs3ReplaceSectionInDevImg(FS3_ROM_CODE, FS3_PCI_CODE, true, (u_int8_t*)&newImageData[0], imageOps._fwImgInfo.lastImageAddr,
-                    (u_int32_t*)&romSect[0], (u_int32_t)romSect.size(), true)) {
+            if (!imageOps.Fs3ReplaceSectionInDevImg(FS3_ROM_CODE, FS3_PCI_CODE, true, (u_int8_t*)NULL, 0,
+                    (u_int32_t*)&romSect[0], (u_int32_t)romSect.size())) {
                 return errmsg(MLXFW_ROM_UPDATE_IN_IMAGE_ERR, "failed to update ROM in image. %s", imageOps.err());
             }
-            createNewImg = true;
-        }
 
+        }
         // image vsd patch
-        if (!burnParams.useImagePs && burnParams.vsdSpecified ) {
+        if (!burnParams.useImagePs && (burnParams.vsdSpecified || burnParams.useDevImgInfo)) {
             // get image info section :
             struct toc_info *imageInfoToc = (struct toc_info *)NULL;
             if (!imageOps.Fs3GetItocInfo(imageOps._fs3ImgInfo.tocArr, imageOps._fs3ImgInfo.numOfItocs, FS3_IMAGE_INFO, imageInfoToc)){
@@ -1092,41 +1021,27 @@ bool Fs3Operations::Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams)
             std::vector<u_int8_t> imageInfoSect = imageInfoToc->section_data;
             struct cibfw_image_info image_info;
             cibfw_image_info_unpack(&image_info, &imageInfoSect[0]);
-            strncpy(image_info.vsd, burnParams.userVsd, VSD_LEN);
-            cibfw_image_info_pack(&image_info, &imageInfoSect[0]);
-            // re-insert it into the image:
-            if (!imageOps.Fs3ReplaceSectionInDevImg(FS3_IMAGE_INFO, FS3_FW_ADB, true, (u_int8_t*)&newImageData[0], imageOps._fwImgInfo.lastImageAddr,
-                    (u_int32_t*)&imageInfoSect[0], (u_int32_t)imageInfoSect.size(), true)) {
-                return errmsg(MLXFW_UPDATE_SECT_ERR, "failed to update image VSD in image. %s", imageOps.err());
+            if (burnParams.vsdSpecified) {
+                strncpy(image_info.vsd, burnParams.userVsd, VSD_LEN);
             }
-            createNewImg = true;
-        }
-
-        // create fs3Operation Obj (handl type BUFF) if NEEDED
-        // open the image buffer
-        if (createNewImg) {
-            FwOperations* newImageOps = FwOperationsCreate((void*)&newImageData[0], (void*)&imageOps._fwImgInfo.lastImageAddr, (char*)NULL, FHT_FW_BUFF);
-            if (!newImageOps) {
-                return errmsg(MLXFW_IMAGE_CORRUPTED_ERR, "Internal error: The prepared image is corrupted.");
+            cibfw_image_info_pack(&image_info, &imageInfoSect[0]);
+            if (burnParams.useDevImgInfo) {
+                // update PSID, name and description in image info
+                struct tools_open_image_info tools_image_info;
+                tools_open_image_info_unpack(&tools_image_info, &imageInfoSect[0]);
+                strncpy(tools_image_info.psid, _fwImgInfo.ext_info.psid, PSID_LEN - 1);
+                strncpy(tools_image_info.name, _fs3ImgInfo.ext_info.name, NAME_LEN - 1);
+                strncpy(tools_image_info.description, _fs3ImgInfo.ext_info.description, DESCRIPTION_LEN - 1);
+                tools_open_image_info_pack(&tools_image_info, &imageInfoSect[0]);
             }
-            // 3. verify it
-            if (!((Fs3Operations*)newImageOps)->Fs3IntQuery(true,false)) {
-                errmsg(MLXFW_IMAGE_CORRUPTED_ERR, "Internal error: The prepared image is corrupted: %s", newImageOps->err());
-                newImageOps->FwCleanUp();
-                delete newImageOps;
-                return false;
+            // re-insert it into the image:
+            if (!imageOps.Fs3ReplaceSectionInDevImg(FS3_IMAGE_INFO, FS3_FW_ADB, true,(u_int8_t*) NULL, 0,
+                    (u_int32_t*)&imageInfoSect[0], (u_int32_t)imageInfoSect.size())) {
+                return errmsg(MLXFW_UPDATE_SECT_ERR, "failed to update IMAGE_INFO section in image. %s", imageOps.err());
             }
-            // 4. pass it to BurnFs3Image instead of imageOps
-            imgToBurn = (Fs3Operations*)newImageOps;
         }
     }
-    bool rc = BurnFs3Image(*imgToBurn, burnParams);
-    if (imgToBurn != &imageOps) {
-        imgToBurn->FwCleanUp();
-        delete imgToBurn;
-    }
-
-    return rc ;
+    return BurnFs3Image(imageOps, burnParams);
 }
 
 bool Fs3Operations::FwBurn(FwOperations *imageOps, u_int8_t forceVersion, ProgressCallBack progressFunc)
@@ -1139,7 +1054,8 @@ bool Fs3Operations::FwBurn(FwOperations *imageOps, u_int8_t forceVersion, Progre
     burnParams.ignoreVersionCheck = forceVersion;
     burnParams.progressFunc = progressFunc;
 
-    return Fs3Burn((*(Fs3Operations*)imageOps), burnParams);
+    return FsBurnAux(imageOps, burnParams);
+
 }
 
 bool Fs3Operations::FwBurnAdvanced(FwOperations *imageOps, ExtBurnParams& burnParams)
@@ -1147,7 +1063,7 @@ bool Fs3Operations::FwBurnAdvanced(FwOperations *imageOps, ExtBurnParams& burnPa
     if (imageOps == NULL) {
         return errmsg("bad parameter is given to FwBurnAdvanced\n");
     }
-    return Fs3Burn((*(Fs3Operations*)imageOps), burnParams);
+    return FsBurnAux(imageOps, burnParams);
 }
 
 bool Fs3Operations::FwBurnBlock(FwOperations *imageOps, ProgressCallBack progressFunc)
@@ -1173,20 +1089,18 @@ bool Fs3Operations::FwReadData(void* image, u_int32_t* imageSize)
         queryOptions.quickQuery = true;
     }
     // Avoid Warning
-    if (!Fs3Verify((VerifyCallBack)NULL, 0, queryOptions)) {
+    if (!FsVerifyAux((VerifyCallBack)NULL, 0, queryOptions)) {
         return false;
     }
 
-    if (image != NULL) {
-        memcpy(image,  &_fs3ImgInfo.imageCache[0], _fwImgInfo.lastImageAddr);
-    }
+    _imageCache.get((u_int8_t*)image, _fwImgInfo.lastImageAddr);
     *imageSize = _fwImgInfo.lastImageAddr;
     return true;
 }
 
 bool Fs3Operations::FwReadRom(std::vector<u_int8_t>& romSect)
 {
-    if (!Fs3IntQuery()) {
+    if (!FsIntQueryAux()) {
         return false;
     }
     if (_romSect.empty()) {
@@ -1207,7 +1121,7 @@ bool Fs3Operations::FwGetSection (u_int32_t sectType, std::vector<u_int8_t>& sec
     }
     //set the sector to read (need to remove it after read)
     _readSectList.push_back(sectType);
-    if (!Fs3IntQuery()) {
+    if (!FsIntQueryAux()) {
         _readSectList.pop_back();
         return false;
     }
@@ -1240,7 +1154,7 @@ bool Fs3Operations::FwSetMFG(fs3_uid_t baseGuid, PrintCallBack callBackFunc)
         return false;
     }
     // on image verify that image is OK after modification (we skip this on device for performance reasons)
-    if (!_ioAccess->is_flash() && !Fs3IntQuery(false, false)) {
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, false)) {
         return false;
     }
     return true;
@@ -1263,7 +1177,7 @@ bool Fs3Operations::FwSetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc,
         return errmsg("Base GUID not found.");
     }
     //query device to get mfg info (for guids override en bit)
-    if (!Fs3IntQuery(false)) {
+    if (!FsIntQueryAux(false)) {
         return false;
     }
 
@@ -1281,10 +1195,10 @@ bool Fs3Operations::FwSetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc,
     usrGuid.base_mac_specified = false;
     usrGuid.set_mac_from_guid = false;
 
-    if (sgParam.guidsSpecified || sgParam.uidsSpecified) {
+    if (sgParam.guidsSpecified || sgParam.uidSpecified) {
         usrGuid.base_guid_specified = true;
         usrGuid.base_guid = sgParam.userGuids[0];
-        usrGuid.set_mac_from_guid = sgParam.uidsSpecified ? true : false;
+        usrGuid.set_mac_from_guid = sgParam.uidSpecified ? true : false;
     }
     if (sgParam.macsSpecified) {
         // check base mac
@@ -1303,7 +1217,7 @@ bool Fs3Operations::FwSetGuids(sg_params_t& sgParam, PrintCallBack callBackFunc,
         return false;
     }
     // on image verify that image is OK after modification (we skip this on device for performance reasons)
-    if (!_ioAccess->is_flash() && !Fs3IntQuery(false, false)) {
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, false)) {
         return false;
     }
     return true;
@@ -1320,7 +1234,7 @@ bool Fs3Operations::FwSetVPD(char* vpdFileStr, PrintCallBack callBackFunc)
         return false;
     }
     // on image verify that image is OK after modification (we skip this on device for performance reasons)
-    if (!_ioAccess->is_flash() && !Fs3IntQuery(false, false)) {
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, false)) {
         return false;
     }
     return true;
@@ -1399,22 +1313,29 @@ bool Fs3Operations::UpdateItocAfterInsert(fs3_section_t sectionType, u_int32_t n
         shiftSize -= removedOrNewSectSize;
     }
     numOfItocs = 0;
+    int shifEntryToc = 0;
+    u_int32_t shiftEntryAddr = -1;
+    int ignoreShiftIdx = -1;
     for (int i = 0; i < _fs3ImgInfo.numOfItocs; i++) {
         struct toc_info *curr_itoc = &_fs3ImgInfo.tocArr[i];
         struct toc_info *newTocInfo = &tocArr[numOfItocs];
         u_int32_t currSectaddr =  curr_itoc->toc_entry.flash_addr << 2; // Put it in one place
-
+        //printf("-D- BEFORE : Entry Type: %#x, Entry offset: %#x\n", curr_itoc->toc_entry.type, curr_itoc->entry_addr);
         if (currSectaddr > newSectAddr) {
             if (!curr_itoc->toc_entry.relative_addr) {
 
                 CopyItocInfo(newTocInfo, curr_itoc);
             } else {
                 ShiftItocAddrInEntry(newTocInfo, curr_itoc, shiftSize);
+
             }
         } else if (currSectaddr == newSectAddr) {
+            shiftEntryAddr = curr_itoc->entry_addr + CIBFW_ITOC_ENTRY_SIZE;
             if (!toAdd) {
+                shifEntryToc = -1 * CIBFW_ITOC_ENTRY_SIZE;
                 continue;
             }
+            shifEntryToc = CIBFW_ITOC_ENTRY_SIZE;
             CopyItocInfo(newTocInfo, curr_itoc);
             Fs3UpdateItocInfo(newTocInfo, newSectAddr, sectionType, newSectData, removedOrNewSectSize);
 
@@ -1422,6 +1343,10 @@ bool Fs3Operations::UpdateItocAfterInsert(fs3_section_t sectionType, u_int32_t n
                 // put next section
                 newTocInfo = &tocArr[++numOfItocs];
                 ShiftItocAddrInEntry(newTocInfo, curr_itoc, shiftSize);
+                newTocInfo->entry_addr = shiftEntryAddr;
+                ignoreShiftIdx = numOfItocs;
+            } else {
+                shifEntryToc = 0;
             }
         } else {
              // just Copy the ITOC as is
@@ -1429,6 +1354,15 @@ bool Fs3Operations::UpdateItocAfterInsert(fs3_section_t sectionType, u_int32_t n
         }
         numOfItocs++;
     }
+    if (shifEntryToc) {
+        for (int i = 0; i < (int)numOfItocs; i++) {
+            struct toc_info *tocInfo = &tocArr[i];
+            if (i != ignoreShiftIdx && tocInfo->entry_addr >= shiftEntryAddr) {
+                tocInfo->entry_addr += shifEntryToc;
+            }
+            //printf("-D- AFTER : Entry Type: %#x, Entry offset: %#x\n", tocInfo->toc_entry.type, tocInfo->entry_addr);
+        }
+    }
     return true;
 }
 
@@ -1436,8 +1370,14 @@ bool Fs3Operations::UpdateImageAfterInsert(struct toc_info *tocArr, u_int32_t nu
 {
 
     // Copy data before itocAddr and ITOC header
-    memcpy(newImgData, &_fs3ImgInfo.imageCache[0], _fs3ImgInfo.itocAddr);
-    memcpy(&newImgData[_fs3ImgInfo.itocAddr], _fs3ImgInfo.itocHeader, CIBFW_ITOC_HEADER_SIZE);
+    //memcpy(newImgData, &_imageCache[0], _fs3ImgInfo.itocAddr);
+    if (newImgData) {
+        _imageCache.get(newImgData, _fs3ImgInfo.itocAddr);
+        memcpy(&newImgData[_fs3ImgInfo.itocAddr], _fs3ImgInfo.itocHeader, CIBFW_ITOC_HEADER_SIZE);
+    } else {
+        Fs3UpdateImgCache(_fs3ImgInfo.itocHeader, _fs3ImgInfo.itocAddr, CIBFW_ITOC_HEADER_SIZE);
+        newImageSize = _fwImgInfo.lastImageAddr;
+    }
     for (int i = 0; i < (int)numOfItocs; i++) {
         // Inits
         u_int32_t itocOffset = _fs3ImgInfo.itocAddr + CIBFW_ITOC_HEADER_SIZE + i * CIBFW_ITOC_ENTRY_SIZE;
@@ -1453,25 +1393,50 @@ bool Fs3Operations::UpdateImageAfterInsert(struct toc_info *tocArr, u_int32_t nu
             return errmsg("Internal error: Sectoion size of %s (0x%x) is not equal to allocated memory for it(0x%x)", GetSectionNameByType(sectType),
                     sectSize, (u_int32_t)currItoc->section_data.size());
         }
+        if (!newImgData) {
+            Fs3UpdateImgCache(currItoc->data, itocOffset, CIBFW_ITOC_ENTRY_SIZE);
+            Fs3UpdateImgCache(&currItoc->section_data[0], sectAddr, sectSize);
+        } else {
+            memcpy(&newImgData[itocOffset], currItoc->data, CIBFW_ITOC_ENTRY_SIZE);
 
-        memcpy(&newImgData[itocOffset], currItoc->data, CIBFW_ITOC_ENTRY_SIZE);
-
-        memcpy(&newImgData[sectAddr], &currItoc->section_data[0], sectSize);
+            memcpy(&newImgData[sectAddr], &currItoc->section_data[0], sectSize);
+        }
     }
     u_int32_t lastItocSect = _fs3ImgInfo.itocAddr + CIBFW_ITOC_HEADER_SIZE + numOfItocs * CIBFW_ITOC_ENTRY_SIZE;
-    memset(&newImgData[lastItocSect], FS3_END, CIBFW_ITOC_ENTRY_SIZE);
+    if (!newImgData) {
+        u_int8_t fs3_end_buf[CIBFW_ITOC_ENTRY_SIZE] = {FS3_END};
+        Fs3UpdateImgCache(fs3_end_buf, lastItocSect, CIBFW_ITOC_ENTRY_SIZE);
+    } else {
+        memset(&newImgData[lastItocSect], FS3_END, CIBFW_ITOC_ENTRY_SIZE);
+    }
+
     return true;
 }
 
+/*
+ * Adrianc: this is probably the longest method signature in this file. to make things clear:
+ *              Fs3ReplaceSectionInDevImg() adds a new section to the firmware image or removes an exsisting section from the firmware image.
+ *              if user specified newImgData, the modified image (after add/remove) will be copied to the buffer, else the object itself will be modified
+ *              (i.e imageCache and itocs updated)
+ *
+ *@param sectionType : section type to add or remove
+ *@param nextSectionType : in case of adding, add the new section before this section type
+ *@param toAdd : specifies whether the operation is add or remove
+ *@param newImageData : if not null the new modified image will be written here (object context remains un-changed)
+ *@param newImageSize:  size of newImageData
+ *@param newSectData : data buffer of the section to be added
+ *@param newSectSize : newSectData size
+ *@param UpdateExsistingTocArr: update the objects itoc array
+ * */
+
 bool Fs3Operations::Fs3ReplaceSectionInDevImg(fs3_section_t sectionType, fs3_section_t nextSectionType, bool toAdd, u_int8_t* newImgData, u_int32_t newImageSize,
-        u_int32_t* newSectData, u_int32_t NewSectSize, bool UpdateExsistingTocArr)
+        u_int32_t* newSectData, u_int32_t NewSectSize)
 {
     u_int32_t newSectAddr;
     u_int32_t numOfItocs;
     struct toc_info tocArr[MAX_TOCS_NUM];
     fs3_section_t sectToPut;
     u_int32_t oldSectSize;
-
     if (!GetModifiedSectionInfo(sectionType, nextSectionType, newSectAddr, sectToPut, oldSectSize)) {
         return false;
     }
@@ -1483,8 +1448,7 @@ bool Fs3Operations::Fs3ReplaceSectionInDevImg(fs3_section_t sectionType, fs3_sec
     if (!UpdateImageAfterInsert(tocArr, numOfItocs, newImgData, newImageSize)) {
         return false;
     }
-
-    if (UpdateExsistingTocArr) {
+    if (!newImgData) { // uptade was perform on the object, update its itoc array
     	_fs3ImgInfo.numOfItocs = numOfItocs;
     	for (u_int32_t i=0;i < numOfItocs;i++) {
     		_fs3ImgInfo.tocArr[i] = tocArr[i];
@@ -1528,7 +1492,6 @@ bool Fs3Operations::Fs3RemoveSection(fs3_section_t sectionType, ProgressCallBack
     return Fs3ModifySection(sectionType, sectionType, false, (u_int32_t*)NULL, 0, progressFunc);
 }
 
-
 bool Fs3Operations::FwBurnRom(FImage* romImg, bool ignoreProdIdCheck, bool ignoreDevidCheck,
         ProgressCallBack progressFunc)
 {
@@ -1544,10 +1507,14 @@ bool Fs3Operations::FwBurnRom(FImage* romImg, bool ignoreProdIdCheck, bool ignor
     if (!FwOperations::getRomsInfo(romImg, romsInfo)) {
             return errmsg("Failed to read given ROM.");
     }
-    if (!Fs3IntQuery(false)) {
+    if (!FsIntQueryAux(false)) {
         return false;
     }
 
+    if (getInfoFromChipType(_fwImgInfo.ext_info.chip_type).chipFamilyType != CFT_HCA) {
+        return errmsg("Burn ROM is supported only for HCA devices.");
+    }
+
     if (!ignoreProdIdCheck && strcmp(_fwImgInfo.ext_info.product_ver, "") != 0) {
         return errmsg("The device FW contains common FW/ROM Product Version - The ROM cannot be updated separately.");
     }
@@ -1556,16 +1523,24 @@ bool Fs3Operations::FwBurnRom(FImage* romImg, bool ignoreProdIdCheck, bool ignor
         return errmsg("Image file ROM: FW is for device %d, but Exp-ROM is for device %d\n", _fwImgInfo.ext_info.dev_type,
                 romsInfo.exp_rom_com_devid);
     }
+    // Burning ROM is not allowed on Device with Timestamp enabled.
+    if (DeviceTimestampEnabled()) {
+        return errmsg("A valid Timestamp was detected on device. ROM cannot be updated. reset timestamp and resume operation");
+    }
     return Fs3AddSection(FS3_ROM_CODE, FS3_PCI_CODE, romImg->getBuf(), romImg->getBufLength(), progressFunc);
 }
 
 bool Fs3Operations::FwDeleteRom(bool ignoreProdIdCheck, ProgressCallBack progressFunc)
 {
     //run int query to get product ver
-    if (!Fs3IntQuery(true)) {
+    if (!FsIntQueryAux(true)) {
         return false;
     }
 
+    if (getInfoFromChipType(_fwImgInfo.ext_info.chip_type).chipFamilyType != CFT_HCA) {
+        return errmsg("Delete ROM is supported only for HCA devices.");
+    }
+
     if (_romSect.empty()) {
         return errmsg("The FW does not contain a ROM section");
     }
@@ -1573,7 +1548,10 @@ bool Fs3Operations::FwDeleteRom(bool ignoreProdIdCheck, ProgressCallBack progres
     if (!ignoreProdIdCheck && strcmp(_fwImgInfo.ext_info.product_ver, "") != 0) {
         return errmsg("The device FW contains common FW/ROM Product Version - The ROM cannot be updated separately.");
     }
-
+    // Deleting ROM is not allowed on Device with Timestamp enabled.
+    if (DeviceTimestampEnabled()) {
+        return errmsg("A valid Timestamp was detected on device. ROM cannot be updated. reset timestamp and resume operation");
+    }
     return Fs3RemoveSection(FS3_ROM_CODE, progressFunc);
 }
 
@@ -1594,6 +1572,7 @@ bool Fs3Operations::Fs3UpdateMfgUidsSection(struct toc_info *curr_toc, std::vect
 {
     struct cibfw_mfg_info cib_mfg_info;
     struct cx4fw_mfg_info cx4_mfg_info;
+    (void)curr_toc;
     cibfw_mfg_info_unpack(&cib_mfg_info, (u_int8_t*)&section_data[0]);
 
     if (CHECK_MFG_OLD_FORMAT(cib_mfg_info)) {
@@ -1609,7 +1588,6 @@ bool Fs3Operations::Fs3UpdateMfgUidsSection(struct toc_info *curr_toc, std::vect
         return errmsg("Unknown MFG_INFO format version (%d.%d).", cib_mfg_info.major_version, cib_mfg_info.minor_version);
     }
     newSectionData = section_data;
-    memset((u_int8_t*)&newSectionData[0], 0, curr_toc->toc_entry.size * 4);
 
     if (CHECK_MFG_NEW_FORMAT(cib_mfg_info)) {
         cx4fw_mfg_info_pack(&cx4_mfg_info, (u_int8_t*)&newSectionData[0]);
@@ -1686,6 +1664,7 @@ bool Fs3Operations::Fs3UpdateUidsSection(struct toc_info *curr_toc, std::vector<
 {
     struct cibfw_device_info cib_dev_info;
     struct cx4fw_device_info cx4_dev_info;
+    (void)curr_toc;
     cibfw_device_info_unpack(&cib_dev_info, (u_int8_t*)&section_data[0]);
 
     if (CHECK_DEV_INFO_OLD_FORMAT(cib_dev_info)) {
@@ -1701,7 +1680,6 @@ bool Fs3Operations::Fs3UpdateUidsSection(struct toc_info *curr_toc, std::vector<
         return errmsg("Unknown DEV_INFO format version (%d.%d).", cib_dev_info.major_version, cib_dev_info.minor_version);
     }
     newSectionData = section_data;
-    memset((u_int8_t*)&newSectionData[0], 0, curr_toc->toc_entry.size * 4);
 
     if (CHECK_DEV_INFO_NEW_FORMAT(cib_dev_info)) {
         cx4fw_device_info_pack(&cx4_dev_info, (u_int8_t*)&newSectionData[0]);
@@ -1715,11 +1693,11 @@ bool Fs3Operations::Fs3UpdateVsdSection(struct toc_info *curr_toc, std::vector<u
         std::vector<u_int8_t>  &newSectionData)
 {
     struct cibfw_device_info dev_info;
+    (void)curr_toc;
     cibfw_device_info_unpack(&dev_info, (u_int8_t*)&section_data[0]);
     memset(dev_info.vsd, 0, sizeof(dev_info.vsd));
     strncpy(dev_info.vsd, user_vsd, TOOLS_ARR_SZ(dev_info.vsd) - 1);
     newSectionData = section_data;
-    memset((u_int8_t*)&newSectionData[0], 0, curr_toc->toc_entry.size * 4);
     cibfw_device_info_pack(&dev_info, (u_int8_t*)&newSectionData[0]);
     return true;
 }
@@ -1737,6 +1715,11 @@ bool Fs3Operations::Fs3UpdateVpdSection(struct toc_info *curr_toc, char *vpd,
         delete[] vpd_data;
         return errmsg("Size of VPD file: %d is not 4-byte alligned!", vpd_size);
     }
+    // assuming VPD section is the last piece of Data on the flash
+    if ( (_ioAccess)->is_flash() && (getAbsAddr(curr_toc) + vpd_size > (_ioAccess)->get_size())) {
+        delete[] vpd_data;
+        return errmsg("VPD data exceeds flash size, max VPD size: 0x%x bytes", (_ioAccess)->get_size() - getAbsAddr(curr_toc));
+    }
     GetSectData(newSectionData, (u_int32_t*)vpd_data, vpd_size);
     curr_toc->toc_entry.size = vpd_size / 4;
     delete[] vpd_data;
@@ -1768,7 +1751,6 @@ bool Fs3Operations::Fs3GetNewSectionAddr(struct toc_info *curr_toc, u_int32_t &N
         // (i.e we assume they are located in: mfg_addr - 4k and mfg_addr - 8k)
         devInfoAddr1 = (toc->toc_entry.flash_addr << 2) - 0x1000;
         devInfoAddr2 = (toc->toc_entry.flash_addr << 2) - 0x2000;
-        //printf("-D-mfg_section: 0x%x devInfoAddr1: 0x%x devInfoAddr2: 0x%x\n", toc->toc_entry.flash_addr, devInfoAddr1, devInfoAddr2);
 
         if ((flash_addr == devInfoAddr1) || (flash_addr == devInfoAddr2)){
             NewSectionAddr = (flash_addr == devInfoAddr1) ? devInfoAddr2 : devInfoAddr1;
@@ -1833,7 +1815,7 @@ bool Fs3Operations::Fs3ReburnItocSection(u_int32_t newSectionAddr,
 
     PRINT_PROGRESS(callBackFunc, message);
 
-    if (!writeImage((ProgressCallBack)NULL, newSectionAddr , (u_int8_t*)&newSectionData[0], newSectionSize, true)) {
+    if (!writeImage((ProgressCallBack)NULL, newSectionAddr , (u_int8_t*)&newSectionData[0], newSectionSize, true, true)) {
     	PRINT_PROGRESS(callBackFunc, (char*)"FAILED\n");
         return false;
     }
@@ -1854,7 +1836,7 @@ bool  Fs3Operations::Fs3UpdateSection(void *new_info, fs3_section_t sect_type, b
     const char *type_msg;
     // init sector to read
     _readSectList.push_back(sect_type);
-    if (!Fs3IntQuery()) {
+    if (!FsIntQueryAux()) {
         _readSectList.pop_back();
         return false;
     }
@@ -1928,7 +1910,7 @@ bool Fs3Operations::FwSetVSD(char* vsdStr, ProgressCallBack progressFunc, PrintC
         return false;
     }
     // on image verify that image is OK after modification (we skip this on device for performance reasons)
-    if (!_ioAccess->is_flash() && !Fs3IntQuery(false, false)) {
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, false)) {
         return false;
     }
     return true;
@@ -1947,7 +1929,7 @@ bool Fs3Operations::FwResetNvData()
 	/*
 	// future support for cx4
 
-	if (!Fs3IntQuery(false)) {
+	if (!FsIntQueryAux(false)) {
 		return false;
 	}
 	if (_fwImgInfo.ext_info.chip_type != CT_CONNECTX) {
@@ -2030,7 +2012,7 @@ bool Fs3Operations::getFirstDevDataAddr(u_int32_t& firstAddr) {
 bool Fs3Operations::reburnItocSection(PrintCallBack callBackFunc) {
 
     // HACK SHOULD BE REMOVED ASAP
-    u_int32_t sector_size = (_ioAccess->is_flash()) ? _ioAccess->get_sector_size() : FS3_DEFAULT_SECTOR_SIZE;
+    u_int32_t sector_size = FS3_DEFAULT_SECTOR_SIZE;
     // Itoc section is failsafe (two sectors after boot section are reserved for itoc entries)
     u_int32_t oldItocAddr = _fs3ImgInfo.itocAddr;
     u_int32_t newItocAddr = (_fs3ImgInfo.firstItocIsEmpty) ? (_fs3ImgInfo.itocAddr - sector_size) :  (_fs3ImgInfo.itocAddr + sector_size);
@@ -2045,7 +2027,7 @@ bool Fs3Operations::reburnItocSection(PrintCallBack callBackFunc) {
     memset(&p[itocSize] - CIBFW_ITOC_ENTRY_SIZE, FS3_END, CIBFW_ITOC_ENTRY_SIZE);
 
     PRINT_PROGRESS(callBackFunc, (char*)"Updating ITOC section - ");
-    bool rc = writeImage((ProgressCallBack)NULL, newItocAddr , p, itocSize, false);
+    bool rc = writeImage((ProgressCallBack)NULL, newItocAddr , p, itocSize, false, true);
     delete[] p;
     if (!rc) {
     	PRINT_PROGRESS(callBackFunc,(char*)"FAILED\n");
@@ -2055,7 +2037,7 @@ bool Fs3Operations::reburnItocSection(PrintCallBack callBackFunc) {
     u_int32_t zeros = 0;
 
     PRINT_PROGRESS(callBackFunc,(char*)"Restoring signature   - ");
-    if (!writeImage((ProgressCallBack)NULL, oldItocAddr, (u_int8_t*)&zeros, 4, false)) {
+    if (!writeImage((ProgressCallBack)NULL, oldItocAddr, (u_int8_t*)&zeros, 4, false, true)) {
         PRINT_PROGRESS(callBackFunc,(char*)"FAILED\n");
         return false;
     }
@@ -2105,7 +2087,7 @@ bool Fs3Operations::FwShiftDevData(PrintCallBack progressFunc)
 
 	//query device and get device data sectors.
 	PUSH_DEV_DATA(_readSectList);
-    if (!Fs3IntQuery()) {
+    if (!FsIntQueryAux()) {
     	POP_DEV_DATA(_readSectList);
         return false;
     }
@@ -2127,7 +2109,7 @@ bool Fs3Operations::FwShiftDevData(PrintCallBack progressFunc)
 		return errmsg("Failed to get MFG_INFO ITOC information.");
 	}
 
-	if (getAbsAddr(mfgToc) < _ioAccess->get_size() - _ioAccess->get_sector_size()) {
+	if (getAbsAddr(mfgToc) < _ioAccess->get_size() - (((Flash*)(_ioAccess))->get_sector_size())) {
 		return errmsg("Device data sections already shifted.");
 	}
 
@@ -2158,7 +2140,7 @@ bool Fs3Operations::FwShiftDevData(PrintCallBack progressFunc)
                 return false;
             }
             // write the section to its new place in the flash
-            if (!writeImage((ProgressCallBack)NULL, getAbsAddr(currToc) , (u_int8_t*)&currToc->section_data[0], (currToc->toc_entry.size << 2), true)) {
+            if (!writeImage((ProgressCallBack)NULL, getAbsAddr(currToc) , (u_int8_t*)&currToc->section_data[0], (currToc->toc_entry.size << 2), true, true)) {
                 PRINT_PROGRESS(progressFunc,(char*)"FAILED\n");
                 return false;
             }
@@ -2227,20 +2209,16 @@ const char* Fs3Operations::FwGetResetRecommandationStr()
 bool Fs3Operations::Fs3IsfuActivateImage(u_int32_t newImageStart)
 {
     int rc = 0;
-    mfile *mf = (mfile*)NULL;
+    mfile *mf = _ioAccess->is_flash() ? ((Flash*)_ioAccess)->getMfileObj() : (mfile*)NULL;
     struct cibfw_register_mfai mfai;
     struct cibfw_register_mfrl mfrl;
     memset(&mfai, 0, sizeof(mfai));
     memset(&mfrl, 0, sizeof(mfrl));
 
-    if (!_devName) {// not an mst device
-        return true;
-    }
-    // send MFRL register
-    mf = mopen(_devName);
     if (!mf) {
-        return false;
+        return errmsg("Failed to activate image. No mfile object found.");
     }
+
     mfai.address = newImageStart;
     mfai.use_address = 1;
     rc = reg_access_mfai(mf,REG_ACCESS_METHOD_SET, &mfai);
@@ -2253,256 +2231,336 @@ bool Fs3Operations::Fs3IsfuActivateImage(u_int32_t newImageStart)
     // ignore ME_REG_ACCESS_BAD_PARAM error for old FW
     rc = (rc == ME_REG_ACCESS_BAD_PARAM) ? ME_OK : rc;
 cleanup:
-    mclose(mf);
     if (rc) {
         return errmsg("Failed to activate image. %s", m_err2str((MError)rc));
     }
     return true;
 }
 
-
-#define IS_EMPTY_CX4_MFG_UIDS(fs3_uids_info) \
-        (((fs3_uids_info).cx4_uids.base_guid.uid == 0x0ULL) &&  ((fs3_uids_info).cx4_uids.base_mac.uid == 0x0ULL))
-
-
-#define GET_UID_LOW(uid) \
-        ((uid) & 0xffffffffULL)
-
-#define GET_UID_HIGH(uid) \
-        ((uid) >> 32)
-
-bool Fs3Operations::CheckAndFixCX4(bool justCheck)
+bool Fs3Operations::FwCalcMD5(u_int8_t md5sum[16])
 {
-    // assuming query/verify was ran before and this is being called on an MST device during burn
-    FBase* origFlashObj = (FBase*)NULL;
-
-    if (!_ioAccess->is_flash()) {
-        return true;
+#if defined(UEFI_BUILD) || defined(NO_OPEN_SSL)
+    (void)md5sum;
+    return errmsg("Operation not supported");
+#else
+    if (!FsIntQueryAux(true, false)) {
+        return false;
     }
-
-    if (((Flash*)_ioAccess)->get_dev_id() != CX4_HW_ID || _maxImgLog2Size != 0x16) {
-        // nothing to do return
-        return true;
+    // push beggining of image to md5buff
+    int sz = FS3_BOOT_START + _fwImgInfo.bootSize;
+    std::vector<u_int8_t> md5buff(sz, 0);
+    _imageCache.get(&(md5buff[0]), sz);
+    // push all non dev data sections to md5buff
+    for (unsigned int j = 0; j < TOC_HEADER_SIZE; j++) {
+        md5buff.push_back(_imageCache[_fs3ImgInfo.itocAddr + j]);
     }
-
-    // re-open flash with -ocr if needed
-    if (_fwParams.ignoreCacheRep == 0) {
-        origFlashObj = _ioAccess;
-        _fwParams.ignoreCacheRep = 1;
-        if (!FwOperations::FwAccessCreate(_fwParams, &_ioAccess)) {
-            _ioAccess = origFlashObj;
-            _fwParams.ignoreCacheRep = 0;
-            return errmsg("Failed to open device for direct flash access");
+    // push itoc header
+    for (int i = 0; i < _fs3ImgInfo.numOfItocs; i++) {
+        // push each non-dev-data section to md5sum buffer
+        u_int32_t tocEntryAddr = _fs3ImgInfo.tocArr[i].entry_addr;
+        u_int32_t tocDataAddr = _fs3ImgInfo.tocArr[i].toc_entry.flash_addr << 2;
+        u_int32_t tocDataSize =  _fs3ImgInfo.tocArr[i].toc_entry.size << 2;
+        if (!_fs3ImgInfo.tocArr[i].toc_entry.device_data) {
+            // itoc entry
+            for (unsigned int j = 0; j < TOC_ENTRY_SIZE; j++) {
+                md5buff.push_back(_imageCache[tocEntryAddr + j]);
+            }
+            // itoc data
+            for (unsigned int j = 0; j < tocDataSize; j++) {
+                md5buff.push_back(_imageCache[tocDataAddr + j]);
+            }
         }
     }
-    // check if Flash0 last sub-sector is write protected (indication if we need to continue)
-    ext_flash_attr_t attr;
-    memset(&attr, 0, sizeof(attr));
+    // calc md5
+    tools_md5(&md5buff[0], md5buff.size(), md5sum);
+    return true;
+#endif
+}
 
-    if (!((Flash*)_ioAccess)->get_attr(attr)) {
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to perform Flash operation");
+Tlv_Status_t Fs3Operations::GetTsObj(TimeStampIFC** tsObj)
+{
+    if (_ioAccess->is_flash()) {
+        *tsObj = TimeStampIFC::getIFC(((Flash*)(_ioAccess))->getMfileObj());
+    } else {
+        // check if buffer or file and allocate accrodingly
+        if (_fwParams.hndlType == FHT_FW_FILE) {
+            *tsObj = TimeStampIFC::getIFC(_fname, _fwImgInfo.lastImageAddr);
+        } else if (_fwParams.hndlType == FHT_FW_BUFF) {
+            *tsObj = TimeStampIFC::getIFC((u_int8_t*)((FImage*)_ioAccess)->getBuf(), ((FImage*)_ioAccess)->getBufLength());
+        } else {
+            *tsObj = (TimeStampIFC*)NULL;
+            errmsg("Unsupported FW handle type.");
+            return TS_HANDLE_NOT_SUPPORTED;
+        }
     }
-
-    if (attr.type_str) {
-        delete [] attr.type_str;
+    Tlv_Status_t rc = (*tsObj)->init();
+    if (rc) {
+        errmsg("%s", (*tsObj)->err());
+        delete *tsObj;
+        *tsObj = (TimeStampIFC*)NULL;
+        return rc;
     }
+    return TS_OK;
+}
 
-    if (!(attr.protect_info_array[0].is_subsector && attr.protect_info_array[0].sectors_num == 1 && attr.protect_info_array[0].is_bottom == 0)) {
-        // Flash0 protection is not as expected : Flash0.Top,1-SubSectors. nothing to do
-        FLASH_RESTORE(origFlashObj);
-        return true;
-    }
-    // mlxmodfw has corrupted dev_data sections and flash protection. attempt to fix
+bool Fs3Operations::FwSetTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer)
+{
+    TimeStampIFC* tsObj;
+    Tlv_Status_t rc;
 
-    if (justCheck) {
-        // just perform checks and return
-        FLASH_RESTORE(origFlashObj);
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, true)) {
         return false;
     }
+    if (GetTsObj(&tsObj)) {
+        return errmsg("Failed to set timestamp. %s", err());
+    }
 
-    char paramName[50] = {0};
-    char paramVal[50] = {0};
-    bool rc = FixCX4Uids();
-
-    // set write protection to last sector
-    strncpy(paramName, "Flash0.WriteProtected", 50);
-    strncpy(paramVal, "Top,1-Sectors", 50);
-    if (!((Flash*)_ioAccess)->set_attr(paramName, paramVal)) {
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to perform Flash operation");
+    if (!_ioAccess->is_flash()) {
+        // if caller hasnt specified fw version take from image
+        struct tools_open_fw_version zeroVer;
+        memset(&zeroVer, 0, sizeof(zeroVer));
+        if (!memcmp(&fwVer, &zeroVer, sizeof(fwVer))) {
+            fwVer.fw_ver_major = _fwImgInfo.ext_info.fw_ver[0];
+            fwVer.fw_ver_minor = _fwImgInfo.ext_info.fw_ver[1];
+            fwVer.fw_ver_subminor = _fwImgInfo.ext_info.fw_ver[2];
+        }
     }
-    // wait for flash op to finish
-    msleep(500);
-    FLASH_RESTORE(origFlashObj);
 
-    if (!rc || !Fs3IntQuery()) {
-        return false;
+    rc = tsObj->setTimeStamp(timestamp, fwVer);
+    if (rc) {
+        errmsg("%s", tsObj->err());
     }
-    return true;
+    delete tsObj;
+    return rc ? false : true;
 }
 
-bool Fs3Operations::FixCX4Uids()
+bool Fs3Operations::FwResetTimeStamp()
 {
-    // fix mfg guids_num and step_size
-    fs3_uid_t baseUid;
-    memset(&baseUid, 0, sizeof(baseUid));
-    if(IS_EMPTY_CX4_MFG_UIDS(_fs3ImgInfo.ext_info.orig_fs3_uids_info)) {
-        // fix macs/guids
-        // adrianc: if MFGs are zero: set the same uids as in dev_info.
-        baseUid.base_guid.l = GET_UID_LOW(_fs3ImgInfo.ext_info.fs3_uids_info.cx4_uids.base_guid.uid);
-        baseUid.base_guid.h = GET_UID_HIGH(_fs3ImgInfo.ext_info.fs3_uids_info.cx4_uids.base_guid.uid);
-
-        baseUid.base_mac.l = GET_UID_LOW(_fs3ImgInfo.ext_info.fs3_uids_info.cx4_uids.base_mac.uid);
-        baseUid.base_mac.h = GET_UID_HIGH(_fs3ImgInfo.ext_info.fs3_uids_info.cx4_uids.base_mac.uid);
+    TimeStampIFC* tsObj;
+    Tlv_Status_t rc;
 
-        baseUid.base_guid_specified = 1;
-        baseUid.base_mac_specified = 1;
-        baseUid.set_mac_from_guid = 0;
+    if (!_ioAccess->is_flash() && !FsIntQueryAux(false, true)) {
+        return false;
+    }
+    if (GetTsObj(&tsObj)) {
+        return errmsg("Failed to reset timestamp. %s", err());
+    }
+    rc = tsObj->resetTimeStamp();
+    if (rc) {
+        errmsg("%s", tsObj->err());
+    }
+    delete tsObj;
+    return rc ? false : true;
+}
 
-        // set manufacture guids
-        if (!FwSetMFG(baseUid)) {
+bool Fs3Operations::FwQueryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning)
+{
+    TimeStampIFC* tsObj;
+    Tlv_Status_t rc;
+    if (!_ioAccess->is_flash()) {
+        if (queryRunning) {
+            return errmsg("cannot get running FW Timestamp on image file");
+        }
+        if (!FsIntQueryAux(false, true)) {
             return false;
         }
     }
-    return true;
-}
 
-#define OPEN_OCR(origFlashObj) do {\
-                        origFlashObj = _ioAccess;\
-                        _fwParams.ignoreCacheRep = 1;\
-                        if (!FwOperations::FwAccessCreate(_fwParams, &_ioAccess)) {\
-                            _ioAccess = origFlashObj;\
-                            _fwParams.ignoreCacheRep = 0;\
-                            return errmsg("Failed to open device for direct flash access");\
-                        }\
-                    } while (0)
+    if (GetTsObj(&tsObj)) {
+        return errmsg("Failed to query timestamp. %s", err());
+    }
 
-#define SET_WRITE_PROTECT(name, val) do { \
-                        char paramName[50] = {0};\
-                        char paramVal[50] = {0};\
-                        strncpy(paramName, name, 50);\
-                        strncpy(paramVal, val, 50);\
-                        if (!((Flash*)_ioAccess)->set_attr(paramName, paramVal)) {\
-                            FLASH_RESTORE(origFlashObj);\
-                            return errmsg("Failed to perform Flash operation");\
-                        }\
-                        msleep(500);\
-                    } while (0)
+    rc = tsObj->queryTimeStamp(timestamp, fwVer, queryRunning);
+    if (rc) {
+        errmsg("%s", tsObj->err());
+    }
+    delete tsObj;
+    return rc ? false : true;
+}
 
-bool Fs3Operations::FixCX4WriteProtection(bool justCheck)
+bool Fs3Operations::TestAndSetTimeStamp(Fs3Operations &imageOps)
 {
-    if (!_ioAccess->is_flash() || ((Flash*)_ioAccess)->get_dev_id() != CX4_HW_ID) {
+    Tlv_Status_t rc;
+    Tlv_Status_t devTsQueryRc;
+    bool retRc = true;
+    TimeStampIFC* imgTsObj;
+    TimeStampIFC* devTsObj;
+    bool tsFoundOnImage = false;
+    struct tools_open_ts_entry imgTs;
+    struct tools_open_fw_version imgFwVer;
+    struct tools_open_ts_entry devTs;
+    struct tools_open_fw_version devFwVer;
+    memset(&imgTs, 0, sizeof(imgTs));
+    memset(&imgFwVer, 0, sizeof(imgFwVer));
+    memset(&devTs, 0, sizeof(devTs));
+    memset(&devFwVer, 0, sizeof(devFwVer));
+
+    if (!_ioAccess->is_flash()) {
+        // no need to test timestamp on image
         return true;
     }
 
-    struct toc_info* mfgToc = (struct toc_info*)NULL;
-    struct toc_info* vpdToc = (struct toc_info*)NULL;
-    u_int32_t mfgAddr = 0;
-    u_int32_t vpdAddr = 0;
-    u_int32_t flashSize = 0;
-    u_int32_t shiftSize = 0x8000;
-    FBase* origFlashObj = (FBase*)NULL;
-    std::vector<u_int8_t> newVpdSection;
-    int retries = 0;
-    if (!Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, FS3_MFG_INFO, mfgToc)) {
-        return errmsg("failed to locate MFG_INFO address within the FW image");
-    }
-    ext_flash_attr_t attr;
-    memset(&attr, 0, sizeof(attr));
-    if (!((Flash*)_ioAccess)->get_attr(attr)) {
-        return errmsg("Failed to perform Flash operation");
-    }
-    flashSize = attr.size;
-    mfgAddr = getAbsAddr(mfgToc);
-    /* If the flash size is 16-MB and the MFG at the end 0xff0000
-     * Move it with the VPD the bottom 32-bit (shift 0x8000) and
-     * FlashProtected Top,8-SubSectors
-     */
-    if (flashSize != 0x1000000 || mfgAddr != 0xff0000) {
+    if (_fwParams.ignoreCacheRep) {
+        // direct flash access no check is needed
         return true;
     }
-
-    if (justCheck) {
-        // just perform checks and return
-        FLASH_RESTORE(origFlashObj);
-        return false;
+    if (imageOps._ioAccess->is_flash()) {
+        return errmsg("TestAndSetTimeStamp bad params");
     }
-
-    // get VPD section
-    _readSectList.push_back(FS3_VPD_R0);
-    if (!Fs3IntQuery()) {
-        _readSectList.pop_back();
-        return false;
+    if (imageOps.GetTsObj(&imgTsObj)) {
+        return errmsg("%s", imageOps.err());
     }
-    _readSectList.pop_back();
-
-    // re-open flash with -ocr if needed
-    if (_fwParams.ignoreCacheRep == 0) {
-        OPEN_OCR(origFlashObj);
+    rc = GetTsObj(&devTsObj);
+    if (rc) {
+        delete imgTsObj;
+        return rc == TS_TIMESTAMPING_NOT_SUPPORTED ? true : false;
     }
-    /*
-     * Check if write protected and disable it
-     */
-    if (((Flash*)_ioAccess)->is_flash_write_protected()) {
-        SET_WRITE_PROTECT("Flash0.WriteProtected", "Disabled");
+    // check if device supports timestamping or if device is not in livefish
+    devTsQueryRc = devTsObj->queryTimeStamp(devTs, devFwVer);
+    if (devTsQueryRc == TS_TIMESTAMPING_NOT_SUPPORTED || devTsQueryRc == TS_UNSUPPORTED_ICMD_VERSION) {
+        retRc = true;
+        goto cleanup;
+    } else if (devTsQueryRc && devTsQueryRc != TS_NO_VALID_TIMESTAMP) {
+        retRc = errmsg("%s", devTsObj->err());
+        goto cleanup;
     }
-    while (((Flash*)_ioAccess)->is_flash_write_protected() && retries < 5) {
-        msleep(500);
+
+    // Option 1 image was timestampped need to try and set it on device
+    // Option 2 image was not timestampped but device was timestampped
+    rc = imgTsObj->queryTimeStamp(imgTs, imgFwVer);
+    if (rc == TS_OK) {
+        tsFoundOnImage = true;
+    } else if (rc != TS_TLV_NOT_FOUND ) {
+        retRc = errmsg("%s", imgTsObj->err());
+        goto cleanup;
     }
-    if (retries == 5) {
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to disable flash write protection");
+
+    if (tsFoundOnImage) {
+        // timestamp found on image, attempt to set it on device
+        rc = devTsObj->setTimeStamp(imgTs, imgFwVer);
+        if (rc == TS_OK) {
+            retRc = true;
+        } else {
+            retRc = errmsg("%s", devTsObj->err());
+        }
+    } else {
+        if (devTsQueryRc == TS_NO_VALID_TIMESTAMP) {
+            // no timestamp on image and no valid timestamp on device check if we got running timestamp if we do then fail
+            devTsQueryRc = devTsObj->queryTimeStamp(devTs, devFwVer, true);
+            if (devTsQueryRc == TS_OK) {
+                // we got running timestamp return error
+                retRc = errmsg("No valid timestamp detected. please set a valid timestamp on image/device or reset timestamps on device.");
+
+            } else if (devTsQueryRc == TS_NO_VALID_TIMESTAMP) {
+                // timestamping not used on device.
+                retRc = true;
+            } else {
+                retRc = errmsg("%s", devTsObj->err());
+            }
+        } else {
+            // we got a valid timestamp on device but not on image! compare the FW version
+            if (devFwVer.fw_ver_major == imageOps._fwImgInfo.ext_info.fw_ver[0] &&
+                    devFwVer.fw_ver_minor == imageOps._fwImgInfo.ext_info.fw_ver[1] &&
+                    devFwVer.fw_ver_subminor == imageOps._fwImgInfo.ext_info.fw_ver[2]) {
+                // versions match allow update
+                retRc = true;
+            } else {
+                retRc = errmsg("Stamped FW version missmatch: %d.%d.%04d differs from %d.%d.%04d", devFwVer.fw_ver_major,\
+                                                                                                devFwVer.fw_ver_minor,\
+                                                                                                devFwVer.fw_ver_subminor,\
+                                                                                                imageOps._fwImgInfo.ext_info.fw_ver[0],\
+                                                                                                imageOps._fwImgInfo.ext_info.fw_ver[1],\
+                                                                                                imageOps._fwImgInfo.ext_info.fw_ver[2]);
+            }
+        }
     }
-    /*
-     * MOVE MFG & VPD Sections to +0x8000
-     */
-    const char* flashParamName = "Flash0.WriteProtected";
-    const char* flashParamVal = "Top,8-SubSectors";
+cleanup:
+    delete imgTsObj;
+    delete devTsObj;
+    return retRc;
+}
 
-    /*
-     * Moving VPD section
-     */
-    if (!Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, FS3_VPD_R0, vpdToc)) {
-        SET_WRITE_PROTECT(flashParamName, flashParamVal);
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to locate VPD_R0 address within the FW image");
+bool Fs3Operations::DeviceTimestampEnabled()
+{
+    Tlv_Status_t rc;
+    Tlv_Status_t queryNextTsRc;
+    Tlv_Status_t queryRunningTsRc;
+    TimeStampIFC* devTsObj;
+    struct tools_open_ts_entry devTs;
+    struct tools_open_fw_version devFwVer;
+    memset(&devTs, 0, sizeof(devTs));
+    memset(&devFwVer, 0, sizeof(devFwVer));
+
+    if (!_ioAccess->is_flash()) {
+        return false;
+    }
+
+    if (_fwParams.ignoreCacheRep) {
+        // direct flash assume no TS
+        return false;
     }
-    /*
-     * VPD_R0 address is after the MFG_INFO section
-     */
-    vpdAddr = mfgAddr + mfgToc->toc_entry.size * 4;
 
-    if (!Fs3UpdateItocInfo(vpdToc, vpdAddr + shiftSize)) {
-        SET_WRITE_PROTECT(flashParamName, flashParamVal);
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to shift VPD_R0 section");
+    rc = GetTsObj(&devTsObj);
+    if (rc) {
+        return false;
     }
-    if (!Fs3ReburnItocSection(vpdAddr + shiftSize, vpdToc->toc_entry.size * 4, vpdToc->section_data, "VPD")) {
-        SET_WRITE_PROTECT(flashParamName, flashParamVal);
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to burn VPD_R0 section, the image maybe left in bad situation");;
+    // TS supported, make sure no valid TS is set
+    queryRunningTsRc = devTsObj->queryTimeStamp(devTs, devFwVer, true);
+    queryNextTsRc = devTsObj->queryTimeStamp(devTs, devFwVer);
+    // Cleanup
+    delete devTsObj;
+
+    if (queryRunningTsRc == TS_OK || queryNextTsRc == TS_OK) {
+        return true;
     }
-    if (!Fs3UpdateItocInfo(mfgToc, mfgAddr + shiftSize)) {
-        SET_WRITE_PROTECT(flashParamName, flashParamVal);
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to shift MFG_INFO section");
+    return false;
+}
+
+bool Fs3Operations::DoAfterBurnJobs(const u_int32_t magic_patter[],
+        Fs3Operations &imageOps, ExtBurnParams& burnParams, Flash *f,
+        u_int32_t new_image_start, u_int8_t  is_curr_image_in_odd_chunks)
+{
+    u_int32_t  zeroes = 0;
+    bool boot_address_was_updated = true;
+
+    // if we access without cache replacement or the burn was non failsafe, update YU bootloaders.
+    // if we access with cache replacement notify currently running fw of new image start address to crspace (for SW reset)
+    //TODO: add SwitchIB, Spectrum when we have support for ISFU
+    if (!SUPPORTS_ISFU(_fwImgInfo.ext_info.chip_type) || !burnParams.burnFailsafe || f->get_ignore_cache_replacment()) {
+        boot_address_was_updated = f->update_boot_addr(new_image_start);
+    } else {
+        _isfuSupported = Fs3IsfuActivateImage(new_image_start);
+        boot_address_was_updated = _isfuSupported;
     }
-    if (!Fs3ReburnItocSection(mfgAddr + shiftSize, mfgToc->toc_entry.size * 4, mfgToc->section_data, "GUID")) {
-        SET_WRITE_PROTECT(flashParamName, flashParamVal);
-        FLASH_RESTORE(origFlashObj);
-        return errmsg("Failed to burn MFG_INFO section, the image maybe left in bad situation");
+
+    if (imageOps._fwImgInfo.ext_info.is_failsafe) {
+        if (!burnParams.burnFailsafe) {
+            // When burning in nofs, remnant of older image with different chunk size
+            // may reside on the flash -
+            // Invalidate all images marking on flash except the one we've just burnt
+
+            u_int32_t cntx_image_start[CNTX_START_POS_SIZE];
+            u_int32_t cntx_image_num;
+
+            FindAllImageStart(f, cntx_image_start, &cntx_image_num, magic_patter);
+            // Address convertor is disabled now - use phys addresses
+            for (u_int32_t i = 0; i < cntx_image_num; i++) {
+                if (cntx_image_start[i] != new_image_start) {
+                    if (!f->write(cntx_image_start[i], &zeroes, sizeof(zeroes), true)) {
+                        return errmsg(MLXFW_FLASH_WRITE_ERR, "Failed to invalidate old fw signature: %s", f->err());
+                    }
+                }
+            }
+        } else {
+            // invalidate previous signature
+            f->set_address_convertor(imageOps._fwImgInfo.cntxLog2ChunkSize, is_curr_image_in_odd_chunks);
+            if (!f->write(0, &zeroes, sizeof(zeroes), true)) {
+                return errmsg(MLXFW_FLASH_WRITE_ERR, "Failed to invalidate old fw signature: %s", f->err());
+            }
+        }
     }
-    /*
-     * Enable Flash protected
-     */
-    SET_WRITE_PROTECT(flashParamName, flashParamVal);
-    FLASH_RESTORE(origFlashObj);
-    /*
-     * Query for check
-     */
-    if (!Fs3IntQuery()) {
-        return errmsg("Failed to query device after fixing write protected sections");
+    if (boot_address_was_updated == false) {
+        report_warn("Failed to update FW boot address. Power cycle the device in order to load the new FW.\n");
     }
     return true;
 }
diff --git a/mlxfwops/lib/fs3_ops.h b/mlxfwops/lib/fs3_ops.h
index 6cb9146..9ec54e4 100644
--- a/mlxfwops/lib/fs3_ops.h
+++ b/mlxfwops/lib/fs3_ops.h
@@ -34,18 +34,41 @@
 #ifndef FS3_OPS_
 #define FS3_OPS_
 
-// #include "flint_base.h"
-#include "fw_ops.h"
 #include <cibfw_layouts.h>
 #include <cx4fw_layouts.h>
+#include <mlarge_buffer.h>
+// #include "flint_base.h"
+#include "fw_ops.h"
+#include "aux_tlv_ops.h"
+
+// FW Binary version
 
+// max supported major version
+// first time breaking compatibility remove the check if the version is not initialized
+#define FS3_MAX_BIN_VER_MAJOR 1
 
+// min supported version
+#define FS3_MIN_BIN_VER_MAJOR 1
+#define FS3_MIN_BIN_VER_MINOR 1
+
+#define FLASH_RESTORE(origFlashObj) \
+        if (origFlashObj) {\
+            _ioAccess->close();\
+            delete _ioAccess;\
+            _ioAccess = origFlashObj;\
+            _fwParams.ignoreCacheRep = 0;\
+        }
 
 class Fs3Operations : public FwOperations {
 public:
 
 
-    Fs3Operations(FBase *ioAccess) : FwOperations(ioAccess), _isfuSupported(false), _badDevDataSections(false), _maxImgLog2Size(0){};
+    Fs3Operations(FBase *ioAccess) : FwOperations(ioAccess),
+        _isfuSupported(false), _badDevDataSections(false), _maxImgLog2Size(0){
+        _minBinMinorVer = FS3_MIN_BIN_VER_MINOR;
+        _minBinMajorVer = FS3_MIN_BIN_VER_MAJOR;
+        _maxBinMajorVer = FS3_MAX_BIN_VER_MAJOR;
+    };
 
     virtual ~Fs3Operations()  {};
     //virtual void print_type() {printf("-D- FS3 type!\n");};
@@ -73,30 +96,45 @@ public:
     virtual bool FwResetNvData();
     virtual bool FwShiftDevData(PrintCallBack progressFunc=(PrintCallBack)NULL);
     virtual const char*  FwGetResetRecommandationStr();
-    virtual bool CheckCX4Device() {return (CheckAndFixCX4() && FixCX4WriteProtection());}
+    virtual bool FwCalcMD5(u_int8_t md5sum[16]);
+    virtual bool FwSetTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer);
+    virtual bool FwQueryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning=false);
+    virtual bool FwResetTimeStamp();
 
-
-private:
-    #define CRC_CHECK_OUTPUT  CRC_CHECK_OLD")"
-    #define FS3_CRC_CHECK_OUT CRC_CHECK_OLD":0x%x)"
-    #define PRE_CRC_OUTPUT   "    "
-    #define MAX_TOCS_NUM         64
-    #define FS3_DEFAULT_SECTOR_SIZE 0x1000
-    #define FS3_LOG2_CHUNK_SIZE_DW_OFFSET 0x9
+protected:
     #define ITOC_ASCII 0x49544f43
-    #define DTOC_ASCII 0x64544f43
     #define TOC_RAND1  0x04081516
     #define TOC_RAND2  0x2342cafa
     #define TOC_RAND3  0xbacafe00
     #define TOC_HEADER_SIZE 0x20
     #define TOC_ENTRY_SIZE  0x20
     #define FS3_FW_SIGNATURE_SIZE 0x10
+    #define MAX_TOCS_NUM         64
     #define MFG_INFO "MFG_INFO"
     #define UNKNOWN_SECTION "UNKNOWN"
 
+    virtual bool FsBurnAux(FwOperations *imageOps, ExtBurnParams& burnParams);
+    bool DumpFs3CRCCheck(u_int8_t sect_type, u_int32_t sect_addr, u_int32_t sect_size, u_int32_t crc_act, u_int32_t crc_exp,
+                bool ignore_crc = false, VerifyCallBack verifyCallBackFunc = (VerifyCallBack)NULL);
+    bool Fs3UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size);
+    virtual bool UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size);
+    virtual bool FsVerifyAux(VerifyCallBack verifyCallBackFunc, bool show_itoc, struct QueryOptions queryOptions);
+    bool FsIntQueryAux(bool readRom = true, bool quickQuery=true);
+    const char* GetSectionNameByType(u_int8_t section_type);
+    bool GetImageInfoFromSection(u_int8_t *buff, u_int8_t sect_type, u_int32_t sect_size, u_int8_t check_support_only = 0);
+    bool IsGetInfoSupported(u_int8_t sect_type);
+    bool IsFs3SectionReadable(u_int8_t type, QueryOptions queryOptions);
+    bool GetMfgInfo(u_int8_t *buff);
+    bool GetDevInfo(u_int8_t *buff);
+    bool GetImageInfo(u_int8_t *buff);
+    bool GetRomInfo(u_int8_t *buff, u_int32_t size);
+    bool DoAfterBurnJobs(const u_int32_t magic_patter[], Fs3Operations &imageOps,
+            ExtBurnParams& burnParams, Flash *f,
+            u_int32_t new_image_start, u_int8_t  is_curr_image_in_odd_chunks);
 
-
-
+    virtual bool getRunningFwVersion();
+    virtual bool Fs3IsfuActivateImage(u_int32_t newImageStart);
+    bool TestAndSetTimeStamp(Fs3Operations &imageOps);
 
     struct toc_info {
         u_int32_t entry_addr;
@@ -104,10 +142,9 @@ private:
         u_int8_t  data[CIBFW_ITOC_ENTRY_SIZE];
         std::vector<u_int8_t>  section_data;
     };
-
+        
     struct Fs3ImgInfo {
         fs3_info_t ext_info;
-        std::vector<u_int8_t> imageCache;
         int             numOfItocs;
         struct toc_info tocArr[MAX_TOCS_NUM];
         u_int8_t        itocHeader[CIBFW_ITOC_HEADER_SIZE];
@@ -115,40 +152,31 @@ private:
         u_int32_t       itocAddr;
         u_int32_t       smallestAbsAddr;
         u_int32_t       sizeOfImgData;
-
     };
 
-    struct SectionInfo {
-        u_int8_t      type;
-        const char    *name;
-    };
+    static const SectionInfo _fs3SectionsInfoArr[];
+    static const u_int32_t _itocSignature[4];
+    Fs3ImgInfo _fs3ImgInfo;
+    MlargeBuffer _imageCache;
+    bool _isfuSupported;
+    bool _badDevDataSections; // set true if during verify one of the device data section is corrupt or mfg section missing
+    u_int32_t _maxImgLog2Size;
+
+private:
+    #define CRC_CHECK_OUTPUT  CRC_CHECK_OLD")"
+    #define FS3_CRC_CHECK_OUT CRC_CHECK_OLD":0x%x)"
+    #define PRE_CRC_OUTPUT   "    "
+    #define FS3_DEFAULT_SECTOR_SIZE 0x1000
+    #define FS3_LOG2_CHUNK_SIZE_DW_OFFSET 0x9
 
-    struct QueryOptions {
-        bool quickQuery;
-        bool readRom;
-    };
 
-    bool Fs3UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size);
-    virtual bool UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size);
     bool VerifyTOC(u_int32_t dtoc_addr, bool& bad_signature, VerifyCallBack verifyCallBackFunc, bool show_itoc,
             struct QueryOptions queryOptions);
     bool checkPreboot(u_int32_t* prebootBuff, u_int32_t size, VerifyCallBack verifyCallBackFunc);
-    bool Fs3Verify(VerifyCallBack verifyCallBackFunc, bool show_itoc, struct QueryOptions queryOptions);
-    const char* GetSectionNameByType(u_int8_t section_type);
     bool CheckTocSignature(struct cibfw_itoc_header *itoc_header, u_int32_t first_signature);
-    bool DumpFs3CRCCheck(u_int8_t sect_type, u_int32_t sect_addr, u_int32_t sect_size, u_int32_t crc_act, u_int32_t crc_exp,
-                bool ignore_crc = false, VerifyCallBack verifyCallBackFunc = (VerifyCallBack)NULL);
-    bool GetImageInfoFromSection(u_int8_t *buff, u_int8_t sect_type, u_int32_t sect_size, u_int8_t check_support_only = 0);
-    bool IsGetInfoSupported(u_int8_t sect_type);
-    bool IsFs3SectionReadable(u_int8_t type, QueryOptions queryOptions);
-    bool GetMfgInfo(u_int8_t *buff);
-    bool GetDevInfo(u_int8_t *buff);
-    bool GetImageInfo(u_int8_t *buff);
-    bool GetRomInfo(u_int8_t *buff, u_int32_t size);
-    bool Fs3IntQuery(bool readRom = true, bool quickQuery=true);
-    bool Fs3Burn(Fs3Operations &imageOps, ExtBurnParams& burnParams);
     bool BurnFs3Image(Fs3Operations &imageOps, ExtBurnParams& burnParams);
-    bool UpdateDevDataITOC(u_int8_t *image_data, struct toc_info *image_toc_info_entry, struct toc_info *flash_toc_arr, int flash_toc_size);
+    bool UpdateDevDataITOC(Fs3Operations &imageOps, struct toc_info *image_toc_info_entry, struct toc_info *flash_toc_arr, int flash_toc_size);
+
     bool AddDevDataITOC(struct toc_info *flash_toc_entry, u_int8_t *image_data, struct toc_info *image_toc_arr, int& image_toc_size);
     bool Fs3UpdateSection(void *new_info, fs3_section_t sect_type=FS3_DEV_INFO, bool is_sect_failsafe=true, CommandType cmd_type=CMD_UNKNOWN, PrintCallBack callBackFunc=(PrintCallBack)NULL );
     bool Fs3GetItocInfo(struct toc_info *tocArr, int num_of_itocs, fs3_section_t sect_type, struct toc_info *&curr_toc);
@@ -162,7 +190,6 @@ private:
                                      std::vector<u_int8_t>  &newSectionData);
     bool Fs3UpdateVpdSection(struct toc_info *curr_toc, char *vpd, std::vector<u_int8_t>  &newSectionData);
     bool Fs3GetNewSectionAddr(struct toc_info *curr_toc, u_int32_t &NewSectionAddr, bool failsafe_section);
-
     bool Fs3UpdateItocInfo(struct toc_info *curr_toc, u_int32_t newSectionAddr, u_int32_t itocSize, std::vector<u_int8_t>  newSectionData);
     bool Fs3UpdateItocInfo(struct toc_info *curr_toc, u_int32_t newSectionAddr);
     bool Fs3UpdateItocInfo(struct toc_info *newItocInfo, u_int32_t newSectionAddr, fs3_section_t sectionType, u_int32_t* newSectData, u_int32_t NewSectSize);
@@ -175,7 +202,7 @@ private:
             struct toc_info *tocArr, u_int32_t &numOfItocs);
     bool UpdateImageAfterInsert(struct toc_info *tocArr, u_int32_t numOfItocs, u_int8_t* newImgData, u_int32_t newSectSize);
     bool Fs3ReplaceSectionInDevImg(fs3_section_t sectionType, fs3_section_t nextSectionType, bool toAdd, u_int8_t* newImgData,
-            u_int32_t newImageSize, u_int32_t* newSectData, u_int32_t NewSectSize, bool UpdateExsistingTocArr= false);
+            u_int32_t newImageSize, u_int32_t* newSectData, u_int32_t NewSectSize);
     bool CalcItocEntryCRC(struct toc_info *curr_toc);
     bool ShiftItocAddrInEntry(struct toc_info *newItocInfo, struct toc_info *oldItocInfo, int shiftSize);
     bool CopyItocInfo(struct toc_info *newTocInfo, struct toc_info *currToc);
@@ -185,22 +212,18 @@ private:
     bool Fs3AddSection(fs3_section_t sectionType, fs3_section_t neighbourSection, u_int32_t* newSectData, u_int32_t newSectSize,
             ProgressCallBack progressFunc);
     bool CheckFs3ImgSize(Fs3Operations& imageOps, bool useImageDevData=false);
-    bool GetMaxImageSize(u_int32_t flash_size, bool image_is_fs, u_int32_t &max_image_size);
     bool CheckItocArray();
     bool CheckItocArrConsistency(std::vector<struct toc_info*>& sortedTocVec, u_int32_t imageStartAddr);
-    bool CheckBinVersion(u_int8_t binVerMajor, u_int8_t binVerMinor);
+
 
     u_int32_t getAbsAddr(toc_info* toc);
     u_int32_t getAbsAddr(toc_info* toc, u_int32_t imgStart);
     bool getLastFwSAddr(u_int32_t& lastAddr);
     bool getFirstDevDataAddr(u_int32_t& firstAddr);
     bool reburnItocSection(PrintCallBack callBackFunc);
-    bool Fs3IsfuActivateImage(u_int32_t newImageStart);
 
-    bool CheckAndFixCX4(bool justCheck=true);
-    bool FixCX4Uids();
-    bool FixCX4WriteProtection(bool justCheck=true);
-    bool DevDataHackCheck(struct cibfw_itoc_entry *devTocEntry);
+    bool DeviceTimestampEnabled();
+    Tlv_Status_t GetTsObj(TimeStampIFC** tsObj);
 
     // this class is for sorting the itoc array by ascending absolute flash_addr used in FwShiftDevData
     class TocComp {
@@ -212,17 +235,6 @@ private:
     	u_int32_t _startAdd;
     };
 
-
-
-
-    // Members
-    static const SectionInfo _fs3SectionsInfoArr[];
-    static const u_int32_t _itocSignature[4];
-    Fs3ImgInfo _fs3ImgInfo;
-    bool _isfuSupported;
-    bool _badDevDataSections; // set true if during verify one of the device data section is corrupt or mfg section missing
-    u_int32_t _maxImgLog2Size;
-
 };
 
 
diff --git a/mlxfwops/lib/fw_ops.cpp b/mlxfwops/lib/fw_ops.cpp
index 6ebcea3..34a8fc7 100644
--- a/mlxfwops/lib/fw_ops.cpp
+++ b/mlxfwops/lib/fw_ops.cpp
@@ -41,6 +41,9 @@
 #include "fs3_ops.h"
 #include "fs2_ops.h"
 
+#ifdef CABLES_SUPP
+#include "cablefw_ops.h"
+#endif
 
 #ifndef NO_MFA_SUPPORT
 #include <mfa.h>
@@ -74,6 +77,9 @@ int FwOperations::getFileSignature(const char* fname)
     if (!strncmp(tmpb, "MFAR", 4)) {
         res = IMG_SIG_TYPE_MFA;
     }
+    if (!strncmp(tmpb, "MTCF", 4)) {
+        res = IMG_SIG_TYPE_CF;
+    }
 
 clean_up:
     fclose(fin);
@@ -214,7 +220,7 @@ bool FwOperations::checkBoot2(u_int32_t beg, u_int32_t offs, u_int32_t& next, bo
 
     // Get absolute address on flash when checking BOOT2 for FS3 image format (for FS2 its always displayed as contiguous)
     // Adrianc: why dont we show them both in the same way when running verify.
-    u_int32_t boot2AbsAddr = (this->FwType() == FIT_FS3 && _ioAccess->is_flash()) ? \
+    u_int32_t boot2AbsAddr = ((this->FwType() == FIT_FS3 || this->FwType() == FIT_FS4) && _ioAccess->is_flash()) ? \
             _ioAccess->get_phys_from_cont(beg, _fwImgInfo.cntxLog2ChunkSize, (_fwImgInfo.imgStart != 0)) : beg;
 
     sprintf(pr, "%s /0x%08x-0x%08x (0x%06x)/ (BOOT2)", pref, offs+boot2AbsAddr,
@@ -227,7 +233,6 @@ bool FwOperations::checkBoot2(u_int32_t beg, u_int32_t offs, u_int32_t& next, bo
         READBUF((*_ioAccess), offs+beg, buff, size*4 + 16, pr);
         // we hold for FS3 an image cache so we selectevely update it in UpdateImgCache() call
         UpdateImgCache((u_int8_t*)buff, offs+beg, size*4 + 16);
-
         TOCPUn(buff, size+4);
         CRC1n(crc, buff, size+4);
         CRC1n(_ioAccess->get_image_crc(), buff, size+4);
@@ -338,6 +343,13 @@ const u_int32_t FwOperations::_cntx_magic_pattern[4] = {
     0x4154BEEF
 };
 
+const u_int32_t FwOperations::_fs4_magic_pattern[4] = {
+    0x4D544657,
+    0xABCDEF00,
+    0xFADE1234,
+    0x5678DEAD
+};
+
 const u_int32_t FwOperations::_cntx_image_start_pos[FwOperations::CNTX_START_POS_SIZE] = {
     0,
     0x10000,
@@ -349,7 +361,8 @@ const u_int32_t FwOperations::_cntx_image_start_pos[FwOperations::CNTX_START_POS
     0x400000
 };
 
-bool FwOperations::CntxFindMagicPattern (FBase* ioAccess, u_int32_t addr) {
+bool FwOperations::FindMagicPattern(FBase* ioAccess, u_int32_t addr,
+        u_int32_t const cntx_magic_pattern[]) {
     if (addr + 16 > ioAccess->get_size()) {
         return false;
     }
@@ -357,7 +370,7 @@ bool FwOperations::CntxFindMagicPattern (FBase* ioAccess, u_int32_t addr) {
         u_int32_t w;
         READ4_NOERRMSG((*ioAccess), addr + i * 4, &w);
         TOCPU1(w);
-        if (w != _cntx_magic_pattern[i]) {
+        if (w != cntx_magic_pattern[i]) {
             //printf("-D- Looking for magic pattern %d addr %06x: Exp=%08x Act=%08x\n", i, addr + i * 4, _cntx_magic_pattern[i], w);
             return false;
         }
@@ -366,24 +379,24 @@ bool FwOperations::CntxFindMagicPattern (FBase* ioAccess, u_int32_t addr) {
     return true;
 }
 
-
-
 // FindAllImageStart
 // OUT: start_locations: set to the start addresses of the found image markers (in accending order)
 // OUT: found_images:    Number of found images (and number of valid entries in the start_locations array).
-bool FwOperations::CntxFindAllImageStart (FBase* ioAccess, u_int32_t start_locations[CNTX_START_POS_SIZE], u_int32_t* found_images) {
+bool FwOperations::FindAllImageStart (FBase* ioAccess,
+        u_int32_t start_locations[CNTX_START_POS_SIZE],
+        u_int32_t* found_images,
+        u_int32_t const cntx_magic_pattern[]) {
+
     int needed_pos_num;
 
     needed_pos_num = CNTX_START_POS_SIZE;
 
     if (ioAccess->is_flash()) {
-        if ( (((Flash*)ioAccess)->get_dev_id() == 400) ||
-             (((Flash*)ioAccess)->get_dev_id() == 435) ||
-             (((Flash*)ioAccess)->get_dev_id() == 6100)) {
+        if ( (((Flash*)ioAccess)->get_dev_id() == CX2_HW_ID) ||
+             (((Flash*)ioAccess)->get_dev_id() == IS4_HW_ID)) {
             needed_pos_num = OLD_CNTX_START_POS_SIZE;
         }
     }
-
     /* WA: due to bug on SwichIB first GA FW (FW doesnt look at chip select field in mfba)
     *     when reading from flash address 0x400000 it wraps around to 0x0 causing more than one
     *     valid image to be found. as a WA we dont check at 0x400000. basic flash operations
@@ -394,19 +407,18 @@ bool FwOperations::CntxFindAllImageStart (FBase* ioAccess, u_int32_t start_locat
     }
 
     ioAccess->set_address_convertor(0,0);
-    *found_images = 0;
-    for (int i = 0; i < needed_pos_num; i++) {
-        if (CntxFindMagicPattern(ioAccess, _cntx_image_start_pos[i])) {
-            start_locations[*found_images] = _cntx_image_start_pos[i];
-            (*found_images)++;
+    if (found_images) {
+        *found_images = 0;
+        for (int i = 0; i < needed_pos_num; i++) {
+            if (FindMagicPattern(ioAccess, _cntx_image_start_pos[i], cntx_magic_pattern)) {
+                start_locations[*found_images] = _cntx_image_start_pos[i];
+                (*found_images)++;
+            }
         }
     }
 
     return true;
 }
-
-
-
 // CAN BE IN ANOTHER MODULE
 bool FwOperations::GetSectData(std::vector<u_int8_t>& file_sect, const u_int32_t *buff, const u_int32_t size) {
 
@@ -430,7 +442,7 @@ bool FwOperations::FwAccessCreate(fw_ops_params_t& fwParams, FBase **ioAccessP)
             WriteToErrBuff(fwParams.errBuff, strerror(errno), fwParams.errBuffSize);
             return false;
         }
-        if (sig == IMG_SIG_TYPE_BIN) {
+        if (sig == IMG_SIG_TYPE_BIN || sig == IMG_SIG_TYPE_CF) {
             *ioAccessP = new FImage;
             if (!(*ioAccessP)->open(fwParams.fileHndl, false, !fwParams.shortErrors)) {
                 WriteToErrBuff(fwParams.errBuff,(*ioAccessP)->err(), fwParams.errBuffSize);
@@ -520,6 +532,8 @@ bool FwOperations::FwAccessCreate(fw_ops_params_t& fwParams, FBase **ioAccessP)
         }
         //set no flash verify if needed (default =false)
         ((Flash*)*ioAccessP)->set_no_flash_verify(fwParams.noFlashVerify);
+        // work with 64KB sector size if possible to increase performace in full fw burn
+        (((Flash*)*ioAccessP)->set_flash_working_mode(Flash::Fwm_64KB));
      } else {
          WriteToErrBuff(fwParams.errBuff,"Unknown Handle Type.", fwParams.errBuffSize);
          return false;
@@ -527,43 +541,106 @@ bool FwOperations::FwAccessCreate(fw_ops_params_t& fwParams, FBase **ioAccessP)
     return true;
 }
 
+u_int8_t FwOperations::IsFS4Image(FBase& f, u_int32_t* found_images) {
+    u_int32_t data;
+    u_int8_t image_version;
+    u_int32_t image_start[CNTX_START_POS_SIZE];
+
+    FindAllImageStart(&f, image_start, found_images, _fs4_magic_pattern);
+
+    if(*found_images){
+        //check if the image_format_version is ok
+        READ4_NOERRMSG(f, image_start[0] + 0x10, &data);
+        TOCPU1(data);
+        image_version = data >> 24;
+        if(image_version == 1){//1 is the current version
+            return FS_FS4_GEN;
+        } else {
+            return FS_UNKNOWN_IMG;
+        }
+    }
+
+    return FS_UNKNOWN_IMG;
+}
+
+u_int8_t FwOperations::IsFS3OrFS2Image(FBase& f, u_int32_t* found_images) {
+    u_int32_t data;
+    u_int8_t image_version;
+    u_int32_t image_start[CNTX_START_POS_SIZE];
+
+    FindAllImageStart(&f, image_start, found_images, _cntx_magic_pattern);
+
+    if (found_images) {
+        READ4_NOERRMSG(f, image_start[0] + FS3_IND_ADDR, &data);
+        TOCPU1(data);
+        image_version = data >> 24;
+        if (image_version == IMG_VER_FS3) {
+            return FS_FS3_GEN;
+        } else {
+            // TODO: if the img format version is unknown we should fail instead of considering it FS2
+            return FS_FS2_GEN;
+        }
+    }
+
+    return FS_UNKNOWN_IMG;
+}
+
 u_int8_t FwOperations::CheckFwFormat(FBase& f, bool getFwFormatFromImg) {
+    u_int8_t v;
+    u_int32_t found_images = 0;
+
     if (f.is_flash() && !getFwFormatFromImg) {
-        if (  ( ((Flash*)&f)->get_dev_id() == 400)              ||
-                ( ((Flash*)&f)->get_dev_id() == 435)              ||
+        if (    ( ((Flash*)&f)->get_dev_id() == CX2_HW_ID)        ||
                 ( ((Flash*)&f)->get_dev_id() == CX3_HW_ID)        ||
+                ( ((Flash*)&f)->get_dev_id() == IS4_HW_ID)              ||
                 ( ((Flash*)&f)->get_dev_id() == SWITCHX_HW_ID)    ||
-                ( ((Flash*)&f)->get_dev_id() == 6100) ||
                 ( ((Flash*)&f)->get_dev_id() == CX3_PRO_HW_ID)) {
             return FS_FS2_GEN;
         } else if ( (((Flash*)&f)->get_dev_id() == CONNECT_IB_HW_ID) ||
                     (((Flash*)&f)->get_dev_id() == SWITCH_IB_HW_ID)  ||
                     (((Flash*)&f)->get_dev_id() == CX4_HW_ID)        ||
-                    (((Flash*)&f)->get_dev_id() == CX4LX_HW_ID)      ||
-                    (((Flash*)&f)->get_dev_id() == SPECTRUM_HW_ID)) {
+                    (((Flash*)&f)->get_dev_id() == CX4LX_HW_ID)        ||
+                    (((Flash*)&f)->get_dev_id() == SPECTRUM_HW_ID)   ||
+                    (((Flash*)&f)->get_dev_id() == SWITCH_IB2_HW_ID)) {
             return FS_FS3_GEN;
         }
     } else {
-        u_int32_t found_images;
-        u_int32_t image_start[CNTX_START_POS_SIZE];
-
-        // Image - check if magic pattern is somewhere in the file:
-        CntxFindAllImageStart(&f, image_start, &found_images);
+        //First check if it is FS4
+        v = IsFS4Image(f, &found_images);
         if (found_images) {
-            u_int32_t data;
-            u_int8_t image_version;
-            READ4_NOERRMSG(f, image_start[0] + FS3_IND_ADDR, &data);
-            TOCPU1(data);
-            image_version = data >> 24;
-            if (image_version == IMG_VER_FS3) {
-                return FS_FS3_GEN;
-            } else {
-                // TODO: if the img format version is unknown we should fail instead of considering it FS2
-                return FS_FS2_GEN;
-            }
+            return v;
         }
+        //If not FS4 then check if it is FS3 or FS2
+        return IsFS3OrFS2Image(f, &found_images);
     }
-    return FS_OLD_GEN;
+    return FS_UNKNOWN_IMG;
+}
+
+
+bool FwOperations::CheckBinVersion(u_int8_t binVerMajor, u_int8_t binVerMinor)
+{
+    if (binVerMajor == 0 && binVerMinor == 0) {
+        return true;
+    }
+
+    if (binVerMajor > _maxBinMajorVer/*FS4_MAX_BIN_VER_MAJOR*/) {
+        return errmsg(MLXFW_UNSUPPORTED_BIN_VER_ERR,
+                "Unsupported binary version (%d.%d) please update to latest MFT package",
+                binVerMajor,
+                binVerMinor);
+    }
+    if (binVerMajor < _minBinMajorVer/*FS4_MIN_BIN_VER_MAJOR*/
+            || (binVerMajor == _minBinMajorVer/*FS4_MIN_BIN_VER_MAJOR*/
+                    && binVerMinor < _minBinMinorVer)) {
+        return errmsg(MLXFW_UNSUPPORTED_BIN_VER_ERR,
+                "Unsupported binary version (%d.%d) minimal supported version (%d.%d)", \
+                binVerMajor,
+                binVerMinor,
+                _minBinMajorVer/*FS4_MIN_BIN_VER_MAJOR*/,
+                _minBinMinorVer/*FS4_MIN_BIN_VER_MINOR*/);
+    }
+
+    return true;
 }
 
 FwOperations* FwOperations::FwOperationsCreate(void* fwHndl, void *info, char* psid, fw_hndl_type_t hndlType, char* errBuff, int buffSize)
@@ -593,6 +670,8 @@ FwOperations* FwOperations::FwOperationsCreate(void* fwHndl, void *info, char* p
         fwParams.ignoreCacheRep = 0;
         fwParams.noFlashVerify = false;
         fwParams.cx3FwAccess = 0;
+    } else if (hndlType == FHT_CABLE_DEV) {
+        fwParams.buffHndl = (u_int32_t*)fwHndl;
     }
     return FwOperationsCreate(fwParams);
 }
@@ -620,6 +699,7 @@ void FwOperations::BackUpFwParams(fw_ops_params_t& fwParams)
     _fwParams.shortErrors = fwParams.shortErrors;
     _fwParams.uefiExtra = fwParams.uefiExtra;
     _fwParams.uefiHndl = fwParams.uefiHndl;
+    _fwParams.isCableFw = fwParams.isCableFw;
 }
 
 FwOperations* FwOperations::FwOperationsCreate(fw_ops_params_t& fwParams)
@@ -628,38 +708,57 @@ FwOperations* FwOperations::FwOperationsCreate(fw_ops_params_t& fwParams)
     u_int8_t fwFormat;
     FBase *ioAccess;
     bool getFwFormatFromImg = false;
-    if (!FwAccessCreate(fwParams, &ioAccess)) {
-        return (FwOperations*)NULL;
-    }
-    if (fwParams.hndlType == FHT_UEFI_DEV) {
-        // IN UEFI we don't have an access to read devID from cr-space so we are reading it from FW  image signature
-        getFwFormatFromImg = true;
-    }
-    fwFormat = CheckFwFormat(*ioAccess, getFwFormatFromImg);
-    switch (fwFormat) {
-        case FS_FS2_GEN: {
-            fwops = new Fs2Operations(ioAccess);
-            break;
-        }
-        case FS_FS3_GEN: {
-            fwops = new Fs3Operations(ioAccess);
-            break;
+#ifdef CABLES_SUPP
+    if (fwParams.hndlType == FHT_CABLE_DEV) {
+        fwops = new CableFwOperations(fwParams.mstHndl);
+        if(!fwops->FwInit()) {
+            WriteToErrBuff(fwParams.errBuff, fwops->err(), fwParams.errBuffSize);
+            return (FwOperations*)NULL;
         }
-        default:
-            delete ioAccess;
-            WriteToErrBuff(fwParams.errBuff,"invalid Firmware Format (found FS Gen 1)", fwParams.errBuffSize);
+        fwops->_devName = strcpy(new char[strlen(fwParams.mstHndl)+ 1], fwParams.mstHndl);
+    } else
+#endif
+    {
+        if (!FwAccessCreate(fwParams, &ioAccess)) {
             return (FwOperations*)NULL;
-    }
-    // save initialization parameters
-    fwops->BackUpFwParams(fwParams);
+        }
+        if (fwParams.hndlType == FHT_UEFI_DEV) {
+            // IN UEFI we don't have an access to read devID from cr-space so we are reading it from FW  image signature
+            getFwFormatFromImg = true;
+        }
+#if 0 // TODO: Fix when you have cable_fw
+        if (fwParams.isCableFw) {
+            fwops = new CableFwOperations(ioAccess);
+        } else
+#endif
+        {
+            fwFormat = CheckFwFormat(*ioAccess, getFwFormatFromImg);
+            switch (fwFormat) {
+                case FS_FS2_GEN: {
+                    fwops = new Fs2Operations(ioAccess);
+                    break;
+                }
+                case FS_FS3_GEN: {
+                    fwops = new Fs3Operations(ioAccess);
+                    break;
+                }
+                default:
+                    delete ioAccess;
+                    WriteToErrBuff(fwParams.errBuff,"invalid Firmware Format (found FS Gen 1)", fwParams.errBuffSize);
+                    return (FwOperations*)NULL;
+            }
+        }
+        // save initialization parameters
+        fwops->BackUpFwParams(fwParams);
 
-    fwops->_advErrors = !fwParams.shortErrors;
-    fwops->FwInit();
-    if (fwParams.hndlType == FHT_FW_FILE) {
-        fwops->_fname = strcpy(new char[strlen(fwParams.fileHndl)+ 1], fwParams.fileHndl);
-    }
-    if (fwParams.hndlType == FHT_MST_DEV) {
-        fwops->_devName = strcpy(new char[strlen(fwParams.mstHndl)+ 1], fwParams.mstHndl);
+        fwops->_advErrors = !fwParams.shortErrors;
+        fwops->FwInit();
+        if (fwParams.hndlType == FHT_FW_FILE) {
+            fwops->_fname = strcpy(new char[strlen(fwParams.fileHndl)+ 1], fwParams.fileHndl);
+        }
+        if (fwParams.hndlType == FHT_MST_DEV) {
+            fwops->_devName = strcpy(new char[strlen(fwParams.mstHndl)+ 1], fwParams.mstHndl);
+        }
     }
     return fwops;
 }
@@ -675,25 +774,40 @@ u_int32_t FwOperations::CalcImageCRC(u_int32_t* buff, u_int32_t size)
     return new_crc;
 }
 
-bool FwOperations::writeImage(ProgressCallBack progressFunc, u_int32_t addr, void *data, int cnt, bool isPhysAddr, int totalSz, int alreadyWrittenSz)
+bool FwOperations::writeImage(ProgressCallBack progressFunc, u_int32_t addr, void *data, int cnt, bool isPhysAddr, bool readModifyWrite, int totalSz, int alreadyWrittenSz)
 {
     u_int8_t   *p = (u_int8_t *)data;
     u_int32_t  curr_addr = addr;
     u_int32_t  towrite = cnt;
     totalSz = totalSz == -1 ? cnt : totalSz;
+    int origFlashWorkingMode = Flash::Fwm_Default;
     bool rc;
-//    if (!_ioAccess->is_flash()) {
- //       return errmsg("Internal error: writeImage is supported only on flash.");
-   // }
     while (towrite) {
         // Write
         int trans;
         if (_ioAccess->is_flash()) {
+            if (readModifyWrite) {
+                // perform write with the smallest supported sector size
+                origFlashWorkingMode = ((Flash*)_ioAccess)->get_flash_working_mode();
+                ((Flash*)_ioAccess)->set_flash_working_mode(Flash::Fwm_Default);
+            }
             trans = (towrite > (int)Flash::TRANS) ? (int)Flash::TRANS : towrite;
             if (isPhysAddr) {
-                rc = ((Flash*)_ioAccess)->write_phy(curr_addr, p, trans);
+                if (readModifyWrite) {
+                    rc = ((Flash*)_ioAccess)->read_modify_write_phy(curr_addr, p, trans);
+                } else {
+                    rc = ((Flash*)_ioAccess)->write_phy(curr_addr, p, trans);
+                }
             } else {
-                rc = ((Flash*)_ioAccess)->write(curr_addr, p, trans);
+                if (readModifyWrite) {
+                    rc = ((Flash*)_ioAccess)->read_modify_write(curr_addr, p, trans);
+                } else {
+                    rc = ((Flash*)_ioAccess)->write(curr_addr, p, trans);
+                }
+            }
+            if (readModifyWrite) {
+                // restore erase sector size
+                ((Flash*)_ioAccess)->set_flash_working_mode(origFlashWorkingMode);
             }
             if (!rc) {
                 return errmsg(MLXFW_FLASH_WRITE_ERR, "Flash write failed: %s", _ioAccess->err());
@@ -713,7 +827,7 @@ bool FwOperations::writeImage(ProgressCallBack progressFunc, u_int32_t addr, voi
             u_int32_t new_perc = ((cnt - towrite + alreadyWrittenSz) * 100) / totalSz;
 
                     if (progressFunc((int)new_perc)) {
-                        return errmsg("Aborting... recieved interrupt signal");
+                        return errmsg("Aborting... received interrupt signal");
                     }
             }
         }
@@ -811,58 +925,63 @@ bool FwOperations::getInfoFromHwDevid(u_int32_t hwDevId, chip_type_t& chipT, con
             *swIds = hwDevData[i].swDevIds;
             return true;
         }
-            i++;
+        i++;
     }
     return errmsg(MLXFW_DEV_ID_ERR, "Failed to identify device ID(MT%d).", hwDevId);
 }
 
+FwOperations::HwDevData FwOperations::getInfoFromChipType(chip_type_t chipT) const {
+    int i = 0;
+    while (hwDevData[i].name != NULL) {
+        if (hwDevData[i].chipType == chipT) {
+           return  hwDevData[i];
+        }
+            i++;
+    }
+    return hwDevData[i];
+}
+
 // TODO:combine both databases(hwDevData and hwDev2Str) and remove old unsupporded devices i.e infinihost infinihost_iii_ex infinihost_iii_lx
 const FwOperations::HwDevData FwOperations::hwDevData[] = {
-    { "InfiniHost",        INFINIHOST_HW_ID, CT_UNKNOWN, 2, {23108, 0}},
-    { "InfiniHost III Ex", INFINIHOST_III_EX_HW_ID, CT_UNKNOWN,2 , {25208, 25218, 0}},
-    { "InfiniHost III Lx", INFINIHOST_III_LX_HW_ID, CT_UNKNOWN, 1, {25204, 0}},
-    { "ConnectX",          CX_HW_ID, CT_CONNECTX, 2,  {25408, 25418, 26418, 26438,
-                                         26428, 25448, 26448, 26468,
-                                         25458, 26458, 26478, 26488,
-                                         4097, 4098, 0}},
-    { "ConnectX-3",        CX3_HW_ID, CT_CONNECTX, 2,  {4099, 4100, 4101, 4102,
+    { "ConnectX",          CX2_HW_ID, CT_CONNECTX, CFT_HCA, 2,  {25408, 25418, 26418, 26438,
+                                                 26428, 25448, 26448, 26468,
+                                                 25458, 26458, 26478, 26488,
+                                                 4097, 4098, 0}},
+    { "ConnectX-3",        CX3_HW_ID, CT_CONNECTX, CFT_HCA, 2,  {4099, 4100, 4101, 4102,
                                          4104, 4105, 4106,
                                          4107, 4108, 4109, 4110,
                                          4111, 4112, 0}},
-    { "ConnectX-3Pro",    CX3_PRO_HW_ID, CT_CONNECTX, 2, {4103,0}},
-    { "Connect_IB",       CONNECT_IB_HW_ID, CT_CONNECT_IB, 2, {CONNECT_IB_SW_ID, 4114, 4115, 4116,
+    { "ConnectX-3Pro",    CX3_PRO_HW_ID, CT_CONNECTX, CFT_HCA, 2, {4103,0}},
+    { "Connect_IB",       CONNECT_IB_HW_ID, CT_CONNECT_IB, CFT_HCA, 2, {CONNECT_IB_SW_ID, 4114, 4115, 4116,
                                          4117, 4118, 4119, 4120,
                                          4121, 4122, 4123, 4124, 0}},
-    { "InfiniScale IV",   IS4_HW_ID,        CT_IS4,         0, {48436, 48437, 48438, 0}},
-    { "BridgeX",          BRIDGEX_HW_ID,    CT_BRIDGEX,     0, {64102, 64112, 64122, 0}},
-    { "SwitchX",          SWITCHX_HW_ID,    CT_SWITCHX,     0, {51000, 0}},
-    { "Switch_IB",        SWITCH_IB_HW_ID,  CT_SWITCH_IB,   0, {52000, 0}},
-    { "ConnectX-4",       CX4_HW_ID,        CT_CONNECTX4,    0, {4115, 0}},
-    { "ConnectX-4LX",     CX4LX_HW_ID,      CT_CONNECTX4_LX,    0, {4117, 0}},
-    { "Spectrum",         SPECTRUM_HW_ID,   CT_SPECTRUM,   0, {52100, 0}},
-    { (char*)NULL ,              0, CT_UNKNOWN, 0, {0}},// zero devid terminator
+    { "InfiniScale IV",   IS4_HW_ID,        CT_IS4, CFT_SWITCH,         0, {48436, 48437, 48438, 0}},
+    { "SwitchX",          SWITCHX_HW_ID,    CT_SWITCHX, CFT_SWITCH,     0, {51000, 0}},
+    { "Switch_IB",        SWITCH_IB_HW_ID,  CT_SWITCH_IB, CFT_SWITCH,   0, {52000, 0}},
+    { "ConnectX-4",       CX4_HW_ID,        CT_CONNECTX4, CFT_HCA,    0, {4115, 0}},
+    { "ConnectX-4LX",     CX4LX_HW_ID,      CT_CONNECTX4_LX, CFT_HCA,    0, {4117, 0}},
+    { "ConnectX-5",       CX5_HW_ID,        CT_CONNECTX5, CFT_HCA,    0, {4119, 0}},
+    { "Spectrum",         SPECTRUM_HW_ID,   CT_SPECTRUM, CFT_SWITCH,   0, {52100, 0}},
+    { "Switch_IB2",       SWITCH_IB2_HW_ID, CT_SWITCH_IB2, CFT_SWITCH,   0, {53000, 0}},
+    { (char*)NULL ,              0, CT_UNKNOWN, CFT_UNKNOWN, 0, {0}},// zero devid terminator
 };
 
 const FwOperations::HwDev2Str FwOperations::hwDev2Str[] = {
+        {"ConnectX-2",        CX2_HW_ID,        0xB0},
         {"ConnectIB",         CONNECT_IB_HW_ID, 0x00},
-        {"ConnectX",          CX_HW_ID,         0xA0},
-        {"ConnectX-2",        CX_HW_ID,         0xB0},
         {"ConnectX-3 A0",     CX3_HW_ID,        0x00},
         {"ConnectX-3 A1",     CX3_HW_ID,        0x01},
         {"ConnectX-3Pro",     CX3_PRO_HW_ID,    0x00},
         {"ConnectX-4",        CX4_HW_ID,        0x00},
         {"ConnectX-4LX",      CX4LX_HW_ID,      0x00},
+        {"ConnectX-5",        CX5_HW_ID,        0x00},
         {"SwitchX A0",        SWITCHX_HW_ID,    0x00},
         {"SwitchX A1",        SWITCHX_HW_ID,    0x01},
-        {"BridgeX",           BRIDGEX_HW_ID,    0xA0},
         {"InfiniScale IV A0", IS4_HW_ID,        0xA0},
         {"InfiniScale IV A1", IS4_HW_ID,        0xA1},
-        {"InfiniHost A0",     INFINIHOST_HW_ID,      0xA0},
-        {"InfiniHost A1",     INFINIHOST_HW_ID,      0xA1},
-        {"InfiniHost III Lx", INFINIHOST_III_LX_HW_ID,      0xA0},
-        {"InfiniHost III Ex", INFINIHOST_III_EX_HW_ID,      0xA0},
         {"SwitchIB A0",       SWITCH_IB_HW_ID,  0x00},
-        {"Spectrum A0",       SPECTRUM_HW_ID,  0x00},
+        {"Spectrum A0",       SPECTRUM_HW_ID,   0x00},
+        {"SwitchIB2 A0",      SWITCH_IB2_HW_ID, 0x00},
         { (char*)NULL ,       (u_int32_t)0, (u_int8_t)0x00}, // zero device ID terminator
 };
 
@@ -947,10 +1066,6 @@ bool FwOperations::CheckMatchingDevId(u_int32_t hwDevId, u_int32_t imageDevId) {
 
     const HwDevData* devData = (const HwDevData*)NULL;
     const char* hwDevName = (const char*)NULL;
-    // HACK: InfiniHost III LX may have 2 HW device ids. - Map the second devid to the first.
-    if (hwDevId == 24204) {
-        hwDevId = 25204;
-    }
 
     // First, find the HW device that the SW id matches
     for (int i = 0; hwDevData[i].hwDevId != 0 ; i++) {
@@ -1019,7 +1134,7 @@ bool FwOperations::CheckFwVersion(FwOperations &imageOps, u_int8_t forceVersion)
 
 bool FwOperations::FwSwReset() {
     if (!_ioAccess->is_flash()) {
-        return errmsg("operation supported only for switch devices InfiniScaleIV, SwitchX and SwitchIB over an IB interface");
+        return errmsg("operation supported only for switch devices: InfiniScaleIV SwitchX and SwitchIB over an IB interface");
     }
     if (!((Flash*)_ioAccess)->sw_reset()) {
         return errmsg("%s",  _ioAccess->err());
@@ -1053,12 +1168,12 @@ bool FwOperations::UpdateImgCache(u_int8_t *buff, u_int32_t addr, u_int32_t size
 
 bool FwOperations::CntxEthOnly(u_int32_t devid)
 {
-    return(devid == 25448) || // ETH
-            (devid == 26448) || // ETH
-            (devid == 25458) || //
-            (devid == 26458) || //
-            (devid == 26468) ||
-            (devid == 26478);
+    return      (devid == 25448) || // ETH
+                (devid == 26448) || // ETH
+                (devid == 25458) || //
+                (devid == 26458) || //
+                (devid == 26468) ||
+                (devid == 26478);
 }
 
 // RomInfo implementation
@@ -1419,6 +1534,7 @@ bool FwOperations::ReadImageFile(const char *fimage, u_int8_t *&file_data, int &
 
 void FwOperations::SetDevFlags(chip_type_t chipType, u_int32_t devType, fw_img_type_t fwType, bool &ibDev, bool &ethDev) {
 
+    (void)devType;
     if (chipType == CT_IS4) {
         ibDev =  true;
         ethDev = false;
@@ -1426,8 +1542,8 @@ void FwOperations::SetDevFlags(chip_type_t chipType, u_int32_t devType, fw_img_t
         ibDev = true;
         ethDev = true;
     } else {
-        ibDev  = (fwType == FIT_FS3 && chipType != CT_SPECTRUM) || !CntxEthOnly(devType);
-        ethDev = (chipType == CT_CONNECTX) || (chipType == CT_SPECTRUM) || (chipType == CT_CONNECTX4) || (chipType == CT_CONNECTX4_LX);
+        ibDev  = (fwType == FIT_FS3 && chipType != CT_SPECTRUM) || (chipType == CT_CONNECTX && !CntxEthOnly(devType));
+        ethDev = (chipType == CT_CONNECTX) || (chipType == CT_SPECTRUM) || (chipType == CT_CONNECTX4) || (chipType == CT_CONNECTX4_LX) || (chipType == CT_CONNECTX5);
     }
 
     if ((!ibDev && !ethDev) || chipType == CT_UNKNOWN) {
@@ -1503,6 +1619,7 @@ bool FwOperations::FwWriteBlock(u_int32_t addr, std::vector<u_int8_t> dataVec, P
 bool FwOperations::FwBurnData(u_int32_t *data, u_int32_t dataSize, ProgressCallBack progressFunc) {
     FwOperations* newImgOps;
     fwOpsParams imgOpsParams;
+    memset(&imgOpsParams, 0, sizeof(imgOpsParams));
     char errBuff[1024] = {0};
 
     imgOpsParams.psid      = (char*)NULL;
@@ -1581,3 +1698,23 @@ const char* FwOperations::expRomType2Str(u_int16_t type)
 	        }
 	return (const char*)NULL;
 }
+
+bool FwOperations::FwSetTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer)
+{
+    (void)timestamp;
+    (void)fwVer;
+    return errmsg("Operation not supported.");
+}
+
+bool FwOperations::FwResetTimeStamp()
+{
+    return errmsg("Operation not supported.");
+}
+
+bool FwOperations::FwQueryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning)
+{
+    (void)timestamp;
+    (void)fwVer;
+    (void)queryRunning;
+    return errmsg("Operation not supported.");
+}
diff --git a/mlxfwops/lib/fw_ops.h b/mlxfwops/lib/fw_ops.h
index 93d58c2..9e3542f 100644
--- a/mlxfwops/lib/fw_ops.h
+++ b/mlxfwops/lib/fw_ops.h
@@ -38,6 +38,10 @@
 #include "flint_io.h"
 #include "mlxfwops_com.h"
 
+#ifdef CABLES_SUPP
+#include <cable_access/cable_access.h>
+#endif
+
 typedef f_prog_func_str VerifyCallBack;
 typedef f_prog_func     ProgressCallBack;
 typedef f_prog_func_str PrintCallBack;
@@ -45,7 +49,7 @@ typedef fw_ver_info_t   FwVerInfo;
 
 typedef int (*PrintCallBackAdv) (int completion, char* str);
 
-class MLXFWOP_API FwOperations : public ErrMsg {
+class MLXFWOP_API FwOperations : public FlintErrMsg {
 
 
 public:
@@ -59,9 +63,10 @@ public:
     // typedef std::tr1::function<void (void)> VerifyCallback;
 
     FwOperations(FBase *ioAccess) :
-    	_ioAccess(ioAccess), _isCached(false), _wasVerified(false),
+        _ioAccess(ioAccess), _isCached(false), _wasVerified(false),
         _quickQuery(false), _printFunc((PrintCallBack)NULL), _fname((const char*)NULL),\
-		_devName((const char*)NULL), _advErrors(true)
+        _devName((const char*)NULL), _advErrors(true), _minBinMinorVer(0), _minBinMajorVer(0),
+        _maxBinMajorVer(0)
     {
         memset(_sectionsToRead, 0, sizeof(_sectionsToRead));
         memset(&_fwImgInfo, 0, sizeof(_fwImgInfo));
@@ -108,13 +113,18 @@ public:
     virtual bool FwShiftDevData(PrintCallBack progressFunc=(PrintCallBack)NULL) = 0;
     virtual const char*  FwGetResetRecommandationStr() = 0;
 
+    virtual bool FwSetTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer);
+    virtual bool FwQueryTimeStamp(struct tools_open_ts_entry& timestamp, struct tools_open_fw_version& fwVer, bool queryRunning=false);
+    virtual bool FwResetTimeStamp();
+
     void FwCleanUp();
     virtual bool FwInit() = 0;
     bool FwSetPrint(PrintCallBack PrintFunc);
 
     //needed for flint low level operations
     bool FwSwReset();
-    virtual bool CheckCX4Device() {return true;}
+    virtual bool CheckCX4Device() {return true; /* deprecated always return true*/ }
+    virtual bool FwCalcMD5(u_int8_t md5sum[16]) = 0;
 
     
     //virtual bool FwBurnBlock(FwOperations &FwImageAccess); // Add call back
@@ -124,7 +134,7 @@ public:
     //bool GetExpRomVersionWrapper();
     void getSupporteHwId(u_int32_t **supportedHwId, u_int32_t &supportedHwIdNum);
 
-    class MLXFWOP_API RomInfo : ErrMsg {
+    class MLXFWOP_API RomInfo : FlintErrMsg {
     public:
         RomInfo(const std::vector<u_int8_t>& romSector, bool resEndi=true);
         ~RomInfo() {};
@@ -173,7 +183,7 @@ public:
         //burn params
         bool userGuidsSpecified;
         bool userMacsSpecified;
-        bool userUidsSpecified;
+        bool userUidSpecified;
         bool vsdSpecified;
         bool blankGuids;
         bool burnFailsafe;
@@ -184,6 +194,7 @@ public:
         bool noDevidCheck;
         bool ignoreVersionCheck;
         bool useImgDevData; // FS3 image only - take device data sections from image (valid only if burnFailsafe== false)
+        bool useDevImgInfo; // FS3 image only - preserve select fields of image_info section on the device when burning.
         BurnRomOption burnRomOptions;
 
         //callback fun
@@ -193,10 +204,11 @@ public:
         std::vector<guid_t> userUids; //contains eiter guids or uids
 
 
-        ExtBurnParams():userGuidsSpecified(false), userMacsSpecified(false), userUidsSpecified(false),
+        ExtBurnParams():userGuidsSpecified(false), userMacsSpecified(false), userUidSpecified(false),
                         vsdSpecified(false),blankGuids(false), burnFailsafe(true), allowPsidChange(false),
                         useImagePs(false), useImageGuids(false), singleImageBurn(true), noDevidCheck(false),
-                        ignoreVersionCheck(false), useImgDevData(false), burnRomOptions(BRO_DEFAULT), progressFunc((ProgressCallBack)NULL),
+                        ignoreVersionCheck(false), useImgDevData(false), useDevImgInfo(false),
+                        burnRomOptions(BRO_DEFAULT), progressFunc((ProgressCallBack)NULL),
                         userVsd((char*)NULL){}
         };
 
@@ -224,6 +236,7 @@ public:
             bool noFlashVerify;
             bool shortErrors; // show short/long error msgs (default shuold be false)
             int cx3FwAccess;
+            int isCableFw;
         };
 
         struct sgParams {
@@ -231,7 +244,7 @@ public:
             bool stripedImage; // default shuold be set to false unless working on striped image file
             bool macsSpecified;
             bool guidsSpecified;
-            bool uidsSpecified; // valid for BridgeX and ConnectIB only
+            bool uidSpecified; // valid for ConnectIB only
             std::vector<guid_t> userGuids;
             u_int8_t numOfGUIDs; // number of GUIDs to allocate for each port. keep zero for default. (FS3 image Only)
             u_int8_t stepSize; // step size between GUIDs. keep zero for default. (FS3 Image Only)
@@ -241,6 +254,7 @@ public:
         };
 protected:
     #define FS3_IND_ADDR 0x24
+    #define FS4_IND_ADDR 0x10
     #define ARR_SIZE(arr) sizeof(arr)/sizeof(arr[0])
     #define RESTORING_MSG "Restoring signature"
 
@@ -270,23 +284,28 @@ protected:
         IMG_SIG_TYPE_UNKNOWN = 0,
         IMG_SIG_TYPE_BIN = 1,
         IMG_SIG_TYPE_MFA = 2,
-        IMG_SIG_OPEN_FILE_FAILED = 3
+        IMG_SIG_TYPE_CF  = 3,
+        IMG_SIG_OPEN_FILE_FAILED = 4
     };
 
     enum {
         IMG_VER_FS2 = 0,
         IMG_VER_FS3 = 3,
+        IMG_VER_FS4 = 4
     };
     enum {
         FS_OLD_GEN = 0,
         FS_FS2_GEN,
         FS_FS3_GEN,
+        FS_FS4_GEN,
+        FS_UNKNOWN_IMG
     };
 
     struct HwDevData {
         const char*      name;
         u_int32_t        hwDevId;
         chip_type_t      chipType;
+        chip_family_type chipFamilyType;
         int              portNum;
         // Zero terminated list of SW device ids
         const u_int32_t  swDevIds[MAX_SW_DEVICES_PER_HW];
@@ -298,6 +317,16 @@ protected:
         u_int8_t         revId;
     };
 
+    struct SectionInfo {
+        u_int8_t      type;
+        const char    *name;
+    };
+
+    struct QueryOptions {
+        bool quickQuery;
+        bool readRom;
+    };
+
     typedef int (*print2log_func) (const char* format, ...);
 
     // Protected Methods
@@ -308,7 +337,7 @@ protected:
     bool checkBoot2(u_int32_t beg, u_int32_t offs, u_int32_t& next, bool fullRead, const char *pref,
             VerifyCallBack verifyCallBackFunc = (VerifyCallBack)NULL);
     u_int32_t CalcImageCRC(u_int32_t* buff, u_int32_t size);
-    bool writeImage(ProgressCallBack progressFunc, u_int32_t addr, void *data, int cnt, bool isPhysAddr = false, int totalSz = -1, int alreadyWrittenSz = 0);
+    bool writeImage(ProgressCallBack progressFunc, u_int32_t addr, void *data, int cnt, bool isPhysAddr = false, bool readModifyWrite=false, int totalSz = -1, int alreadyWrittenSz = 0);
     //////////////////////////////////////////////////////////////////
     bool GetSectData(std::vector<u_int8_t>& file_sect, const u_int32_t *buff, const u_int32_t size);
     ////////////////////////////////////////////////////////////////////
@@ -321,7 +350,7 @@ protected:
     void FwInitCom();
     void FwDebugPrint(char *str);
 
-    static bool CntxFindAllImageStart (FBase *ioAccess, u_int32_t start_locations[CNTX_START_POS_SIZE], u_int32_t* found_images);
+    static bool FindAllImageStart (FBase *ioAccess, u_int32_t start_locations[CNTX_START_POS_SIZE], u_int32_t* found_images, u_int32_t const cntx_magic_pattern[]);
     static bool     getRomsInfo(FBase* io, roms_info_t& romsInfo);
 
     bool GetQuickQuery()           {return _quickQuery;}
@@ -329,12 +358,14 @@ protected:
     bool CheckPSID(FwOperations &imageOps, u_int8_t allow_psid_change = false);
     chip_type_t getChipType();
     bool getInfoFromHwDevid(u_int32_t hwDevId, chip_type_t& chipT, const u_int32_t** swIds);
+    HwDevData getInfoFromChipType(chip_type_t chipT) const;
 
     bool ReadImageFile(const char *fimage, u_int8_t *&file_data, int &file_size, int min_size=-1); // min_size=-1 like int flint_ops needed for fs3updateSection
     bool ModifyImageFile(const char *fimage, u_int32_t addr, void *data, int cnt);
     bool WriteImageToFile(const char *file_name, u_int8_t *data, u_int32_t length);
     bool FwBurnData(u_int32_t *data, u_int32_t dataSize, ProgressCallBack progressFunc);
     static bool FwAccessCreate(fw_ops_params_t& fwParams, FBase **ioAccessP);
+    bool CheckBinVersion(u_int8_t binVerMajor, u_int8_t binVerMinor);
 
     // Protected Members
     FBase*    _ioAccess;
@@ -356,6 +387,10 @@ protected:
     // show advanced error msgs
     bool _advErrors;
 
+    u_int8_t _minBinMinorVer;
+    u_int8_t _minBinMajorVer;
+    u_int8_t _maxBinMajorVer;
+
 private:
 
     // Static Methods
@@ -366,7 +401,11 @@ private:
     static int      getFileSignature(const char* fname);
     static int      getBufferSignature(u_int8_t* buf, u_int32_t size);
     static u_int8_t CheckFwFormat(FBase& f, bool getFwFormatFromImg = false);
-    static bool     CntxFindMagicPattern  (FBase* ioAccess, u_int32_t addr);
+    static u_int8_t IsFS4Image(FBase& f, u_int32_t* found_images);
+    static u_int8_t IsFS3OrFS2Image(FBase& f, u_int32_t* found_images);
+    static bool     FindMagicPattern  (FBase* ioAccess, u_int32_t addr,
+            u_int32_t const cntx_magic_pattern[]);
+
     static void     WriteToErrBuff(char* errBuff, const char* errStr, int size);
     void BackUpFwParams(fw_ops_params_t& fwParams);
     static const char * err2str(int errNum);
@@ -374,13 +413,15 @@ private:
 
     // Static Members
     static const u_int32_t _cntx_image_start_pos[CNTX_START_POS_SIZE];
-    static const u_int32_t _cntx_magic_pattern[4];
 
     // Members
     static const HwDevData hwDevData[];
     static const HwDev2Str hwDev2Str[];
     //fw_hndl_type_t _hndlType;  //not used atm
 
+protected:
+    static const u_int32_t _cntx_magic_pattern[4];
+    static const u_int32_t _fs4_magic_pattern[4];
 };
 
 #endif // FW_ACCESS_H
diff --git a/mlxfwops/lib/mlxfwops.cpp b/mlxfwops/lib/mlxfwops.cpp
index c46d98d..681076a 100755
--- a/mlxfwops/lib/mlxfwops.cpp
+++ b/mlxfwops/lib/mlxfwops.cpp
@@ -68,6 +68,13 @@ MLXFWOP_API int MLXFWOPCALL mlxfw_open_buffer(mlxfwops_t** mlxfwops_p, void* buf
     return mlxfw_open_int(mlxfwops_p, buffer, &size, psid, FHT_FW_BUFF, (char*)NULL, 0);
 }
 
+#ifdef CABLES_SUPP
+MLXFWOP_API int MLXFWOPCALL mlxfw_open_cable(mlxfwops_t** mlxfwops_p, char *handle_name, int port)
+{
+    return mlxfw_open_int(mlxfwops_p, handle_name, &port, (char*)NULL, FHT_CABLE_DEV, (char*)NULL, 0);
+}
+#endif
+
 #ifdef UEFI_BUILD
 
 MLXFWOP_API int MLXFWOPCALL mlxfw_open_uefi(mlxfwops_t** mlxfwops_p, uefi_Dev_t* dev, f_fw_cmd fw_cmd_func, uefi_dev_info_t* dev_info)
@@ -167,8 +174,8 @@ MLXFWOP_API int MLXFWOPCALL mlxfw_burn(mlxfwops_t* dev_mlxfwops, mlxfwops_t* img
     burnParams.progressFunc = prog_func;
     burnParams.allowPsidChange = allow_psid_change ? true : false;
     bool rc = !static_cast<FwOperations*>((void*)dev_mlxfwops)->FwBurnAdvanced(static_cast<FwOperations*>((void*)img_mlxfwops),burnParams);
-    return static_cast<FwOperations*>((void*)dev_mlxfwops)->getErrorCode() ?\
-    		static_cast<FwOperations*>((void*)dev_mlxfwops)->getErrorCode() : rc;
+    int errorCode = static_cast<FwOperations*>((void*)dev_mlxfwops)->getErrorCode(); // the class's verbose error code
+    return rc ? ( errorCode ? errorCode : rc) : rc;
 }
 
 MLXFWOP_API int MLXFWOPCALL mlxfw_query(mlxfwops_t* mlxfwops, fw_info_t* fw_info)
@@ -176,7 +183,12 @@ MLXFWOP_API int MLXFWOPCALL mlxfw_query(mlxfwops_t* mlxfwops, fw_info_t* fw_info
     if (mlxfwops == NULL) {
         return MLXFW_BAD_PARAM_ERR;
     }
+#ifdef UEFI_BUILD
+    // skip reading ROM in UEFI due to performance issues
+    return (static_cast<FwOperations*>((void*)mlxfwops)->FwQuery(fw_info, false) == true) ? MLXFW_OK :  MLXFW_ERR_IN_STR;
+#else
     return (static_cast<FwOperations*>((void*)mlxfwops)->FwQuery(fw_info, true) == true) ? MLXFW_OK :  MLXFW_ERR_IN_STR;
+#endif
 }
 
 MLXFWOP_API const char* MLXFWOPCALL mlxfw_exp_rom_type_to_str(u_int16_t type)
diff --git a/mlxfwops/lib/mlxfwops.h b/mlxfwops/lib/mlxfwops.h
index fcb9919..1da17f2 100755
--- a/mlxfwops/lib/mlxfwops.h
+++ b/mlxfwops/lib/mlxfwops.h
@@ -58,6 +58,9 @@ MLXFWOP_API int MLXFWOPCALL mlxfw_open_image(mlxfwops_t** mlxfwops_p, char *file
 
 MLXFWOP_API int MLXFWOPCALL mlxfw_open_buffer(mlxfwops_t** mlxfwops_p, void* buffer, u_int32_t size, char *psid);
 
+#ifdef CABLES_SUPP
+MLXFWOP_API int MLXFWOPCALL mlxfw_open_cable(mlxfwops_t** mlxfwops_p, char *handle_name, int port);
+#endif
 
 #ifdef UEFI_BUILD
 #include <mft_uefi_common.h>
diff --git a/mlxfwops/lib/mlxfwops_com.h b/mlxfwops/lib/mlxfwops_com.h
index e690016..0935904 100644
--- a/mlxfwops/lib/mlxfwops_com.h
+++ b/mlxfwops/lib/mlxfwops_com.h
@@ -65,6 +65,10 @@ typedef int (*f_prog_func_str) (char* str);
 #define PSID_LEN 16
 #define PRODUCT_VER_LEN 16
 #define PRS_NAME_LEN 100
+#define FS3_PRS_NAME_LEN 97
+#define FS4_PRS_NAME_LEN 97
+#define NAME_LEN 65
+#define DESCRIPTION_LEN 257
 
 #define FREE_STR_MAX_LEN    256
 
@@ -115,7 +119,11 @@ enum {
     MLXFW_ROM_UPDATE_IN_IMAGE_ERR,
     MLXFW_GET_SECT_ERR,
     MLXFW_UPDATE_SECT_ERR,
-    MLXFW_BAD_PARAM_ERR
+    MLXFW_BAD_PARAM_ERR,
+    MLXFW_PRS_MISSMATCH_ERR,
+    MLXFW_NO_VALID_DEVICE_INFO_ERR,
+    MLXFW_TWO_VALID_DEVICE_INFO_ERR,
+    MLXFW_DTOC_OVERWRITE_CHUNK
 };
 
 enum {
@@ -153,15 +161,22 @@ typedef enum chip_type {
     CT_UNKNOWN = 0,
     CT_CONNECTX,
     CT_SWITCHX,
-    CT_BRIDGEX,
     CT_IS4,
     CT_CONNECT_IB,
     CT_SWITCH_IB,
     CT_SPECTRUM,
     CT_CONNECTX4,
     CT_CONNECTX4_LX,
+    CT_SWITCH_IB2,
+    CT_CONNECTX5,
 }chip_type_t;
 
+typedef enum chip_family_type {
+    CFT_UNKNOWN = 0,
+    CFT_HCA,
+    CFT_SWITCH,
+}chip_family_type_t;
+
 typedef struct guid {
     u_int32_t h;
     u_int32_t l;
@@ -181,6 +196,19 @@ typedef struct fs3_uid {
     u_int8_t step_size_pp[2]; // set 0xff for default, not relevant for devices >= CX4
 } fs3_uid_t;
 
+typedef struct fs4_uid {
+    guid_t base_guid;
+    int base_guid_specified;
+    guid_t base_mac;
+    int base_mac_specified;
+    u_int8_t num_of_guids; // set 0 for default
+    u_int8_t step_size; // set 0 for default, not relevant for devices >= CX4
+    int set_mac_from_guid;  // if set , base_mac will be derrived automatically from base guid
+    int use_pp_attr; // if set, num_of_guids[2] and step_size[2] will be used for the uid attributes.
+    u_int8_t num_of_guids_pp[2]; // set 0xff for default
+    u_int8_t step_size_pp[2]; // set 0xff for default, not relevant for devices >= CX4
+} fs4_uid_t;
+
 typedef struct rom_info {
     u_int16_t exp_rom_product_id; // 0 - invalid.
     u_int16_t exp_rom_ver[3];
@@ -222,9 +250,14 @@ typedef struct fs3_info_ext {
     uids_t          orig_fs3_uids_info;
     char            image_vsd[VSD_LEN+1];
     char            orig_psid[PSID_LEN+1];
+    char            prs_name[FS3_PRS_NAME_LEN];
+    char            orig_prs_name[FS3_PRS_NAME_LEN];
+    char            name[NAME_LEN];
+    char            description[DESCRIPTION_LEN];
 
 } fs3_info_t;
 
+typedef struct fs3_info_ext fs4_info_t;
 
 typedef struct fs2_info_ext {
     guid_t       guids[MAX_GUIDS];
@@ -237,6 +270,15 @@ typedef struct fs2_info_ext {
     char         prs_name[PRS_NAME_LEN];
 } fs2_info_t;
 
+#ifdef CABLES_SUPP
+typedef struct cablefw_info_ext {
+        u_int8_t  fw_gw_revision[2];
+        u_int16_t fw_dev_id;
+        u_int32_t fw_revision;
+        u_int8_t  image_key;
+} cablefw_info_t;
+#endif
+
 typedef struct roms_info {
     u_int8_t     exp_rom_found;
     u_int8_t     num_of_exp_rom;
@@ -265,14 +307,19 @@ typedef struct fw_info_com {
     u_int8_t     is_failsafe;
     chip_type_t  chip_type;
     roms_info_t  roms_info;
+    u_int16_t    running_fw_ver[3];
 } fw_info_com_t;
 
 
 typedef struct fw_info_ext {
-    u_int8_t      fw_type;
-    fw_info_com_t fw_info;
-    fs2_info_t    fs2_info;
-    fs3_info_t    fs3_info;
+    u_int8_t       fw_type;
+    fw_info_com_t  fw_info;
+    fs2_info_t     fs2_info;
+    fs3_info_t     fs3_info;
+#ifdef CABLES_SUPP
+    cablefw_info_t cablefw_info;
+#endif
+    fs3_info_t    fs4_info;
 } fw_info_t;
 
 typedef enum fw_hndl_type {
@@ -280,12 +327,15 @@ typedef enum fw_hndl_type {
     FHT_FW_FILE,
     FHT_UEFI_DEV,
     FHT_FW_BUFF,
+    FHT_CABLE_DEV,
 } fw_hndl_type_t;
 
 
 typedef enum fw_img_type {
     FIT_FS2,
     FIT_FS3,
+    FIT_FC1,
+    FIT_FS4,
 } fw_img_type_t;
 
 
diff --git a/mstdump/Makefile.in b/mstdump/Makefile.in
index 70617f0..3d6259c 100644
--- a/mstdump/Makefile.in
+++ b/mstdump/Makefile.in
@@ -269,6 +269,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
diff --git a/mstdump/crd_lib/Makefile.am b/mstdump/crd_lib/Makefile.am
index f3e405b..c884184 100755
--- a/mstdump/crd_lib/Makefile.am
+++ b/mstdump/crd_lib/Makefile.am
@@ -33,7 +33,7 @@
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
 
-INCLUDES =	-I$(top_srcdir) -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS =	-I$(top_srcdir) -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
 AM_CFLAGS = -Wall -W -g -MP -MD -pipe -Wno-unused-function  $(COMPILER_FPIC) -DMTCR_EXPORT -DMST_UL -DDATA_PATH=\"$(pkgdatadir)\"
 
 noinst_LIBRARIES = libcrdump.a
diff --git a/mstdump/crd_lib/Makefile.in b/mstdump/crd_lib/Makefile.in
index db70093..89326f9 100644
--- a/mstdump/crd_lib/Makefile.in
+++ b/mstdump/crd_lib/Makefile.in
@@ -265,6 +265,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -319,7 +320,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
 AM_CFLAGS = -Wall -W -g -MP -MD -pipe -Wno-unused-function  $(COMPILER_FPIC) -DMTCR_EXPORT -DMST_UL -DDATA_PATH=\"$(pkgdatadir)\"
 noinst_LIBRARIES = libcrdump.a
 libcrdump_a_SOURCES = crdump.c crdump.h
diff --git a/mstdump/crd_lib/crdump.c b/mstdump/crd_lib/crdump.c
index 451a944..91f5acf 100755
--- a/mstdump/crd_lib/crdump.c
+++ b/mstdump/crd_lib/crdump.c
@@ -327,16 +327,9 @@ static int crd_get_csv_path(IN dm_dev_id_t dev_type, OUT char *csv_file_path) {
     const int dev_name_len = 100;
     char dev_name[100] = {0};
     int  rc;
-    switch (dev_type) {
-    case DeviceInfiniHostIIIEx:
-    case DeviceInfiniHostIIIEx_MF:
-    case DeviceInfiniHost:
-    case DeviceInfiniScale:
-    case DeviceInfiniHostIIILx:
-        return CRD_NOT_SUPPORTED;
-    default:
-        strncpy(dev_name, dm_dev_type2str(dev_type), dev_name_len - 1);
-    }
+
+    strncpy(dev_name, dm_dev_type2str(dev_type), dev_name_len - 1);
+
     if (!strcmp(dev_name, "Unknown Device")) {
         return CRD_UNKOWN_DEVICE;
     }
@@ -504,8 +497,8 @@ static int crd_read_line(IN FILE *fd, OUT char *tmp) {
         if (!feof(fd)) {
             int c = fgetc(fd);
             if (c == '#') {
-                char* _ptr=fgets (tmp, 300, fd);
-                (void)_ptr;//avoid warning
+                if (!fgets (tmp, 300, fd)) { // Avoid warning
+                }
                 tmp[0] = 0;
                 continue;
             }
diff --git a/mstdump/crd_main/Makefile.am b/mstdump/crd_main/Makefile.am
index 0c096d4..89d2778 100755
--- a/mstdump/crd_main/Makefile.am
+++ b/mstdump/crd_main/Makefile.am
@@ -31,7 +31,7 @@
 #--
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir) -I$(srcdir)/../crd_lib -I$(top_srcdir)/include/mtcr_ul
+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/../crd_lib -I$(top_srcdir)/include/mtcr_ul
 AM_CFLAGS = -MD -pipe -g -Wall -W
 
 bin_PROGRAMS = mstregdump
@@ -40,3 +40,5 @@ mstregdump_SOURCES = mstdump.c
 mstregdump_LDADD = ../crd_lib/libcrdump.a ../../dev_mgt/libdev_mgt.a ../../reg_access/libreg_access.a ../../tools_layouts/libtools_layouts.a \
 			../../mtcr_ul/libmtcr_ul.a  -lm -ldl
 
+mstregdump_CFLAGS = -DMSTDUMP_NAME=\"mstregdump\" -DDEV_EXAMPLE=\"0b:00.0\"
+
diff --git a/mstdump/crd_main/Makefile.in b/mstdump/crd_main/Makefile.in
index bb043be..5400de3 100644
--- a/mstdump/crd_main/Makefile.in
+++ b/mstdump/crd_main/Makefile.in
@@ -124,7 +124,7 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_mstregdump_OBJECTS = mstdump.$(OBJEXT)
+am_mstregdump_OBJECTS = mstregdump-mstdump.$(OBJEXT)
 mstregdump_OBJECTS = $(am_mstregdump_OBJECTS)
 mstregdump_DEPENDENCIES = ../crd_lib/libcrdump.a \
 	../../dev_mgt/libdev_mgt.a ../../reg_access/libreg_access.a \
@@ -134,6 +134,9 @@ AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
+mstregdump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mstregdump_CFLAGS) \
+	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -262,6 +265,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -318,12 +322,13 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir) -I$(srcdir)/../crd_lib -I$(top_srcdir)/include/mtcr_ul
+AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/../crd_lib -I$(top_srcdir)/include/mtcr_ul
 AM_CFLAGS = -MD -pipe -g -Wall -W
 mstregdump_SOURCES = mstdump.c
 mstregdump_LDADD = ../crd_lib/libcrdump.a ../../dev_mgt/libdev_mgt.a ../../reg_access/libreg_access.a ../../tools_layouts/libtools_layouts.a \
 			../../mtcr_ul/libmtcr_ul.a  -lm -ldl
 
+mstregdump_CFLAGS = -DMSTDUMP_NAME=\"mstregdump\" -DDEV_EXAMPLE=\"0b:00.0\"
 all: all-am
 
 .SUFFIXES:
@@ -410,7 +415,7 @@ clean-binPROGRAMS:
 
 mstregdump$(EXEEXT): $(mstregdump_OBJECTS) $(mstregdump_DEPENDENCIES) $(EXTRA_mstregdump_DEPENDENCIES) 
 	@rm -f mstregdump$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(mstregdump_OBJECTS) $(mstregdump_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(mstregdump_LINK) $(mstregdump_OBJECTS) $(mstregdump_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -418,7 +423,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mstdump.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mstregdump-mstdump.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -441,6 +446,20 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
+mstregdump-mstdump.o: mstdump.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mstregdump_CFLAGS) $(CFLAGS) -MT mstregdump-mstdump.o -MD -MP -MF $(DEPDIR)/mstregdump-mstdump.Tpo -c -o mstregdump-mstdump.o `test -f 'mstdump.c' || echo '$(srcdir)/'`mstdump.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mstregdump-mstdump.Tpo $(DEPDIR)/mstregdump-mstdump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mstdump.c' object='mstregdump-mstdump.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mstregdump_CFLAGS) $(CFLAGS) -c -o mstregdump-mstdump.o `test -f 'mstdump.c' || echo '$(srcdir)/'`mstdump.c
+
+mstregdump-mstdump.obj: mstdump.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mstregdump_CFLAGS) $(CFLAGS) -MT mstregdump-mstdump.obj -MD -MP -MF $(DEPDIR)/mstregdump-mstdump.Tpo -c -o mstregdump-mstdump.obj `if test -f 'mstdump.c'; then $(CYGPATH_W) 'mstdump.c'; else $(CYGPATH_W) '$(srcdir)/mstdump.c'; fi`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mstregdump-mstdump.Tpo $(DEPDIR)/mstregdump-mstdump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mstdump.c' object='mstregdump-mstdump.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mstregdump_CFLAGS) $(CFLAGS) -c -o mstregdump-mstdump.obj `if test -f 'mstdump.c'; then $(CYGPATH_W) 'mstdump.c'; else $(CYGPATH_W) '$(srcdir)/mstdump.c'; fi`
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
diff --git a/mstdump/crd_main/mstdump.c b/mstdump/crd_main/mstdump.c
index 1a431d7..01c894b 100755
--- a/mstdump/crd_main/mstdump.c
+++ b/mstdump/crd_main/mstdump.c
@@ -38,15 +38,25 @@
 
 #define CAUSE_FLAG "--cause"
 #define MAX_DEV_LEN 512
+
+#ifndef MSTDUMP_NAME
+#define MSTDUMP_NAME "mstdump"
+#endif
+
+#ifndef DEV_EXAMPLE
+#define DEV_EXAMPLE "/dev/mst/mt4099_pci_cr0"
+#endif
+
+
 // string explaining the cmd-line structure
-char correct_cmdline[] = "   Mellanox mstdump utility, dumps device internal configuration data\n\
-   Usage: mstdump [-full] <device> [i2c-slave] [-v[ersion] [-h[elp]]]\n\n\
+char correct_cmdline[] = "   Mellanox "MSTDUMP_NAME" utility, dumps device internal configuration data\n\
+   Usage: "MSTDUMP_NAME" [-full] <device> [i2c-slave] [-v[ersion] [-h[elp]]]\n\n\
    -full              :  Dump more expanded list of addresses\n\
                          Note : be careful when using this flag, None safe addresses might be read.\n\
    -v                 :  Display version info\n\
    -h                 :  Print this help message\n\
    Example :\n\
-            mstdump /dev/mst/mt4099_pci_cr0\n";
+            "MSTDUMP_NAME" "DEV_EXAMPLE"\n";
 
 
 void print_dword(crd_dword_t *dword) {
@@ -79,7 +89,7 @@ int main(int argc, char* argv[]) {
     for (i = 1; i < argc; ++i) {
         /* check position-independent flags */
         if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-help")) {
-            fprintf(stderr, "%s", correct_cmdline);
+            fprintf(stdout, "%s", correct_cmdline);
             exit (0);
         }
         else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "-version")) {
@@ -109,7 +119,7 @@ int main(int argc, char* argv[]) {
         return 1;
     }
     strncpy(device, argv[i], MAX_DEV_LEN -1);
-    if (!( mf = mopen((const char *)device))) {
+    if (!( mf = mopen_adv((const char *)device, (MType)(MST_DEFAULT | MST_CABLE)))) {
         fprintf(stderr, "Unable to open device %s. Exiting.\n", argv[i]);
         return 1;
     }
diff --git a/mstdump/mstdump_dbs/BridgeX.csv b/mstdump/mstdump_dbs/BridgeX.csv
deleted file mode 100755
index 8c8f6dc..0000000
--- a/mstdump/mstdump_dbs/BridgeX.csv
+++ /dev/null
@@ -1,1463 +0,0 @@
-# addr, size, enable addr
-0x000000,5,
-0x000018,1,
-0x000020,1,
-0x000030,2,
-0x000084,8,UNKNOWN
-0x0000a8,12,UNKNOWN
-0x0000dc,1,UNKNOWN
-0x0000f4,8,UNKNOWN
-0x000118,1,
-0x000120,1,
-0x000130,2,
-0x000180,9,UNKNOWN
-0x0001a8,12,UNKNOWN
-0x0001dc,1,UNKNOWN
-0x0001f4,8,UNKNOWN
-0x000218,1,
-0x000220,1,
-0x000230,2,
-0x000280,9,UNKNOWN
-0x0002a8,12,UNKNOWN
-0x0002dc,1,UNKNOWN
-0x0002f4,15,UNKNOWN
-0x000400,15,UNKNOWN
-0x000440,4,UNKNOWN
-0x000500,7,UNKNOWN
-0x000520,1,UNKNOWN
-0x000530,2,UNKNOWN
-0x000540,4,UNKNOWN
-0x000554,2,UNKNOWN
-0x000560,4,UNKNOWN
-0x000574,1,UNKNOWN
-0x00057c,4,UNKNOWN
-0x000590,9,UNKNOWN
-0x0005c0,4,UNKNOWN
-0x0005d4,3,UNKNOWN
-0x0005e4,1,UNKNOWN
-0x0005ec,1,UNKNOWN
-0x000600,7,UNKNOWN
-0x000620,1,UNKNOWN
-0x000630,2,UNKNOWN
-0x000640,4,UNKNOWN
-0x000654,2,UNKNOWN
-0x000660,4,UNKNOWN
-0x000674,1,UNKNOWN
-0x00067c,4,UNKNOWN
-0x000690,9,UNKNOWN
-0x0006c0,4,UNKNOWN
-0x0006d4,3,UNKNOWN
-0x0006e4,1,UNKNOWN
-0x0006ec,1,UNKNOWN
-0x000700,7,UNKNOWN
-0x000720,1,UNKNOWN
-0x000730,2,UNKNOWN
-0x000740,4,UNKNOWN
-0x000754,2,UNKNOWN
-0x000760,4,UNKNOWN
-0x000774,1,UNKNOWN
-0x00077c,4,UNKNOWN
-0x000790,9,UNKNOWN
-0x0007c0,4,UNKNOWN
-0x0007d4,3,UNKNOWN
-0x0007e4,1,UNKNOWN
-0x0007ec,1,UNKNOWN
-0x000800,2,UNKNOWN
-0x00080c,3,UNKNOWN
-0x00081c,1,UNKNOWN
-0x000828,1,UNKNOWN
-0x000840,4,UNKNOWN
-0x000854,4,UNKNOWN
-0x000880,3,UNKNOWN
-0x000890,2,UNKNOWN
-0x000900,1,UNKNOWN
-0x000908,1,UNKNOWN
-0x000910,2,UNKNOWN
-0x00091c,4,UNKNOWN
-0x000940,13,UNKNOWN
-0x000980,10,UNKNOWN
-0x0009c0,5,UNKNOWN
-0x0009e0,1,UNKNOWN
-0x0009f0,2,UNKNOWN
-0x000a00,1,UNKNOWN
-0x000a10,2,UNKNOWN
-0x000a20,1,UNKNOWN
-0x000a30,2,UNKNOWN
-0x000a40,2,UNKNOWN
-0x000c00,2,UNKNOWN
-0x000c0c,3,UNKNOWN
-0x000c1c,1,UNKNOWN
-0x000c28,1,UNKNOWN
-0x000c40,4,UNKNOWN
-0x000c54,4,UNKNOWN
-0x000c80,3,UNKNOWN
-0x000c90,2,UNKNOWN
-0x000d00,1,UNKNOWN
-0x000d08,1,UNKNOWN
-0x000d10,2,UNKNOWN
-0x000d1c,4,UNKNOWN
-0x000d40,13,UNKNOWN
-0x000d80,10,UNKNOWN
-0x000dc0,5,UNKNOWN
-0x000de0,1,UNKNOWN
-0x000df0,2,UNKNOWN
-0x000e00,1,UNKNOWN
-0x000e10,2,UNKNOWN
-0x000e20,1,UNKNOWN
-0x000e30,2,UNKNOWN
-0x000e40,2,UNKNOWN
-0x001000,2,UNKNOWN
-0x00100c,3,UNKNOWN
-0x00101c,1,UNKNOWN
-0x001028,1,UNKNOWN
-0x001040,4,UNKNOWN
-0x001054,4,UNKNOWN
-0x001080,3,UNKNOWN
-0x001090,2,UNKNOWN
-0x001100,1,UNKNOWN
-0x001108,1,UNKNOWN
-0x001110,2,UNKNOWN
-0x00111c,4,UNKNOWN
-0x001140,13,UNKNOWN
-0x001180,10,UNKNOWN
-0x0011c0,5,UNKNOWN
-0x0011e0,1,UNKNOWN
-0x0011f0,2,UNKNOWN
-0x001200,1,UNKNOWN
-0x001210,2,UNKNOWN
-0x001220,1,UNKNOWN
-0x001230,2,UNKNOWN
-0x001240,2,UNKNOWN
-0x001400,2,UNKNOWN
-0x00140c,3,UNKNOWN
-0x00141c,1,UNKNOWN
-0x001428,1,UNKNOWN
-0x001440,4,UNKNOWN
-0x001454,4,UNKNOWN
-0x001480,3,UNKNOWN
-0x001490,2,UNKNOWN
-0x001500,1,UNKNOWN
-0x001508,1,UNKNOWN
-0x001510,2,UNKNOWN
-0x00151c,4,UNKNOWN
-0x001540,13,UNKNOWN
-0x001580,10,UNKNOWN
-0x0015c0,5,UNKNOWN
-0x0015e0,1,UNKNOWN
-0x0015f0,2,UNKNOWN
-0x001600,1,UNKNOWN
-0x001610,2,UNKNOWN
-0x001620,1,UNKNOWN
-0x001630,2,UNKNOWN
-0x001640,2,UNKNOWN
-0x002000,108,UNKNOWN
-0x002800,26,UNKNOWN
-0x002870,3,UNKNOWN
-0x002890,14,UNKNOWN
-0x0028d0,2,UNKNOWN
-0x0028e0,20,UNKNOWN
-0x002a00,1,UNKNOWN
-0x002a10,6,UNKNOWN
-0x002a30,21,UNKNOWN
-0x002a90,2,UNKNOWN
-0x003000,26,UNKNOWN
-0x003070,3,UNKNOWN
-0x003090,14,UNKNOWN
-0x0030d0,2,UNKNOWN
-0x0030e0,20,UNKNOWN
-0x003200,1,UNKNOWN
-0x003210,6,UNKNOWN
-0x003230,21,UNKNOWN
-0x003290,2,UNKNOWN
-0x003800,26,UNKNOWN
-0x003870,3,UNKNOWN
-0x003890,14,UNKNOWN
-0x0038d0,2,UNKNOWN
-0x0038e0,20,UNKNOWN
-0x003a00,1,UNKNOWN
-0x003a10,6,UNKNOWN
-0x003a30,21,UNKNOWN
-0x003a90,2,UNKNOWN
-0x004000,8,UNKNOWN
-0x004028,7,UNKNOWN
-0x00404c,7,UNKNOWN
-0x004074,7,UNKNOWN
-0x004098,7,UNKNOWN
-0x0040bc,7,UNKNOWN
-0x0040e4,7,UNKNOWN
-0x004108,7,UNKNOWN
-0x00412c,7,UNKNOWN
-0x004160,1,UNKNOWN
-0x004170,2,UNKNOWN
-0x004180,1,UNKNOWN
-0x004190,2,UNKNOWN
-0x004200,7,UNKNOWN
-0x004220,9,UNKNOWN
-0x004250,7,UNKNOWN
-0x004280,1,UNKNOWN
-0x004290,2,UNKNOWN
-0x004300,7,UNKNOWN
-0x004320,9,UNKNOWN
-0x004350,7,UNKNOWN
-0x004380,1,UNKNOWN
-0x004390,2,UNKNOWN
-0x004400,7,UNKNOWN
-0x004420,9,UNKNOWN
-0x004450,7,UNKNOWN
-0x004480,1,UNKNOWN
-0x004490,2,UNKNOWN
-0x004500,7,UNKNOWN
-0x004520,9,UNKNOWN
-0x004550,7,UNKNOWN
-0x004580,1,UNKNOWN
-0x004590,2,UNKNOWN
-0x004600,2,UNKNOWN
-0x004610,2,UNKNOWN
-0x004640,1,UNKNOWN
-0x004648,2,UNKNOWN
-0x004654,3,UNKNOWN
-0x004700,1,UNKNOWN
-0x00470c,1,UNKNOWN
-0x004718,2,UNKNOWN
-0x004728,1,UNKNOWN
-0x004740,1,UNKNOWN
-0x004750,2,UNKNOWN
-0x0047f0,2,UNKNOWN
-0x004800,1,UNKNOWN
-0x004810,2,UNKNOWN
-0x004820,3,UNKNOWN
-0x004830,3,UNKNOWN
-0x004900,3,UNKNOWN
-0x004910,3,UNKNOWN
-0x004920,3,UNKNOWN
-0x004930,3,UNKNOWN
-0x004940,18,UNKNOWN
-0x00498c,6,UNKNOWN
-0x0049c0,1,UNKNOWN
-0x0049d0,2,UNKNOWN
-0x005000,604,UNKNOWN
-0x006000,604,UNKNOWN
-0x007000,604,UNKNOWN
-0x008000,5,
-0x008018,1,
-0x008020,1,
-0x008030,2,
-0x008080,9,
-0x0080a8,12,
-0x0080dc,1,
-0x0080f4,8,
-0x008118,1,
-0x008120,1,
-0x008130,2,
-0x008180,9,UNKNOWN
-0x0081a8,12,UNKNOWN
-0x0081dc,1,UNKNOWN
-0x0081f4,8,UNKNOWN
-0x008218,1,UNKNOWN
-0x008220,1,UNKNOWN
-0x008230,2,UNKNOWN
-0x008280,9,UNKNOWN
-0x0082a8,12,UNKNOWN
-0x0082dc,1,UNKNOWN
-0x0082f4,15,UNKNOWN
-0x008400,15,
-0x008440,4,
-0x008500,7,UNKNOWN
-0x008520,1,UNKNOWN
-0x008530,2,UNKNOWN
-0x008540,4,UNKNOWN
-0x008554,2,UNKNOWN
-0x008560,4,UNKNOWN
-0x008574,1,UNKNOWN
-0x00857c,4,UNKNOWN
-0x008590,9,UNKNOWN
-0x0085c0,4,UNKNOWN
-0x0085d4,3,UNKNOWN
-0x0085e4,1,UNKNOWN
-0x0085ec,1,UNKNOWN
-0x008600,7,UNKNOWN
-0x008620,1,UNKNOWN
-0x008630,2,UNKNOWN
-0x008640,4,UNKNOWN
-0x008654,2,UNKNOWN
-0x008660,4,UNKNOWN
-0x008674,1,UNKNOWN
-0x00867c,4,UNKNOWN
-0x008690,9,UNKNOWN
-0x0086c0,4,UNKNOWN
-0x0086d4,3,UNKNOWN
-0x0086e4,1,UNKNOWN
-0x0086ec,1,UNKNOWN
-0x008700,7,UNKNOWN
-0x008720,1,UNKNOWN
-0x008730,2,UNKNOWN
-0x008740,4,UNKNOWN
-0x008754,2,UNKNOWN
-0x008760,4,UNKNOWN
-0x008774,1,UNKNOWN
-0x00877c,4,UNKNOWN
-0x008790,9,UNKNOWN
-0x0087c0,4,UNKNOWN
-0x0087d4,3,UNKNOWN
-0x0087e4,1,UNKNOWN
-0x0087ec,1,UNKNOWN
-0x008900,2,
-0x00890c,2,
-0x008918,5,
-0x008938,4,
-0x008960,1,
-0x008970,2,
-0x008c00,1,
-0x008c10,7,
-0x008c30,2,
-0x008c40,5,
-0x008c60,3,
-0x008c70,5,
-0x008c88,4,
-0x008d10,8,
-0x008d34,1,
-0x008d40,1,
-0x008e00,1,
-0x008e10,2,
-0x009000,108,
-0x009800,26,UNKNOWN
-0x009870,3,UNKNOWN
-0x009890,14,UNKNOWN
-0x0098d0,2,UNKNOWN
-0x0098e0,20,UNKNOWN
-0x009a00,1,UNKNOWN
-0x009a10,6,UNKNOWN
-0x009a30,21,UNKNOWN
-0x009a90,2,UNKNOWN
-0x00a000,26,UNKNOWN
-0x00a070,3,UNKNOWN
-0x00a090,14,UNKNOWN
-0x00a0d0,2,UNKNOWN
-0x00a0e0,20,UNKNOWN
-0x00a200,1,UNKNOWN
-0x00a210,6,UNKNOWN
-0x00a230,21,UNKNOWN
-0x00a290,2,UNKNOWN
-0x00a800,26,UNKNOWN
-0x00a870,3,UNKNOWN
-0x00a890,14,UNKNOWN
-0x00a8d0,2,UNKNOWN
-0x00a8e0,20,UNKNOWN
-0x00aa00,1,UNKNOWN
-0x00aa10,6,UNKNOWN
-0x00aa30,21,UNKNOWN
-0x00aa90,2,UNKNOWN
-0x00b000,8,UNKNOWN
-0x00b028,7,UNKNOWN
-0x00b04c,7,UNKNOWN
-0x00b074,7,UNKNOWN
-0x00b098,7,UNKNOWN
-0x00b0bc,7,UNKNOWN
-0x00b0e4,7,UNKNOWN
-0x00b108,7,UNKNOWN
-0x00b12c,7,UNKNOWN
-0x00b160,1,UNKNOWN
-0x00b170,2,UNKNOWN
-0x00b180,1,UNKNOWN
-0x00b190,2,UNKNOWN
-0x00b300,7,
-0x00b320,9,
-0x00b350,7,
-0x00b380,1,
-0x00b390,2,
-0x00b400,7,
-0x00b420,9,
-0x00b450,7,
-0x00b480,1,
-0x00b490,2,
-0x00b500,7,
-0x00b520,9,
-0x00b550,7,
-0x00b580,1,
-0x00b590,2,
-0x00b900,1,
-0x00b90c,1,
-0x00b918,2,
-0x00b928,1,
-0x00b940,1,
-0x00b950,2,
-0x00b9f0,2,
-0x00ba00,1,
-0x00ba10,2,
-0x00ba20,3,
-0x00bb00,2,
-0x00bb10,2,
-0x00bb3c,1,
-0x00bb44,2,
-0x00bb50,2,
-0x00c700,3,
-0x00c710,3,
-0x00c720,3,
-0x00c730,3,
-0x00c740,18,
-0x00c78c,6,
-0x00c7c0,1,
-0x00c7d0,2,
-0x00d000,604,
-0x00e000,604,
-0x00f000,604,UNKNOWN
-0x014000,1,
-0x014008,1,
-0x014010,1,
-0x014018,1,
-0x014020,1,
-0x014028,1,
-0x014030,1,
-0x014038,1,
-0x014040,1,
-0x014048,1,
-0x014050,1,
-0x014058,1,
-0x014060,1,
-0x014068,1,
-0x014070,1,
-0x014084,7,
-0x0140a4,1,
-0x0140cc,5,
-0x0140e4,10,
-0x014110,1,
-0x014130,1,
-0x01413c,1,
-0x014144,4,
-0x01415c,1,
-0x014170,20,
-0x014200,2,
-0x01420c,8,
-0x014234,2,
-0x014240,3,
-0x014254,2,
-0x0142c0,16,
-0x014400,9,
-0x014440,8,
-0x014480,9,
-0x0144c0,8,
-0x014500,9,
-0x014540,8,
-0x014580,9,
-0x0145c0,8,
-0x014600,8,
-0x014684,1,
-0x0146ac,13,
-0x014700,12,
-0x014800,8,
-0x014840,16,
-0x014884,4,
-0x014898,15,
-0x0148dc,4,
-0x014900,3,
-0x014910,3,
-0x014920,6,
-0x014940,6,
-0x014960,3,
-0x014980,1,
-0x014994,3,
-0x014a00,1,
-0x014a14,6,
-0x014a34,2,
-0x014a40,4,
-0x014a80,1,
-0x014a88,24,
-0x014b1c,15,
-0x014b5c,1,
-0x014c00,22,
-0x014c60,6,
-0x014c80,6,
-0x014ca0,6,
-0x014cc0,6,
-0x014ce0,6,
-0x014d40,28,
-0x014dc0,8,
-0x014e00,17,
-0x014e48,64,
-0x015000,1,
-0x015008,1,
-0x015010,1,
-0x015018,1,
-0x015020,1,
-0x015028,1,
-0x015030,1,
-0x015038,1,
-0x015040,1,
-0x015048,1,
-0x015050,1,
-0x015058,1,
-0x015060,1,
-0x015068,1,
-0x015070,1,
-0x015084,7,
-0x0150a4,1,
-0x0150cc,5,
-0x0150e4,12,
-0x015130,2,
-0x01513c,1,
-0x015160,3,
-0x015200,2,
-0x01520c,1,
-0x015214,1,
-0x015220,2,
-0x01522c,1,
-0x015234,1,
-0x015240,2,
-0x01524c,1,
-0x015254,1,
-0x015268,1,
-0x015274,1,
-0x015280,16,
-0x015400,9,
-0x015440,8,
-0x015480,9,
-0x0154c0,8,
-0x015500,9,
-0x015540,8,
-0x015600,8,
-0x015684,1,
-0x0156a4,11,
-0x0156d4,7,
-0x015700,12,
-0x0157dc,2,
-0x015800,8,
-0x015840,16,
-0x015884,4,
-0x015898,15,
-0x0158dc,4,
-0x015900,3,
-0x015940,6,
-0x015960,3,
-0x015980,1,
-0x015994,3,
-0x015a00,1,
-0x015a14,6,
-0x015a34,2,
-0x015a40,9,
-0x015a80,1,
-0x015a88,24,
-0x015b1c,15,
-0x015b5c,1,
-0x015c00,22,
-0x015c60,6,
-0x015c80,6,
-0x015ca0,6,
-0x015cc0,6,
-0x015ce0,6,
-0x015d40,28,
-0x015dc0,8,
-0x015e00,17,
-0x015e48,64,
-0x016064,7,
-0x016084,7,
-0x0160c0,1,
-0x016114,6,
-0x016200,20,
-0x016258,5,
-0x016270,1,
-0x016400,11,
-0x016460,65,
-0x016570,3,
-0x016604,1,
-0x016614,3,
-0x016624,1,
-0x016634,8,
-0x01667c,3,
-0x01668c,3,
-0x01669c,3,
-0x0166ac,3,
-0x0166bc,3,
-0x0166cc,3,
-0x0166dc,3,
-0x0166ec,3,
-0x0166fc,3,
-0x01670c,3,
-0x01671c,3,
-0x01672c,3,
-0x01673c,3,
-0x01674c,3,
-0x01675c,3,
-0x01676c,3,
-0x01677c,9,
-0x016880,1,
-0x016890,2,
-0x0168a0,3,
-0x016a00,2,
-0x016a0c,2,
-0x016a18,3,
-0x016a28,1,
-0x016a40,1,
-0x016a50,2,
-0x016a60,1,
-0x016a70,2,
-0x016af0,3,
-0x016b00,1,
-0x016b10,2,
-0x016b20,1,
-0x016b30,2,
-0x016b40,1,
-0x016b50,2,
-0x016b60,1,
-0x016b70,2,
-0x016b80,1,
-0x016b90,2,
-0x016ba0,3,
-0x016bb0,1,
-0x017000,1,
-0x017040,1,
-0x017048,3,
-0x017058,3,
-0x017068,3,
-0x017078,3,
-0x017088,3,
-0x017098,3,
-0x0170a8,3,
-0x0170b8,3,
-0x0170c8,3,
-0x0170d8,3,
-0x0170e8,3,
-0x0170f8,3,
-0x017110,2,
-0x01748c,3,
-0x0174a0,4,
-0x020000,5,
-0x020018,1,
-0x020020,1,
-0x020030,2,
-0x020080,9,UNKNOWN
-0x0200a8,12,UNKNOWN
-0x0200dc,1,UNKNOWN
-0x0200f4,8,UNKNOWN
-0x020118,1,
-0x020120,1,
-0x020130,2,
-0x020180,9,UNKNOWN
-0x0201a8,12,UNKNOWN
-0x0201dc,1,UNKNOWN
-0x0201f4,8,UNKNOWN
-0x020218,1,UNKNOWN
-0x020220,1,UNKNOWN
-0x020230,2,UNKNOWN
-0x020280,9,UNKNOWN
-0x0202a8,12,UNKNOWN
-0x0202dc,1,UNKNOWN
-0x0202f4,15,UNKNOWN
-0x020400,15,
-0x020440,4,
-0x020500,7,UNKNOWN
-0x020520,1,UNKNOWN
-0x020530,2,UNKNOWN
-0x020540,4,UNKNOWN
-0x020554,2,UNKNOWN
-0x020560,4,UNKNOWN
-0x020574,1,UNKNOWN
-0x02057c,4,UNKNOWN
-0x020590,9,UNKNOWN
-0x0205c0,4,UNKNOWN
-0x0205d4,3,UNKNOWN
-0x0205e4,1,UNKNOWN
-0x0205ec,1,UNKNOWN
-0x020600,7,UNKNOWN
-0x020620,1,UNKNOWN
-0x020630,2,UNKNOWN
-0x020640,4,UNKNOWN
-0x020654,2,UNKNOWN
-0x020660,4,UNKNOWN
-0x020674,1,UNKNOWN
-0x02067c,4,UNKNOWN
-0x020690,9,UNKNOWN
-0x0206c0,4,UNKNOWN
-0x0206d4,3,UNKNOWN
-0x0206e4,1,UNKNOWN
-0x0206ec,1,UNKNOWN
-0x020700,7,UNKNOWN
-0x020720,1,UNKNOWN
-0x020730,2,UNKNOWN
-0x020740,4,UNKNOWN
-0x020754,2,UNKNOWN
-0x020760,4,UNKNOWN
-0x020774,1,UNKNOWN
-0x02077c,4,UNKNOWN
-0x020790,9,UNKNOWN
-0x0207c0,4,UNKNOWN
-0x0207d4,3,UNKNOWN
-0x0207e4,1,UNKNOWN
-0x0207ec,1,UNKNOWN
-0x020800,2,UNKNOWN
-0x02080c,3,UNKNOWN
-0x02081c,1,UNKNOWN
-0x020828,1,UNKNOWN
-0x020840,4,UNKNOWN
-0x020854,4,UNKNOWN
-0x020880,3,UNKNOWN
-0x020890,2,UNKNOWN
-0x020900,1,UNKNOWN
-0x020908,1,UNKNOWN
-0x020910,2,UNKNOWN
-0x02091c,4,UNKNOWN
-0x020940,13,UNKNOWN
-0x020980,10,UNKNOWN
-0x0209c0,5,UNKNOWN
-0x0209e0,1,UNKNOWN
-0x0209f0,2,UNKNOWN
-0x020a00,1,UNKNOWN
-0x020a10,2,UNKNOWN
-0x020a20,1,UNKNOWN
-0x020a30,2,UNKNOWN
-0x020a40,2,UNKNOWN
-0x020c00,2,UNKNOWN
-0x020c0c,3,UNKNOWN
-0x020c1c,1,UNKNOWN
-0x020c28,1,UNKNOWN
-0x020c40,4,UNKNOWN
-0x020c54,4,UNKNOWN
-0x020c80,3,UNKNOWN
-0x020c90,2,UNKNOWN
-0x020d00,1,UNKNOWN
-0x020d08,1,UNKNOWN
-0x020d10,2,UNKNOWN
-0x020d1c,4,UNKNOWN
-0x020d40,13,UNKNOWN
-0x020d80,10,UNKNOWN
-0x020dc0,5,UNKNOWN
-0x020de0,1,UNKNOWN
-0x020df0,2,UNKNOWN
-0x020e00,1,UNKNOWN
-0x020e10,2,UNKNOWN
-0x020e20,1,UNKNOWN
-0x020e30,2,UNKNOWN
-0x020e40,2,UNKNOWN
-0x021000,2,UNKNOWN
-0x02100c,3,UNKNOWN
-0x02101c,1,UNKNOWN
-0x021028,1,UNKNOWN
-0x021040,4,UNKNOWN
-0x021054,4,UNKNOWN
-0x021080,3,UNKNOWN
-0x021090,2,UNKNOWN
-0x021100,1,UNKNOWN
-0x021108,1,UNKNOWN
-0x021110,2,UNKNOWN
-0x02111c,4,UNKNOWN
-0x021140,13,UNKNOWN
-0x021180,10,UNKNOWN
-0x0211c0,5,UNKNOWN
-0x0211e0,1,UNKNOWN
-0x0211f0,2,UNKNOWN
-0x021200,1,UNKNOWN
-0x021210,2,UNKNOWN
-0x021220,1,UNKNOWN
-0x021230,2,UNKNOWN
-0x021240,2,UNKNOWN
-0x021400,2,UNKNOWN
-0x02140c,3,UNKNOWN
-0x02141c,1,UNKNOWN
-0x021428,1,UNKNOWN
-0x021440,4,UNKNOWN
-0x021454,4,UNKNOWN
-0x021480,3,UNKNOWN
-0x021490,2,UNKNOWN
-0x021500,1,UNKNOWN
-0x021508,1,UNKNOWN
-0x021510,2,UNKNOWN
-0x02151c,4,UNKNOWN
-0x021540,13,UNKNOWN
-0x021580,10,UNKNOWN
-0x0215c0,5,UNKNOWN
-0x0215e0,1,UNKNOWN
-0x0215f0,2,UNKNOWN
-0x021600,1,UNKNOWN
-0x021610,2,UNKNOWN
-0x021620,1,UNKNOWN
-0x021630,2,UNKNOWN
-0x021640,2,UNKNOWN
-0x022000,108,UNKNOWN
-0x022800,26,UNKNOWN
-0x022870,3,UNKNOWN
-0x022890,14,UNKNOWN
-0x0228d0,2,UNKNOWN
-0x0228e0,20,UNKNOWN
-0x022a00,1,UNKNOWN
-0x022a10,6,UNKNOWN
-0x022a30,21,UNKNOWN
-0x022a90,2,UNKNOWN
-0x023000,26,UNKNOWN
-0x023070,3,UNKNOWN
-0x023090,14,UNKNOWN
-0x0230d0,2,UNKNOWN
-0x0230e0,20,UNKNOWN
-0x023200,1,UNKNOWN
-0x023210,6,UNKNOWN
-0x023230,21,UNKNOWN
-0x023290,2,UNKNOWN
-0x023800,26,UNKNOWN
-0x023870,3,UNKNOWN
-0x023890,14,UNKNOWN
-0x0238d0,2,UNKNOWN
-0x0238e0,20,UNKNOWN
-0x023a00,1,UNKNOWN
-0x023a10,6,UNKNOWN
-0x023a30,21,UNKNOWN
-0x023a90,2,UNKNOWN
-0x024000,8,UNKNOWN
-0x024028,7,UNKNOWN
-0x02404c,7,UNKNOWN
-0x024074,7,UNKNOWN
-0x024098,7,UNKNOWN
-0x0240bc,7,UNKNOWN
-0x0240e4,7,UNKNOWN
-0x024108,7,UNKNOWN
-0x02412c,7,UNKNOWN
-0x024160,1,UNKNOWN
-0x024170,2,UNKNOWN
-0x024180,1,UNKNOWN
-0x024190,2,UNKNOWN
-0x024200,7,
-0x024220,9,
-0x024250,7,
-0x024280,1,
-0x024290,2,
-0x024300,7,
-0x024320,9,
-0x024350,7,
-0x024380,1,
-0x024390,2,
-0x024400,7,
-0x024420,9,
-0x024450,7,
-0x024480,1,
-0x024490,2,
-0x024500,7,UNKNOWN
-0x024520,9,UNKNOWN
-0x024550,7,UNKNOWN
-0x024580,1,UNKNOWN
-0x024590,2,UNKNOWN
-0x024600,2,
-0x024610,2,
-0x024640,1,
-0x024648,2,
-0x024654,3,
-0x024700,1,
-0x02470c,1,
-0x024718,2,
-0x024728,1,
-0x024740,1,
-0x024750,2,
-0x0247f0,2,
-0x024800,1,
-0x024810,2,
-0x024820,3,
-0x024830,3,
-0x024900,3,UNKNOWN
-0x024910,3,UNKNOWN
-0x024920,3,UNKNOWN
-0x024930,3,UNKNOWN
-0x024940,18,UNKNOWN
-0x02498c,6,UNKNOWN
-0x0249c0,1,UNKNOWN
-0x0249d0,2,UNKNOWN
-0x025000,604,UNKNOWN
-0x026000,604,UNKNOWN
-0x027000,604,UNKNOWN
-0x028000,5,
-0x028018,1,
-0x028020,1,
-0x028030,2,
-0x028080,9,
-0x0280a8,12,
-0x0280dc,1,
-0x0280f4,8,
-0x028118,1,
-0x028120,1,
-0x028130,2,
-0x028180,9,UNKNOWN
-0x0281a8,12,UNKNOWN
-0x0281dc,1,UNKNOWN
-0x0281f4,8,UNKNOWN
-0x028218,1,
-0x028220,1,
-0x028230,2,
-0x028280,9,UNKNOWN
-0x0282a8,12,UNKNOWN
-0x0282dc,1,UNKNOWN
-0x0282f4,15,UNKNOWN
-0x028400,15,
-0x028440,4,
-0x028500,7,UNKNOWN
-0x028520,1,UNKNOWN
-0x028530,2,UNKNOWN
-0x028540,4,UNKNOWN
-0x028554,2,UNKNOWN
-0x028560,4,UNKNOWN
-0x028574,1,UNKNOWN
-0x02857c,4,UNKNOWN
-0x028590,9,UNKNOWN
-0x0285c0,4,UNKNOWN
-0x0285d4,3,UNKNOWN
-0x0285e4,1,UNKNOWN
-0x0285ec,1,UNKNOWN
-0x028600,7,UNKNOWN
-0x028620,1,UNKNOWN
-0x028630,2,UNKNOWN
-0x028640,4,UNKNOWN
-0x028654,2,UNKNOWN
-0x028660,4,UNKNOWN
-0x028674,1,UNKNOWN
-0x02867c,4,UNKNOWN
-0x028690,9,UNKNOWN
-0x0286c0,4,UNKNOWN
-0x0286d4,3,UNKNOWN
-0x0286e4,1,UNKNOWN
-0x0286ec,1,UNKNOWN
-0x028700,7,UNKNOWN
-0x028720,1,UNKNOWN
-0x028730,2,UNKNOWN
-0x028740,4,UNKNOWN
-0x028754,2,UNKNOWN
-0x028760,4,UNKNOWN
-0x028774,1,UNKNOWN
-0x02877c,4,UNKNOWN
-0x028790,9,UNKNOWN
-0x0287c0,4,UNKNOWN
-0x0287d4,3,UNKNOWN
-0x0287e4,1,UNKNOWN
-0x0287ec,1,UNKNOWN
-0x028900,2,
-0x02890c,2,
-0x028918,5,
-0x028938,4,
-0x028960,1,
-0x028970,2,
-0x028c00,1,
-0x028c10,7,
-0x028c30,2,
-0x028c40,5,
-0x028c60,3,
-0x028c70,5,
-0x028c88,4,
-0x028d10,8,
-0x028d34,1,
-0x028d40,1,
-0x028e00,1,
-0x028e10,2,
-0x029000,108,
-0x029800,26,UNKNOWN
-0x029870,3,UNKNOWN
-0x029890,14,UNKNOWN
-0x0298d0,2,UNKNOWN
-0x0298e0,20,UNKNOWN
-0x029a00,1,UNKNOWN
-0x029a10,6,UNKNOWN
-0x029a30,21,UNKNOWN
-0x029a90,2,UNKNOWN
-0x02a000,26,UNKNOWN
-0x02a070,3,UNKNOWN
-0x02a090,14,UNKNOWN
-0x02a0d0,2,UNKNOWN
-0x02a0e0,20,UNKNOWN
-0x02a200,1,UNKNOWN
-0x02a210,6,UNKNOWN
-0x02a230,21,UNKNOWN
-0x02a290,2,UNKNOWN
-0x02a800,26,UNKNOWN
-0x02a870,3,UNKNOWN
-0x02a890,14,UNKNOWN
-0x02a8d0,2,UNKNOWN
-0x02a8e0,20,UNKNOWN
-0x02aa00,1,UNKNOWN
-0x02aa10,6,UNKNOWN
-0x02aa30,21,UNKNOWN
-0x02aa90,2,UNKNOWN
-0x02b000,8,UNKNOWN
-0x02b028,7,UNKNOWN
-0x02b04c,7,UNKNOWN
-0x02b074,7,UNKNOWN
-0x02b098,7,UNKNOWN
-0x02b0bc,7,UNKNOWN
-0x02b0e4,7,UNKNOWN
-0x02b108,7,UNKNOWN
-0x02b12c,7,UNKNOWN
-0x02b160,1,UNKNOWN
-0x02b170,2,UNKNOWN
-0x02b180,1,UNKNOWN
-0x02b190,2,UNKNOWN
-0x02b300,7,
-0x02b320,9,
-0x02b350,7,
-0x02b380,1,
-0x02b390,2,
-0x02b400,7,
-0x02b420,9,
-0x02b450,7,
-0x02b480,1,
-0x02b490,2,
-0x02b500,7,
-0x02b520,9,
-0x02b550,7,
-0x02b580,1,
-0x02b590,2,
-0x02b900,1,
-0x02b90c,1,
-0x02b918,2,
-0x02b928,1,
-0x02b940,1,
-0x02b950,2,
-0x02b9f0,2,
-0x02ba00,1,
-0x02ba10,2,
-0x02ba20,3,
-0x02bb00,2,
-0x02bb10,2,
-0x02bb3c,1,
-0x02bb44,2,
-0x02bb50,2,
-0x02c700,3,
-0x02c710,3,
-0x02c720,3,
-0x02c730,3,
-0x02c740,18,
-0x02c78c,6,
-0x02c7c0,1,
-0x02c7d0,2,
-0x02d000,604,
-0x02e000,604,
-0x02f000,604,UNKNOWN
-0x034000,1,
-0x034008,1,
-0x034010,1,
-0x034018,1,
-0x034020,1,
-0x034028,1,
-0x034030,1,
-0x034038,1,
-0x034040,1,
-0x034048,1,
-0x034050,1,
-0x034058,1,
-0x034060,1,
-0x034068,1,
-0x034070,1,
-0x034084,7,
-0x0340a4,1,
-0x0340cc,5,
-0x0340e4,10,
-0x034110,1,
-0x034130,1,
-0x03413c,1,
-0x034144,4,
-0x03415c,1,
-0x034170,20,
-0x034200,2,
-0x03420c,8,
-0x034234,2,
-0x034240,3,
-0x034254,2,
-0x0342c0,16,
-0x034400,9,
-0x034440,8,
-0x034480,9,
-0x0344c0,8,
-0x034500,9,
-0x034540,8,
-0x034580,9,
-0x0345c0,8,
-0x034600,8,
-0x034684,1,
-0x0346ac,13,
-0x034700,12,
-0x034800,8,
-0x034840,16,
-0x034884,4,
-0x034898,15,
-0x0348dc,4,
-0x034900,3,
-0x034910,3,
-0x034920,6,
-0x034940,6,
-0x034960,3,
-0x034980,1,
-0x034994,3,
-0x034a00,1,
-0x034a14,6,
-0x034a34,2,
-0x034a40,4,
-0x034a80,1,
-0x034a88,24,
-0x034b1c,15,
-0x034b5c,1,
-0x034c00,22,
-0x034c60,6,
-0x034c80,6,
-0x034ca0,6,
-0x034cc0,6,
-0x034ce0,6,
-0x034d40,28,
-0x034dc0,8,
-0x034e00,17,
-0x034e48,64,
-0x035000,1,
-0x035008,1,
-0x035010,1,
-0x035018,1,
-0x035020,1,
-0x035028,1,
-0x035030,1,
-0x035038,1,
-0x035040,1,
-0x035048,1,
-0x035050,1,
-0x035058,1,
-0x035060,1,
-0x035068,1,
-0x035070,1,
-0x035084,7,
-0x0350a4,1,
-0x0350cc,5,
-0x0350e4,12,
-0x035130,2,
-0x03513c,1,
-0x035160,3,
-0x035200,2,
-0x03520c,1,
-0x035214,1,
-0x035220,2,
-0x03522c,1,
-0x035234,1,
-0x035240,2,
-0x03524c,1,
-0x035254,1,
-0x035268,1,
-0x035274,1,
-0x035280,16,
-0x035400,9,
-0x035440,8,
-0x035480,9,
-0x0354c0,8,
-0x035500,9,
-0x035540,8,
-0x035600,8,
-0x035684,1,
-0x0356a4,11,
-0x0356d4,7,
-0x035700,12,
-0x0357dc,2,
-0x035800,8,
-0x035840,16,
-0x035884,4,
-0x035898,15,
-0x0358dc,4,
-0x035900,3,
-0x035940,6,
-0x035960,3,
-0x035980,1,
-0x035994,3,
-0x035a00,1,
-0x035a14,6,
-0x035a34,2,
-0x035a40,9,
-0x035a80,1,
-0x035a88,24,
-0x035b1c,15,
-0x035b5c,1,
-0x035c00,22,
-0x035c60,6,
-0x035c80,6,
-0x035ca0,6,
-0x035cc0,6,
-0x035ce0,6,
-0x035d40,28,
-0x035dc0,8,
-0x035e00,17,
-0x035e48,64,
-0x036064,7,
-0x036084,7,
-0x0360c0,1,
-0x036114,6,
-0x036200,20,
-0x036258,5,
-0x036270,1,
-0x036400,11,
-0x036460,65,
-0x036570,3,
-0x036604,1,
-0x036614,3,
-0x036624,1,
-0x036634,8,
-0x03667c,3,
-0x03668c,3,
-0x03669c,3,
-0x0366ac,3,
-0x0366bc,3,
-0x0366cc,3,
-0x0366dc,3,
-0x0366ec,3,
-0x0366fc,3,
-0x03670c,3,
-0x03671c,3,
-0x03672c,3,
-0x03673c,3,
-0x03674c,3,
-0x03675c,3,
-0x03676c,3,
-0x03677c,9,
-0x036880,1,
-0x036890,2,
-0x0368a0,3,
-0x036a00,2,
-0x036a0c,2,
-0x036a18,3,
-0x036a28,1,
-0x036a40,1,
-0x036a50,2,
-0x036a60,1,
-0x036a70,2,
-0x036af0,3,
-0x036b00,1,
-0x036b10,2,
-0x036b20,1,
-0x036b30,2,
-0x036b40,1,
-0x036b50,2,
-0x036b60,1,
-0x036b70,2,
-0x036b80,1,
-0x036b90,2,
-0x036ba0,3,
-0x036bb0,1,
-0x037000,1,
-0x037040,1,
-0x037048,3,
-0x037058,3,
-0x037068,3,
-0x037078,3,
-0x037088,3,
-0x037098,3,
-0x0370a8,3,
-0x0370b8,3,
-0x0370c8,3,
-0x0370d8,3,
-0x0370e8,3,
-0x0370f8,3,
-0x037110,2,
-0x03748c,3,
-0x0374a0,4,
-0x040000,3,
-0x04001c,1,
-0x040030,1,
-0x040044,1,
-0x04004c,1,
-0x040054,1,
-0x04005c,1,
-0x040068,11,
-0x04009c,2,
-0x0400ac,13,
-0x040180,1,
-0x0401c0,1,
-0x0401cc,1,UNKNOWN
-0x0401e0,1,
-0x0401ec,2,
-0x0401f8,1,
-0x040200,3,
-0x04021c,1,
-0x040230,1,
-0x040244,1,
-0x04024c,1,
-0x040254,1,
-0x04025c,1,
-0x040268,11,
-0x04029c,2,
-0x0402ac,13,
-0x040380,1,
-0x0403c0,1,
-0x0403cc,1,UNKNOWN
-0x0403e0,1,
-0x0403ec,2,
-0x0403f8,1,
-0x040400,128,
-0x040604,1,
-0x040618,2,
-0x040804,9,
-0x040850,10,
-0x04087c,1,
-0x0408b0,3,
-0x0408c0,1,
-0x0408d0,2,
-0x0408e0,1,
-0x0408f0,2,
-0x040900,1,
-0x040910,2,
-0x040940,10,
-0x040980,1,
-0x041800,8,
-0x041890,3,
-0x042000,24,
-0x042200,18,
-0x042400,42,
-0x042600,2,
-0x042800,42,
-0x042a00,2,
-0x042fec,1,
-0x042ff4,3,
-0x043010,4,
-0x043030,7,
-0x043100,7,
-0x043140,4,
-0x050100,9,
-0x050128,8,
-0x050160,1,
-0x050170,4,
-0x05018c,1,
-0x0501bc,5,
-0x050200,25,
-0x050280,12,
-0x051100,10,
-0x051130,4,
-0x051158,9,
-0x051180,1,
-0x0517fc,1,
-0x0518b8,16,
-0x051900,12,
-0x053c00,4,
-0x053c20,4,
-0x053c34,9,
-0x053c60,2,
-0x053c6c,2,
-0x053c8c,3,
-0x053c9c,1,
-0x053cf4,4,
-0x053e00,4,
-0x053e20,4,
-0x053e34,7,
-0x053e60,2,
-0x053e6c,2,
-0x053e8c,3,
-0x053e9c,1,
-0x053ef4,3,
-0x053f04,7,
-0x053f40,1,
-0x053ffc,5,
-0x055000,1,
-0x056000,4,
-0x057000,1,
-0x057020,1,
-0x057100,1,
-0x057200,3,
-0x0577f8,2,
-0x060000,16385,
-0x07000c,1,
-0x070018,2,
-0x070028,1,
-0x070040,1,
-0x070050,2,
-0x0700f0,3,
-0x070100,2,
-0x07010c,6,
-0x070128,3,
-0x070140,5,
-0x070180,4,
-0x0701a0,1,
-0x0701b0,2,
-0x070200,33,
-0x0702a0,1,
-0x0702b0,2,
-0x0702c0,12,
-0x070304,1,
-0x070310,4,
-0x070c40,2,
-0x071000,7,
-0x072000,7,
-0x0f0000,3,
-0x0f0014,1,
-0x0f001c,3,
-0x0f0030,3,
-0x0f0040,2,
-0x0f004c,3,
-0x0f0060,1,
-0x0f0070,2,
-0x0f0080,2,
-0x0f008c,3,
-0x0f00a0,1,
-0x0f00b0,2,
-0x0f00c0,2,
-0x0f00d0,4,
-0x0f00f0,2,
-0x0f0100,4,
-0x0f0128,7,
-0x0f0150,2,
-0x0f0160,3,
-0x0f0170,1,
-0x0f0180,9,
-0x0f01b0,5,
-0x0f01c4,7,UNKNOWN
-0x0f0200,23,
-0x0f02a4,5,
-0x0f02c0,7,
-0x0f02e0,5,
-0x0f0404,2,
-0x0f0410,10,
-0x0f0440,4,
-0x0f0454,7,
-0x0f0480,23,
-0x0f3000,13,
-0x0f3040,5,
-0x0f3058,7,
-0x0f3078,14,
-0x0f30c0,13,
-0x0f3100,1,
-0x0f310c,1,
-0x0f3120,2,
-0x0f3130,5,
-0x0f3184,13,
-0x0f31bc,1,
-0x0f3204,1,
-0x0f3210,5,
-0x0f3244,6,
-0x0f3264,5,
-0x0f3280,2,
-0x0f3290,8,
-0x0f32ec,1,
-0x0f3300,11,
-0x0f3330,1,
-0x0f3400,32,
-0x0f3500,2,
-0x0f350c,11,
-0x0f3548,2,
-0x0f3554,4,
-0x0f3574,2,
-0x0f3580,9,
-0x0f35b0,2,
-0x0f35cc,8,
-0x0f3704,1,
-0x0f370c,12,
-0x0f3760,1,
-0x0f3770,2,
-0x0f3780,1,
-0x0f3790,2,
-0x0f37ac,5,
-0x0f3800,3,
-0x0f3810,2,
-0x0f381c,21,
-0x0f3880,9,
-0x0f38b0,2,
-0x0f38c0,1,
-0x0f38f8,3,
-0x0f3908,2,
-0x0f3920,1,
-0x0f3928,27,
-0x0f3998,3,
-0x0f39b0,4,
-0x0f3a00,3,
-0x0f3a10,4,
-0x0f3a24,3,
-0x0f3a34,4,
-0x0f3a60,1,
-0x0f3a70,2,
-0x0f3a84,3,
-0x0f3b00,1,
-0x0f3b0c,1,
-0x0f3b18,2,
-0x0f3b28,1,
-0x0f3b40,1,
-0x0f3b50,2,
-0x0f3bf0,3,
-0x0f3c00,3,
diff --git a/mstdump/mstdump_dbs/ConnectX.csv b/mstdump/mstdump_dbs/ConnectX.csv
deleted file mode 100755
index 99d2d7b..0000000
--- a/mstdump/mstdump_dbs/ConnectX.csv
+++ /dev/null
@@ -1,2301 +0,0 @@
-# addr, size, enable addr
-0x010000,1,
-0x0100a0,15,
-0x0100ec,7,
-0x01010c,1,
-0x010150,1,
-0x0101cc,1,
-0x0101fc,1,
-0x010208,8,
-0x010300,7,
-0x010320,20,
-0x010374,2,
-0x010400,3,
-0x010410,2,
-0x010440,3,
-0x010450,2,
-0x010600,29,
-0x010680,3,
-0x010690,2,
-0x0106a0,4,
-0x0106b4,2,
-0x0106e0,3,
-0x0106f0,3,
-0x010700,4,
-0x010714,1,
-0x010720,5,
-0x010740,13,
-0x010780,4,
-0x0107a0,1,
-0x0107a8,1,
-0x0107b0,12,
-0x0107f8,3,
-0x0108a0,15,
-0x0108ec,7,
-0x01090c,1,
-0x010950,1,
-0x0109cc,1,
-0x0109fc,1,
-0x010a08,8,
-0x010b00,7,
-0x010b20,20,
-0x010b74,2,
-0x010c00,3,
-0x010c10,2,
-0x010c40,3,
-0x010c50,2,
-0x010e00,29,
-0x010e80,3,
-0x010e90,2,
-0x010ea0,4,
-0x010eb8,1,
-0x010ee0,3,
-0x010ef0,3,
-0x010f00,4,
-0x010f14,1,
-0x010f20,5,
-0x010f40,13,
-0x010f80,4,
-0x010fa0,1,
-0x010fa8,1,
-0x010fb0,12,
-0x010ff8,3,
-0x011010,6,
-0x011080,11,
-0x011114,6,
-0x011130,4,
-0x011180,5,
-0x011200,7,
-0x011220,1,
-0x011240,4,
-0x011260,1,
-0x011280,4,
-0x011300,3,
-0x011310,2,
-0x011400,3,
-0x011410,1,
-0x011418,1,
-0x011420,1,
-0x011428,1,
-0x011430,1,
-0x011438,1,
-0x011440,1,
-0x011448,1,
-0x011460,1,
-0x011488,2,
-0x0114b0,4,
-0x011800,1,
-0x011810,6,
-0x011880,11,
-0x011914,6,
-0x011930,4,
-0x011980,5,
-0x011a00,7,
-0x011a20,1,
-0x011a40,4,
-0x011a60,1,
-0x011a80,4,
-0x011b00,3,
-0x011b10,2,
-0x011c00,3,
-0x011c10,1,
-0x011c18,1,
-0x011c20,1,
-0x011c28,1,
-0x011c30,1,
-0x011c38,1,
-0x011c40,1,
-0x011c48,1,
-0x011c60,1,
-0x011c88,2,
-0x011cb0,4,
-0x012000,1,
-0x012020,3,
-0x012030,2,
-0x0120a0,4,
-0x0120c0,7,
-0x01211c,13,
-0x012164,1,
-0x012170,4,
-0x0121e0,6,
-0x012250,1,
-0x012360,11,
-0x01240c,5,
-0x012464,3,
-0x012480,3,
-0x012490,3,
-0x012508,2,
-0x012520,8,
-0x012568,2,
-0x012590,4,
-0x0125b4,3,
-0x012600,13,
-0x01270c,1,
-0x012740,2,
-0x012750,2,
-0x01275c,5,
-0x012788,2,
-0x0127a8,6,
-0x0127d8,2,
-0x012800,3,
-0x012840,3,
-0x012850,2,
-0x012860,3,
-0x012870,2,
-0x0128a0,4,
-0x012904,1,
-0x012910,5,
-0x012928,3,
-0x012944,5,
-0x012980,4,
-0x0129a0,3,
-0x0129b0,2,
-0x018000,1,
-0x01805c,4,
-0x018080,8,
-0x0180a4,7,
-0x0180c4,2,
-0x018100,32,
-0x018200,4,
-0x018224,1,
-0x018234,5,
-0x018300,32,
-0x018384,1,
-0x01838c,1,
-0x018394,1,
-0x01839c,1,
-0x0183a4,3,
-0x018400,5,
-0x018420,5,
-0x018440,5,
-0x018460,5,
-0x018480,5,
-0x0184a0,5,
-0x0184c0,5,
-0x0184e0,5,
-0x018500,5,
-0x018520,5,
-0x018540,5,
-0x018560,5,
-0x018580,5,
-0x0185a0,5,
-0x0185c0,5,
-0x0185e0,5,
-0x01860c,5,
-0x018624,4,
-0x018804,3,
-0x018840,3,
-0x018850,3,
-0x018860,7,
-0x018884,11,
-0x0188c8,2,
-0x0188d4,2,
-0x0188e0,8,
-0x018a04,3,
-0x018a20,3,
-0x018a30,4,
-0x018a44,16,
-0x018a88,4,
-0x018c00,18,
-0x018c50,30,
-0x018cd0,14,
-0x018d0c,2,
-0x018e00,3,
-0x018e10,2,
-0x018e20,3,
-0x018e30,2,
-0x018e40,3,
-0x018e50,2,
-0x019ff0,2052,
-0x01c004,2,
-0x01c010,4,
-0x01c06c,19,
-0x01c0c0,5,
-0x01c180,3,
-0x01c190,2,
-0x01c1a0,3,
-0x01c1b0,2,
-0x01c1c0,5,
-0x01c1e0,5,
-0x01c200,17,
-0x01c250,29,
-0x01c2d0,14,
-0x01c30c,2,
-0x01c40c,5,
-0x01c428,2,
-0x01c434,1,
-0x01c43c,1,
-0x01c448,2,
-0x01c454,1,
-0x01c45c,1,
-0x01c464,18,
-0x01c5e4,7,
-0x01c608,4,
-0x01c624,4,
-0x01c650,5,
-0x01c680,9,
-0x01c6a8,4,
-0x01c6c0,9,
-0x01c6e8,11,
-0x01c71c,5,
-0x01c738,2,
-0x01c744,1,
-0x01c750,12,
-0x01c7dc,1,
-0x01c7e4,20,
-0x01c840,7,
-0x01c860,11,
-0x01c8a0,5,
-0x01c900,13,
-0x01c940,7,
-0x01c960,11,
-0x01c9a0,5,
-0x01ca00,13,
-0x01ca40,7,
-0x01ca60,11,
-0x01caa0,5,
-0x01cb00,13,
-0x01cb40,7,
-0x01cb60,11,
-0x01cba0,5,
-0x01cc00,13,
-0x01cc40,7,
-0x01cc60,11,
-0x01cca0,5,
-0x01cd00,13,
-0x01cd40,7,
-0x01cd60,11,
-0x01cda0,5,
-0x01ce00,13,
-0x01ce40,7,
-0x01ce60,11,
-0x01cea0,5,
-0x01cf00,13,
-0x01cf40,7,
-0x01cf60,11,
-0x01cfa0,5,
-0x01d000,18,
-0x01d050,31,
-0x01d0d0,2,
-0x01d0e8,15,
-0x01d140,55,
-0x01d220,10,
-0x01d260,5,
-0x01d278,2,
-0x01d284,1,
-0x01d298,2,
-0x01d2a8,6,
-0x01d300,11,
-0x01d33c,17,
-0x01d3c0,5,
-0x01d3e0,3,
-0x01d3f0,1,
-0x01d400,18,
-0x01d450,31,
-0x01d4d0,2,
-0x01d4e8,15,
-0x01d540,55,
-0x01d620,10,
-0x01d660,5,
-0x01d678,2,
-0x01d684,1,
-0x01d698,2,
-0x01d6a8,6,
-0x01d700,11,
-0x01d73c,17,
-0x01d7c0,5,
-0x01d7e0,3,
-0x01d7f0,1,
-0x01d800,19,
-0x01d880,8,
-0x01d8c4,1,
-0x01d8cc,5,
-0x01d8e4,7,
-0x01d910,5,
-0x01da00,7,
-0x01db0c,16,
-0x01db50,2,
-0x01db60,3,
-0x01db70,2,
-0x01db80,3,
-0x01db90,2,
-0x01dba0,3,
-0x01dc00,5,
-0x01dd80,5,
-0x01dda0,5,
-0x01ddbc,1,
-0x01dde0,9,
-0x01de08,2,
-0x01e5c0,3,
-0x01e5dc,1,
-0x01e5e4,14,
-0x01e620,4,
-0x01e640,16,
-0x01e780,160,
-0x01ea04,13,
-0x01ec00,8,
-0x01ec24,1,
-0x01ec30,1,
-0x01ec44,39,
-0x01ed80,1,
-0x01edc4,1,
-0x01ede0,5,
-0x01edf8,1,
-0x01ee00,8,
-0x01ee24,1,
-0x01ee30,1,
-0x01ee44,39,
-0x01ef80,1,
-0x01efc4,1,
-0x01efe0,5,
-0x01eff8,1,
-0x01f000,1024,
-0x030000,3,
-0x030010,2,
-0x030020,3,
-0x030030,2,
-0x030040,3,
-0x030050,2,
-0x030100,27,
-0x030180,3,
-0x030200,80,
-0x030400,288,
-0x030900,32,
-0x030a04,1,
-0x030b00,33,
-0x030c00,128,
-0x030e1c,1,
-0x030e3c,1,
-0x030e44,1,
-0x030e5c,17,
-0x030f10,28,
-0x031000,14,
-0x031040,14,
-0x031080,14,
-0x0310c0,14,
-0x031100,147,
-0x034000,3,
-0x034010,2,
-0x034100,14,
-0x03413c,7,
-0x03415c,7,
-0x03417c,7,
-0x03419c,7,
-0x0341bc,7,
-0x0341dc,7,
-0x0341fc,7,
-0x03421c,5,
-0x034240,7,
-0x034260,12,
-0x034304,1,
-0x034314,3,
-0x034324,1,
-0x034334,3,
-0x034344,1,
-0x03435c,1,
-0x034414,3,
-0x034510,4,
-0x034608,6,
-0x034800,7,
-0x034820,4,
-0x034840,16,
-0x034980,32,
-0x035000,5,
-0x035020,1,
-0x035028,1,
-0x035040,14,
-0x035104,5,
-0x036000,128,
-0x036204,13,
-0x036400,8,
-0x036424,1,
-0x036430,1,
-0x036444,39,
-0x036580,1,
-0x0365c4,1,
-0x0365e0,5,
-0x0365f8,1,
-0x036600,3,
-0x036700,3,
-0x036710,2,
-0x036720,3,
-0x036730,2,
-0x040000,19,
-0x040050,3,
-0x040080,1,
-0x040090,8,
-0x0400b4,3,
-0x0400cc,8,
-0x040104,16,
-0x040150,2,
-0x04015c,1,
-0x040170,11,
-0x0401a4,1,
-0x0401ac,5,
-0x0401c4,8,
-0x040200,3,
-0x040210,3,
-0x040220,3,
-0x040230,3,
-0x040240,3,
-0x040250,3,
-0x040260,3,
-0x040270,3,
-0x040280,3,
-0x040290,3,
-0x0402a0,3,
-0x0402b0,3,
-0x0402c0,3,
-0x0402d0,3,
-0x0402e0,3,
-0x0402f0,3,
-0x040304,1,
-0x040314,8,
-0x040340,11,
-0x040400,50,
-0x0404cc,6,
-0x040510,18,
-0x04055c,3,
-0x04056c,3,
-0x04057c,3,
-0x04058c,2,
-0x04059c,17,
-0x040610,14,
-0x0406e0,49,
-0x0407b0,4,
-0x0407d0,3,
-0x0407f0,1,
-0x040800,332,
-0x040d38,4,
-0x040d50,23,
-0x040df0,11,
-0x040e20,1,
-0x040e28,11,
-0x040e58,1,
-0x040e60,4,
-0x040e74,11,
-0x040eb0,4,
-0x040ec8,2,
-0x040ed4,7,
-0x040ef8,3,
-0x041000,33,
-0x041100,45,
-0x0411dc,1,
-0x0411e4,15,
-0x041224,1,
-0x041230,1,
-0x041244,39,
-0x041380,1,
-0x0413c4,1,
-0x0413e0,5,
-0x0413f8,1,
-0x041400,8,
-0x041424,1,
-0x041430,1,
-0x041444,39,
-0x041580,1,
-0x0415c4,1,
-0x0415e0,5,
-0x0415f8,1,
-0x041a00,3,
-0x041a10,2,
-0x041a20,3,
-0x041a30,2,
-0x041a40,3,
-0x041a50,2,
-0x041c00,128,
-0x041e04,13,
-0x042000,5,
-0x042020,5,
-0x042040,5,
-0x042060,5,
-0x042080,5,
-0x0420a0,5,
-0x0420c0,5,
-0x0420e0,5,
-0x042100,5,
-0x042120,5,
-0x042140,5,
-0x042160,5,
-0x042180,5,
-0x0421a0,5,
-0x0421c0,5,
-0x0421e0,5,
-0x042200,5,
-0x042220,5,
-0x042240,5,
-0x042260,5,
-0x042280,5,
-0x0422a0,5,
-0x0422c0,5,
-0x0422e0,5,
-0x042300,5,
-0x042320,5,
-0x042340,5,
-0x042360,5,
-0x042380,5,
-0x0423a0,5,
-0x0423c0,5,
-0x0423e0,5,
-0x042400,5,
-0x042420,5,
-0x042440,5,
-0x042460,5,
-0x042480,5,
-0x0424a0,5,
-0x0424c0,5,
-0x0424e0,5,
-0x042500,5,
-0x042520,5,
-0x042540,5,
-0x042560,5,
-0x042580,5,
-0x0425a0,5,
-0x0425c0,5,
-0x0425e0,5,
-0x042600,5,
-0x042620,5,
-0x042640,5,
-0x042660,5,
-0x042680,5,
-0x0426a0,5,
-0x0426c0,5,
-0x0426e0,5,
-0x042700,5,
-0x042720,5,
-0x042740,5,
-0x042760,5,
-0x042780,5,
-0x0427a0,5,
-0x0427c0,5,
-0x0427e0,5,
-0x042800,5,
-0x042820,5,
-0x042840,5,
-0x042860,5,
-0x042880,5,
-0x0428a0,5,
-0x0428c0,5,
-0x0428e0,5,
-0x042900,5,
-0x042920,5,
-0x042940,5,
-0x042960,5,
-0x042980,5,
-0x0429a0,5,
-0x0429c0,5,
-0x0429e0,5,
-0x042a00,5,
-0x042a20,5,
-0x042a40,5,
-0x042a60,5,
-0x042a80,5,
-0x042aa0,5,
-0x042ac0,5,
-0x042ae0,5,
-0x042b00,5,
-0x042b20,5,
-0x042b40,5,
-0x042b60,5,
-0x042b80,5,
-0x042ba0,5,
-0x042bc0,5,
-0x042be0,5,
-0x042c00,5,
-0x042c20,5,
-0x042c40,5,
-0x042c60,5,
-0x042c80,5,
-0x042ca0,5,
-0x042cc0,5,
-0x042ce0,5,
-0x042d00,5,
-0x042d20,5,
-0x042d40,5,
-0x042d60,5,
-0x042d80,5,
-0x042da0,5,
-0x042dc0,5,
-0x042de0,5,
-0x042e00,5,
-0x042e20,5,
-0x042e40,5,
-0x042e60,5,
-0x042e80,5,
-0x042ea0,5,
-0x042ec0,5,
-0x042ee0,5,
-0x042f00,5,
-0x042f20,5,
-0x042f40,5,
-0x042f60,5,
-0x042f80,5,
-0x042fa0,5,
-0x042fc0,5,
-0x042fe0,5,
-0x043000,5,
-0x043020,5,
-0x043040,5,
-0x043060,5,
-0x043080,5,
-0x0430a0,5,
-0x0430c0,5,
-0x0430e0,5,
-0x043100,5,
-0x043120,5,
-0x043140,5,
-0x043160,5,
-0x043180,5,
-0x0431a0,5,
-0x0431c0,5,
-0x0431e0,5,
-0x043200,5,
-0x043220,5,
-0x043240,5,
-0x043260,5,
-0x043280,5,
-0x0432a0,5,
-0x0432c0,5,
-0x0432e0,5,
-0x043300,5,
-0x043320,5,
-0x043340,5,
-0x043360,5,
-0x043380,5,
-0x0433a0,5,
-0x0433c0,5,
-0x0433e0,5,
-0x043400,5,
-0x043420,5,
-0x043440,5,
-0x043460,5,
-0x043480,5,
-0x0434a0,5,
-0x0434c0,5,
-0x0434e0,5,
-0x043500,5,
-0x043520,5,
-0x043540,5,
-0x043560,5,
-0x043580,5,
-0x0435a0,5,
-0x0435c0,5,
-0x0435e0,5,
-0x043600,5,
-0x043620,5,
-0x043640,5,
-0x043660,5,
-0x043680,5,
-0x0436a0,5,
-0x0436c0,5,
-0x0436e0,5,
-0x043700,5,
-0x043720,5,
-0x043740,5,
-0x043760,5,
-0x043780,5,
-0x0437a0,5,
-0x0437c0,5,
-0x0437e0,5,
-0x043800,5,
-0x043820,5,
-0x043840,5,
-0x043860,5,
-0x043880,5,
-0x0438a0,5,
-0x0438c0,5,
-0x0438e0,5,
-0x043900,5,
-0x043920,5,
-0x043940,5,
-0x043960,5,
-0x043980,5,
-0x0439a0,5,
-0x0439c0,5,
-0x0439e0,5,
-0x043a00,5,
-0x043a20,5,
-0x043a40,5,
-0x043a60,5,
-0x043a80,5,
-0x043aa0,5,
-0x043ac0,5,
-0x043ae0,5,
-0x043b00,5,
-0x043b20,5,
-0x043b40,5,
-0x043b60,5,
-0x043b80,5,
-0x043ba0,5,
-0x043bc0,5,
-0x043be0,5,
-0x043c00,5,
-0x043c20,5,
-0x043c40,5,
-0x043c60,5,
-0x043c80,5,
-0x043ca0,5,
-0x043cc0,5,
-0x043ce0,5,
-0x043d00,5,
-0x043d20,5,
-0x043d40,5,
-0x043d60,5,
-0x043d80,5,
-0x043da0,5,
-0x043dc0,5,
-0x043de0,5,
-0x043e00,5,
-0x043e20,5,
-0x043e40,5,
-0x043e60,5,
-0x043e80,5,
-0x043ea0,5,
-0x043ec0,5,
-0x043ee0,5,
-0x043f00,5,
-0x043f20,5,
-0x043f40,5,
-0x043f60,5,
-0x043f80,5,
-0x043fa0,5,
-0x043fc0,5,
-0x043fe0,5,
-0x044fcc,5,
-0x044fe4,5,
-0x044ffc,5,
-0x045014,5,
-0x04502c,5,
-0x045044,5,
-0x04505c,5,
-0x045074,5,
-0x04508c,5,
-0x0450a4,5,
-0x0450bc,5,
-0x0450d4,5,
-0x0450ec,5,
-0x045104,5,
-0x04511c,119,
-0x045300,39,
-0x045400,13,
-0x045440,13,
-0x045ff8,642,
-0x047004,1,
-0x04700c,1,
-0x047ff0,2,
-0x048000,5,
-0x048020,5,
-0x048040,5,
-0x048060,5,
-0x048080,5,
-0x0480a0,5,
-0x0480c0,5,
-0x0480e0,5,
-0x048100,5,
-0x048120,5,
-0x048140,5,
-0x048160,5,
-0x048180,5,
-0x0481a0,5,
-0x0481c0,5,
-0x0481e0,5,
-0x048200,5,
-0x048220,5,
-0x048240,5,
-0x048260,5,
-0x048280,5,
-0x0482a0,5,
-0x0482c0,5,
-0x0482e0,5,
-0x048300,5,
-0x048320,5,
-0x048340,5,
-0x048360,5,
-0x048380,5,
-0x0483a0,5,
-0x0483c0,5,
-0x0483e0,5,
-0x048400,5,
-0x048420,5,
-0x048440,5,
-0x048460,5,
-0x048480,5,
-0x0484a0,5,
-0x0484c0,5,
-0x0484e0,5,
-0x048500,5,
-0x048520,5,
-0x048540,5,
-0x048560,5,
-0x048580,5,
-0x0485a0,5,
-0x0485c0,5,
-0x0485e0,5,
-0x048600,5,
-0x048620,5,
-0x048640,5,
-0x048660,5,
-0x048680,5,
-0x0486a0,5,
-0x0486c0,5,
-0x0486e0,5,
-0x048700,5,
-0x048720,5,
-0x048740,5,
-0x048760,5,
-0x048780,5,
-0x0487a0,5,
-0x0487c0,5,
-0x0487e0,5,
-0x048800,5,
-0x048820,5,
-0x048840,5,
-0x048860,5,
-0x048880,5,
-0x0488a0,5,
-0x0488c0,5,
-0x0488e0,5,
-0x048900,5,
-0x048920,5,
-0x048940,5,
-0x048960,5,
-0x048980,5,
-0x0489a0,5,
-0x0489c0,5,
-0x0489e0,5,
-0x048a00,5,
-0x048a20,5,
-0x048a40,5,
-0x048a60,5,
-0x048a80,5,
-0x048aa0,5,
-0x048ac0,5,
-0x048ae0,5,
-0x048b00,5,
-0x048b20,5,
-0x048b40,5,
-0x048b60,5,
-0x048b80,5,
-0x048ba0,5,
-0x048bc0,5,
-0x048be0,5,
-0x048c00,5,
-0x048c20,5,
-0x048c40,5,
-0x048c60,5,
-0x048c80,5,
-0x048ca0,5,
-0x048cc0,5,
-0x048ce0,5,
-0x048d00,5,
-0x048d20,5,
-0x048d40,5,
-0x048d60,5,
-0x048d80,5,
-0x048da0,5,
-0x048dc0,5,
-0x048de0,5,
-0x048e00,5,
-0x048e20,5,
-0x048e40,5,
-0x048e60,5,
-0x048e80,5,
-0x048ea0,5,
-0x048ec0,5,
-0x048ee0,5,
-0x048f00,5,
-0x048f20,5,
-0x048f40,5,
-0x048f60,5,
-0x048f80,5,
-0x048fa0,5,
-0x048fc0,5,
-0x048fe0,5,
-0x049000,5,
-0x049020,5,
-0x049040,5,
-0x049060,5,
-0x049080,5,
-0x0490a0,5,
-0x0490c0,5,
-0x0490e0,5,
-0x049100,5,
-0x049120,5,
-0x049140,5,
-0x049160,5,
-0x049180,5,
-0x0491a0,5,
-0x0491c0,5,
-0x0491e0,5,
-0x049200,5,
-0x049220,5,
-0x049240,5,
-0x049260,5,
-0x049280,5,
-0x0492a0,5,
-0x0492c0,5,
-0x0492e0,5,
-0x049300,5,
-0x049320,5,
-0x049340,5,
-0x049360,5,
-0x049380,5,
-0x0493a0,5,
-0x0493c0,5,
-0x0493e0,5,
-0x049400,5,
-0x049420,5,
-0x049440,5,
-0x049460,5,
-0x049480,5,
-0x0494a0,5,
-0x0494c0,5,
-0x0494e0,5,
-0x049500,5,
-0x049520,5,
-0x049540,5,
-0x049560,5,
-0x049580,5,
-0x0495a0,5,
-0x0495c0,5,
-0x0495e0,5,
-0x049600,5,
-0x049620,5,
-0x049640,5,
-0x049660,5,
-0x049680,5,
-0x0496a0,5,
-0x0496c0,5,
-0x0496e0,5,
-0x049700,5,
-0x049720,5,
-0x049740,5,
-0x049760,5,
-0x049780,5,
-0x0497a0,5,
-0x0497c0,5,
-0x0497e0,5,
-0x049800,5,
-0x049820,5,
-0x049840,5,
-0x049860,5,
-0x049880,5,
-0x0498a0,5,
-0x0498c0,5,
-0x0498e0,5,
-0x049900,5,
-0x049920,5,
-0x049940,5,
-0x049960,5,
-0x049980,5,
-0x0499a0,5,
-0x0499c0,5,
-0x0499e0,5,
-0x049a00,5,
-0x049a20,5,
-0x049a40,5,
-0x049a60,5,
-0x049a80,5,
-0x049aa0,5,
-0x049ac0,5,
-0x049ae0,5,
-0x049b00,5,
-0x049b20,5,
-0x049b40,5,
-0x049b60,5,
-0x049b80,5,
-0x049ba0,5,
-0x049bc0,5,
-0x049be0,5,
-0x049c00,5,
-0x049c20,5,
-0x049c40,5,
-0x049c60,5,
-0x049c80,5,
-0x049ca0,5,
-0x049cc0,5,
-0x049ce0,5,
-0x049d00,5,
-0x049d20,5,
-0x049d40,5,
-0x049d60,5,
-0x049d80,5,
-0x049da0,5,
-0x049dc0,5,
-0x049de0,5,
-0x049e00,5,
-0x049e20,5,
-0x049e40,5,
-0x049e60,5,
-0x049e80,5,
-0x049ea0,5,
-0x049ec0,5,
-0x049ee0,5,
-0x049f00,5,
-0x049f20,5,
-0x049f40,5,
-0x049f60,5,
-0x049f80,5,
-0x049fa0,5,
-0x049fc0,5,
-0x049fe0,5,
-0x04a000,5,
-0x04a020,5,
-0x04a040,5,
-0x04a060,5,
-0x04a080,5,
-0x04a0a0,5,
-0x04a0c0,5,
-0x04a0e0,5,
-0x04a100,5,
-0x04a120,5,
-0x04a140,5,
-0x04a160,5,
-0x04a180,5,
-0x04a1a0,5,
-0x04a1c0,5,
-0x04a1e0,5,
-0x04a200,5,
-0x04a220,5,
-0x04a240,5,
-0x04a260,5,
-0x04a280,5,
-0x04a2a0,5,
-0x04a2c0,5,
-0x04a2e0,5,
-0x04a300,5,
-0x04a320,5,
-0x04a340,5,
-0x04a360,5,
-0x04a380,5,
-0x04a3a0,5,
-0x04a3c0,5,
-0x04a3e0,5,
-0x04a400,5,
-0x04a420,5,
-0x04a440,5,
-0x04a460,5,
-0x04a480,5,
-0x04a4a0,5,
-0x04a4c0,5,
-0x04a4e0,5,
-0x04a500,5,
-0x04a520,5,
-0x04a540,5,
-0x04a560,5,
-0x04a580,5,
-0x04a5a0,5,
-0x04a5c0,5,
-0x04a5e0,5,
-0x04a600,5,
-0x04a620,5,
-0x04a640,5,
-0x04a660,5,
-0x04a680,5,
-0x04a6a0,5,
-0x04a6c0,5,
-0x04a6e0,5,
-0x04a700,5,
-0x04a720,5,
-0x04a740,5,
-0x04a760,5,
-0x04a780,5,
-0x04a7a0,5,
-0x04a7c0,5,
-0x04a7e0,5,
-0x04a800,5,
-0x04a820,5,
-0x04a840,5,
-0x04a860,5,
-0x04a880,5,
-0x04a8a0,5,
-0x04a8c0,5,
-0x04a8e0,5,
-0x04a900,5,
-0x04a920,5,
-0x04a940,5,
-0x04a960,5,
-0x04a980,5,
-0x04a9a0,5,
-0x04a9c0,5,
-0x04a9e0,5,
-0x04aa00,5,
-0x04aa20,5,
-0x04aa40,5,
-0x04aa60,5,
-0x04aa80,5,
-0x04aaa0,5,
-0x04aac0,5,
-0x04aae0,5,
-0x04ab00,5,
-0x04ab20,5,
-0x04ab40,5,
-0x04ab60,5,
-0x04ab80,5,
-0x04aba0,5,
-0x04abc0,5,
-0x04abe0,5,
-0x04ac00,5,
-0x04ac20,5,
-0x04ac40,5,
-0x04ac60,5,
-0x04ac80,5,
-0x04aca0,5,
-0x04acc0,5,
-0x04ace0,5,
-0x04ad00,5,
-0x04ad20,5,
-0x04ad40,5,
-0x04ad60,5,
-0x04ad80,5,
-0x04ada0,5,
-0x04adc0,5,
-0x04ade0,5,
-0x04ae00,5,
-0x04ae20,5,
-0x04ae40,5,
-0x04ae60,5,
-0x04ae80,5,
-0x04aea0,5,
-0x04aec0,5,
-0x04aee0,5,
-0x04af00,5,
-0x04af20,5,
-0x04af40,5,
-0x04af60,5,
-0x04af80,5,
-0x04afa0,5,
-0x04afc0,5,
-0x04afe0,5,
-0x04b000,5,
-0x04b020,5,
-0x04b040,5,
-0x04b060,5,
-0x04b080,5,
-0x04b0a0,5,
-0x04b0c0,5,
-0x04b0e0,5,
-0x04b100,5,
-0x04b120,5,
-0x04b140,5,
-0x04b160,5,
-0x04b180,5,
-0x04b1a0,5,
-0x04b1c0,5,
-0x04b1e0,5,
-0x04b200,5,
-0x04b220,5,
-0x04b240,5,
-0x04b260,5,
-0x04b280,5,
-0x04b2a0,5,
-0x04b2c0,5,
-0x04b2e0,5,
-0x04b300,5,
-0x04b320,5,
-0x04b340,5,
-0x04b360,5,
-0x04b380,5,
-0x04b3a0,5,
-0x04b3c0,5,
-0x04b3e0,5,
-0x04b400,5,
-0x04b420,5,
-0x04b440,5,
-0x04b460,5,
-0x04b480,5,
-0x04b4a0,5,
-0x04b4c0,5,
-0x04b4e0,5,
-0x04b500,5,
-0x04b520,5,
-0x04b540,5,
-0x04b560,5,
-0x04b580,5,
-0x04b5a0,5,
-0x04b5c0,5,
-0x04b5e0,5,
-0x04b600,5,
-0x04b620,5,
-0x04b640,5,
-0x04b660,5,
-0x04b680,5,
-0x04b6a0,5,
-0x04b6c0,5,
-0x04b6e0,5,
-0x04b700,5,
-0x04b720,5,
-0x04b740,5,
-0x04b760,5,
-0x04b780,5,
-0x04b7a0,5,
-0x04b7c0,5,
-0x04b7e0,5,
-0x04b800,5,
-0x04b820,5,
-0x04b840,5,
-0x04b860,5,
-0x04b880,5,
-0x04b8a0,5,
-0x04b8c0,5,
-0x04b8e0,5,
-0x04b900,5,
-0x04b920,5,
-0x04b940,5,
-0x04b960,5,
-0x04b980,5,
-0x04b9a0,5,
-0x04b9c0,5,
-0x04b9e0,5,
-0x04ba00,5,
-0x04ba20,5,
-0x04ba40,5,
-0x04ba60,5,
-0x04ba80,5,
-0x04baa0,5,
-0x04bac0,5,
-0x04bae0,5,
-0x04bb00,5,
-0x04bb20,5,
-0x04bb40,5,
-0x04bb60,5,
-0x04bb80,5,
-0x04bba0,5,
-0x04bbc0,5,
-0x04bbe0,5,
-0x04bc00,5,
-0x04bc20,5,
-0x04bc40,5,
-0x04bc60,5,
-0x04bc80,5,
-0x04bca0,5,
-0x04bcc0,5,
-0x04bce0,5,
-0x04bd00,5,
-0x04bd20,5,
-0x04bd40,5,
-0x04bd60,5,
-0x04bd80,5,
-0x04bda0,5,
-0x04bdc0,5,
-0x04bde0,5,
-0x04be00,5,
-0x04be20,5,
-0x04be40,5,
-0x04be60,5,
-0x04be80,5,
-0x04bea0,5,
-0x04bec0,5,
-0x04bee0,5,
-0x04bf00,5,
-0x04bf20,5,
-0x04bf40,5,
-0x04bf60,5,
-0x04bf80,5,
-0x04bfa0,5,
-0x04bfc0,5,
-0x04bfe0,5,
-0x04c000,5,
-0x04c020,5,
-0x04c040,5,
-0x04c060,5,
-0x04c080,5,
-0x04c0a0,5,
-0x04c0c0,5,
-0x04c0e0,5,
-0x04c100,5,
-0x04c120,5,
-0x04c140,5,
-0x04c160,5,
-0x04c180,5,
-0x04c1a0,5,
-0x04c1c0,5,
-0x04c1e0,5,
-0x04c200,5,
-0x04c220,5,
-0x04c240,5,
-0x04c260,5,
-0x04c280,5,
-0x04c2a0,5,
-0x04c2c0,5,
-0x04c2e0,5,
-0x04c300,5,
-0x04c320,5,
-0x04c340,5,
-0x04c360,5,
-0x04c380,5,
-0x04c3a0,5,
-0x04c3c0,5,
-0x04c3e0,5,
-0x04c400,5,
-0x04c420,5,
-0x04c440,5,
-0x04c460,5,
-0x04c480,5,
-0x04c4a0,5,
-0x04c4c0,5,
-0x04c4e0,5,
-0x04c500,5,
-0x04c520,5,
-0x04c540,5,
-0x04c560,5,
-0x04c580,5,
-0x04c5a0,5,
-0x04c5c0,5,
-0x04c5e0,5,
-0x04c600,5,
-0x04c620,5,
-0x04c640,5,
-0x04c660,5,
-0x04c680,5,
-0x04c6a0,5,
-0x04c6c0,5,
-0x04c6e0,5,
-0x04c700,5,
-0x04c720,5,
-0x04c740,5,
-0x04c760,5,
-0x04c780,5,
-0x04c7a0,5,
-0x04c7c0,5,
-0x04c7e0,5,
-0x04c800,5,
-0x04c820,5,
-0x04c840,5,
-0x04c860,5,
-0x04c880,5,
-0x04c8a0,5,
-0x04c8c0,5,
-0x04c8e0,5,
-0x04c900,5,
-0x04c920,5,
-0x04c940,5,
-0x04c960,5,
-0x04c980,5,
-0x04c9a0,5,
-0x04c9c0,5,
-0x04c9e0,5,
-0x04ca00,5,
-0x04ca20,5,
-0x04ca40,5,
-0x04ca60,5,
-0x04ca80,5,
-0x04caa0,5,
-0x04cac0,5,
-0x04cae0,5,
-0x04cb00,5,
-0x04cb20,5,
-0x04cb40,5,
-0x04cb60,5,
-0x04cb80,5,
-0x04cba0,5,
-0x04cbc0,5,
-0x04cbe0,5,
-0x04cc00,5,
-0x04cc20,5,
-0x04cc40,5,
-0x04cc60,5,
-0x04cc80,5,
-0x04cca0,5,
-0x04ccc0,5,
-0x04cce0,5,
-0x04cd00,5,
-0x04cd20,5,
-0x04cd40,5,
-0x04cd60,5,
-0x04cd80,5,
-0x04cda0,5,
-0x04cdc0,5,
-0x04cde0,5,
-0x04ce00,5,
-0x04ce20,5,
-0x04ce40,5,
-0x04ce60,5,
-0x04ce80,5,
-0x04cea0,5,
-0x04cec0,5,
-0x04cee0,5,
-0x04cf00,5,
-0x04cf20,5,
-0x04cf40,5,
-0x04cf60,5,
-0x04cf80,5,
-0x04cfa0,5,
-0x04cfc0,5,
-0x04cfe0,5,
-0x050004,1,
-0x05000c,5,
-0x054000,5,
-0x054020,5,
-0x054040,5,
-0x054060,5,
-0x054080,5,
-0x0540a0,5,
-0x0540c0,5,
-0x0540e0,5,
-0x054100,5,
-0x054120,5,
-0x054140,5,
-0x054160,5,
-0x054180,5,
-0x0541a0,5,
-0x0541c0,5,
-0x0541e0,5,
-0x054200,5,
-0x054220,5,
-0x054240,5,
-0x054260,5,
-0x054280,5,
-0x0542a0,5,
-0x0542c0,5,
-0x0542e0,5,
-0x054300,5,
-0x054320,5,
-0x054340,5,
-0x054360,5,
-0x054380,5,
-0x0543a0,5,
-0x0543c0,5,
-0x0543e0,5,
-0x054400,5,
-0x054420,5,
-0x054440,5,
-0x054460,5,
-0x054480,5,
-0x0544a0,5,
-0x0544c0,5,
-0x0544e0,5,
-0x054500,5,
-0x054520,5,
-0x054540,5,
-0x054560,5,
-0x054580,5,
-0x0545a0,5,
-0x0545c0,5,
-0x0545e0,5,
-0x054600,5,
-0x054620,5,
-0x054640,5,
-0x054660,5,
-0x054680,5,
-0x0546a0,5,
-0x0546c0,5,
-0x0546e0,5,
-0x054700,5,
-0x054720,5,
-0x054740,5,
-0x054760,5,
-0x054780,5,
-0x0547a0,5,
-0x0547c0,5,
-0x0547e0,5,
-0x054800,5,
-0x054820,5,
-0x054840,5,
-0x054860,5,
-0x054880,5,
-0x0548a0,5,
-0x0548c0,5,
-0x0548e0,5,
-0x054900,5,
-0x054920,5,
-0x054940,5,
-0x054960,5,
-0x054980,5,
-0x0549a0,5,
-0x0549c0,5,
-0x0549e0,5,
-0x054a00,5,
-0x054a20,5,
-0x054a40,5,
-0x054a60,5,
-0x054a80,5,
-0x054aa0,5,
-0x054ac0,5,
-0x054ae0,5,
-0x054b00,5,
-0x054b20,5,
-0x054b40,5,
-0x054b60,5,
-0x054b80,5,
-0x054ba0,5,
-0x054bc0,5,
-0x054be0,5,
-0x054c00,5,
-0x054c20,5,
-0x054c40,5,
-0x054c60,5,
-0x055004,1,
-0x05500c,8,
-0x05900c,5,
-0x060400,5,
-0x060500,6,
-0x060520,6,
-0x060600,6,
-0x060700,7,
-0x060800,64,
-0x060940,3,
-0x060a04,7,
-0x060c00,4,
-0x060d00,2,
-0x060e00,4,
-0x060f40,16,
-0x060f88,2,
-0x061000,34,
-0x061100,34,
-0x061200,34,
-0x061300,34,
-0x061400,34,
-0x061500,34,
-0x061600,34,
-0x061700,34,
-0x061800,34,
-0x061900,34,
-0x061a00,34,
-0x061b00,34,
-0x061c00,34,
-0x061d00,34,
-0x061e00,34,
-0x061f00,34,
-0x062100,2,
-0x064000,2048,
-0x066100,3,
-0x068800,7,
-0x068820,4,
-0x068840,16,
-0x068980,36,
-0x068a20,3,
-0x068a30,2,
-0x068a40,3,
-0x068a50,2,
-0x068a60,3,
-0x068a70,2,
-0x068a80,2,
-0x070000,13,
-0x070040,12,
-0x07007c,13,
-0x0700bc,6,
-0x0700d8,5,
-0x0700f0,23,
-0x070180,5,
-0x0701fc,1,
-0x070210,12,
-0x070244,7,
-0x070290,12,
-0x0702c4,1,
-0x0702d0,4,
-0x070300,64,
-0x071000,33,
-0x071100,33,
-0x071200,33,
-0x071300,33,
-0x071400,33,
-0x071500,33,
-0x071600,33,
-0x071700,33,
-0x071800,33,
-0x071900,33,
-0x071a00,33,
-0x071b00,33,
-0x072000,67,
-0x072200,67,
-0x072400,67,
-0x072600,67,
-0x072800,67,
-0x072a00,67,
-0x072c00,67,
-0x073000,33,
-0x073100,33,
-0x073200,33,
-0x073300,33,
-0x073400,33,
-0x073500,33,
-0x073600,33,
-0x073700,33,
-0x073800,33,
-0x073900,33,
-0x073a00,33,
-0x073b00,33,
-0x076c00,5,
-0x076c18,2,
-0x076c24,1,
-0x076c2c,1,
-0x076c34,4,
-0x076c4c,3,
-0x078000,17,
-0x078080,17,
-0x078100,17,
-0x078180,17,
-0x078210,5,
-0x078284,2,
-0x0782d4,59,
-0x078400,6,
-0x078a60,5,
-0x078a88,13,
-0x078b00,32,
-0x078b84,6,
-0x078c20,10,
-0x078c50,2,
-0x078c5c,7,
-0x078c80,5,
-0x078ca0,1,
-0x078cc0,7,
-0x078d00,32,
-0x078d84,6,
-0x078e60,1,
-0x078e70,1,
-0x078e80,10,
-0x078ec0,2,
-0x078ecc,1,
-0x078ee0,6,
-0x078f00,7,
-0x078f20,7,
-0x078f44,2,
-0x078f60,2,
-0x078f70,1,
-0x078f78,2,
-0x078fb4,6,
-0x078fd0,1,
-0x079000,1,
-0x079008,1,
-0x079010,1,
-0x079018,1,
-0x079020,1,
-0x079028,1,
-0x079030,1,
-0x079038,1,
-0x079040,1,
-0x079048,1,
-0x079050,1,
-0x079058,1,
-0x079060,1,
-0x079068,1,
-0x079070,1,
-0x079078,1,
-0x079080,1,
-0x079088,1,
-0x079090,1,
-0x079098,1,
-0x0790a0,1,
-0x0790a8,1,
-0x0790b0,1,
-0x0790b8,1,
-0x0790c0,1,
-0x0790c8,1,
-0x0790d0,1,
-0x0790d8,1,
-0x0790e0,1,
-0x0790e8,1,
-0x0790f0,1,
-0x0790f8,1,
-0x079100,1,
-0x079108,1,
-0x079110,1,
-0x079118,1,
-0x079120,1,
-0x079128,1,
-0x079130,1,
-0x079138,1,
-0x079140,1,
-0x079148,1,
-0x079150,1,
-0x079158,1,
-0x079160,1,
-0x079168,1,
-0x079170,1,
-0x079178,1,
-0x079180,1,
-0x079188,1,
-0x079190,1,
-0x079198,1,
-0x0791a0,1,
-0x0791a8,1,
-0x0791b0,1,
-0x0791b8,1,
-0x0791c0,1,
-0x0791c8,1,
-0x0791d0,1,
-0x0791d8,1,
-0x0791e0,1,
-0x0791e8,1,
-0x0791f0,1,
-0x0791f8,1,
-0x079200,1,
-0x079208,1,
-0x079210,1,
-0x079218,1,
-0x079220,1,
-0x079228,1,
-0x079230,1,
-0x079238,1,
-0x079240,1,
-0x079248,1,
-0x079250,1,
-0x079258,1,
-0x079260,1,
-0x079268,1,
-0x079270,1,
-0x079278,1,
-0x079280,1,
-0x079288,1,
-0x079290,1,
-0x079298,1,
-0x0792a0,1,
-0x0792a8,1,
-0x0792b0,1,
-0x0792b8,1,
-0x0792c0,1,
-0x0792c8,1,
-0x0792d0,1,
-0x0792d8,1,
-0x0792e0,1,
-0x0792e8,1,
-0x0792f0,1,
-0x0792f8,1,
-0x079300,1,
-0x079308,1,
-0x079310,1,
-0x079318,1,
-0x079320,1,
-0x079328,1,
-0x079330,1,
-0x079338,1,
-0x079340,1,
-0x079348,1,
-0x079350,1,
-0x079358,1,
-0x079360,1,
-0x079368,1,
-0x079370,1,
-0x079378,1,
-0x079380,1,
-0x079388,1,
-0x079390,1,
-0x079398,1,
-0x0793a0,1,
-0x0793a8,1,
-0x0793b0,1,
-0x0793b8,1,
-0x0793c0,1,
-0x0793c8,1,
-0x0793d0,1,
-0x0793d8,1,
-0x0793e0,1,
-0x0793e8,1,
-0x0793f0,1,
-0x0793f8,1,
-0x079400,1,
-0x079408,1,
-0x079410,1,
-0x079418,1,
-0x079420,1,
-0x079428,1,
-0x079430,1,
-0x079438,1,
-0x079440,1,
-0x079448,1,
-0x079450,1,
-0x079458,1,
-0x079460,1,
-0x079468,1,
-0x079470,1,
-0x079478,1,
-0x079480,1,
-0x079488,1,
-0x079490,1,
-0x079498,1,
-0x0794a0,1,
-0x0794a8,1,
-0x0794b0,1,
-0x0794b8,1,
-0x0794c0,1,
-0x0794c8,1,
-0x0794d0,1,
-0x0794d8,1,
-0x0794e0,1,
-0x0794e8,1,
-0x0794f0,1,
-0x0794f8,1,
-0x079500,1,
-0x079508,1,
-0x079510,1,
-0x079518,1,
-0x079520,1,
-0x079528,1,
-0x079530,1,
-0x079538,1,
-0x079540,1,
-0x079548,1,
-0x079550,1,
-0x079558,1,
-0x079560,1,
-0x079568,1,
-0x079570,1,
-0x079578,1,
-0x079580,1,
-0x079588,1,
-0x079590,1,
-0x079598,1,
-0x0795a0,1,
-0x0795a8,1,
-0x0795b0,1,
-0x0795b8,1,
-0x0795c0,1,
-0x0795c8,1,
-0x0795d0,1,
-0x0795d8,1,
-0x0795e0,1,
-0x0795e8,1,
-0x0795f0,1,
-0x0795f8,1,
-0x079600,1,
-0x079608,1,
-0x079610,1,
-0x079618,1,
-0x079620,1,
-0x079628,1,
-0x079630,1,
-0x079638,1,
-0x079640,1,
-0x079648,1,
-0x079650,1,
-0x079658,1,
-0x079660,1,
-0x079668,1,
-0x079670,1,
-0x079678,1,
-0x079680,1,
-0x079688,1,
-0x079690,1,
-0x079698,1,
-0x0796a0,1,
-0x0796a8,1,
-0x0796b0,1,
-0x0796b8,1,
-0x0796c0,1,
-0x0796c8,1,
-0x0796d0,1,
-0x0796d8,1,
-0x0796e0,1,
-0x0796e8,1,
-0x0796f0,1,
-0x0796f8,1,
-0x079700,1,
-0x079708,1,
-0x079710,1,
-0x079718,1,
-0x079720,1,
-0x079728,1,
-0x079730,1,
-0x079738,1,
-0x079740,1,
-0x079748,1,
-0x079750,1,
-0x079758,1,
-0x079760,1,
-0x079768,1,
-0x079770,1,
-0x079778,1,
-0x079780,1,
-0x079788,1,
-0x079790,1,
-0x079798,1,
-0x0797a0,1,
-0x0797a8,1,
-0x0797b0,1,
-0x0797b8,1,
-0x0797c0,1,
-0x0797c8,1,
-0x0797d0,1,
-0x0797d8,1,
-0x0797e0,1,
-0x0797e8,1,
-0x0797f0,1,
-0x0797f8,1,
-0x079800,1,
-0x079808,1,
-0x079810,1,
-0x079818,1,
-0x079820,1,
-0x079828,1,
-0x079830,1,
-0x079838,1,
-0x079840,1,
-0x079848,1,
-0x079850,1,
-0x079858,1,
-0x079860,1,
-0x079868,1,
-0x079870,1,
-0x079878,1,
-0x079880,1,
-0x079888,1,
-0x079890,1,
-0x079898,1,
-0x0798a0,1,
-0x0798a8,1,
-0x0798b0,1,
-0x0798b8,1,
-0x0798c0,1,
-0x0798c8,1,
-0x0798d0,1,
-0x0798d8,1,
-0x0798e0,1,
-0x0798e8,1,
-0x0798f0,1,
-0x0798f8,1,
-0x079900,1,
-0x079908,1,
-0x079910,1,
-0x079918,1,
-0x079920,1,
-0x079928,1,
-0x079930,1,
-0x079938,1,
-0x079940,1,
-0x079948,1,
-0x079950,1,
-0x079958,1,
-0x079960,1,
-0x079968,1,
-0x079970,1,
-0x079978,1,
-0x079980,1,
-0x079988,1,
-0x079990,1,
-0x079998,1,
-0x0799a0,1,
-0x0799a8,1,
-0x0799b0,1,
-0x0799b8,1,
-0x0799c0,1,
-0x0799c8,1,
-0x0799d0,1,
-0x0799d8,1,
-0x0799e0,1,
-0x0799e8,1,
-0x0799f0,1,
-0x0799f8,1,
-0x079a00,1,
-0x079a08,1,
-0x079a10,1,
-0x079a18,1,
-0x079a20,1,
-0x079a28,1,
-0x079a30,1,
-0x079a38,1,
-0x079a40,1,
-0x079a48,1,
-0x079a50,1,
-0x079a58,1,
-0x079a60,1,
-0x079a68,1,
-0x079a70,1,
-0x079a78,1,
-0x079a80,1,
-0x079a88,1,
-0x079a90,1,
-0x079a98,1,
-0x079aa0,1,
-0x079aa8,1,
-0x079ab0,1,
-0x079ab8,1,
-0x079ac0,1,
-0x079ac8,1,
-0x079ad0,1,
-0x079ad8,1,
-0x079ae0,1,
-0x079ae8,1,
-0x079af0,1,
-0x079af8,1,
-0x079b00,1,
-0x079b08,1,
-0x079b10,1,
-0x079b18,1,
-0x079b20,1,
-0x079b28,1,
-0x079b30,1,
-0x079b38,1,
-0x079b40,1,
-0x079b48,1,
-0x079b50,1,
-0x079b58,1,
-0x079b60,1,
-0x079b68,1,
-0x079b70,1,
-0x079b78,1,
-0x079b80,1,
-0x079b88,1,
-0x079b90,1,
-0x079b98,1,
-0x079ba0,1,
-0x079ba8,1,
-0x079bb0,1,
-0x079bb8,1,
-0x079bc0,1,
-0x079bc8,1,
-0x079bd0,1,
-0x079bd8,1,
-0x079be0,1,
-0x079be8,1,
-0x079bf0,1,
-0x079bf8,1,
-0x079c00,1,
-0x079c08,1,
-0x079c10,1,
-0x079c18,1,
-0x079c20,1,
-0x079c28,1,
-0x079c30,1,
-0x079c38,1,
-0x079c40,1,
-0x079c48,1,
-0x079c50,1,
-0x079c58,1,
-0x079c60,1,
-0x079c68,1,
-0x079c70,1,
-0x079c78,1,
-0x079c80,1,
-0x079c88,1,
-0x079c90,1,
-0x079c98,1,
-0x079ca0,1,
-0x079ca8,1,
-0x079cb0,1,
-0x079cb8,1,
-0x079cc0,1,
-0x079cc8,1,
-0x079cd0,1,
-0x079cd8,1,
-0x079ce0,1,
-0x079ce8,1,
-0x079cf0,1,
-0x079cf8,1,
-0x079d00,1,
-0x079d08,1,
-0x079d10,1,
-0x079d18,1,
-0x079d20,1,
-0x079d28,1,
-0x079d30,1,
-0x079d38,1,
-0x079d40,1,
-0x079d48,1,
-0x079d50,1,
-0x079d58,1,
-0x079d60,1,
-0x079d68,1,
-0x079d70,1,
-0x079d78,1,
-0x079d80,1,
-0x079d88,1,
-0x079d90,1,
-0x079d98,1,
-0x079da0,1,
-0x079da8,1,
-0x079db0,1,
-0x079db8,1,
-0x079dc0,1,
-0x079dc8,1,
-0x079dd0,1,
-0x079dd8,1,
-0x079de0,1,
-0x079de8,1,
-0x079df0,1,
-0x079df8,1,
-0x079e00,1,
-0x079e08,1,
-0x079e10,1,
-0x079e18,1,
-0x079e20,1,
-0x079e28,1,
-0x079e30,1,
-0x079e38,1,
-0x079e40,1,
-0x079e48,1,
-0x079e50,1,
-0x079e58,1,
-0x079e60,1,
-0x079e68,1,
-0x079e70,1,
-0x079e78,1,
-0x079e80,1,
-0x079e88,1,
-0x079e90,1,
-0x079e98,1,
-0x079ea0,1,
-0x079ea8,1,
-0x079eb0,1,
-0x079eb8,1,
-0x079ec0,1,
-0x079ec8,1,
-0x079ed0,1,
-0x079ed8,1,
-0x079ee0,1,
-0x079ee8,1,
-0x079ef0,1,
-0x079ef8,1,
-0x079f00,1,
-0x079f08,1,
-0x079f10,1,
-0x079f18,1,
-0x079f20,1,
-0x079f28,1,
-0x079f30,1,
-0x079f38,1,
-0x079f40,1,
-0x079f48,1,
-0x079f50,1,
-0x079f58,1,
-0x079f60,1,
-0x079f68,1,
-0x079f70,1,
-0x079f78,1,
-0x079f80,1,
-0x079f88,1,
-0x079f90,1,
-0x079f98,1,
-0x079fa0,1,
-0x079fa8,1,
-0x079fb0,1,
-0x079fb8,1,
-0x079fc0,1,
-0x079fc8,1,
-0x079fd0,1,
-0x079fd8,1,
-0x079fe0,1,
-0x079fe8,1,
-0x079ff0,1,
-0x079ff8,1,
-0x07bef8,2,
-0x07bf04,1,
-0x07bf14,22,
-0x07bf80,2,
-0x07bffc,1033,
-0x07e000,1040,
-0x07f100,24,
-0x07f200,3,
-0x07f7f8,514,
-0x080680,7,
-0x081000,3,
-0x081010,12,
-0x081120,3,
-0x081130,2,
-0x081140,3,
-0x081150,2,
-0x081160,3,
-0x081170,2,
-0x081204,18,
-0x081304,2,
-0x08139c,25,
-0x081404,21,
-0x08145c,1,
-0x081468,6,
-0x081504,2,
-0x081604,14,
-0x081640,128,
-0x081904,5,
-0x081a30,4,
-0x081a60,18,
-0x081ad0,4,
-0x081c00,128,
-0x081e04,13,
-0x082000,8,
-0x082024,1,
-0x082030,1,
-0x082044,39,
-0x082180,1,
-0x0821c4,1,
-0x0821e0,5,
-0x0821f8,1,
-0x082200,9,
-0x08229c,3,
-0x0822e0,7,
-0x082328,6,
-0x082430,20,
-0x082484,3,
-0x082498,2,
-0x082500,16,
-0x082548,2,
-0x082558,2,
-0x082564,2,
-0x082590,4,
-0x0827fc,14,
-0x082838,66,
-0x082c00,13,
-0x082c38,66,
-0x083000,13,
-0x083038,66,
-0x0f0000,8,
-0x0f0040,8,
-0x0f0064,1,
-0x0f0078,5,
-0x0f0090,2,
-0x0f00a4,2,
-0x0f00b0,4,
-0x0f00f0,24,
-0x0f0180,17,
-0x0f0200,8,
-0x0f0240,11,
-0x0f0270,2,
-0x0f0280,1,
-0x0f02a4,5,
-0x0f02c0,11,
-0x0f0400,2,
-0x0f0410,10,
-0x0f0440,7,
-0x0f0470,11,
-0x0f04b0,11,
-0x0f04f0,4,
-0x0f3000,2,
-0x0f300c,3,
-0x0f301c,6,
-0x0f3040,5,
-0x0f3058,6,
-0x0f3078,14,
-0x0f30c0,13,
-0x0f30fc,2,
-0x0f310c,1,
-0x0f3120,2,
-0x0f3130,5,
-0x0f3184,15,
-0x0f3204,1,
-0x0f3210,5,
-0x0f3244,6,
-0x0f3264,5,
-0x0f3280,2,
-0x0f3290,8,
-0x0f32e4,1,
-0x0f32ec,1,
-0x0f3300,11,
-0x0f3330,2,
-0x0f3400,34,
-0x0f3500,2,
-0x0f350c,11,
-0x0f3540,15,
-0x0f3580,11,
-0x0f35b0,2,
-0x0f35cc,8,
-0x0f3700,13,
-0x0f3740,3,
-0x0f3750,2,
-0x0f3760,3,
-0x0f3770,2,
-0x0f3780,3,
-0x0f3790,2,
-0x0f37a0,10,
-0x0f3800,3,
-0x0f3810,2,
-0x0f381c,22,
-0x0f3880,12,
-0x0f38f8,6,
-0x0f3920,1,
-0x0f3928,1,
-0x0f3930,24,
-0x0f39a0,1,
-0x0f39a8,1,
-0x0f39b0,23,
-0x0f3a10,13,
-0x0f3a84,3,
-0x0f3c00,256,
diff --git a/mstdump/mstdump_dbs/ConnectX4.csv b/mstdump/mstdump_dbs/ConnectX4.csv
index 789cfca..87d9904 100644
--- a/mstdump/mstdump_dbs/ConnectX4.csv
+++ b/mstdump/mstdump_dbs/ConnectX4.csv
@@ -2085,18 +2085,6 @@
 0x0d4740,14,
 0x0d4780,62,
 0x0d487c,1,
-0x0d4884,1,
-0x0d488c,1,
-0x0d4894,1,
-0x0d489c,1,
-0x0d48a4,1,
-0x0d48ac,1,
-0x0d48b4,1,
-0x0d48bc,1,
-0x0d4900,3,
-0x0d4940,3,
-0x0d4980,3,
-0x0d49c0,3,
 0x0d4a00,8,
 0x0d4a24,15,
 0x0d4a64,30,
@@ -2123,10 +2111,6 @@
 0x0d4e94,5,
 0x0d4eac,1,
 0x0d4eb4,3,
-0x0d4f00,15,
-0x0d4f40,15,
-0x0d4f80,15,
-0x0d4fc0,15,
 0x0d5000,29,
 0x0d5078,4,
 0x0d5090,2,
@@ -2157,18 +2141,6 @@
 0x0d5740,14,
 0x0d5780,62,
 0x0d587c,1,
-0x0d5884,1,
-0x0d588c,1,
-0x0d5894,1,
-0x0d589c,1,
-0x0d58a4,1,
-0x0d58ac,1,
-0x0d58b4,1,
-0x0d58bc,1,
-0x0d5900,3,
-0x0d5940,3,
-0x0d5980,3,
-0x0d59c0,3,
 0x0d5a00,8,
 0x0d5a24,15,
 0x0d5a64,30,
@@ -2195,10 +2167,6 @@
 0x0d5e94,5,
 0x0d5eac,1,
 0x0d5eb4,3,
-0x0d5f00,15,
-0x0d5f40,15,
-0x0d5f80,15,
-0x0d5fc0,15,
 0x0d6000,15,
 0x0d6070,3,
 0x0d6080,6,
@@ -3214,18 +3182,6 @@
 0x118740,14,
 0x118780,62,
 0x11887c,1,
-0x118884,1,
-0x11888c,1,
-0x118894,1,
-0x11889c,1,
-0x1188a4,1,
-0x1188ac,1,
-0x1188b4,1,
-0x1188bc,1,
-0x118900,3,
-0x118940,3,
-0x118980,3,
-0x1189c0,3,
 0x118a00,8,
 0x118a24,15,
 0x118a64,30,
@@ -3252,10 +3208,6 @@
 0x118e94,5,
 0x118eac,1,
 0x118eb4,3,
-0x118f00,15,
-0x118f40,15,
-0x118f80,15,
-0x118fc0,15,
 0x119000,29,
 0x119078,4,
 0x119090,2,
@@ -3286,18 +3238,6 @@
 0x119740,14,
 0x119780,62,
 0x11987c,1,
-0x119884,1,
-0x11988c,1,
-0x119894,1,
-0x11989c,1,
-0x1198a4,1,
-0x1198ac,1,
-0x1198b4,1,
-0x1198bc,1,
-0x119900,3,
-0x119940,3,
-0x119980,3,
-0x1199c0,3,
 0x119a00,8,
 0x119a24,15,
 0x119a64,30,
@@ -3324,10 +3264,6 @@
 0x119e94,5,
 0x119eac,1,
 0x119eb4,3,
-0x119f00,15,
-0x119f40,15,
-0x119f80,15,
-0x119fc0,15,
 0x11a000,29,
 0x11a078,4,
 0x11a090,2,
@@ -3358,18 +3294,6 @@
 0x11a740,14,
 0x11a780,62,
 0x11a87c,1,
-0x11a884,1,
-0x11a88c,1,
-0x11a894,1,
-0x11a89c,1,
-0x11a8a4,1,
-0x11a8ac,1,
-0x11a8b4,1,
-0x11a8bc,1,
-0x11a900,3,
-0x11a940,3,
-0x11a980,3,
-0x11a9c0,3,
 0x11aa00,8,
 0x11aa24,15,
 0x11aa64,30,
@@ -3396,10 +3320,6 @@
 0x11ae94,5,
 0x11aeac,1,
 0x11aeb4,3,
-0x11af00,15,
-0x11af40,15,
-0x11af80,15,
-0x11afc0,15,
 0x11b000,29,
 0x11b078,4,
 0x11b090,2,
@@ -3430,18 +3350,6 @@
 0x11b740,14,
 0x11b780,62,
 0x11b87c,1,
-0x11b884,1,
-0x11b88c,1,
-0x11b894,1,
-0x11b89c,1,
-0x11b8a4,1,
-0x11b8ac,1,
-0x11b8b4,1,
-0x11b8bc,1,
-0x11b900,3,
-0x11b940,3,
-0x11b980,3,
-0x11b9c0,3,
 0x11ba00,8,
 0x11ba24,15,
 0x11ba64,30,
@@ -3468,10 +3376,6 @@
 0x11be94,5,
 0x11beac,1,
 0x11beb4,3,
-0x11bf00,15,
-0x11bf40,15,
-0x11bf80,15,
-0x11bfc0,15,
 0x11c000,19,
 0x11c050,10,
 0x11c080,19,
diff --git a/mstdump/mstdump_dbs/Makefile.in b/mstdump/mstdump_dbs/Makefile.in
index 0c5c0b7..01f037b 100644
--- a/mstdump/mstdump_dbs/Makefile.in
+++ b/mstdump/mstdump_dbs/Makefile.in
@@ -206,6 +206,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
diff --git a/mstdump/mstdump_dbs/Spectrum.csv b/mstdump/mstdump_dbs/Spectrum.csv
index 9b0a4a0..83f58fb 100644
--- a/mstdump/mstdump_dbs/Spectrum.csv
+++ b/mstdump/mstdump_dbs/Spectrum.csv
@@ -3986,7 +3986,7 @@
 0x0c2b80,19,
 0x0c2bd0,10,
 0x0c2c00,19,
-0x0c2c50,10,
+0x0c2c60,6,
 0x0c2c84,1,
 0x0c2c94,8,
 0x0c2cb8,14,
@@ -4097,7 +4097,6 @@
 0x0d0000,4,
 0x0d0014,1,
 0x0d0020,3,
-0x0d0030,3,
 0x0d0040,8,
 0x0d007c,2,
 0x0d00a0,6,
@@ -4230,7 +4229,6 @@
 0x0d8020,3,
 0x0d8030,1,
 0x0d8038,4,
-0x0d8050,1,
 0x0d8100,6,
 0x0d8120,10,
 0x0d8150,10,
@@ -4238,16 +4236,6 @@
 0x0d81b0,6,
 0x0d81d0,6,
 0x0d81f0,2,
-0x0d8400,1,
-0x0d8428,1,
-0x0d8450,1,
-0x0d8478,1,
-0x0d84a0,6,
-0x0d85ac,1,
-0x0d85d8,4,
-0x0d8600,6,
-0x0d8620,6,
-0x0d8640,3,
 0x0d8800,6,
 0x0d8820,3,
 0x0d8830,4,
@@ -4257,12 +4245,6 @@
 0x0d8958,2,
 0x0d8964,1,
 0x0d8974,3,
-0x0d8998,2,
-0x0d89a4,1,
-0x0d89b4,3,
-0x0d89d8,2,
-0x0d89e4,1,
-0x0d89f4,3,
 0x0d9020,4,
 0x0d9040,11,
 0x0d9074,2,
@@ -4319,62 +4301,6 @@
 0x0da570,18,
 0x0da5bc,5,
 0x0da800,480,
-0x0db020,4,
-0x0db040,11,
-0x0db074,2,
-0x0db080,4,
-0x0db0b0,22,
-0x0db110,2,
-0x0db120,22,
-0x0db180,2,
-0x0db1a0,6,
-0x0db1c0,9,
-0x0db200,42,
-0x0db2c0,1,
-0x0db2c8,13,
-0x0db300,25,
-0x0db36c,4,
-0x0db380,2,
-0x0db3a0,1,
-0x0db3c0,11,
-0x0db404,3,
-0x0db420,11,
-0x0db480,6,
-0x0db500,1,
-0x0db520,6,
-0x0db540,3,
-0x0db550,7,
-0x0db570,18,
-0x0db5bc,5,
-0x0db800,480,
-0x0dc020,4,
-0x0dc040,11,
-0x0dc074,2,
-0x0dc080,4,
-0x0dc0b0,22,
-0x0dc110,2,
-0x0dc120,22,
-0x0dc180,2,
-0x0dc1a0,6,
-0x0dc1c0,9,
-0x0dc200,42,
-0x0dc2c0,1,
-0x0dc2c8,13,
-0x0dc300,25,
-0x0dc36c,4,
-0x0dc380,2,
-0x0dc3a0,1,
-0x0dc3c0,11,
-0x0dc404,3,
-0x0dc420,11,
-0x0dc480,6,
-0x0dc500,1,
-0x0dc520,6,
-0x0dc540,3,
-0x0dc550,7,
-0x0dc570,18,
-0x0dc5bc,5,
-0x0dc800,480,
 0x0df800,5,
 0x0df818,1,
 0x0df854,6,
@@ -4387,18 +4313,6 @@
 0x0df980,4,
 0x0df9a4,1,
 0x0df9ac,2,
-0x0dfa00,5,
-0x0dfa18,1,
-0x0dfa54,6,
-0x0dfa80,4,
-0x0dfaa4,1,
-0x0dfaac,2,
-0x0dfb00,5,
-0x0dfb18,1,
-0x0dfb54,6,
-0x0dfb80,4,
-0x0dfba4,1,
-0x0dfbac,2,
 0x0e8000,1,
 0x0e8008,2,
 0x0e8058,3,
@@ -4576,78 +4490,6 @@
 0x0f208c,3,
 0x0f20a0,10,
 0x0f20e0,6,
-0x0f2100,2,
-0x0f210c,3,
-0x0f2120,10,
-0x0f2160,6,
-0x0f2180,2,
-0x0f218c,3,
-0x0f21a0,10,
-0x0f21e0,6,
-0x0f2200,2,
-0x0f220c,3,
-0x0f2220,10,
-0x0f2260,6,
-0x0f2280,2,
-0x0f228c,3,
-0x0f22a0,10,
-0x0f22e0,6,
-0x0f2300,2,
-0x0f230c,3,
-0x0f2320,10,
-0x0f2360,6,
-0x0f2380,2,
-0x0f238c,3,
-0x0f23a0,10,
-0x0f23e0,6,
-0x0f2400,2,
-0x0f240c,3,
-0x0f2420,10,
-0x0f2460,6,
-0x0f2480,2,
-0x0f248c,3,
-0x0f24a0,10,
-0x0f24e0,6,
-0x0f2500,2,
-0x0f250c,3,
-0x0f2520,10,
-0x0f2560,6,
-0x0f2580,2,
-0x0f258c,3,
-0x0f25a0,10,
-0x0f25e0,6,
-0x0f2600,2,
-0x0f260c,3,
-0x0f2620,10,
-0x0f2660,6,
-0x0f2680,2,
-0x0f268c,3,
-0x0f26a0,10,
-0x0f26e0,6,
-0x0f2700,2,
-0x0f270c,3,
-0x0f2720,10,
-0x0f2760,6,
-0x0f2780,2,
-0x0f278c,3,
-0x0f27a0,10,
-0x0f27e0,6,
-0x0f2800,2,
-0x0f280c,3,
-0x0f2820,10,
-0x0f2860,6,
-0x0f2880,2,
-0x0f288c,3,
-0x0f28a0,10,
-0x0f28e0,6,
-0x0f2900,2,
-0x0f290c,3,
-0x0f2920,10,
-0x0f2960,6,
-0x0f2980,2,
-0x0f298c,3,
-0x0f29a0,10,
-0x0f29e0,6,
 0x0f4000,7,
 0x0f4020,4,
 0x0f4204,1,
@@ -10212,30 +10054,11 @@
 0x1c91e0,40,
 0x1c92e0,10,
 0x1c9320,10,
-0x1c9560,10,
+0x1c9560,8,
 0x1c95a0,10,
 0x1c95e0,5,
 0x1c9600,10,
 0x1c9660,21,
-0x1c9800,18,
-0x1c9880,18,
-0x1c9a00,15,
-0x1c9a40,15,
-0x1c9a80,10,
-0x1c9ac0,10,
-0x1c9b00,3,
-0x1c9b80,18,
-0x1c9c00,13,
-0x1c9c40,10,
-0x1c9c80,15,
-0x1c9d00,10,
-0x1c9e00,1,
-0x1ca000,1,
-0x1ca184,1,
-0x1ca18c,1,
-0x1ca1a4,1,
-0x1ca1ac,1,
-0x1ca1c0,1,
 0x1ca804,1,
 0x1ca80c,4,
 0x1ca824,1,
@@ -10320,30 +10143,11 @@
 0x1cd1e0,40,
 0x1cd2e0,10,
 0x1cd320,10,
-0x1cd560,10,
+0x1cd560,8,
 0x1cd5a0,10,
 0x1cd5e0,5,
 0x1cd600,10,
 0x1cd660,21,
-0x1cd800,18,
-0x1cd880,18,
-0x1cda00,15,
-0x1cda40,15,
-0x1cda80,10,
-0x1cdac0,10,
-0x1cdb00,3,
-0x1cdb80,18,
-0x1cdc00,13,
-0x1cdc40,10,
-0x1cdc80,15,
-0x1cdd00,10,
-0x1cde00,1,
-0x1ce000,1,
-0x1ce184,1,
-0x1ce18c,1,
-0x1ce1a4,1,
-0x1ce1ac,1,
-0x1ce1c0,1,
 0x1ce804,1,
 0x1ce80c,4,
 0x1ce824,1,
@@ -10428,30 +10232,11 @@
 0x1d11e0,40,
 0x1d12e0,10,
 0x1d1320,10,
-0x1d1560,10,
+0x1d1560,8,
 0x1d15a0,10,
 0x1d15e0,5,
 0x1d1600,10,
 0x1d1660,21,
-0x1d1800,18,
-0x1d1880,18,
-0x1d1a00,15,
-0x1d1a40,15,
-0x1d1a80,10,
-0x1d1ac0,10,
-0x1d1b00,3,
-0x1d1b80,18,
-0x1d1c00,13,
-0x1d1c40,10,
-0x1d1c80,15,
-0x1d1d00,10,
-0x1d1e00,1,
-0x1d2000,1,
-0x1d2184,1,
-0x1d218c,1,
-0x1d21a4,1,
-0x1d21ac,1,
-0x1d21c0,1,
 0x1d2804,1,
 0x1d280c,4,
 0x1d2824,1,
@@ -10536,30 +10321,11 @@
 0x1d51e0,40,
 0x1d52e0,10,
 0x1d5320,10,
-0x1d5560,10,
+0x1d5560,8,
 0x1d55a0,10,
 0x1d55e0,5,
 0x1d5600,10,
 0x1d5660,21,
-0x1d5800,18,
-0x1d5880,18,
-0x1d5a00,15,
-0x1d5a40,15,
-0x1d5a80,10,
-0x1d5ac0,10,
-0x1d5b00,3,
-0x1d5b80,18,
-0x1d5c00,13,
-0x1d5c40,10,
-0x1d5c80,15,
-0x1d5d00,10,
-0x1d5e00,1,
-0x1d6000,1,
-0x1d6184,1,
-0x1d618c,1,
-0x1d61a4,1,
-0x1d61ac,1,
-0x1d61c0,1,
 0x1d6804,1,
 0x1d680c,4,
 0x1d6824,1,
@@ -11358,23 +11124,6 @@
 0x20620c,6,
 0x206240,13,
 0x206280,16,
-0x206400,8,
-0x206424,15,
-0x206464,15,
-0x2064a4,15,
-0x2064e4,30,
-0x206580,10,
-0x2065ac,1,
-0x2065b4,5,
-0x2065cc,1,
-0x2065d4,5,
-0x2065ec,1,
-0x2065f4,13,
-0x206680,4,
-0x206694,2,
-0x2066a0,5,
-0x2066c0,5,
-0x2066e0,4,
 0x206800,19,
 0x206850,10,
 0x206880,19,
@@ -11392,7 +11141,7 @@
 0x206b80,19,
 0x206bd0,10,
 0x206c00,19,
-0x206c50,10,
+0x206c60,6,
 0x206c84,1,
 0x206c94,8,
 0x206cb8,14,
@@ -11421,13 +11170,6 @@
 0x208030,1,
 0x208038,4,
 0x208050,1,
-0x208100,6,
-0x208120,10,
-0x208150,10,
-0x208180,10,
-0x2081b0,6,
-0x2081d0,6,
-0x2081f0,2,
 0x208400,1,
 0x208428,1,
 0x208450,1,
@@ -12105,23 +11847,6 @@
 0x22620c,6,
 0x226240,13,
 0x226280,16,
-0x226400,8,
-0x226424,15,
-0x226464,15,
-0x2264a4,15,
-0x2264e4,30,
-0x226580,10,
-0x2265ac,1,
-0x2265b4,5,
-0x2265cc,1,
-0x2265d4,5,
-0x2265ec,1,
-0x2265f4,13,
-0x226680,4,
-0x226694,2,
-0x2266a0,5,
-0x2266c0,5,
-0x2266e0,4,
 0x226800,19,
 0x226850,10,
 0x226880,19,
@@ -12139,7 +11864,7 @@
 0x226b80,19,
 0x226bd0,10,
 0x226c00,19,
-0x226c50,10,
+0x226c60,6,
 0x226c84,1,
 0x226c94,8,
 0x226cb8,14,
@@ -12168,13 +11893,6 @@
 0x228030,1,
 0x228038,4,
 0x228050,1,
-0x228100,6,
-0x228120,10,
-0x228150,10,
-0x228180,10,
-0x2281b0,6,
-0x2281d0,6,
-0x2281f0,2,
 0x228400,1,
 0x228428,1,
 0x228450,1,
@@ -12852,23 +12570,6 @@
 0x24620c,6,
 0x246240,13,
 0x246280,16,
-0x246400,8,
-0x246424,15,
-0x246464,15,
-0x2464a4,15,
-0x2464e4,30,
-0x246580,10,
-0x2465ac,1,
-0x2465b4,5,
-0x2465cc,1,
-0x2465d4,5,
-0x2465ec,1,
-0x2465f4,13,
-0x246680,4,
-0x246694,2,
-0x2466a0,5,
-0x2466c0,5,
-0x2466e0,4,
 0x246800,19,
 0x246850,10,
 0x246880,19,
@@ -12886,7 +12587,7 @@
 0x246b80,19,
 0x246bd0,10,
 0x246c00,19,
-0x246c50,10,
+0x246c60,6,
 0x246c84,1,
 0x246c94,8,
 0x246cb8,14,
@@ -12915,13 +12616,6 @@
 0x248030,1,
 0x248038,4,
 0x248050,1,
-0x248100,6,
-0x248120,10,
-0x248150,10,
-0x248180,10,
-0x2481b0,6,
-0x2481d0,6,
-0x2481f0,2,
 0x248400,1,
 0x248428,1,
 0x248450,1,
@@ -13633,7 +13327,7 @@
 0x266b80,19,
 0x266bd0,10,
 0x266c00,19,
-0x266c50,10,
+0x266c60,6,
 0x266c84,1,
 0x266c94,8,
 0x266cb8,14,
@@ -13662,13 +13356,6 @@
 0x268030,1,
 0x268038,4,
 0x268050,1,
-0x268100,6,
-0x268120,10,
-0x268150,10,
-0x268180,10,
-0x2681b0,6,
-0x2681d0,6,
-0x2681f0,2,
 0x268400,1,
 0x268428,1,
 0x268450,1,
@@ -14346,23 +14033,6 @@
 0x28620c,6,
 0x286240,13,
 0x286280,16,
-0x286400,8,
-0x286424,15,
-0x286464,15,
-0x2864a4,15,
-0x2864e4,30,
-0x286580,10,
-0x2865ac,1,
-0x2865b4,5,
-0x2865cc,1,
-0x2865d4,5,
-0x2865ec,1,
-0x2865f4,13,
-0x286680,4,
-0x286694,2,
-0x2866a0,5,
-0x2866c0,5,
-0x2866e0,4,
 0x286800,19,
 0x286850,10,
 0x286880,19,
@@ -14380,7 +14050,7 @@
 0x286b80,19,
 0x286bd0,10,
 0x286c00,19,
-0x286c50,10,
+0x286c60,6,
 0x286c84,1,
 0x286c94,8,
 0x286cb8,14,
@@ -14409,13 +14079,6 @@
 0x288030,1,
 0x288038,4,
 0x288050,1,
-0x288100,6,
-0x288120,10,
-0x288150,10,
-0x288180,10,
-0x2881b0,6,
-0x2881d0,6,
-0x2881f0,2,
 0x288400,1,
 0x288428,1,
 0x288450,1,
@@ -15093,23 +14756,6 @@
 0x2a620c,6,
 0x2a6240,13,
 0x2a6280,16,
-0x2a6400,8,
-0x2a6424,15,
-0x2a6464,15,
-0x2a64a4,15,
-0x2a64e4,30,
-0x2a6580,10,
-0x2a65ac,1,
-0x2a65b4,5,
-0x2a65cc,1,
-0x2a65d4,5,
-0x2a65ec,1,
-0x2a65f4,13,
-0x2a6680,4,
-0x2a6694,2,
-0x2a66a0,5,
-0x2a66c0,5,
-0x2a66e0,4,
 0x2a6800,19,
 0x2a6850,10,
 0x2a6880,19,
@@ -15127,7 +14773,7 @@
 0x2a6b80,19,
 0x2a6bd0,10,
 0x2a6c00,19,
-0x2a6c50,10,
+0x2a6c60,6,
 0x2a6c84,1,
 0x2a6c94,8,
 0x2a6cb8,14,
@@ -15156,13 +14802,6 @@
 0x2a8030,1,
 0x2a8038,4,
 0x2a8050,1,
-0x2a8100,6,
-0x2a8120,10,
-0x2a8150,10,
-0x2a8180,10,
-0x2a81b0,6,
-0x2a81d0,6,
-0x2a81f0,2,
 0x2a8400,1,
 0x2a8428,1,
 0x2a8450,1,
@@ -15840,23 +15479,6 @@
 0x2c620c,6,
 0x2c6240,13,
 0x2c6280,16,
-0x2c6400,8,
-0x2c6424,15,
-0x2c6464,15,
-0x2c64a4,15,
-0x2c64e4,30,
-0x2c6580,10,
-0x2c65ac,1,
-0x2c65b4,5,
-0x2c65cc,1,
-0x2c65d4,5,
-0x2c65ec,1,
-0x2c65f4,13,
-0x2c6680,4,
-0x2c6694,2,
-0x2c66a0,5,
-0x2c66c0,5,
-0x2c66e0,4,
 0x2c6800,19,
 0x2c6850,10,
 0x2c6880,19,
@@ -15874,7 +15496,7 @@
 0x2c6b80,19,
 0x2c6bd0,10,
 0x2c6c00,19,
-0x2c6c50,10,
+0x2c6c60,6,
 0x2c6c84,1,
 0x2c6c94,8,
 0x2c6cb8,14,
@@ -15903,13 +15525,6 @@
 0x2c8030,1,
 0x2c8038,4,
 0x2c8050,1,
-0x2c8100,6,
-0x2c8120,10,
-0x2c8150,10,
-0x2c8180,10,
-0x2c81b0,6,
-0x2c81d0,6,
-0x2c81f0,2,
 0x2c8400,1,
 0x2c8428,1,
 0x2c8450,1,
@@ -16587,23 +16202,6 @@
 0x2e620c,6,
 0x2e6240,13,
 0x2e6280,16,
-0x2e6400,8,
-0x2e6424,15,
-0x2e6464,15,
-0x2e64a4,15,
-0x2e64e4,30,
-0x2e6580,10,
-0x2e65ac,1,
-0x2e65b4,5,
-0x2e65cc,1,
-0x2e65d4,5,
-0x2e65ec,1,
-0x2e65f4,13,
-0x2e6680,4,
-0x2e6694,2,
-0x2e66a0,5,
-0x2e66c0,5,
-0x2e66e0,4,
 0x2e6800,19,
 0x2e6850,10,
 0x2e6880,19,
@@ -16621,7 +16219,7 @@
 0x2e6b80,19,
 0x2e6bd0,10,
 0x2e6c00,19,
-0x2e6c50,10,
+0x2e6c60,6,
 0x2e6c84,1,
 0x2e6c94,8,
 0x2e6cb8,14,
@@ -16650,13 +16248,6 @@
 0x2e8030,1,
 0x2e8038,4,
 0x2e8050,1,
-0x2e8100,6,
-0x2e8120,10,
-0x2e8150,10,
-0x2e8180,10,
-0x2e81b0,6,
-0x2e81d0,6,
-0x2e81f0,2,
 0x2e8400,1,
 0x2e8428,1,
 0x2e8450,1,
@@ -17334,23 +16925,6 @@
 0x30620c,6,
 0x306240,13,
 0x306280,16,
-0x306400,8,
-0x306424,15,
-0x306464,15,
-0x3064a4,15,
-0x3064e4,30,
-0x306580,10,
-0x3065ac,1,
-0x3065b4,5,
-0x3065cc,1,
-0x3065d4,5,
-0x3065ec,1,
-0x3065f4,13,
-0x306680,4,
-0x306694,2,
-0x3066a0,5,
-0x3066c0,5,
-0x3066e0,4,
 0x306800,19,
 0x306850,10,
 0x306880,19,
@@ -17368,7 +16942,7 @@
 0x306b80,19,
 0x306bd0,10,
 0x306c00,19,
-0x306c50,10,
+0x306c60,6,
 0x306c84,1,
 0x306c94,8,
 0x306cb8,14,
@@ -17397,13 +16971,6 @@
 0x308030,1,
 0x308038,4,
 0x308050,1,
-0x308100,6,
-0x308120,10,
-0x308150,10,
-0x308180,10,
-0x3081b0,6,
-0x3081d0,6,
-0x3081f0,2,
 0x308400,1,
 0x308428,1,
 0x308450,1,
@@ -18081,23 +17648,6 @@
 0x32620c,6,
 0x326240,13,
 0x326280,16,
-0x326400,8,
-0x326424,15,
-0x326464,15,
-0x3264a4,15,
-0x3264e4,30,
-0x326580,10,
-0x3265ac,1,
-0x3265b4,5,
-0x3265cc,1,
-0x3265d4,5,
-0x3265ec,1,
-0x3265f4,13,
-0x326680,4,
-0x326694,2,
-0x3266a0,5,
-0x3266c0,5,
-0x3266e0,4,
 0x326800,19,
 0x326850,10,
 0x326880,19,
@@ -18115,7 +17665,7 @@
 0x326b80,19,
 0x326bd0,10,
 0x326c00,19,
-0x326c50,10,
+0x326c60,6,
 0x326c84,1,
 0x326c94,8,
 0x326cb8,14,
@@ -18144,13 +17694,6 @@
 0x328030,1,
 0x328038,4,
 0x328050,1,
-0x328100,6,
-0x328120,10,
-0x328150,10,
-0x328180,10,
-0x3281b0,6,
-0x3281d0,6,
-0x3281f0,2,
 0x328400,1,
 0x328428,1,
 0x328450,1,
@@ -18828,23 +18371,6 @@
 0x34620c,6,
 0x346240,13,
 0x346280,16,
-0x346400,8,
-0x346424,15,
-0x346464,15,
-0x3464a4,15,
-0x3464e4,30,
-0x346580,10,
-0x3465ac,1,
-0x3465b4,5,
-0x3465cc,1,
-0x3465d4,5,
-0x3465ec,1,
-0x3465f4,13,
-0x346680,4,
-0x346694,2,
-0x3466a0,5,
-0x3466c0,5,
-0x3466e0,4,
 0x346800,19,
 0x346850,10,
 0x346880,19,
@@ -18862,7 +18388,7 @@
 0x346b80,19,
 0x346bd0,10,
 0x346c00,19,
-0x346c50,10,
+0x346c60,6,
 0x346c84,1,
 0x346c94,8,
 0x346cb8,14,
@@ -18891,13 +18417,6 @@
 0x348030,1,
 0x348038,4,
 0x348050,1,
-0x348100,6,
-0x348120,10,
-0x348150,10,
-0x348180,10,
-0x3481b0,6,
-0x3481d0,6,
-0x3481f0,2,
 0x348400,1,
 0x348428,1,
 0x348450,1,
@@ -19609,7 +19128,7 @@
 0x366b80,19,
 0x366bd0,10,
 0x366c00,19,
-0x366c50,10,
+0x366c60,6,
 0x366c84,1,
 0x366c94,8,
 0x366cb8,14,
@@ -19638,13 +19157,6 @@
 0x368030,1,
 0x368038,4,
 0x368050,1,
-0x368100,6,
-0x368120,10,
-0x368150,10,
-0x368180,10,
-0x3681b0,6,
-0x3681d0,6,
-0x3681f0,2,
 0x368400,1,
 0x368428,1,
 0x368450,1,
@@ -20322,23 +19834,6 @@
 0x38620c,6,
 0x386240,13,
 0x386280,16,
-0x386400,8,
-0x386424,15,
-0x386464,15,
-0x3864a4,15,
-0x3864e4,30,
-0x386580,10,
-0x3865ac,1,
-0x3865b4,5,
-0x3865cc,1,
-0x3865d4,5,
-0x3865ec,1,
-0x3865f4,13,
-0x386680,4,
-0x386694,2,
-0x3866a0,5,
-0x3866c0,5,
-0x3866e0,4,
 0x386800,19,
 0x386850,10,
 0x386880,19,
@@ -20356,7 +19851,7 @@
 0x386b80,19,
 0x386bd0,10,
 0x386c00,19,
-0x386c50,10,
+0x386c60,6,
 0x386c84,1,
 0x386c94,8,
 0x386cb8,14,
@@ -20385,13 +19880,6 @@
 0x388030,1,
 0x388038,4,
 0x388050,1,
-0x388100,6,
-0x388120,10,
-0x388150,10,
-0x388180,10,
-0x3881b0,6,
-0x3881d0,6,
-0x3881f0,2,
 0x388400,1,
 0x388428,1,
 0x388450,1,
@@ -21069,23 +20557,6 @@
 0x3a620c,6,
 0x3a6240,13,
 0x3a6280,16,
-0x3a6400,8,
-0x3a6424,15,
-0x3a6464,15,
-0x3a64a4,15,
-0x3a64e4,30,
-0x3a6580,10,
-0x3a65ac,1,
-0x3a65b4,5,
-0x3a65cc,1,
-0x3a65d4,5,
-0x3a65ec,1,
-0x3a65f4,13,
-0x3a6680,4,
-0x3a6694,2,
-0x3a66a0,5,
-0x3a66c0,5,
-0x3a66e0,4,
 0x3a6800,19,
 0x3a6850,10,
 0x3a6880,19,
@@ -21103,7 +20574,7 @@
 0x3a6b80,19,
 0x3a6bd0,10,
 0x3a6c00,19,
-0x3a6c50,10,
+0x3a6c60,6,
 0x3a6c84,1,
 0x3a6c94,8,
 0x3a6cb8,14,
@@ -21132,13 +20603,6 @@
 0x3a8030,1,
 0x3a8038,4,
 0x3a8050,1,
-0x3a8100,6,
-0x3a8120,10,
-0x3a8150,10,
-0x3a8180,10,
-0x3a81b0,6,
-0x3a81d0,6,
-0x3a81f0,2,
 0x3a8400,1,
 0x3a8428,1,
 0x3a8450,1,
@@ -21816,23 +21280,6 @@
 0x3c620c,6,
 0x3c6240,13,
 0x3c6280,16,
-0x3c6400,8,
-0x3c6424,15,
-0x3c6464,15,
-0x3c64a4,15,
-0x3c64e4,30,
-0x3c6580,10,
-0x3c65ac,1,
-0x3c65b4,5,
-0x3c65cc,1,
-0x3c65d4,5,
-0x3c65ec,1,
-0x3c65f4,13,
-0x3c6680,4,
-0x3c6694,2,
-0x3c66a0,5,
-0x3c66c0,5,
-0x3c66e0,4,
 0x3c6800,19,
 0x3c6850,10,
 0x3c6880,19,
@@ -21850,7 +21297,7 @@
 0x3c6b80,19,
 0x3c6bd0,10,
 0x3c6c00,19,
-0x3c6c50,10,
+0x3c6c60,6,
 0x3c6c84,1,
 0x3c6c94,8,
 0x3c6cb8,14,
@@ -21879,13 +21326,6 @@
 0x3c8030,1,
 0x3c8038,4,
 0x3c8050,1,
-0x3c8100,6,
-0x3c8120,10,
-0x3c8150,10,
-0x3c8180,10,
-0x3c81b0,6,
-0x3c81d0,6,
-0x3c81f0,2,
 0x3c8400,1,
 0x3c8428,1,
 0x3c8450,1,
@@ -22563,23 +22003,6 @@
 0x3e620c,6,
 0x3e6240,13,
 0x3e6280,16,
-0x3e6400,8,
-0x3e6424,15,
-0x3e6464,15,
-0x3e64a4,15,
-0x3e64e4,30,
-0x3e6580,10,
-0x3e65ac,1,
-0x3e65b4,5,
-0x3e65cc,1,
-0x3e65d4,5,
-0x3e65ec,1,
-0x3e65f4,13,
-0x3e6680,4,
-0x3e6694,2,
-0x3e66a0,5,
-0x3e66c0,5,
-0x3e66e0,4,
 0x3e6800,19,
 0x3e6850,10,
 0x3e6880,19,
@@ -22597,7 +22020,7 @@
 0x3e6b80,19,
 0x3e6bd0,10,
 0x3e6c00,19,
-0x3e6c50,10,
+0x3e6c60,6,
 0x3e6c84,1,
 0x3e6c94,8,
 0x3e6cb8,14,
@@ -22626,13 +22049,6 @@
 0x3e8030,1,
 0x3e8038,4,
 0x3e8050,1,
-0x3e8100,6,
-0x3e8120,10,
-0x3e8150,10,
-0x3e8180,10,
-0x3e81b0,6,
-0x3e81d0,6,
-0x3e81f0,2,
 0x3e8400,1,
 0x3e8428,1,
 0x3e8450,1,
diff --git a/mstdump/mstdump_dbs/SwitchIB2.csv b/mstdump/mstdump_dbs/SwitchIB2.csv
new file mode 100644
index 0000000..cd74222
--- /dev/null
+++ b/mstdump/mstdump_dbs/SwitchIB2.csv
@@ -0,0 +1,13081 @@
+#Addr, Size, Enable addr
+0x000400,1,
+0x000408,14,
+0x000480,1,
+0x000488,18,
+0x000500,9,
+0x000534,2,
+0x00054c,4,
+0x00056c,11,
+0x0005ac,8,
+0x0005d0,1,
+0x000604,1,
+0x00060c,13,
+0x000644,1,
+0x000654,3,
+0x000664,1,
+0x00066c,8,
+0x0006a8,3,
+0x0006c0,8,
+0x000700,6,
+0x000760,4,
+0x000780,8,
+0x0007b8,8,
+0x0007dc,10,
+0x000808,14,
+0x000880,1,
+0x000888,18,
+0x000900,9,
+0x000934,2,
+0x00094c,4,
+0x00096c,11,
+0x0009ac,8,
+0x0009d0,1,
+0x000a04,1,
+0x000a0c,13,
+0x000a44,1,
+0x000a54,3,
+0x000a64,1,
+0x000a6c,8,
+0x000aa8,3,
+0x000ac0,8,
+0x000b00,6,
+0x000b60,4,
+0x000b80,8,
+0x000bb8,8,
+0x000bdc,10,
+0x000c08,14,
+0x000c80,1,
+0x000c88,18,
+0x000d00,9,
+0x000d34,2,
+0x000d4c,4,
+0x000d6c,11,
+0x000dac,8,
+0x000dd0,1,
+0x000e04,1,
+0x000e0c,13,
+0x000e44,1,
+0x000e54,3,
+0x000e64,1,
+0x000e6c,8,
+0x000ea8,3,
+0x000ec0,8,
+0x000f00,6,
+0x000f60,4,
+0x000f80,8,
+0x000fb8,8,
+0x000fdc,10,
+0x001008,14,
+0x001080,1,
+0x001088,18,
+0x001100,9,
+0x001134,2,
+0x00114c,4,
+0x00116c,11,
+0x0011ac,8,
+0x0011d0,1,
+0x001204,1,
+0x00120c,13,
+0x001244,1,
+0x001254,3,
+0x001264,1,
+0x00126c,8,
+0x0012a8,3,
+0x0012c0,8,
+0x001300,6,
+0x001360,4,
+0x001380,8,
+0x0013b8,8,
+0x0013dc,10,
+0x001408,14,
+0x001480,1,
+0x001488,18,
+0x001500,9,
+0x001534,2,
+0x00154c,4,
+0x00156c,11,
+0x0015ac,8,
+0x0015d0,1,
+0x001604,1,
+0x00160c,13,
+0x001644,1,
+0x001654,3,
+0x001664,1,
+0x00166c,8,
+0x0016a8,3,
+0x0016c0,8,
+0x001700,6,
+0x001760,4,
+0x001780,8,
+0x0017b8,8,
+0x0017dc,10,
+0x001808,14,
+0x001880,1,
+0x001888,18,
+0x001900,9,
+0x001934,2,
+0x00194c,4,
+0x00196c,11,
+0x0019ac,8,
+0x0019d0,1,
+0x001a04,1,
+0x001a0c,13,
+0x001a44,1,
+0x001a54,3,
+0x001a64,1,
+0x001a6c,8,
+0x001aa8,3,
+0x001ac0,8,
+0x001b00,6,
+0x001b60,4,
+0x001b80,8,
+0x001bb8,8,
+0x001bdc,10,
+0x001c08,14,
+0x001c80,1,
+0x001c88,18,
+0x001d00,9,
+0x001d34,2,
+0x001d4c,4,
+0x001d6c,11,
+0x001dac,8,
+0x001dd0,1,
+0x001e04,1,
+0x001e0c,13,
+0x001e44,1,
+0x001e54,3,
+0x001e64,1,
+0x001e6c,8,
+0x001ea8,3,
+0x001ec0,8,
+0x001f00,6,
+0x001f60,4,
+0x001f80,8,
+0x001fb8,8,
+0x001fdc,10,
+0x002008,14,
+0x002080,1,
+0x002088,18,
+0x002100,9,
+0x002134,2,
+0x00214c,4,
+0x00216c,11,
+0x0021ac,8,
+0x0021d0,1,
+0x002204,1,
+0x00220c,13,
+0x002244,1,
+0x002254,3,
+0x002264,1,
+0x00226c,8,
+0x0022a8,3,
+0x0022c0,8,
+0x002300,6,
+0x002360,4,
+0x002380,8,
+0x0023b8,8,
+0x0023dc,10,
+0x002408,14,
+0x002480,1,
+0x002488,18,
+0x002500,9,
+0x002534,2,
+0x00254c,4,
+0x00256c,11,
+0x0025ac,8,
+0x0025d0,1,
+0x002604,1,
+0x00260c,13,
+0x002644,1,
+0x002654,3,
+0x002664,1,
+0x00266c,8,
+0x0026a8,3,
+0x0026c0,8,
+0x002700,6,
+0x002760,4,
+0x002780,8,
+0x0027b8,8,
+0x0027dc,10,
+0x002808,14,
+0x002880,1,
+0x002888,18,
+0x002900,9,
+0x002934,2,
+0x00294c,4,
+0x00296c,11,
+0x0029ac,8,
+0x0029d0,1,
+0x002a04,1,
+0x002a0c,13,
+0x002a44,1,
+0x002a54,3,
+0x002a64,1,
+0x002a6c,8,
+0x002aa8,3,
+0x002ac0,8,
+0x002b00,6,
+0x002b60,4,
+0x002b80,8,
+0x002bb8,8,
+0x002bdc,10,
+0x002c08,14,
+0x002c80,1,
+0x002c88,18,
+0x002d00,9,
+0x002d34,2,
+0x002d4c,4,
+0x002d6c,11,
+0x002dac,8,
+0x002dd0,1,
+0x002e04,1,
+0x002e0c,13,
+0x002e44,1,
+0x002e54,3,
+0x002e64,1,
+0x002e6c,8,
+0x002ea8,3,
+0x002ec0,8,
+0x002f00,6,
+0x002f60,4,
+0x002f80,8,
+0x002fb8,8,
+0x002fdc,10,
+0x003008,14,
+0x003080,1,
+0x003088,18,
+0x003100,9,
+0x003134,2,
+0x00314c,4,
+0x00316c,11,
+0x0031ac,8,
+0x0031d0,1,
+0x003204,1,
+0x00320c,13,
+0x003244,1,
+0x003254,3,
+0x003264,1,
+0x00326c,8,
+0x0032a8,3,
+0x0032c0,8,
+0x003300,6,
+0x003360,4,
+0x003380,8,
+0x0033b8,8,
+0x0033dc,10,
+0x003408,14,
+0x003480,1,
+0x003488,18,
+0x003500,9,
+0x003534,2,
+0x00354c,4,
+0x00356c,11,
+0x0035ac,8,
+0x0035d0,1,
+0x003604,1,
+0x00360c,13,
+0x003644,1,
+0x003654,3,
+0x003664,1,
+0x00366c,8,
+0x0036a8,3,
+0x0036c0,8,
+0x003700,6,
+0x003760,4,
+0x003780,8,
+0x0037b8,8,
+0x0037dc,10,
+0x003808,14,
+0x003880,1,
+0x003888,18,
+0x003900,9,
+0x003934,2,
+0x00394c,4,
+0x00396c,11,
+0x0039ac,8,
+0x0039d0,1,
+0x003a04,1,
+0x003a0c,13,
+0x003a44,1,
+0x003a54,3,
+0x003a64,1,
+0x003a6c,8,
+0x003aa8,3,
+0x003ac0,8,
+0x003b00,6,
+0x003b60,4,
+0x003b80,8,
+0x003bb8,8,
+0x003bdc,10,
+0x003c08,14,
+0x003c80,1,
+0x003c88,18,
+0x003d00,9,
+0x003d34,2,
+0x003d4c,4,
+0x003d6c,11,
+0x003dac,8,
+0x003dd0,1,
+0x003e04,1,
+0x003e0c,13,
+0x003e44,1,
+0x003e54,3,
+0x003e64,1,
+0x003e6c,8,
+0x003ea8,3,
+0x003ec0,8,
+0x003f00,6,
+0x003f60,4,
+0x003f80,8,
+0x003fb8,8,
+0x003fdc,10,
+0x004008,14,
+0x004080,1,
+0x004088,18,
+0x004100,9,
+0x004134,2,
+0x00414c,4,
+0x00416c,11,
+0x0041ac,8,
+0x0041d0,1,
+0x004204,1,
+0x00420c,13,
+0x004244,1,
+0x004254,3,
+0x004264,1,
+0x00426c,8,
+0x0042a8,3,
+0x0042c0,8,
+0x004300,6,
+0x004360,4,
+0x004380,8,
+0x0043b8,8,
+0x0043dc,10,
+0x004408,14,
+0x004480,1,
+0x004488,18,
+0x004500,9,
+0x004534,2,
+0x00454c,4,
+0x00456c,11,
+0x0045ac,8,
+0x0045d0,1,
+0x004604,1,
+0x00460c,13,
+0x004644,1,
+0x004654,3,
+0x004664,1,
+0x00466c,8,
+0x0046a8,3,
+0x0046c0,8,
+0x004700,6,
+0x004760,4,
+0x004780,8,
+0x0047b8,8,
+0x0047dc,10,
+0x004808,14,
+0x004880,1,
+0x004888,18,
+0x004900,9,
+0x004934,2,
+0x00494c,4,
+0x00496c,11,
+0x0049ac,8,
+0x0049d0,1,
+0x004a04,1,
+0x004a0c,13,
+0x004a44,1,
+0x004a54,3,
+0x004a64,1,
+0x004a6c,8,
+0x004aa8,3,
+0x004ac0,8,
+0x004b00,6,
+0x004b60,4,
+0x004b80,8,
+0x004bb8,8,
+0x004bdc,10,
+0x004c08,14,
+0x004c80,1,
+0x004c88,18,
+0x004d00,9,
+0x004d34,2,
+0x004d4c,4,
+0x004d6c,11,
+0x004dac,8,
+0x004dd0,1,
+0x004e04,1,
+0x004e0c,13,
+0x004e44,1,
+0x004e54,3,
+0x004e64,1,
+0x004e6c,8,
+0x004ea8,3,
+0x004ec0,8,
+0x004f00,6,
+0x004f60,4,
+0x004f80,8,
+0x004fb8,8,
+0x004fdc,10,
+0x005008,14,
+0x005080,1,
+0x005088,18,
+0x005100,9,
+0x005134,2,
+0x00514c,4,
+0x00516c,11,
+0x0051ac,8,
+0x0051d0,1,
+0x005204,1,
+0x00520c,13,
+0x005244,1,
+0x005254,3,
+0x005264,1,
+0x00526c,8,
+0x0052a8,3,
+0x0052c0,8,
+0x005300,6,
+0x005360,4,
+0x005380,8,
+0x0053b8,8,
+0x0053dc,10,
+0x005428,1,
+0x005450,1,
+0x005478,1,
+0x0054a0,1,
+0x0055ac,1,
+0x0055d8,4,
+0x005600,6,
+0x005620,6,
+0x005640,3,
+0x005800,13,
+0x005840,6,
+0x005860,3,
+0x005880,2,
+0x005904,2,
+0x005918,1,
+0x005940,1,
+0x008400,1,
+0x008408,14,
+0x008480,1,
+0x008488,18,
+0x008500,9,
+0x008534,2,
+0x00854c,4,
+0x00856c,11,
+0x0085ac,8,
+0x0085d0,1,
+0x008604,1,
+0x00860c,13,
+0x008644,1,
+0x008654,3,
+0x008664,1,
+0x00866c,8,
+0x0086a8,3,
+0x0086c0,8,
+0x008700,6,
+0x008760,4,
+0x008780,8,
+0x0087b8,8,
+0x0087dc,10,
+0x008808,14,
+0x008880,1,
+0x008888,18,
+0x008900,9,
+0x008934,2,
+0x00894c,4,
+0x00896c,11,
+0x0089ac,8,
+0x0089d0,1,
+0x008a04,1,
+0x008a0c,13,
+0x008a44,1,
+0x008a54,3,
+0x008a64,1,
+0x008a6c,8,
+0x008aa8,3,
+0x008ac0,8,
+0x008b00,6,
+0x008b60,4,
+0x008b80,8,
+0x008bb8,8,
+0x008bdc,10,
+0x008c08,14,
+0x008c80,1,
+0x008c88,18,
+0x008d00,9,
+0x008d34,2,
+0x008d4c,4,
+0x008d6c,11,
+0x008dac,8,
+0x008dd0,1,
+0x008e04,1,
+0x008e0c,13,
+0x008e44,1,
+0x008e54,3,
+0x008e64,1,
+0x008e6c,8,
+0x008ea8,3,
+0x008ec0,8,
+0x008f00,6,
+0x008f60,4,
+0x008f80,8,
+0x008fb8,8,
+0x008fdc,10,
+0x009008,14,
+0x009080,1,
+0x009088,18,
+0x009100,9,
+0x009134,2,
+0x00914c,4,
+0x00916c,11,
+0x0091ac,8,
+0x0091d0,1,
+0x009204,1,
+0x00920c,13,
+0x009244,1,
+0x009254,3,
+0x009264,1,
+0x00926c,8,
+0x0092a8,3,
+0x0092c0,8,
+0x009300,6,
+0x009360,4,
+0x009380,8,
+0x0093b8,8,
+0x0093dc,10,
+0x009408,14,
+0x009480,1,
+0x009488,18,
+0x009500,9,
+0x009534,2,
+0x00954c,4,
+0x00956c,11,
+0x0095ac,8,
+0x0095d0,1,
+0x009604,1,
+0x00960c,13,
+0x009644,1,
+0x009654,3,
+0x009664,1,
+0x00966c,8,
+0x0096a8,3,
+0x0096c0,8,
+0x009700,6,
+0x009760,4,
+0x009780,8,
+0x0097b8,8,
+0x0097dc,10,
+0x009808,14,
+0x009880,1,
+0x009888,18,
+0x009900,9,
+0x009934,2,
+0x00994c,4,
+0x00996c,11,
+0x0099ac,8,
+0x0099d0,1,
+0x009a04,1,
+0x009a0c,13,
+0x009a44,1,
+0x009a54,3,
+0x009a64,1,
+0x009a6c,8,
+0x009aa8,3,
+0x009ac0,8,
+0x009b00,6,
+0x009b60,4,
+0x009b80,8,
+0x009bb8,8,
+0x009bdc,10,
+0x009c08,14,
+0x009c80,1,
+0x009c88,18,
+0x009d00,9,
+0x009d34,2,
+0x009d4c,4,
+0x009d6c,11,
+0x009dac,8,
+0x009dd0,1,
+0x009e04,1,
+0x009e0c,13,
+0x009e44,1,
+0x009e54,3,
+0x009e64,1,
+0x009e6c,8,
+0x009ea8,3,
+0x009ec0,8,
+0x009f00,6,
+0x009f60,4,
+0x009f80,8,
+0x009fb8,8,
+0x009fdc,10,
+0x00a008,14,
+0x00a080,1,
+0x00a088,18,
+0x00a100,9,
+0x00a134,2,
+0x00a14c,4,
+0x00a16c,11,
+0x00a1ac,8,
+0x00a1d0,1,
+0x00a204,1,
+0x00a20c,13,
+0x00a244,1,
+0x00a254,3,
+0x00a264,1,
+0x00a26c,8,
+0x00a2a8,3,
+0x00a2c0,8,
+0x00a300,6,
+0x00a360,4,
+0x00a380,8,
+0x00a3b8,8,
+0x00a3dc,10,
+0x00a408,14,
+0x00a480,1,
+0x00a488,18,
+0x00a500,9,
+0x00a534,2,
+0x00a54c,4,
+0x00a56c,11,
+0x00a5ac,8,
+0x00a5d0,1,
+0x00a604,1,
+0x00a60c,13,
+0x00a644,1,
+0x00a654,3,
+0x00a664,1,
+0x00a66c,8,
+0x00a6a8,3,
+0x00a6c0,8,
+0x00a700,6,
+0x00a760,4,
+0x00a780,8,
+0x00a7b8,8,
+0x00a7dc,10,
+0x00a808,14,
+0x00a880,1,
+0x00a888,18,
+0x00a900,9,
+0x00a934,2,
+0x00a94c,4,
+0x00a96c,11,
+0x00a9ac,8,
+0x00a9d0,1,
+0x00aa04,1,
+0x00aa0c,13,
+0x00aa44,1,
+0x00aa54,3,
+0x00aa64,1,
+0x00aa6c,8,
+0x00aaa8,3,
+0x00aac0,8,
+0x00ab00,6,
+0x00ab60,4,
+0x00ab80,8,
+0x00abb8,8,
+0x00abdc,10,
+0x00ac08,14,
+0x00ac80,1,
+0x00ac88,18,
+0x00ad00,9,
+0x00ad34,2,
+0x00ad4c,4,
+0x00ad6c,11,
+0x00adac,8,
+0x00add0,1,
+0x00ae04,1,
+0x00ae0c,13,
+0x00ae44,1,
+0x00ae54,3,
+0x00ae64,1,
+0x00ae6c,8,
+0x00aea8,3,
+0x00aec0,8,
+0x00af00,6,
+0x00af60,4,
+0x00af80,8,
+0x00afb8,8,
+0x00afdc,10,
+0x00b008,14,
+0x00b080,1,
+0x00b088,18,
+0x00b100,9,
+0x00b134,2,
+0x00b14c,4,
+0x00b16c,11,
+0x00b1ac,8,
+0x00b1d0,1,
+0x00b204,1,
+0x00b20c,13,
+0x00b244,1,
+0x00b254,3,
+0x00b264,1,
+0x00b26c,8,
+0x00b2a8,3,
+0x00b2c0,8,
+0x00b300,6,
+0x00b360,4,
+0x00b380,8,
+0x00b3b8,8,
+0x00b3dc,10,
+0x00b408,14,
+0x00b480,1,
+0x00b488,18,
+0x00b500,9,
+0x00b534,2,
+0x00b54c,4,
+0x00b56c,11,
+0x00b5ac,8,
+0x00b5d0,1,
+0x00b604,1,
+0x00b60c,13,
+0x00b644,1,
+0x00b654,3,
+0x00b664,1,
+0x00b66c,8,
+0x00b6a8,3,
+0x00b6c0,8,
+0x00b700,6,
+0x00b760,4,
+0x00b780,8,
+0x00b7b8,8,
+0x00b7dc,10,
+0x00b808,14,
+0x00b880,1,
+0x00b888,18,
+0x00b900,9,
+0x00b934,2,
+0x00b94c,4,
+0x00b96c,11,
+0x00b9ac,8,
+0x00b9d0,1,
+0x00ba04,1,
+0x00ba0c,13,
+0x00ba44,1,
+0x00ba54,3,
+0x00ba64,1,
+0x00ba6c,8,
+0x00baa8,3,
+0x00bac0,8,
+0x00bb00,6,
+0x00bb60,4,
+0x00bb80,8,
+0x00bbb8,8,
+0x00bbdc,10,
+0x00bc08,14,
+0x00bc80,1,
+0x00bc88,18,
+0x00bd00,9,
+0x00bd34,2,
+0x00bd4c,4,
+0x00bd6c,11,
+0x00bdac,8,
+0x00bdd0,1,
+0x00be04,1,
+0x00be0c,13,
+0x00be44,1,
+0x00be54,3,
+0x00be64,1,
+0x00be6c,8,
+0x00bea8,3,
+0x00bec0,8,
+0x00bf00,6,
+0x00bf60,4,
+0x00bf80,8,
+0x00bfb8,8,
+0x00bfdc,10,
+0x00c008,14,
+0x00c080,1,
+0x00c088,18,
+0x00c100,9,
+0x00c134,2,
+0x00c14c,4,
+0x00c16c,11,
+0x00c1ac,8,
+0x00c1d0,1,
+0x00c204,1,
+0x00c20c,13,
+0x00c244,1,
+0x00c254,3,
+0x00c264,1,
+0x00c26c,8,
+0x00c2a8,3,
+0x00c2c0,8,
+0x00c300,6,
+0x00c360,4,
+0x00c380,8,
+0x00c3b8,8,
+0x00c3dc,10,
+0x00c408,14,
+0x00c480,1,
+0x00c488,18,
+0x00c500,9,
+0x00c534,2,
+0x00c54c,4,
+0x00c56c,11,
+0x00c5ac,8,
+0x00c5d0,1,
+0x00c604,1,
+0x00c60c,13,
+0x00c644,1,
+0x00c654,3,
+0x00c664,1,
+0x00c66c,8,
+0x00c6a8,3,
+0x00c6c0,8,
+0x00c700,6,
+0x00c760,4,
+0x00c780,8,
+0x00c7b8,8,
+0x00c7dc,10,
+0x00c808,14,
+0x00c880,1,
+0x00c888,18,
+0x00c900,9,
+0x00c934,2,
+0x00c94c,4,
+0x00c96c,11,
+0x00c9ac,8,
+0x00c9d0,1,
+0x00ca04,1,
+0x00ca0c,13,
+0x00ca44,1,
+0x00ca54,3,
+0x00ca64,1,
+0x00ca6c,8,
+0x00caa8,3,
+0x00cac0,8,
+0x00cb00,6,
+0x00cb60,4,
+0x00cb80,8,
+0x00cbb8,8,
+0x00cbdc,10,
+0x00cc08,14,
+0x00cc80,1,
+0x00cc88,18,
+0x00cd00,9,
+0x00cd34,2,
+0x00cd4c,4,
+0x00cd6c,11,
+0x00cdac,8,
+0x00cdd0,1,
+0x00ce04,1,
+0x00ce0c,13,
+0x00ce44,1,
+0x00ce54,3,
+0x00ce64,1,
+0x00ce6c,8,
+0x00cea8,3,
+0x00cec0,8,
+0x00cf00,6,
+0x00cf60,4,
+0x00cf80,8,
+0x00cfb8,8,
+0x00cfdc,10,
+0x00d008,14,
+0x00d080,1,
+0x00d088,18,
+0x00d100,9,
+0x00d134,2,
+0x00d14c,4,
+0x00d16c,11,
+0x00d1ac,8,
+0x00d1d0,1,
+0x00d204,1,
+0x00d20c,13,
+0x00d244,1,
+0x00d254,3,
+0x00d264,1,
+0x00d26c,8,
+0x00d2a8,3,
+0x00d2c0,8,
+0x00d300,6,
+0x00d360,4,
+0x00d380,8,
+0x00d3b8,8,
+0x00d3dc,10,
+0x00d428,1,
+0x00d450,1,
+0x00d478,1,
+0x00d4a0,1,
+0x00d5ac,1,
+0x00d5d8,4,
+0x00d600,6,
+0x00d620,6,
+0x00d640,3,
+0x00d800,13,
+0x00d840,6,
+0x00d860,3,
+0x00d880,2,
+0x00d904,2,
+0x00d918,1,
+0x00d940,1,
+0x010000,1,
+0x010008,10,
+0x010034,16,
+0x010080,33,
+0x010110,5,
+0x010128,2,
+0x010134,1,
+0x01013c,13,
+0x010174,1,
+0x01017c,7,
+0x0101a0,17,
+0x0101e8,3,
+0x010200,1,
+0x010208,10,
+0x010234,16,
+0x010280,33,
+0x010310,5,
+0x010328,2,
+0x010334,1,
+0x01033c,13,
+0x010374,1,
+0x01037c,7,
+0x0103a0,17,
+0x0103e8,3,
+0x010400,1,
+0x010408,10,
+0x010434,16,
+0x010480,33,
+0x010510,5,
+0x010528,2,
+0x010534,1,
+0x01053c,13,
+0x010574,1,
+0x01057c,7,
+0x0105a0,17,
+0x0105e8,3,
+0x010600,1,
+0x010608,10,
+0x010634,16,
+0x010680,33,
+0x010710,5,
+0x010728,2,
+0x010734,1,
+0x01073c,13,
+0x010774,1,
+0x01077c,7,
+0x0107a0,17,
+0x0107e8,3,
+0x010800,1,
+0x010808,10,
+0x010834,16,
+0x010880,33,
+0x010910,5,
+0x010928,2,
+0x010934,1,
+0x01093c,13,
+0x010974,1,
+0x01097c,7,
+0x0109a0,17,
+0x0109e8,3,
+0x010a00,1,
+0x010a08,10,
+0x010a34,16,
+0x010a80,33,
+0x010b10,5,
+0x010b28,2,
+0x010b34,1,
+0x010b3c,13,
+0x010b74,1,
+0x010b7c,7,
+0x010ba0,17,
+0x010be8,3,
+0x010c00,1,
+0x010c08,10,
+0x010c34,16,
+0x010c80,33,
+0x010d10,5,
+0x010d28,2,
+0x010d34,1,
+0x010d3c,13,
+0x010d74,1,
+0x010d7c,7,
+0x010da0,17,
+0x010de8,3,
+0x010e00,1,
+0x010e08,10,
+0x010e34,16,
+0x010e80,33,
+0x010f10,5,
+0x010f28,2,
+0x010f34,1,
+0x010f3c,13,
+0x010f74,1,
+0x010f7c,7,
+0x010fa0,17,
+0x010fe8,3,
+0x011000,1,
+0x011008,10,
+0x011034,16,
+0x011080,33,
+0x011110,5,
+0x011128,2,
+0x011134,1,
+0x01113c,13,
+0x011174,1,
+0x01117c,7,
+0x0111a0,17,
+0x0111e8,3,
+0x011200,1,
+0x011208,10,
+0x011234,16,
+0x011280,33,
+0x011310,5,
+0x011328,2,
+0x011334,1,
+0x01133c,13,
+0x011374,1,
+0x01137c,7,
+0x0113a0,17,
+0x0113e8,3,
+0x011400,1,
+0x011408,10,
+0x011434,16,
+0x011480,33,
+0x011510,5,
+0x011528,2,
+0x011534,1,
+0x01153c,13,
+0x011574,1,
+0x01157c,7,
+0x0115a0,17,
+0x0115e8,3,
+0x011600,1,
+0x011608,10,
+0x011634,16,
+0x011680,33,
+0x011710,5,
+0x011728,2,
+0x011734,1,
+0x01173c,13,
+0x011774,1,
+0x01177c,7,
+0x0117a0,17,
+0x0117e8,3,
+0x011800,1,
+0x011808,10,
+0x011834,16,
+0x011880,33,
+0x011910,5,
+0x011928,2,
+0x011934,1,
+0x01193c,13,
+0x011974,1,
+0x01197c,7,
+0x0119a0,17,
+0x0119e8,3,
+0x011a00,1,
+0x011a08,10,
+0x011a34,16,
+0x011a80,33,
+0x011b10,5,
+0x011b28,2,
+0x011b34,1,
+0x011b3c,13,
+0x011b74,1,
+0x011b7c,7,
+0x011ba0,17,
+0x011be8,3,
+0x011c00,1,
+0x011c08,10,
+0x011c34,16,
+0x011c80,33,
+0x011d10,5,
+0x011d28,2,
+0x011d34,1,
+0x011d3c,13,
+0x011d74,1,
+0x011d7c,7,
+0x011da0,17,
+0x011de8,3,
+0x011e00,1,
+0x011e08,10,
+0x011e34,16,
+0x011e80,33,
+0x011f10,5,
+0x011f28,2,
+0x011f34,1,
+0x011f3c,13,
+0x011f74,1,
+0x011f7c,7,
+0x011fa0,17,
+0x011fe8,3,
+0x012000,1,
+0x012008,10,
+0x012034,16,
+0x012080,33,
+0x012110,5,
+0x012128,2,
+0x012134,1,
+0x01213c,13,
+0x012174,1,
+0x01217c,7,
+0x0121a0,17,
+0x0121e8,3,
+0x012200,1,
+0x012208,10,
+0x012234,16,
+0x012280,33,
+0x012310,5,
+0x012328,2,
+0x012334,1,
+0x01233c,13,
+0x012374,1,
+0x01237c,7,
+0x0123a0,17,
+0x0123e8,3,
+0x012800,2,
+0x01280c,37,
+0x0128a4,64,
+0x012a00,84,
+0x012b54,2,
+0x012b7c,1,
+0x012b84,1,
+0x012b8c,4,
+0x012ba4,1,
+0x012bac,75,
+0x012d00,60,
+0x012dfc,7,
+0x012e20,6,
+0x012e40,6,
+0x012e60,6,
+0x012e80,3,
+0x012f00,14,
+0x012f40,1,
+0x013000,3,
+0x013028,3,
+0x013050,3,
+0x013078,3,
+0x0130a0,6,
+0x0131ac,1,
+0x0131d8,4,
+0x013200,6,
+0x013220,6,
+0x013240,6,
+0x013260,6,
+0x013280,6,
+0x0132a0,6,
+0x0132c0,3,
+0x013400,6,
+0x013420,3,
+0x013440,3,
+0x013500,13,
+0x013540,1,
+0x013900,1,
+0x014000,1,
+0x014008,10,
+0x014034,16,
+0x014080,33,
+0x014110,5,
+0x014128,2,
+0x014134,1,
+0x01413c,13,
+0x014174,1,
+0x01417c,7,
+0x0141a0,17,
+0x0141e8,3,
+0x014200,1,
+0x014208,10,
+0x014234,16,
+0x014280,33,
+0x014310,5,
+0x014328,2,
+0x014334,1,
+0x01433c,13,
+0x014374,1,
+0x01437c,7,
+0x0143a0,17,
+0x0143e8,3,
+0x014400,1,
+0x014408,10,
+0x014434,16,
+0x014480,33,
+0x014510,5,
+0x014528,2,
+0x014534,1,
+0x01453c,13,
+0x014574,1,
+0x01457c,7,
+0x0145a0,17,
+0x0145e8,3,
+0x014600,1,
+0x014608,10,
+0x014634,16,
+0x014680,33,
+0x014710,5,
+0x014728,2,
+0x014734,1,
+0x01473c,13,
+0x014774,1,
+0x01477c,7,
+0x0147a0,17,
+0x0147e8,3,
+0x014800,1,
+0x014808,10,
+0x014834,16,
+0x014880,33,
+0x014910,5,
+0x014928,2,
+0x014934,1,
+0x01493c,13,
+0x014974,1,
+0x01497c,7,
+0x0149a0,17,
+0x0149e8,3,
+0x014a00,1,
+0x014a08,10,
+0x014a34,16,
+0x014a80,33,
+0x014b10,5,
+0x014b28,2,
+0x014b34,1,
+0x014b3c,13,
+0x014b74,1,
+0x014b7c,7,
+0x014ba0,17,
+0x014be8,3,
+0x014c00,1,
+0x014c08,10,
+0x014c34,16,
+0x014c80,33,
+0x014d10,5,
+0x014d28,2,
+0x014d34,1,
+0x014d3c,13,
+0x014d74,1,
+0x014d7c,7,
+0x014da0,17,
+0x014de8,3,
+0x014e00,1,
+0x014e08,10,
+0x014e34,16,
+0x014e80,33,
+0x014f10,5,
+0x014f28,2,
+0x014f34,1,
+0x014f3c,13,
+0x014f74,1,
+0x014f7c,7,
+0x014fa0,17,
+0x014fe8,3,
+0x015000,1,
+0x015008,10,
+0x015034,16,
+0x015080,33,
+0x015110,5,
+0x015128,2,
+0x015134,1,
+0x01513c,13,
+0x015174,1,
+0x01517c,7,
+0x0151a0,17,
+0x0151e8,3,
+0x015200,1,
+0x015208,10,
+0x015234,16,
+0x015280,33,
+0x015310,5,
+0x015328,2,
+0x015334,1,
+0x01533c,13,
+0x015374,1,
+0x01537c,7,
+0x0153a0,17,
+0x0153e8,3,
+0x015400,1,
+0x015408,10,
+0x015434,16,
+0x015480,33,
+0x015510,5,
+0x015528,2,
+0x015534,1,
+0x01553c,13,
+0x015574,1,
+0x01557c,7,
+0x0155a0,17,
+0x0155e8,3,
+0x015600,1,
+0x015608,10,
+0x015634,16,
+0x015680,33,
+0x015710,5,
+0x015728,2,
+0x015734,1,
+0x01573c,13,
+0x015774,1,
+0x01577c,7,
+0x0157a0,17,
+0x0157e8,3,
+0x015800,1,
+0x015808,10,
+0x015834,16,
+0x015880,33,
+0x015910,5,
+0x015928,2,
+0x015934,1,
+0x01593c,13,
+0x015974,1,
+0x01597c,7,
+0x0159a0,17,
+0x0159e8,3,
+0x015a00,1,
+0x015a08,10,
+0x015a34,16,
+0x015a80,33,
+0x015b10,5,
+0x015b28,2,
+0x015b34,1,
+0x015b3c,13,
+0x015b74,1,
+0x015b7c,7,
+0x015ba0,17,
+0x015be8,3,
+0x015c00,1,
+0x015c08,10,
+0x015c34,16,
+0x015c80,33,
+0x015d10,5,
+0x015d28,2,
+0x015d34,1,
+0x015d3c,13,
+0x015d74,1,
+0x015d7c,7,
+0x015da0,17,
+0x015de8,3,
+0x015e00,1,
+0x015e08,10,
+0x015e34,16,
+0x015e80,33,
+0x015f10,5,
+0x015f28,2,
+0x015f34,1,
+0x015f3c,13,
+0x015f74,1,
+0x015f7c,7,
+0x015fa0,17,
+0x015fe8,3,
+0x016000,1,
+0x016008,10,
+0x016034,16,
+0x016080,33,
+0x016110,5,
+0x016128,2,
+0x016134,1,
+0x01613c,13,
+0x016174,1,
+0x01617c,7,
+0x0161a0,17,
+0x0161e8,3,
+0x016200,1,
+0x016208,10,
+0x016234,16,
+0x016280,33,
+0x016310,5,
+0x016328,2,
+0x016334,1,
+0x01633c,13,
+0x016374,1,
+0x01637c,7,
+0x0163a0,17,
+0x0163e8,3,
+0x016800,2,
+0x01680c,37,
+0x0168a4,64,
+0x016a00,84,
+0x016b54,2,
+0x016b7c,1,
+0x016b84,1,
+0x016b8c,4,
+0x016ba4,1,
+0x016bac,75,
+0x016d00,60,
+0x016dfc,7,
+0x016e20,6,
+0x016e40,6,
+0x016e60,6,
+0x016e80,3,
+0x016f00,14,
+0x016f40,1,
+0x017000,3,
+0x017028,3,
+0x017050,3,
+0x017078,3,
+0x0170a0,6,
+0x0171ac,1,
+0x0171d8,4,
+0x017200,6,
+0x017220,6,
+0x017240,6,
+0x017260,6,
+0x017280,6,
+0x0172a0,6,
+0x0172c0,3,
+0x017400,6,
+0x017420,3,
+0x017440,3,
+0x017500,13,
+0x017540,1,
+0x017900,1,
+0x018000,9,
+0x018030,8,
+0x018080,9,
+0x0180b0,8,
+0x018100,9,
+0x018130,8,
+0x018180,9,
+0x0181b0,8,
+0x018200,9,
+0x018230,8,
+0x018280,9,
+0x0182b0,8,
+0x018300,9,
+0x018330,8,
+0x018380,9,
+0x0183b0,8,
+0x018400,9,
+0x018430,8,
+0x018480,9,
+0x0184b0,8,
+0x018500,9,
+0x018530,8,
+0x018580,9,
+0x0185b0,8,
+0x018600,9,
+0x018630,8,
+0x018680,9,
+0x0186b0,8,
+0x018700,9,
+0x018730,8,
+0x018780,9,
+0x0187b0,8,
+0x018800,9,
+0x018830,8,
+0x018880,9,
+0x0188b0,8,
+0x018900,9,
+0x018930,8,
+0x018980,9,
+0x0189b0,8,
+0x018a00,9,
+0x018a30,8,
+0x018a80,9,
+0x018ab0,8,
+0x018b00,9,
+0x018b30,8,
+0x018b80,9,
+0x018bb0,8,
+0x018c00,9,
+0x018c30,8,
+0x018c80,9,
+0x018cb0,8,
+0x018d00,9,
+0x018d30,8,
+0x018d80,9,
+0x018db0,8,
+0x018e00,9,
+0x018e30,8,
+0x018e80,9,
+0x018eb0,8,
+0x018f00,9,
+0x018f30,8,
+0x018f80,9,
+0x018fb0,8,
+0x019000,9,
+0x019030,8,
+0x019080,9,
+0x0190b0,8,
+0x019100,9,
+0x019130,8,
+0x019180,9,
+0x0191b0,8,
+0x019200,6,
+0x019220,3,
+0x019230,10,
+0x019260,3,
+0x019270,10,
+0x0192a0,3,
+0x0192b0,10,
+0x0192e0,3,
+0x0192f0,10,
+0x019320,3,
+0x019330,10,
+0x019360,3,
+0x019370,10,
+0x0193a0,3,
+0x0193b0,10,
+0x0193e0,3,
+0x0193f0,10,
+0x019420,3,
+0x019430,10,
+0x019460,3,
+0x019470,10,
+0x0194a0,3,
+0x0194b0,10,
+0x0194e0,3,
+0x0194f0,10,
+0x019520,3,
+0x019530,10,
+0x019560,3,
+0x019570,10,
+0x0195a0,3,
+0x0195b0,10,
+0x0195e0,3,
+0x0195f0,10,
+0x019620,3,
+0x019630,10,
+0x019660,3,
+0x019670,10,
+0x0196a0,3,
+0x0196b0,10,
+0x0196e0,3,
+0x0196f0,10,
+0x019720,3,
+0x019730,10,
+0x019760,3,
+0x019770,10,
+0x0197a0,3,
+0x0197b0,10,
+0x0197e0,3,
+0x0197f0,10,
+0x019820,3,
+0x019830,10,
+0x019860,3,
+0x019870,10,
+0x0198a0,3,
+0x0198b0,10,
+0x0198e0,3,
+0x0198f0,10,
+0x019920,3,
+0x019930,10,
+0x019960,3,
+0x019970,10,
+0x0199a0,3,
+0x0199b0,10,
+0x0199e0,3,
+0x0199f0,10,
+0x019a20,3,
+0x019a30,10,
+0x019a60,3,
+0x019a70,10,
+0x019aa0,3,
+0x019ab0,10,
+0x019ae0,3,
+0x019af0,4,
+0x01a400,13,
+0x01a440,6,
+0x01a460,3,
+0x01a480,8,
+0x01a4b0,7,
+0x01a4d0,3,
+0x01a500,6,
+0x01a520,6,
+0x01a540,6,
+0x01a560,6,
+0x01a580,6,
+0x01a5a0,6,
+0x01a5c0,6,
+0x01a5e0,6,
+0x01a600,6,
+0x01a620,6,
+0x01a640,6,
+0x01a660,6,
+0x01a680,6,
+0x01a6a0,6,
+0x01a6c0,6,
+0x01a6e0,6,
+0x01a700,6,
+0x01a720,6,
+0x01a740,6,
+0x01a760,6,
+0x01a780,6,
+0x01a7a0,6,
+0x01a7c0,6,
+0x01a7e0,6,
+0x01a800,6,
+0x01a820,6,
+0x01a840,6,
+0x01a860,6,
+0x01a880,6,
+0x01a8a0,6,
+0x01a8c0,6,
+0x01a8e0,6,
+0x01a900,6,
+0x01a920,6,
+0x01a940,6,
+0x01a960,6,
+0x01ab00,6,
+0x01ab20,3,
+0x01ab30,10,
+0x01ab60,3,
+0x01ab70,10,
+0x01aba0,3,
+0x01abb0,10,
+0x01abe0,3,
+0x01abf0,9,
+0x01acf4,3,
+0x01b000,38,
+0x01b100,37,
+0x01b200,18,
+0x01b400,6,
+0x01b420,6,
+0x01b440,6,
+0x01b460,6,
+0x01b480,6,
+0x01b4a0,6,
+0x01b4c0,6,
+0x01b4e0,6,
+0x01b500,6,
+0x01b520,6,
+0x01b540,6,
+0x01b560,6,
+0x01b580,6,
+0x01b5a0,6,
+0x01b5c0,6,
+0x01b5e0,6,
+0x01b600,6,
+0x01b620,6,
+0x01b640,3,
+0x01b800,6,
+0x01b820,6,
+0x01b840,6,
+0x01b860,6,
+0x01b880,6,
+0x01b8a0,6,
+0x01b8c0,6,
+0x01b8e0,6,
+0x01b900,6,
+0x01b920,6,
+0x01b940,6,
+0x01b960,6,
+0x01b980,6,
+0x01b9a0,6,
+0x01b9c0,6,
+0x01b9e0,6,
+0x01ba00,6,
+0x01ba20,6,
+0x01ba40,6,
+0x01ba60,3,
+0x01bc00,2,
+0x01c000,22,
+0x01c060,3,
+0x01c070,26,
+0x01c0e0,3,
+0x01c0f0,26,
+0x01c160,3,
+0x01c170,26,
+0x01c1e0,3,
+0x01c1f0,26,
+0x01c260,3,
+0x01c270,26,
+0x01c2e0,3,
+0x01c2f0,26,
+0x01c360,3,
+0x01c370,26,
+0x01c3e0,3,
+0x01c3f0,26,
+0x01c460,3,
+0x01c470,26,
+0x01c4e0,3,
+0x01c4f0,26,
+0x01c560,3,
+0x01c570,26,
+0x01c5e0,3,
+0x01c5f0,26,
+0x01c660,3,
+0x01c670,26,
+0x01c6e0,3,
+0x01c6f0,26,
+0x01c760,3,
+0x01c770,26,
+0x01c7e0,3,
+0x01c7f0,26,
+0x01c860,3,
+0x01c870,26,
+0x01c8e0,3,
+0x01c8f0,26,
+0x01c960,3,
+0x01c970,26,
+0x01c9e0,3,
+0x01c9f0,26,
+0x01ca60,3,
+0x01ca70,26,
+0x01cae0,3,
+0x01caf0,26,
+0x01cb60,3,
+0x01cb70,26,
+0x01cbe0,3,
+0x01cbf0,26,
+0x01cc60,3,
+0x01cc70,26,
+0x01cce0,3,
+0x01ccf0,26,
+0x01cd60,3,
+0x01cd70,26,
+0x01cde0,3,
+0x01cdf0,26,
+0x01ce60,3,
+0x01ce70,26,
+0x01cee0,3,
+0x01cef0,26,
+0x01cf60,3,
+0x01cf70,26,
+0x01cfe0,3,
+0x01cff0,26,
+0x01d060,3,
+0x01d070,26,
+0x01d0e0,3,
+0x01d0f0,26,
+0x01d160,3,
+0x01d170,26,
+0x01d1e0,3,
+0x01d1f0,6,
+0x01d800,6,
+0x01d820,4,
+0x01d840,8,
+0x01d87c,7,
+0x01d8a0,4,
+0x01d8c0,8,
+0x01d8fc,7,
+0x01d920,4,
+0x01d940,8,
+0x01d97c,7,
+0x01d9a0,4,
+0x01d9c0,8,
+0x01d9fc,7,
+0x01da20,4,
+0x01da40,8,
+0x01da7c,7,
+0x01daa0,4,
+0x01dac0,8,
+0x01dafc,7,
+0x01db20,4,
+0x01db40,8,
+0x01db7c,7,
+0x01dba0,4,
+0x01dbc0,8,
+0x01dbfc,7,
+0x01dc20,4,
+0x01dc40,8,
+0x01dc7c,7,
+0x01dca0,4,
+0x01dcc0,8,
+0x01dcfc,7,
+0x01dd20,4,
+0x01dd40,8,
+0x01dd7c,7,
+0x01dda0,4,
+0x01ddc0,8,
+0x01ddfc,7,
+0x01de20,4,
+0x01de40,8,
+0x01de7c,7,
+0x01dea0,4,
+0x01dec0,8,
+0x01defc,7,
+0x01df20,4,
+0x01df40,8,
+0x01df7c,7,
+0x01dfa0,4,
+0x01dfc0,8,
+0x01dffc,7,
+0x01e020,4,
+0x01e040,8,
+0x01e07c,7,
+0x01e0a0,4,
+0x01e0c0,8,
+0x01e0fc,7,
+0x01e120,4,
+0x01e140,8,
+0x01e17c,7,
+0x01e1a0,4,
+0x01e1c0,8,
+0x01e1fc,7,
+0x01e220,4,
+0x01e240,8,
+0x01e27c,7,
+0x01e2a0,4,
+0x01e2c0,8,
+0x01e2fc,7,
+0x01e320,4,
+0x01e340,8,
+0x01e37c,7,
+0x01e3a0,4,
+0x01e3c0,8,
+0x01e3fc,7,
+0x01e420,4,
+0x01e440,8,
+0x01e47c,7,
+0x01e4a0,4,
+0x01e4c0,8,
+0x01e4fc,7,
+0x01e520,4,
+0x01e540,8,
+0x01e57c,7,
+0x01e5a0,4,
+0x01e5c0,8,
+0x01e5fc,7,
+0x01e620,4,
+0x01e640,8,
+0x01e67c,7,
+0x01e6a0,4,
+0x01e6c0,8,
+0x01e6fc,7,
+0x01e720,4,
+0x01e740,8,
+0x01e77c,7,
+0x01e7a0,4,
+0x01e7c0,8,
+0x01e7fc,7,
+0x01e820,4,
+0x01e840,8,
+0x01e87c,7,
+0x01e8a0,4,
+0x01e8c0,8,
+0x01e8fc,7,
+0x01e920,4,
+0x01e940,8,
+0x01e97c,7,
+0x01e9a0,4,
+0x01e9c0,8,
+0x01e9fc,7,
+0x01ea20,4,
+0x01ea40,8,
+0x01ea7c,7,
+0x01eaa0,4,
+0x01eac0,8,
+0x01eafc,1,
+0x01f408,13,
+0x01f440,1,
+0x01f448,1,
+0x01f45c,4,
+0x01f470,10,
+0x01f4a0,6,
+0x01f4c0,6,
+0x01f4e0,3,
+0x01f800,4,
+0x01f828,4,
+0x01f850,4,
+0x01f878,4,
+0x01f8a0,4,
+0x01f9ac,1,
+0x01f9d8,4,
+0x01fa00,6,
+0x01fa20,6,
+0x01fa40,6,
+0x01fa60,6,
+0x01fa80,6,
+0x01faa0,6,
+0x01fac0,6,
+0x01fae0,6,
+0x01fb00,3,
+0x01fc00,13,
+0x01fc40,3,
+0x01fc50,6,
+0x01fc6c,1,
+0x01fc80,6,
+0x01fca0,6,
+0x01fcc0,6,
+0x01fce0,3,
+0x01fd00,1,
+0x01fd80,6,
+0x01fda0,6,
+0x01fdc0,6,
+0x01fde0,3,
+0x01fe00,1,
+0x01fe08,4,
+0x01fffc,1,
+0x049000,6,
+0x049020,20,
+0x049080,10,
+0x0490b0,1,
+0x0490c0,3,
+0x0490d0,3,
+0x049100,2,
+0x049110,3,
+0x049120,4,
+0x049140,7,
+0x049160,7,
+0x049180,3,
+0x049190,1,
+0x049200,6,
+0x049220,20,
+0x049280,10,
+0x0492b0,1,
+0x0492c0,3,
+0x0492d0,3,
+0x049300,2,
+0x049310,3,
+0x049320,4,
+0x049340,7,
+0x049360,7,
+0x049380,3,
+0x049390,1,
+0x049400,6,
+0x049420,20,
+0x049480,10,
+0x0494b0,1,
+0x0494c0,3,
+0x0494d0,3,
+0x049500,2,
+0x049510,3,
+0x049520,4,
+0x049540,7,
+0x049560,7,
+0x049580,3,
+0x049590,1,
+0x049608,2,
+0x049620,1,
+0x049648,2,
+0x049660,1,
+0x049688,2,
+0x0496a0,1,
+0x0496c8,2,
+0x0496e0,1,
+0x049708,2,
+0x049720,1,
+0x049748,2,
+0x049760,1,
+0x049788,2,
+0x0497a0,1,
+0x0497c8,2,
+0x0497e0,1,
+0x049804,28,
+0x049880,3,
+0x0498a0,2,
+0x0498c0,1,
+0x0498e0,3,
+0x049a00,13,
+0x049a40,2,
+0x049a4c,4,
+0x050400,11,
+0x050430,6,
+0x050460,3,
+0x0504a0,3,
+0x050700,13,
+0x050740,7,
+0x050760,7,
+0x051800,162,
+0x051a90,2,
+0x051aa0,2,
+0x051c00,8,
+0x051d00,26,
+0x051d84,1,
+0x051d94,9,
+0x051e00,16,
+0x058400,12,
+0x058440,7,
+0x058460,2,
+0x058480,12,
+0x0584c0,7,
+0x0584e0,2,
+0x058500,6,
+0x058520,6,
+0x058540,3,
+0x058584,1,
+0x058590,9,
+0x0585e0,7,
+0x058600,10,
+0x058640,10,
+0x058680,15,
+0x0586d8,9,
+0x058800,6,
+0x058820,6,
+0x058840,6,
+0x058860,6,
+0x058880,6,
+0x0588a0,6,
+0x0588c0,6,
+0x0588e0,6,
+0x058900,3,
+0x058a00,6,
+0x058b00,6,
+0x058b20,6,
+0x058b40,6,
+0x058b60,6,
+0x058b80,6,
+0x058ba0,6,
+0x058bc0,3,
+0x060000,32,
+0x060200,64,
+0x060400,96,
+0x060600,2,
+0x060800,96,
+0x060a00,2,
+0x060c20,8,
+0x060f80,6,
+0x060fa0,7,
+0x060fd8,2,
+0x060fe4,1,
+0x060ff0,10,
+0x061020,16,
+0x061084,1,
+0x0610c0,16,
+0x061204,1,
+0x061220,8,
+0x061250,3,
+0x061260,5,
+0x061280,6,
+0x0612a0,6,
+0x061300,3,
+0x061310,2,
+0x061320,2,
+0x061330,1,
+0x061340,3,
+0x062000,16,
+0x062060,7,
+0x062080,5,
+0x062100,2,
+0x06210c,2,
+0x062118,1,
+0x062120,1,
+0x062180,10,
+0x0621b0,2,
+0x0621c0,2,
+0x0621d0,5,
+0x062200,3,
+0x062210,3,
+0x062280,4,
+0x063600,5,
+0x063620,14,
+0x063660,5,
+0x063684,1,
+0x06368c,10,
+0x063700,1,
+0x063800,5,
+0x063820,12,
+0x063860,5,
+0x063884,1,
+0x06388c,10,
+0x063904,1,
+0x06390c,5,
+0x063940,1,
+0x063950,2,
+0x0639fc,1,
+0x064000,5,
+0x064020,1,
+0x064030,1,
+0x064040,1,
+0x064050,1,
+0x064060,1,
+0x064070,1,
+0x064080,1,
+0x064090,1,
+0x0640a0,1,
+0x0640b0,1,
+0x0640c0,1,
+0x0640d0,1,
+0x0640e0,1,
+0x0640f0,1,
+0x064100,1,
+0x064110,1,
+0x064120,1,
+0x064130,1,
+0x064140,1,
+0x064150,1,
+0x064160,1,
+0x064170,1,
+0x064180,1,
+0x064190,1,
+0x0641a0,1,
+0x0641b0,1,
+0x0641c0,1,
+0x0641d0,1,
+0x0641e0,1,
+0x0641f0,1,
+0x064200,1,
+0x064210,1,
+0x064220,1,
+0x064230,1,
+0x064240,1,
+0x064250,1,
+0x064260,1,
+0x064270,1,
+0x064280,1,
+0x064290,1,
+0x0642a0,1,
+0x0642b0,1,
+0x0642c0,1,
+0x0642d0,1,
+0x0642e0,1,
+0x0642f0,1,
+0x064300,1,
+0x064310,1,
+0x064320,1,
+0x064330,1,
+0x064340,1,
+0x064350,1,
+0x064360,1,
+0x064370,1,
+0x064380,1,
+0x064390,1,
+0x0643a0,1,
+0x0643b0,1,
+0x0643c0,1,
+0x0643d0,1,
+0x0643e0,1,
+0x0643f0,1,
+0x064400,1,
+0x064410,1,
+0x064420,1,
+0x064430,1,
+0x064440,1,
+0x064450,1,
+0x064460,1,
+0x064470,1,
+0x064480,1,
+0x064490,1,
+0x0644a0,1,
+0x0644b0,1,
+0x0644c0,1,
+0x0644d0,1,
+0x0644e0,1,
+0x0644f0,1,
+0x064500,1,
+0x064510,1,
+0x064520,1,
+0x064530,1,
+0x064540,1,
+0x064550,1,
+0x064560,1,
+0x064570,1,
+0x064580,1,
+0x064590,1,
+0x0645a0,1,
+0x0645b0,1,
+0x0645c0,1,
+0x0645d0,1,
+0x0645e0,1,
+0x0645f0,1,
+0x064600,1,
+0x064610,1,
+0x064620,1,
+0x064630,1,
+0x064640,1,
+0x064650,1,
+0x064660,1,
+0x064670,1,
+0x064680,1,
+0x064690,1,
+0x0646a0,1,
+0x0646b0,1,
+0x0646c0,1,
+0x0646d0,1,
+0x0646e0,1,
+0x0646f0,1,
+0x064700,1,
+0x064710,1,
+0x064720,1,
+0x064730,1,
+0x064740,1,
+0x064750,1,
+0x064760,1,
+0x064770,1,
+0x064780,1,
+0x064790,1,
+0x0647a0,1,
+0x0647b0,1,
+0x0647c0,1,
+0x0647d0,1,
+0x0647e0,1,
+0x0647f0,1,
+0x064800,1,
+0x064810,1,
+0x064820,1,
+0x064830,1,
+0x064840,1,
+0x064850,1,
+0x064860,1,
+0x064870,1,
+0x064880,1,
+0x064890,1,
+0x0648a0,1,
+0x0648b0,1,
+0x0648c0,1,
+0x0648d0,1,
+0x0648e0,1,
+0x0648f0,1,
+0x064900,1,
+0x064910,1,
+0x064920,1,
+0x064930,1,
+0x064940,1,
+0x064950,1,
+0x064960,1,
+0x064970,1,
+0x064980,1,
+0x064990,1,
+0x0649a0,1,
+0x0649b0,1,
+0x0649c0,1,
+0x0649d0,1,
+0x0649e0,1,
+0x0649f0,1,
+0x064a00,1,
+0x064a10,1,
+0x064a20,1,
+0x064a30,1,
+0x064a40,1,
+0x064a50,1,
+0x064a60,1,
+0x064a70,1,
+0x064a80,1,
+0x064a90,1,
+0x064aa0,1,
+0x064ab0,1,
+0x064ac0,1,
+0x064ad0,1,
+0x064ae0,1,
+0x064af0,1,
+0x064b00,1,
+0x064b10,1,
+0x064b20,1,
+0x064b30,1,
+0x064b40,1,
+0x064b50,1,
+0x064b60,1,
+0x064b70,1,
+0x064b80,1,
+0x064b90,1,
+0x064ba0,1,
+0x064bb0,1,
+0x064bc0,1,
+0x064bd0,1,
+0x064be0,1,
+0x064bf0,1,
+0x064c00,1,
+0x064c10,1,
+0x064c20,1,
+0x064c30,1,
+0x064c40,1,
+0x064c50,1,
+0x064c60,1,
+0x064c70,1,
+0x064c80,1,
+0x064c90,1,
+0x064ca0,1,
+0x064cb0,1,
+0x064cc0,1,
+0x064cd0,1,
+0x064ce0,1,
+0x064cf0,1,
+0x064d00,1,
+0x064d10,1,
+0x064d20,1,
+0x064d30,1,
+0x064d40,1,
+0x064d50,1,
+0x064d60,1,
+0x064d70,1,
+0x064d80,1,
+0x064d90,1,
+0x064da0,1,
+0x064db0,1,
+0x064dc0,1,
+0x064dd0,1,
+0x064de0,1,
+0x064df0,1,
+0x064e00,1,
+0x064e10,1,
+0x064e20,1,
+0x064e30,1,
+0x064e40,1,
+0x064e50,1,
+0x064e60,1,
+0x064e70,1,
+0x064e80,1,
+0x064e90,1,
+0x064ea0,1,
+0x064eb0,1,
+0x064ec0,1,
+0x064ed0,1,
+0x064ee0,1,
+0x064ef0,1,
+0x064f00,1,
+0x064f10,1,
+0x064f20,1,
+0x064f30,1,
+0x064f40,1,
+0x064f50,1,
+0x064f60,1,
+0x064f70,1,
+0x064f80,1,
+0x064f90,1,
+0x064fa0,1,
+0x064fb0,1,
+0x064fc0,1,
+0x064fd0,1,
+0x064fe0,1,
+0x064ff0,1,
+0x065000,8,
+0x066000,5,
+0x066020,1,
+0x066030,1,
+0x066040,1,
+0x066050,1,
+0x066060,1,
+0x066070,1,
+0x066080,1,
+0x066090,1,
+0x0660a0,1,
+0x0660b0,1,
+0x0660c0,1,
+0x0660d0,1,
+0x0660e0,1,
+0x0660f0,1,
+0x066100,1,
+0x066110,1,
+0x066120,1,
+0x066130,1,
+0x066140,1,
+0x066150,1,
+0x066160,1,
+0x066170,1,
+0x066180,1,
+0x066190,1,
+0x0661a0,1,
+0x0661b0,1,
+0x0661c0,1,
+0x0661d0,1,
+0x0661e0,1,
+0x0661f0,1,
+0x066200,1,
+0x066210,1,
+0x066220,1,
+0x066230,1,
+0x066240,1,
+0x066250,1,
+0x066260,1,
+0x066270,1,
+0x066280,1,
+0x066290,1,
+0x0662a0,1,
+0x0662b0,1,
+0x0662c0,1,
+0x0662d0,1,
+0x0662e0,1,
+0x0662f0,1,
+0x066300,1,
+0x066310,1,
+0x066320,1,
+0x066330,1,
+0x066340,1,
+0x066350,1,
+0x066360,1,
+0x066370,1,
+0x066380,1,
+0x066390,1,
+0x0663a0,1,
+0x0663b0,1,
+0x0663c0,1,
+0x0663d0,1,
+0x0663e0,1,
+0x0663f0,1,
+0x066400,1,
+0x066410,1,
+0x066420,1,
+0x066430,1,
+0x066440,1,
+0x066450,1,
+0x066460,1,
+0x066470,1,
+0x066480,1,
+0x066490,1,
+0x0664a0,1,
+0x0664b0,1,
+0x0664c0,1,
+0x0664d0,1,
+0x0664e0,1,
+0x0664f0,1,
+0x066500,1,
+0x066510,1,
+0x066520,1,
+0x066530,1,
+0x066540,1,
+0x066550,1,
+0x066560,1,
+0x066570,1,
+0x066580,1,
+0x066590,1,
+0x0665a0,1,
+0x0665b0,1,
+0x0665c0,1,
+0x0665d0,1,
+0x0665e0,1,
+0x0665f0,1,
+0x066600,1,
+0x066610,1,
+0x066620,1,
+0x066630,1,
+0x066640,1,
+0x066650,1,
+0x066660,1,
+0x066670,1,
+0x066680,1,
+0x066690,1,
+0x0666a0,1,
+0x0666b0,1,
+0x0666c0,1,
+0x0666d0,1,
+0x0666e0,1,
+0x0666f0,1,
+0x066700,1,
+0x066710,1,
+0x066720,1,
+0x066730,1,
+0x066740,1,
+0x066750,1,
+0x066760,1,
+0x066770,1,
+0x066780,1,
+0x066790,1,
+0x0667a0,1,
+0x0667b0,1,
+0x0667c0,1,
+0x0667d0,1,
+0x0667e0,1,
+0x0667f0,1,
+0x066800,1,
+0x066810,1,
+0x066820,1,
+0x066830,1,
+0x066840,1,
+0x066850,1,
+0x066860,1,
+0x066870,1,
+0x066880,1,
+0x066890,1,
+0x0668a0,1,
+0x0668b0,1,
+0x0668c0,1,
+0x0668d0,1,
+0x0668e0,1,
+0x0668f0,1,
+0x066900,1,
+0x066910,1,
+0x066920,1,
+0x066930,1,
+0x066940,1,
+0x066950,1,
+0x066960,1,
+0x066970,1,
+0x066980,1,
+0x066990,1,
+0x0669a0,1,
+0x0669b0,1,
+0x0669c0,1,
+0x0669d0,1,
+0x0669e0,1,
+0x0669f0,1,
+0x066a00,1,
+0x066a10,1,
+0x066a20,1,
+0x066a30,1,
+0x066a40,1,
+0x066a50,1,
+0x066a60,1,
+0x066a70,1,
+0x066a80,1,
+0x066a90,1,
+0x066aa0,1,
+0x066ab0,1,
+0x066ac0,1,
+0x066ad0,1,
+0x066ae0,1,
+0x066af0,1,
+0x066b00,1,
+0x066b10,1,
+0x066b20,1,
+0x066b30,1,
+0x066b40,1,
+0x066b50,1,
+0x066b60,1,
+0x066b70,1,
+0x066b80,1,
+0x066b90,1,
+0x066ba0,1,
+0x066bb0,1,
+0x066bc0,1,
+0x066bd0,1,
+0x066be0,1,
+0x066bf0,1,
+0x066c00,1,
+0x066c10,1,
+0x066c20,1,
+0x066c30,1,
+0x066c40,1,
+0x066c50,1,
+0x066c60,1,
+0x066c70,1,
+0x066c80,1,
+0x066c90,1,
+0x066ca0,1,
+0x066cb0,1,
+0x066cc0,1,
+0x066cd0,1,
+0x066ce0,1,
+0x066cf0,1,
+0x066d00,1,
+0x066d10,1,
+0x066d20,1,
+0x066d30,1,
+0x066d40,1,
+0x066d50,1,
+0x066d60,1,
+0x066d70,1,
+0x066d80,1,
+0x066d90,1,
+0x066da0,1,
+0x066db0,1,
+0x066dc0,1,
+0x066dd0,1,
+0x066de0,1,
+0x066df0,1,
+0x066e00,1,
+0x066e10,1,
+0x066e20,1,
+0x066e30,1,
+0x066e40,1,
+0x066e50,1,
+0x066e60,1,
+0x066e70,1,
+0x066e80,1,
+0x066e90,1,
+0x066ea0,1,
+0x066eb0,1,
+0x066ec0,1,
+0x066ed0,1,
+0x066ee0,1,
+0x066ef0,1,
+0x066f00,1,
+0x066f10,1,
+0x066f20,1,
+0x066f30,1,
+0x066f40,1,
+0x066f50,1,
+0x066f60,1,
+0x066f70,1,
+0x066f80,1,
+0x066f90,1,
+0x066fa0,1,
+0x066fb0,1,
+0x066fc0,1,
+0x066fd0,1,
+0x066fe0,1,
+0x066ff0,1,
+0x067000,16,
+0x067100,8,
+0x067124,7,
+0x067144,7,
+0x067200,3,
+0x0677f8,2,
+0x06f008,2,
+0x06f014,11,
+0x06f044,1,
+0x06f04c,3,
+0x06f05c,1,
+0x06f064,1,
+0x06f07c,1,
+0x06f500,2,
+0x06f518,1,
+0x06f520,3,
+0x06f540,6,
+0x06f580,10,
+0x06f800,2,
+0x070000,4,
+0x070020,25,
+0x070088,8,
+0x070100,6,
+0x070120,7,
+0x070140,4,
+0x070200,24,
+0x070280,1,
+0x070288,4,
+0x070300,37,
+0x070b00,14,
+0x070b40,14,
+0x070b84,1,
+0x070c00,1,
+0x070c10,3,
+0x070c3c,3,
+0x070c50,8,
+0x071000,7,
+0x072000,7,
+0x073000,114,
+0x0731d0,3,
+0x0731e0,3,
+0x0731f0,3,
+0x073200,2,
+0x073210,7,
+0x073230,1,
+0x073240,48,
+0x073338,15,
+0x074000,8,
+0x074044,3,
+0x074060,4,
+0x074080,8,
+0x075000,1025,
+0x07600c,1,
+0x07f000,2,
+0x07f028,2,
+0x07f050,2,
+0x07f078,2,
+0x07f0a0,23,
+0x07f1ac,1,
+0x07f1d8,4,
+0x07f200,6,
+0x07f220,6,
+0x07f240,6,
+0x07f260,6,
+0x07f280,3,
+0x07fa00,6,
+0x07fb00,7,
+0x07fb20,7,
+0x07fb40,7,
+0x07fb60,1,
+0x07fb70,1,
+0x07fb80,7,
+0x07fc00,3,
+0x080000,32771,
+0x0a0010,2,
+0x0a001c,6,
+0x0a0038,2,
+0x0a0048,2,
+0x0a0058,2,
+0x0a0064,16,
+0x0a00ac,14,
+0x0a00f0,1,
+0x0a00fc,35,
+0x0a01e0,1,
+0x0a01e8,5,
+0x0a0200,3,
+0x0a0210,2,
+0x0a021c,6,
+0x0a0238,2,
+0x0a0248,2,
+0x0a0258,2,
+0x0a0264,16,
+0x0a02ac,14,
+0x0a02f0,1,
+0x0a02fc,35,
+0x0a03e0,1,
+0x0a03e8,5,
+0x0a0400,3,
+0x0a0410,2,
+0x0a041c,6,
+0x0a0438,2,
+0x0a0448,2,
+0x0a0458,2,
+0x0a0464,16,
+0x0a04ac,14,
+0x0a04f0,1,
+0x0a04fc,35,
+0x0a05e0,1,
+0x0a05e8,5,
+0x0a0600,3,
+0x0a0610,2,
+0x0a061c,6,
+0x0a0638,2,
+0x0a0648,2,
+0x0a0658,2,
+0x0a0664,16,
+0x0a06ac,14,
+0x0a06f0,1,
+0x0a06fc,35,
+0x0a07e0,1,
+0x0a07e8,5,
+0x0a0800,3,
+0x0a0810,2,
+0x0a081c,6,
+0x0a0838,2,
+0x0a0848,2,
+0x0a0858,2,
+0x0a0864,16,
+0x0a08ac,14,
+0x0a08f0,1,
+0x0a08fc,35,
+0x0a09e0,1,
+0x0a09e8,5,
+0x0a0a00,3,
+0x0a0a10,2,
+0x0a0a1c,6,
+0x0a0a38,2,
+0x0a0a48,2,
+0x0a0a58,2,
+0x0a0a64,16,
+0x0a0aac,14,
+0x0a0af0,1,
+0x0a0afc,35,
+0x0a0be0,1,
+0x0a0be8,5,
+0x0a0c00,3,
+0x0a0c10,2,
+0x0a0c1c,6,
+0x0a0c38,2,
+0x0a0c48,2,
+0x0a0c58,2,
+0x0a0c64,16,
+0x0a0cac,14,
+0x0a0cf0,1,
+0x0a0cfc,35,
+0x0a0de0,1,
+0x0a0de8,5,
+0x0a0e00,3,
+0x0a0e10,2,
+0x0a0e1c,6,
+0x0a0e38,2,
+0x0a0e48,2,
+0x0a0e58,2,
+0x0a0e64,16,
+0x0a0eac,14,
+0x0a0ef0,1,
+0x0a0efc,35,
+0x0a0fe0,1,
+0x0a0fe8,5,
+0x0a1000,128,
+0x0a1208,2,
+0x0a1218,2,
+0x0a1404,17,
+0x0a1484,1,
+0x0a14a0,17,
+0x0a1504,1,
+0x0a1540,17,
+0x0a15e0,8,
+0x0a1604,3,
+0x0a1700,33,
+0x0a1800,6,
+0x0a1820,10,
+0x0a1870,1,
+0x0a1c00,2,
+0x0a1c28,2,
+0x0a1c50,2,
+0x0a1c78,2,
+0x0a1ca0,7,
+0x0a1dac,1,
+0x0a1dd8,4,
+0x0a1e00,6,
+0x0a1e20,6,
+0x0a1e40,6,
+0x0a1e60,6,
+0x0a1e80,3,
+0x0a2010,2,
+0x0a201c,1,
+0x0a2028,2,
+0x0a2040,8,
+0x0a2064,5,
+0x0a20d0,8,
+0x0a20f4,22,
+0x0a2150,3,
+0x0a2160,8,
+0x0a2184,3,
+0x0a21a0,8,
+0x0a2200,4,
+0x0a2218,52,
+0x0a2300,8,
+0x0a2330,3,
+0x0a2600,1,
+0x0a2800,6,
+0x0a2820,6,
+0x0a2840,6,
+0x0a2860,6,
+0x0a2880,3,
+0x0a2900,6,
+0x0a2920,6,
+0x0a2940,3,
+0x0a2980,6,
+0x0a29a0,6,
+0x0a29c0,6,
+0x0a29e0,3,
+0x0a2a00,6,
+0x0a2a20,3,
+0x0a2a30,1,
+0x0a3120,6,
+0x0a3140,6,
+0x0a3160,6,
+0x0a3180,6,
+0x0a31a0,6,
+0x0a31c0,6,
+0x0a3604,2,
+0x0a3700,16,
+0x0a3a00,1,
+0x0a3b00,8,
+0x0a8000,8192,
+0x0c1000,1,
+0x0c1028,1,
+0x0c1050,1,
+0x0c1078,1,
+0x0c10a0,9,
+0x0c11ac,1,
+0x0c11d8,4,
+0x0c1200,6,
+0x0c1220,6,
+0x0c1240,3,
+0x0c1400,6,
+0x0c1420,3,
+0x0c1500,13,
+0x0c1540,3,
+0x0c2000,14,
+0x0c2070,3,
+0x0c2080,6,
+0x0c2100,9,
+0x0c2204,1,
+0x0c220c,6,
+0x0c2240,13,
+0x0c2280,16,
+0x0c2400,8,
+0x0c2424,15,
+0x0c2464,15,
+0x0c24a4,15,
+0x0c24e4,30,
+0x0c2580,10,
+0x0c25ac,1,
+0x0c25b4,5,
+0x0c25cc,1,
+0x0c25d4,5,
+0x0c25ec,1,
+0x0c25f4,13,
+0x0c2680,4,
+0x0c2694,2,
+0x0c26a0,5,
+0x0c26c0,5,
+0x0c26e0,4,
+0x0c2800,19,
+0x0c2850,10,
+0x0c2880,19,
+0x0c28d0,10,
+0x0c2900,19,
+0x0c2950,10,
+0x0c2980,19,
+0x0c29d0,10,
+0x0c2a00,19,
+0x0c2a50,10,
+0x0c2a80,19,
+0x0c2ad0,10,
+0x0c2b00,19,
+0x0c2b50,10,
+0x0c2b80,19,
+0x0c2bd0,10,
+0x0c2c00,19,
+0x0c2c60,6,
+0x0c2c84,1,
+0x0c2c94,8,
+0x0c2cb8,9,
+0x0c2ce0,4,
+0x0c3000,29,
+0x0c3078,4,
+0x0c3090,2,
+0x0c30a0,7,
+0x0c30c0,11,
+0x0c3100,14,
+0x0c3140,14,
+0x0c3180,61,
+0x0c3278,4,
+0x0c3290,2,
+0x0c32a0,7,
+0x0c32c0,11,
+0x0c3300,14,
+0x0c3340,14,
+0x0c3380,61,
+0x0c3478,4,
+0x0c3490,2,
+0x0c34a0,7,
+0x0c34c0,11,
+0x0c3500,14,
+0x0c3540,14,
+0x0c3580,61,
+0x0c3678,4,
+0x0c3690,2,
+0x0c36a0,7,
+0x0c36c0,11,
+0x0c3700,14,
+0x0c3740,14,
+0x0c3780,67,
+0x0c3890,1,
+0x0c3a00,8,
+0x0c3a24,15,
+0x0c3a64,30,
+0x0c3b00,4,
+0x0c3b20,2,
+0x0c3c00,6,
+0x0c3c40,14,
+0x0c3c80,9,
+0x0c3d00,9,
+0x0c3d2c,1,
+0x0c3d40,3,
+0x0c3d60,1,
+0x0c3d80,3,
+0x0c3e00,2,
+0x0c3e0c,1,
+0x0c3e14,5,
+0x0c3e2c,1,
+0x0c3e34,5,
+0x0c3e4c,1,
+0x0c3e54,5,
+0x0c3e6c,1,
+0x0c3e74,5,
+0x0c3e8c,1,
+0x0c3e94,5,
+0x0c3eac,1,
+0x0c3eb4,3,
+0x0c8000,25,
+0x0c8068,4,
+0x0c807c,4,
+0x0c80a0,3,
+0x0c80b0,2,
+0x0c80c8,6,
+0x0c8180,6,
+0x0ca000,3,
+0x0ca010,21,
+0x0ca068,14,
+0x0ca0a4,2,
+0x0ca0b0,2,
+0x0ca0c0,14,
+0x0ca100,12,
+0x0ca140,4,
+0x0ca160,1,
+0x0ca184,1,
+0x0ca194,2,
+0x0ca1b8,3,
+0x0ca1d0,5,
+0x0ca1e8,3,
+0x0ca1f8,8,
+0x0ca220,6,
+0x0ca240,3,
+0x0ca280,6,
+0x0ca2a0,6,
+0x0ca2c0,3,
+0x0ca300,6,
+0x0ca320,6,
+0x0ca340,6,
+0x0ca360,6,
+0x0ca380,6,
+0x0ca3a0,6,
+0x0ca3c0,6,
+0x0ca3e0,6,
+0x0ca400,6,
+0x0ca6fc,1,
+0x0ca800,72,
+0x0cb000,4,
+0x0cb044,1,
+0x0cb04c,1,
+0x0cb100,8,
+0x0cb1f0,6,
+0x0cb210,3,
+0x0cb220,2,
+0x0cb230,3,
+0x0cb240,2,
+0x0cb250,3,
+0x0cb260,2,
+0x0cb270,3,
+0x0cb280,1,
+0x0cb400,5,
+0x0cb59c,1,
+0x0cb5ac,9,
+0x0d0000,5,
+0x0d0020,4,
+0x0d0034,17,
+0x0d0080,1,
+0x0d00a0,6,
+0x0d0100,5,
+0x0d0120,4,
+0x0d0134,17,
+0x0d0180,1,
+0x0d01a0,6,
+0x0d0200,5,
+0x0d0220,4,
+0x0d0234,17,
+0x0d0280,1,
+0x0d02a0,6,
+0x0d0300,5,
+0x0d0320,4,
+0x0d0334,17,
+0x0d0380,1,
+0x0d03a0,6,
+0x0d0400,6,
+0x0d0440,6,
+0x0d0480,3,
+0x0d04c0,3,
+0x0d0500,6,
+0x0d051c,7,
+0x0d0540,1,
+0x0d0c00,13,
+0x0d0c40,12,
+0x0d0c80,13,
+0x0d0cc0,12,
+0x0d0d00,6,
+0x0d0d20,6,
+0x0d0e40,11,
+0x0d0e80,6,
+0x0d0ea0,6,
+0x0d1000,2,
+0x0d1010,5,
+0x0d1040,3,
+0x0d1050,3,
+0x0d1060,32,
+0x0d1100,8,
+0x0d1140,8,
+0x0d1180,3,
+0x0d1190,2,
+0x0d119c,9,
+0x0d1218,9,
+0x0d1240,3,
+0x0d1250,6,
+0x0d1280,1,
+0x0d1288,6,
+0x0d12a4,1,
+0x0d12c0,1,
+0x0d12c8,6,
+0x0d12e4,1,
+0x0d1400,8,
+0x0d1424,2,
+0x0d1800,24,
+0x0d1864,5,
+0x0d1880,8,
+0x0d1900,13,
+0x0d1980,4,
+0x0d19a0,6,
+0x0d19c0,6,
+0x0d19dc,1,
+0x0d1a00,6,
+0x0d1a1c,1,
+0x0d1a40,1,
+0x0d1a60,1,
+0x0d1a68,23,
+0x0d1ac8,6,
+0x0d1b00,17,
+0x0d1b48,6,
+0x0d1b80,12,
+0x0d1c00,6,
+0x0d1c20,6,
+0x0d1c40,6,
+0x0d1c60,3,
+0x0d1d00,6,
+0x0d1d20,6,
+0x0d1d40,3,
+0x0d1d80,6,
+0x0d1da0,6,
+0x0d1dc0,3,
+0x0d4000,5,
+0x0d4038,1,
+0x0d4044,1,
+0x0d4050,2,
+0x0d4100,6,
+0x0d8000,6,
+0x0d8020,3,
+0x0d8030,8,
+0x0d8100,6,
+0x0d8120,10,
+0x0d8150,8,
+0x0d8800,6,
+0x0d8820,3,
+0x0d8830,4,
+0x0d8858,2,
+0x0d8864,1,
+0x0d8874,3,
+0x0d8898,2,
+0x0d88a4,1,
+0x0d88b4,3,
+0x0d9000,6,
+0x0d9020,6,
+0x0d9040,3,
+0x0d9080,14,
+0x0d90bc,1,
+0x0d90c4,13,
+0x0d90fc,5,
+0x0d9120,4,
+0x0d9140,3,
+0x0d9180,3,
+0x0d9190,3,
+0x0d91a0,1,
+0x0d91e0,6,
+0x0d9200,20,
+0x0d925c,30,
+0x0d9300,24,
+0x0d9380,2,
+0x0d93a0,1,
+0x0d93c0,11,
+0x0d9404,3,
+0x0d9420,11,
+0x0d9460,3,
+0x0d9480,6,
+0x0d9500,6,
+0x0d9520,6,
+0x0d9540,1,
+0x0d9558,2,
+0x0d9600,17,
+0x0d9800,410,
+0x0da000,6,
+0x0da020,6,
+0x0da040,3,
+0x0da080,14,
+0x0da0bc,1,
+0x0da0c4,13,
+0x0da0fc,5,
+0x0da120,4,
+0x0da140,3,
+0x0da180,3,
+0x0da190,3,
+0x0da1a0,1,
+0x0da1e0,6,
+0x0da200,20,
+0x0da25c,30,
+0x0da300,24,
+0x0da380,2,
+0x0da3a0,1,
+0x0da3c0,11,
+0x0da404,3,
+0x0da420,11,
+0x0da460,3,
+0x0da480,6,
+0x0da500,6,
+0x0da520,6,
+0x0da540,1,
+0x0da558,2,
+0x0da600,17,
+0x0da800,410,
+0x0db800,5,
+0x0db818,1,
+0x0db854,6,
+0x0db880,2,
+0x0db8a4,1,
+0x0db8ac,2,
+0x0dba00,28,
+0x0dba7c,13,
+0x0dbab4,1,
+0x0dbabc,10,
+0x0dbb04,1,
+0x0dbb0c,5,
+0x0dbb24,1,
+0x0dbb34,9,
+0x0dbb60,6,
+0x0dbb80,22,
+0x0dbbe0,3,
+0x0dbbf0,2,
+0x0dbc00,5,
+0x0dbc18,1,
+0x0dbc54,6,
+0x0dbc80,2,
+0x0dbca4,1,
+0x0dbcac,2,
+0x0dbe00,28,
+0x0dbe7c,13,
+0x0dbeb4,1,
+0x0dbebc,10,
+0x0dbf04,1,
+0x0dbf0c,5,
+0x0dbf24,1,
+0x0dbf34,9,
+0x0dbf60,6,
+0x0dbf80,22,
+0x0dbfe0,3,
+0x0dbff0,2,
+0x0dc000,1,
+0x0e8000,1,
+0x0e8008,2,
+0x0e8058,3,
+0x0e8120,2,
+0x0e8130,2,
+0x0e8140,1,
+0x0e8184,11,
+0x0e81c4,3,
+0x0e81dc,3,
+0x0e8280,13,
+0x0e8400,16,
+0x0e8444,7,
+0x0e8500,4,
+0x0e8804,1,
+0x0e8824,7,
+0x0e8844,1,
+0x0e884c,27,
+0x0e88d4,2,
+0x0e8c00,1,
+0x0e8c08,3,
+0x0e8c80,20,
+0x0e8d00,3,
+0x0e8d20,6,
+0x0e8d80,4,
+0x0e8da0,6,
+0x0e8dbc,7,
+0x0e8e00,21,
+0x0e8e80,6,
+0x0e8ea0,6,
+0x0e8ec0,3,
+0x0e9000,35,
+0x0e9090,2,
+0x0e90f0,1,
+0x0e90f8,1,
+0x0e9100,1,
+0x0e9108,5,
+0x0e9138,2,
+0x0e9144,1,
+0x0e9160,13,
+0x0e91a0,3,
+0x0e9200,2,
+0x0e9214,11,
+0x0e9244,7,
+0x0e92b8,2,
+0x0e92c4,7,
+0x0e9310,1,
+0x0e9340,4,
+0x0e9380,7,
+0x0e9400,14,
+0x0e9440,10,
+0x0e947c,1,
+0x0e9700,2,
+0x0e9720,8,
+0x0e9800,3,
+0x0e9810,3,
+0x0e9820,3,
+0x0e9830,3,
+0x0e9840,3,
+0x0e9850,3,
+0x0e9860,3,
+0x0e9870,3,
+0x0e9880,3,
+0x0e9890,3,
+0x0e98a0,3,
+0x0e98b0,3,
+0x0e98c0,3,
+0x0e98d0,3,
+0x0e98e0,3,
+0x0e98f0,3,
+0x0e9900,68,
+0x0e9c00,36,
+0x0e9d00,3,
+0x0e9d40,2,
+0x0e9d4c,1,
+0x0e9d84,1,
+0x0e9d90,4,
+0x0e9e00,6,
+0x0e9e20,6,
+0x0e9e40,6,
+0x0e9e60,3,
+0x0e9e80,6,
+0x0e9ea0,3,
+0x0e9f80,13,
+0x0e9fc0,2,
+0x0ea000,1,
+0x0ea028,1,
+0x0ea050,1,
+0x0ea078,1,
+0x0ea0a0,3,
+0x0ea1ac,1,
+0x0ea1d8,4,
+0x0ea200,6,
+0x0ea220,6,
+0x0ea240,3,
+0x0ea400,6,
+0x0ea420,2,
+0x0ea430,2,
+0x0ea440,2,
+0x0ea450,6,
+0x0ea470,2,
+0x0ea490,24,
+0x0ea520,8,
+0x0ea604,1,
+0x0ea6f0,72,
+0x0f0000,3,
+0x0f0014,11,
+0x0f0044,15,
+0x0f00f0,3,
+0x0f0100,1,
+0x0f0108,3,
+0x0f0118,1,
+0x0f0130,4,
+0x0f0180,3,
+0x0f0190,2,
+0x0f01a0,3,
+0x0f01c0,2,
+0x0f01d0,10,
+0x0f0200,61,
+0x0f0404,9,
+0x0f0440,12,
+0x0f0480,5,
+0x0f04b8,19,
+0x0f05a0,1,
+0x0f05c0,8,
+0x0f0800,17,
+0x0f0850,9,
+0x0f0880,9,
+0x0f08b0,9,
+0x0f08e0,9,
+0x0f0920,4,
+0x0f093c,5,
+0x0f095c,5,
+0x0f097c,5,
+0x0f099c,5,
+0x0f09bc,5,
+0x0f09dc,1,
+0x0f0a90,2,
+0x0f0c00,128,
+0x0f0e04,1,
+0x0f0e14,9,
+0x0f0e3c,1,
+0x0f1000,3,
+0x0f1010,4,
+0x0f1030,2,
+0x0f1080,10,
+0x0f10c0,1,
+0x0f10e0,2,
+0x0f10ec,1,
+0x0f10f4,3,
+0x0f1400,6,
+0x0f1420,6,
+0x0f1440,6,
+0x0f1460,6,
+0x0f1480,6,
+0x0f14a0,6,
+0x0f14c0,6,
+0x0f14e0,6,
+0x0f1500,6,
+0x0f1520,6,
+0x0f1540,6,
+0x0f1560,6,
+0x0f1580,6,
+0x0f15a0,6,
+0x0f15c0,6,
+0x0f15e0,6,
+0x0f1600,6,
+0x0f1620,3,
+0x0f1800,3,
+0x0f2000,2,
+0x0f200c,3,
+0x0f2020,8,
+0x0f2060,6,
+0x0f2080,2,
+0x0f208c,3,
+0x0f20a0,8,
+0x0f20e0,6,
+0x0f2100,2,
+0x0f210c,3,
+0x0f2120,8,
+0x0f2160,6,
+0x0f2180,2,
+0x0f218c,3,
+0x0f21a0,8,
+0x0f21e0,6,
+0x0f2200,2,
+0x0f220c,3,
+0x0f2220,8,
+0x0f2260,6,
+0x0f2280,2,
+0x0f228c,3,
+0x0f22a0,8,
+0x0f22e0,6,
+0x0f2300,2,
+0x0f230c,3,
+0x0f2320,8,
+0x0f2360,6,
+0x0f2380,2,
+0x0f238c,3,
+0x0f23a0,8,
+0x0f23e0,6,
+0x0f2400,2,
+0x0f240c,3,
+0x0f2420,8,
+0x0f2460,6,
+0x0f2480,2,
+0x0f248c,3,
+0x0f24a0,8,
+0x0f24e0,6,
+0x0f2500,2,
+0x0f250c,3,
+0x0f2520,8,
+0x0f2560,6,
+0x0f2580,2,
+0x0f258c,3,
+0x0f25a0,8,
+0x0f25e0,6,
+0x0f2600,2,
+0x0f260c,3,
+0x0f2620,8,
+0x0f2660,6,
+0x0f2680,2,
+0x0f268c,3,
+0x0f26a0,8,
+0x0f26e0,6,
+0x0f2700,2,
+0x0f270c,3,
+0x0f2720,8,
+0x0f2760,6,
+0x0f2780,2,
+0x0f278c,3,
+0x0f27a0,8,
+0x0f27e0,6,
+0x0f2800,2,
+0x0f280c,3,
+0x0f2820,8,
+0x0f2860,6,
+0x0f2880,2,
+0x0f288c,3,
+0x0f28a0,8,
+0x0f28e0,6,
+0x0f2900,2,
+0x0f290c,3,
+0x0f2920,8,
+0x0f2960,6,
+0x0f2980,2,
+0x0f298c,3,
+0x0f29a0,8,
+0x0f29e0,6,
+0x0f4000,7,
+0x0f4020,4,
+0x0f4204,1,
+0x0f4280,35,
+0x0f4310,4,
+0x0f4404,1,
+0x0f4480,34,
+0x0f4510,10,
+0x0f453c,3,
+0x0f4800,7,
+0x0f4820,4,
+0x0f4a04,1,
+0x0f4a80,35,
+0x0f4b10,4,
+0x0f4c04,1,
+0x0f4c80,34,
+0x0f4d10,10,
+0x0f4d3c,3,
+0x0f5000,7,
+0x0f5020,4,
+0x0f5204,1,
+0x0f5280,35,
+0x0f5310,4,
+0x0f5404,1,
+0x0f5480,34,
+0x0f5510,10,
+0x0f553c,3,
+0x0f5800,7,
+0x0f5820,4,
+0x0f5a04,1,
+0x0f5a80,35,
+0x0f5b10,4,
+0x0f5c04,1,
+0x0f5c80,34,
+0x0f5d10,10,
+0x0f5d3c,3,
+0x0f6000,7,
+0x0f6020,4,
+0x0f6204,1,
+0x0f6280,35,
+0x0f6310,4,
+0x0f6404,1,
+0x0f6480,34,
+0x0f6510,10,
+0x0f653c,3,
+0x0f6800,7,
+0x0f6820,4,
+0x0f6a04,1,
+0x0f6a80,35,
+0x0f6b10,4,
+0x0f6c04,1,
+0x0f6c80,34,
+0x0f6d10,10,
+0x0f6d3c,3,
+0x0f8000,9,
+0x0f8100,6,
+0x0f8120,6,
+0x0f8140,3,
+0x0f8180,10,
+0x0f81c0,3,
+0x0f81d0,2,
+0x0f8200,9,
+0x0f8300,6,
+0x0f8320,6,
+0x0f8340,3,
+0x0f8380,10,
+0x0f83c0,3,
+0x0f83d0,2,
+0x0f8400,9,
+0x0f8500,6,
+0x0f8520,6,
+0x0f8540,3,
+0x0f8580,10,
+0x0f85c0,3,
+0x0f85d0,2,
+0x0f8600,9,
+0x0f8700,6,
+0x0f8720,6,
+0x0f8740,3,
+0x0f8780,10,
+0x0f87c0,3,
+0x0f87d0,2,
+0x0f8800,9,
+0x0f8900,6,
+0x0f8920,6,
+0x0f8940,3,
+0x0f8980,10,
+0x0f89c0,3,
+0x0f89d0,2,
+0x0f8a00,9,
+0x0f8b00,6,
+0x0f8b20,6,
+0x0f8b40,3,
+0x0f8b80,10,
+0x0f8bc0,3,
+0x0f8bd0,2,
+0x0f8c00,9,
+0x0f8d00,6,
+0x0f8d20,6,
+0x0f8d40,3,
+0x0f8d80,10,
+0x0f8dc0,3,
+0x0f8dd0,2,
+0x0f8e00,9,
+0x0f8f00,6,
+0x0f8f20,6,
+0x0f8f40,3,
+0x0f8f80,10,
+0x0f8fc0,3,
+0x0f8fd0,2,
+0x0f9000,9,
+0x0f9100,6,
+0x0f9120,6,
+0x0f9140,3,
+0x0f9180,10,
+0x0f91c0,3,
+0x0f91d0,2,
+0x0f9200,9,
+0x0f9300,6,
+0x0f9320,6,
+0x0f9340,3,
+0x0f9380,10,
+0x0f93c0,3,
+0x0f93d0,2,
+0x0f9400,9,
+0x0f9500,6,
+0x0f9520,6,
+0x0f9540,3,
+0x0f9580,10,
+0x0f95c0,3,
+0x0f95d0,2,
+0x0f9600,9,
+0x0f9700,6,
+0x0f9720,6,
+0x0f9740,3,
+0x0f9780,10,
+0x0f97c0,3,
+0x0f97d0,2,
+0x0f9800,9,
+0x0f9900,6,
+0x0f9920,6,
+0x0f9940,3,
+0x0f9980,10,
+0x0f99c0,3,
+0x0f99d0,2,
+0x0f9a00,9,
+0x0f9b00,6,
+0x0f9b20,6,
+0x0f9b40,3,
+0x0f9b80,10,
+0x0f9bc0,3,
+0x0f9bd0,2,
+0x0f9c00,9,
+0x0f9d00,6,
+0x0f9d20,6,
+0x0f9d40,3,
+0x0f9d80,10,
+0x0f9dc0,3,
+0x0f9dd0,2,
+0x0f9e00,9,
+0x0f9f00,6,
+0x0f9f20,6,
+0x0f9f40,3,
+0x0f9f80,10,
+0x0f9fc0,3,
+0x0f9fd0,2,
+0x0fa000,9,
+0x0fa100,6,
+0x0fa120,6,
+0x0fa140,3,
+0x0fa180,10,
+0x0fa1c0,3,
+0x0fa1d0,2,
+0x0fa200,9,
+0x0fa300,6,
+0x0fa320,6,
+0x0fa340,3,
+0x0fa380,10,
+0x0fa3c0,3,
+0x0fa3d0,2,
+0x0fa400,9,
+0x0fa480,10,
+0x0fa4c0,1,
+0x0fa4e0,2,
+0x0fa4ec,1,
+0x0fa4f4,9,
+0x0fa520,6,
+0x0fa540,3,
+0x0fa580,6,
+0x0fa5c0,3,
+0x0fa5d0,6,
+0x0fa600,9,
+0x0fa680,10,
+0x0fa6c0,1,
+0x0fa6e0,2,
+0x0fa6ec,1,
+0x0fa6f4,9,
+0x0fa720,6,
+0x0fa740,3,
+0x0fa780,6,
+0x0fa7c0,3,
+0x0fa7d0,6,
+0x0fa800,9,
+0x0fa880,10,
+0x0fa8c0,1,
+0x0fa8e0,2,
+0x0fa8ec,1,
+0x0fa8f4,9,
+0x0fa920,6,
+0x0fa940,3,
+0x0fa980,8,
+0x0fa9c0,3,
+0x0fa9d0,2,
+0x0faa00,9,
+0x0faa80,10,
+0x0faac0,1,
+0x0faae0,2,
+0x0faaec,1,
+0x0faaf4,9,
+0x0fab20,6,
+0x0fab40,3,
+0x0fab80,8,
+0x0fabc0,3,
+0x0fabd0,2,
+0x0fac00,9,
+0x0fac80,10,
+0x0facc0,1,
+0x0face0,2,
+0x0facec,1,
+0x0facf4,9,
+0x0fad20,6,
+0x0fad40,3,
+0x0fad80,10,
+0x0fadc0,3,
+0x0fadd0,2,
+0x0fade8,2,
+0x0fae00,9,
+0x0fae80,10,
+0x0faec0,1,
+0x0faee0,2,
+0x0faeec,1,
+0x0faef4,9,
+0x0faf20,6,
+0x0faf40,3,
+0x0faf80,12,
+0x0fafc0,3,
+0x0fafd0,2,
+0x0fb000,9,
+0x0fb100,6,
+0x0fb120,6,
+0x0fb140,3,
+0x0fb180,4,
+0x0fb1a8,2,
+0x0fb1c0,3,
+0x0fb1d0,2,
+0x100000,6,
+0x100100,30,
+0x100180,5,
+0x100200,6,
+0x100300,30,
+0x100380,5,
+0x100400,11,
+0x100430,29,
+0x100500,2,
+0x10050c,4,
+0x100520,5,
+0x10053c,1,
+0x100544,1,
+0x10054c,5,
+0x100564,3,
+0x100600,4,
+0x100620,6,
+0x100640,6,
+0x100660,6,
+0x100680,6,
+0x1006a0,4,
+0x100800,6,
+0x100820,6,
+0x100840,6,
+0x100860,3,
+0x100884,14,
+0x1008c0,16,
+0x100c00,20,
+0x100c58,4,
+0x100c70,2,
+0x100c7c,7,
+0x100d00,4,
+0x100d30,2,
+0x100d3c,12,
+0x100d70,2,
+0x100d80,3,
+0x100e00,32,
+0x101000,6,
+0x101100,30,
+0x101180,5,
+0x101200,6,
+0x101300,30,
+0x101380,5,
+0x101400,11,
+0x101430,29,
+0x101500,2,
+0x10150c,4,
+0x101520,5,
+0x10153c,1,
+0x101544,1,
+0x10154c,5,
+0x101564,3,
+0x101600,4,
+0x101620,6,
+0x101640,6,
+0x101660,6,
+0x101680,6,
+0x1016a0,4,
+0x101800,6,
+0x101820,6,
+0x101840,6,
+0x101860,3,
+0x101884,14,
+0x1018c0,16,
+0x101c00,20,
+0x101c58,4,
+0x101c70,2,
+0x101c7c,7,
+0x101d00,4,
+0x101d30,2,
+0x101d3c,12,
+0x101d70,2,
+0x101d80,3,
+0x101e00,32,
+0x102000,6,
+0x102100,30,
+0x102180,5,
+0x102200,6,
+0x102300,30,
+0x102380,5,
+0x102400,11,
+0x102430,29,
+0x102500,2,
+0x10250c,4,
+0x102520,5,
+0x10253c,1,
+0x102544,1,
+0x10254c,5,
+0x102564,3,
+0x102600,4,
+0x102620,6,
+0x102640,6,
+0x102660,6,
+0x102680,6,
+0x1026a0,4,
+0x102800,6,
+0x102820,6,
+0x102840,6,
+0x102860,3,
+0x102884,14,
+0x1028c0,16,
+0x102c00,20,
+0x102c58,4,
+0x102c70,2,
+0x102c7c,7,
+0x102d00,4,
+0x102d30,2,
+0x102d3c,12,
+0x102d70,2,
+0x102d80,3,
+0x102e00,32,
+0x103000,6,
+0x103100,30,
+0x103180,5,
+0x103200,6,
+0x103300,30,
+0x103380,5,
+0x103400,11,
+0x103430,29,
+0x103500,2,
+0x10350c,4,
+0x103520,5,
+0x10353c,1,
+0x103544,1,
+0x10354c,5,
+0x103564,3,
+0x103600,4,
+0x103620,6,
+0x103640,6,
+0x103660,6,
+0x103680,6,
+0x1036a0,4,
+0x103800,6,
+0x103820,6,
+0x103840,6,
+0x103860,3,
+0x103884,14,
+0x1038c0,16,
+0x103c00,20,
+0x103c58,4,
+0x103c70,2,
+0x103c7c,7,
+0x103d00,4,
+0x103d30,2,
+0x103d3c,12,
+0x103d70,2,
+0x103d80,3,
+0x103e00,32,
+0x104000,6,
+0x104100,30,
+0x104180,5,
+0x104200,6,
+0x104300,30,
+0x104380,5,
+0x104400,11,
+0x104430,29,
+0x104500,2,
+0x10450c,4,
+0x104520,5,
+0x10453c,1,
+0x104544,1,
+0x10454c,5,
+0x104564,3,
+0x104600,4,
+0x104620,6,
+0x104640,6,
+0x104660,6,
+0x104680,6,
+0x1046a0,4,
+0x104800,6,
+0x104820,6,
+0x104840,6,
+0x104860,3,
+0x104884,14,
+0x1048c0,16,
+0x104c00,20,
+0x104c58,4,
+0x104c70,2,
+0x104c7c,7,
+0x104d00,4,
+0x104d30,2,
+0x104d3c,12,
+0x104d70,2,
+0x104d80,3,
+0x104e00,32,
+0x105000,6,
+0x105100,30,
+0x105180,5,
+0x105200,6,
+0x105300,30,
+0x105380,5,
+0x105400,11,
+0x105430,29,
+0x105500,2,
+0x10550c,4,
+0x105520,5,
+0x10553c,1,
+0x105544,1,
+0x10554c,5,
+0x105564,3,
+0x105600,4,
+0x105620,6,
+0x105640,6,
+0x105660,6,
+0x105680,6,
+0x1056a0,4,
+0x105800,6,
+0x105820,6,
+0x105840,6,
+0x105860,3,
+0x105884,14,
+0x1058c0,16,
+0x105c00,20,
+0x105c58,4,
+0x105c70,2,
+0x105c7c,7,
+0x105d00,4,
+0x105d30,2,
+0x105d3c,12,
+0x105d70,2,
+0x105d80,3,
+0x105e00,32,
+0x106000,6,
+0x106100,30,
+0x106180,5,
+0x106200,6,
+0x106300,30,
+0x106380,5,
+0x106400,11,
+0x106430,29,
+0x106500,2,
+0x10650c,4,
+0x106520,5,
+0x10653c,1,
+0x106544,1,
+0x10654c,5,
+0x106564,3,
+0x106600,4,
+0x106620,6,
+0x106640,6,
+0x106660,6,
+0x106680,6,
+0x1066a0,4,
+0x106800,6,
+0x106820,6,
+0x106840,6,
+0x106860,3,
+0x106884,14,
+0x1068c0,16,
+0x106c00,20,
+0x106c58,4,
+0x106c70,2,
+0x106c7c,7,
+0x106d00,4,
+0x106d30,2,
+0x106d3c,12,
+0x106d70,2,
+0x106d80,3,
+0x106e00,32,
+0x107000,6,
+0x107100,30,
+0x107180,5,
+0x107200,6,
+0x107300,30,
+0x107380,5,
+0x107400,11,
+0x107430,29,
+0x107500,2,
+0x10750c,4,
+0x107520,5,
+0x10753c,1,
+0x107544,1,
+0x10754c,5,
+0x107564,3,
+0x107600,4,
+0x107620,6,
+0x107640,6,
+0x107660,6,
+0x107680,6,
+0x1076a0,4,
+0x107800,6,
+0x107820,6,
+0x107840,6,
+0x107860,3,
+0x107884,14,
+0x1078c0,16,
+0x107c00,20,
+0x107c58,4,
+0x107c70,2,
+0x107c7c,7,
+0x107d00,4,
+0x107d30,2,
+0x107d3c,12,
+0x107d70,2,
+0x107d80,3,
+0x107e00,32,
+0x108000,6,
+0x108100,30,
+0x108180,5,
+0x108200,6,
+0x108300,30,
+0x108380,5,
+0x108400,11,
+0x108430,29,
+0x108500,2,
+0x10850c,4,
+0x108520,5,
+0x10853c,1,
+0x108544,1,
+0x10854c,5,
+0x108564,3,
+0x108600,4,
+0x108620,6,
+0x108640,6,
+0x108660,6,
+0x108680,6,
+0x1086a0,4,
+0x108800,6,
+0x108820,6,
+0x108840,6,
+0x108860,3,
+0x108884,14,
+0x1088c0,16,
+0x108c00,20,
+0x108c58,4,
+0x108c70,2,
+0x108c7c,7,
+0x108d00,4,
+0x108d30,2,
+0x108d3c,12,
+0x108d70,2,
+0x108d80,3,
+0x108e00,32,
+0x109000,6,
+0x109100,30,
+0x109180,5,
+0x109200,6,
+0x109300,30,
+0x109380,5,
+0x109400,11,
+0x109430,29,
+0x109500,2,
+0x10950c,4,
+0x109520,5,
+0x10953c,1,
+0x109544,1,
+0x10954c,5,
+0x109564,3,
+0x109600,4,
+0x109620,6,
+0x109640,6,
+0x109660,6,
+0x109680,6,
+0x1096a0,4,
+0x109800,6,
+0x109820,6,
+0x109840,6,
+0x109860,3,
+0x109884,14,
+0x1098c0,16,
+0x109c00,20,
+0x109c58,4,
+0x109c70,2,
+0x109c7c,7,
+0x109d00,4,
+0x109d30,2,
+0x109d3c,12,
+0x109d70,2,
+0x109d80,3,
+0x109e00,32,
+0x10a000,1,
+0x113ffc,6,
+0x114018,3,
+0x114028,3,
+0x114038,3,
+0x114048,3,
+0x114058,3,
+0x114068,3,
+0x114078,3,
+0x114088,12,
+0x1140c8,13,
+0x114100,29,
+0x114178,11,
+0x1141c0,3,
+0x1141d0,3,
+0x1141e0,6,
+0x114400,5,
+0x114428,5,
+0x114450,5,
+0x114478,5,
+0x1144a0,4,
+0x1145ac,1,
+0x1145d8,4,
+0x114600,6,
+0x114620,6,
+0x114640,6,
+0x114660,6,
+0x114680,6,
+0x1146a0,6,
+0x1146c0,6,
+0x1146e0,6,
+0x114700,6,
+0x114720,6,
+0x114740,3,
+0x114900,7,
+0x114920,36,
+0x114c00,1,
+0x114c08,1,
+0x114c10,5,
+0x114c38,1,
+0x114c60,7,
+0x115000,1,
+0x115008,11,
+0x115038,10,
+0x115068,3,
+0x115104,4,
+0x115128,3,
+0x115204,5,
+0x115220,10,
+0x115250,3,
+0x115280,6,
+0x1152a0,6,
+0x1152c0,6,
+0x1152e0,3,
+0x115300,7,
+0x140000,6,
+0x140100,30,
+0x140180,5,
+0x140200,6,
+0x140300,30,
+0x140380,5,
+0x140400,11,
+0x140430,29,
+0x140500,2,
+0x14050c,4,
+0x140520,5,
+0x14053c,1,
+0x140544,1,
+0x14054c,5,
+0x140564,3,
+0x140600,4,
+0x140620,6,
+0x140640,6,
+0x140660,6,
+0x140680,6,
+0x1406a0,4,
+0x140800,6,
+0x140820,6,
+0x140840,6,
+0x140860,3,
+0x140884,14,
+0x1408c0,16,
+0x140c00,20,
+0x140c58,4,
+0x140c70,2,
+0x140c7c,7,
+0x140d00,4,
+0x140d30,2,
+0x140d3c,12,
+0x140d70,2,
+0x140d80,3,
+0x140e00,32,
+0x141000,6,
+0x141100,30,
+0x141180,5,
+0x141200,6,
+0x141300,30,
+0x141380,5,
+0x141400,11,
+0x141430,29,
+0x141500,2,
+0x14150c,4,
+0x141520,5,
+0x14153c,1,
+0x141544,1,
+0x14154c,5,
+0x141564,3,
+0x141600,4,
+0x141620,6,
+0x141640,6,
+0x141660,6,
+0x141680,6,
+0x1416a0,4,
+0x141800,6,
+0x141820,6,
+0x141840,6,
+0x141860,3,
+0x141884,14,
+0x1418c0,16,
+0x141c00,20,
+0x141c58,4,
+0x141c70,2,
+0x141c7c,7,
+0x141d00,4,
+0x141d30,2,
+0x141d3c,12,
+0x141d70,2,
+0x141d80,3,
+0x141e00,32,
+0x142000,6,
+0x142100,30,
+0x142180,5,
+0x142200,6,
+0x142300,30,
+0x142380,5,
+0x142400,11,
+0x142430,29,
+0x142500,2,
+0x14250c,4,
+0x142520,5,
+0x14253c,1,
+0x142544,1,
+0x14254c,5,
+0x142564,3,
+0x142600,4,
+0x142620,6,
+0x142640,6,
+0x142660,6,
+0x142680,6,
+0x1426a0,4,
+0x142800,6,
+0x142820,6,
+0x142840,6,
+0x142860,3,
+0x142884,14,
+0x1428c0,16,
+0x142c00,20,
+0x142c58,4,
+0x142c70,2,
+0x142c7c,7,
+0x142d00,4,
+0x142d30,2,
+0x142d3c,12,
+0x142d70,2,
+0x142d80,3,
+0x142e00,32,
+0x143000,6,
+0x143100,30,
+0x143180,5,
+0x143200,6,
+0x143300,30,
+0x143380,5,
+0x143400,11,
+0x143430,29,
+0x143500,2,
+0x14350c,4,
+0x143520,5,
+0x14353c,1,
+0x143544,1,
+0x14354c,5,
+0x143564,3,
+0x143600,4,
+0x143620,6,
+0x143640,6,
+0x143660,6,
+0x143680,6,
+0x1436a0,4,
+0x143800,6,
+0x143820,6,
+0x143840,6,
+0x143860,3,
+0x143884,14,
+0x1438c0,16,
+0x143c00,20,
+0x143c58,4,
+0x143c70,2,
+0x143c7c,7,
+0x143d00,4,
+0x143d30,2,
+0x143d3c,12,
+0x143d70,2,
+0x143d80,3,
+0x143e00,32,
+0x144000,6,
+0x144100,30,
+0x144180,5,
+0x144200,6,
+0x144300,30,
+0x144380,5,
+0x144400,11,
+0x144430,29,
+0x144500,2,
+0x14450c,4,
+0x144520,5,
+0x14453c,1,
+0x144544,1,
+0x14454c,5,
+0x144564,3,
+0x144600,4,
+0x144620,6,
+0x144640,6,
+0x144660,6,
+0x144680,6,
+0x1446a0,4,
+0x144800,6,
+0x144820,6,
+0x144840,6,
+0x144860,3,
+0x144884,14,
+0x1448c0,16,
+0x144c00,20,
+0x144c58,4,
+0x144c70,2,
+0x144c7c,7,
+0x144d00,4,
+0x144d30,2,
+0x144d3c,12,
+0x144d70,2,
+0x144d80,3,
+0x144e00,32,
+0x145000,6,
+0x145100,30,
+0x145180,5,
+0x145200,6,
+0x145300,30,
+0x145380,5,
+0x145400,11,
+0x145430,29,
+0x145500,2,
+0x14550c,4,
+0x145520,5,
+0x14553c,1,
+0x145544,1,
+0x14554c,5,
+0x145564,3,
+0x145600,4,
+0x145620,6,
+0x145640,6,
+0x145660,6,
+0x145680,6,
+0x1456a0,4,
+0x145800,6,
+0x145820,6,
+0x145840,6,
+0x145860,3,
+0x145884,14,
+0x1458c0,16,
+0x145c00,20,
+0x145c58,4,
+0x145c70,2,
+0x145c7c,7,
+0x145d00,4,
+0x145d30,2,
+0x145d3c,12,
+0x145d70,2,
+0x145d80,3,
+0x145e00,32,
+0x146000,6,
+0x146100,30,
+0x146180,5,
+0x146200,6,
+0x146300,30,
+0x146380,5,
+0x146400,11,
+0x146430,29,
+0x146500,2,
+0x14650c,4,
+0x146520,5,
+0x14653c,1,
+0x146544,1,
+0x14654c,5,
+0x146564,3,
+0x146600,4,
+0x146620,6,
+0x146640,6,
+0x146660,6,
+0x146680,6,
+0x1466a0,4,
+0x146800,6,
+0x146820,6,
+0x146840,6,
+0x146860,3,
+0x146884,14,
+0x1468c0,16,
+0x146c00,20,
+0x146c58,4,
+0x146c70,2,
+0x146c7c,7,
+0x146d00,4,
+0x146d30,2,
+0x146d3c,12,
+0x146d70,2,
+0x146d80,3,
+0x146e00,32,
+0x147000,6,
+0x147100,30,
+0x147180,5,
+0x147200,6,
+0x147300,30,
+0x147380,5,
+0x147400,11,
+0x147430,29,
+0x147500,2,
+0x14750c,4,
+0x147520,5,
+0x14753c,1,
+0x147544,1,
+0x14754c,5,
+0x147564,3,
+0x147600,4,
+0x147620,6,
+0x147640,6,
+0x147660,6,
+0x147680,6,
+0x1476a0,4,
+0x147800,6,
+0x147820,6,
+0x147840,6,
+0x147860,3,
+0x147884,14,
+0x1478c0,16,
+0x147c00,20,
+0x147c58,4,
+0x147c70,2,
+0x147c7c,7,
+0x147d00,4,
+0x147d30,2,
+0x147d3c,12,
+0x147d70,2,
+0x147d80,3,
+0x147e00,32,
+0x148000,6,
+0x148100,30,
+0x148180,5,
+0x148200,6,
+0x148300,30,
+0x148380,5,
+0x148400,11,
+0x148430,29,
+0x148500,2,
+0x14850c,4,
+0x148520,5,
+0x14853c,1,
+0x148544,1,
+0x14854c,5,
+0x148564,3,
+0x148600,4,
+0x148620,6,
+0x148640,6,
+0x148660,6,
+0x148680,6,
+0x1486a0,4,
+0x148800,6,
+0x148820,6,
+0x148840,6,
+0x148860,3,
+0x148884,14,
+0x1488c0,16,
+0x148c00,20,
+0x148c58,4,
+0x148c70,2,
+0x148c7c,7,
+0x148d00,4,
+0x148d30,2,
+0x148d3c,12,
+0x148d70,2,
+0x148d80,3,
+0x148e00,32,
+0x149000,6,
+0x149100,30,
+0x149180,5,
+0x149200,6,
+0x149300,30,
+0x149380,5,
+0x149400,11,
+0x149430,29,
+0x149500,2,
+0x14950c,4,
+0x149520,5,
+0x14953c,1,
+0x149544,1,
+0x14954c,5,
+0x149564,3,
+0x149600,4,
+0x149620,6,
+0x149640,6,
+0x149660,6,
+0x149680,6,
+0x1496a0,4,
+0x149800,6,
+0x149820,6,
+0x149840,6,
+0x149860,3,
+0x149884,14,
+0x1498c0,16,
+0x149c00,20,
+0x149c58,4,
+0x149c70,2,
+0x149c7c,7,
+0x149d00,4,
+0x149d30,2,
+0x149d3c,12,
+0x149d70,2,
+0x149d80,3,
+0x149e00,32,
+0x14a000,1,
+0x153ffc,6,
+0x154018,3,
+0x154028,3,
+0x154038,3,
+0x154048,3,
+0x154058,3,
+0x154068,3,
+0x154078,3,
+0x154088,12,
+0x1540c8,13,
+0x154100,29,
+0x154178,11,
+0x1541c0,3,
+0x1541d0,3,
+0x1541e0,6,
+0x154400,5,
+0x154428,5,
+0x154450,5,
+0x154478,5,
+0x1544a0,4,
+0x1545ac,1,
+0x1545d8,4,
+0x154600,6,
+0x154620,6,
+0x154640,6,
+0x154660,6,
+0x154680,6,
+0x1546a0,6,
+0x1546c0,6,
+0x1546e0,6,
+0x154700,6,
+0x154720,6,
+0x154740,3,
+0x154900,7,
+0x154920,36,
+0x154c00,1,
+0x154c08,1,
+0x154c10,5,
+0x154c38,1,
+0x154c60,7,
+0x155000,1,
+0x155008,11,
+0x155038,10,
+0x155068,3,
+0x155104,4,
+0x155128,3,
+0x155204,5,
+0x155220,10,
+0x155250,3,
+0x155280,6,
+0x1552a0,6,
+0x1552c0,6,
+0x1552e0,3,
+0x155300,7,
+0x180000,6,
+0x180020,6,
+0x180040,6,
+0x180060,6,
+0x180080,6,
+0x1800a0,6,
+0x1800c0,3,
+0x180100,1,
+0x180110,1,
+0x188000,11,
+0x188040,61,
+0x188140,2,
+0x188190,67,
+0x1882a0,3,
+0x1882b0,2,
+0x1882cc,24,
+0x188330,2,
+0x188604,1,
+0x188630,40,
+0x188764,1,
+0x18876c,1,
+0x188800,1,
+0x189004,1,
+0x18900c,13,
+0x189044,1,
+0x18904c,3,
+0x189084,1,
+0x189090,4,
+0x1890a4,1,
+0x1890ac,1,
+0x1890b4,1,
+0x1890bc,1,
+0x189404,1,
+0x189474,35,
+0x189504,1,
+0x18950c,3,
+0x189604,16,
+0x189804,1,
+0x18982c,23,
+0x189904,27,
+0x189980,12,
+0x1899c4,1,
+0x1899cc,2,
+0x189c00,2,
+0x189ffc,1,
+0x18a004,1,
+0x18a07c,33,
+0x18a104,1,
+0x18a120,11,
+0x18a184,3,
+0x18a194,31,
+0x18a8e0,1,
+0x18b004,1,
+0x18b020,8,
+0x18b044,1,
+0x18b060,10,
+0x18b104,1,
+0x18b178,34,
+0x18b204,1,
+0x18b218,12,
+0x18b280,2,
+0x18b304,1,
+0x18b30c,1,
+0x18b314,1,
+0x18b31c,1,
+0x18b324,1,
+0x18b32c,2,
+0x18b340,2,
+0x18b400,2,
+0x18b808,1,
+0x18c000,298,
+0x18c804,6,
+0x18c8e0,1,
+0x18d000,1,
+0x18d028,1,
+0x18d050,1,
+0x18d078,1,
+0x18d0a0,14,
+0x18d1ac,1,
+0x18d1d8,4,
+0x18d200,6,
+0x18d220,6,
+0x18d240,3,
+0x18d400,2,
+0x18d500,6,
+0x18d520,6,
+0x18d540,6,
+0x18d560,6,
+0x18d580,6,
+0x18d5a0,6,
+0x18d5c0,3,
+0x18d600,13,
+0x18d640,1,
+0x18d700,1,
+0x200000,5,
+0x200020,4,
+0x200034,17,
+0x200080,1,
+0x2000a0,6,
+0x200100,5,
+0x200120,4,
+0x200134,17,
+0x200180,1,
+0x2001a0,6,
+0x200200,5,
+0x200220,4,
+0x200234,17,
+0x200280,1,
+0x2002a0,6,
+0x200300,5,
+0x200320,4,
+0x200334,17,
+0x200380,1,
+0x2003a0,6,
+0x200500,6,
+0x20051c,7,
+0x200540,1,
+0x200c00,13,
+0x200c40,12,
+0x200c80,13,
+0x200cc0,12,
+0x200d00,6,
+0x200d20,6,
+0x200d80,14,
+0x200dc0,2,
+0x200e40,11,
+0x200e80,6,
+0x200ea0,6,
+0x201000,2,
+0x201010,5,
+0x201060,32,
+0x201100,8,
+0x201180,3,
+0x201190,2,
+0x20119c,5,
+0x201218,9,
+0x201240,3,
+0x201250,6,
+0x201280,1,
+0x201288,6,
+0x2012a4,1,
+0x201400,8,
+0x201424,2,
+0x201500,5,
+0x201520,4,
+0x201540,5,
+0x201560,4,
+0x201800,24,
+0x201864,5,
+0x201880,8,
+0x201900,13,
+0x201980,4,
+0x2019a0,6,
+0x201a40,1,
+0x201a60,1,
+0x201a68,23,
+0x201ac8,6,
+0x201b00,17,
+0x201b48,6,
+0x201b80,12,
+0x201c00,6,
+0x201c20,6,
+0x201c40,6,
+0x201c60,3,
+0x201d00,6,
+0x201d20,6,
+0x201d40,3,
+0x202000,5,
+0x202020,4,
+0x202034,17,
+0x202080,1,
+0x2020a0,6,
+0x202100,5,
+0x202120,4,
+0x202134,17,
+0x202180,1,
+0x2021a0,6,
+0x202200,5,
+0x202220,4,
+0x202234,17,
+0x202280,1,
+0x2022a0,6,
+0x202300,5,
+0x202320,4,
+0x202334,17,
+0x202380,1,
+0x2023a0,6,
+0x202500,6,
+0x20251c,7,
+0x202540,1,
+0x202c00,13,
+0x202c40,12,
+0x202c80,13,
+0x202cc0,12,
+0x202d00,6,
+0x202d20,6,
+0x202d80,14,
+0x202dc0,2,
+0x202e40,11,
+0x202e80,6,
+0x202ea0,6,
+0x203000,2,
+0x203010,5,
+0x203060,32,
+0x203100,8,
+0x203180,3,
+0x203190,2,
+0x20319c,5,
+0x203218,9,
+0x203240,3,
+0x203250,6,
+0x203280,1,
+0x203288,6,
+0x2032a4,1,
+0x203400,8,
+0x203424,2,
+0x203500,5,
+0x203520,4,
+0x203540,5,
+0x203560,4,
+0x203800,24,
+0x203864,5,
+0x203880,8,
+0x203900,13,
+0x203980,4,
+0x2039a0,6,
+0x203a40,1,
+0x203a60,1,
+0x203a68,23,
+0x203ac8,6,
+0x203b00,17,
+0x203b48,6,
+0x203b80,12,
+0x203c00,6,
+0x203c20,6,
+0x203c40,6,
+0x203c60,3,
+0x203d00,6,
+0x203d20,6,
+0x203d40,3,
+0x204000,29,
+0x204078,4,
+0x204090,2,
+0x2040a0,7,
+0x2040c0,11,
+0x204100,14,
+0x204140,14,
+0x204180,61,
+0x204278,4,
+0x204290,2,
+0x2042a0,7,
+0x2042c0,11,
+0x204300,14,
+0x204340,14,
+0x204380,61,
+0x204478,4,
+0x204490,2,
+0x2044a0,7,
+0x2044c0,11,
+0x204500,14,
+0x204540,14,
+0x204580,61,
+0x204678,4,
+0x204690,2,
+0x2046a0,7,
+0x2046c0,11,
+0x204700,14,
+0x204740,14,
+0x204780,67,
+0x204890,1,
+0x204a00,8,
+0x204a24,15,
+0x204a64,30,
+0x204b00,4,
+0x204b20,2,
+0x204c00,6,
+0x204c40,14,
+0x204c80,9,
+0x204d00,9,
+0x204d2c,1,
+0x204d40,3,
+0x204d60,1,
+0x204d80,3,
+0x204e00,2,
+0x204e0c,1,
+0x204e14,5,
+0x204e2c,1,
+0x204e34,5,
+0x204e4c,1,
+0x204e54,5,
+0x204e6c,1,
+0x204e74,5,
+0x204e8c,1,
+0x204e94,5,
+0x204eac,1,
+0x204eb4,3,
+0x205000,29,
+0x205078,4,
+0x205090,2,
+0x2050a0,7,
+0x2050c0,11,
+0x205100,14,
+0x205140,14,
+0x205180,61,
+0x205278,4,
+0x205290,2,
+0x2052a0,7,
+0x2052c0,11,
+0x205300,14,
+0x205340,14,
+0x205380,61,
+0x205478,4,
+0x205490,2,
+0x2054a0,7,
+0x2054c0,11,
+0x205500,14,
+0x205540,14,
+0x205580,61,
+0x205678,4,
+0x205690,2,
+0x2056a0,7,
+0x2056c0,11,
+0x205700,14,
+0x205740,14,
+0x205780,67,
+0x205890,1,
+0x205a00,8,
+0x205a24,15,
+0x205a64,30,
+0x205b00,4,
+0x205b20,2,
+0x205c00,6,
+0x205c40,14,
+0x205c80,9,
+0x205d00,9,
+0x205d2c,1,
+0x205d40,3,
+0x205d60,1,
+0x205d80,3,
+0x205e00,2,
+0x205e0c,1,
+0x205e14,5,
+0x205e2c,1,
+0x205e34,5,
+0x205e4c,1,
+0x205e54,5,
+0x205e6c,1,
+0x205e74,5,
+0x205e8c,1,
+0x205e94,5,
+0x205eac,1,
+0x205eb4,3,
+0x206000,14,
+0x206070,3,
+0x206080,6,
+0x206100,9,
+0x206204,1,
+0x20620c,6,
+0x206240,13,
+0x206280,16,
+0x206800,19,
+0x206850,10,
+0x206880,19,
+0x2068d0,10,
+0x206900,19,
+0x206950,10,
+0x206980,19,
+0x2069d0,10,
+0x206a00,19,
+0x206a50,10,
+0x206a80,19,
+0x206ad0,10,
+0x206b00,19,
+0x206b50,10,
+0x206b80,19,
+0x206bd0,10,
+0x206c00,19,
+0x206c60,6,
+0x206c84,1,
+0x206c94,8,
+0x206cb8,9,
+0x206ce0,4,
+0x207000,6,
+0x207020,3,
+0x207040,7,
+0x207060,6,
+0x207100,5,
+0x207138,1,
+0x207144,1,
+0x207150,2,
+0x208000,6,
+0x208020,3,
+0x208030,9,
+0x208100,6,
+0x208120,10,
+0x208150,8,
+0x208400,1,
+0x208428,1,
+0x208450,1,
+0x208478,1,
+0x2084a0,8,
+0x2085ac,1,
+0x2085d8,4,
+0x208600,6,
+0x208620,6,
+0x208640,3,
+0x208800,6,
+0x208820,3,
+0x208830,4,
+0x208858,2,
+0x208864,1,
+0x208874,3,
+0x208898,2,
+0x2088a4,1,
+0x2088b4,3,
+0x209000,6,
+0x209020,6,
+0x209040,3,
+0x209080,14,
+0x2090bc,1,
+0x2090c4,13,
+0x2090fc,1,
+0x209200,20,
+0x20925c,30,
+0x209300,24,
+0x209380,2,
+0x2093a0,1,
+0x2093c0,11,
+0x209404,3,
+0x209420,11,
+0x209460,3,
+0x209480,6,
+0x209500,6,
+0x209520,6,
+0x209540,1,
+0x209558,2,
+0x209600,17,
+0x209800,410,
+0x20a000,6,
+0x20a020,6,
+0x20a040,3,
+0x20a080,14,
+0x20a0bc,1,
+0x20a0c4,13,
+0x20a0fc,1,
+0x20a200,20,
+0x20a25c,30,
+0x20a300,24,
+0x20a380,2,
+0x20a3a0,1,
+0x20a3c0,11,
+0x20a404,3,
+0x20a420,11,
+0x20a460,3,
+0x20a480,6,
+0x20a500,6,
+0x20a520,6,
+0x20a540,1,
+0x20a558,2,
+0x20a600,17,
+0x20a800,410,
+0x20b000,4,
+0x20b020,25,
+0x20b088,8,
+0x20b100,4,
+0x20b120,25,
+0x20b188,8,
+0x20b200,34,
+0x20b300,37,
+0x20b400,16,
+0x20b464,1,
+0x20b474,3,
+0x20b500,6,
+0x20b520,2,
+0x20b530,9,
+0x20b570,10,
+0x20b5a0,2,
+0x20b5b0,9,
+0x20b5f0,4,
+0x20b620,7,
+0x20b640,16,
+0x20b700,6,
+0x20b720,6,
+0x20b740,6,
+0x20b760,6,
+0x20b780,3,
+0x20b800,5,
+0x20b818,1,
+0x20b854,6,
+0x20b880,2,
+0x20b8a4,1,
+0x20b8ac,2,
+0x20ba00,28,
+0x20ba7c,13,
+0x20bab4,1,
+0x20babc,10,
+0x20bb04,1,
+0x20bb0c,5,
+0x20bb24,1,
+0x20bb34,9,
+0x20bb60,6,
+0x20bb80,22,
+0x20bbe0,3,
+0x20bbf0,2,
+0x20bc00,5,
+0x20bc18,1,
+0x20bc54,6,
+0x20bc80,2,
+0x20bca4,1,
+0x20bcac,2,
+0x20be00,28,
+0x20be7c,13,
+0x20beb4,1,
+0x20bebc,10,
+0x20bf04,1,
+0x20bf0c,5,
+0x20bf24,1,
+0x20bf34,9,
+0x20bf60,6,
+0x20bf80,22,
+0x20bfe0,3,
+0x20bff0,2,
+0x20c008,2,
+0x20c014,11,
+0x20c044,1,
+0x20c04c,3,
+0x20c05c,1,
+0x20c064,1,
+0x20c07c,1,
+0x20c500,2,
+0x20c518,1,
+0x20c520,3,
+0x20c540,6,
+0x20c580,10,
+0x20c808,2,
+0x20c814,11,
+0x20c844,1,
+0x20c84c,3,
+0x20c85c,1,
+0x20c864,1,
+0x20c87c,1,
+0x20cd00,2,
+0x20cd18,1,
+0x20cd20,3,
+0x20cd40,6,
+0x20cd80,10,
+0x20d800,2,
+0x20d828,2,
+0x20d850,2,
+0x20d878,2,
+0x20d8a0,6,
+0x20d9ac,1,
+0x20d9d8,4,
+0x20da00,6,
+0x20da20,6,
+0x20da40,6,
+0x20da60,6,
+0x20da80,3,
+0x20dc00,6,
+0x20dc20,3,
+0x20dc40,2,
+0x20dc60,1,
+0x210000,5,
+0x210020,4,
+0x210034,17,
+0x210080,1,
+0x2100a0,6,
+0x210100,5,
+0x210120,4,
+0x210134,17,
+0x210180,1,
+0x2101a0,6,
+0x210200,5,
+0x210220,4,
+0x210234,17,
+0x210280,1,
+0x2102a0,6,
+0x210300,5,
+0x210320,4,
+0x210334,17,
+0x210380,1,
+0x2103a0,6,
+0x210500,6,
+0x21051c,7,
+0x210540,1,
+0x210c00,13,
+0x210c40,12,
+0x210c80,13,
+0x210cc0,12,
+0x210d00,6,
+0x210d20,6,
+0x210d80,14,
+0x210dc0,2,
+0x210e40,11,
+0x210e80,6,
+0x210ea0,6,
+0x211000,2,
+0x211010,5,
+0x211060,32,
+0x211100,8,
+0x211180,3,
+0x211190,2,
+0x21119c,5,
+0x211218,9,
+0x211240,3,
+0x211250,6,
+0x211280,1,
+0x211288,6,
+0x2112a4,1,
+0x211400,8,
+0x211424,2,
+0x211500,5,
+0x211520,4,
+0x211540,5,
+0x211560,4,
+0x211800,24,
+0x211864,5,
+0x211880,8,
+0x211900,13,
+0x211980,4,
+0x2119a0,6,
+0x211a40,1,
+0x211a60,1,
+0x211a68,23,
+0x211ac8,6,
+0x211b00,17,
+0x211b48,6,
+0x211b80,12,
+0x211c00,6,
+0x211c20,6,
+0x211c40,6,
+0x211c60,3,
+0x211d00,6,
+0x211d20,6,
+0x211d40,3,
+0x212000,5,
+0x212020,4,
+0x212034,17,
+0x212080,1,
+0x2120a0,6,
+0x212100,5,
+0x212120,4,
+0x212134,17,
+0x212180,1,
+0x2121a0,6,
+0x212200,5,
+0x212220,4,
+0x212234,17,
+0x212280,1,
+0x2122a0,6,
+0x212300,5,
+0x212320,4,
+0x212334,17,
+0x212380,1,
+0x2123a0,6,
+0x212500,6,
+0x21251c,7,
+0x212540,1,
+0x212c00,13,
+0x212c40,12,
+0x212c80,13,
+0x212cc0,12,
+0x212d00,6,
+0x212d20,6,
+0x212d80,14,
+0x212dc0,2,
+0x212e40,11,
+0x212e80,6,
+0x212ea0,6,
+0x213000,2,
+0x213010,5,
+0x213060,32,
+0x213100,8,
+0x213180,3,
+0x213190,2,
+0x21319c,5,
+0x213218,9,
+0x213240,3,
+0x213250,6,
+0x213280,1,
+0x213288,6,
+0x2132a4,1,
+0x213400,8,
+0x213424,2,
+0x213500,5,
+0x213520,4,
+0x213540,5,
+0x213560,4,
+0x213800,24,
+0x213864,5,
+0x213880,8,
+0x213900,13,
+0x213980,4,
+0x2139a0,6,
+0x213a40,1,
+0x213a60,1,
+0x213a68,23,
+0x213ac8,6,
+0x213b00,17,
+0x213b48,6,
+0x213b80,12,
+0x213c00,6,
+0x213c20,6,
+0x213c40,6,
+0x213c60,3,
+0x213d00,6,
+0x213d20,6,
+0x213d40,3,
+0x214000,29,
+0x214078,4,
+0x214090,2,
+0x2140a0,7,
+0x2140c0,11,
+0x214100,14,
+0x214140,14,
+0x214180,61,
+0x214278,4,
+0x214290,2,
+0x2142a0,7,
+0x2142c0,11,
+0x214300,14,
+0x214340,14,
+0x214380,61,
+0x214478,4,
+0x214490,2,
+0x2144a0,7,
+0x2144c0,11,
+0x214500,14,
+0x214540,14,
+0x214580,61,
+0x214678,4,
+0x214690,2,
+0x2146a0,7,
+0x2146c0,11,
+0x214700,14,
+0x214740,14,
+0x214780,67,
+0x214890,1,
+0x214a00,8,
+0x214a24,15,
+0x214a64,30,
+0x214b00,4,
+0x214b20,2,
+0x214c00,6,
+0x214c40,14,
+0x214c80,9,
+0x214d00,9,
+0x214d2c,1,
+0x214d40,3,
+0x214d60,1,
+0x214d80,3,
+0x214e00,2,
+0x214e0c,1,
+0x214e14,5,
+0x214e2c,1,
+0x214e34,5,
+0x214e4c,1,
+0x214e54,5,
+0x214e6c,1,
+0x214e74,5,
+0x214e8c,1,
+0x214e94,5,
+0x214eac,1,
+0x214eb4,3,
+0x215000,29,
+0x215078,4,
+0x215090,2,
+0x2150a0,7,
+0x2150c0,11,
+0x215100,14,
+0x215140,14,
+0x215180,61,
+0x215278,4,
+0x215290,2,
+0x2152a0,7,
+0x2152c0,11,
+0x215300,14,
+0x215340,14,
+0x215380,61,
+0x215478,4,
+0x215490,2,
+0x2154a0,7,
+0x2154c0,11,
+0x215500,14,
+0x215540,14,
+0x215580,61,
+0x215678,4,
+0x215690,2,
+0x2156a0,7,
+0x2156c0,11,
+0x215700,14,
+0x215740,14,
+0x215780,67,
+0x215890,1,
+0x215a00,8,
+0x215a24,15,
+0x215a64,30,
+0x215b00,4,
+0x215b20,2,
+0x215c00,6,
+0x215c40,14,
+0x215c80,9,
+0x215d00,9,
+0x215d2c,1,
+0x215d40,3,
+0x215d60,1,
+0x215d80,3,
+0x215e00,2,
+0x215e0c,1,
+0x215e14,5,
+0x215e2c,1,
+0x215e34,5,
+0x215e4c,1,
+0x215e54,5,
+0x215e6c,1,
+0x215e74,5,
+0x215e8c,1,
+0x215e94,5,
+0x215eac,1,
+0x215eb4,3,
+0x216000,14,
+0x216070,3,
+0x216080,6,
+0x216100,9,
+0x216204,1,
+0x21620c,6,
+0x216240,13,
+0x216280,16,
+0x216800,19,
+0x216850,10,
+0x216880,19,
+0x2168d0,10,
+0x216900,19,
+0x216950,10,
+0x216980,19,
+0x2169d0,10,
+0x216a00,19,
+0x216a50,10,
+0x216a80,19,
+0x216ad0,10,
+0x216b00,19,
+0x216b50,10,
+0x216b80,19,
+0x216bd0,10,
+0x216c00,19,
+0x216c60,6,
+0x216c84,1,
+0x216c94,8,
+0x216cb8,9,
+0x216ce0,4,
+0x217000,6,
+0x217020,3,
+0x217040,7,
+0x217060,6,
+0x217100,5,
+0x217138,1,
+0x217144,1,
+0x217150,2,
+0x218000,6,
+0x218020,3,
+0x218030,9,
+0x218100,6,
+0x218120,10,
+0x218150,8,
+0x218400,1,
+0x218428,1,
+0x218450,1,
+0x218478,1,
+0x2184a0,8,
+0x2185ac,1,
+0x2185d8,4,
+0x218600,6,
+0x218620,6,
+0x218640,3,
+0x218800,6,
+0x218820,3,
+0x218830,4,
+0x218858,2,
+0x218864,1,
+0x218874,3,
+0x218898,2,
+0x2188a4,1,
+0x2188b4,3,
+0x219000,6,
+0x219020,6,
+0x219040,3,
+0x219080,14,
+0x2190bc,1,
+0x2190c4,13,
+0x2190fc,1,
+0x219200,20,
+0x21925c,30,
+0x219300,24,
+0x219380,2,
+0x2193a0,1,
+0x2193c0,11,
+0x219404,3,
+0x219420,11,
+0x219460,3,
+0x219480,6,
+0x219500,6,
+0x219520,6,
+0x219540,1,
+0x219558,2,
+0x219600,17,
+0x219800,410,
+0x21a000,6,
+0x21a020,6,
+0x21a040,3,
+0x21a080,14,
+0x21a0bc,1,
+0x21a0c4,13,
+0x21a0fc,1,
+0x21a200,20,
+0x21a25c,30,
+0x21a300,24,
+0x21a380,2,
+0x21a3a0,1,
+0x21a3c0,11,
+0x21a404,3,
+0x21a420,11,
+0x21a460,3,
+0x21a480,6,
+0x21a500,6,
+0x21a520,6,
+0x21a540,1,
+0x21a558,2,
+0x21a600,17,
+0x21a800,410,
+0x21b000,4,
+0x21b020,25,
+0x21b088,8,
+0x21b100,4,
+0x21b120,25,
+0x21b188,8,
+0x21b200,34,
+0x21b300,37,
+0x21b400,16,
+0x21b464,1,
+0x21b474,3,
+0x21b500,6,
+0x21b520,2,
+0x21b530,9,
+0x21b570,10,
+0x21b5a0,2,
+0x21b5b0,9,
+0x21b5f0,4,
+0x21b620,7,
+0x21b640,16,
+0x21b700,6,
+0x21b720,6,
+0x21b740,6,
+0x21b760,6,
+0x21b780,3,
+0x21b800,5,
+0x21b818,1,
+0x21b854,6,
+0x21b880,2,
+0x21b8a4,1,
+0x21b8ac,2,
+0x21ba00,28,
+0x21ba7c,13,
+0x21bab4,1,
+0x21babc,10,
+0x21bb04,1,
+0x21bb0c,5,
+0x21bb24,1,
+0x21bb34,9,
+0x21bb60,6,
+0x21bb80,22,
+0x21bbe0,3,
+0x21bbf0,2,
+0x21bc00,5,
+0x21bc18,1,
+0x21bc54,6,
+0x21bc80,2,
+0x21bca4,1,
+0x21bcac,2,
+0x21be00,28,
+0x21be7c,13,
+0x21beb4,1,
+0x21bebc,10,
+0x21bf04,1,
+0x21bf0c,5,
+0x21bf24,1,
+0x21bf34,9,
+0x21bf60,6,
+0x21bf80,22,
+0x21bfe0,3,
+0x21bff0,2,
+0x21c008,2,
+0x21c014,11,
+0x21c044,1,
+0x21c04c,3,
+0x21c05c,1,
+0x21c064,1,
+0x21c07c,1,
+0x21c500,2,
+0x21c518,1,
+0x21c520,3,
+0x21c540,6,
+0x21c580,10,
+0x21c808,2,
+0x21c814,11,
+0x21c844,1,
+0x21c84c,3,
+0x21c85c,1,
+0x21c864,1,
+0x21c87c,1,
+0x21cd00,2,
+0x21cd18,1,
+0x21cd20,3,
+0x21cd40,6,
+0x21cd80,10,
+0x21d800,2,
+0x21d828,2,
+0x21d850,2,
+0x21d878,2,
+0x21d8a0,6,
+0x21d9ac,1,
+0x21d9d8,4,
+0x21da00,6,
+0x21da20,6,
+0x21da40,6,
+0x21da60,6,
+0x21da80,3,
+0x21dc00,6,
+0x21dc20,3,
+0x21dc40,2,
+0x21dc60,1,
+0x220000,5,
+0x220020,4,
+0x220034,17,
+0x220080,1,
+0x2200a0,6,
+0x220100,5,
+0x220120,4,
+0x220134,17,
+0x220180,1,
+0x2201a0,6,
+0x220200,5,
+0x220220,4,
+0x220234,17,
+0x220280,1,
+0x2202a0,6,
+0x220300,5,
+0x220320,4,
+0x220334,17,
+0x220380,1,
+0x2203a0,6,
+0x220500,6,
+0x22051c,7,
+0x220540,1,
+0x220c00,13,
+0x220c40,12,
+0x220c80,13,
+0x220cc0,12,
+0x220d00,6,
+0x220d20,6,
+0x220d80,14,
+0x220dc0,2,
+0x220e40,11,
+0x220e80,6,
+0x220ea0,6,
+0x221000,2,
+0x221010,5,
+0x221060,32,
+0x221100,8,
+0x221180,3,
+0x221190,2,
+0x22119c,5,
+0x221218,9,
+0x221240,3,
+0x221250,6,
+0x221280,1,
+0x221288,6,
+0x2212a4,1,
+0x221400,8,
+0x221424,2,
+0x221500,5,
+0x221520,4,
+0x221540,5,
+0x221560,4,
+0x221800,24,
+0x221864,5,
+0x221880,8,
+0x221900,13,
+0x221980,4,
+0x2219a0,6,
+0x221a40,1,
+0x221a60,1,
+0x221a68,23,
+0x221ac8,6,
+0x221b00,17,
+0x221b48,6,
+0x221b80,12,
+0x221c00,6,
+0x221c20,6,
+0x221c40,6,
+0x221c60,3,
+0x221d00,6,
+0x221d20,6,
+0x221d40,3,
+0x222000,5,
+0x222020,4,
+0x222034,17,
+0x222080,1,
+0x2220a0,6,
+0x222100,5,
+0x222120,4,
+0x222134,17,
+0x222180,1,
+0x2221a0,6,
+0x222200,5,
+0x222220,4,
+0x222234,17,
+0x222280,1,
+0x2222a0,6,
+0x222300,5,
+0x222320,4,
+0x222334,17,
+0x222380,1,
+0x2223a0,6,
+0x222500,6,
+0x22251c,7,
+0x222540,1,
+0x222c00,13,
+0x222c40,12,
+0x222c80,13,
+0x222cc0,12,
+0x222d00,6,
+0x222d20,6,
+0x222d80,14,
+0x222dc0,2,
+0x222e40,11,
+0x222e80,6,
+0x222ea0,6,
+0x223000,2,
+0x223010,5,
+0x223060,32,
+0x223100,8,
+0x223180,3,
+0x223190,2,
+0x22319c,5,
+0x223218,9,
+0x223240,3,
+0x223250,6,
+0x223280,1,
+0x223288,6,
+0x2232a4,1,
+0x223400,8,
+0x223424,2,
+0x223500,5,
+0x223520,4,
+0x223540,5,
+0x223560,4,
+0x223800,24,
+0x223864,5,
+0x223880,8,
+0x223900,13,
+0x223980,4,
+0x2239a0,6,
+0x223a40,1,
+0x223a60,1,
+0x223a68,23,
+0x223ac8,6,
+0x223b00,17,
+0x223b48,6,
+0x223b80,12,
+0x223c00,6,
+0x223c20,6,
+0x223c40,6,
+0x223c60,3,
+0x223d00,6,
+0x223d20,6,
+0x223d40,3,
+0x224000,29,
+0x224078,4,
+0x224090,2,
+0x2240a0,7,
+0x2240c0,11,
+0x224100,14,
+0x224140,14,
+0x224180,61,
+0x224278,4,
+0x224290,2,
+0x2242a0,7,
+0x2242c0,11,
+0x224300,14,
+0x224340,14,
+0x224380,61,
+0x224478,4,
+0x224490,2,
+0x2244a0,7,
+0x2244c0,11,
+0x224500,14,
+0x224540,14,
+0x224580,61,
+0x224678,4,
+0x224690,2,
+0x2246a0,7,
+0x2246c0,11,
+0x224700,14,
+0x224740,14,
+0x224780,67,
+0x224890,1,
+0x224a00,8,
+0x224a24,15,
+0x224a64,30,
+0x224b00,4,
+0x224b20,2,
+0x224c00,6,
+0x224c40,14,
+0x224c80,9,
+0x224d00,9,
+0x224d2c,1,
+0x224d40,3,
+0x224d60,1,
+0x224d80,3,
+0x224e00,2,
+0x224e0c,1,
+0x224e14,5,
+0x224e2c,1,
+0x224e34,5,
+0x224e4c,1,
+0x224e54,5,
+0x224e6c,1,
+0x224e74,5,
+0x224e8c,1,
+0x224e94,5,
+0x224eac,1,
+0x224eb4,3,
+0x225000,29,
+0x225078,4,
+0x225090,2,
+0x2250a0,7,
+0x2250c0,11,
+0x225100,14,
+0x225140,14,
+0x225180,61,
+0x225278,4,
+0x225290,2,
+0x2252a0,7,
+0x2252c0,11,
+0x225300,14,
+0x225340,14,
+0x225380,61,
+0x225478,4,
+0x225490,2,
+0x2254a0,7,
+0x2254c0,11,
+0x225500,14,
+0x225540,14,
+0x225580,61,
+0x225678,4,
+0x225690,2,
+0x2256a0,7,
+0x2256c0,11,
+0x225700,14,
+0x225740,14,
+0x225780,67,
+0x225890,1,
+0x225a00,8,
+0x225a24,15,
+0x225a64,30,
+0x225b00,4,
+0x225b20,2,
+0x225c00,6,
+0x225c40,14,
+0x225c80,9,
+0x225d00,9,
+0x225d2c,1,
+0x225d40,3,
+0x225d60,1,
+0x225d80,3,
+0x225e00,2,
+0x225e0c,1,
+0x225e14,5,
+0x225e2c,1,
+0x225e34,5,
+0x225e4c,1,
+0x225e54,5,
+0x225e6c,1,
+0x225e74,5,
+0x225e8c,1,
+0x225e94,5,
+0x225eac,1,
+0x225eb4,3,
+0x226000,14,
+0x226070,3,
+0x226080,6,
+0x226100,9,
+0x226204,1,
+0x22620c,6,
+0x226240,13,
+0x226280,16,
+0x226800,19,
+0x226850,10,
+0x226880,19,
+0x2268d0,10,
+0x226900,19,
+0x226950,10,
+0x226980,19,
+0x2269d0,10,
+0x226a00,19,
+0x226a50,10,
+0x226a80,19,
+0x226ad0,10,
+0x226b00,19,
+0x226b50,10,
+0x226b80,19,
+0x226bd0,10,
+0x226c00,19,
+0x226c60,6,
+0x226c84,1,
+0x226c94,8,
+0x226cb8,9,
+0x226ce0,4,
+0x227000,6,
+0x227020,3,
+0x227040,7,
+0x227060,6,
+0x227100,5,
+0x227138,1,
+0x227144,1,
+0x227150,2,
+0x228000,6,
+0x228020,3,
+0x228030,9,
+0x228100,6,
+0x228120,10,
+0x228150,8,
+0x228400,1,
+0x228428,1,
+0x228450,1,
+0x228478,1,
+0x2284a0,8,
+0x2285ac,1,
+0x2285d8,4,
+0x228600,6,
+0x228620,6,
+0x228640,3,
+0x228800,6,
+0x228820,3,
+0x228830,4,
+0x228858,2,
+0x228864,1,
+0x228874,3,
+0x228898,2,
+0x2288a4,1,
+0x2288b4,3,
+0x229000,6,
+0x229020,6,
+0x229040,3,
+0x229080,14,
+0x2290bc,1,
+0x2290c4,13,
+0x2290fc,1,
+0x229200,20,
+0x22925c,30,
+0x229300,24,
+0x229380,2,
+0x2293a0,1,
+0x2293c0,11,
+0x229404,3,
+0x229420,11,
+0x229460,3,
+0x229480,6,
+0x229500,6,
+0x229520,6,
+0x229540,1,
+0x229558,2,
+0x229600,17,
+0x229800,410,
+0x22a000,6,
+0x22a020,6,
+0x22a040,3,
+0x22a080,14,
+0x22a0bc,1,
+0x22a0c4,13,
+0x22a0fc,1,
+0x22a200,20,
+0x22a25c,30,
+0x22a300,24,
+0x22a380,2,
+0x22a3a0,1,
+0x22a3c0,11,
+0x22a404,3,
+0x22a420,11,
+0x22a460,3,
+0x22a480,6,
+0x22a500,6,
+0x22a520,6,
+0x22a540,1,
+0x22a558,2,
+0x22a600,17,
+0x22a800,410,
+0x22b000,4,
+0x22b020,25,
+0x22b088,8,
+0x22b100,4,
+0x22b120,25,
+0x22b188,8,
+0x22b200,34,
+0x22b300,37,
+0x22b400,16,
+0x22b464,1,
+0x22b474,3,
+0x22b500,6,
+0x22b520,2,
+0x22b530,9,
+0x22b570,10,
+0x22b5a0,2,
+0x22b5b0,9,
+0x22b5f0,4,
+0x22b620,7,
+0x22b640,16,
+0x22b700,6,
+0x22b720,6,
+0x22b740,6,
+0x22b760,6,
+0x22b780,3,
+0x22b800,5,
+0x22b818,1,
+0x22b854,6,
+0x22b880,2,
+0x22b8a4,1,
+0x22b8ac,2,
+0x22ba00,28,
+0x22ba7c,13,
+0x22bab4,1,
+0x22babc,10,
+0x22bb04,1,
+0x22bb0c,5,
+0x22bb24,1,
+0x22bb34,9,
+0x22bb60,6,
+0x22bb80,22,
+0x22bbe0,3,
+0x22bbf0,2,
+0x22bc00,5,
+0x22bc18,1,
+0x22bc54,6,
+0x22bc80,2,
+0x22bca4,1,
+0x22bcac,2,
+0x22be00,28,
+0x22be7c,13,
+0x22beb4,1,
+0x22bebc,10,
+0x22bf04,1,
+0x22bf0c,5,
+0x22bf24,1,
+0x22bf34,9,
+0x22bf60,6,
+0x22bf80,22,
+0x22bfe0,3,
+0x22bff0,2,
+0x22c008,2,
+0x22c014,11,
+0x22c044,1,
+0x22c04c,3,
+0x22c05c,1,
+0x22c064,1,
+0x22c07c,1,
+0x22c500,2,
+0x22c518,1,
+0x22c520,3,
+0x22c540,6,
+0x22c580,10,
+0x22c808,2,
+0x22c814,11,
+0x22c844,1,
+0x22c84c,3,
+0x22c85c,1,
+0x22c864,1,
+0x22c87c,1,
+0x22cd00,2,
+0x22cd18,1,
+0x22cd20,3,
+0x22cd40,6,
+0x22cd80,10,
+0x22d800,2,
+0x22d828,2,
+0x22d850,2,
+0x22d878,2,
+0x22d8a0,6,
+0x22d9ac,1,
+0x22d9d8,4,
+0x22da00,6,
+0x22da20,6,
+0x22da40,6,
+0x22da60,6,
+0x22da80,3,
+0x22dc00,6,
+0x22dc20,3,
+0x22dc40,2,
+0x22dc60,1,
+0x230000,5,
+0x230020,4,
+0x230034,17,
+0x230080,1,
+0x2300a0,6,
+0x230100,5,
+0x230120,4,
+0x230134,17,
+0x230180,1,
+0x2301a0,6,
+0x230200,5,
+0x230220,4,
+0x230234,17,
+0x230280,1,
+0x2302a0,6,
+0x230300,5,
+0x230320,4,
+0x230334,17,
+0x230380,1,
+0x2303a0,6,
+0x230500,6,
+0x23051c,7,
+0x230540,1,
+0x230c00,13,
+0x230c40,12,
+0x230c80,13,
+0x230cc0,12,
+0x230d00,6,
+0x230d20,6,
+0x230d80,14,
+0x230dc0,2,
+0x230e40,11,
+0x230e80,6,
+0x230ea0,6,
+0x231000,2,
+0x231010,5,
+0x231060,32,
+0x231100,8,
+0x231180,3,
+0x231190,2,
+0x23119c,5,
+0x231218,9,
+0x231240,3,
+0x231250,6,
+0x231280,1,
+0x231288,6,
+0x2312a4,1,
+0x231400,8,
+0x231424,2,
+0x231500,5,
+0x231520,4,
+0x231540,5,
+0x231560,4,
+0x231800,24,
+0x231864,5,
+0x231880,8,
+0x231900,13,
+0x231980,4,
+0x2319a0,6,
+0x231a40,1,
+0x231a60,1,
+0x231a68,23,
+0x231ac8,6,
+0x231b00,17,
+0x231b48,6,
+0x231b80,12,
+0x231c00,6,
+0x231c20,6,
+0x231c40,6,
+0x231c60,3,
+0x231d00,6,
+0x231d20,6,
+0x231d40,3,
+0x232000,5,
+0x232020,4,
+0x232034,17,
+0x232080,1,
+0x2320a0,6,
+0x232100,5,
+0x232120,4,
+0x232134,17,
+0x232180,1,
+0x2321a0,6,
+0x232200,5,
+0x232220,4,
+0x232234,17,
+0x232280,1,
+0x2322a0,6,
+0x232300,5,
+0x232320,4,
+0x232334,17,
+0x232380,1,
+0x2323a0,6,
+0x232500,6,
+0x23251c,7,
+0x232540,1,
+0x232c00,13,
+0x232c40,12,
+0x232c80,13,
+0x232cc0,12,
+0x232d00,6,
+0x232d20,6,
+0x232d80,14,
+0x232dc0,2,
+0x232e40,11,
+0x232e80,6,
+0x232ea0,6,
+0x233000,2,
+0x233010,5,
+0x233060,32,
+0x233100,8,
+0x233180,3,
+0x233190,2,
+0x23319c,5,
+0x233218,9,
+0x233240,3,
+0x233250,6,
+0x233280,1,
+0x233288,6,
+0x2332a4,1,
+0x233400,8,
+0x233424,2,
+0x233500,5,
+0x233520,4,
+0x233540,5,
+0x233560,4,
+0x233800,24,
+0x233864,5,
+0x233880,8,
+0x233900,13,
+0x233980,4,
+0x2339a0,6,
+0x233a40,1,
+0x233a60,1,
+0x233a68,23,
+0x233ac8,6,
+0x233b00,17,
+0x233b48,6,
+0x233b80,12,
+0x233c00,6,
+0x233c20,6,
+0x233c40,6,
+0x233c60,3,
+0x233d00,6,
+0x233d20,6,
+0x233d40,3,
+0x234000,29,
+0x234078,4,
+0x234090,2,
+0x2340a0,7,
+0x2340c0,11,
+0x234100,14,
+0x234140,14,
+0x234180,61,
+0x234278,4,
+0x234290,2,
+0x2342a0,7,
+0x2342c0,11,
+0x234300,14,
+0x234340,14,
+0x234380,61,
+0x234478,4,
+0x234490,2,
+0x2344a0,7,
+0x2344c0,11,
+0x234500,14,
+0x234540,14,
+0x234580,61,
+0x234678,4,
+0x234690,2,
+0x2346a0,7,
+0x2346c0,11,
+0x234700,14,
+0x234740,14,
+0x234780,67,
+0x234890,1,
+0x234a00,8,
+0x234a24,15,
+0x234a64,30,
+0x234b00,4,
+0x234b20,2,
+0x234c00,6,
+0x234c40,14,
+0x234c80,9,
+0x234d00,9,
+0x234d2c,1,
+0x234d40,3,
+0x234d60,1,
+0x234d80,3,
+0x234e00,2,
+0x234e0c,1,
+0x234e14,5,
+0x234e2c,1,
+0x234e34,5,
+0x234e4c,1,
+0x234e54,5,
+0x234e6c,1,
+0x234e74,5,
+0x234e8c,1,
+0x234e94,5,
+0x234eac,1,
+0x234eb4,3,
+0x235000,29,
+0x235078,4,
+0x235090,2,
+0x2350a0,7,
+0x2350c0,11,
+0x235100,14,
+0x235140,14,
+0x235180,61,
+0x235278,4,
+0x235290,2,
+0x2352a0,7,
+0x2352c0,11,
+0x235300,14,
+0x235340,14,
+0x235380,61,
+0x235478,4,
+0x235490,2,
+0x2354a0,7,
+0x2354c0,11,
+0x235500,14,
+0x235540,14,
+0x235580,61,
+0x235678,4,
+0x235690,2,
+0x2356a0,7,
+0x2356c0,11,
+0x235700,14,
+0x235740,14,
+0x235780,67,
+0x235890,1,
+0x235a00,8,
+0x235a24,15,
+0x235a64,30,
+0x235b00,4,
+0x235b20,2,
+0x235c00,6,
+0x235c40,14,
+0x235c80,9,
+0x235d00,9,
+0x235d2c,1,
+0x235d40,3,
+0x235d60,1,
+0x235d80,3,
+0x235e00,2,
+0x235e0c,1,
+0x235e14,5,
+0x235e2c,1,
+0x235e34,5,
+0x235e4c,1,
+0x235e54,5,
+0x235e6c,1,
+0x235e74,5,
+0x235e8c,1,
+0x235e94,5,
+0x235eac,1,
+0x235eb4,3,
+0x236000,14,
+0x236070,3,
+0x236080,6,
+0x236100,9,
+0x236204,1,
+0x23620c,6,
+0x236240,13,
+0x236280,16,
+0x236800,19,
+0x236850,10,
+0x236880,19,
+0x2368d0,10,
+0x236900,19,
+0x236950,10,
+0x236980,19,
+0x2369d0,10,
+0x236a00,19,
+0x236a50,10,
+0x236a80,19,
+0x236ad0,10,
+0x236b00,19,
+0x236b50,10,
+0x236b80,19,
+0x236bd0,10,
+0x236c00,19,
+0x236c60,6,
+0x236c84,1,
+0x236c94,8,
+0x236cb8,9,
+0x236ce0,4,
+0x237000,6,
+0x237020,3,
+0x237040,7,
+0x237060,6,
+0x237100,5,
+0x237138,1,
+0x237144,1,
+0x237150,2,
+0x238000,6,
+0x238020,3,
+0x238030,9,
+0x238100,6,
+0x238120,10,
+0x238150,8,
+0x238400,1,
+0x238428,1,
+0x238450,1,
+0x238478,1,
+0x2384a0,8,
+0x2385ac,1,
+0x2385d8,4,
+0x238600,6,
+0x238620,6,
+0x238640,3,
+0x238800,6,
+0x238820,3,
+0x238830,4,
+0x238858,2,
+0x238864,1,
+0x238874,3,
+0x238898,2,
+0x2388a4,1,
+0x2388b4,3,
+0x239000,6,
+0x239020,6,
+0x239040,3,
+0x239080,14,
+0x2390bc,1,
+0x2390c4,13,
+0x2390fc,1,
+0x239200,20,
+0x23925c,30,
+0x239300,24,
+0x239380,2,
+0x2393a0,1,
+0x2393c0,11,
+0x239404,3,
+0x239420,11,
+0x239460,3,
+0x239480,6,
+0x239500,6,
+0x239520,6,
+0x239540,1,
+0x239558,2,
+0x239600,17,
+0x239800,410,
+0x23a000,6,
+0x23a020,6,
+0x23a040,3,
+0x23a080,14,
+0x23a0bc,1,
+0x23a0c4,13,
+0x23a0fc,1,
+0x23a200,20,
+0x23a25c,30,
+0x23a300,24,
+0x23a380,2,
+0x23a3a0,1,
+0x23a3c0,11,
+0x23a404,3,
+0x23a420,11,
+0x23a460,3,
+0x23a480,6,
+0x23a500,6,
+0x23a520,6,
+0x23a540,1,
+0x23a558,2,
+0x23a600,17,
+0x23a800,410,
+0x23b000,4,
+0x23b020,25,
+0x23b088,8,
+0x23b100,4,
+0x23b120,25,
+0x23b188,8,
+0x23b200,34,
+0x23b300,37,
+0x23b400,16,
+0x23b464,1,
+0x23b474,3,
+0x23b500,6,
+0x23b520,2,
+0x23b530,9,
+0x23b570,10,
+0x23b5a0,2,
+0x23b5b0,9,
+0x23b5f0,4,
+0x23b620,7,
+0x23b640,16,
+0x23b700,6,
+0x23b720,6,
+0x23b740,6,
+0x23b760,6,
+0x23b780,3,
+0x23b800,5,
+0x23b818,1,
+0x23b854,6,
+0x23b880,2,
+0x23b8a4,1,
+0x23b8ac,2,
+0x23ba00,28,
+0x23ba7c,13,
+0x23bab4,1,
+0x23babc,10,
+0x23bb04,1,
+0x23bb0c,5,
+0x23bb24,1,
+0x23bb34,9,
+0x23bb60,6,
+0x23bb80,22,
+0x23bbe0,3,
+0x23bbf0,2,
+0x23bc00,5,
+0x23bc18,1,
+0x23bc54,6,
+0x23bc80,2,
+0x23bca4,1,
+0x23bcac,2,
+0x23be00,28,
+0x23be7c,13,
+0x23beb4,1,
+0x23bebc,10,
+0x23bf04,1,
+0x23bf0c,5,
+0x23bf24,1,
+0x23bf34,9,
+0x23bf60,6,
+0x23bf80,22,
+0x23bfe0,3,
+0x23bff0,2,
+0x23c008,2,
+0x23c014,11,
+0x23c044,1,
+0x23c04c,3,
+0x23c05c,1,
+0x23c064,1,
+0x23c07c,1,
+0x23c500,2,
+0x23c518,1,
+0x23c520,3,
+0x23c540,6,
+0x23c580,10,
+0x23c808,2,
+0x23c814,11,
+0x23c844,1,
+0x23c84c,3,
+0x23c85c,1,
+0x23c864,1,
+0x23c87c,1,
+0x23cd00,2,
+0x23cd18,1,
+0x23cd20,3,
+0x23cd40,6,
+0x23cd80,10,
+0x23d800,2,
+0x23d828,2,
+0x23d850,2,
+0x23d878,2,
+0x23d8a0,6,
+0x23d9ac,1,
+0x23d9d8,4,
+0x23da00,6,
+0x23da20,6,
+0x23da40,6,
+0x23da60,6,
+0x23da80,3,
+0x23dc00,6,
+0x23dc20,3,
+0x23dc40,2,
+0x23dc60,1,
+0x240000,5,
+0x240020,4,
+0x240034,17,
+0x240080,1,
+0x2400a0,6,
+0x240100,5,
+0x240120,4,
+0x240134,17,
+0x240180,1,
+0x2401a0,6,
+0x240200,5,
+0x240220,4,
+0x240234,17,
+0x240280,1,
+0x2402a0,6,
+0x240300,5,
+0x240320,4,
+0x240334,17,
+0x240380,1,
+0x2403a0,6,
+0x240500,6,
+0x24051c,7,
+0x240540,1,
+0x240c00,13,
+0x240c40,12,
+0x240c80,13,
+0x240cc0,12,
+0x240d00,6,
+0x240d20,6,
+0x240d80,14,
+0x240dc0,2,
+0x240e40,11,
+0x240e80,6,
+0x240ea0,6,
+0x241000,2,
+0x241010,5,
+0x241060,32,
+0x241100,8,
+0x241180,3,
+0x241190,2,
+0x24119c,5,
+0x241218,9,
+0x241240,3,
+0x241250,6,
+0x241280,1,
+0x241288,6,
+0x2412a4,1,
+0x241400,8,
+0x241424,2,
+0x241500,5,
+0x241520,4,
+0x241540,5,
+0x241560,4,
+0x241800,24,
+0x241864,5,
+0x241880,8,
+0x241900,13,
+0x241980,4,
+0x2419a0,6,
+0x241a40,1,
+0x241a60,1,
+0x241a68,23,
+0x241ac8,6,
+0x241b00,17,
+0x241b48,6,
+0x241b80,12,
+0x241c00,6,
+0x241c20,6,
+0x241c40,6,
+0x241c60,3,
+0x241d00,6,
+0x241d20,6,
+0x241d40,3,
+0x242000,5,
+0x242020,4,
+0x242034,17,
+0x242080,1,
+0x2420a0,6,
+0x242100,5,
+0x242120,4,
+0x242134,17,
+0x242180,1,
+0x2421a0,6,
+0x242200,5,
+0x242220,4,
+0x242234,17,
+0x242280,1,
+0x2422a0,6,
+0x242300,5,
+0x242320,4,
+0x242334,17,
+0x242380,1,
+0x2423a0,6,
+0x242500,6,
+0x24251c,7,
+0x242540,1,
+0x242c00,13,
+0x242c40,12,
+0x242c80,13,
+0x242cc0,12,
+0x242d00,6,
+0x242d20,6,
+0x242d80,14,
+0x242dc0,2,
+0x242e40,11,
+0x242e80,6,
+0x242ea0,6,
+0x243000,2,
+0x243010,5,
+0x243060,32,
+0x243100,8,
+0x243180,3,
+0x243190,2,
+0x24319c,5,
+0x243218,9,
+0x243240,3,
+0x243250,6,
+0x243280,1,
+0x243288,6,
+0x2432a4,1,
+0x243400,8,
+0x243424,2,
+0x243500,5,
+0x243520,4,
+0x243540,5,
+0x243560,4,
+0x243800,24,
+0x243864,5,
+0x243880,8,
+0x243900,13,
+0x243980,4,
+0x2439a0,6,
+0x243a40,1,
+0x243a60,1,
+0x243a68,23,
+0x243ac8,6,
+0x243b00,17,
+0x243b48,6,
+0x243b80,12,
+0x243c00,6,
+0x243c20,6,
+0x243c40,6,
+0x243c60,3,
+0x243d00,6,
+0x243d20,6,
+0x243d40,3,
+0x244000,29,
+0x244078,4,
+0x244090,2,
+0x2440a0,7,
+0x2440c0,11,
+0x244100,14,
+0x244140,14,
+0x244180,61,
+0x244278,4,
+0x244290,2,
+0x2442a0,7,
+0x2442c0,11,
+0x244300,14,
+0x244340,14,
+0x244380,61,
+0x244478,4,
+0x244490,2,
+0x2444a0,7,
+0x2444c0,11,
+0x244500,14,
+0x244540,14,
+0x244580,61,
+0x244678,4,
+0x244690,2,
+0x2446a0,7,
+0x2446c0,11,
+0x244700,14,
+0x244740,14,
+0x244780,67,
+0x244890,1,
+0x244a00,8,
+0x244a24,15,
+0x244a64,30,
+0x244b00,4,
+0x244b20,2,
+0x244c00,6,
+0x244c40,14,
+0x244c80,9,
+0x244d00,9,
+0x244d2c,1,
+0x244d40,3,
+0x244d60,1,
+0x244d80,3,
+0x244e00,2,
+0x244e0c,1,
+0x244e14,5,
+0x244e2c,1,
+0x244e34,5,
+0x244e4c,1,
+0x244e54,5,
+0x244e6c,1,
+0x244e74,5,
+0x244e8c,1,
+0x244e94,5,
+0x244eac,1,
+0x244eb4,3,
+0x245000,29,
+0x245078,4,
+0x245090,2,
+0x2450a0,7,
+0x2450c0,11,
+0x245100,14,
+0x245140,14,
+0x245180,61,
+0x245278,4,
+0x245290,2,
+0x2452a0,7,
+0x2452c0,11,
+0x245300,14,
+0x245340,14,
+0x245380,61,
+0x245478,4,
+0x245490,2,
+0x2454a0,7,
+0x2454c0,11,
+0x245500,14,
+0x245540,14,
+0x245580,61,
+0x245678,4,
+0x245690,2,
+0x2456a0,7,
+0x2456c0,11,
+0x245700,14,
+0x245740,14,
+0x245780,67,
+0x245890,1,
+0x245a00,8,
+0x245a24,15,
+0x245a64,30,
+0x245b00,4,
+0x245b20,2,
+0x245c00,6,
+0x245c40,14,
+0x245c80,9,
+0x245d00,9,
+0x245d2c,1,
+0x245d40,3,
+0x245d60,1,
+0x245d80,3,
+0x245e00,2,
+0x245e0c,1,
+0x245e14,5,
+0x245e2c,1,
+0x245e34,5,
+0x245e4c,1,
+0x245e54,5,
+0x245e6c,1,
+0x245e74,5,
+0x245e8c,1,
+0x245e94,5,
+0x245eac,1,
+0x245eb4,3,
+0x246000,14,
+0x246070,3,
+0x246080,6,
+0x246100,9,
+0x246204,1,
+0x24620c,6,
+0x246240,13,
+0x246280,16,
+0x246400,8,
+0x246424,15,
+0x246464,15,
+0x2464a4,15,
+0x2464e4,30,
+0x246580,10,
+0x2465ac,1,
+0x2465b4,5,
+0x2465cc,1,
+0x2465d4,5,
+0x2465ec,1,
+0x2465f4,13,
+0x246680,4,
+0x246694,2,
+0x2466a0,5,
+0x2466c0,5,
+0x2466e0,4,
+0x246800,19,
+0x246850,10,
+0x246880,19,
+0x2468d0,10,
+0x246900,19,
+0x246950,10,
+0x246980,19,
+0x2469d0,10,
+0x246a00,19,
+0x246a50,10,
+0x246a80,19,
+0x246ad0,10,
+0x246b00,19,
+0x246b50,10,
+0x246b80,19,
+0x246bd0,10,
+0x246c00,19,
+0x246c60,6,
+0x246c84,1,
+0x246c94,8,
+0x246cb8,9,
+0x246ce0,4,
+0x247000,6,
+0x247020,3,
+0x247040,7,
+0x247060,6,
+0x247100,5,
+0x247138,1,
+0x247144,1,
+0x247150,2,
+0x248000,6,
+0x248020,3,
+0x248030,9,
+0x248100,6,
+0x248120,10,
+0x248150,8,
+0x248400,1,
+0x248428,1,
+0x248450,1,
+0x248478,1,
+0x2484a0,8,
+0x2485ac,1,
+0x2485d8,4,
+0x248600,6,
+0x248620,6,
+0x248640,3,
+0x248800,6,
+0x248820,3,
+0x248830,4,
+0x248858,2,
+0x248864,1,
+0x248874,3,
+0x248898,2,
+0x2488a4,1,
+0x2488b4,3,
+0x249000,6,
+0x249020,6,
+0x249040,3,
+0x249080,14,
+0x2490bc,1,
+0x2490c4,13,
+0x2490fc,1,
+0x249200,20,
+0x24925c,30,
+0x249300,24,
+0x249380,2,
+0x2493a0,1,
+0x2493c0,11,
+0x249404,3,
+0x249420,11,
+0x249460,3,
+0x249480,6,
+0x249500,6,
+0x249520,6,
+0x249540,1,
+0x249558,2,
+0x249600,17,
+0x249800,410,
+0x24a000,6,
+0x24a020,6,
+0x24a040,3,
+0x24a080,14,
+0x24a0bc,1,
+0x24a0c4,13,
+0x24a0fc,1,
+0x24a200,20,
+0x24a25c,30,
+0x24a300,24,
+0x24a380,2,
+0x24a3a0,1,
+0x24a3c0,11,
+0x24a404,3,
+0x24a420,11,
+0x24a460,3,
+0x24a480,6,
+0x24a500,6,
+0x24a520,6,
+0x24a540,1,
+0x24a558,2,
+0x24a600,17,
+0x24a800,410,
+0x24b000,4,
+0x24b020,25,
+0x24b088,8,
+0x24b100,4,
+0x24b120,25,
+0x24b188,8,
+0x24b200,34,
+0x24b300,37,
+0x24b400,16,
+0x24b464,1,
+0x24b474,3,
+0x24b500,6,
+0x24b520,2,
+0x24b530,9,
+0x24b570,10,
+0x24b5a0,2,
+0x24b5b0,9,
+0x24b5f0,4,
+0x24b620,7,
+0x24b640,16,
+0x24b700,6,
+0x24b720,6,
+0x24b740,6,
+0x24b760,6,
+0x24b780,3,
+0x24b800,5,
+0x24b818,1,
+0x24b854,6,
+0x24b880,2,
+0x24b8a4,1,
+0x24b8ac,2,
+0x24ba00,28,
+0x24ba7c,13,
+0x24bab4,1,
+0x24babc,10,
+0x24bb04,1,
+0x24bb0c,5,
+0x24bb24,1,
+0x24bb34,9,
+0x24bb60,6,
+0x24bb80,22,
+0x24bbe0,3,
+0x24bbf0,2,
+0x24bc00,5,
+0x24bc18,1,
+0x24bc54,6,
+0x24bc80,2,
+0x24bca4,1,
+0x24bcac,2,
+0x24be00,28,
+0x24be7c,13,
+0x24beb4,1,
+0x24bebc,10,
+0x24bf04,1,
+0x24bf0c,5,
+0x24bf24,1,
+0x24bf34,9,
+0x24bf60,6,
+0x24bf80,22,
+0x24bfe0,3,
+0x24bff0,2,
+0x24c008,2,
+0x24c014,11,
+0x24c044,1,
+0x24c04c,3,
+0x24c05c,1,
+0x24c064,1,
+0x24c07c,1,
+0x24c500,2,
+0x24c518,1,
+0x24c520,3,
+0x24c540,6,
+0x24c580,10,
+0x24c808,2,
+0x24c814,11,
+0x24c844,1,
+0x24c84c,3,
+0x24c85c,1,
+0x24c864,1,
+0x24c87c,1,
+0x24cd00,2,
+0x24cd18,1,
+0x24cd20,3,
+0x24cd40,6,
+0x24cd80,10,
+0x24d800,2,
+0x24d828,2,
+0x24d850,2,
+0x24d878,2,
+0x24d8a0,6,
+0x24d9ac,1,
+0x24d9d8,4,
+0x24da00,6,
+0x24da20,6,
+0x24da40,6,
+0x24da60,6,
+0x24da80,3,
+0x24dc00,6,
+0x24dc20,3,
+0x24dc40,2,
+0x24dc60,1,
+0x250000,5,
+0x250020,4,
+0x250034,17,
+0x250080,1,
+0x2500a0,6,
+0x250100,5,
+0x250120,4,
+0x250134,17,
+0x250180,1,
+0x2501a0,6,
+0x250200,5,
+0x250220,4,
+0x250234,17,
+0x250280,1,
+0x2502a0,6,
+0x250300,5,
+0x250320,4,
+0x250334,17,
+0x250380,1,
+0x2503a0,6,
+0x250500,6,
+0x25051c,7,
+0x250540,1,
+0x250c00,13,
+0x250c40,12,
+0x250c80,13,
+0x250cc0,12,
+0x250d00,6,
+0x250d20,6,
+0x250d80,14,
+0x250dc0,2,
+0x250e40,11,
+0x250e80,6,
+0x250ea0,6,
+0x251000,2,
+0x251010,5,
+0x251060,32,
+0x251100,8,
+0x251180,3,
+0x251190,2,
+0x25119c,5,
+0x251218,9,
+0x251240,3,
+0x251250,6,
+0x251280,1,
+0x251288,6,
+0x2512a4,1,
+0x251400,8,
+0x251424,2,
+0x251500,5,
+0x251520,4,
+0x251540,5,
+0x251560,4,
+0x251800,24,
+0x251864,5,
+0x251880,8,
+0x251900,13,
+0x251980,4,
+0x2519a0,6,
+0x251a40,1,
+0x251a60,1,
+0x251a68,23,
+0x251ac8,6,
+0x251b00,17,
+0x251b48,6,
+0x251b80,12,
+0x251c00,6,
+0x251c20,6,
+0x251c40,6,
+0x251c60,3,
+0x251d00,6,
+0x251d20,6,
+0x251d40,3,
+0x252000,5,
+0x252020,4,
+0x252034,17,
+0x252080,1,
+0x2520a0,6,
+0x252100,5,
+0x252120,4,
+0x252134,17,
+0x252180,1,
+0x2521a0,6,
+0x252200,5,
+0x252220,4,
+0x252234,17,
+0x252280,1,
+0x2522a0,6,
+0x252300,5,
+0x252320,4,
+0x252334,17,
+0x252380,1,
+0x2523a0,6,
+0x252500,6,
+0x25251c,7,
+0x252540,1,
+0x252c00,13,
+0x252c40,12,
+0x252c80,13,
+0x252cc0,12,
+0x252d00,6,
+0x252d20,6,
+0x252d80,14,
+0x252dc0,2,
+0x252e40,11,
+0x252e80,6,
+0x252ea0,6,
+0x253000,2,
+0x253010,5,
+0x253060,32,
+0x253100,8,
+0x253180,3,
+0x253190,2,
+0x25319c,5,
+0x253218,9,
+0x253240,3,
+0x253250,6,
+0x253280,1,
+0x253288,6,
+0x2532a4,1,
+0x253400,8,
+0x253424,2,
+0x253500,5,
+0x253520,4,
+0x253540,5,
+0x253560,4,
+0x253800,24,
+0x253864,5,
+0x253880,8,
+0x253900,13,
+0x253980,4,
+0x2539a0,6,
+0x253a40,1,
+0x253a60,1,
+0x253a68,23,
+0x253ac8,6,
+0x253b00,17,
+0x253b48,6,
+0x253b80,12,
+0x253c00,6,
+0x253c20,6,
+0x253c40,6,
+0x253c60,3,
+0x253d00,6,
+0x253d20,6,
+0x253d40,3,
+0x254000,29,
+0x254078,4,
+0x254090,2,
+0x2540a0,7,
+0x2540c0,11,
+0x254100,14,
+0x254140,14,
+0x254180,61,
+0x254278,4,
+0x254290,2,
+0x2542a0,7,
+0x2542c0,11,
+0x254300,14,
+0x254340,14,
+0x254380,61,
+0x254478,4,
+0x254490,2,
+0x2544a0,7,
+0x2544c0,11,
+0x254500,14,
+0x254540,14,
+0x254580,61,
+0x254678,4,
+0x254690,2,
+0x2546a0,7,
+0x2546c0,11,
+0x254700,14,
+0x254740,14,
+0x254780,67,
+0x254890,1,
+0x254a00,8,
+0x254a24,15,
+0x254a64,30,
+0x254b00,4,
+0x254b20,2,
+0x254c00,6,
+0x254c40,14,
+0x254c80,9,
+0x254d00,9,
+0x254d2c,1,
+0x254d40,3,
+0x254d60,1,
+0x254d80,3,
+0x254e00,2,
+0x254e0c,1,
+0x254e14,5,
+0x254e2c,1,
+0x254e34,5,
+0x254e4c,1,
+0x254e54,5,
+0x254e6c,1,
+0x254e74,5,
+0x254e8c,1,
+0x254e94,5,
+0x254eac,1,
+0x254eb4,3,
+0x255000,29,
+0x255078,4,
+0x255090,2,
+0x2550a0,7,
+0x2550c0,11,
+0x255100,14,
+0x255140,14,
+0x255180,61,
+0x255278,4,
+0x255290,2,
+0x2552a0,7,
+0x2552c0,11,
+0x255300,14,
+0x255340,14,
+0x255380,61,
+0x255478,4,
+0x255490,2,
+0x2554a0,7,
+0x2554c0,11,
+0x255500,14,
+0x255540,14,
+0x255580,61,
+0x255678,4,
+0x255690,2,
+0x2556a0,7,
+0x2556c0,11,
+0x255700,14,
+0x255740,14,
+0x255780,67,
+0x255890,1,
+0x255a00,8,
+0x255a24,15,
+0x255a64,30,
+0x255b00,4,
+0x255b20,2,
+0x255c00,6,
+0x255c40,14,
+0x255c80,9,
+0x255d00,9,
+0x255d2c,1,
+0x255d40,3,
+0x255d60,1,
+0x255d80,3,
+0x255e00,2,
+0x255e0c,1,
+0x255e14,5,
+0x255e2c,1,
+0x255e34,5,
+0x255e4c,1,
+0x255e54,5,
+0x255e6c,1,
+0x255e74,5,
+0x255e8c,1,
+0x255e94,5,
+0x255eac,1,
+0x255eb4,3,
+0x256000,14,
+0x256070,3,
+0x256080,6,
+0x256100,9,
+0x256204,1,
+0x25620c,6,
+0x256240,13,
+0x256280,16,
+0x256800,19,
+0x256850,10,
+0x256880,19,
+0x2568d0,10,
+0x256900,19,
+0x256950,10,
+0x256980,19,
+0x2569d0,10,
+0x256a00,19,
+0x256a50,10,
+0x256a80,19,
+0x256ad0,10,
+0x256b00,19,
+0x256b50,10,
+0x256b80,19,
+0x256bd0,10,
+0x256c00,19,
+0x256c60,6,
+0x256c84,1,
+0x256c94,8,
+0x256cb8,9,
+0x256ce0,4,
+0x257000,6,
+0x257020,3,
+0x257040,7,
+0x257060,6,
+0x257100,5,
+0x257138,1,
+0x257144,1,
+0x257150,2,
+0x258000,6,
+0x258020,3,
+0x258030,9,
+0x258100,6,
+0x258120,10,
+0x258150,8,
+0x258400,1,
+0x258428,1,
+0x258450,1,
+0x258478,1,
+0x2584a0,8,
+0x2585ac,1,
+0x2585d8,4,
+0x258600,6,
+0x258620,6,
+0x258640,3,
+0x258800,6,
+0x258820,3,
+0x258830,4,
+0x258858,2,
+0x258864,1,
+0x258874,3,
+0x258898,2,
+0x2588a4,1,
+0x2588b4,3,
+0x259000,6,
+0x259020,6,
+0x259040,3,
+0x259080,14,
+0x2590bc,1,
+0x2590c4,13,
+0x2590fc,1,
+0x259200,20,
+0x25925c,30,
+0x259300,24,
+0x259380,2,
+0x2593a0,1,
+0x2593c0,11,
+0x259404,3,
+0x259420,11,
+0x259460,3,
+0x259480,6,
+0x259500,6,
+0x259520,6,
+0x259540,1,
+0x259558,2,
+0x259600,17,
+0x259800,410,
+0x25a000,6,
+0x25a020,6,
+0x25a040,3,
+0x25a080,14,
+0x25a0bc,1,
+0x25a0c4,13,
+0x25a0fc,1,
+0x25a200,20,
+0x25a25c,30,
+0x25a300,24,
+0x25a380,2,
+0x25a3a0,1,
+0x25a3c0,11,
+0x25a404,3,
+0x25a420,11,
+0x25a460,3,
+0x25a480,6,
+0x25a500,6,
+0x25a520,6,
+0x25a540,1,
+0x25a558,2,
+0x25a600,17,
+0x25a800,410,
+0x25b000,4,
+0x25b020,25,
+0x25b088,8,
+0x25b100,4,
+0x25b120,25,
+0x25b188,8,
+0x25b200,34,
+0x25b300,37,
+0x25b400,16,
+0x25b464,1,
+0x25b474,3,
+0x25b500,6,
+0x25b520,2,
+0x25b530,9,
+0x25b570,10,
+0x25b5a0,2,
+0x25b5b0,9,
+0x25b5f0,4,
+0x25b620,7,
+0x25b640,16,
+0x25b700,6,
+0x25b720,6,
+0x25b740,6,
+0x25b760,6,
+0x25b780,3,
+0x25b800,5,
+0x25b818,1,
+0x25b854,6,
+0x25b880,2,
+0x25b8a4,1,
+0x25b8ac,2,
+0x25ba00,28,
+0x25ba7c,13,
+0x25bab4,1,
+0x25babc,10,
+0x25bb04,1,
+0x25bb0c,5,
+0x25bb24,1,
+0x25bb34,9,
+0x25bb60,6,
+0x25bb80,22,
+0x25bbe0,3,
+0x25bbf0,2,
+0x25bc00,5,
+0x25bc18,1,
+0x25bc54,6,
+0x25bc80,2,
+0x25bca4,1,
+0x25bcac,2,
+0x25be00,28,
+0x25be7c,13,
+0x25beb4,1,
+0x25bebc,10,
+0x25bf04,1,
+0x25bf0c,5,
+0x25bf24,1,
+0x25bf34,9,
+0x25bf60,6,
+0x25bf80,22,
+0x25bfe0,3,
+0x25bff0,2,
+0x25c008,2,
+0x25c014,11,
+0x25c044,1,
+0x25c04c,3,
+0x25c05c,1,
+0x25c064,1,
+0x25c07c,1,
+0x25c500,2,
+0x25c518,1,
+0x25c520,3,
+0x25c540,6,
+0x25c580,10,
+0x25c808,2,
+0x25c814,11,
+0x25c844,1,
+0x25c84c,3,
+0x25c85c,1,
+0x25c864,1,
+0x25c87c,1,
+0x25cd00,2,
+0x25cd18,1,
+0x25cd20,3,
+0x25cd40,6,
+0x25cd80,10,
+0x25d800,2,
+0x25d828,2,
+0x25d850,2,
+0x25d878,2,
+0x25d8a0,6,
+0x25d9ac,1,
+0x25d9d8,4,
+0x25da00,6,
+0x25da20,6,
+0x25da40,6,
+0x25da60,6,
+0x25da80,3,
+0x25dc00,6,
+0x25dc20,3,
+0x25dc40,2,
+0x25dc60,1,
+0x260000,5,
+0x260020,4,
+0x260034,17,
+0x260080,1,
+0x2600a0,6,
+0x260100,5,
+0x260120,4,
+0x260134,17,
+0x260180,1,
+0x2601a0,6,
+0x260200,5,
+0x260220,4,
+0x260234,17,
+0x260280,1,
+0x2602a0,6,
+0x260300,5,
+0x260320,4,
+0x260334,17,
+0x260380,1,
+0x2603a0,6,
+0x260500,6,
+0x26051c,7,
+0x260540,1,
+0x260c00,13,
+0x260c40,12,
+0x260c80,13,
+0x260cc0,12,
+0x260d00,6,
+0x260d20,6,
+0x260d80,14,
+0x260dc0,2,
+0x260e40,11,
+0x260e80,6,
+0x260ea0,6,
+0x261000,2,
+0x261010,5,
+0x261060,32,
+0x261100,8,
+0x261180,3,
+0x261190,2,
+0x26119c,5,
+0x261218,9,
+0x261240,3,
+0x261250,6,
+0x261280,1,
+0x261288,6,
+0x2612a4,1,
+0x261400,8,
+0x261424,2,
+0x261500,5,
+0x261520,4,
+0x261540,5,
+0x261560,4,
+0x261800,24,
+0x261864,5,
+0x261880,8,
+0x261900,13,
+0x261980,4,
+0x2619a0,6,
+0x261a40,1,
+0x261a60,1,
+0x261a68,23,
+0x261ac8,6,
+0x261b00,17,
+0x261b48,6,
+0x261b80,12,
+0x261c00,6,
+0x261c20,6,
+0x261c40,6,
+0x261c60,3,
+0x261d00,6,
+0x261d20,6,
+0x261d40,3,
+0x262000,5,
+0x262020,4,
+0x262034,17,
+0x262080,1,
+0x2620a0,6,
+0x262100,5,
+0x262120,4,
+0x262134,17,
+0x262180,1,
+0x2621a0,6,
+0x262200,5,
+0x262220,4,
+0x262234,17,
+0x262280,1,
+0x2622a0,6,
+0x262300,5,
+0x262320,4,
+0x262334,17,
+0x262380,1,
+0x2623a0,6,
+0x262500,6,
+0x26251c,7,
+0x262540,1,
+0x262c00,13,
+0x262c40,12,
+0x262c80,13,
+0x262cc0,12,
+0x262d00,6,
+0x262d20,6,
+0x262d80,14,
+0x262dc0,2,
+0x262e40,11,
+0x262e80,6,
+0x262ea0,6,
+0x263000,2,
+0x263010,5,
+0x263060,32,
+0x263100,8,
+0x263180,3,
+0x263190,2,
+0x26319c,5,
+0x263218,9,
+0x263240,3,
+0x263250,6,
+0x263280,1,
+0x263288,6,
+0x2632a4,1,
+0x263400,8,
+0x263424,2,
+0x263500,5,
+0x263520,4,
+0x263540,5,
+0x263560,4,
+0x263800,24,
+0x263864,5,
+0x263880,8,
+0x263900,13,
+0x263980,4,
+0x2639a0,6,
+0x263a40,1,
+0x263a60,1,
+0x263a68,23,
+0x263ac8,6,
+0x263b00,17,
+0x263b48,6,
+0x263b80,12,
+0x263c00,6,
+0x263c20,6,
+0x263c40,6,
+0x263c60,3,
+0x263d00,6,
+0x263d20,6,
+0x263d40,3,
+0x264000,29,
+0x264078,4,
+0x264090,2,
+0x2640a0,7,
+0x2640c0,11,
+0x264100,14,
+0x264140,14,
+0x264180,61,
+0x264278,4,
+0x264290,2,
+0x2642a0,7,
+0x2642c0,11,
+0x264300,14,
+0x264340,14,
+0x264380,61,
+0x264478,4,
+0x264490,2,
+0x2644a0,7,
+0x2644c0,11,
+0x264500,14,
+0x264540,14,
+0x264580,61,
+0x264678,4,
+0x264690,2,
+0x2646a0,7,
+0x2646c0,11,
+0x264700,14,
+0x264740,14,
+0x264780,67,
+0x264890,1,
+0x264a00,8,
+0x264a24,15,
+0x264a64,30,
+0x264b00,4,
+0x264b20,2,
+0x264c00,6,
+0x264c40,14,
+0x264c80,9,
+0x264d00,9,
+0x264d2c,1,
+0x264d40,3,
+0x264d60,1,
+0x264d80,3,
+0x264e00,2,
+0x264e0c,1,
+0x264e14,5,
+0x264e2c,1,
+0x264e34,5,
+0x264e4c,1,
+0x264e54,5,
+0x264e6c,1,
+0x264e74,5,
+0x264e8c,1,
+0x264e94,5,
+0x264eac,1,
+0x264eb4,3,
+0x265000,29,
+0x265078,4,
+0x265090,2,
+0x2650a0,7,
+0x2650c0,11,
+0x265100,14,
+0x265140,14,
+0x265180,61,
+0x265278,4,
+0x265290,2,
+0x2652a0,7,
+0x2652c0,11,
+0x265300,14,
+0x265340,14,
+0x265380,61,
+0x265478,4,
+0x265490,2,
+0x2654a0,7,
+0x2654c0,11,
+0x265500,14,
+0x265540,14,
+0x265580,61,
+0x265678,4,
+0x265690,2,
+0x2656a0,7,
+0x2656c0,11,
+0x265700,14,
+0x265740,14,
+0x265780,67,
+0x265890,1,
+0x265a00,8,
+0x265a24,15,
+0x265a64,30,
+0x265b00,4,
+0x265b20,2,
+0x265c00,6,
+0x265c40,14,
+0x265c80,9,
+0x265d00,9,
+0x265d2c,1,
+0x265d40,3,
+0x265d60,1,
+0x265d80,3,
+0x265e00,2,
+0x265e0c,1,
+0x265e14,5,
+0x265e2c,1,
+0x265e34,5,
+0x265e4c,1,
+0x265e54,5,
+0x265e6c,1,
+0x265e74,5,
+0x265e8c,1,
+0x265e94,5,
+0x265eac,1,
+0x265eb4,3,
+0x266000,14,
+0x266070,3,
+0x266080,6,
+0x266100,9,
+0x266204,1,
+0x26620c,6,
+0x266240,13,
+0x266280,16,
+0x266800,19,
+0x266850,10,
+0x266880,19,
+0x2668d0,10,
+0x266900,19,
+0x266950,10,
+0x266980,19,
+0x2669d0,10,
+0x266a00,19,
+0x266a50,10,
+0x266a80,19,
+0x266ad0,10,
+0x266b00,19,
+0x266b50,10,
+0x266b80,19,
+0x266bd0,10,
+0x266c00,19,
+0x266c60,6,
+0x266c84,1,
+0x266c94,8,
+0x266cb8,9,
+0x266ce0,4,
+0x267000,6,
+0x267020,3,
+0x267040,7,
+0x267060,6,
+0x267100,5,
+0x267138,1,
+0x267144,1,
+0x267150,2,
+0x268000,6,
+0x268020,3,
+0x268030,9,
+0x268100,6,
+0x268120,10,
+0x268150,8,
+0x268400,1,
+0x268428,1,
+0x268450,1,
+0x268478,1,
+0x2684a0,8,
+0x2685ac,1,
+0x2685d8,4,
+0x268600,6,
+0x268620,6,
+0x268640,3,
+0x268800,6,
+0x268820,3,
+0x268830,4,
+0x268858,2,
+0x268864,1,
+0x268874,3,
+0x268898,2,
+0x2688a4,1,
+0x2688b4,3,
+0x269000,6,
+0x269020,6,
+0x269040,3,
+0x269080,14,
+0x2690bc,1,
+0x2690c4,13,
+0x2690fc,1,
+0x269200,20,
+0x26925c,30,
+0x269300,24,
+0x269380,2,
+0x2693a0,1,
+0x2693c0,11,
+0x269404,3,
+0x269420,11,
+0x269460,3,
+0x269480,6,
+0x269500,6,
+0x269520,6,
+0x269540,1,
+0x269558,2,
+0x269600,17,
+0x269800,410,
+0x26a000,6,
+0x26a020,6,
+0x26a040,3,
+0x26a080,14,
+0x26a0bc,1,
+0x26a0c4,13,
+0x26a0fc,1,
+0x26a200,20,
+0x26a25c,30,
+0x26a300,24,
+0x26a380,2,
+0x26a3a0,1,
+0x26a3c0,11,
+0x26a404,3,
+0x26a420,11,
+0x26a460,3,
+0x26a480,6,
+0x26a500,6,
+0x26a520,6,
+0x26a540,1,
+0x26a558,2,
+0x26a600,17,
+0x26a800,410,
+0x26b000,4,
+0x26b020,25,
+0x26b088,8,
+0x26b100,4,
+0x26b120,25,
+0x26b188,8,
+0x26b200,34,
+0x26b300,37,
+0x26b400,16,
+0x26b464,1,
+0x26b474,3,
+0x26b500,6,
+0x26b520,2,
+0x26b530,9,
+0x26b570,10,
+0x26b5a0,2,
+0x26b5b0,9,
+0x26b5f0,4,
+0x26b620,7,
+0x26b640,16,
+0x26b700,6,
+0x26b720,6,
+0x26b740,6,
+0x26b760,6,
+0x26b780,3,
+0x26b800,5,
+0x26b818,1,
+0x26b854,6,
+0x26b880,2,
+0x26b8a4,1,
+0x26b8ac,2,
+0x26ba00,28,
+0x26ba7c,13,
+0x26bab4,1,
+0x26babc,10,
+0x26bb04,1,
+0x26bb0c,5,
+0x26bb24,1,
+0x26bb34,9,
+0x26bb60,6,
+0x26bb80,22,
+0x26bbe0,3,
+0x26bbf0,2,
+0x26bc00,5,
+0x26bc18,1,
+0x26bc54,6,
+0x26bc80,2,
+0x26bca4,1,
+0x26bcac,2,
+0x26be00,28,
+0x26be7c,13,
+0x26beb4,1,
+0x26bebc,10,
+0x26bf04,1,
+0x26bf0c,5,
+0x26bf24,1,
+0x26bf34,9,
+0x26bf60,6,
+0x26bf80,22,
+0x26bfe0,3,
+0x26bff0,2,
+0x26c008,2,
+0x26c014,11,
+0x26c044,1,
+0x26c04c,3,
+0x26c05c,1,
+0x26c064,1,
+0x26c07c,1,
+0x26c500,2,
+0x26c518,1,
+0x26c520,3,
+0x26c540,6,
+0x26c580,10,
+0x26c808,2,
+0x26c814,11,
+0x26c844,1,
+0x26c84c,3,
+0x26c85c,1,
+0x26c864,1,
+0x26c87c,1,
+0x26cd00,2,
+0x26cd18,1,
+0x26cd20,3,
+0x26cd40,6,
+0x26cd80,10,
+0x26d800,2,
+0x26d828,2,
+0x26d850,2,
+0x26d878,2,
+0x26d8a0,6,
+0x26d9ac,1,
+0x26d9d8,4,
+0x26da00,6,
+0x26da20,6,
+0x26da40,6,
+0x26da60,6,
+0x26da80,3,
+0x26dc00,6,
+0x26dc20,3,
+0x26dc40,2,
+0x26dc60,1,
+0x270000,5,
+0x270020,4,
+0x270034,17,
+0x270080,1,
+0x2700a0,6,
+0x270100,5,
+0x270120,4,
+0x270134,17,
+0x270180,1,
+0x2701a0,6,
+0x270200,5,
+0x270220,4,
+0x270234,17,
+0x270280,1,
+0x2702a0,6,
+0x270300,5,
+0x270320,4,
+0x270334,17,
+0x270380,1,
+0x2703a0,6,
+0x270500,6,
+0x27051c,7,
+0x270540,1,
+0x270c00,13,
+0x270c40,12,
+0x270c80,13,
+0x270cc0,12,
+0x270d00,6,
+0x270d20,6,
+0x270d80,14,
+0x270dc0,2,
+0x270e40,11,
+0x270e80,6,
+0x270ea0,6,
+0x271000,2,
+0x271010,5,
+0x271060,32,
+0x271100,8,
+0x271180,3,
+0x271190,2,
+0x27119c,5,
+0x271218,9,
+0x271240,3,
+0x271250,6,
+0x271280,1,
+0x271288,6,
+0x2712a4,1,
+0x271400,8,
+0x271424,2,
+0x271500,5,
+0x271520,4,
+0x271540,5,
+0x271560,4,
+0x271800,24,
+0x271864,5,
+0x271880,8,
+0x271900,13,
+0x271980,4,
+0x2719a0,6,
+0x271a40,1,
+0x271a60,1,
+0x271a68,23,
+0x271ac8,6,
+0x271b00,17,
+0x271b48,6,
+0x271b80,12,
+0x271c00,6,
+0x271c20,6,
+0x271c40,6,
+0x271c60,3,
+0x271d00,6,
+0x271d20,6,
+0x271d40,3,
+0x272000,5,
+0x272020,4,
+0x272034,17,
+0x272080,1,
+0x2720a0,6,
+0x272100,5,
+0x272120,4,
+0x272134,17,
+0x272180,1,
+0x2721a0,6,
+0x272200,5,
+0x272220,4,
+0x272234,17,
+0x272280,1,
+0x2722a0,6,
+0x272300,5,
+0x272320,4,
+0x272334,17,
+0x272380,1,
+0x2723a0,6,
+0x272500,6,
+0x27251c,7,
+0x272540,1,
+0x272c00,13,
+0x272c40,12,
+0x272c80,13,
+0x272cc0,12,
+0x272d00,6,
+0x272d20,6,
+0x272d80,14,
+0x272dc0,2,
+0x272e40,11,
+0x272e80,6,
+0x272ea0,6,
+0x273000,2,
+0x273010,5,
+0x273060,32,
+0x273100,8,
+0x273180,3,
+0x273190,2,
+0x27319c,5,
+0x273218,9,
+0x273240,3,
+0x273250,6,
+0x273280,1,
+0x273288,6,
+0x2732a4,1,
+0x273400,8,
+0x273424,2,
+0x273500,5,
+0x273520,4,
+0x273540,5,
+0x273560,4,
+0x273800,24,
+0x273864,5,
+0x273880,8,
+0x273900,13,
+0x273980,4,
+0x2739a0,6,
+0x273a40,1,
+0x273a60,1,
+0x273a68,23,
+0x273ac8,6,
+0x273b00,17,
+0x273b48,6,
+0x273b80,12,
+0x273c00,6,
+0x273c20,6,
+0x273c40,6,
+0x273c60,3,
+0x273d00,6,
+0x273d20,6,
+0x273d40,3,
+0x274000,29,
+0x274078,4,
+0x274090,2,
+0x2740a0,7,
+0x2740c0,11,
+0x274100,14,
+0x274140,14,
+0x274180,61,
+0x274278,4,
+0x274290,2,
+0x2742a0,7,
+0x2742c0,11,
+0x274300,14,
+0x274340,14,
+0x274380,61,
+0x274478,4,
+0x274490,2,
+0x2744a0,7,
+0x2744c0,11,
+0x274500,14,
+0x274540,14,
+0x274580,61,
+0x274678,4,
+0x274690,2,
+0x2746a0,7,
+0x2746c0,11,
+0x274700,14,
+0x274740,14,
+0x274780,67,
+0x274890,1,
+0x274a00,8,
+0x274a24,15,
+0x274a64,30,
+0x274b00,4,
+0x274b20,2,
+0x274c00,6,
+0x274c40,14,
+0x274c80,9,
+0x274d00,9,
+0x274d2c,1,
+0x274d40,3,
+0x274d60,1,
+0x274d80,3,
+0x274e00,2,
+0x274e0c,1,
+0x274e14,5,
+0x274e2c,1,
+0x274e34,5,
+0x274e4c,1,
+0x274e54,5,
+0x274e6c,1,
+0x274e74,5,
+0x274e8c,1,
+0x274e94,5,
+0x274eac,1,
+0x274eb4,3,
+0x275000,29,
+0x275078,4,
+0x275090,2,
+0x2750a0,7,
+0x2750c0,11,
+0x275100,14,
+0x275140,14,
+0x275180,61,
+0x275278,4,
+0x275290,2,
+0x2752a0,7,
+0x2752c0,11,
+0x275300,14,
+0x275340,14,
+0x275380,61,
+0x275478,4,
+0x275490,2,
+0x2754a0,7,
+0x2754c0,11,
+0x275500,14,
+0x275540,14,
+0x275580,61,
+0x275678,4,
+0x275690,2,
+0x2756a0,7,
+0x2756c0,11,
+0x275700,14,
+0x275740,14,
+0x275780,67,
+0x275890,1,
+0x275a00,8,
+0x275a24,15,
+0x275a64,30,
+0x275b00,4,
+0x275b20,2,
+0x275c00,6,
+0x275c40,14,
+0x275c80,9,
+0x275d00,9,
+0x275d2c,1,
+0x275d40,3,
+0x275d60,1,
+0x275d80,3,
+0x275e00,2,
+0x275e0c,1,
+0x275e14,5,
+0x275e2c,1,
+0x275e34,5,
+0x275e4c,1,
+0x275e54,5,
+0x275e6c,1,
+0x275e74,5,
+0x275e8c,1,
+0x275e94,5,
+0x275eac,1,
+0x275eb4,3,
+0x276000,14,
+0x276070,3,
+0x276080,6,
+0x276100,9,
+0x276204,1,
+0x27620c,6,
+0x276240,13,
+0x276280,16,
+0x276800,19,
+0x276850,10,
+0x276880,19,
+0x2768d0,10,
+0x276900,19,
+0x276950,10,
+0x276980,19,
+0x2769d0,10,
+0x276a00,19,
+0x276a50,10,
+0x276a80,19,
+0x276ad0,10,
+0x276b00,19,
+0x276b50,10,
+0x276b80,19,
+0x276bd0,10,
+0x276c00,19,
+0x276c60,6,
+0x276c84,1,
+0x276c94,8,
+0x276cb8,9,
+0x276ce0,4,
+0x277000,6,
+0x277020,3,
+0x277040,7,
+0x277060,6,
+0x277100,5,
+0x277138,1,
+0x277144,1,
+0x277150,2,
+0x278000,6,
+0x278020,3,
+0x278030,9,
+0x278100,6,
+0x278120,10,
+0x278150,8,
+0x278400,1,
+0x278428,1,
+0x278450,1,
+0x278478,1,
+0x2784a0,8,
+0x2785ac,1,
+0x2785d8,4,
+0x278600,6,
+0x278620,6,
+0x278640,3,
+0x278800,6,
+0x278820,3,
+0x278830,4,
+0x278858,2,
+0x278864,1,
+0x278874,3,
+0x278898,2,
+0x2788a4,1,
+0x2788b4,3,
+0x279000,6,
+0x279020,6,
+0x279040,3,
+0x279080,14,
+0x2790bc,1,
+0x2790c4,13,
+0x2790fc,1,
+0x279200,20,
+0x27925c,30,
+0x279300,24,
+0x279380,2,
+0x2793a0,1,
+0x2793c0,11,
+0x279404,3,
+0x279420,11,
+0x279460,3,
+0x279480,6,
+0x279500,6,
+0x279520,6,
+0x279540,1,
+0x279558,2,
+0x279600,17,
+0x279800,410,
+0x27a000,6,
+0x27a020,6,
+0x27a040,3,
+0x27a080,14,
+0x27a0bc,1,
+0x27a0c4,13,
+0x27a0fc,1,
+0x27a200,20,
+0x27a25c,30,
+0x27a300,24,
+0x27a380,2,
+0x27a3a0,1,
+0x27a3c0,11,
+0x27a404,3,
+0x27a420,11,
+0x27a460,3,
+0x27a480,6,
+0x27a500,6,
+0x27a520,6,
+0x27a540,1,
+0x27a558,2,
+0x27a600,17,
+0x27a800,410,
+0x27b000,4,
+0x27b020,25,
+0x27b088,8,
+0x27b100,4,
+0x27b120,25,
+0x27b188,8,
+0x27b200,34,
+0x27b300,37,
+0x27b400,16,
+0x27b464,1,
+0x27b474,3,
+0x27b500,6,
+0x27b520,2,
+0x27b530,9,
+0x27b570,10,
+0x27b5a0,2,
+0x27b5b0,9,
+0x27b5f0,4,
+0x27b620,7,
+0x27b640,16,
+0x27b700,6,
+0x27b720,6,
+0x27b740,6,
+0x27b760,6,
+0x27b780,3,
+0x27b800,5,
+0x27b818,1,
+0x27b854,6,
+0x27b880,2,
+0x27b8a4,1,
+0x27b8ac,2,
+0x27ba00,28,
+0x27ba7c,13,
+0x27bab4,1,
+0x27babc,10,
+0x27bb04,1,
+0x27bb0c,5,
+0x27bb24,1,
+0x27bb34,9,
+0x27bb60,6,
+0x27bb80,22,
+0x27bbe0,3,
+0x27bbf0,2,
+0x27bc00,5,
+0x27bc18,1,
+0x27bc54,6,
+0x27bc80,2,
+0x27bca4,1,
+0x27bcac,2,
+0x27be00,28,
+0x27be7c,13,
+0x27beb4,1,
+0x27bebc,10,
+0x27bf04,1,
+0x27bf0c,5,
+0x27bf24,1,
+0x27bf34,9,
+0x27bf60,6,
+0x27bf80,22,
+0x27bfe0,3,
+0x27bff0,2,
+0x27c008,2,
+0x27c014,11,
+0x27c044,1,
+0x27c04c,3,
+0x27c05c,1,
+0x27c064,1,
+0x27c07c,1,
+0x27c500,2,
+0x27c518,1,
+0x27c520,3,
+0x27c540,6,
+0x27c580,10,
+0x27c808,2,
+0x27c814,11,
+0x27c844,1,
+0x27c84c,3,
+0x27c85c,1,
+0x27c864,1,
+0x27c87c,1,
+0x27cd00,2,
+0x27cd18,1,
+0x27cd20,3,
+0x27cd40,6,
+0x27cd80,10,
+0x27d800,2,
+0x27d828,2,
+0x27d850,2,
+0x27d878,2,
+0x27d8a0,6,
+0x27d9ac,1,
+0x27d9d8,4,
+0x27da00,6,
+0x27da20,6,
+0x27da40,6,
+0x27da60,6,
+0x27da80,3,
+0x27dc00,6,
+0x27dc20,3,
+0x27dc40,2,
+0x27dc60,1,
+0x280000,5,
+0x280020,4,
+0x280034,17,
+0x280080,1,
+0x2800a0,6,
+0x280100,5,
+0x280120,4,
+0x280134,17,
+0x280180,1,
+0x2801a0,6,
+0x280200,5,
+0x280220,4,
+0x280234,17,
+0x280280,1,
+0x2802a0,6,
+0x280300,5,
+0x280320,4,
+0x280334,17,
+0x280380,1,
+0x2803a0,6,
+0x280500,6,
+0x28051c,7,
+0x280540,1,
+0x280c00,13,
+0x280c40,12,
+0x280c80,13,
+0x280cc0,12,
+0x280d00,6,
+0x280d20,6,
+0x280d80,14,
+0x280dc0,2,
+0x280e40,11,
+0x280e80,6,
+0x280ea0,6,
+0x281000,2,
+0x281010,5,
+0x281060,32,
+0x281100,8,
+0x281180,3,
+0x281190,2,
+0x28119c,5,
+0x281218,9,
+0x281240,3,
+0x281250,6,
+0x281280,1,
+0x281288,6,
+0x2812a4,1,
+0x281400,8,
+0x281424,2,
+0x281500,5,
+0x281520,4,
+0x281540,5,
+0x281560,4,
+0x281800,24,
+0x281864,5,
+0x281880,8,
+0x281900,13,
+0x281980,4,
+0x2819a0,6,
+0x281a40,1,
+0x281a60,1,
+0x281a68,23,
+0x281ac8,6,
+0x281b00,17,
+0x281b48,6,
+0x281b80,12,
+0x281c00,6,
+0x281c20,6,
+0x281c40,6,
+0x281c60,3,
+0x281d00,6,
+0x281d20,6,
+0x281d40,3,
+0x282000,5,
+0x282020,4,
+0x282034,17,
+0x282080,1,
+0x2820a0,6,
+0x282100,5,
+0x282120,4,
+0x282134,17,
+0x282180,1,
+0x2821a0,6,
+0x282200,5,
+0x282220,4,
+0x282234,17,
+0x282280,1,
+0x2822a0,6,
+0x282300,5,
+0x282320,4,
+0x282334,17,
+0x282380,1,
+0x2823a0,6,
+0x282500,6,
+0x28251c,7,
+0x282540,1,
+0x282c00,13,
+0x282c40,12,
+0x282c80,13,
+0x282cc0,12,
+0x282d00,6,
+0x282d20,6,
+0x282d80,14,
+0x282dc0,2,
+0x282e40,11,
+0x282e80,6,
+0x282ea0,6,
+0x283000,2,
+0x283010,5,
+0x283060,32,
+0x283100,8,
+0x283180,3,
+0x283190,2,
+0x28319c,5,
+0x283218,9,
+0x283240,3,
+0x283250,6,
+0x283280,1,
+0x283288,6,
+0x2832a4,1,
+0x283400,8,
+0x283424,2,
+0x283500,5,
+0x283520,4,
+0x283540,5,
+0x283560,4,
+0x283800,24,
+0x283864,5,
+0x283880,8,
+0x283900,13,
+0x283980,4,
+0x2839a0,6,
+0x283a40,1,
+0x283a60,1,
+0x283a68,23,
+0x283ac8,6,
+0x283b00,17,
+0x283b48,6,
+0x283b80,12,
+0x283c00,6,
+0x283c20,6,
+0x283c40,6,
+0x283c60,3,
+0x283d00,6,
+0x283d20,6,
+0x283d40,3,
+0x284000,29,
+0x284078,4,
+0x284090,2,
+0x2840a0,7,
+0x2840c0,11,
+0x284100,14,
+0x284140,14,
+0x284180,61,
+0x284278,4,
+0x284290,2,
+0x2842a0,7,
+0x2842c0,11,
+0x284300,14,
+0x284340,14,
+0x284380,61,
+0x284478,4,
+0x284490,2,
+0x2844a0,7,
+0x2844c0,11,
+0x284500,14,
+0x284540,14,
+0x284580,61,
+0x284678,4,
+0x284690,2,
+0x2846a0,7,
+0x2846c0,11,
+0x284700,14,
+0x284740,14,
+0x284780,67,
+0x284890,1,
+0x284a00,8,
+0x284a24,15,
+0x284a64,30,
+0x284b00,4,
+0x284b20,2,
+0x284c00,6,
+0x284c40,14,
+0x284c80,9,
+0x284d00,9,
+0x284d2c,1,
+0x284d40,3,
+0x284d60,1,
+0x284d80,3,
+0x284e00,2,
+0x284e0c,1,
+0x284e14,5,
+0x284e2c,1,
+0x284e34,5,
+0x284e4c,1,
+0x284e54,5,
+0x284e6c,1,
+0x284e74,5,
+0x284e8c,1,
+0x284e94,5,
+0x284eac,1,
+0x284eb4,3,
+0x285000,29,
+0x285078,4,
+0x285090,2,
+0x2850a0,7,
+0x2850c0,11,
+0x285100,14,
+0x285140,14,
+0x285180,61,
+0x285278,4,
+0x285290,2,
+0x2852a0,7,
+0x2852c0,11,
+0x285300,14,
+0x285340,14,
+0x285380,61,
+0x285478,4,
+0x285490,2,
+0x2854a0,7,
+0x2854c0,11,
+0x285500,14,
+0x285540,14,
+0x285580,61,
+0x285678,4,
+0x285690,2,
+0x2856a0,7,
+0x2856c0,11,
+0x285700,14,
+0x285740,14,
+0x285780,67,
+0x285890,1,
+0x285a00,8,
+0x285a24,15,
+0x285a64,30,
+0x285b00,4,
+0x285b20,2,
+0x285c00,6,
+0x285c40,14,
+0x285c80,9,
+0x285d00,9,
+0x285d2c,1,
+0x285d40,3,
+0x285d60,1,
+0x285d80,3,
+0x285e00,2,
+0x285e0c,1,
+0x285e14,5,
+0x285e2c,1,
+0x285e34,5,
+0x285e4c,1,
+0x285e54,5,
+0x285e6c,1,
+0x285e74,5,
+0x285e8c,1,
+0x285e94,5,
+0x285eac,1,
+0x285eb4,3,
+0x286000,14,
+0x286070,3,
+0x286080,6,
+0x286100,9,
+0x286204,1,
+0x28620c,6,
+0x286240,13,
+0x286280,16,
+0x286800,19,
+0x286850,10,
+0x286880,19,
+0x2868d0,10,
+0x286900,19,
+0x286950,10,
+0x286980,19,
+0x2869d0,10,
+0x286a00,19,
+0x286a50,10,
+0x286a80,19,
+0x286ad0,10,
+0x286b00,19,
+0x286b50,10,
+0x286b80,19,
+0x286bd0,10,
+0x286c00,19,
+0x286c60,6,
+0x286c84,1,
+0x286c94,8,
+0x286cb8,9,
+0x286ce0,4,
+0x287000,6,
+0x287020,3,
+0x287040,7,
+0x287060,6,
+0x287100,5,
+0x287138,1,
+0x287144,1,
+0x287150,2,
+0x288000,6,
+0x288020,3,
+0x288030,9,
+0x288100,6,
+0x288120,10,
+0x288150,8,
+0x288400,1,
+0x288428,1,
+0x288450,1,
+0x288478,1,
+0x2884a0,8,
+0x2885ac,1,
+0x2885d8,4,
+0x288600,6,
+0x288620,6,
+0x288640,3,
+0x288800,6,
+0x288820,3,
+0x288830,4,
+0x288858,2,
+0x288864,1,
+0x288874,3,
+0x288898,2,
+0x2888a4,1,
+0x2888b4,3,
+0x289000,6,
+0x289020,6,
+0x289040,3,
+0x289080,14,
+0x2890bc,1,
+0x2890c4,13,
+0x2890fc,1,
+0x289200,20,
+0x28925c,30,
+0x289300,24,
+0x289380,2,
+0x2893a0,1,
+0x2893c0,11,
+0x289404,3,
+0x289420,11,
+0x289460,3,
+0x289480,6,
+0x289500,6,
+0x289520,6,
+0x289540,1,
+0x289558,2,
+0x289600,17,
+0x289800,410,
+0x28a000,6,
+0x28a020,6,
+0x28a040,3,
+0x28a080,14,
+0x28a0bc,1,
+0x28a0c4,13,
+0x28a0fc,1,
+0x28a200,20,
+0x28a25c,30,
+0x28a300,24,
+0x28a380,2,
+0x28a3a0,1,
+0x28a3c0,11,
+0x28a404,3,
+0x28a420,11,
+0x28a460,3,
+0x28a480,6,
+0x28a500,6,
+0x28a520,6,
+0x28a540,1,
+0x28a558,2,
+0x28a600,17,
+0x28a800,410,
+0x28b000,4,
+0x28b020,25,
+0x28b088,8,
+0x28b100,4,
+0x28b120,25,
+0x28b188,8,
+0x28b200,34,
+0x28b300,37,
+0x28b400,16,
+0x28b464,1,
+0x28b474,3,
+0x28b500,6,
+0x28b520,2,
+0x28b530,9,
+0x28b570,10,
+0x28b5a0,2,
+0x28b5b0,9,
+0x28b5f0,4,
+0x28b620,7,
+0x28b640,16,
+0x28b700,6,
+0x28b720,6,
+0x28b740,6,
+0x28b760,6,
+0x28b780,3,
+0x28b800,5,
+0x28b818,1,
+0x28b854,6,
+0x28b880,2,
+0x28b8a4,1,
+0x28b8ac,2,
+0x28ba00,28,
+0x28ba7c,13,
+0x28bab4,1,
+0x28babc,10,
+0x28bb04,1,
+0x28bb0c,5,
+0x28bb24,1,
+0x28bb34,9,
+0x28bb60,6,
+0x28bb80,22,
+0x28bbe0,3,
+0x28bbf0,2,
+0x28bc00,5,
+0x28bc18,1,
+0x28bc54,6,
+0x28bc80,2,
+0x28bca4,1,
+0x28bcac,2,
+0x28be00,28,
+0x28be7c,13,
+0x28beb4,1,
+0x28bebc,10,
+0x28bf04,1,
+0x28bf0c,5,
+0x28bf24,1,
+0x28bf34,9,
+0x28bf60,6,
+0x28bf80,22,
+0x28bfe0,3,
+0x28bff0,2,
+0x28c008,2,
+0x28c014,11,
+0x28c044,1,
+0x28c04c,3,
+0x28c05c,1,
+0x28c064,1,
+0x28c07c,1,
+0x28c500,2,
+0x28c518,1,
+0x28c520,3,
+0x28c540,6,
+0x28c580,10,
+0x28c808,2,
+0x28c814,11,
+0x28c844,1,
+0x28c84c,3,
+0x28c85c,1,
+0x28c864,1,
+0x28c87c,1,
+0x28cd00,2,
+0x28cd18,1,
+0x28cd20,3,
+0x28cd40,6,
+0x28cd80,10,
+0x28d800,2,
+0x28d828,2,
+0x28d850,2,
+0x28d878,2,
+0x28d8a0,6,
+0x28d9ac,1,
+0x28d9d8,4,
+0x28da00,6,
+0x28da20,6,
+0x28da40,6,
+0x28da60,6,
+0x28da80,3,
+0x28dc00,6,
+0x28dc20,3,
+0x28dc40,2,
+0x28dc60,1,
+0x290000,5,
+0x290020,4,
+0x290034,17,
+0x290080,1,
+0x2900a0,6,
+0x290100,5,
+0x290120,4,
+0x290134,17,
+0x290180,1,
+0x2901a0,6,
+0x290200,5,
+0x290220,4,
+0x290234,17,
+0x290280,1,
+0x2902a0,6,
+0x290300,5,
+0x290320,4,
+0x290334,17,
+0x290380,1,
+0x2903a0,6,
+0x290500,6,
+0x29051c,7,
+0x290540,1,
+0x290c00,13,
+0x290c40,12,
+0x290c80,13,
+0x290cc0,12,
+0x290d00,6,
+0x290d20,6,
+0x290d80,14,
+0x290dc0,2,
+0x290e40,11,
+0x290e80,6,
+0x290ea0,6,
+0x291000,2,
+0x291010,5,
+0x291060,32,
+0x291100,8,
+0x291180,3,
+0x291190,2,
+0x29119c,5,
+0x291218,9,
+0x291240,3,
+0x291250,6,
+0x291280,1,
+0x291288,6,
+0x2912a4,1,
+0x291400,8,
+0x291424,2,
+0x291500,5,
+0x291520,4,
+0x291540,5,
+0x291560,4,
+0x291800,24,
+0x291864,5,
+0x291880,8,
+0x291900,13,
+0x291980,4,
+0x2919a0,6,
+0x291a40,1,
+0x291a60,1,
+0x291a68,23,
+0x291ac8,6,
+0x291b00,17,
+0x291b48,6,
+0x291b80,12,
+0x291c00,6,
+0x291c20,6,
+0x291c40,6,
+0x291c60,3,
+0x291d00,6,
+0x291d20,6,
+0x291d40,3,
+0x292000,5,
+0x292020,4,
+0x292034,17,
+0x292080,1,
+0x2920a0,6,
+0x292100,5,
+0x292120,4,
+0x292134,17,
+0x292180,1,
+0x2921a0,6,
+0x292200,5,
+0x292220,4,
+0x292234,17,
+0x292280,1,
+0x2922a0,6,
+0x292300,5,
+0x292320,4,
+0x292334,17,
+0x292380,1,
+0x2923a0,6,
+0x292500,6,
+0x29251c,7,
+0x292540,1,
+0x292c00,13,
+0x292c40,12,
+0x292c80,13,
+0x292cc0,12,
+0x292d00,6,
+0x292d20,6,
+0x292d80,14,
+0x292dc0,2,
+0x292e40,11,
+0x292e80,6,
+0x292ea0,6,
+0x293000,2,
+0x293010,5,
+0x293060,32,
+0x293100,8,
+0x293180,3,
+0x293190,2,
+0x29319c,5,
+0x293218,9,
+0x293240,3,
+0x293250,6,
+0x293280,1,
+0x293288,6,
+0x2932a4,1,
+0x293400,8,
+0x293424,2,
+0x293500,5,
+0x293520,4,
+0x293540,5,
+0x293560,4,
+0x293800,24,
+0x293864,5,
+0x293880,8,
+0x293900,13,
+0x293980,4,
+0x2939a0,6,
+0x293a40,1,
+0x293a60,1,
+0x293a68,23,
+0x293ac8,6,
+0x293b00,17,
+0x293b48,6,
+0x293b80,12,
+0x293c00,6,
+0x293c20,6,
+0x293c40,6,
+0x293c60,3,
+0x293d00,6,
+0x293d20,6,
+0x293d40,3,
+0x294000,29,
+0x294078,4,
+0x294090,2,
+0x2940a0,7,
+0x2940c0,11,
+0x294100,14,
+0x294140,14,
+0x294180,61,
+0x294278,4,
+0x294290,2,
+0x2942a0,7,
+0x2942c0,11,
+0x294300,14,
+0x294340,14,
+0x294380,61,
+0x294478,4,
+0x294490,2,
+0x2944a0,7,
+0x2944c0,11,
+0x294500,14,
+0x294540,14,
+0x294580,61,
+0x294678,4,
+0x294690,2,
+0x2946a0,7,
+0x2946c0,11,
+0x294700,14,
+0x294740,14,
+0x294780,67,
+0x294890,1,
+0x294a00,8,
+0x294a24,15,
+0x294a64,30,
+0x294b00,4,
+0x294b20,2,
+0x294c00,6,
+0x294c40,14,
+0x294c80,9,
+0x294d00,9,
+0x294d2c,1,
+0x294d40,3,
+0x294d60,1,
+0x294d80,3,
+0x294e00,2,
+0x294e0c,1,
+0x294e14,5,
+0x294e2c,1,
+0x294e34,5,
+0x294e4c,1,
+0x294e54,5,
+0x294e6c,1,
+0x294e74,5,
+0x294e8c,1,
+0x294e94,5,
+0x294eac,1,
+0x294eb4,3,
+0x295000,29,
+0x295078,4,
+0x295090,2,
+0x2950a0,7,
+0x2950c0,11,
+0x295100,14,
+0x295140,14,
+0x295180,61,
+0x295278,4,
+0x295290,2,
+0x2952a0,7,
+0x2952c0,11,
+0x295300,14,
+0x295340,14,
+0x295380,61,
+0x295478,4,
+0x295490,2,
+0x2954a0,7,
+0x2954c0,11,
+0x295500,14,
+0x295540,14,
+0x295580,61,
+0x295678,4,
+0x295690,2,
+0x2956a0,7,
+0x2956c0,11,
+0x295700,14,
+0x295740,14,
+0x295780,67,
+0x295890,1,
+0x295a00,8,
+0x295a24,15,
+0x295a64,30,
+0x295b00,4,
+0x295b20,2,
+0x295c00,6,
+0x295c40,14,
+0x295c80,9,
+0x295d00,9,
+0x295d2c,1,
+0x295d40,3,
+0x295d60,1,
+0x295d80,3,
+0x295e00,2,
+0x295e0c,1,
+0x295e14,5,
+0x295e2c,1,
+0x295e34,5,
+0x295e4c,1,
+0x295e54,5,
+0x295e6c,1,
+0x295e74,5,
+0x295e8c,1,
+0x295e94,5,
+0x295eac,1,
+0x295eb4,3,
+0x296000,14,
+0x296070,3,
+0x296080,6,
+0x296100,9,
+0x296204,1,
+0x29620c,6,
+0x296240,13,
+0x296280,16,
+0x296800,19,
+0x296850,10,
+0x296880,19,
+0x2968d0,10,
+0x296900,19,
+0x296950,10,
+0x296980,19,
+0x2969d0,10,
+0x296a00,19,
+0x296a50,10,
+0x296a80,19,
+0x296ad0,10,
+0x296b00,19,
+0x296b50,10,
+0x296b80,19,
+0x296bd0,10,
+0x296c00,19,
+0x296c60,6,
+0x296c84,1,
+0x296c94,8,
+0x296cb8,9,
+0x296ce0,4,
+0x297000,6,
+0x297020,3,
+0x297040,7,
+0x297060,6,
+0x297100,5,
+0x297138,1,
+0x297144,1,
+0x297150,2,
+0x298000,6,
+0x298020,3,
+0x298030,9,
+0x298100,6,
+0x298120,10,
+0x298150,8,
+0x298400,1,
+0x298428,1,
+0x298450,1,
+0x298478,1,
+0x2984a0,8,
+0x2985ac,1,
+0x2985d8,4,
+0x298600,6,
+0x298620,6,
+0x298640,3,
+0x298800,6,
+0x298820,3,
+0x298830,4,
+0x298858,2,
+0x298864,1,
+0x298874,3,
+0x298898,2,
+0x2988a4,1,
+0x2988b4,3,
+0x299000,6,
+0x299020,6,
+0x299040,3,
+0x299080,14,
+0x2990bc,1,
+0x2990c4,13,
+0x2990fc,1,
+0x299200,20,
+0x29925c,30,
+0x299300,24,
+0x299380,2,
+0x2993a0,1,
+0x2993c0,11,
+0x299404,3,
+0x299420,11,
+0x299460,3,
+0x299480,6,
+0x299500,6,
+0x299520,6,
+0x299540,1,
+0x299558,2,
+0x299600,17,
+0x299800,410,
+0x29a000,6,
+0x29a020,6,
+0x29a040,3,
+0x29a080,14,
+0x29a0bc,1,
+0x29a0c4,13,
+0x29a0fc,1,
+0x29a200,20,
+0x29a25c,30,
+0x29a300,24,
+0x29a380,2,
+0x29a3a0,1,
+0x29a3c0,11,
+0x29a404,3,
+0x29a420,11,
+0x29a460,3,
+0x29a480,6,
+0x29a500,6,
+0x29a520,6,
+0x29a540,1,
+0x29a558,2,
+0x29a600,17,
+0x29a800,410,
+0x29b000,4,
+0x29b020,25,
+0x29b088,8,
+0x29b100,4,
+0x29b120,25,
+0x29b188,8,
+0x29b200,34,
+0x29b300,37,
+0x29b400,16,
+0x29b464,1,
+0x29b474,3,
+0x29b500,6,
+0x29b520,2,
+0x29b530,9,
+0x29b570,10,
+0x29b5a0,2,
+0x29b5b0,9,
+0x29b5f0,4,
+0x29b620,7,
+0x29b640,16,
+0x29b700,6,
+0x29b720,6,
+0x29b740,6,
+0x29b760,6,
+0x29b780,3,
+0x29b800,5,
+0x29b818,1,
+0x29b854,6,
+0x29b880,2,
+0x29b8a4,1,
+0x29b8ac,2,
+0x29ba00,28,
+0x29ba7c,13,
+0x29bab4,1,
+0x29babc,10,
+0x29bb04,1,
+0x29bb0c,5,
+0x29bb24,1,
+0x29bb34,9,
+0x29bb60,6,
+0x29bb80,22,
+0x29bbe0,3,
+0x29bbf0,2,
+0x29bc00,5,
+0x29bc18,1,
+0x29bc54,6,
+0x29bc80,2,
+0x29bca4,1,
+0x29bcac,2,
+0x29be00,28,
+0x29be7c,13,
+0x29beb4,1,
+0x29bebc,10,
+0x29bf04,1,
+0x29bf0c,5,
+0x29bf24,1,
+0x29bf34,9,
+0x29bf60,6,
+0x29bf80,22,
+0x29bfe0,3,
+0x29bff0,2,
+0x29c008,2,
+0x29c014,11,
+0x29c044,1,
+0x29c04c,3,
+0x29c05c,1,
+0x29c064,1,
+0x29c07c,1,
+0x29c500,2,
+0x29c518,1,
+0x29c520,3,
+0x29c540,6,
+0x29c580,10,
+0x29c808,2,
+0x29c814,11,
+0x29c844,1,
+0x29c84c,3,
+0x29c85c,1,
+0x29c864,1,
+0x29c87c,1,
+0x29cd00,2,
+0x29cd18,1,
+0x29cd20,3,
+0x29cd40,6,
+0x29cd80,10,
+0x29d800,2,
+0x29d828,2,
+0x29d850,2,
+0x29d878,2,
+0x29d8a0,6,
+0x29d9ac,1,
+0x29d9d8,4,
+0x29da00,6,
+0x29da20,6,
+0x29da40,6,
+0x29da60,6,
+0x29da80,3,
+0x29dc00,6,
+0x29dc20,3,
+0x29dc40,2,
+0x29dc60,1,
+0x2a0000,5,
+0x2a0020,4,
+0x2a0034,17,
+0x2a0080,1,
+0x2a00a0,6,
+0x2a0100,5,
+0x2a0120,4,
+0x2a0134,17,
+0x2a0180,1,
+0x2a01a0,6,
+0x2a0200,5,
+0x2a0220,4,
+0x2a0234,17,
+0x2a0280,1,
+0x2a02a0,6,
+0x2a0300,5,
+0x2a0320,4,
+0x2a0334,17,
+0x2a0380,1,
+0x2a03a0,6,
+0x2a0500,6,
+0x2a051c,7,
+0x2a0540,1,
+0x2a0c00,13,
+0x2a0c40,12,
+0x2a0c80,13,
+0x2a0cc0,12,
+0x2a0d00,6,
+0x2a0d20,6,
+0x2a0d80,14,
+0x2a0dc0,2,
+0x2a0e40,11,
+0x2a0e80,6,
+0x2a0ea0,6,
+0x2a1000,2,
+0x2a1010,5,
+0x2a1060,32,
+0x2a1100,8,
+0x2a1180,3,
+0x2a1190,2,
+0x2a119c,5,
+0x2a1218,9,
+0x2a1240,3,
+0x2a1250,6,
+0x2a1280,1,
+0x2a1288,6,
+0x2a12a4,1,
+0x2a1400,8,
+0x2a1424,2,
+0x2a1500,5,
+0x2a1520,4,
+0x2a1540,5,
+0x2a1560,4,
+0x2a1800,24,
+0x2a1864,5,
+0x2a1880,8,
+0x2a1900,13,
+0x2a1980,4,
+0x2a19a0,6,
+0x2a1a40,1,
+0x2a1a60,1,
+0x2a1a68,23,
+0x2a1ac8,6,
+0x2a1b00,17,
+0x2a1b48,6,
+0x2a1b80,12,
+0x2a1c00,6,
+0x2a1c20,6,
+0x2a1c40,6,
+0x2a1c60,3,
+0x2a1d00,6,
+0x2a1d20,6,
+0x2a1d40,3,
+0x2a2000,5,
+0x2a2020,4,
+0x2a2034,17,
+0x2a2080,1,
+0x2a20a0,6,
+0x2a2100,5,
+0x2a2120,4,
+0x2a2134,17,
+0x2a2180,1,
+0x2a21a0,6,
+0x2a2200,5,
+0x2a2220,4,
+0x2a2234,17,
+0x2a2280,1,
+0x2a22a0,6,
+0x2a2300,5,
+0x2a2320,4,
+0x2a2334,17,
+0x2a2380,1,
+0x2a23a0,6,
+0x2a2500,6,
+0x2a251c,7,
+0x2a2540,1,
+0x2a2c00,13,
+0x2a2c40,12,
+0x2a2c80,13,
+0x2a2cc0,12,
+0x2a2d00,6,
+0x2a2d20,6,
+0x2a2d80,14,
+0x2a2dc0,2,
+0x2a2e40,11,
+0x2a2e80,6,
+0x2a2ea0,6,
+0x2a3000,2,
+0x2a3010,5,
+0x2a3060,32,
+0x2a3100,8,
+0x2a3180,3,
+0x2a3190,2,
+0x2a319c,5,
+0x2a3218,9,
+0x2a3240,3,
+0x2a3250,6,
+0x2a3280,1,
+0x2a3288,6,
+0x2a32a4,1,
+0x2a3400,8,
+0x2a3424,2,
+0x2a3500,5,
+0x2a3520,4,
+0x2a3540,5,
+0x2a3560,4,
+0x2a3800,24,
+0x2a3864,5,
+0x2a3880,8,
+0x2a3900,13,
+0x2a3980,4,
+0x2a39a0,6,
+0x2a3a40,1,
+0x2a3a60,1,
+0x2a3a68,23,
+0x2a3ac8,6,
+0x2a3b00,17,
+0x2a3b48,6,
+0x2a3b80,12,
+0x2a3c00,6,
+0x2a3c20,6,
+0x2a3c40,6,
+0x2a3c60,3,
+0x2a3d00,6,
+0x2a3d20,6,
+0x2a3d40,3,
+0x2a4000,29,
+0x2a4078,4,
+0x2a4090,2,
+0x2a40a0,7,
+0x2a40c0,11,
+0x2a4100,14,
+0x2a4140,14,
+0x2a4180,61,
+0x2a4278,4,
+0x2a4290,2,
+0x2a42a0,7,
+0x2a42c0,11,
+0x2a4300,14,
+0x2a4340,14,
+0x2a4380,61,
+0x2a4478,4,
+0x2a4490,2,
+0x2a44a0,7,
+0x2a44c0,11,
+0x2a4500,14,
+0x2a4540,14,
+0x2a4580,61,
+0x2a4678,4,
+0x2a4690,2,
+0x2a46a0,7,
+0x2a46c0,11,
+0x2a4700,14,
+0x2a4740,14,
+0x2a4780,67,
+0x2a4890,1,
+0x2a4a00,8,
+0x2a4a24,15,
+0x2a4a64,30,
+0x2a4b00,4,
+0x2a4b20,2,
+0x2a4c00,6,
+0x2a4c40,14,
+0x2a4c80,9,
+0x2a4d00,9,
+0x2a4d2c,1,
+0x2a4d40,3,
+0x2a4d60,1,
+0x2a4d80,3,
+0x2a4e00,2,
+0x2a4e0c,1,
+0x2a4e14,5,
+0x2a4e2c,1,
+0x2a4e34,5,
+0x2a4e4c,1,
+0x2a4e54,5,
+0x2a4e6c,1,
+0x2a4e74,5,
+0x2a4e8c,1,
+0x2a4e94,5,
+0x2a4eac,1,
+0x2a4eb4,3,
+0x2a5000,29,
+0x2a5078,4,
+0x2a5090,2,
+0x2a50a0,7,
+0x2a50c0,11,
+0x2a5100,14,
+0x2a5140,14,
+0x2a5180,61,
+0x2a5278,4,
+0x2a5290,2,
+0x2a52a0,7,
+0x2a52c0,11,
+0x2a5300,14,
+0x2a5340,14,
+0x2a5380,61,
+0x2a5478,4,
+0x2a5490,2,
+0x2a54a0,7,
+0x2a54c0,11,
+0x2a5500,14,
+0x2a5540,14,
+0x2a5580,61,
+0x2a5678,4,
+0x2a5690,2,
+0x2a56a0,7,
+0x2a56c0,11,
+0x2a5700,14,
+0x2a5740,14,
+0x2a5780,67,
+0x2a5890,1,
+0x2a5a00,8,
+0x2a5a24,15,
+0x2a5a64,30,
+0x2a5b00,4,
+0x2a5b20,2,
+0x2a5c00,6,
+0x2a5c40,14,
+0x2a5c80,9,
+0x2a5d00,9,
+0x2a5d2c,1,
+0x2a5d40,3,
+0x2a5d60,1,
+0x2a5d80,3,
+0x2a5e00,2,
+0x2a5e0c,1,
+0x2a5e14,5,
+0x2a5e2c,1,
+0x2a5e34,5,
+0x2a5e4c,1,
+0x2a5e54,5,
+0x2a5e6c,1,
+0x2a5e74,5,
+0x2a5e8c,1,
+0x2a5e94,5,
+0x2a5eac,1,
+0x2a5eb4,3,
+0x2a6000,14,
+0x2a6070,3,
+0x2a6080,6,
+0x2a6100,9,
+0x2a6204,1,
+0x2a620c,6,
+0x2a6240,13,
+0x2a6280,16,
+0x2a6800,19,
+0x2a6850,10,
+0x2a6880,19,
+0x2a68d0,10,
+0x2a6900,19,
+0x2a6950,10,
+0x2a6980,19,
+0x2a69d0,10,
+0x2a6a00,19,
+0x2a6a50,10,
+0x2a6a80,19,
+0x2a6ad0,10,
+0x2a6b00,19,
+0x2a6b50,10,
+0x2a6b80,19,
+0x2a6bd0,10,
+0x2a6c00,19,
+0x2a6c60,6,
+0x2a6c84,1,
+0x2a6c94,8,
+0x2a6cb8,9,
+0x2a6ce0,4,
+0x2a7000,6,
+0x2a7020,3,
+0x2a7040,7,
+0x2a7060,6,
+0x2a7100,5,
+0x2a7138,1,
+0x2a7144,1,
+0x2a7150,2,
+0x2a8000,6,
+0x2a8020,3,
+0x2a8030,9,
+0x2a8100,6,
+0x2a8120,10,
+0x2a8150,8,
+0x2a8400,1,
+0x2a8428,1,
+0x2a8450,1,
+0x2a8478,1,
+0x2a84a0,8,
+0x2a85ac,1,
+0x2a85d8,4,
+0x2a8600,6,
+0x2a8620,6,
+0x2a8640,3,
+0x2a8800,6,
+0x2a8820,3,
+0x2a8830,4,
+0x2a8858,2,
+0x2a8864,1,
+0x2a8874,3,
+0x2a8898,2,
+0x2a88a4,1,
+0x2a88b4,3,
+0x2a9000,6,
+0x2a9020,6,
+0x2a9040,3,
+0x2a9080,14,
+0x2a90bc,1,
+0x2a90c4,13,
+0x2a90fc,1,
+0x2a9200,20,
+0x2a925c,30,
+0x2a9300,24,
+0x2a9380,2,
+0x2a93a0,1,
+0x2a93c0,11,
+0x2a9404,3,
+0x2a9420,11,
+0x2a9460,3,
+0x2a9480,6,
+0x2a9500,6,
+0x2a9520,6,
+0x2a9540,1,
+0x2a9558,2,
+0x2a9600,17,
+0x2a9800,410,
+0x2aa000,6,
+0x2aa020,6,
+0x2aa040,3,
+0x2aa080,14,
+0x2aa0bc,1,
+0x2aa0c4,13,
+0x2aa0fc,1,
+0x2aa200,20,
+0x2aa25c,30,
+0x2aa300,24,
+0x2aa380,2,
+0x2aa3a0,1,
+0x2aa3c0,11,
+0x2aa404,3,
+0x2aa420,11,
+0x2aa460,3,
+0x2aa480,6,
+0x2aa500,6,
+0x2aa520,6,
+0x2aa540,1,
+0x2aa558,2,
+0x2aa600,17,
+0x2aa800,410,
+0x2ab000,4,
+0x2ab020,25,
+0x2ab088,8,
+0x2ab100,4,
+0x2ab120,25,
+0x2ab188,8,
+0x2ab200,34,
+0x2ab300,37,
+0x2ab400,16,
+0x2ab464,1,
+0x2ab474,3,
+0x2ab500,6,
+0x2ab520,2,
+0x2ab530,9,
+0x2ab570,10,
+0x2ab5a0,2,
+0x2ab5b0,9,
+0x2ab5f0,4,
+0x2ab620,7,
+0x2ab640,16,
+0x2ab700,6,
+0x2ab720,6,
+0x2ab740,6,
+0x2ab760,6,
+0x2ab780,3,
+0x2ab800,5,
+0x2ab818,1,
+0x2ab854,6,
+0x2ab880,2,
+0x2ab8a4,1,
+0x2ab8ac,2,
+0x2aba00,28,
+0x2aba7c,13,
+0x2abab4,1,
+0x2ababc,10,
+0x2abb04,1,
+0x2abb0c,5,
+0x2abb24,1,
+0x2abb34,9,
+0x2abb60,6,
+0x2abb80,22,
+0x2abbe0,3,
+0x2abbf0,2,
+0x2abc00,5,
+0x2abc18,1,
+0x2abc54,6,
+0x2abc80,2,
+0x2abca4,1,
+0x2abcac,2,
+0x2abe00,28,
+0x2abe7c,13,
+0x2abeb4,1,
+0x2abebc,10,
+0x2abf04,1,
+0x2abf0c,5,
+0x2abf24,1,
+0x2abf34,9,
+0x2abf60,6,
+0x2abf80,22,
+0x2abfe0,3,
+0x2abff0,2,
+0x2ac008,2,
+0x2ac014,11,
+0x2ac044,1,
+0x2ac04c,3,
+0x2ac05c,1,
+0x2ac064,1,
+0x2ac07c,1,
+0x2ac500,2,
+0x2ac518,1,
+0x2ac520,3,
+0x2ac540,6,
+0x2ac580,10,
+0x2ac808,2,
+0x2ac814,11,
+0x2ac844,1,
+0x2ac84c,3,
+0x2ac85c,1,
+0x2ac864,1,
+0x2ac87c,1,
+0x2acd00,2,
+0x2acd18,1,
+0x2acd20,3,
+0x2acd40,6,
+0x2acd80,10,
+0x2ad800,2,
+0x2ad828,2,
+0x2ad850,2,
+0x2ad878,2,
+0x2ad8a0,6,
+0x2ad9ac,1,
+0x2ad9d8,4,
+0x2ada00,6,
+0x2ada20,6,
+0x2ada40,6,
+0x2ada60,6,
+0x2ada80,3,
+0x2adc00,6,
+0x2adc20,3,
+0x2adc40,2,
+0x2adc60,1,
+0x2b0000,5,
+0x2b0020,4,
+0x2b0034,17,
+0x2b0080,1,
+0x2b00a0,6,
+0x2b0100,5,
+0x2b0120,4,
+0x2b0134,17,
+0x2b0180,1,
+0x2b01a0,6,
+0x2b0200,5,
+0x2b0220,4,
+0x2b0234,17,
+0x2b0280,1,
+0x2b02a0,6,
+0x2b0300,5,
+0x2b0320,4,
+0x2b0334,17,
+0x2b0380,1,
+0x2b03a0,6,
+0x2b0500,6,
+0x2b051c,7,
+0x2b0540,1,
+0x2b0c00,13,
+0x2b0c40,12,
+0x2b0c80,13,
+0x2b0cc0,12,
+0x2b0d00,6,
+0x2b0d20,6,
+0x2b0d80,14,
+0x2b0dc0,2,
+0x2b0e40,11,
+0x2b0e80,6,
+0x2b0ea0,6,
+0x2b1000,2,
+0x2b1010,5,
+0x2b1060,32,
+0x2b1100,8,
+0x2b1180,3,
+0x2b1190,2,
+0x2b119c,5,
+0x2b1218,9,
+0x2b1240,3,
+0x2b1250,6,
+0x2b1280,1,
+0x2b1288,6,
+0x2b12a4,1,
+0x2b1400,8,
+0x2b1424,2,
+0x2b1500,5,
+0x2b1520,4,
+0x2b1540,5,
+0x2b1560,4,
+0x2b1800,24,
+0x2b1864,5,
+0x2b1880,8,
+0x2b1900,13,
+0x2b1980,4,
+0x2b19a0,6,
+0x2b1a40,1,
+0x2b1a60,1,
+0x2b1a68,23,
+0x2b1ac8,6,
+0x2b1b00,17,
+0x2b1b48,6,
+0x2b1b80,12,
+0x2b1c00,6,
+0x2b1c20,6,
+0x2b1c40,6,
+0x2b1c60,3,
+0x2b1d00,6,
+0x2b1d20,6,
+0x2b1d40,3,
+0x2b2000,5,
+0x2b2020,4,
+0x2b2034,17,
+0x2b2080,1,
+0x2b20a0,6,
+0x2b2100,5,
+0x2b2120,4,
+0x2b2134,17,
+0x2b2180,1,
+0x2b21a0,6,
+0x2b2200,5,
+0x2b2220,4,
+0x2b2234,17,
+0x2b2280,1,
+0x2b22a0,6,
+0x2b2300,5,
+0x2b2320,4,
+0x2b2334,17,
+0x2b2380,1,
+0x2b23a0,6,
+0x2b2500,6,
+0x2b251c,7,
+0x2b2540,1,
+0x2b2c00,13,
+0x2b2c40,12,
+0x2b2c80,13,
+0x2b2cc0,12,
+0x2b2d00,6,
+0x2b2d20,6,
+0x2b2d80,14,
+0x2b2dc0,2,
+0x2b2e40,11,
+0x2b2e80,6,
+0x2b2ea0,6,
+0x2b3000,2,
+0x2b3010,5,
+0x2b3060,32,
+0x2b3100,8,
+0x2b3180,3,
+0x2b3190,2,
+0x2b319c,5,
+0x2b3218,9,
+0x2b3240,3,
+0x2b3250,6,
+0x2b3280,1,
+0x2b3288,6,
+0x2b32a4,1,
+0x2b3400,8,
+0x2b3424,2,
+0x2b3500,5,
+0x2b3520,4,
+0x2b3540,5,
+0x2b3560,4,
+0x2b3800,24,
+0x2b3864,5,
+0x2b3880,8,
+0x2b3900,13,
+0x2b3980,4,
+0x2b39a0,6,
+0x2b3a40,1,
+0x2b3a60,1,
+0x2b3a68,23,
+0x2b3ac8,6,
+0x2b3b00,17,
+0x2b3b48,6,
+0x2b3b80,12,
+0x2b3c00,6,
+0x2b3c20,6,
+0x2b3c40,6,
+0x2b3c60,3,
+0x2b3d00,6,
+0x2b3d20,6,
+0x2b3d40,3,
+0x2b4000,29,
+0x2b4078,4,
+0x2b4090,2,
+0x2b40a0,7,
+0x2b40c0,11,
+0x2b4100,14,
+0x2b4140,14,
+0x2b4180,61,
+0x2b4278,4,
+0x2b4290,2,
+0x2b42a0,7,
+0x2b42c0,11,
+0x2b4300,14,
+0x2b4340,14,
+0x2b4380,61,
+0x2b4478,4,
+0x2b4490,2,
+0x2b44a0,7,
+0x2b44c0,11,
+0x2b4500,14,
+0x2b4540,14,
+0x2b4580,61,
+0x2b4678,4,
+0x2b4690,2,
+0x2b46a0,7,
+0x2b46c0,11,
+0x2b4700,14,
+0x2b4740,14,
+0x2b4780,67,
+0x2b4890,1,
+0x2b4a00,8,
+0x2b4a24,15,
+0x2b4a64,30,
+0x2b4b00,4,
+0x2b4b20,2,
+0x2b4c00,6,
+0x2b4c40,14,
+0x2b4c80,9,
+0x2b4d00,9,
+0x2b4d2c,1,
+0x2b4d40,3,
+0x2b4d60,1,
+0x2b4d80,3,
+0x2b4e00,2,
+0x2b4e0c,1,
+0x2b4e14,5,
+0x2b4e2c,1,
+0x2b4e34,5,
+0x2b4e4c,1,
+0x2b4e54,5,
+0x2b4e6c,1,
+0x2b4e74,5,
+0x2b4e8c,1,
+0x2b4e94,5,
+0x2b4eac,1,
+0x2b4eb4,3,
+0x2b5000,29,
+0x2b5078,4,
+0x2b5090,2,
+0x2b50a0,7,
+0x2b50c0,11,
+0x2b5100,14,
+0x2b5140,14,
+0x2b5180,61,
+0x2b5278,4,
+0x2b5290,2,
+0x2b52a0,7,
+0x2b52c0,11,
+0x2b5300,14,
+0x2b5340,14,
+0x2b5380,61,
+0x2b5478,4,
+0x2b5490,2,
+0x2b54a0,7,
+0x2b54c0,11,
+0x2b5500,14,
+0x2b5540,14,
+0x2b5580,61,
+0x2b5678,4,
+0x2b5690,2,
+0x2b56a0,7,
+0x2b56c0,11,
+0x2b5700,14,
+0x2b5740,14,
+0x2b5780,67,
+0x2b5890,1,
+0x2b5a00,8,
+0x2b5a24,15,
+0x2b5a64,30,
+0x2b5b00,4,
+0x2b5b20,2,
+0x2b5c00,6,
+0x2b5c40,14,
+0x2b5c80,9,
+0x2b5d00,9,
+0x2b5d2c,1,
+0x2b5d40,3,
+0x2b5d60,1,
+0x2b5d80,3,
+0x2b5e00,2,
+0x2b5e0c,1,
+0x2b5e14,5,
+0x2b5e2c,1,
+0x2b5e34,5,
+0x2b5e4c,1,
+0x2b5e54,5,
+0x2b5e6c,1,
+0x2b5e74,5,
+0x2b5e8c,1,
+0x2b5e94,5,
+0x2b5eac,1,
+0x2b5eb4,3,
+0x2b6000,14,
+0x2b6070,3,
+0x2b6080,6,
+0x2b6100,9,
+0x2b6204,1,
+0x2b620c,6,
+0x2b6240,13,
+0x2b6280,16,
+0x2b6800,19,
+0x2b6850,10,
+0x2b6880,19,
+0x2b68d0,10,
+0x2b6900,19,
+0x2b6950,10,
+0x2b6980,19,
+0x2b69d0,10,
+0x2b6a00,19,
+0x2b6a50,10,
+0x2b6a80,19,
+0x2b6ad0,10,
+0x2b6b00,19,
+0x2b6b50,10,
+0x2b6b80,19,
+0x2b6bd0,10,
+0x2b6c00,19,
+0x2b6c60,6,
+0x2b6c84,1,
+0x2b6c94,8,
+0x2b6cb8,9,
+0x2b6ce0,4,
+0x2b7000,6,
+0x2b7020,3,
+0x2b7040,7,
+0x2b7060,6,
+0x2b7100,5,
+0x2b7138,1,
+0x2b7144,1,
+0x2b7150,2,
+0x2b8000,6,
+0x2b8020,3,
+0x2b8030,9,
+0x2b8100,6,
+0x2b8120,10,
+0x2b8150,8,
+0x2b8400,1,
+0x2b8428,1,
+0x2b8450,1,
+0x2b8478,1,
+0x2b84a0,8,
+0x2b85ac,1,
+0x2b85d8,4,
+0x2b8600,6,
+0x2b8620,6,
+0x2b8640,3,
+0x2b8800,6,
+0x2b8820,3,
+0x2b8830,4,
+0x2b8858,2,
+0x2b8864,1,
+0x2b8874,3,
+0x2b8898,2,
+0x2b88a4,1,
+0x2b88b4,3,
+0x2b9000,6,
+0x2b9020,6,
+0x2b9040,3,
+0x2b9080,14,
+0x2b90bc,1,
+0x2b90c4,13,
+0x2b90fc,1,
+0x2b9200,20,
+0x2b925c,30,
+0x2b9300,24,
+0x2b9380,2,
+0x2b93a0,1,
+0x2b93c0,11,
+0x2b9404,3,
+0x2b9420,11,
+0x2b9460,3,
+0x2b9480,6,
+0x2b9500,6,
+0x2b9520,6,
+0x2b9540,1,
+0x2b9558,2,
+0x2b9600,17,
+0x2b9800,410,
+0x2ba000,6,
+0x2ba020,6,
+0x2ba040,3,
+0x2ba080,14,
+0x2ba0bc,1,
+0x2ba0c4,13,
+0x2ba0fc,1,
+0x2ba200,20,
+0x2ba25c,30,
+0x2ba300,24,
+0x2ba380,2,
+0x2ba3a0,1,
+0x2ba3c0,11,
+0x2ba404,3,
+0x2ba420,11,
+0x2ba460,3,
+0x2ba480,6,
+0x2ba500,6,
+0x2ba520,6,
+0x2ba540,1,
+0x2ba558,2,
+0x2ba600,17,
+0x2ba800,410,
+0x2bb000,4,
+0x2bb020,25,
+0x2bb088,8,
+0x2bb100,4,
+0x2bb120,25,
+0x2bb188,8,
+0x2bb200,34,
+0x2bb300,37,
+0x2bb400,16,
+0x2bb464,1,
+0x2bb474,3,
+0x2bb500,6,
+0x2bb520,2,
+0x2bb530,9,
+0x2bb570,10,
+0x2bb5a0,2,
+0x2bb5b0,9,
+0x2bb5f0,4,
+0x2bb620,7,
+0x2bb640,16,
+0x2bb700,6,
+0x2bb720,6,
+0x2bb740,6,
+0x2bb760,6,
+0x2bb780,3,
+0x2bb800,5,
+0x2bb818,1,
+0x2bb854,6,
+0x2bb880,2,
+0x2bb8a4,1,
+0x2bb8ac,2,
+0x2bba00,28,
+0x2bba7c,13,
+0x2bbab4,1,
+0x2bbabc,10,
+0x2bbb04,1,
+0x2bbb0c,5,
+0x2bbb24,1,
+0x2bbb34,9,
+0x2bbb60,6,
+0x2bbb80,22,
+0x2bbbe0,3,
+0x2bbbf0,2,
+0x2bbc00,5,
+0x2bbc18,1,
+0x2bbc54,6,
+0x2bbc80,2,
+0x2bbca4,1,
+0x2bbcac,2,
+0x2bbe00,28,
+0x2bbe7c,13,
+0x2bbeb4,1,
+0x2bbebc,10,
+0x2bbf04,1,
+0x2bbf0c,5,
+0x2bbf24,1,
+0x2bbf34,9,
+0x2bbf60,6,
+0x2bbf80,22,
+0x2bbfe0,3,
+0x2bbff0,2,
+0x2bc008,2,
+0x2bc014,11,
+0x2bc044,1,
+0x2bc04c,3,
+0x2bc05c,1,
+0x2bc064,1,
+0x2bc07c,1,
+0x2bc500,2,
+0x2bc518,1,
+0x2bc520,3,
+0x2bc540,6,
+0x2bc580,10,
+0x2bc808,2,
+0x2bc814,11,
+0x2bc844,1,
+0x2bc84c,3,
+0x2bc85c,1,
+0x2bc864,1,
+0x2bc87c,1,
+0x2bcd00,2,
+0x2bcd18,1,
+0x2bcd20,3,
+0x2bcd40,6,
+0x2bcd80,10,
+0x2bd800,2,
+0x2bd828,2,
+0x2bd850,2,
+0x2bd878,2,
+0x2bd8a0,6,
+0x2bd9ac,1,
+0x2bd9d8,4,
+0x2bda00,6,
+0x2bda20,6,
+0x2bda40,6,
+0x2bda60,6,
+0x2bda80,3,
+0x2bdc00,6,
+0x2bdc20,3,
+0x2bdc40,2,
+0x2bdc60,1,
+0x2c0000,5,
+0x2c0020,4,
+0x2c0034,17,
+0x2c0080,1,
+0x2c00a0,6,
+0x2c0100,5,
+0x2c0120,4,
+0x2c0134,17,
+0x2c0180,1,
+0x2c01a0,6,
+0x2c0200,5,
+0x2c0220,4,
+0x2c0234,17,
+0x2c0280,1,
+0x2c02a0,6,
+0x2c0300,5,
+0x2c0320,4,
+0x2c0334,17,
+0x2c0380,1,
+0x2c03a0,6,
+0x2c0500,6,
+0x2c051c,7,
+0x2c0540,1,
+0x2c0c00,13,
+0x2c0c40,12,
+0x2c0c80,13,
+0x2c0cc0,12,
+0x2c0d00,6,
+0x2c0d20,6,
+0x2c0d80,14,
+0x2c0dc0,2,
+0x2c0e40,11,
+0x2c0e80,6,
+0x2c0ea0,6,
+0x2c1000,2,
+0x2c1010,5,
+0x2c1060,32,
+0x2c1100,8,
+0x2c1180,3,
+0x2c1190,2,
+0x2c119c,5,
+0x2c1218,9,
+0x2c1240,3,
+0x2c1250,6,
+0x2c1280,1,
+0x2c1288,6,
+0x2c12a4,1,
+0x2c1400,8,
+0x2c1424,2,
+0x2c1500,5,
+0x2c1520,4,
+0x2c1540,5,
+0x2c1560,4,
+0x2c1800,24,
+0x2c1864,5,
+0x2c1880,8,
+0x2c1900,13,
+0x2c1980,4,
+0x2c19a0,6,
+0x2c1a40,1,
+0x2c1a60,1,
+0x2c1a68,23,
+0x2c1ac8,6,
+0x2c1b00,17,
+0x2c1b48,6,
+0x2c1b80,12,
+0x2c1c00,6,
+0x2c1c20,6,
+0x2c1c40,6,
+0x2c1c60,3,
+0x2c1d00,6,
+0x2c1d20,6,
+0x2c1d40,3,
+0x2c2000,5,
+0x2c2020,4,
+0x2c2034,17,
+0x2c2080,1,
+0x2c20a0,6,
+0x2c2100,5,
+0x2c2120,4,
+0x2c2134,17,
+0x2c2180,1,
+0x2c21a0,6,
+0x2c2200,5,
+0x2c2220,4,
+0x2c2234,17,
+0x2c2280,1,
+0x2c22a0,6,
+0x2c2300,5,
+0x2c2320,4,
+0x2c2334,17,
+0x2c2380,1,
+0x2c23a0,6,
+0x2c2500,6,
+0x2c251c,7,
+0x2c2540,1,
+0x2c2c00,13,
+0x2c2c40,12,
+0x2c2c80,13,
+0x2c2cc0,12,
+0x2c2d00,6,
+0x2c2d20,6,
+0x2c2d80,14,
+0x2c2dc0,2,
+0x2c2e40,11,
+0x2c2e80,6,
+0x2c2ea0,6,
+0x2c3000,2,
+0x2c3010,5,
+0x2c3060,32,
+0x2c3100,8,
+0x2c3180,3,
+0x2c3190,2,
+0x2c319c,5,
+0x2c3218,9,
+0x2c3240,3,
+0x2c3250,6,
+0x2c3280,1,
+0x2c3288,6,
+0x2c32a4,1,
+0x2c3400,8,
+0x2c3424,2,
+0x2c3500,5,
+0x2c3520,4,
+0x2c3540,5,
+0x2c3560,4,
+0x2c3800,24,
+0x2c3864,5,
+0x2c3880,8,
+0x2c3900,13,
+0x2c3980,4,
+0x2c39a0,6,
+0x2c3a40,1,
+0x2c3a60,1,
+0x2c3a68,23,
+0x2c3ac8,6,
+0x2c3b00,17,
+0x2c3b48,6,
+0x2c3b80,12,
+0x2c3c00,6,
+0x2c3c20,6,
+0x2c3c40,6,
+0x2c3c60,3,
+0x2c3d00,6,
+0x2c3d20,6,
+0x2c3d40,3,
+0x2c4000,29,
+0x2c4078,4,
+0x2c4090,2,
+0x2c40a0,7,
+0x2c40c0,11,
+0x2c4100,14,
+0x2c4140,14,
+0x2c4180,61,
+0x2c4278,4,
+0x2c4290,2,
+0x2c42a0,7,
+0x2c42c0,11,
+0x2c4300,14,
+0x2c4340,14,
+0x2c4380,61,
+0x2c4478,4,
+0x2c4490,2,
+0x2c44a0,7,
+0x2c44c0,11,
+0x2c4500,14,
+0x2c4540,14,
+0x2c4580,61,
+0x2c4678,4,
+0x2c4690,2,
+0x2c46a0,7,
+0x2c46c0,11,
+0x2c4700,14,
+0x2c4740,14,
+0x2c4780,67,
+0x2c4890,1,
+0x2c4a00,8,
+0x2c4a24,15,
+0x2c4a64,30,
+0x2c4b00,4,
+0x2c4b20,2,
+0x2c4c00,6,
+0x2c4c40,14,
+0x2c4c80,9,
+0x2c4d00,9,
+0x2c4d2c,1,
+0x2c4d40,3,
+0x2c4d60,1,
+0x2c4d80,3,
+0x2c4e00,2,
+0x2c4e0c,1,
+0x2c4e14,5,
+0x2c4e2c,1,
+0x2c4e34,5,
+0x2c4e4c,1,
+0x2c4e54,5,
+0x2c4e6c,1,
+0x2c4e74,5,
+0x2c4e8c,1,
+0x2c4e94,5,
+0x2c4eac,1,
+0x2c4eb4,3,
+0x2c5000,29,
+0x2c5078,4,
+0x2c5090,2,
+0x2c50a0,7,
+0x2c50c0,11,
+0x2c5100,14,
+0x2c5140,14,
+0x2c5180,61,
+0x2c5278,4,
+0x2c5290,2,
+0x2c52a0,7,
+0x2c52c0,11,
+0x2c5300,14,
+0x2c5340,14,
+0x2c5380,61,
+0x2c5478,4,
+0x2c5490,2,
+0x2c54a0,7,
+0x2c54c0,11,
+0x2c5500,14,
+0x2c5540,14,
+0x2c5580,61,
+0x2c5678,4,
+0x2c5690,2,
+0x2c56a0,7,
+0x2c56c0,11,
+0x2c5700,14,
+0x2c5740,14,
+0x2c5780,67,
+0x2c5890,1,
+0x2c5a00,8,
+0x2c5a24,15,
+0x2c5a64,30,
+0x2c5b00,4,
+0x2c5b20,2,
+0x2c5c00,6,
+0x2c5c40,14,
+0x2c5c80,9,
+0x2c5d00,9,
+0x2c5d2c,1,
+0x2c5d40,3,
+0x2c5d60,1,
+0x2c5d80,3,
+0x2c5e00,2,
+0x2c5e0c,1,
+0x2c5e14,5,
+0x2c5e2c,1,
+0x2c5e34,5,
+0x2c5e4c,1,
+0x2c5e54,5,
+0x2c5e6c,1,
+0x2c5e74,5,
+0x2c5e8c,1,
+0x2c5e94,5,
+0x2c5eac,1,
+0x2c5eb4,3,
+0x2c6000,14,
+0x2c6070,3,
+0x2c6080,6,
+0x2c6100,9,
+0x2c6204,1,
+0x2c620c,6,
+0x2c6240,13,
+0x2c6280,16,
+0x2c6800,19,
+0x2c6850,10,
+0x2c6880,19,
+0x2c68d0,10,
+0x2c6900,19,
+0x2c6950,10,
+0x2c6980,19,
+0x2c69d0,10,
+0x2c6a00,19,
+0x2c6a50,10,
+0x2c6a80,19,
+0x2c6ad0,10,
+0x2c6b00,19,
+0x2c6b50,10,
+0x2c6b80,19,
+0x2c6bd0,10,
+0x2c6c00,19,
+0x2c6c60,6,
+0x2c6c84,1,
+0x2c6c94,8,
+0x2c6cb8,9,
+0x2c6ce0,4,
+0x2c7000,6,
+0x2c7020,3,
+0x2c7040,7,
+0x2c7060,6,
+0x2c7100,5,
+0x2c7138,1,
+0x2c7144,1,
+0x2c7150,2,
+0x2c8000,6,
+0x2c8020,3,
+0x2c8030,9,
+0x2c8100,6,
+0x2c8120,10,
+0x2c8150,8,
+0x2c8400,1,
+0x2c8428,1,
+0x2c8450,1,
+0x2c8478,1,
+0x2c84a0,8,
+0x2c85ac,1,
+0x2c85d8,4,
+0x2c8600,6,
+0x2c8620,6,
+0x2c8640,3,
+0x2c8800,6,
+0x2c8820,3,
+0x2c8830,4,
+0x2c8858,2,
+0x2c8864,1,
+0x2c8874,3,
+0x2c8898,2,
+0x2c88a4,1,
+0x2c88b4,3,
+0x2c9000,6,
+0x2c9020,6,
+0x2c9040,3,
+0x2c9080,14,
+0x2c90bc,1,
+0x2c90c4,13,
+0x2c90fc,1,
+0x2c9200,20,
+0x2c925c,30,
+0x2c9300,24,
+0x2c9380,2,
+0x2c93a0,1,
+0x2c93c0,11,
+0x2c9404,3,
+0x2c9420,11,
+0x2c9460,3,
+0x2c9480,6,
+0x2c9500,6,
+0x2c9520,6,
+0x2c9540,1,
+0x2c9558,2,
+0x2c9600,17,
+0x2c9800,410,
+0x2ca000,6,
+0x2ca020,6,
+0x2ca040,3,
+0x2ca080,14,
+0x2ca0bc,1,
+0x2ca0c4,13,
+0x2ca0fc,1,
+0x2ca200,20,
+0x2ca25c,30,
+0x2ca300,24,
+0x2ca380,2,
+0x2ca3a0,1,
+0x2ca3c0,11,
+0x2ca404,3,
+0x2ca420,11,
+0x2ca460,3,
+0x2ca480,6,
+0x2ca500,6,
+0x2ca520,6,
+0x2ca540,1,
+0x2ca558,2,
+0x2ca600,17,
+0x2ca800,410,
+0x2cb000,4,
+0x2cb020,25,
+0x2cb088,8,
+0x2cb100,4,
+0x2cb120,25,
+0x2cb188,8,
+0x2cb200,34,
+0x2cb300,37,
+0x2cb400,16,
+0x2cb464,1,
+0x2cb474,3,
+0x2cb500,6,
+0x2cb520,2,
+0x2cb530,9,
+0x2cb570,10,
+0x2cb5a0,2,
+0x2cb5b0,9,
+0x2cb5f0,4,
+0x2cb620,7,
+0x2cb640,16,
+0x2cb700,6,
+0x2cb720,6,
+0x2cb740,6,
+0x2cb760,6,
+0x2cb780,3,
+0x2cb800,5,
+0x2cb818,1,
+0x2cb854,6,
+0x2cb880,2,
+0x2cb8a4,1,
+0x2cb8ac,2,
+0x2cba00,28,
+0x2cba7c,13,
+0x2cbab4,1,
+0x2cbabc,10,
+0x2cbb04,1,
+0x2cbb0c,5,
+0x2cbb24,1,
+0x2cbb34,9,
+0x2cbb60,6,
+0x2cbb80,22,
+0x2cbbe0,3,
+0x2cbbf0,2,
+0x2cbc00,5,
+0x2cbc18,1,
+0x2cbc54,6,
+0x2cbc80,2,
+0x2cbca4,1,
+0x2cbcac,2,
+0x2cbe00,28,
+0x2cbe7c,13,
+0x2cbeb4,1,
+0x2cbebc,10,
+0x2cbf04,1,
+0x2cbf0c,5,
+0x2cbf24,1,
+0x2cbf34,9,
+0x2cbf60,6,
+0x2cbf80,22,
+0x2cbfe0,3,
+0x2cbff0,2,
+0x2cc008,2,
+0x2cc014,11,
+0x2cc044,1,
+0x2cc04c,3,
+0x2cc05c,1,
+0x2cc064,1,
+0x2cc07c,1,
+0x2cc500,2,
+0x2cc518,1,
+0x2cc520,3,
+0x2cc540,6,
+0x2cc580,10,
+0x2cc808,2,
+0x2cc814,11,
+0x2cc844,1,
+0x2cc84c,3,
+0x2cc85c,1,
+0x2cc864,1,
+0x2cc87c,1,
+0x2ccd00,2,
+0x2ccd18,1,
+0x2ccd20,3,
+0x2ccd40,6,
+0x2ccd80,10,
+0x2cd800,2,
+0x2cd828,2,
+0x2cd850,2,
+0x2cd878,2,
+0x2cd8a0,6,
+0x2cd9ac,1,
+0x2cd9d8,4,
+0x2cda00,6,
+0x2cda20,6,
+0x2cda40,6,
+0x2cda60,6,
+0x2cda80,3,
+0x2cdc00,6,
+0x2cdc20,3,
+0x2cdc40,2,
+0x2cdc60,1,
+0x2d0000,5,
+0x2d0020,4,
+0x2d0034,17,
+0x2d0080,1,
+0x2d00a0,6,
+0x2d0100,5,
+0x2d0120,4,
+0x2d0134,17,
+0x2d0180,1,
+0x2d01a0,6,
+0x2d0200,5,
+0x2d0220,4,
+0x2d0234,17,
+0x2d0280,1,
+0x2d02a0,6,
+0x2d0300,5,
+0x2d0320,4,
+0x2d0334,17,
+0x2d0380,1,
+0x2d03a0,6,
+0x2d0500,6,
+0x2d051c,7,
+0x2d0540,1,
+0x2d0c00,13,
+0x2d0c40,12,
+0x2d0c80,13,
+0x2d0cc0,12,
+0x2d0d00,6,
+0x2d0d20,6,
+0x2d0d80,14,
+0x2d0dc0,2,
+0x2d0e40,11,
+0x2d0e80,6,
+0x2d0ea0,6,
+0x2d1000,2,
+0x2d1010,5,
+0x2d1060,32,
+0x2d1100,8,
+0x2d1180,3,
+0x2d1190,2,
+0x2d119c,5,
+0x2d1218,9,
+0x2d1240,3,
+0x2d1250,6,
+0x2d1280,1,
+0x2d1288,6,
+0x2d12a4,1,
+0x2d1400,8,
+0x2d1424,2,
+0x2d1500,5,
+0x2d1520,4,
+0x2d1540,5,
+0x2d1560,4,
+0x2d1800,24,
+0x2d1864,5,
+0x2d1880,8,
+0x2d1900,13,
+0x2d1980,4,
+0x2d19a0,6,
+0x2d1a40,1,
+0x2d1a60,1,
+0x2d1a68,23,
+0x2d1ac8,6,
+0x2d1b00,17,
+0x2d1b48,6,
+0x2d1b80,12,
+0x2d1c00,6,
+0x2d1c20,6,
+0x2d1c40,6,
+0x2d1c60,3,
+0x2d1d00,6,
+0x2d1d20,6,
+0x2d1d40,3,
+0x2d2000,5,
+0x2d2020,4,
+0x2d2034,17,
+0x2d2080,1,
+0x2d20a0,6,
+0x2d2100,5,
+0x2d2120,4,
+0x2d2134,17,
+0x2d2180,1,
+0x2d21a0,6,
+0x2d2200,5,
+0x2d2220,4,
+0x2d2234,17,
+0x2d2280,1,
+0x2d22a0,6,
+0x2d2300,5,
+0x2d2320,4,
+0x2d2334,17,
+0x2d2380,1,
+0x2d23a0,6,
+0x2d2500,6,
+0x2d251c,7,
+0x2d2540,1,
+0x2d2c00,13,
+0x2d2c40,12,
+0x2d2c80,13,
+0x2d2cc0,12,
+0x2d2d00,6,
+0x2d2d20,6,
+0x2d2d80,14,
+0x2d2dc0,2,
+0x2d2e40,11,
+0x2d2e80,6,
+0x2d2ea0,6,
+0x2d3000,2,
+0x2d3010,5,
+0x2d3060,32,
+0x2d3100,8,
+0x2d3180,3,
+0x2d3190,2,
+0x2d319c,5,
+0x2d3218,9,
+0x2d3240,3,
+0x2d3250,6,
+0x2d3280,1,
+0x2d3288,6,
+0x2d32a4,1,
+0x2d3400,8,
+0x2d3424,2,
+0x2d3500,5,
+0x2d3520,4,
+0x2d3540,5,
+0x2d3560,4,
+0x2d3800,24,
+0x2d3864,5,
+0x2d3880,8,
+0x2d3900,13,
+0x2d3980,4,
+0x2d39a0,6,
+0x2d3a40,1,
+0x2d3a60,1,
+0x2d3a68,23,
+0x2d3ac8,6,
+0x2d3b00,17,
+0x2d3b48,6,
+0x2d3b80,12,
+0x2d3c00,6,
+0x2d3c20,6,
+0x2d3c40,6,
+0x2d3c60,3,
+0x2d3d00,6,
+0x2d3d20,6,
+0x2d3d40,3,
+0x2d4000,29,
+0x2d4078,4,
+0x2d4090,2,
+0x2d40a0,7,
+0x2d40c0,11,
+0x2d4100,14,
+0x2d4140,14,
+0x2d4180,61,
+0x2d4278,4,
+0x2d4290,2,
+0x2d42a0,7,
+0x2d42c0,11,
+0x2d4300,14,
+0x2d4340,14,
+0x2d4380,61,
+0x2d4478,4,
+0x2d4490,2,
+0x2d44a0,7,
+0x2d44c0,11,
+0x2d4500,14,
+0x2d4540,14,
+0x2d4580,61,
+0x2d4678,4,
+0x2d4690,2,
+0x2d46a0,7,
+0x2d46c0,11,
+0x2d4700,14,
+0x2d4740,14,
+0x2d4780,67,
+0x2d4890,1,
+0x2d4a00,8,
+0x2d4a24,15,
+0x2d4a64,30,
+0x2d4b00,4,
+0x2d4b20,2,
+0x2d4c00,6,
+0x2d4c40,14,
+0x2d4c80,9,
+0x2d4d00,9,
+0x2d4d2c,1,
+0x2d4d40,3,
+0x2d4d60,1,
+0x2d4d80,3,
+0x2d4e00,2,
+0x2d4e0c,1,
+0x2d4e14,5,
+0x2d4e2c,1,
+0x2d4e34,5,
+0x2d4e4c,1,
+0x2d4e54,5,
+0x2d4e6c,1,
+0x2d4e74,5,
+0x2d4e8c,1,
+0x2d4e94,5,
+0x2d4eac,1,
+0x2d4eb4,3,
+0x2d5000,29,
+0x2d5078,4,
+0x2d5090,2,
+0x2d50a0,7,
+0x2d50c0,11,
+0x2d5100,14,
+0x2d5140,14,
+0x2d5180,61,
+0x2d5278,4,
+0x2d5290,2,
+0x2d52a0,7,
+0x2d52c0,11,
+0x2d5300,14,
+0x2d5340,14,
+0x2d5380,61,
+0x2d5478,4,
+0x2d5490,2,
+0x2d54a0,7,
+0x2d54c0,11,
+0x2d5500,14,
+0x2d5540,14,
+0x2d5580,61,
+0x2d5678,4,
+0x2d5690,2,
+0x2d56a0,7,
+0x2d56c0,11,
+0x2d5700,14,
+0x2d5740,14,
+0x2d5780,67,
+0x2d5890,1,
+0x2d5a00,8,
+0x2d5a24,15,
+0x2d5a64,30,
+0x2d5b00,4,
+0x2d5b20,2,
+0x2d5c00,6,
+0x2d5c40,14,
+0x2d5c80,9,
+0x2d5d00,9,
+0x2d5d2c,1,
+0x2d5d40,3,
+0x2d5d60,1,
+0x2d5d80,3,
+0x2d5e00,2,
+0x2d5e0c,1,
+0x2d5e14,5,
+0x2d5e2c,1,
+0x2d5e34,5,
+0x2d5e4c,1,
+0x2d5e54,5,
+0x2d5e6c,1,
+0x2d5e74,5,
+0x2d5e8c,1,
+0x2d5e94,5,
+0x2d5eac,1,
+0x2d5eb4,3,
+0x2d6000,14,
+0x2d6070,3,
+0x2d6080,6,
+0x2d6100,9,
+0x2d6204,1,
+0x2d620c,6,
+0x2d6240,13,
+0x2d6280,16,
+0x2d6400,8,
+0x2d6424,15,
+0x2d6464,15,
+0x2d64a4,15,
+0x2d64e4,30,
+0x2d6580,10,
+0x2d65ac,1,
+0x2d65b4,5,
+0x2d65cc,1,
+0x2d65d4,5,
+0x2d65ec,1,
+0x2d65f4,13,
+0x2d6680,4,
+0x2d6694,2,
+0x2d66a0,5,
+0x2d66c0,5,
+0x2d66e0,4,
+0x2d6800,19,
+0x2d6850,10,
+0x2d6880,19,
+0x2d68d0,10,
+0x2d6900,19,
+0x2d6950,10,
+0x2d6980,19,
+0x2d69d0,10,
+0x2d6a00,19,
+0x2d6a50,10,
+0x2d6a80,19,
+0x2d6ad0,10,
+0x2d6b00,19,
+0x2d6b50,10,
+0x2d6b80,19,
+0x2d6bd0,10,
+0x2d6c00,19,
+0x2d6c60,6,
+0x2d6c84,1,
+0x2d6c94,8,
+0x2d6cb8,9,
+0x2d6ce0,4,
+0x2d7000,6,
+0x2d7020,3,
+0x2d7040,7,
+0x2d7060,6,
+0x2d7100,5,
+0x2d7138,1,
+0x2d7144,1,
+0x2d7150,2,
+0x2d8000,6,
+0x2d8020,3,
+0x2d8030,9,
+0x2d8100,6,
+0x2d8120,10,
+0x2d8150,8,
+0x2d8400,1,
+0x2d8428,1,
+0x2d8450,1,
+0x2d8478,1,
+0x2d84a0,8,
+0x2d85ac,1,
+0x2d85d8,4,
+0x2d8600,6,
+0x2d8620,6,
+0x2d8640,3,
+0x2d8800,6,
+0x2d8820,3,
+0x2d8830,4,
+0x2d8858,2,
+0x2d8864,1,
+0x2d8874,3,
+0x2d8898,2,
+0x2d88a4,1,
+0x2d88b4,3,
+0x2d9000,6,
+0x2d9020,6,
+0x2d9040,3,
+0x2d9080,14,
+0x2d90bc,1,
+0x2d90c4,13,
+0x2d90fc,1,
+0x2d9200,20,
+0x2d925c,30,
+0x2d9300,24,
+0x2d9380,2,
+0x2d93a0,1,
+0x2d93c0,11,
+0x2d9404,3,
+0x2d9420,11,
+0x2d9460,3,
+0x2d9480,6,
+0x2d9500,6,
+0x2d9520,6,
+0x2d9540,1,
+0x2d9558,2,
+0x2d9600,17,
+0x2d9800,410,
+0x2da000,6,
+0x2da020,6,
+0x2da040,3,
+0x2da080,14,
+0x2da0bc,1,
+0x2da0c4,13,
+0x2da0fc,1,
+0x2da200,20,
+0x2da25c,30,
+0x2da300,24,
+0x2da380,2,
+0x2da3a0,1,
+0x2da3c0,11,
+0x2da404,3,
+0x2da420,11,
+0x2da460,3,
+0x2da480,6,
+0x2da500,6,
+0x2da520,6,
+0x2da540,1,
+0x2da558,2,
+0x2da600,17,
+0x2da800,410,
+0x2db000,4,
+0x2db020,25,
+0x2db088,8,
+0x2db100,4,
+0x2db120,25,
+0x2db188,8,
+0x2db200,34,
+0x2db300,37,
+0x2db400,16,
+0x2db464,1,
+0x2db474,3,
+0x2db500,6,
+0x2db520,2,
+0x2db530,9,
+0x2db570,10,
+0x2db5a0,2,
+0x2db5b0,9,
+0x2db5f0,4,
+0x2db620,7,
+0x2db640,16,
+0x2db700,6,
+0x2db720,6,
+0x2db740,6,
+0x2db760,6,
+0x2db780,3,
+0x2db800,5,
+0x2db818,1,
+0x2db854,6,
+0x2db880,2,
+0x2db8a4,1,
+0x2db8ac,2,
+0x2dba00,28,
+0x2dba7c,13,
+0x2dbab4,1,
+0x2dbabc,10,
+0x2dbb04,1,
+0x2dbb0c,5,
+0x2dbb24,1,
+0x2dbb34,9,
+0x2dbb60,6,
+0x2dbb80,22,
+0x2dbbe0,3,
+0x2dbbf0,2,
+0x2dbc00,5,
+0x2dbc18,1,
+0x2dbc54,6,
+0x2dbc80,2,
+0x2dbca4,1,
+0x2dbcac,2,
+0x2dbe00,28,
+0x2dbe7c,13,
+0x2dbeb4,1,
+0x2dbebc,10,
+0x2dbf04,1,
+0x2dbf0c,5,
+0x2dbf24,1,
+0x2dbf34,9,
+0x2dbf60,6,
+0x2dbf80,22,
+0x2dbfe0,3,
+0x2dbff0,2,
+0x2dc008,2,
+0x2dc014,11,
+0x2dc044,1,
+0x2dc04c,3,
+0x2dc05c,1,
+0x2dc064,1,
+0x2dc07c,1,
+0x2dc500,2,
+0x2dc518,1,
+0x2dc520,3,
+0x2dc540,6,
+0x2dc580,10,
+0x2dc808,2,
+0x2dc814,11,
+0x2dc844,1,
+0x2dc84c,3,
+0x2dc85c,1,
+0x2dc864,1,
+0x2dc87c,1,
+0x2dcd00,2,
+0x2dcd18,1,
+0x2dcd20,3,
+0x2dcd40,6,
+0x2dcd80,10,
+0x2dd800,2,
+0x2dd828,2,
+0x2dd850,2,
+0x2dd878,2,
+0x2dd8a0,6,
+0x2dd9ac,1,
+0x2dd9d8,4,
+0x2dda00,6,
+0x2dda20,6,
+0x2dda40,6,
+0x2dda60,6,
+0x2dda80,3,
+0x2ddc00,6,
+0x2ddc20,3,
+0x2ddc40,2,
+0x2ddc60,1,
+0x2e0000,5,
+0x2e0020,4,
+0x2e0034,17,
+0x2e0080,1,
+0x2e00a0,6,
+0x2e0100,5,
+0x2e0120,4,
+0x2e0134,17,
+0x2e0180,1,
+0x2e01a0,6,
+0x2e0200,5,
+0x2e0220,4,
+0x2e0234,17,
+0x2e0280,1,
+0x2e02a0,6,
+0x2e0300,5,
+0x2e0320,4,
+0x2e0334,17,
+0x2e0380,1,
+0x2e03a0,6,
+0x2e0500,6,
+0x2e051c,7,
+0x2e0540,1,
+0x2e0c00,13,
+0x2e0c40,12,
+0x2e0c80,13,
+0x2e0cc0,12,
+0x2e0d00,6,
+0x2e0d20,6,
+0x2e0d80,14,
+0x2e0dc0,2,
+0x2e0e40,11,
+0x2e0e80,6,
+0x2e0ea0,6,
+0x2e1000,2,
+0x2e1010,5,
+0x2e1060,32,
+0x2e1100,8,
+0x2e1180,3,
+0x2e1190,2,
+0x2e119c,5,
+0x2e1218,9,
+0x2e1240,3,
+0x2e1250,6,
+0x2e1280,1,
+0x2e1288,6,
+0x2e12a4,1,
+0x2e1400,8,
+0x2e1424,2,
+0x2e1500,5,
+0x2e1520,4,
+0x2e1540,5,
+0x2e1560,4,
+0x2e1800,24,
+0x2e1864,5,
+0x2e1880,8,
+0x2e1900,13,
+0x2e1980,4,
+0x2e19a0,6,
+0x2e1a40,1,
+0x2e1a60,1,
+0x2e1a68,23,
+0x2e1ac8,6,
+0x2e1b00,17,
+0x2e1b48,6,
+0x2e1b80,12,
+0x2e1c00,6,
+0x2e1c20,6,
+0x2e1c40,6,
+0x2e1c60,3,
+0x2e1d00,6,
+0x2e1d20,6,
+0x2e1d40,3,
+0x2e2000,5,
+0x2e2020,4,
+0x2e2034,17,
+0x2e2080,1,
+0x2e20a0,6,
+0x2e2100,5,
+0x2e2120,4,
+0x2e2134,17,
+0x2e2180,1,
+0x2e21a0,6,
+0x2e2200,5,
+0x2e2220,4,
+0x2e2234,17,
+0x2e2280,1,
+0x2e22a0,6,
+0x2e2300,5,
+0x2e2320,4,
+0x2e2334,17,
+0x2e2380,1,
+0x2e23a0,6,
+0x2e2500,6,
+0x2e251c,7,
+0x2e2540,1,
+0x2e2c00,13,
+0x2e2c40,12,
+0x2e2c80,13,
+0x2e2cc0,12,
+0x2e2d00,6,
+0x2e2d20,6,
+0x2e2d80,14,
+0x2e2dc0,2,
+0x2e2e40,11,
+0x2e2e80,6,
+0x2e2ea0,6,
+0x2e3000,2,
+0x2e3010,5,
+0x2e3060,32,
+0x2e3100,8,
+0x2e3180,3,
+0x2e3190,2,
+0x2e319c,5,
+0x2e3218,9,
+0x2e3240,3,
+0x2e3250,6,
+0x2e3280,1,
+0x2e3288,6,
+0x2e32a4,1,
+0x2e3400,8,
+0x2e3424,2,
+0x2e3500,5,
+0x2e3520,4,
+0x2e3540,5,
+0x2e3560,4,
+0x2e3800,24,
+0x2e3864,5,
+0x2e3880,8,
+0x2e3900,13,
+0x2e3980,4,
+0x2e39a0,6,
+0x2e3a40,1,
+0x2e3a60,1,
+0x2e3a68,23,
+0x2e3ac8,6,
+0x2e3b00,17,
+0x2e3b48,6,
+0x2e3b80,12,
+0x2e3c00,6,
+0x2e3c20,6,
+0x2e3c40,6,
+0x2e3c60,3,
+0x2e3d00,6,
+0x2e3d20,6,
+0x2e3d40,3,
+0x2e4000,29,
+0x2e4078,4,
+0x2e4090,2,
+0x2e40a0,7,
+0x2e40c0,11,
+0x2e4100,14,
+0x2e4140,14,
+0x2e4180,61,
+0x2e4278,4,
+0x2e4290,2,
+0x2e42a0,7,
+0x2e42c0,11,
+0x2e4300,14,
+0x2e4340,14,
+0x2e4380,61,
+0x2e4478,4,
+0x2e4490,2,
+0x2e44a0,7,
+0x2e44c0,11,
+0x2e4500,14,
+0x2e4540,14,
+0x2e4580,61,
+0x2e4678,4,
+0x2e4690,2,
+0x2e46a0,7,
+0x2e46c0,11,
+0x2e4700,14,
+0x2e4740,14,
+0x2e4780,67,
+0x2e4890,1,
+0x2e4a00,8,
+0x2e4a24,15,
+0x2e4a64,30,
+0x2e4b00,4,
+0x2e4b20,2,
+0x2e4c00,6,
+0x2e4c40,14,
+0x2e4c80,9,
+0x2e4d00,9,
+0x2e4d2c,1,
+0x2e4d40,3,
+0x2e4d60,1,
+0x2e4d80,3,
+0x2e4e00,2,
+0x2e4e0c,1,
+0x2e4e14,5,
+0x2e4e2c,1,
+0x2e4e34,5,
+0x2e4e4c,1,
+0x2e4e54,5,
+0x2e4e6c,1,
+0x2e4e74,5,
+0x2e4e8c,1,
+0x2e4e94,5,
+0x2e4eac,1,
+0x2e4eb4,3,
+0x2e5000,29,
+0x2e5078,4,
+0x2e5090,2,
+0x2e50a0,7,
+0x2e50c0,11,
+0x2e5100,14,
+0x2e5140,14,
+0x2e5180,61,
+0x2e5278,4,
+0x2e5290,2,
+0x2e52a0,7,
+0x2e52c0,11,
+0x2e5300,14,
+0x2e5340,14,
+0x2e5380,61,
+0x2e5478,4,
+0x2e5490,2,
+0x2e54a0,7,
+0x2e54c0,11,
+0x2e5500,14,
+0x2e5540,14,
+0x2e5580,61,
+0x2e5678,4,
+0x2e5690,2,
+0x2e56a0,7,
+0x2e56c0,11,
+0x2e5700,14,
+0x2e5740,14,
+0x2e5780,67,
+0x2e5890,1,
+0x2e5a00,8,
+0x2e5a24,15,
+0x2e5a64,30,
+0x2e5b00,4,
+0x2e5b20,2,
+0x2e5c00,6,
+0x2e5c40,14,
+0x2e5c80,9,
+0x2e5d00,9,
+0x2e5d2c,1,
+0x2e5d40,3,
+0x2e5d60,1,
+0x2e5d80,3,
+0x2e5e00,2,
+0x2e5e0c,1,
+0x2e5e14,5,
+0x2e5e2c,1,
+0x2e5e34,5,
+0x2e5e4c,1,
+0x2e5e54,5,
+0x2e5e6c,1,
+0x2e5e74,5,
+0x2e5e8c,1,
+0x2e5e94,5,
+0x2e5eac,1,
+0x2e5eb4,3,
+0x2e6000,14,
+0x2e6070,3,
+0x2e6080,6,
+0x2e6100,9,
+0x2e6204,1,
+0x2e620c,6,
+0x2e6240,13,
+0x2e6280,16,
+0x2e6800,19,
+0x2e6850,10,
+0x2e6880,19,
+0x2e68d0,10,
+0x2e6900,19,
+0x2e6950,10,
+0x2e6980,19,
+0x2e69d0,10,
+0x2e6a00,19,
+0x2e6a50,10,
+0x2e6a80,19,
+0x2e6ad0,10,
+0x2e6b00,19,
+0x2e6b50,10,
+0x2e6b80,19,
+0x2e6bd0,10,
+0x2e6c00,19,
+0x2e6c60,6,
+0x2e6c84,1,
+0x2e6c94,8,
+0x2e6cb8,9,
+0x2e6ce0,4,
+0x2e7000,6,
+0x2e7020,3,
+0x2e7040,7,
+0x2e7060,6,
+0x2e7100,5,
+0x2e7138,1,
+0x2e7144,1,
+0x2e7150,2,
+0x2e8000,6,
+0x2e8020,3,
+0x2e8030,9,
+0x2e8100,6,
+0x2e8120,10,
+0x2e8150,8,
+0x2e8400,1,
+0x2e8428,1,
+0x2e8450,1,
+0x2e8478,1,
+0x2e84a0,8,
+0x2e85ac,1,
+0x2e85d8,4,
+0x2e8600,6,
+0x2e8620,6,
+0x2e8640,3,
+0x2e8800,6,
+0x2e8820,3,
+0x2e8830,4,
+0x2e8858,2,
+0x2e8864,1,
+0x2e8874,3,
+0x2e8898,2,
+0x2e88a4,1,
+0x2e88b4,3,
+0x2e9000,6,
+0x2e9020,6,
+0x2e9040,3,
+0x2e9080,14,
+0x2e90bc,1,
+0x2e90c4,13,
+0x2e90fc,1,
+0x2e9200,20,
+0x2e925c,30,
+0x2e9300,24,
+0x2e9380,2,
+0x2e93a0,1,
+0x2e93c0,11,
+0x2e9404,3,
+0x2e9420,11,
+0x2e9460,3,
+0x2e9480,6,
+0x2e9500,6,
+0x2e9520,6,
+0x2e9540,1,
+0x2e9558,2,
+0x2e9600,17,
+0x2e9800,410,
+0x2ea000,6,
+0x2ea020,6,
+0x2ea040,3,
+0x2ea080,14,
+0x2ea0bc,1,
+0x2ea0c4,13,
+0x2ea0fc,1,
+0x2ea200,20,
+0x2ea25c,30,
+0x2ea300,24,
+0x2ea380,2,
+0x2ea3a0,1,
+0x2ea3c0,11,
+0x2ea404,3,
+0x2ea420,11,
+0x2ea460,3,
+0x2ea480,6,
+0x2ea500,6,
+0x2ea520,6,
+0x2ea540,1,
+0x2ea558,2,
+0x2ea600,17,
+0x2ea800,410,
+0x2eb000,4,
+0x2eb020,25,
+0x2eb088,8,
+0x2eb100,4,
+0x2eb120,25,
+0x2eb188,8,
+0x2eb200,34,
+0x2eb300,37,
+0x2eb400,16,
+0x2eb464,1,
+0x2eb474,3,
+0x2eb500,6,
+0x2eb520,2,
+0x2eb530,9,
+0x2eb570,10,
+0x2eb5a0,2,
+0x2eb5b0,9,
+0x2eb5f0,4,
+0x2eb620,7,
+0x2eb640,16,
+0x2eb700,6,
+0x2eb720,6,
+0x2eb740,6,
+0x2eb760,6,
+0x2eb780,3,
+0x2eb800,5,
+0x2eb818,1,
+0x2eb854,6,
+0x2eb880,2,
+0x2eb8a4,1,
+0x2eb8ac,2,
+0x2eba00,28,
+0x2eba7c,13,
+0x2ebab4,1,
+0x2ebabc,10,
+0x2ebb04,1,
+0x2ebb0c,5,
+0x2ebb24,1,
+0x2ebb34,9,
+0x2ebb60,6,
+0x2ebb80,22,
+0x2ebbe0,3,
+0x2ebbf0,2,
+0x2ebc00,5,
+0x2ebc18,1,
+0x2ebc54,6,
+0x2ebc80,2,
+0x2ebca4,1,
+0x2ebcac,2,
+0x2ebe00,28,
+0x2ebe7c,13,
+0x2ebeb4,1,
+0x2ebebc,10,
+0x2ebf04,1,
+0x2ebf0c,5,
+0x2ebf24,1,
+0x2ebf34,9,
+0x2ebf60,6,
+0x2ebf80,22,
+0x2ebfe0,3,
+0x2ebff0,2,
+0x2ec008,2,
+0x2ec014,11,
+0x2ec044,1,
+0x2ec04c,3,
+0x2ec05c,1,
+0x2ec064,1,
+0x2ec07c,1,
+0x2ec500,2,
+0x2ec518,1,
+0x2ec520,3,
+0x2ec540,6,
+0x2ec580,10,
+0x2ec808,2,
+0x2ec814,11,
+0x2ec844,1,
+0x2ec84c,3,
+0x2ec85c,1,
+0x2ec864,1,
+0x2ec87c,1,
+0x2ecd00,2,
+0x2ecd18,1,
+0x2ecd20,3,
+0x2ecd40,6,
+0x2ecd80,10,
+0x2ed800,2,
+0x2ed828,2,
+0x2ed850,2,
+0x2ed878,2,
+0x2ed8a0,6,
+0x2ed9ac,1,
+0x2ed9d8,4,
+0x2eda00,6,
+0x2eda20,6,
+0x2eda40,6,
+0x2eda60,6,
+0x2eda80,3,
+0x2edc00,6,
+0x2edc20,3,
+0x2edc40,2,
+0x2edc60,1,
+0x2f0000,5,
+0x2f0020,4,
+0x2f0034,17,
+0x2f0080,1,
+0x2f00a0,6,
+0x2f0100,5,
+0x2f0120,4,
+0x2f0134,17,
+0x2f0180,1,
+0x2f01a0,6,
+0x2f0200,5,
+0x2f0220,4,
+0x2f0234,17,
+0x2f0280,1,
+0x2f02a0,6,
+0x2f0300,5,
+0x2f0320,4,
+0x2f0334,17,
+0x2f0380,1,
+0x2f03a0,6,
+0x2f0500,6,
+0x2f051c,7,
+0x2f0540,1,
+0x2f0c00,13,
+0x2f0c40,12,
+0x2f0c80,13,
+0x2f0cc0,12,
+0x2f0d00,6,
+0x2f0d20,6,
+0x2f0d80,14,
+0x2f0dc0,2,
+0x2f0e40,11,
+0x2f0e80,6,
+0x2f0ea0,6,
+0x2f1000,2,
+0x2f1010,5,
+0x2f1060,32,
+0x2f1100,8,
+0x2f1180,3,
+0x2f1190,2,
+0x2f119c,5,
+0x2f1218,9,
+0x2f1240,3,
+0x2f1250,6,
+0x2f1280,1,
+0x2f1288,6,
+0x2f12a4,1,
+0x2f1400,8,
+0x2f1424,2,
+0x2f1500,5,
+0x2f1520,4,
+0x2f1540,5,
+0x2f1560,4,
+0x2f1800,24,
+0x2f1864,5,
+0x2f1880,8,
+0x2f1900,13,
+0x2f1980,4,
+0x2f19a0,6,
+0x2f1a40,1,
+0x2f1a60,1,
+0x2f1a68,23,
+0x2f1ac8,6,
+0x2f1b00,17,
+0x2f1b48,6,
+0x2f1b80,12,
+0x2f1c00,6,
+0x2f1c20,6,
+0x2f1c40,6,
+0x2f1c60,3,
+0x2f1d00,6,
+0x2f1d20,6,
+0x2f1d40,3,
+0x2f2000,5,
+0x2f2020,4,
+0x2f2034,17,
+0x2f2080,1,
+0x2f20a0,6,
+0x2f2100,5,
+0x2f2120,4,
+0x2f2134,17,
+0x2f2180,1,
+0x2f21a0,6,
+0x2f2200,5,
+0x2f2220,4,
+0x2f2234,17,
+0x2f2280,1,
+0x2f22a0,6,
+0x2f2300,5,
+0x2f2320,4,
+0x2f2334,17,
+0x2f2380,1,
+0x2f23a0,6,
+0x2f2500,6,
+0x2f251c,7,
+0x2f2540,1,
+0x2f2c00,13,
+0x2f2c40,12,
+0x2f2c80,13,
+0x2f2cc0,12,
+0x2f2d00,6,
+0x2f2d20,6,
+0x2f2d80,14,
+0x2f2dc0,2,
+0x2f2e40,11,
+0x2f2e80,6,
+0x2f2ea0,6,
+0x2f3000,2,
+0x2f3010,5,
+0x2f3060,32,
+0x2f3100,8,
+0x2f3180,3,
+0x2f3190,2,
+0x2f319c,5,
+0x2f3218,9,
+0x2f3240,3,
+0x2f3250,6,
+0x2f3280,1,
+0x2f3288,6,
+0x2f32a4,1,
+0x2f3400,8,
+0x2f3424,2,
+0x2f3500,5,
+0x2f3520,4,
+0x2f3540,5,
+0x2f3560,4,
+0x2f3800,24,
+0x2f3864,5,
+0x2f3880,8,
+0x2f3900,13,
+0x2f3980,4,
+0x2f39a0,6,
+0x2f3a40,1,
+0x2f3a60,1,
+0x2f3a68,23,
+0x2f3ac8,6,
+0x2f3b00,17,
+0x2f3b48,6,
+0x2f3b80,12,
+0x2f3c00,6,
+0x2f3c20,6,
+0x2f3c40,6,
+0x2f3c60,3,
+0x2f3d00,6,
+0x2f3d20,6,
+0x2f3d40,3,
+0x2f4000,29,
+0x2f4078,4,
+0x2f4090,2,
+0x2f40a0,7,
+0x2f40c0,11,
+0x2f4100,14,
+0x2f4140,14,
+0x2f4180,61,
+0x2f4278,4,
+0x2f4290,2,
+0x2f42a0,7,
+0x2f42c0,11,
+0x2f4300,14,
+0x2f4340,14,
+0x2f4380,61,
+0x2f4478,4,
+0x2f4490,2,
+0x2f44a0,7,
+0x2f44c0,11,
+0x2f4500,14,
+0x2f4540,14,
+0x2f4580,61,
+0x2f4678,4,
+0x2f4690,2,
+0x2f46a0,7,
+0x2f46c0,11,
+0x2f4700,14,
+0x2f4740,14,
+0x2f4780,67,
+0x2f4890,1,
+0x2f4a00,8,
+0x2f4a24,15,
+0x2f4a64,30,
+0x2f4b00,4,
+0x2f4b20,2,
+0x2f4c00,6,
+0x2f4c40,14,
+0x2f4c80,9,
+0x2f4d00,9,
+0x2f4d2c,1,
+0x2f4d40,3,
+0x2f4d60,1,
+0x2f4d80,3,
+0x2f4e00,2,
+0x2f4e0c,1,
+0x2f4e14,5,
+0x2f4e2c,1,
+0x2f4e34,5,
+0x2f4e4c,1,
+0x2f4e54,5,
+0x2f4e6c,1,
+0x2f4e74,5,
+0x2f4e8c,1,
+0x2f4e94,5,
+0x2f4eac,1,
+0x2f4eb4,3,
+0x2f5000,29,
+0x2f5078,4,
+0x2f5090,2,
+0x2f50a0,7,
+0x2f50c0,11,
+0x2f5100,14,
+0x2f5140,14,
+0x2f5180,61,
+0x2f5278,4,
+0x2f5290,2,
+0x2f52a0,7,
+0x2f52c0,11,
+0x2f5300,14,
+0x2f5340,14,
+0x2f5380,61,
+0x2f5478,4,
+0x2f5490,2,
+0x2f54a0,7,
+0x2f54c0,11,
+0x2f5500,14,
+0x2f5540,14,
+0x2f5580,61,
+0x2f5678,4,
+0x2f5690,2,
+0x2f56a0,7,
+0x2f56c0,11,
+0x2f5700,14,
+0x2f5740,14,
+0x2f5780,67,
+0x2f5890,1,
+0x2f5a00,8,
+0x2f5a24,15,
+0x2f5a64,30,
+0x2f5b00,4,
+0x2f5b20,2,
+0x2f5c00,6,
+0x2f5c40,14,
+0x2f5c80,9,
+0x2f5d00,9,
+0x2f5d2c,1,
+0x2f5d40,3,
+0x2f5d60,1,
+0x2f5d80,3,
+0x2f5e00,2,
+0x2f5e0c,1,
+0x2f5e14,5,
+0x2f5e2c,1,
+0x2f5e34,5,
+0x2f5e4c,1,
+0x2f5e54,5,
+0x2f5e6c,1,
+0x2f5e74,5,
+0x2f5e8c,1,
+0x2f5e94,5,
+0x2f5eac,1,
+0x2f5eb4,3,
+0x2f6000,14,
+0x2f6070,3,
+0x2f6080,6,
+0x2f6100,9,
+0x2f6204,1,
+0x2f620c,6,
+0x2f6240,13,
+0x2f6280,16,
+0x2f6800,19,
+0x2f6850,10,
+0x2f6880,19,
+0x2f68d0,10,
+0x2f6900,19,
+0x2f6950,10,
+0x2f6980,19,
+0x2f69d0,10,
+0x2f6a00,19,
+0x2f6a50,10,
+0x2f6a80,19,
+0x2f6ad0,10,
+0x2f6b00,19,
+0x2f6b50,10,
+0x2f6b80,19,
+0x2f6bd0,10,
+0x2f6c00,19,
+0x2f6c60,6,
+0x2f6c84,1,
+0x2f6c94,8,
+0x2f6cb8,9,
+0x2f6ce0,4,
+0x2f7000,6,
+0x2f7020,3,
+0x2f7040,7,
+0x2f7060,6,
+0x2f7100,5,
+0x2f7138,1,
+0x2f7144,1,
+0x2f7150,2,
+0x2f8000,6,
+0x2f8020,3,
+0x2f8030,9,
+0x2f8100,6,
+0x2f8120,10,
+0x2f8150,8,
+0x2f8400,1,
+0x2f8428,1,
+0x2f8450,1,
+0x2f8478,1,
+0x2f84a0,8,
+0x2f85ac,1,
+0x2f85d8,4,
+0x2f8600,6,
+0x2f8620,6,
+0x2f8640,3,
+0x2f8800,6,
+0x2f8820,3,
+0x2f8830,4,
+0x2f8858,2,
+0x2f8864,1,
+0x2f8874,3,
+0x2f8898,2,
+0x2f88a4,1,
+0x2f88b4,3,
+0x2f9000,6,
+0x2f9020,6,
+0x2f9040,3,
+0x2f9080,14,
+0x2f90bc,1,
+0x2f90c4,13,
+0x2f90fc,1,
+0x2f9200,20,
+0x2f925c,30,
+0x2f9300,24,
+0x2f9380,2,
+0x2f93a0,1,
+0x2f93c0,11,
+0x2f9404,3,
+0x2f9420,11,
+0x2f9460,3,
+0x2f9480,6,
+0x2f9500,6,
+0x2f9520,6,
+0x2f9540,1,
+0x2f9558,2,
+0x2f9600,17,
+0x2f9800,410,
+0x2fa000,6,
+0x2fa020,6,
+0x2fa040,3,
+0x2fa080,14,
+0x2fa0bc,1,
+0x2fa0c4,13,
+0x2fa0fc,1,
+0x2fa200,20,
+0x2fa25c,30,
+0x2fa300,24,
+0x2fa380,2,
+0x2fa3a0,1,
+0x2fa3c0,11,
+0x2fa404,3,
+0x2fa420,11,
+0x2fa460,3,
+0x2fa480,6,
+0x2fa500,6,
+0x2fa520,6,
+0x2fa540,1,
+0x2fa558,2,
+0x2fa600,17,
+0x2fa800,410,
+0x2fb000,4,
+0x2fb020,25,
+0x2fb088,8,
+0x2fb100,4,
+0x2fb120,25,
+0x2fb188,8,
+0x2fb200,34,
+0x2fb300,37,
+0x2fb400,16,
+0x2fb464,1,
+0x2fb474,3,
+0x2fb500,6,
+0x2fb520,2,
+0x2fb530,9,
+0x2fb570,10,
+0x2fb5a0,2,
+0x2fb5b0,9,
+0x2fb5f0,4,
+0x2fb620,7,
+0x2fb640,16,
+0x2fb700,6,
+0x2fb720,6,
+0x2fb740,6,
+0x2fb760,6,
+0x2fb780,3,
+0x2fb800,5,
+0x2fb818,1,
+0x2fb854,6,
+0x2fb880,2,
+0x2fb8a4,1,
+0x2fb8ac,2,
+0x2fba00,28,
+0x2fba7c,13,
+0x2fbab4,1,
+0x2fbabc,10,
+0x2fbb04,1,
+0x2fbb0c,5,
+0x2fbb24,1,
+0x2fbb34,9,
+0x2fbb60,6,
+0x2fbb80,22,
+0x2fbbe0,3,
+0x2fbbf0,2,
+0x2fbc00,5,
+0x2fbc18,1,
+0x2fbc54,6,
+0x2fbc80,2,
+0x2fbca4,1,
+0x2fbcac,2,
+0x2fbe00,28,
+0x2fbe7c,13,
+0x2fbeb4,1,
+0x2fbebc,10,
+0x2fbf04,1,
+0x2fbf0c,5,
+0x2fbf24,1,
+0x2fbf34,9,
+0x2fbf60,6,
+0x2fbf80,22,
+0x2fbfe0,3,
+0x2fbff0,2,
+0x2fc008,2,
+0x2fc014,11,
+0x2fc044,1,
+0x2fc04c,3,
+0x2fc05c,1,
+0x2fc064,1,
+0x2fc07c,1,
+0x2fc500,2,
+0x2fc518,1,
+0x2fc520,3,
+0x2fc540,6,
+0x2fc580,10,
+0x2fc808,2,
+0x2fc814,11,
+0x2fc844,1,
+0x2fc84c,3,
+0x2fc85c,1,
+0x2fc864,1,
+0x2fc87c,1,
+0x2fcd00,2,
+0x2fcd18,1,
+0x2fcd20,3,
+0x2fcd40,6,
+0x2fcd80,10,
+0x2fd800,2,
+0x2fd828,2,
+0x2fd850,2,
+0x2fd878,2,
+0x2fd8a0,6,
+0x2fd9ac,1,
+0x2fd9d8,4,
+0x2fda00,6,
+0x2fda20,6,
+0x2fda40,6,
+0x2fda60,6,
+0x2fda80,3,
+0x2fdc00,6,
+0x2fdc20,3,
+0x2fdc40,2,
+0x2fdc60,1,
+0x300000,5,
+0x300020,4,
+0x300034,17,
+0x300080,1,
+0x3000a0,6,
+0x300100,5,
+0x300120,4,
+0x300134,17,
+0x300180,1,
+0x3001a0,6,
+0x300200,5,
+0x300220,4,
+0x300234,17,
+0x300280,1,
+0x3002a0,6,
+0x300300,5,
+0x300320,4,
+0x300334,17,
+0x300380,1,
+0x3003a0,6,
+0x300500,6,
+0x30051c,7,
+0x300540,1,
+0x300c00,13,
+0x300c40,12,
+0x300c80,13,
+0x300cc0,12,
+0x300d00,6,
+0x300d20,6,
+0x300d80,14,
+0x300dc0,2,
+0x300e40,11,
+0x300e80,6,
+0x300ea0,6,
+0x301000,2,
+0x301010,5,
+0x301060,32,
+0x301100,8,
+0x301180,3,
+0x301190,2,
+0x30119c,5,
+0x301218,9,
+0x301240,3,
+0x301250,6,
+0x301280,1,
+0x301288,6,
+0x3012a4,1,
+0x301400,8,
+0x301424,2,
+0x301500,5,
+0x301520,4,
+0x301540,5,
+0x301560,4,
+0x301800,24,
+0x301864,5,
+0x301880,8,
+0x301900,13,
+0x301980,4,
+0x3019a0,6,
+0x301a40,1,
+0x301a60,1,
+0x301a68,23,
+0x301ac8,6,
+0x301b00,17,
+0x301b48,6,
+0x301b80,12,
+0x301c00,6,
+0x301c20,6,
+0x301c40,6,
+0x301c60,3,
+0x301d00,6,
+0x301d20,6,
+0x301d40,3,
+0x302000,5,
+0x302020,4,
+0x302034,17,
+0x302080,1,
+0x3020a0,6,
+0x302100,5,
+0x302120,4,
+0x302134,17,
+0x302180,1,
+0x3021a0,6,
+0x302200,5,
+0x302220,4,
+0x302234,17,
+0x302280,1,
+0x3022a0,6,
+0x302300,5,
+0x302320,4,
+0x302334,17,
+0x302380,1,
+0x3023a0,6,
+0x302500,6,
+0x30251c,7,
+0x302540,1,
+0x302c00,13,
+0x302c40,12,
+0x302c80,13,
+0x302cc0,12,
+0x302d00,6,
+0x302d20,6,
+0x302d80,14,
+0x302dc0,2,
+0x302e40,11,
+0x302e80,6,
+0x302ea0,6,
+0x303000,2,
+0x303010,5,
+0x303060,32,
+0x303100,8,
+0x303180,3,
+0x303190,2,
+0x30319c,5,
+0x303218,9,
+0x303240,3,
+0x303250,6,
+0x303280,1,
+0x303288,6,
+0x3032a4,1,
+0x303400,8,
+0x303424,2,
+0x303500,5,
+0x303520,4,
+0x303540,5,
+0x303560,4,
+0x303800,24,
+0x303864,5,
+0x303880,8,
+0x303900,13,
+0x303980,4,
+0x3039a0,6,
+0x303a40,1,
+0x303a60,1,
+0x303a68,23,
+0x303ac8,6,
+0x303b00,17,
+0x303b48,6,
+0x303b80,12,
+0x303c00,6,
+0x303c20,6,
+0x303c40,6,
+0x303c60,3,
+0x303d00,6,
+0x303d20,6,
+0x303d40,3,
+0x304000,29,
+0x304078,4,
+0x304090,2,
+0x3040a0,7,
+0x3040c0,11,
+0x304100,14,
+0x304140,14,
+0x304180,61,
+0x304278,4,
+0x304290,2,
+0x3042a0,7,
+0x3042c0,11,
+0x304300,14,
+0x304340,14,
+0x304380,61,
+0x304478,4,
+0x304490,2,
+0x3044a0,7,
+0x3044c0,11,
+0x304500,14,
+0x304540,14,
+0x304580,61,
+0x304678,4,
+0x304690,2,
+0x3046a0,7,
+0x3046c0,11,
+0x304700,14,
+0x304740,14,
+0x304780,67,
+0x304890,1,
+0x304a00,8,
+0x304a24,15,
+0x304a64,30,
+0x304b00,4,
+0x304b20,2,
+0x304c00,6,
+0x304c40,14,
+0x304c80,9,
+0x304d00,9,
+0x304d2c,1,
+0x304d40,3,
+0x304d60,1,
+0x304d80,3,
+0x304e00,2,
+0x304e0c,1,
+0x304e14,5,
+0x304e2c,1,
+0x304e34,5,
+0x304e4c,1,
+0x304e54,5,
+0x304e6c,1,
+0x304e74,5,
+0x304e8c,1,
+0x304e94,5,
+0x304eac,1,
+0x304eb4,3,
+0x305000,29,
+0x305078,4,
+0x305090,2,
+0x3050a0,7,
+0x3050c0,11,
+0x305100,14,
+0x305140,14,
+0x305180,61,
+0x305278,4,
+0x305290,2,
+0x3052a0,7,
+0x3052c0,11,
+0x305300,14,
+0x305340,14,
+0x305380,61,
+0x305478,4,
+0x305490,2,
+0x3054a0,7,
+0x3054c0,11,
+0x305500,14,
+0x305540,14,
+0x305580,61,
+0x305678,4,
+0x305690,2,
+0x3056a0,7,
+0x3056c0,11,
+0x305700,14,
+0x305740,14,
+0x305780,67,
+0x305890,1,
+0x305a00,8,
+0x305a24,15,
+0x305a64,30,
+0x305b00,4,
+0x305b20,2,
+0x305c00,6,
+0x305c40,14,
+0x305c80,9,
+0x305d00,9,
+0x305d2c,1,
+0x305d40,3,
+0x305d60,1,
+0x305d80,3,
+0x305e00,2,
+0x305e0c,1,
+0x305e14,5,
+0x305e2c,1,
+0x305e34,5,
+0x305e4c,1,
+0x305e54,5,
+0x305e6c,1,
+0x305e74,5,
+0x305e8c,1,
+0x305e94,5,
+0x305eac,1,
+0x305eb4,3,
+0x306000,14,
+0x306070,3,
+0x306080,6,
+0x306100,9,
+0x306204,1,
+0x30620c,6,
+0x306240,13,
+0x306280,16,
+0x306800,19,
+0x306850,10,
+0x306880,19,
+0x3068d0,10,
+0x306900,19,
+0x306950,10,
+0x306980,19,
+0x3069d0,10,
+0x306a00,19,
+0x306a50,10,
+0x306a80,19,
+0x306ad0,10,
+0x306b00,19,
+0x306b50,10,
+0x306b80,19,
+0x306bd0,10,
+0x306c00,19,
+0x306c60,6,
+0x306c84,1,
+0x306c94,8,
+0x306cb8,9,
+0x306ce0,4,
+0x307000,6,
+0x307020,3,
+0x307040,7,
+0x307060,6,
+0x307100,5,
+0x307138,1,
+0x307144,1,
+0x307150,2,
+0x308000,6,
+0x308020,3,
+0x308030,9,
+0x308100,6,
+0x308120,10,
+0x308150,8,
+0x308400,1,
+0x308428,1,
+0x308450,1,
+0x308478,1,
+0x3084a0,8,
+0x3085ac,1,
+0x3085d8,4,
+0x308600,6,
+0x308620,6,
+0x308640,3,
+0x308800,6,
+0x308820,3,
+0x308830,4,
+0x308858,2,
+0x308864,1,
+0x308874,3,
+0x308898,2,
+0x3088a4,1,
+0x3088b4,3,
+0x309000,6,
+0x309020,6,
+0x309040,3,
+0x309080,14,
+0x3090bc,1,
+0x3090c4,13,
+0x3090fc,1,
+0x309200,20,
+0x30925c,30,
+0x309300,24,
+0x309380,2,
+0x3093a0,1,
+0x3093c0,11,
+0x309404,3,
+0x309420,11,
+0x309460,3,
+0x309480,6,
+0x309500,6,
+0x309520,6,
+0x309540,1,
+0x309558,2,
+0x309600,17,
+0x309800,410,
+0x30a000,6,
+0x30a020,6,
+0x30a040,3,
+0x30a080,14,
+0x30a0bc,1,
+0x30a0c4,13,
+0x30a0fc,1,
+0x30a200,20,
+0x30a25c,30,
+0x30a300,24,
+0x30a380,2,
+0x30a3a0,1,
+0x30a3c0,11,
+0x30a404,3,
+0x30a420,11,
+0x30a460,3,
+0x30a480,6,
+0x30a500,6,
+0x30a520,6,
+0x30a540,1,
+0x30a558,2,
+0x30a600,17,
+0x30a800,410,
+0x30b000,4,
+0x30b020,25,
+0x30b088,8,
+0x30b100,4,
+0x30b120,25,
+0x30b188,8,
+0x30b200,34,
+0x30b300,37,
+0x30b400,16,
+0x30b464,1,
+0x30b474,3,
+0x30b500,6,
+0x30b520,2,
+0x30b530,9,
+0x30b570,10,
+0x30b5a0,2,
+0x30b5b0,9,
+0x30b5f0,4,
+0x30b620,7,
+0x30b640,16,
+0x30b700,6,
+0x30b720,6,
+0x30b740,6,
+0x30b760,6,
+0x30b780,3,
+0x30b800,5,
+0x30b818,1,
+0x30b854,6,
+0x30b880,2,
+0x30b8a4,1,
+0x30b8ac,2,
+0x30ba00,28,
+0x30ba7c,13,
+0x30bab4,1,
+0x30babc,10,
+0x30bb04,1,
+0x30bb0c,5,
+0x30bb24,1,
+0x30bb34,9,
+0x30bb60,6,
+0x30bb80,22,
+0x30bbe0,3,
+0x30bbf0,2,
+0x30bc00,5,
+0x30bc18,1,
+0x30bc54,6,
+0x30bc80,2,
+0x30bca4,1,
+0x30bcac,2,
+0x30be00,28,
+0x30be7c,13,
+0x30beb4,1,
+0x30bebc,10,
+0x30bf04,1,
+0x30bf0c,5,
+0x30bf24,1,
+0x30bf34,9,
+0x30bf60,6,
+0x30bf80,22,
+0x30bfe0,3,
+0x30bff0,2,
+0x30c008,2,
+0x30c014,11,
+0x30c044,1,
+0x30c04c,3,
+0x30c05c,1,
+0x30c064,1,
+0x30c07c,1,
+0x30c500,2,
+0x30c518,1,
+0x30c520,3,
+0x30c540,6,
+0x30c580,10,
+0x30c808,2,
+0x30c814,11,
+0x30c844,1,
+0x30c84c,3,
+0x30c85c,1,
+0x30c864,1,
+0x30c87c,1,
+0x30cd00,2,
+0x30cd18,1,
+0x30cd20,3,
+0x30cd40,6,
+0x30cd80,10,
+0x30d800,2,
+0x30d828,2,
+0x30d850,2,
+0x30d878,2,
+0x30d8a0,6,
+0x30d9ac,1,
+0x30d9d8,4,
+0x30da00,6,
+0x30da20,6,
+0x30da40,6,
+0x30da60,6,
+0x30da80,3,
+0x30dc00,6,
+0x30dc20,3,
+0x30dc40,2,
+0x30dc60,1,
+0x310000,5,
+0x310020,4,
+0x310034,17,
+0x310080,1,
+0x3100a0,6,
+0x310100,5,
+0x310120,4,
+0x310134,17,
+0x310180,1,
+0x3101a0,6,
+0x310200,5,
+0x310220,4,
+0x310234,17,
+0x310280,1,
+0x3102a0,6,
+0x310300,5,
+0x310320,4,
+0x310334,17,
+0x310380,1,
+0x3103a0,6,
+0x310500,6,
+0x31051c,7,
+0x310540,1,
+0x310c00,13,
+0x310c40,12,
+0x310c80,13,
+0x310cc0,12,
+0x310d00,6,
+0x310d20,6,
+0x310d80,14,
+0x310dc0,2,
+0x310e40,11,
+0x310e80,6,
+0x310ea0,6,
+0x311000,2,
+0x311010,5,
+0x311060,32,
+0x311100,8,
+0x311180,3,
+0x311190,2,
+0x31119c,5,
+0x311218,9,
+0x311240,3,
+0x311250,6,
+0x311280,1,
+0x311288,6,
+0x3112a4,1,
+0x311400,8,
+0x311424,2,
+0x311500,5,
+0x311520,4,
+0x311540,5,
+0x311560,4,
+0x311800,24,
+0x311864,5,
+0x311880,8,
+0x311900,13,
+0x311980,4,
+0x3119a0,6,
+0x311a40,1,
+0x311a60,1,
+0x311a68,23,
+0x311ac8,6,
+0x311b00,17,
+0x311b48,6,
+0x311b80,12,
+0x311c00,6,
+0x311c20,6,
+0x311c40,6,
+0x311c60,3,
+0x311d00,6,
+0x311d20,6,
+0x311d40,3,
+0x312000,5,
+0x312020,4,
+0x312034,17,
+0x312080,1,
+0x3120a0,6,
+0x312100,5,
+0x312120,4,
+0x312134,17,
+0x312180,1,
+0x3121a0,6,
+0x312200,5,
+0x312220,4,
+0x312234,17,
+0x312280,1,
+0x3122a0,6,
+0x312300,5,
+0x312320,4,
+0x312334,17,
+0x312380,1,
+0x3123a0,6,
+0x312500,6,
+0x31251c,7,
+0x312540,1,
+0x312c00,13,
+0x312c40,12,
+0x312c80,13,
+0x312cc0,12,
+0x312d00,6,
+0x312d20,6,
+0x312d80,14,
+0x312dc0,2,
+0x312e40,11,
+0x312e80,6,
+0x312ea0,6,
+0x313000,2,
+0x313010,5,
+0x313060,32,
+0x313100,8,
+0x313180,3,
+0x313190,2,
+0x31319c,5,
+0x313218,9,
+0x313240,3,
+0x313250,6,
+0x313280,1,
+0x313288,6,
+0x3132a4,1,
+0x313400,8,
+0x313424,2,
+0x313500,5,
+0x313520,4,
+0x313540,5,
+0x313560,4,
+0x313800,24,
+0x313864,5,
+0x313880,8,
+0x313900,13,
+0x313980,4,
+0x3139a0,6,
+0x313a40,1,
+0x313a60,1,
+0x313a68,23,
+0x313ac8,6,
+0x313b00,17,
+0x313b48,6,
+0x313b80,12,
+0x313c00,6,
+0x313c20,6,
+0x313c40,6,
+0x313c60,3,
+0x313d00,6,
+0x313d20,6,
+0x313d40,3,
+0x314000,29,
+0x314078,4,
+0x314090,2,
+0x3140a0,7,
+0x3140c0,11,
+0x314100,14,
+0x314140,14,
+0x314180,61,
+0x314278,4,
+0x314290,2,
+0x3142a0,7,
+0x3142c0,11,
+0x314300,14,
+0x314340,14,
+0x314380,61,
+0x314478,4,
+0x314490,2,
+0x3144a0,7,
+0x3144c0,11,
+0x314500,14,
+0x314540,14,
+0x314580,61,
+0x314678,4,
+0x314690,2,
+0x3146a0,7,
+0x3146c0,11,
+0x314700,14,
+0x314740,14,
+0x314780,67,
+0x314890,1,
+0x314a00,8,
+0x314a24,15,
+0x314a64,30,
+0x314b00,4,
+0x314b20,2,
+0x314c00,6,
+0x314c40,14,
+0x314c80,9,
+0x314d00,9,
+0x314d2c,1,
+0x314d40,3,
+0x314d60,1,
+0x314d80,3,
+0x314e00,2,
+0x314e0c,1,
+0x314e14,5,
+0x314e2c,1,
+0x314e34,5,
+0x314e4c,1,
+0x314e54,5,
+0x314e6c,1,
+0x314e74,5,
+0x314e8c,1,
+0x314e94,5,
+0x314eac,1,
+0x314eb4,3,
+0x315000,29,
+0x315078,4,
+0x315090,2,
+0x3150a0,7,
+0x3150c0,11,
+0x315100,14,
+0x315140,14,
+0x315180,61,
+0x315278,4,
+0x315290,2,
+0x3152a0,7,
+0x3152c0,11,
+0x315300,14,
+0x315340,14,
+0x315380,61,
+0x315478,4,
+0x315490,2,
+0x3154a0,7,
+0x3154c0,11,
+0x315500,14,
+0x315540,14,
+0x315580,61,
+0x315678,4,
+0x315690,2,
+0x3156a0,7,
+0x3156c0,11,
+0x315700,14,
+0x315740,14,
+0x315780,67,
+0x315890,1,
+0x315a00,8,
+0x315a24,15,
+0x315a64,30,
+0x315b00,4,
+0x315b20,2,
+0x315c00,6,
+0x315c40,14,
+0x315c80,9,
+0x315d00,9,
+0x315d2c,1,
+0x315d40,3,
+0x315d60,1,
+0x315d80,3,
+0x315e00,2,
+0x315e0c,1,
+0x315e14,5,
+0x315e2c,1,
+0x315e34,5,
+0x315e4c,1,
+0x315e54,5,
+0x315e6c,1,
+0x315e74,5,
+0x315e8c,1,
+0x315e94,5,
+0x315eac,1,
+0x315eb4,3,
+0x316000,14,
+0x316070,3,
+0x316080,6,
+0x316100,9,
+0x316204,1,
+0x31620c,6,
+0x316240,13,
+0x316280,16,
+0x316800,19,
+0x316850,10,
+0x316880,19,
+0x3168d0,10,
+0x316900,19,
+0x316950,10,
+0x316980,19,
+0x3169d0,10,
+0x316a00,19,
+0x316a50,10,
+0x316a80,19,
+0x316ad0,10,
+0x316b00,19,
+0x316b50,10,
+0x316b80,19,
+0x316bd0,10,
+0x316c00,19,
+0x316c60,6,
+0x316c84,1,
+0x316c94,8,
+0x316cb8,9,
+0x316ce0,4,
+0x317000,6,
+0x317020,3,
+0x317040,7,
+0x317060,6,
+0x317100,5,
+0x317138,1,
+0x317144,1,
+0x317150,2,
+0x318000,6,
+0x318020,3,
+0x318030,9,
+0x318100,6,
+0x318120,10,
+0x318150,8,
+0x318400,1,
+0x318428,1,
+0x318450,1,
+0x318478,1,
+0x3184a0,8,
+0x3185ac,1,
+0x3185d8,4,
+0x318600,6,
+0x318620,6,
+0x318640,3,
+0x318800,6,
+0x318820,3,
+0x318830,4,
+0x318858,2,
+0x318864,1,
+0x318874,3,
+0x318898,2,
+0x3188a4,1,
+0x3188b4,3,
+0x319000,6,
+0x319020,6,
+0x319040,3,
+0x319080,14,
+0x3190bc,1,
+0x3190c4,13,
+0x3190fc,1,
+0x319200,20,
+0x31925c,30,
+0x319300,24,
+0x319380,2,
+0x3193a0,1,
+0x3193c0,11,
+0x319404,3,
+0x319420,11,
+0x319460,3,
+0x319480,6,
+0x319500,6,
+0x319520,6,
+0x319540,1,
+0x319558,2,
+0x319600,17,
+0x319800,410,
+0x31a000,6,
+0x31a020,6,
+0x31a040,3,
+0x31a080,14,
+0x31a0bc,1,
+0x31a0c4,13,
+0x31a0fc,1,
+0x31a200,20,
+0x31a25c,30,
+0x31a300,24,
+0x31a380,2,
+0x31a3a0,1,
+0x31a3c0,11,
+0x31a404,3,
+0x31a420,11,
+0x31a460,3,
+0x31a480,6,
+0x31a500,6,
+0x31a520,6,
+0x31a540,1,
+0x31a558,2,
+0x31a600,17,
+0x31a800,410,
+0x31b000,4,
+0x31b020,25,
+0x31b088,8,
+0x31b100,4,
+0x31b120,25,
+0x31b188,8,
+0x31b200,34,
+0x31b300,37,
+0x31b400,16,
+0x31b464,1,
+0x31b474,3,
+0x31b500,6,
+0x31b520,2,
+0x31b530,9,
+0x31b570,10,
+0x31b5a0,2,
+0x31b5b0,9,
+0x31b5f0,4,
+0x31b620,7,
+0x31b640,16,
+0x31b700,6,
+0x31b720,6,
+0x31b740,6,
+0x31b760,6,
+0x31b780,3,
+0x31b800,5,
+0x31b818,1,
+0x31b854,6,
+0x31b880,2,
+0x31b8a4,1,
+0x31b8ac,2,
+0x31ba00,28,
+0x31ba7c,13,
+0x31bab4,1,
+0x31babc,10,
+0x31bb04,1,
+0x31bb0c,5,
+0x31bb24,1,
+0x31bb34,9,
+0x31bb60,6,
+0x31bb80,22,
+0x31bbe0,3,
+0x31bbf0,2,
+0x31bc00,5,
+0x31bc18,1,
+0x31bc54,6,
+0x31bc80,2,
+0x31bca4,1,
+0x31bcac,2,
+0x31be00,28,
+0x31be7c,13,
+0x31beb4,1,
+0x31bebc,10,
+0x31bf04,1,
+0x31bf0c,5,
+0x31bf24,1,
+0x31bf34,9,
+0x31bf60,6,
+0x31bf80,22,
+0x31bfe0,3,
+0x31bff0,2,
+0x31c008,2,
+0x31c014,11,
+0x31c044,1,
+0x31c04c,3,
+0x31c05c,1,
+0x31c064,1,
+0x31c07c,1,
+0x31c500,2,
+0x31c518,1,
+0x31c520,3,
+0x31c540,6,
+0x31c580,10,
+0x31c808,2,
+0x31c814,11,
+0x31c844,1,
+0x31c84c,3,
+0x31c85c,1,
+0x31c864,1,
+0x31c87c,1,
+0x31cd00,2,
+0x31cd18,1,
+0x31cd20,3,
+0x31cd40,6,
+0x31cd80,10,
+0x31d800,2,
+0x31d828,2,
+0x31d850,2,
+0x31d878,2,
+0x31d8a0,6,
+0x31d9ac,1,
+0x31d9d8,4,
+0x31da00,6,
+0x31da20,6,
+0x31da40,6,
+0x31da60,6,
+0x31da80,3,
+0x31dc00,6,
+0x31dc20,3,
+0x31dc40,2,
+0x31dc60,1,
diff --git a/mstflint.spec b/mstflint.spec
index d38d908..97f2a5c 100644
--- a/mstflint.spec
+++ b/mstflint.spec
@@ -1,23 +1,24 @@
 %{!?ibmadlib: %define ibmadlib libibmad-devel}
 %{!?name: %define name mstflint}
-%{!?version: %define version 4.1.0}
+%{!?version: %define version 4.4.0}
 %{!?release: %define release 1}
 %{!?buildtype: %define buildtype "native"}
 %{!?noinband: %define noinband 0}
 %{!?nodc: %define nodc 0}
+%{!?enablecs: %define enablecs 0}
 
 %define debug_package %{nil}
 %define optflags -g -O2
 
 Summary: Mellanox firmware burning application
 Name: %{name}
-Version: 4.1.0
-Release: 1.46.gb1cdaf7
+Version: 4.4.0
+Release: 1.12.gd1edd58
 License: GPL/BSD
 Url: http://openfabrics.org
 Group: System Environment/Base
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
-Source: http://www.openfabrics.org/downloads/mstflint-4.1.0-1.46.gb1cdaf7.tar.gz
+Source: http://www.openfabrics.org/downloads/mstflint-4.4.0-1.12.gd1edd58.tar.gz
 ExclusiveArch: i386 i486 i586 i686 x86_64 ia64 ppc ppc64 ppc64le arm64 aarch64
 BuildRequires: zlib-devel %{ibmadlib}
 
@@ -38,6 +39,10 @@ for network adapters based on Mellanox Technologies chips.
     config_flags="$config_flags --disable-inband"
 %endif
 
+%if %{enablecs}
+    config_flags="$config_flags --enable-cs"
+%endif
+
 %if %{buildtype} == "ppc"
     config_flags="$config_flags --host=ppc-linux"
 %endif
@@ -64,6 +69,14 @@ make DESTDIR=${RPM_BUILD_ROOT} install
 # remove unpackaged files from the buildroot
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 
+# create softlinks to old mtcr header and lib locations
+# link mtcr_ul to old location
+mkdir -p %{buildroot}/%{_includedir}/mtcr_ul
+ln -s %{_includedir}/mstflint/mtcr.h %{buildroot}/%{_includedir}/mtcr_ul/mtcr.h
+ln -s %{_includedir}/mstflint/mtcr_com_defs.h %{buildroot}/%{_includedir}/mtcr_ul/mtcr_com_defs.h
+# link mtcr_ul to old lib path
+ln -s %{_libdir}/mstflint/libmtcr_ul.a %{buildroot}/%{_libdir}/libmtcr_ul.a 
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -78,12 +91,27 @@ rm -rf $RPM_BUILD_ROOT
 %{_bindir}/mstmcra
 %{_bindir}/mstconfig
 %{_bindir}/hca_self_test.ofed
+
+%{_includedir}/mstflint/mtcr.h
+%{_includedir}/mstflint/mtcr_com_defs.h
 %{_includedir}/mtcr_ul/mtcr.h
+%{_includedir}/mtcr_ul/mtcr_com_defs.h
+%{_libdir}/mstflint/libmtcr_ul.a
 %{_libdir}/libmtcr_ul.a
+
 %{_datadir}/mstflint
 %{_mandir}/man1/*
 
 %changelog
+* Wed May 17 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.4.0 Updates
+   
+* Wed Mar 23 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.4.0 Updates
+
+* Mon Jan 11 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.3.0 Updates
+
 * Wed Aug 26 2015 Adrian Chiris <adrianc at dev.mellanox.co.il>
    MFT 4.1.0 Updates
    
diff --git a/mstflint.spec.in b/mstflint.spec.in
index a9d0ff3..18807a8 100644
--- a/mstflint.spec.in
+++ b/mstflint.spec.in
@@ -1,10 +1,11 @@
 %{!?ibmadlib: %define ibmadlib libibmad-devel}
 %{!?name: %define name mstflint}
-%{!?version: %define version 4.1.0}
+%{!?version: %define version 4.4.0}
 %{!?release: %define release 1}
 %{!?buildtype: %define buildtype "native"}
 %{!?noinband: %define noinband 0}
 %{!?nodc: %define nodc 0}
+%{!?enablecs: %define enablecs 0}
 
 %define debug_package %{nil}
 %define optflags -g -O2
@@ -12,7 +13,7 @@
 Summary: Mellanox firmware burning application
 Name: %{name}
 Version: %{version}
-Release: 1
+Release: %{release} 
 License: GPL/BSD
 Url: http://openfabrics.org
 Group: System Environment/Base
@@ -38,6 +39,10 @@ for network adapters based on Mellanox Technologies chips.
     config_flags="$config_flags --disable-inband"
 %endif
 
+%if %{enablecs}
+    config_flags="$config_flags --enable-cs"
+%endif
+
 %if %{buildtype} == "ppc"
     config_flags="$config_flags --host=ppc-linux"
 %endif
@@ -64,6 +69,14 @@ make DESTDIR=${RPM_BUILD_ROOT} install
 # remove unpackaged files from the buildroot
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 
+# create softlinks to old mtcr header and lib locations
+# link mtcr_ul to old location
+mkdir -p %{buildroot}/%{_includedir}/mtcr_ul
+ln -s %{_includedir}/mstflint/mtcr.h %{buildroot}/%{_includedir}/mtcr_ul/mtcr.h
+ln -s %{_includedir}/mstflint/mtcr_com_defs.h %{buildroot}/%{_includedir}/mtcr_ul/mtcr_com_defs.h
+# link mtcr_ul to old lib path
+ln -s %{_libdir}/mstflint/libmtcr_ul.a %{buildroot}/%{_libdir}/libmtcr_ul.a 
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -78,12 +91,27 @@ rm -rf $RPM_BUILD_ROOT
 %{_bindir}/mstmcra
 %{_bindir}/mstconfig
 %{_bindir}/hca_self_test.ofed
+
+%{_includedir}/mstflint/mtcr.h
+%{_includedir}/mstflint/mtcr_com_defs.h
 %{_includedir}/mtcr_ul/mtcr.h
+%{_includedir}/mtcr_ul/mtcr_com_defs.h
+%{_libdir}/mstflint/libmtcr_ul.a
 %{_libdir}/libmtcr_ul.a
+
 %{_datadir}/mstflint
 %{_mandir}/man1/*
 
 %changelog
+* Wed May 17 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.4.0 Updates
+   
+* Wed Mar 23 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.4.0 Updates
+
+* Mon Jan 11 2016 Adrian Chiris <adrianc at dev.mellanox.co.il>
+   MFT 4.3.0 Updates
+
 * Wed Aug 26 2015 Adrian Chiris <adrianc at dev.mellanox.co.il>
    MFT 4.1.0 Updates
    
diff --git a/mtcr_ul/Makefile.am b/mtcr_ul/Makefile.am
index dd1b68d..76d1e78 100644
--- a/mtcr_ul/Makefile.am
+++ b/mtcr_ul/Makefile.am
@@ -31,13 +31,16 @@
 #--
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
 
-lib_LIBRARIES = libmtcr_ul.a
+pkglib_LIBRARIES = libmtcr_ul.a
 
 libmtcr_ul_a_SOURCES = mtcr_ul.c mtcr_ib.h  mtcr_int_defs.h\
+			mtcr_ib_res_mgt.h mtcr_ib_res_mgt.c\
 			mtcr_tools_cif.c mtcr_tools_cif.h\
 			mtcr_ul_icmd_cif.c mtcr_icmd_cif.h\
+			mtcr_ul_com_defs.h mtcr_mf.h\
+			mtcr_ul_com.h mtcr_ul_com.c\
 			packets_common.c packets_common.h\
 			packets_layout.c packets_layout.h
 libmtcr_ul_a_CFLAGS = -W -Wall -g -MP -MD -fPIC -DMTCR_API="" -DMST_UL
@@ -48,6 +51,6 @@ else
 libmtcr_ul_a_CFLAGS += -DNO_INBAND
 endif
 
-libraryincludedir=$(includedir)/mtcr_ul
-libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h
+libraryincludedir=$(includedir)/mstflint
+libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h  $(top_srcdir)/include/mtcr_ul/mtcr_com_defs.h
 
diff --git a/mtcr_ul/Makefile.in b/mtcr_ul/Makefile.in
index eb33b14..3cf4284 100644
--- a/mtcr_ul/Makefile.in
+++ b/mtcr_ul/Makefile.in
@@ -151,9 +151,9 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" \
+am__installdirs = "$(DESTDIR)$(pkglibdir)" \
 	"$(DESTDIR)$(libraryincludedir)"
-LIBRARIES = $(lib_LIBRARIES)
+LIBRARIES = $(pkglib_LIBRARIES)
 ARFLAGS = cru
 AM_V_AR = $(am__v_AR_ at AM_V@)
 am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
@@ -162,14 +162,18 @@ am__v_AR_1 =
 libmtcr_ul_a_AR = $(AR) $(ARFLAGS)
 libmtcr_ul_a_LIBADD =
 am__libmtcr_ul_a_SOURCES_DIST = mtcr_ul.c mtcr_ib.h mtcr_int_defs.h \
-	mtcr_tools_cif.c mtcr_tools_cif.h mtcr_ul_icmd_cif.c \
-	mtcr_icmd_cif.h packets_common.c packets_common.h \
-	packets_layout.c packets_layout.h mtcr_ib_ofed.c
+	mtcr_ib_res_mgt.h mtcr_ib_res_mgt.c mtcr_tools_cif.c \
+	mtcr_tools_cif.h mtcr_ul_icmd_cif.c mtcr_icmd_cif.h \
+	mtcr_ul_com_defs.h mtcr_mf.h mtcr_ul_com.h mtcr_ul_com.c \
+	packets_common.c packets_common.h packets_layout.c \
+	packets_layout.h mtcr_ib_ofed.c
 @ENABLE_INBAND_TRUE at am__objects_1 =  \
 @ENABLE_INBAND_TRUE@	libmtcr_ul_a-mtcr_ib_ofed.$(OBJEXT)
 am_libmtcr_ul_a_OBJECTS = libmtcr_ul_a-mtcr_ul.$(OBJEXT) \
+	libmtcr_ul_a-mtcr_ib_res_mgt.$(OBJEXT) \
 	libmtcr_ul_a-mtcr_tools_cif.$(OBJEXT) \
 	libmtcr_ul_a-mtcr_ul_icmd_cif.$(OBJEXT) \
+	libmtcr_ul_a-mtcr_ul_com.$(OBJEXT) \
 	libmtcr_ul_a-packets_common.$(OBJEXT) \
 	libmtcr_ul_a-packets_layout.$(OBJEXT) $(am__objects_1)
 libmtcr_ul_a_OBJECTS = $(am_libmtcr_ul_a_OBJECTS)
@@ -306,6 +310,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -362,16 +367,18 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
-lib_LIBRARIES = libmtcr_ul.a
+AM_CPPFLAGS = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+pkglib_LIBRARIES = libmtcr_ul.a
 libmtcr_ul_a_SOURCES = mtcr_ul.c mtcr_ib.h mtcr_int_defs.h \
-	mtcr_tools_cif.c mtcr_tools_cif.h mtcr_ul_icmd_cif.c \
-	mtcr_icmd_cif.h packets_common.c packets_common.h \
-	packets_layout.c packets_layout.h $(am__append_1)
+	mtcr_ib_res_mgt.h mtcr_ib_res_mgt.c mtcr_tools_cif.c \
+	mtcr_tools_cif.h mtcr_ul_icmd_cif.c mtcr_icmd_cif.h \
+	mtcr_ul_com_defs.h mtcr_mf.h mtcr_ul_com.h mtcr_ul_com.c \
+	packets_common.c packets_common.h packets_layout.c \
+	packets_layout.h $(am__append_1)
 libmtcr_ul_a_CFLAGS = -W -Wall -g -MP -MD -fPIC -DMTCR_API="" -DMST_UL \
 	$(am__append_2)
-libraryincludedir = $(includedir)/mtcr_ul
-libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h
+libraryincludedir = $(includedir)/mstflint
+libraryinclude_HEADERS = $(top_srcdir)/include/mtcr_ul/mtcr.h  $(top_srcdir)/include/mtcr_ul/mtcr_com_defs.h
 all: all-am
 
 .SUFFIXES:
@@ -406,37 +413,37 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-libLIBRARIES: $(lib_LIBRARIES)
+install-pkglibLIBRARIES: $(pkglib_LIBRARIES)
 	@$(NORMAL_INSTALL)
-	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	@list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(pkglibdir)" || exit $$?; }
 	@$(POST_INSTALL)
-	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	@list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	for p in $$list; do \
 	  if test -f $$p; then \
 	    $(am__strip_dir) \
-	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
-	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	    echo " ( cd '$(DESTDIR)$(pkglibdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(pkglibdir)" && $(RANLIB) $$f ) || exit $$?; \
 	  else :; fi; \
 	done
 
-uninstall-libLIBRARIES:
+uninstall-pkglibLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	@list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+	dir='$(DESTDIR)$(pkglibdir)'; $(am__uninstall_files_from_dir)
 
-clean-libLIBRARIES:
-	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+clean-pkglibLIBRARIES:
+	-test -z "$(pkglib_LIBRARIES)" || rm -f $(pkglib_LIBRARIES)
 
 libmtcr_ul.a: $(libmtcr_ul_a_OBJECTS) $(libmtcr_ul_a_DEPENDENCIES) $(EXTRA_libmtcr_ul_a_DEPENDENCIES) 
 	$(AM_V_at)-rm -f libmtcr_ul.a
@@ -450,8 +457,10 @@ distclean-compile:
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_ib_ofed.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_tools_cif.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_ul.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-mtcr_ul_icmd_cif.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-packets_common.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libmtcr_ul_a-packets_layout.Po at am__quote@
@@ -491,6 +500,20 @@ libmtcr_ul_a-mtcr_ul.obj: mtcr_ul.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ul.obj `if test -f 'mtcr_ul.c'; then $(CYGPATH_W) 'mtcr_ul.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ul.c'; fi`
 
+libmtcr_ul_a-mtcr_ib_res_mgt.o: mtcr_ib_res_mgt.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-mtcr_ib_res_mgt.o -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Tpo -c -o libmtcr_ul_a-mtcr_ib_res_mgt.o `test -f 'mtcr_ib_res_mgt.c' || echo '$(srcdir)/'`mtcr_ib_res_mgt.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Tpo $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mtcr_ib_res_mgt.c' object='libmtcr_ul_a-mtcr_ib_res_mgt.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ib_res_mgt.o `test -f 'mtcr_ib_res_mgt.c' || echo '$(srcdir)/'`mtcr_ib_res_mgt.c
+
+libmtcr_ul_a-mtcr_ib_res_mgt.obj: mtcr_ib_res_mgt.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-mtcr_ib_res_mgt.obj -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Tpo -c -o libmtcr_ul_a-mtcr_ib_res_mgt.obj `if test -f 'mtcr_ib_res_mgt.c'; then $(CYGPATH_W) 'mtcr_ib_res_mgt.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ib_res_mgt.c'; fi`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Tpo $(DEPDIR)/libmtcr_ul_a-mtcr_ib_res_mgt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mtcr_ib_res_mgt.c' object='libmtcr_ul_a-mtcr_ib_res_mgt.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ib_res_mgt.obj `if test -f 'mtcr_ib_res_mgt.c'; then $(CYGPATH_W) 'mtcr_ib_res_mgt.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ib_res_mgt.c'; fi`
+
 libmtcr_ul_a-mtcr_tools_cif.o: mtcr_tools_cif.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-mtcr_tools_cif.o -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-mtcr_tools_cif.Tpo -c -o libmtcr_ul_a-mtcr_tools_cif.o `test -f 'mtcr_tools_cif.c' || echo '$(srcdir)/'`mtcr_tools_cif.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-mtcr_tools_cif.Tpo $(DEPDIR)/libmtcr_ul_a-mtcr_tools_cif.Po
@@ -519,6 +542,20 @@ libmtcr_ul_a-mtcr_ul_icmd_cif.obj: mtcr_ul_icmd_cif.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ul_icmd_cif.obj `if test -f 'mtcr_ul_icmd_cif.c'; then $(CYGPATH_W) 'mtcr_ul_icmd_cif.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ul_icmd_cif.c'; fi`
 
+libmtcr_ul_a-mtcr_ul_com.o: mtcr_ul_com.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-mtcr_ul_com.o -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Tpo -c -o libmtcr_ul_a-mtcr_ul_com.o `test -f 'mtcr_ul_com.c' || echo '$(srcdir)/'`mtcr_ul_com.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Tpo $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mtcr_ul_com.c' object='libmtcr_ul_a-mtcr_ul_com.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ul_com.o `test -f 'mtcr_ul_com.c' || echo '$(srcdir)/'`mtcr_ul_com.c
+
+libmtcr_ul_a-mtcr_ul_com.obj: mtcr_ul_com.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-mtcr_ul_com.obj -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Tpo -c -o libmtcr_ul_a-mtcr_ul_com.obj `if test -f 'mtcr_ul_com.c'; then $(CYGPATH_W) 'mtcr_ul_com.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ul_com.c'; fi`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Tpo $(DEPDIR)/libmtcr_ul_a-mtcr_ul_com.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='mtcr_ul_com.c' object='libmtcr_ul_a-mtcr_ul_com.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -c -o libmtcr_ul_a-mtcr_ul_com.obj `if test -f 'mtcr_ul_com.c'; then $(CYGPATH_W) 'mtcr_ul_com.c'; else $(CYGPATH_W) '$(srcdir)/mtcr_ul_com.c'; fi`
+
 libmtcr_ul_a-packets_common.o: packets_common.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmtcr_ul_a_CFLAGS) $(CFLAGS) -MT libmtcr_ul_a-packets_common.o -MD -MP -MF $(DEPDIR)/libmtcr_ul_a-packets_common.Tpo -c -o libmtcr_ul_a-packets_common.o `test -f 'packets_common.c' || echo '$(srcdir)/'`packets_common.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libmtcr_ul_a-packets_common.Tpo $(DEPDIR)/libmtcr_ul_a-packets_common.Po
@@ -674,7 +711,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(LIBRARIES) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libraryincludedir)"; do \
+	for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libraryincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -709,7 +746,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libLIBRARIES clean-libtool \
+clean-am: clean-generic clean-libtool clean-pkglibLIBRARIES \
 	mostlyclean-am
 
 distclean: distclean-am
@@ -736,7 +773,7 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-libLIBRARIES
+install-exec-am: install-pkglibLIBRARIES
 
 install-html: install-html-am
 
@@ -776,25 +813,26 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-libLIBRARIES uninstall-libraryincludeHEADERS
+uninstall-am: uninstall-libraryincludeHEADERS \
+	uninstall-pkglibLIBRARIES
 
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLIBRARIES clean-libtool cscopelist-am ctags ctags-am \
-	distclean distclean-compile distclean-generic \
+	clean-libtool clean-pkglibLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-html install-html-am install-info \
-	install-info-am install-libLIBRARIES \
-	install-libraryincludeHEADERS install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-libLIBRARIES \
-	uninstall-libraryincludeHEADERS
+	install-info-am install-libraryincludeHEADERS install-man \
+	install-pdf install-pdf-am install-pkglibLIBRARIES install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-libraryincludeHEADERS \
+	uninstall-pkglibLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/mtcr_ul/mtcr_ib.h b/mtcr_ul/mtcr_ib.h
index 2a36327..cb3ed49 100644
--- a/mtcr_ul/mtcr_ib.h
+++ b/mtcr_ul/mtcr_ib.h
@@ -39,9 +39,7 @@
 #ifndef _MTCR_IB_H
 #define _MTCR_IB_H
 
-#ifdef __WIN__
-    #include <mtcr.h>
-#endif
+ #include <mtcr.h>
 
 int mib_open(const char *name, mfile *mf, int mad_init);
 int mib_close(mfile *mf);
diff --git a/mtcr_ul/mtcr_ib_ofed.c b/mtcr_ul/mtcr_ib_ofed.c
index 31f0a1e..971d4b8 100644
--- a/mtcr_ul/mtcr_ib_ofed.c
+++ b/mtcr_ul/mtcr_ib_ofed.c
@@ -59,12 +59,15 @@
 
 #ifdef MST_UL
 #include <errno.h>
-#include "mtcr.h"
 #include "mtcr_int_defs.h"
 #endif
 
 #include "mtcr_ib.h"
-#include <mtcr.h>
+
+#ifndef __WIN__
+#include "mtcr_mf.h"
+#include "mtcr_com_defs.h"
+#endif
 
 #include <infiniband/mad.h>
 
@@ -584,7 +587,7 @@ int mib_open(const char *name, mfile *mf, int mad_init)
     ib_portid_t *sm_id           = 0;
     int          ca_port         = 0;
     int          dest_type       = IB_DEST_LID;
-    ibvs_mad    *ivm;
+    ibvs_mad    *ivm             = NULL;
     char        *nbuf            = NULL;
     char        *path_str, *p;
     int          rc              = -1;
@@ -594,6 +597,11 @@ int mib_open(const char *name, mfile *mf, int mad_init)
     char* first_comma;
     char* second_comma;
     //ibdebug = 1;
+    if (!mf || !name) {
+        IBERROR(("Bad(null) device argument for inband access"));
+        errno = EINVAL;
+        goto end;
+    }
     if (!(ivm=(ibvs_mad*)malloc(sizeof(ibvs_mad))))
     {
         IBERROR(("can't allocate ibvsmad_mfile"));
@@ -759,15 +767,17 @@ end:
 int
 mib_close(mfile *mf)
 {
-    if (mf->ctx) {
-    // TODO: free the ddl handlers
-        ibvs_mad* h = (ibvs_mad*)(mf->ctx);
-        h->mad_rpc_close_port(h->srcport);
-#ifndef IBVSMAD_DLOPEN
-        free_dll_handle(mf);
-#endif
-        free(mf->ctx);
-        mf->ctx = NULL;
+    if (mf) {
+        if (mf->ctx) {
+        // TODO: free the ddl handlers
+            ibvs_mad* h = (ibvs_mad*)(mf->ctx);
+            h->mad_rpc_close_port(h->srcport);
+    #ifndef IBVSMAD_DLOPEN
+            free_dll_handle(mf);
+    #endif
+            free(mf->ctx);
+            mf->ctx = NULL;
+        }
     }
     return 0;
 }
@@ -782,6 +792,10 @@ mib_close(mfile *mf)
 
 int mib_get_chunk_size(mfile *mf)
 {
+    if (!mf || !mf->ctx) {
+        IBERROR(("get chunk size failed. Null Param."));
+        return -1;
+    }
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
     if (h->use_smp) {
         return MAX_IB_SMP_DATA_SIZE;
@@ -797,6 +811,10 @@ int mib_get_chunk_size(mfile *mf)
 int
 mib_read4(mfile *mf, u_int32_t memory_address, u_int32_t *data)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("cr access read failed. Null Param."));
+        return -1;
+    }
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
 
     DEBUG(("mread4 of 0x%08x", memory_address));
@@ -807,10 +825,6 @@ mib_read4(mfile *mf, u_int32_t memory_address, u_int32_t *data)
     return 4;
 }
 
-
-
-
-
 /********************************************************
 **
 *    Write an IS3 CR-Space 32 bit register
@@ -819,6 +833,10 @@ mib_read4(mfile *mf, u_int32_t memory_address, u_int32_t *data)
 int
 mib_write4(mfile *mf, u_int32_t memory_address, u_int32_t _data)
 {
+    if (!mf || !mf->ctx) {
+        IBERROR(("cr access write failed. Null Param."));
+        return -1;
+    }
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
 
     u_int32_t data = _data;
@@ -833,6 +851,10 @@ mib_write4(mfile *mf, u_int32_t memory_address, u_int32_t _data)
 
 MTCR_API int mib_readblock(mfile *mf, unsigned int offset, u_int32_t *data, int length)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("cr access read failed. Null Param."));
+        return -1;
+    }
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
 
     CHECK_ALLIGN(length);
@@ -846,6 +868,10 @@ MTCR_API int mib_readblock(mfile *mf, unsigned int offset, u_int32_t *data, int
 }
 MTCR_API int mib_writeblock(mfile *mf, unsigned int offset, u_int32_t *data, int length)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("cr access write failed. Null Param."));
+        return -1;
+    }
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
 
     CHECK_ALLIGN(length);
@@ -883,6 +909,12 @@ int is_node_managed(ibvs_mad* h)
 int
 mib_swreset(mfile *mf)
 {
+    if (!mf || !mf->ctx) {
+        errno = EINVAL;
+        IBERROR(("swreset write failed. Null Param."));
+        return -1;
+    }
+
     u_int32_t swreset_timer = 15;
     char* ep;
     char* swreset_env;
@@ -951,6 +983,10 @@ static int mib_status_translate(int status)
 
 int mib_acces_reg_mad(mfile *mf, u_int8_t *data)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("mib_acces_reg_mad failed. Null Param."));
+        return ME_BAD_PARAMS;
+    }
     u_int8_t* p;
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
     int status = -1;
@@ -974,6 +1010,10 @@ int mib_acces_reg_mad(mfile *mf, u_int8_t *data)
 
 int mib_smp_set(mfile* mf, u_int8_t* data, u_int16_t attr_id, u_int32_t attr_mod)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("mib_smp_set failed. Null Param."));
+        return ME_BAD_PARAMS;
+    }
     u_int8_t* p;
     int status = -1;
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
@@ -996,6 +1036,10 @@ int mib_smp_set(mfile* mf, u_int8_t* data, u_int16_t attr_id, u_int32_t attr_mod
 
 int mib_smp_get(mfile* mf, u_int8_t* data, u_int16_t attr_id, u_int32_t attr_mod)
 {
+    if (!mf || !mf->ctx || !data) {
+        IBERROR(("mib_smp_get failed. Null Param."));
+        return ME_BAD_PARAMS;
+    }
     u_int8_t* p;
     int status = -1;
     ibvs_mad* h = (ibvs_mad*)(mf->ctx);
diff --git a/mtcr_ul/mtcr_ib_res_mgt.c b/mtcr_ul/mtcr_ib_res_mgt.c
new file mode 100644
index 0000000..7d4839f
--- /dev/null
+++ b/mtcr_ul/mtcr_ib_res_mgt.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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 <string.h>
+
+#include "mtcr_ib.h"
+#include "mtcr_ib_res_mgt.h"
+#include "packets_common.h"
+
+
+#define IB_SMP_DATA_SIZE 48
+#define SMP_SEMAPHOE_LOCK_CMD 0xff53
+
+#define DBG_PRINTF(...) do { if (getenv("MFT_DEBUG") != NULL) { fprintf(stderr, __VA_ARGS__); } } while (0)
+
+/* Description -   */
+/* Size in bytes - 12 */
+struct semaphore_lock_cmd {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+    /* Description - The maximal Semaphore Address supported by the device. */
+    /* 0.0 - 0.7 */
+     u_int8_t semaphore_max_addr;
+    /* Description - The lease time for a lock is 50msec *2^LeaseTimeExponent */
+    /* 0.16 - 0.23 */
+     u_int8_t lease_time_exponent;
+    /* Description - Should be used to extend a lock. When a lock owner application wish to extend the lock it should set this bit to 1 and fill the Key field with key obtained by the GetResp() to successful acquiring of a lock. */
+    /* 0.31 - 4.31 */
+     u_int8_t is_lease;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+    /* Description - The specific Semaphore being queried or requested a lock for */
+    /* 4.0 - 4.15 */
+     u_int16_t semaphore_addr;
+    /* Description - 1 = Lock, 2 = Extend, 3 = Release */
+    /* 4.16 - 4.17 */
+     u_int8_t op;
+/*---------------- DWORD[2] (Offset 0x8) ----------------*/
+    /* Description - This field is provided by the device on a successful lock. It should be used by the user in order to either extend or release of the lock. */
+    /* 8.0 - 8.31 */
+     u_int32_t lock_key;
+};
+
+
+void semaphore_lock_cmd_pack(const struct semaphore_lock_cmd *ptr_struct, u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=24;
+    push_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->semaphore_max_addr);
+
+    offset=8;
+    push_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->lease_time_exponent);
+
+    offset=0;
+    push_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->is_lease);
+
+    offset=48;
+    push_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->semaphore_addr);
+
+    offset=46;
+    push_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->op);
+
+    offset=64;
+    push_to_buff_32(ptr_buff, offset, ptr_struct->lock_key);
+
+}
+
+void semaphore_lock_cmd_unpack(struct semaphore_lock_cmd *ptr_struct, u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    u_int8_t val=0;
+    (void)val;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=24;
+    ptr_struct->semaphore_max_addr = (u_int8_t)pop_from_buff(ptr_buff, offset, 8);
+
+    offset=8;
+    ptr_struct->lease_time_exponent = (u_int8_t)pop_from_buff(ptr_buff, offset, 8);
+
+    offset=0;
+    ptr_struct->is_lease = (u_int8_t)pop_from_buff(ptr_buff, offset, 1);
+
+    offset=48;
+    ptr_struct->semaphore_addr = (u_int16_t)pop_from_buff(ptr_buff, offset, 16);
+
+    offset=46;
+    ptr_struct->op = (u_int8_t)pop_from_buff(ptr_buff, offset, 2);
+
+    offset=64;
+    ptr_struct->lock_key = pop_from_buff_32(ptr_buff, offset);
+
+}
+
+int mib_semaphore_lock_vs_mad(
+        mfile* mf,
+        sem_op_t op,
+        u_int32_t sem_addr,
+        u_int32_t lock_key,
+        u_int32_t* res,
+        int* is_leaseable,
+        u_int8_t* lease_time_exp,
+        sem_lock_method_t method)
+{
+#ifndef NO_INBAND
+    u_int8_t mad_data[IB_SMP_DATA_SIZE] = {0};
+    int rc = ME_OK;
+    struct semaphore_lock_cmd cmd;
+    memset(&cmd, 0, sizeof(cmd));
+    cmd.semaphore_addr = sem_addr;
+    cmd.op = op;
+    cmd.lock_key = lock_key;
+    DBG_PRINTF("#######BFORE#####\n# SEM_ADDR: 0x%x\n# OP: %d\n# Lock_Key: 0x%x\n#################\n",
+            cmd.semaphore_addr, cmd.op, cmd.lock_key);
+    semaphore_lock_cmd_pack(&cmd, mad_data);
+    if (method == SEM_LOCK_SET) {
+        rc = mib_smp_set(mf, mad_data, SMP_SEMAPHOE_LOCK_CMD, 0);
+    } else {
+        rc = mib_smp_get(mf, mad_data, SMP_SEMAPHOE_LOCK_CMD, 0);
+    }
+    semaphore_lock_cmd_unpack(&cmd, mad_data);
+    DBG_PRINTF("#######AFTER#####\n# SEM_ADDR: 0x%x\n# OP: %d\n# Lock_Key: 0x%x\n#################\n",
+                cmd.semaphore_addr, cmd.op, cmd.lock_key);
+    *res = cmd.lock_key;
+    *is_leaseable = (int)cmd.is_lease;
+    *lease_time_exp = cmd.lease_time_exponent;
+    return rc;
+#else
+    (void)mf;
+    (void)op;
+    (void)sem_addr;
+    (void)lock_key;
+    (void)res;
+    (void)is_leaseable;
+    (void)lease_time_exp;
+    (void)method;
+    return 1;
+#endif
+}
+
+int mib_semaphore_lock_is_supported(mfile* mf)
+{
+#ifndef NO_INBAND
+    u_int8_t mad_data[IB_SMP_DATA_SIZE] = {0};
+    struct semaphore_lock_cmd cmd;
+    memset(&cmd, 0, sizeof(cmd));
+    mib_smp_get(mf, mad_data, SMP_SEMAPHOE_LOCK_CMD, 0);
+    semaphore_lock_cmd_unpack(&cmd, mad_data);
+    DBG_PRINTF("###### QUERY #####\n# MAX_SEM_ADDR: 0x%x\n#################\n", cmd.semaphore_max_addr);
+    if (cmd.semaphore_max_addr > 0) {
+        return 1;
+    } else {
+        return 0;
+    }
+#else
+    (void)mf;
+    return 1;
+#endif
+}
diff --git a/mflash/mflash_access_layer.h b/mtcr_ul/mtcr_ib_res_mgt.h
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to mtcr_ul/mtcr_ib_res_mgt.h
index 23931fa..d03bb33
--- a/mflash/mflash_access_layer.h
+++ b/mtcr_ul/mtcr_ib_res_mgt.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,34 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
+#ifndef _MTCR_IB_RES_MGT_H_
+#define _MTCR_IB_RES_MGT_H_
 
-#include <compatibility.h>
-//#include "cib_cif.h"
+#include <mtcr.h>
 
-#include "mflash_common_structs.h"
+typedef enum {
+    SMP_SEM_LOCK = 1,
+    SMP_SEM_EXTEND,
+    SMP_SEM_RELEASE
+} sem_op_t;
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+typedef enum {
+    SEM_LOCK_GET = 0x0,
+    SEM_LOCK_SET = 0x1
+} sem_lock_method_t;
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
+MTCR_API int mib_semaphore_lock_vs_mad(
+        mfile* mf,
+        sem_op_t op,
+        u_int32_t sem_addr,
+        u_int32_t lock_key,
+        u_int32_t* res,
+        int* is_leaseable,
+        u_int8_t* lease_time_exp,
+        sem_lock_method_t method);
 
+MTCR_API int mib_semaphore_lock_is_supported(mfile* mf);
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+#endif
diff --git a/mtcr_ul/mtcr_icmd_cif.h b/mtcr_ul/mtcr_icmd_cif.h
index a103525..a3cad36 100644
--- a/mtcr_ul/mtcr_icmd_cif.h
+++ b/mtcr_ul/mtcr_icmd_cif.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,9 +28,6 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
 #ifndef _MTCR_ICMD_CIF     /* guard */
@@ -39,14 +37,13 @@
 extern "C" {
 #endif
 
-
-
-
 #include <compatibility.h>
+#include <mtcr.h>
 #ifdef MST_UL
+#include "mtcr_mf.h"
 #include <mtcr_int_defs.h>
 #endif
-#include <mtcr.h>
+
 
 /* --------- Typedefs & Constants ---------------------------------- */
 
@@ -81,7 +78,7 @@ void icmd_close(mfile *mf);
  * @return          One of the GCIF_STATUS_* values, or a raw
  *                  status value (as indicated in cr-space).
  **/
-int icmd_send_command_int(mfile		*mf,
+int icmd_send_command_int(mfile     *mf,
                       IN    int     opcode,
                       INOUT void*   data,
                       IN    int     write_data_size,
diff --git a/mtcr_ul/mtcr_int_defs.h b/mtcr_ul/mtcr_int_defs.h
index ea03cfa..09c75cc 100644
--- a/mtcr_ul/mtcr_int_defs.h
+++ b/mtcr_ul/mtcr_int_defs.h
@@ -33,7 +33,7 @@
 #ifndef MTCR_INT_DEFS
 #define MTCR_INT_DEFS
 
-#include <mtcr.h>
+#include "mtcr_com_defs.h"
 
 typedef int (*f_mread4)        (mfile *mf, unsigned int offset, u_int32_t *value);
 typedef int (*f_mwrite4)       (mfile *mf, unsigned int offset, u_int32_t  value);
@@ -42,31 +42,11 @@ typedef int (*f_mwrite4_block) (mfile *mf, unsigned int offset, u_int32_t* data,
 typedef int (*f_maccess_reg)   (mfile *mf, u_int8_t *data);
 typedef int (*f_mclose)        (mfile* mf);
 
-
-typedef struct icmd_params_t {
-    int icmd_opened;
-    int took_semaphore;
-    int ctrl_addr;
-    int cmd_addr;
-    u_int32_t max_cmd_size;
-    int semaphore_addr;
-    int static_cfg_not_done_addr;
-    int static_cfg_not_done_offs;
-}icmd_params;
-
-typedef struct tools_hcr_params_t {
-    int supp_cr_mbox; // 1: mbox supported , -1: mbox not supported
-}tools_hcr_params;
-
-typedef struct access_reg_params_t {
-    int max_reg_size;
-}access_reg_params;
-
-struct mfile_t {
-    char*            dev_name;
-    void            *ctx; // Access method context
-    int              access_type;
+typedef struct ul_ctx {
     int              fdlock;
+    /* Hermon WA */
+    int              connectx_flush; /* For ConnectX A0 */
+    int              need_flush; /* For ConnectX A0 */
 
     f_mread4         mread4;
     f_mwrite4        mwrite4;
@@ -76,7 +56,6 @@ struct mfile_t {
     f_mclose         mclose;
 
     /******** RESERVED FIELDS FOR SWITCHING METHOD IF NEEDED ******/
-    void            *res_ctx; // Reserved access method context
     int              res_access_type;
     int              res_fdlock;
     f_mread4         res_mread4;
@@ -84,18 +63,7 @@ struct mfile_t {
     f_mread4_block   res_mread4_block;
     f_mwrite4_block  res_mwrite4_block;
     /*************************************************************/
-
-    //for ICMD access
-    icmd_params icmd;
-    // for vendor specific pci capability
-    int vsec_supp;
-    u_int32_t vsec_addr;
-    int address_space;
-    // for tools HCR access
-    tools_hcr_params hcr_params;
-    // for sending access registers
-    access_reg_params acc_reg_params;
-};
+} ul_ctx_t;
 #endif
 
 
diff --git a/mtcr_ul/mtcr_tools_cif.c b/mtcr_ul/mtcr_tools_cif.c
index a80404f..926054f 100644
--- a/mtcr_ul/mtcr_tools_cif.c
+++ b/mtcr_ul/mtcr_tools_cif.c
@@ -36,7 +36,9 @@
 
 #include <bit_slice.h>
 #include <common/tools_utils.h>
+
 #include "mtcr_tools_cif.h"
+#include "mtcr_mf.h"
 
 #define TOOLS_HCR_ADDR      0x80780
 #define CR_MBOX_ADDR        0xe0000
diff --git a/mtcr_ul/mtcr_tools_cif.h b/mtcr_ul/mtcr_tools_cif.h
index e33c223..7654432 100644
--- a/mtcr_ul/mtcr_tools_cif.h
+++ b/mtcr_ul/mtcr_tools_cif.h
@@ -39,9 +39,6 @@ extern "C" {
 
 
 #include <compatibility.h>
-#ifdef MST_UL
-#include <mtcr_int_defs.h>
-#endif
 #include <mtcr.h>
 
 #define FLASH_REG_ACCESS	0x9001
@@ -70,8 +67,8 @@ int tools_cmdif_reg_access(mfile *mf, void* data,int write_data_size, int read_d
  * check if sending registers via tools HCR is supported
  *
  */
-int tools_cmdif_is_supported(mfile *mf);
-int tools_cmdif_is_cr_mbox_supported(mfile *mf);
+MTCR_API int tools_cmdif_is_supported(mfile *mf);
+MTCR_API int tools_cmdif_is_cr_mbox_supported(mfile *mf);
 
 #ifdef __cplusplus
 }
diff --git a/mtcr_ul/mtcr_ul.c b/mtcr_ul/mtcr_ul.c
index b97d310..dddd1b5 100644
--- a/mtcr_ul/mtcr_ul.c
+++ b/mtcr_ul/mtcr_ul.c
@@ -34,1642 +34,99 @@
  *
  */
 
+#include <mtcr_ul_com.h>
+#include <mtcr_ib.h>
+#include <errno.h>
+#include <common/tools_utils.h>
+#include <stdlib.h>
 
-//use memory mapped /dev/mem for access
-#define CONFIG_ENABLE_MMAP 1
-//mmap /dev/mem for memory access (does not work on sparc)
-#define CONFIG_USE_DEV_MEM 1
-//use pci configuration cycles for access
-#define CONFIG_ENABLE_PCICONF 1
-
-#ifndef _XOPEN_SOURCE
-#if CONFIG_ENABLE_PCICONF && CONFIG_ENABLE_MMAP
-/* For strerror_r */
-#define _XOPEN_SOURCE 600
-#elif CONFIG_ENABLE_PCICONF
-#define _XOPEN_SOURCE 500
-#endif
-#endif
-
-#if CONFIG_ENABLE_MMAP
-#define _FILE_OFFSET_BITS 64
-#endif
-
-#define MTCR_MAP_SIZE 0x100000
-
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-
-#include <unistd.h>
-
-#include <netinet/in.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libgen.h>
-#include <sys/file.h>
-
-
-#if CONFIG_ENABLE_MMAP
-#include <sys/mman.h>
-#include <sys/pci.h>
-#include <sys/ioctl.h>
-#endif
-
-#include <bit_slice.h>
-#include <mtcr.h>
-#include "tools_utils.h"
-#include "mtcr_int_defs.h"
-#include "mtcr_ib.h"
-#include "packets_layout.h"
-#include "mtcr_tools_cif.h"
-#include "mtcr_icmd_cif.h"
-
-#ifndef __be32_to_cpu
-#define __be32_to_cpu(x) ntohl(x)
-#endif
-#ifndef __cpu_to_be32
-#define __cpu_to_be32(x) htonl(x)
-#endif
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#ifndef __cpu_to_le32
-#define  __cpu_to_le32(x) (x)
-#endif
-#ifndef __le32_to_cpu
-#define  __le32_to_cpu(x) (x)
-#endif
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#ifndef __cpu_to_le32
-#define  __cpu_to_le32(x) bswap_32(x)
-#endif
-#ifndef __le32_to_cpu
-#define  __le32_to_cpu(x) bswap_32(x)
-#endif
-#else
-#ifndef __cpu_to_le32
-#define  __cpu_to_le32(x) bswap_32(__cpu_to_be32(x))
-#endif
-#ifndef __le32_to_cpu
-#define  __le32_to_cpu(x) __be32_to_cpu(bswap_32(x))
-#endif
-#endif
-
-struct pcicr_context {
-    int              fd;
-    void            *ptr;
-    int              connectx_flush; /* For ConnectX/ConnectX3 */
-    int              need_flush; /* For ConnectX/ConnectX3 */
-};
-
-struct pciconf_context {
-    int              fd;
-};
-
-#define CX3_SW_ID    4099
-#define CX3PRO_SW_ID 4103
-
-/* Forward decl*/
-static int get_inband_dev_from_pci(char* inband_dev, char* pci_dev);
-
-int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, unsigned my_func);
-/*
- * Lock file section:
- *
- * in order to support concurrency on both MEMORY/CONFIG_CYCLES access methods
- * there is need for a sync mechanism between mtcr_ul using processes
- *
- * solution: each mfile obj shall contain a file descriptor linked to a unique, device determined file
- *           which will be used as a lock for the critical sections in read/write operations.
- *           these lock files will be created per device (dbdf format) AND per interface (memory/configuration cycles).
- */
-
-#define LOCK_FILE_DIR "/tmp/mstflint_lockfiles"
-#define LOCK_FILE_FORMAT "/tmp/mstflint_lockfiles/%04x:%02x:%02x.%x_%s"
-// lockfile example : /tmp/mstflint_lockfiles/0000:0b:00.0_config
-//                    /tmp/mstflint_lockfiles/0000:0b:00.0_mem
-// general format : /tmp/mstflint_lockfiles/<domain:bus:device.function>_<config|mem>
-#define CHECK_LOCK(rc) \
-    if(rc) {\
-        return rc;\
-    }
-
-#define MAX_RETRY_CNT 4096
-static int _flock_int(int fdlock, int operation) {
-    int cnt = 0;
-    if (fdlock == 0) { // in case we failed to create the lock file we ignore the locking mechanism
-        return 0;
-    }
-    do {
-        if (flock(fdlock, operation | LOCK_NB) == 0) {
-            return 0;
-        } else if(errno != EWOULDBLOCK){
-            break; // BAD! lock/free failed
-        }
-        if ((cnt & 0xf) == 0) {// sleep every 16 retries
-            usleep(1);
-        }
-        cnt++;
-    } while (cnt < MAX_RETRY_CNT);
-    perror("failed to perform lock operation.");
-    return -1;
-
-}
-
-static int _create_lock(mfile* mf, unsigned domain, unsigned bus, unsigned dev, unsigned func, mtcr_access_method_t access)
-{
-    char fname[64] = {0};
-    int rc;
-    int fd = 0;
-    snprintf(fname, 64,LOCK_FILE_FORMAT, domain, bus, dev, func, access == MTCR_ACCESS_CONFIG ? "config" : "mem");
-    rc = mkdir ("/tmp", 0777);
-    if (rc && errno != EEXIST) {
-        goto cl_clean_up;
-    }
-
-    rc = mkdir(LOCK_FILE_DIR, 0777);
-    if (rc && errno != EEXIST) {
-        goto cl_clean_up;
-    }
-
-    fd = open(fname, O_RDONLY | O_CREAT, 0777);
-    if (fd < 0) {
-        goto cl_clean_up;
-    }
-    mf->fdlock = fd;
-    return 0;
-
-cl_clean_up:
-    fprintf(stderr, "Warrning: Failed to create lockfile: %s (parallel access not supported)\n" ,fname);
-    return 0;
-}
-/*End of Lock file section */
-
-static int _extract_dbdf_from_full_name(const char *name, unsigned* domain, unsigned* bus, unsigned* dev, unsigned* func)
-{
-    if (sscanf(name, "/sys/bus/pci/devices/%4x:%2x:%2x.%d/resource0", domain, bus, dev, func) == 4) {
-        return 0;
-    } else if (sscanf(name, "/sys/bus/pci/devices/%4x:%2x:%2x.%d/config", domain, bus, dev, func) == 4) {
-        return 0;
-    } else if (sscanf(name, "/proc/bus/pci/%4x:%2x/%2x.%d", domain, bus, dev, func) == 4) {
-        return 0;
-    } else if (sscanf(name, "/proc/bus/pci/%2x/%2x.%d", bus, dev, func) == 3) {
-        *domain = 0;
-        return 0;
-    }
-    // failed to extract dbdf format from name
-    errno = EINVAL;
-    return -1;
-}
-
-static int mtcr_connectx_flush(void *ptr, int fdlock)
-{
-    u_int32_t value;
-    int rc;
-    rc = _flock_int(fdlock, LOCK_EX); CHECK_LOCK(rc);
-    *((u_int32_t *)((char *)ptr + 0xf0380)) = 0x0;
-    do {
-        asm volatile ("":::"memory");
-        value = __be32_to_cpu(*((u_int32_t *)((char *)ptr + 0xf0380)));
-    } while(value);
-    rc = _flock_int(fdlock, LOCK_UN); CHECK_LOCK(rc)
-    return 0;
-}
-
-int mread4(mfile *mf, unsigned int offset, u_int32_t *value)
-{
-    return mf->mread4(mf,offset,value);
-}
-
-int mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
-{
-    return mf->mwrite4(mf,offset,value);
-}
-
-// TODO: Verify change 'data' type from void* to u_in32_t* does not mess up things
-static int
-mread_chunk_as_multi_mread4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
-{
-    int i;
-    if (length % 4) {
-        return EINVAL;
-    }
-    for (i = 0; i < length ; i += 4) {
-        u_int32_t value;
-        if (mread4(mf, offset + i, &value) != 4) {
-            return -1;
-        }
-        memcpy((char*)data + i , &value,4);
-    }
-    return length;
-}
-
-static int
-mwrite_chunk_as_multi_mwrite4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
-{
-    int i;
-    if (length % 4) {
-        return EINVAL;
-    }
-    for (i = 0; i < length ; i += 4) {
-        u_int32_t value;
-        memcpy(&value, (char*)data + i ,4);
-        if (mwrite4(mf, offset + i, value) != 4) {
-            return -1;
-        }
-    }
-    return length;
-}
-
-/*
-* Return values:
-* 0:  OK
-* <0: Error
-* 1 : Device does not support memory access
-*
-*/
-static
-int mtcr_check_signature(mfile *mf)
-{
-    unsigned signature;
-    int rc;
-    char* connectx_flush = getenv("CONNECTX_FLUSH");
-    rc = mread4(mf, 0xF0014, &signature);
-    if (rc != 4) {
-        if (!errno)
-            errno = EIO;
-        return -1;
-    }
-
-    switch (signature) {
-    case 0xbad0cafe:  /* secure host mode device id */
-        return 0;
-    case 0xbadacce5:  /* returned upon mapping the UAR bar */
-    case 0xffffffff:  /* returned when pci mem access is disabled (driver down) */
-        return 1;
-    }
-
-    if (connectx_flush == NULL || strcmp(connectx_flush, "0")) {
-        if ((signature == 0xa00190         ||
-            (signature & 0xffff) == 0x1f5  ||
-            (signature & 0xffff) == 0x1f7) && mf->access_type == MTCR_ACCESS_MEMORY) {
-            struct pcicr_context* ctx = mf->ctx;
-            ctx->connectx_flush = 1;
-            if (mtcr_connectx_flush(ctx->ptr, mf->fdlock)) {
-                return -1;
-            }
-        }
-    }
-
-    return 0;
-}
-
-#if CONFIG_ENABLE_MMAP
-/*
- * The PCI interface treats multi-function devices as independent
- * devices.  The slot/function address of each device is encoded
- * in a single byte as follows:
- *
- *  7:3 = slot
- *  2:0 = function
- */
-#define PCI_DEVFN(slot,func)    ((((slot) & 0x1f) << 3) | ((func) & 0x07))
-#define PCI_SLOT(devfn)     (((devfn) >> 3) & 0x1f)
-#define PCI_FUNC(devfn)     ((devfn) & 0x07)
-
-static
-unsigned long long mtcr_procfs_get_offset(unsigned my_bus, unsigned my_dev,
-                      unsigned my_func)
-{
-    FILE* f;
-    unsigned irq;
-    unsigned long long base_addr[6], rom_base_addr, size[6], rom_size;
-
-    unsigned bus, dev, func;
-    //unsigned vendor_id;
-    //unsigned device_id;
-    unsigned int cnt;
-
-    unsigned long long offset = (unsigned long long)-1;
-
-    char buf[4048];
-
-    f = fopen("/proc/bus/pci/devices", "r");
-    if (!f) return offset;
-
-    for(;;) if (fgets(buf, sizeof(buf) - 1, f)) {
-        unsigned dfn, vend;
-
-        cnt = sscanf(buf,
-                 "%x %x %x %llx %llx %llx %llx %llx %llx "
-                 "%llx %llx %llx %llx %llx %llx %llx %llx",
-                 &dfn,
-                 &vend,
-                 &irq,
-                 &base_addr[0],
-                 &base_addr[1],
-                 &base_addr[2],
-                 &base_addr[3],
-                 &base_addr[4],
-                 &base_addr[5],
-                 &rom_base_addr,
-                 &size[0],
-                 &size[1],
-                 &size[2],
-                 &size[3],
-                 &size[4],
-                 &size[5],
-                 &rom_size);
-        if (cnt != 9 && cnt != 10 && cnt != 17)
-        {
-            fprintf(stderr,"proc: parse error (read only %d items)\n", cnt);
-            fprintf(stderr,"the offending line in " "/proc/bus/pci/devices" " is "
-                "\"%.*s\"\n", (int)sizeof(buf), buf);
-            goto error;
-        }
-        bus = dfn >> 8U;
-        dev = PCI_SLOT(dfn & 0xff);
-        func = PCI_FUNC(dfn & 0xff);
-        //vendor_id = vend >> 16U;
-        //device_id = vend & 0xffff;
-
-        if (bus == my_bus && dev == my_dev && func == my_func)
-            break;
-    }
-    else
-        goto error;
-
-    if (cnt != 17 || size[1] != 0 || size[0] != MTCR_MAP_SIZE) {
-        if (0) fprintf(stderr,"proc: unexpected region size values: "
-            "cnt=%d, size[0]=%#llx, size[1]=%#llx\n",
-            cnt,size[0],size[1]);
-        if (0) fprintf(stderr,"the offending line in " "/proc/bus/pci/devices"
-                   " is \"%.*s\"\n", (int)sizeof(buf), buf);
-        goto error;
-    }
-
-
-    offset = ((unsigned long long)(base_addr[1]) << 32) +
-        ((unsigned long long)(base_addr[0]) & ~(unsigned long long)(0xfffff));
-
-    fclose(f);
-    return offset;
-
-error:
-    fclose(f);
-    errno = ENXIO;
-    return offset;
-}
-
-static
-unsigned long long mtcr_sysfs_get_offset(unsigned domain, unsigned bus,
-                     unsigned dev, unsigned func)
-{
-    unsigned long long start, end, type;
-    unsigned long long offset = (unsigned long long)-1;
-    FILE *f;
-    int cnt;
-    char mbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/resource";
-    sprintf(mbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource",
-               domain, bus, dev, func);
-
-    f = fopen(mbuf, "r");
-    if (!f)
-        return offset;
-
-    cnt = fscanf(f, "0x%llx 0x%llx 0x%llx", &start, &end, &type);
-    if (cnt != 3 || end != start + MTCR_MAP_SIZE - 1) {
-        if (0) fprintf(stderr,"proc: unexpected region size values: "
-            "cnt=%d, start=%#llx, end=%#llx\n",
-            cnt, start, end);
-        goto error;
-    }
-
-    fclose(f);
-    return start;
-
-error:
-    fclose(f);
-    errno = ENOENT;
-    return offset;
-}
-
-//
-// PCI MEMORY ACCESS FUNCTIONS
-//
-
-static
-int mtcr_pcicr_mclose(mfile *mf)
-{
-    struct pcicr_context* ctx = mf->ctx;
-    struct pciconf_context* conf_ctx = mf->res_ctx;
-    if (ctx) {
-        if (ctx->ptr) {
-            munmap(ctx->ptr,MTCR_MAP_SIZE);
-        }
-
-        if (ctx->fd != -1) {
-            close(ctx->fd);
-        }
-        free(ctx);
-        mf->ctx = NULL;
-    }
-    if (conf_ctx) {
-        if (conf_ctx->fd != -1) {
-            close(conf_ctx->fd);
-        }
-        free(conf_ctx);
-        mf->res_ctx = NULL;
-    }
-    return 0;
-}
-
-static
-int mtcr_mmap(struct pcicr_context *mf, const char *name, off_t off, int ioctl_needed)
-{
-    int err;
-    /*
-    static const char sysbuspcidevices[] = "/sys/bus/pci/devices/";
-    // Enable PCI device before mmapping it
-    // this allows to flash a device even if mlx4_core fails to load with some kernels.
-    if (!strncmp(name, sysbuspcidevices, sizeof(sysbuspcidevices)-1)) {
-        // Accessing through sysfs: need to enable PCI device.
-        // We need to write 1 to 'enable' file located in
-        // parent dir for 'name'
-        int fd;
-        char fname[4096];
-        int i = strrchr(name, '/') - name;  //always ok
-        if (i + sizeof("enable") >= sizeof(fname)) {
-            return -1;
-            }
-        strncpy(fname, name, i+1);
-        strcpy(fname + i + 1, "enable");
-
-        fd = open(fname, O_WRONLY | O_SYNC);
-        if (fd < 0) {
-            return -1;
-            }
-        i = write(fd, "1", 1);
-        err = errno;
-        close(fd);
-        errno = err;
-        if (1 != i) {
-            return -1;
-            }
-        }
-     */
-    mf->fd = open(name, O_RDWR | O_SYNC);
-    if (mf->fd < 0)
-        return -1;
-
-    if (ioctl_needed && ioctl(mf->fd, PCIIOC_MMAP_IS_MEM) < 0) {
-        err = errno;
-        close(mf->fd);
-        errno = err;
-        return -1;
-    }
-
-    mf->ptr = mmap(NULL, MTCR_MAP_SIZE, PROT_READ | PROT_WRITE,
-               MAP_SHARED, mf->fd, off);
-
-    if (!mf->ptr || mf->ptr == MAP_FAILED) {
-        err = errno;
-        close(mf->fd);
-        errno = err;
-        return -1;
-    }
-    return 0;
-}
-
-int mtcr_pcicr_mread4(mfile *mf, unsigned int offset, u_int32_t *value)
-{
-    struct pcicr_context *ctx = mf->ctx;
-
-    if (offset >= MTCR_MAP_SIZE) {
-        errno = EINVAL;
-        return 0;
-    }
-    if (ctx->need_flush) {
-        if (mtcr_connectx_flush(ctx->ptr, mf->fdlock)) {
-            return 0;
-        }
-        ctx->need_flush = 0;
-    }
-    *value = __be32_to_cpu(*((u_int32_t *)((char *)ctx->ptr + offset)));
-    return 4;
-}
-
-int mtcr_pcicr_mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
-{
-    struct pcicr_context *ctx = mf->ctx;
-
-    if (offset >= MTCR_MAP_SIZE) {
-        errno = EINVAL;
-        return 0;
-    }
-    *((u_int32_t *)((char *)ctx->ptr + offset)) = __cpu_to_be32(value);
-    ctx->need_flush = ctx->connectx_flush;
-    return 4;
-}
-
-static
-int mtcr_pcicr_open(mfile *mf, const char *name, char* conf_name, off_t off, int ioctl_needed)
-{
-    int rc;
-    struct pcicr_context *ctx;
-
-    mf->access_type   = MTCR_ACCESS_MEMORY;
-
-    mf->mread4        = mtcr_pcicr_mread4;
-    mf->mwrite4       = mtcr_pcicr_mwrite4;
-    mf->mread4_block  = mread_chunk_as_multi_mread4;
-    mf->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
-    mf->mclose        = mtcr_pcicr_mclose;
-
-    ctx = (struct pcicr_context*)malloc(sizeof(struct pcicr_context));
-    if (!ctx)
-        return 1;
-
-    ctx->ptr = NULL;
-    ctx->fd = -1;
-    ctx->connectx_flush = 0;
-    ctx->need_flush = 0;
-
-    mf->ctx = ctx;
-
-    rc = mtcr_mmap(ctx, name, off, ioctl_needed);
-    if (rc) {
-        goto end;
-    }
-
-    rc = mtcr_check_signature(mf);
-end:
-    if (rc) {
-        mtcr_pcicr_mclose(mf);
-    } else if (conf_name != NULL) {
-        mfile* conf_mf = mopen(conf_name);
-        if (conf_mf != NULL) {
-            mf->res_ctx = conf_mf->ctx;
-            mf->res_access_type = conf_mf->access_type;
-            mf->vsec_addr = conf_mf->vsec_addr;
-            mf->vsec_supp = conf_mf->vsec_supp;
-            mf->address_space = conf_mf->address_space;
-            mf->res_fdlock = conf_mf->fdlock;
-            mf->res_mread4 = conf_mf->mread4;
-            mf->res_mwrite4 = conf_mf->mwrite4;
-            mf->res_mread4_block = conf_mf->mread4_block;
-            mf->res_mwrite4_block = conf_mf->mwrite4_block;
-            free(conf_mf);
-        }
-    }
-
-    return rc;
-}
-
-
-//
-// PCI CONF ACCESS FUNCTIONS
-//
-
-
-#if CONFIG_ENABLE_PCICONF
-/* PCI address space related enum*/
-enum {
-    PCI_CAP_PTR = 0x34,
-    PCI_HDR_SIZE = 0x40,
-    PCI_EXT_SPACE_ADDR = 0xff,
-
-    PCI_CTRL_OFFSET = 0x4, // for space / semaphore / auto-increment bit
-    PCI_COUNTER_OFFSET = 0x8,
-    PCI_SEMAPHORE_OFFSET = 0xc,
-    PCI_ADDR_OFFSET = 0x10,
-    PCI_DATA_OFFSET = 0x14,
-
-    PCI_FLAG_BIT_OFFS = 31,
-
-    PCI_SPACE_BIT_OFFS = 0,
-    PCI_SPACE_BIT_LEN = 16,
-
-    PCI_STATUS_BIT_OFFS = 29,
-    PCI_STATUS_BIT_LEN = 3,
-};
-
-/* Mellanox vendor specific enum */
-enum {
-    CAP_ID = 0x9,
-    ICMD_DOMAIN = 0x1,
-    CR_SPACE_DOMAIN = 0x2,
-    SEMAPHORE_DOMAIN = 0xa,
-    IFC_MAX_RETRIES = 2048
-};
-
-/* PCI operation enum(read or write)*/
-enum {
-    READ_OP = 0,
-    WRITE_OP = 1,
-};
-
-
-#define READ4_PCI(mf, val_ptr, pci_offs, err_prefix, action_on_fail)    \
-    do {                                                                \
-        int rc;                                                         \
-        int lock_rc;                                                    \
-        struct pciconf_context *pci_ctx = mf->ctx;                      \
-        lock_rc = _flock_int(mf->fdlock, LOCK_EX);                      \
-        if (lock_rc) {                                                  \
-            perror(err_prefix);                                         \
-            action_on_fail;                                             \
-        }                                                               \
-        rc = pread(pci_ctx->fd, val_ptr, 4, pci_offs);                  \
-        lock_rc = _flock_int(mf->fdlock, LOCK_UN);                      \
-        if (lock_rc) {                                                  \
-            perror(err_prefix);                                         \
-            action_on_fail;                                             \
-        }                                                               \
-        if (rc != 4 ) {                                                 \
-            if (rc < 0)                                                 \
-                perror(err_prefix);                                     \
-            action_on_fail;                                             \
-        }                                                               \
-        *val_ptr = __le32_to_cpu(*val_ptr);\
-    } while (0)
-
-#define WRITE4_PCI(mf, val, pci_offs, err_prefix, action_on_fail)           \
-        do {                                                                \
-            int rc;                                                         \
-            int lock_rc;                                                    \
-            u_int32_t val_le;                                               \
-            struct pciconf_context *pci_ctx = mf->ctx;                      \
-            val_le = __cpu_to_le32(val);                                    \
-            lock_rc = _flock_int(mf->fdlock, LOCK_EX);                      \
-            if (lock_rc) {                                                  \
-                perror(err_prefix);                                         \
-                action_on_fail;                                             \
-            }                                                               \
-            rc = pwrite(pci_ctx->fd, &val_le, 4, pci_offs);                 \
-            lock_rc = _flock_int(mf->fdlock, LOCK_UN);                      \
-            if (lock_rc) {                                                  \
-                perror(err_prefix);                                         \
-                action_on_fail;                                             \
-            }                                                               \
-            if (rc != 4 ) {                                                 \
-                if (rc < 0)                                                 \
-                    perror(err_prefix);                                     \
-                action_on_fail;                                         \
-            }                                                               \
-        } while (0)
-
-
-int pci_find_capability(mfile* mf, int cap_id)
-{
-    unsigned offset;
-    unsigned char visited[256] = {}; /* Prevent infinite loops */
-    unsigned char data[2];
-    int ret;
-    int lock_ret;
-    struct pciconf_context *pci_ctx = mf->ctx;
-
-    // protect against parallel access
-    lock_ret = _flock_int(mf->fdlock, LOCK_EX);
-    if (lock_ret) {
-        return 0;
-    }
-
-    ret = pread(pci_ctx->fd, data, 1, PCI_CAP_PTR);
-
-    lock_ret = _flock_int(mf->fdlock, LOCK_UN);
-    if (lock_ret) {
-        return 0;
-    }
-
-    if (ret != 1) {
-        return 0;
-    }
-
-    offset = data[0];
-    while(1) {
-        if (offset < PCI_HDR_SIZE || offset > PCI_EXT_SPACE_ADDR) {
-            return 0;
-        }
-
-        lock_ret = _flock_int(mf->fdlock, LOCK_EX);
-        if (lock_ret) {
-            return 0;
-        }
-
-        ret = pread(pci_ctx->fd, data, sizeof data, offset);
-
-        lock_ret = _flock_int(mf->fdlock, LOCK_UN);
-        if (lock_ret) {
-            return 0;
-        }
-
-        if (ret != sizeof data) {
-            return 0;
-        }
-
-        visited[offset] = 1;
-
-        if (data[0] == cap_id) {
-            return offset;
-        }
-
-        offset = data[1];
-        if (visited[offset]) {
-            return 0;
-        }
-    }
-    return 0;
-}
-
-int mtcr_pciconf_cap9_sem(mfile* mf, int state)
-{
-    u_int32_t lock_val;
-    u_int32_t counter = 0;
-    int retries = 0;
-    if (!state) {// unlock
-        WRITE4_PCI(mf, 0, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "unlock semaphore", return ME_PCI_WRITE_ERROR);
-    } else { // lock
-        do {
-            if (retries > IFC_MAX_RETRIES) {
-                return ME_SEM_LOCKED;
-            }
-            // read semaphore untill 0x0
-            READ4_PCI(mf, &lock_val, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "read counter", return ME_PCI_READ_ERROR);
-            if (lock_val) { //semaphore is taken
-                retries++;
-                msleep(1); // wait for current op to end
-                continue;
-            }
-            //read ticket
-            READ4_PCI(mf, &counter, mf->vsec_addr + PCI_COUNTER_OFFSET, "read counter", return ME_PCI_READ_ERROR);
-            //write ticket to semaphore dword
-            WRITE4_PCI(mf, counter, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "write counter to semaphore", return ME_PCI_WRITE_ERROR);
-            // read back semaphore make sure ticket == semaphore else repeat
-            READ4_PCI(mf, &lock_val, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "read counter", return ME_PCI_READ_ERROR);
-            retries++;
-        } while (counter != lock_val);
-    }
-    return ME_OK;
-}
-
-int mtcr_pciconf_wait_on_flag(mfile* mf, u_int8_t expected_val)
-{
-    int retries = 0;
-    u_int32_t flag;
-    do {
-         if (retries > IFC_MAX_RETRIES) {
-             return ME_PCI_IFC_TOUT;
-         }
-         READ4_PCI(mf, &flag, mf->vsec_addr + PCI_ADDR_OFFSET, "read flag", return ME_PCI_READ_ERROR);
-         flag = EXTRACT(flag, PCI_FLAG_BIT_OFFS, 1);
-         retries++;
-         if ((retries & 0xf) == 0) {// dont sleep always
-             msleep(1);
-         }
-     } while (flag != expected_val);
-    return ME_OK;
-}
-
-int mtcr_pciconf_set_addr_space(mfile* mf, u_int16_t space)
-{
-    // read modify write
-    u_int32_t val;
-    READ4_PCI(mf, &val, mf->vsec_addr + PCI_CTRL_OFFSET, "read domain", return ME_PCI_READ_ERROR);
-    val = MERGE(val, space, PCI_SPACE_BIT_OFFS, PCI_SPACE_BIT_LEN);
-    WRITE4_PCI(mf, val, mf->vsec_addr + PCI_CTRL_OFFSET, "write domain", return ME_PCI_WRITE_ERROR);
-    // read status and make sure space is supported
-    READ4_PCI(mf, &val, mf->vsec_addr + PCI_CTRL_OFFSET, "read status", return ME_PCI_READ_ERROR);
-    if (EXTRACT(val, PCI_STATUS_BIT_OFFS, PCI_STATUS_BIT_LEN) == 0) {
-        return ME_PCI_SPACE_NOT_SUPPORTED;
-    }
-    return ME_OK;
-}
-
-int mtcr_pciconf_rw(mfile *mf, unsigned int offset, u_int32_t* data, int rw)
-{
-    int rc = ME_OK;
-    u_int32_t address = offset;
-
-    //last 2 bits must be zero as we only allow 30 bits addresses
-    if (EXTRACT(address, 30, 2)) {
-        return ME_BAD_PARAMS;
-    }
-
-    address = MERGE(address,(rw ? 1 : 0), PCI_FLAG_BIT_OFFS, 1);
-    if (rw == WRITE_OP) {
-        // write data
-        WRITE4_PCI(mf, *data, mf->vsec_addr + PCI_DATA_OFFSET, "write value", return ME_PCI_WRITE_ERROR);
-        // write address
-        WRITE4_PCI(mf, address, mf->vsec_addr + PCI_ADDR_OFFSET, "write offset", return ME_PCI_WRITE_ERROR);
-        // wait on flag
-        rc = mtcr_pciconf_wait_on_flag(mf, 0);
-    } else {
-        // write address
-        WRITE4_PCI(mf, address, mf->vsec_addr + PCI_ADDR_OFFSET, "write offset", return ME_PCI_WRITE_ERROR);
-        // wait on flag
-        rc = mtcr_pciconf_wait_on_flag(mf, 1);
-        // read data
-        READ4_PCI(mf, data, mf->vsec_addr + PCI_DATA_OFFSET, "read value", return ME_PCI_READ_ERROR);
-    }
-    return rc;
-}
-
-int mtcr_pciconf_send_pci_cmd_int(mfile *mf, int space, unsigned int offset, u_int32_t* data, int rw)
-{
-    int rc = ME_OK;
-
-    // take semaphore
-    rc = mtcr_pciconf_cap9_sem(mf, 1);
-    if (rc) {
-        return rc;
-    }
-
-    // set address space
-    rc = mtcr_pciconf_set_addr_space(mf, space);
-    if (rc) {
-        goto cleanup;
-    }
-
-    // read/write the data
-    rc = mtcr_pciconf_rw(mf, offset, data, rw);
-cleanup:
-    // clear semaphore
-    mtcr_pciconf_cap9_sem(mf, 0);
-    return rc;
-}
-
-// adrianc: no need to lock the file semaphore if we access cr-space through mellanox vendor specific cap
-int mtcr_pciconf_mread4(mfile *mf, unsigned int offset, u_int32_t *value)
-{
-    int rc;
-    rc = mtcr_pciconf_send_pci_cmd_int(mf, mf->address_space, offset, value, READ_OP);
-    if (rc) {
-        return -1;
-    }
-    return 4;
-}
-int mtcr_pciconf_mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
-{
-    int rc;
-    rc = mtcr_pciconf_send_pci_cmd_int(mf, mf->address_space, offset, &value, WRITE_OP);
-    if (rc) {
-        return -1;
-    }
-    return 4;
-}
-
-static int block_op_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length, int rw)
-{
-    int i;
-    int rc = ME_OK;
-    int wrote_or_read = length;
-    if (length % 4) {
-        return -1;
-    }
-    // lock semaphore and set address space
-    rc = mtcr_pciconf_cap9_sem(mf, 1);
-    if (rc) {
-         return -1;
-    }
-    // set address space
-    rc = mtcr_pciconf_set_addr_space(mf, mf->address_space);
-    if (rc) {
-        wrote_or_read = -1;
-        goto cleanup;
-    }
-
-    for (i = 0; i < length ; i += 4) {
-        if (mtcr_pciconf_rw(mf, offset + i, &(data[(i >> 2)]), rw)) {
-            wrote_or_read = i;
-            goto cleanup;
-        }
-    }
-cleanup:
-    mtcr_pciconf_cap9_sem(mf, 0);
-    return wrote_or_read;
-}
-
-static int
-mread4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
-{
-    return block_op_pciconf(mf, offset, data, length, READ_OP);
-}
-
-static int
-mwrite4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
-{
-    return block_op_pciconf(mf, offset, data, length, WRITE_OP);
-}
-
-int mtcr_pciconf_mread4_old(mfile *mf, unsigned int offset, u_int32_t *value)
-{
-    struct pciconf_context *ctx = mf->ctx;
-    int rc;
-    // adrianc: PCI registers always in le32
-    offset = __cpu_to_le32(offset);
-    rc = _flock_int(mf->fdlock, LOCK_EX);
-    if (rc) {
-        goto pciconf_read_cleanup;
-    }
-    rc=pwrite(ctx->fd, &offset, 4, 22*4);
-    if (rc < 0) {
-        perror("write offset");
-        goto pciconf_read_cleanup;
-    }
-    if (rc != 4) {
-        rc = 0;
-        goto pciconf_read_cleanup;
-    }
-
-    rc = pread(ctx->fd, value, 4, 23*4);
-    if (rc < 0) {
-        perror("read value");
-        goto pciconf_read_cleanup;
-    }
-    *value = __le32_to_cpu(*value);
-pciconf_read_cleanup:
-    _flock_int(mf->fdlock, LOCK_UN);
-    return rc;
-}
-
-int mtcr_pciconf_mwrite4_old(mfile *mf, unsigned int offset, u_int32_t value)
-{
-    struct pciconf_context *ctx = mf->ctx;
-    int rc;
-    offset = __cpu_to_le32(offset);
-    rc = _flock_int(mf->fdlock, LOCK_EX);
-    if (rc) {
-        goto pciconf_write_cleanup;
-    }
-    rc = pwrite(ctx->fd, &offset, 4, 22*4);
-    if (rc < 0) {
-        perror("write offset");
-        goto pciconf_write_cleanup;
-    }
-    if (rc != 4) {
-        rc = 0;
-        goto pciconf_write_cleanup;
-    }
-    value = __cpu_to_le32(value);
-    rc = pwrite(ctx->fd, &value, 4, 23*4);
-    if (rc < 0) {
-        perror("write value");
-        goto pciconf_write_cleanup;
-    }
-pciconf_write_cleanup:
-    _flock_int(mf->fdlock, LOCK_UN);
-    return rc;
-}
-
-static
-int mtcr_pciconf_mclose(mfile *mf)
-{
-    struct pciconf_context *ctx = mf->ctx;
-    unsigned int word;
-    if (ctx) {
-        //TODO: apparently this read is useless here , need to check
-        // what happens if we remove it , (maybe something to do with ConnectX WA ??)
-        mread4(mf, 0xf0014, &word);
-        if (ctx->fd != -1) {
-            close(ctx->fd);
-        }
-        free(ctx);
-        mf->ctx = NULL;
-    }
-
-    return 0;
-}
-
-static
-int mtcr_pciconf_open(mfile *mf, const char *name)
-{
-    int err;
-    int rc;
-    struct pciconf_context *ctx;
-
-    ctx = (struct pciconf_context*)malloc(sizeof(struct pciconf_context));
-    if (!ctx)
-        return 1;
-
-    mf->ctx = ctx;
-
-    ctx->fd = -1;
-    ctx->fd = open(name, O_RDWR | O_SYNC);
-    if (ctx->fd < 0) {
-        return -1;
-    }
-
-    mf->access_type   = MTCR_ACCESS_CONFIG;
-
-    if ((mf->vsec_addr = pci_find_capability(mf, CAP_ID))) {
-        // check if the needed spaces are supported
-        if (mtcr_pciconf_set_addr_space(mf, ICMD_DOMAIN) || \
-                mtcr_pciconf_set_addr_space(mf, SEMAPHORE_DOMAIN) || \
-                mtcr_pciconf_set_addr_space(mf, CR_SPACE_DOMAIN)) {
-            mf->vsec_supp = 0;
-        } else {
-            mf->vsec_supp = 1;
-        }
-    }
-
-    if (mf->vsec_supp) {
-        mf->address_space = CR_SPACE_DOMAIN;
-        mf->mread4        = mtcr_pciconf_mread4;
-        mf->mwrite4       = mtcr_pciconf_mwrite4;
-        mf->mread4_block  = mread4_block_pciconf;
-        mf->mwrite4_block = mwrite4_block_pciconf;
-    } else {
-        mf->mread4        = mtcr_pciconf_mread4_old;
-        mf->mwrite4       = mtcr_pciconf_mwrite4_old;
-        mf->mread4_block  = mread_chunk_as_multi_mread4;
-        mf->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
-    }
-    mf->mclose        = mtcr_pciconf_mclose;
-
-    rc = mtcr_check_signature(mf);
-    if (rc) {
-        rc = -1;
-        goto end;
-    }
-
-end:
-    if (rc) {
-        err = errno;
-        mtcr_pciconf_mclose(mf);
-        errno = err;
-    }
-    return rc;
-}
-#else
-static
-int mtcr_pciconf_open(mfile *mf, const char *name)
-{
-    return -1;
-}
-#endif
-
-//
-// IN-BAND ACCESS FUNCTIONS
-//
-
-
-static
-int mtcr_inband_open(mfile* mf, const char* name)
-{
-
-#ifndef NO_INBAND
-    mf->access_type   = MTCR_ACCESS_INBAND;
-    mf->mread4        = mib_read4;
-    mf->mwrite4       = mib_write4;
-    mf->mread4_block  = mib_readblock;
-    mf->mwrite4_block = mib_writeblock;
-    mf->maccess_reg   = mib_acces_reg_mad;
-    mf->mclose        = mib_close;
-
-    return mib_open(name,mf,0);
-
-#else
-    (void) name;
-    (void) mf;
-    errno = ENOSYS;
-    return -1;
-#endif
-}
-
-static
-enum mtcr_access_method mtcr_parse_name(const char* name, int *force,
-                        unsigned *domain_p, unsigned *bus_p,
-                        unsigned *dev_p, unsigned *func_p)
-{
-    unsigned my_domain = 0;
-    unsigned my_bus;
-    unsigned my_dev;
-    unsigned my_func;
-    int scnt, r;
-    int force_config = 0;
-    char config[] = "/config";
-    char resource0[] = "/resource0";
-    char procbuspci[] = "/proc/bus/pci/";
-
-    unsigned len = strlen(name);
-    unsigned tmp;
-
-    if (len >= sizeof config && !strcmp(config, name + len + 1 - sizeof config)) {
-        *force = 1;
-        return MTCR_ACCESS_CONFIG;
-    }
-
-    if (len >= sizeof resource0 &&
-        !strcmp(resource0, name + len + 1 - sizeof resource0)) {
-        *force = 1;
-        return MTCR_ACCESS_MEMORY;
-    }
-
-    if (!strncmp(name,"/proc/bus/pci/", sizeof procbuspci - 1)) {
-        *force = 1;
-        return MTCR_ACCESS_CONFIG;
-    }
-
-    if (sscanf(name, "lid-%x", &tmp) == 1  ||
-        sscanf(name, "ibdr-%x", &tmp) == 1 ||
-        strstr(name, "lid-") != 0 || strstr(name, "ibdr-") != 0) {
-        *force = 1;
-        return MTCR_ACCESS_INBAND;
-    }
-
-
-    if (sscanf(name, "mthca%x", &tmp) == 1 ||
-        sscanf(name, "mlx4_%x", &tmp) == 1 ||
-        sscanf(name, "mlx5_%x", &tmp) == 1) {
-        char mbuf[4048];
-        char pbuf[4048];
-        char *base;
-
-        r = snprintf(mbuf, sizeof mbuf, "/sys/class/infiniband/%s/device", name);
-        if (r <= 0 || r >= (int)sizeof mbuf) {
-            fprintf(stderr,"Unable to print device name %s\n", name);
-            goto parse_error;
-        }
-
-        r = readlink(mbuf, pbuf, sizeof pbuf - 1);
-        if (r < 0) {
-            perror("read link");
-            fprintf(stderr,"Unable to read link %s\n", mbuf);
-            return MTCR_ACCESS_ERROR;
-        }
-        pbuf[r] = '\0';
-
-        base = basename(pbuf);
-        if (!base)
-            goto parse_error;
-        scnt = sscanf(base, "%x:%x:%x.%x",
-                  &my_domain, &my_bus, &my_dev, &my_func);
-        if (scnt != 4)
-            goto parse_error;
-        if (sscanf(name, "mlx5_%x", &tmp) == 1) {
-            force_config = 1;
-        }
-        goto name_parsed;
-    }
-
-    scnt = sscanf(name, "%x:%x.%x", &my_bus, &my_dev, &my_func);
-    if (scnt == 3) {
-        force_config = check_force_config(my_domain, my_bus, my_dev, my_func);
-        goto name_parsed;
-    }
-
-    scnt = sscanf(name, "%x:%x:%x.%x", &my_domain, &my_bus, &my_dev, &my_func);
-    if (scnt == 4) {
-        force_config = check_force_config(my_domain, my_bus, my_dev, my_func);
-        goto name_parsed;
-    }
-
-parse_error:
-    fprintf(stderr,"Unable to parse device name %s\n", name);
-    errno = EINVAL;
-    return MTCR_ACCESS_ERROR;
-
-name_parsed:
-    *domain_p = my_domain;
-    *bus_p = my_bus;
-    *dev_p = my_dev;
-    *func_p = my_func;
-    *force = 0;
-#ifdef __aarch64__
-    // on ARM processors MMAP not supported
-    (void)force_config; // avoid warrnings
-    return MTCR_ACCESS_CONFIG;
-#else
-    if (force_config) {
-        return MTCR_ACCESS_CONFIG;
-    }
-    return MTCR_ACCESS_MEMORY;
-#endif
-}
-#endif
-
-int mread4_block (mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
-{
-    return mf->mread4_block(mf, offset, data, byte_len);
-}
-
-int mwrite4_block (mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
-{
-    return mf->mwrite4_block(mf, offset, data, byte_len);
-}
-
-int msw_reset(mfile *mf)
-{
-#ifndef NO_INBAND
-    switch (mf->access_type) {
-    case MTCR_ACCESS_INBAND:
-        return mib_swreset(mf);
-    default:
-        errno = EPERM;
-        return -1;
-    }
-#else
-    (void)mf;
-    return -1;
-#endif
-}
-
-int mhca_reset(mfile *mf)
-{
-    (void)mf;
-    errno = ENOTSUP;
-    return -1;
-}
-
-int is_supported_device(char* devname)
-{
-    static char* unsupported_dev_ids[] = {
-            "0x0600", //FPGA
-            "-1"
-    };
-    char fname[64];
-    char devid[64];
-    FILE* f;
-    int ret_val = 1;
-    int i = 0;
-    sprintf(fname, "/sys/bus/pci/devices/%s/device", devname);
-    f = fopen(fname, "r");
-    if (f == NULL) {
-        //printf("-D- Could not open file: %s\n", fname);
-        return 1;
-    }
-    if (fgets(devid, sizeof(devid), f)) {
-        while (strcmp(unsupported_dev_ids[i], "-1")) {
-            if (!strncmp(devid, unsupported_dev_ids[i], strlen(unsupported_dev_ids[i]))) {
-                //printf("-D- device: %s, with devid: %s is unsupported\n", devname, devid);
-                ret_val = 0;
-                break;
-            }
-            i++;
-        }
-    }
-    fclose(f);
-    return ret_val;
-}
-
-int mdevices(char *buf, int len, int mask)
-{
-
-#define MDEVS_TAVOR_CR  0x20
-#define MLNX_PCI_VENDOR_ID  "0x15b3"
-
-    FILE* f;
-    DIR* d;
-    struct dirent *dir;
-    int pos = 0;
-    int sz;
-    int rsz;
-    int ndevs = 0;
-
-    if (!(mask & MDEVS_TAVOR_CR)) {
-        return 0;
-    }
-
-    char inbuf[64];
-    char fname[64];
-
-    d = opendir("/sys/bus/pci/devices");
-    if (d == NULL) {
-        return -2;
-    }
-
-    while ((dir = readdir(d)) != NULL) {
-        if (dir->d_name[0] == '.') {
-            continue;
-        }
-        sz = strlen(dir->d_name);
-        if (sz > 2 && strcmp(dir->d_name + sz - 2, ".0")) {
-            continue;
-        } else if (sz > 4 && strcmp(dir->d_name + sz - 4, "00.0")) {
-            // Skip virtual functions
-            char physfn[64];
-            DIR* physfndir;
-            sprintf(physfn, "/sys/bus/pci/devices/%s/physfn", dir->d_name);
-            if ((physfndir = opendir(physfn)) != NULL) {
-                closedir(physfndir);
-                continue;
-            }
-        }
-        sprintf(fname, "/sys/bus/pci/devices/%s/vendor", dir->d_name);
-        f = fopen(fname, "r");
-        if (f == NULL) {
-            ndevs = -2;
-            goto cleanup_dir_opened;
-        }
-        if (fgets(inbuf, sizeof(inbuf), f)) {
-            if(!strncmp(inbuf, MLNX_PCI_VENDOR_ID, strlen(MLNX_PCI_VENDOR_ID)) &&
-                    is_supported_device(dir->d_name)) {
-                rsz = sz + 1; //dev name size + place for Null char
-                if ((pos + rsz) > len) {
-                    ndevs = -1;
-                    goto cleanup_file_opened;
-                }
-                memcpy(&buf[pos], dir->d_name, rsz);
-                pos += rsz;
-                ndevs++;
-            }
-        }
-        fclose(f);
-    }
-    closedir(d);
-
-    return ndevs;
-
-cleanup_file_opened:
-    fclose(f);
-cleanup_dir_opened:
-    closedir(d);
-    return ndevs;
+int mread4(mfile *mf, unsigned int offset, u_int32_t *value)
+{
+    return mread4_ul(mf, offset, value);
 }
 
-static
-int read_pci_config_header(u_int16_t domain, u_int8_t bus, u_int8_t dev, u_int8_t func, u_int8_t data[0x40])
+int mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
 {
-    char proc_dev[64];
-    sprintf(proc_dev, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/config", domain, bus, dev, func);
-    FILE* f = fopen(proc_dev, "r");
-    if (!f) {
-        fprintf(stderr, "Failed to open (%s) for reading: %s\n", proc_dev, strerror(errno));
-        return 1;
-    }
-    setvbuf(f, NULL, _IONBF, 0);
-    if (fread(data, 0x40, 1, f) != 1) {
-        fprintf(stderr, "Failed to read from (%s): %s\n", proc_dev, strerror(errno));
-        fclose(f);
-        return 1;
-    }
-
-    fclose(f);
-    return 0;
+    return mwrite4_ul(mf, offset, value);
 }
 
-
-int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, unsigned my_func)
+int mread4_block(mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
 {
-    u_int8_t conf_header[0x40];
-    u_int32_t *conf_header_32p = (u_int32_t*)conf_header;
-    if (read_pci_config_header(my_domain, my_bus, my_dev, my_func, conf_header)) {
-        return 0;
-    }
-    u_int32_t devid = __le32_to_cpu(conf_header_32p[0]) >> 16;
-    if (devid == CX3PRO_SW_ID || devid == CX3_SW_ID) {
-        return 0;
-    }
-    return 1;
+    return mread4_block_ul(mf, offset, data, byte_len);
 }
 
-
-dev_info* mdevices_info(int mask, int* len)
+int mwrite4_block(mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
 {
-    char* devs = 0;
-    char* dev_name;
-    int size = 2048;
-    int rc;
-    int i;
-
-    // Get list of devices
-    do {
-        if (devs) {
-            free(devs);
-        }
-        size *= 2;
-        devs = (char*)malloc(size);
-        rc = mdevices(devs, size, mask);
-    } while (rc == -1);
-
-    if ( rc <= 0 ) {
-        len = 0;
-        if (devs) {
-            free(devs);
-        }
-        return NULL;
-    }
-    // For each device read
-    dev_info* dev_info_arr = (dev_info*) malloc(sizeof(dev_info)*rc);
-    memset(dev_info_arr, 0, sizeof(dev_info)*rc);
-    dev_name = devs;
-    for (i = 0; i < rc; i++) {
-        int domain = 0;
-        int bus = 0;
-        int dev = 0;
-        int func = 0;
-
-        dev_info_arr[i].type = (Mdevs)MDEVS_TAVOR_CR;
-        u_int8_t conf_header[0x40];
-        u_int32_t *conf_header_32p = (u_int32_t*)conf_header;
-
-        // update default device name
-        strncpy(dev_info_arr[i].dev_name, dev_name, sizeof(dev_info_arr[i].dev_name) - 1);
-        strncpy(dev_info_arr[i].pci.cr_dev, dev_name, sizeof(dev_info_arr[i].pci.cr_dev) - 1);
-
-        // update dbdf
-        if (sscanf(dev_name, "%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
-            rc = -1;
-            len = 0;
-            free(dev_info_arr);
-            free(devs);
-            return NULL;
-        }
-        dev_info_arr[i].pci.domain = domain;
-        dev_info_arr[i].pci.bus = bus;
-        dev_info_arr[i].pci.dev = dev;
-        dev_info_arr[i].pci.func = func;
-
-        // read configuration space header
-        if (read_pci_config_header(domain, bus, dev, func, conf_header)) {
-            goto next;
-        }
-
-        dev_info_arr[i].pci.dev_id = __le32_to_cpu(conf_header_32p[0]) >> 16;
-        dev_info_arr[i].pci.vend_id = __le32_to_cpu(conf_header_32p[0]) & 0xffff;
-        dev_info_arr[i].pci.class_id = __le32_to_cpu(conf_header_32p[2]) >> 8;
-        dev_info_arr[i].pci.subsys_id = __le32_to_cpu(conf_header_32p[11]) >> 16;
-        dev_info_arr[i].pci.subsys_vend_id = __le32_to_cpu(conf_header_32p[11]) & 0xffff;
-
-        // set pci conf device
-        snprintf(dev_info_arr[i].pci.conf_dev, sizeof(dev_info_arr[i].pci.conf_dev), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/config", domain, bus,dev, func);
-        //Copy to dev_name as default device
-        snprintf(dev_info_arr[i].dev_name, sizeof(dev_info_arr[i].dev_name), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/config", domain, bus,dev, func);
+    return mwrite4_block_ul(mf, offset, data, byte_len);
+}
 
-next:
-        dev_name += strlen(dev_name) + 1;
+int msw_reset(mfile *mf)
+{
+#ifndef NO_INBAND
+    switch (mf->tp) {
+        case MST_IB:
+            return mib_swreset(mf);
+        default:
+            errno = EPERM;
+            return -1;
     }
-
-    free(devs);
-    *len = rc;
-    return dev_info_arr;
+#else
+    (void)mf;
+    return -1;
+#endif
 }
 
-
-void mdevices_info_destroy(dev_info* dev_info, int len)
+int mhca_reset(mfile *mf)
 {
-    (void)len;
-    if (dev_info)
-        free(dev_info);
+    (void) mf;
+    errno = ENOTSUP;
+    return -1;
 }
 
-mfile *mopen(const char *name)
+int mdevices(char *buf, int len, int mask)
 {
-    mfile *mf;
-    off_t offset;
-    unsigned domain = 0, bus = 0, dev = 0, func = 0;
-    mtcr_access_method_t access;
-    int force;
-    char rbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/resource0";
-    char cbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/config";
-    char pdbuf[] = "/proc/bus/pci/XXXX:XX/XX.X";
-    char pbuf[] = "/proc/bus/pci/XX/XX.X";
-    char errbuf[4048]="";
-    int err;
-    int rc;
-
-    if (geteuid() != 0) {
-    	errno = EACCES;
-    	return NULL;
-    }
-    mf = (mfile *)malloc(sizeof(mfile));
-    if (!mf)
-        return NULL;
+    return mdevices_ul(buf, len, mask);
+}
 
-    memset(mf, 0, sizeof(mfile));
-    mf->dev_name = strdup(name);
-    if (!mf->dev_name)
-        goto open_failed;
 
-    access = mtcr_parse_name(name, &force, &domain, &bus, &dev, &func);
-    if (access == MTCR_ACCESS_ERROR)
-        goto open_failed;
+dev_info* mdevices_info(int mask, int* len)
+{
+    return mdevices_info_ul(mask, len);
+}
 
-    if (access == MTCR_ACCESS_CONFIG || access == MTCR_ACCESS_MEMORY) {
-        // allocate lock to sync between parallel cr space requests (CONF/MEMORY only)
-        if (force) {
-            // need to extract the dbdf format from the full name
-            if (_extract_dbdf_from_full_name(name, &domain, &bus, &dev, &func)){
-                goto open_failed;
+void mdevices_info_destroy(dev_info* dev_info, int len)
+{
+    int i, j;
+    if (dev_info) {
+        for (i = 0; i < len; i++) {
+            if (dev_info[i].type == MDEVS_TAVOR_CR &&
+                dev_info[i].pci.ib_devs) {
+                for (j = 0; dev_info[i].pci.ib_devs[j]; j++) {
+                    if (dev_info[i].pci.ib_devs[j]) {
+                        free(dev_info[i].pci.ib_devs[j]);
+                    }
+                }
+                free(dev_info[i].pci.ib_devs);
+            }
+            if (dev_info[i].type == MDEVS_TAVOR_CR &&
+                dev_info[i].pci.net_devs) {
+                for (j = 0; dev_info[i].pci.net_devs[j]; j++) {
+                    if (dev_info[i].pci.net_devs[j]) {
+                        free(dev_info[i].pci.net_devs[j]);
+                    }
+                }
+                free(dev_info[i].pci.net_devs);
             }
-        }
-        if (_create_lock(mf, domain, bus, dev, func , access)) {
-            goto open_failed;
-        }
-    }
-
-    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config",
-        domain, bus, dev, func);
-
-    if (force) {
-        switch (access) {
-        case MTCR_ACCESS_CONFIG:
-            rc = mtcr_pciconf_open(mf, name);
-            break;
-        case MTCR_ACCESS_MEMORY:
-            rc = mtcr_pcicr_open(mf, name, cbuf, 0, 0);
-            break;
-        case MTCR_ACCESS_INBAND:
-            rc = mtcr_inband_open(mf, name);
-            break;
-        default:
-            goto open_failed;
-        }
-
-        if (0 == rc) {
-            return mf;
-        } else {
-            goto open_failed;
-        }
-    }
-
-    if (access == MTCR_ACCESS_CONFIG)
-        goto access_config_forced;
-
-    sprintf(rbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource0",
-        domain, bus, dev, func);
-
-    rc = mtcr_pcicr_open(mf, rbuf, cbuf, 0, 0);
-    if (rc == 0) {
-        return mf;
-    } else if (rc == 1) {
-        goto access_config_forced;
-    }
-
-    /* Following access methods need the resource BAR */
-    offset = mtcr_sysfs_get_offset(domain, bus, dev, func);
-    if (offset == -1 && !domain)
-        offset = mtcr_procfs_get_offset(bus, dev, func);
-    if (offset == -1)
-        goto access_config;
-
-    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x",
-        domain, bus, dev, func);
-    rc = mtcr_pcicr_open(mf, pdbuf, cbuf, offset, 1);
-    if (rc == 0) {
-        return mf;
-    } else if (rc == 1) {
-        goto access_config;
-    }
 
-    if (!domain) {
-        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x",
-            bus, dev, func);
-        rc = mtcr_pcicr_open(mf, pbuf, cbuf, offset, 1);
-        if (rc == 0) {
-            return mf;
-        } else if (rc == 1) {
-            goto access_config;
         }
+        free(dev_info);
     }
-
-#if CONFIG_USE_DEV_MEM
-    /* Non-portable, but helps some systems */
-    if (!mtcr_pcicr_open(mf, "/dev/mem", cbuf, offset, 0))
-        return mf;
-#endif
-
-access_config:
-#if CONFIG_ENABLE_PCICONF && CONFIG_ENABLE_PCICONF
-    strerror_r(errno, errbuf, sizeof errbuf);
-    fprintf(stderr,
-            "Warning: memory access to device %s failed: %s. Switching to PCI config access.\n",
-            name, errbuf);
-#endif
-
-access_config_forced:
-
-    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config",
-        domain, bus, dev, func);
-    if (!mtcr_pciconf_open(mf, cbuf))
-        return mf;
-
-    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x",
-        domain, bus, dev, func);
-    if (!mtcr_pciconf_open(mf, pdbuf))
-        return mf;
-
-    if (!domain) {
-        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x",
-            bus, dev, func);
-        if (!mtcr_pciconf_open(mf, pdbuf))
-            return mf;
-    }
-
-open_failed:
-        err = errno;
-        mclose(mf);
-        errno = err;
-        return NULL;
 }
 
+mfile *mopen(const char *name)
+{
+    return mopen_ul(name);
+}
 
 mfile *mopend(const char *name, int type)
 {
@@ -1681,533 +138,87 @@ mfile *mopend(const char *name, int type)
 
 int mclose(mfile *mf)
 {
-    if (mf != NULL){
-        if (mf->mclose != NULL && mf->ctx != NULL) {
-            // close icmd if if needed
-            if (mf->icmd.icmd_opened) {
-                icmd_close(mf);
-            }
-            mf->mclose(mf);
-        }
-        if (mf->dev_name) {
-            free(mf->dev_name);
-        }
-        if (mf->fdlock) {
-            close(mf->fdlock);
-        }
-        if (mf->res_fdlock) {
-            close(mf->res_fdlock);
-        }
-        free(mf);
-    }
-    return 0;
+    return mclose_ul(mf);
 }
 
-extern void mpci_change(mfile* mf)
+mfile *mopen_adv(const char *name, MType mtype)
 {
-    if (!mf->res_ctx) {
-        return;
-    }
-    if (mf->res_access_type == MTCR_ACCESS_CONFIG) {
-        mf->res_access_type = MTCR_ACCESS_MEMORY;
-        mf->access_type     = MTCR_ACCESS_CONFIG;
-    } else if (mf->res_access_type == MTCR_ACCESS_MEMORY) {
-        mf->res_access_type = MTCR_ACCESS_CONFIG;
-        mf->access_type     = MTCR_ACCESS_MEMORY;
-    } else {
-        return;
+    mfile* mf = mopend(name, MST_TAVOR);
+    if (mf) {
+        if (mf->tp & mtype) {
+            return mf;
+        } else {
+            errno = EPERM;
+            mclose(mf);
+            return NULL;
+        }
     }
-
-    /***** Switching READ WRITE FUNCS ******/
-    f_mread4 tmp_mread4 = mf->mread4;
-    mf->mread4 = mf->res_mread4;
-    mf->res_mread4 = tmp_mread4;
-
-    f_mwrite4 tmp_mwrite4 = mf->mwrite4;
-    mf->mwrite4 = mf->res_mwrite4;
-    mf->res_mwrite4 = tmp_mwrite4;
-
-    f_mread4_block tmp_mread4_block = mf->mread4_block;
-    mf->mread4_block = mf->res_mread4_block;
-    mf->res_mread4_block = tmp_mread4_block;
-
-    f_mwrite4_block  tmp_mwrite4_block = mf->mwrite4_block;
-    mf->mwrite4_block = mf->res_mwrite4_block;
-    mf->res_mwrite4_block = tmp_mwrite4_block;
-
-    /***** Switching FD LOCKs ******/
-    int tmp_lock = mf->res_fdlock;
-    mf->res_fdlock = mf->fdlock;
-    mf->fdlock = tmp_lock;
-
-    /***** Switching CNTX ******/
-    void* tmp_ctx = mf->res_ctx;
-    mf->res_ctx = mf->ctx;
-    mf->ctx = tmp_ctx;
+    return mf;
 }
 
 mfile *mopen_fw_ctx(void* fw_cmd_context, void* fw_cmd_func, void* extra_data)
 {
-	// not implemented
+    // not implemented
     TOOLS_UNUSED(fw_cmd_context);
     TOOLS_UNUSED(fw_cmd_func);
     TOOLS_UNUSED(extra_data);
-	return NULL;
+    return NULL;
 }
 
 unsigned char mset_i2c_slave(mfile *mf, unsigned char new_i2c_slave)
 {
-    (void)mf;
-    (void)new_i2c_slave; /* compiler warning */
+    (void) mf;
+    (void) new_i2c_slave; /* compiler warning */
     fprintf(stderr, "Warning: libmtcr: mset_i2c_slave() is not implemented and has no effect.\n");
     return 0;
 }
 
 
-int mget_mdevs_flags(mfile *mf, u_int32_t *devs_flags)
-{
-    switch (mf->access_type) {
-    case MTCR_ACCESS_INBAND: *devs_flags = MDEVS_IB; break;
-    case MTCR_ACCESS_MEMORY:
-    case MTCR_ACCESS_CONFIG: *devs_flags = MDEVS_TAVOR_CR; break;
-    default:
-        return -1;
-    }
-    return 0;
-}
-
-int mget_mdevs_type(mfile *mf, u_int32_t *mtype)
-{
-    if (mf == NULL || mtype == NULL) {
-        errno = EINVAL;
-        return 1;
-    }
-
-    *mtype = mf->access_type;
-    return 0;
-}
-
-
-#define IBDR_MAX_NAME_SIZE 128
-#define BDF_NAME_SIZE 12
-#define DEV_DIR_MAX_SIZE 128
-static
-int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
-{
-    unsigned domain = 0, bus = 0, dev = 0, func = 0;
-    int force = 0;
-    enum mtcr_access_method access;
-    DIR* d;
-    struct dirent *dir;
-    char dirname[DEV_DIR_MAX_SIZE], subdirname[DEV_DIR_MAX_SIZE], linkname[DEV_DIR_MAX_SIZE];
-    int found = 0;
-
-    access = mtcr_parse_name(pci_dev, &force, &domain, &bus, &dev, &func);
-
-    strcpy(dirname, "/sys/class/infiniband");
-    d = opendir(dirname);
-    if (d == NULL) {
-        errno = ENODEV;
-        return -2;
-    }
-  
-    while ((dir = readdir(d)) != NULL) {
-        unsigned curr_domain = 0, curr_bus = 0, curr_dev = 0, curr_func = 0;
-        int curr_force = 0, link_size;
-        if (dir->d_name[0] == '.') {
-            continue;
-        }
-        sprintf(subdirname, "%s/%s/device", dirname, dir->d_name);
-        link_size = readlink(subdirname, linkname, DEV_DIR_MAX_SIZE);
-        access = mtcr_parse_name(&linkname[link_size - BDF_NAME_SIZE], &curr_force, &curr_domain, &curr_bus, &curr_dev, &curr_func);
-                 
-        if (domain == curr_domain && bus == curr_bus && dev == curr_dev && func == curr_func) {
-            sprintf(inband_dev, "ibdr-0,%s,1", dir->d_name);
-            found = 1;
-            break;
-        }
-    }
-
-    closedir(d);
-    (void)access; // avoid compiler warrnings
-    if (found) {
-        return 0;
-    } else {
-        errno = ENODEV;
-        return -1;
-    }
-}
-
-static
-int reopen_pci_as_inband(mfile* mf)
-{
-    int rc;
-    char inband_dev[IBDR_MAX_NAME_SIZE];
-    rc = get_inband_dev_from_pci(inband_dev, mf->dev_name);
-    if (rc) {
-        errno = ENODEV;
-        return -1;
-    }
-
-    mf->mclose(mf);
-    free(mf->dev_name);
-    mf->dev_name = strdup(inband_dev);
-
-    rc = mtcr_inband_open(mf, inband_dev);
-    return rc;
-}
 
 int maccess_reg_mad(mfile *mf, u_int8_t *data)
 {
-    int rc;
-
-    if (mf == NULL || data == NULL) {
-        return ME_BAD_PARAMS;
-    }
-
-    if (mf->access_type != MTCR_ACCESS_INBAND) {
-        // Close current device and re-open as inband
-        rc = reopen_pci_as_inband(mf);
-        if (rc) {
-            errno = ENODEV; // for compatibility untill we change mtcr to use error code
-            return ME_REG_ACCESS_UNKNOWN_ERR;
-        }
-    }
-
-    return mf->maccess_reg(mf, data);
+    return maccess_reg_mad_ul(mf, data);
 }
 
 int mos_reg_access(mfile *mf, int reg_access, void *reg_data, u_int32_t cmd_type)
 {
-    (void)mf;
-    (void)reg_data; /* compiler warning */
-    (void)cmd_type; /* compiler warning */
-    (void)reg_access; /* compiler warning */
+    (void) mf;
+    (void) reg_data; /* compiler warning */
+    (void) cmd_type; /* compiler warning */
+    (void) reg_access; /* compiler warning */
     fprintf(stderr, "Warning: libmtcr: mos_reg_access() is not implemented and has no effect.\n");
     return ME_NOT_IMPLEMENTED;
 }
 
 int maccess_reg_cmdif(mfile *mf, reg_access_t reg_access, void *reg_data, u_int32_t cmd_type)
 {
-    (void)mf;
-    (void)reg_data; /* compiler warning */
-    (void)cmd_type; /* compiler warning */
-    (void)reg_access; /* compiler warning */
+    (void) mf;
+    (void) reg_data; /* compiler warning */
+    (void) cmd_type; /* compiler warning */
+    (void) reg_access; /* compiler warning */
     fprintf(stderr, "Warning: libmtcr: maccess_reg_cmdif() is not implemented and has no effect.\n");
     return ME_NOT_IMPLEMENTED;
 }
 
-static void mtcr_fix_endianness(u_int32_t *buf, int len)
-{
-    int i;
-
-    for (i = 0; i < (len/4); ++i) {
-        buf[i] = __be32_to_cpu(buf[i]);
-    }
-}
-
 int mread_buffer(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
 {
-    int rc;
-    rc = mread4_block(mf, offset, (u_int32_t*)data, byte_len);
-    mtcr_fix_endianness((u_int32_t*)data, byte_len);
-    return rc;
-
+    return mread_buffer_ul(mf, offset, data, byte_len);
 }
 
 int mwrite_buffer(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
 {
-    mtcr_fix_endianness((u_int32_t*)data, byte_len);
-    return mwrite4_block(mf, offset, (u_int32_t*)data, byte_len);
-}
-
-/*
- * Reg Access Section
- */
-
-#define TLV_OPERATION_SIZE 4
-#define OP_TLV_SIZE        16
-#define REG_TLV_HEADER_LEN 4
-
-enum {
-    MAD_CLASS_REG_ACCESS = 1,
-};
-enum {
-    TLV_END       = 0,
-    TLV_OPERATION = 1,
-    TLV_DR        = 2,
-    TLV_REG       = 3,
-    TLV_USER_DATA = 4,
-};
-
-#define REGISTER_HEADERS_SIZE 12
-#define INBAND_MAX_REG_SIZE 44
-#define ICMD_MAX_REG_SIZE (ICMD_MAX_CMD_SIZE - REGISTER_HEADERS_SIZE)
-#define TOOLS_HCR_MAX_REG_SIZE (TOOLS_HCR_MAX_MBOX - REGISTER_HEADERS_SIZE)
-
-static int supports_icmd(mfile* mf);
-static int supports_tools_cmdif_reg(mfile* mf);
-static int init_operation_tlv(struct OperationTlv *operation_tlv, u_int16_t reg_id, u_int8_t method);
-static int mreg_send_wrapper(mfile* mf, u_int8_t *data, int r_icmd_size, int w_icmd_size);
-static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t  reg_size, u_int32_t r_size_reg, u_int32_t	w_size_reg, int *reg_status);
-int mget_max_reg_size(mfile *mf);
-
-// maccess_reg: Do a reg_access for the mf device.
-// - reg_data is both in and out
-// TODO: When the reg operation succeeds but the reg status is != 0,
-//       a specific
-
-int maccess_reg(mfile     *mf,
-                u_int16_t  reg_id,
-                maccess_reg_method_t reg_method,
-                void*      reg_data,
-                u_int32_t  reg_size,
-                u_int32_t	r_size_reg,
-                u_int32_t	w_size_reg,
-                int       *reg_status)
-{
-    int rc;
-    if (mf == NULL || reg_data == NULL || reg_status == NULL || reg_size <= 0) {
-        return ME_BAD_PARAMS;
-    }
-    // check register size
-    unsigned int max_size = (unsigned int)mget_max_reg_size(mf);
-    if ( reg_size > (unsigned int)max_size) {
-    	//reg too big
-    	return ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT;
-    }
-#ifndef MST_UL
-    // TODO: add specific checks for each FW access method where needed
-    if (mf->flags & MDEVS_MLNX_OS){
-    	rc = mos_reg_access_raw(mf, reg_id, reg_method, reg_data, reg_size, reg_status);
-    } else if ((mf->flags & (MDEVS_IB | MDEVS_FWCTX)) || (mf->flags != MDEVS_IB && (supports_icmd(mf) || supports_tools_cmdif_reg(mf)))) {
-    	rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
-    }else {
-        return ME_REG_ACCESS_NOT_SUPPORTED;
-    }
-#else
-    if (mf->access_type == MTCR_ACCESS_INBAND || (supports_icmd(mf) || supports_tools_cmdif_reg(mf)) ) {
-        	rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
-        }else {
-            return ME_REG_ACCESS_NOT_SUPPORTED;
-        }
-#endif
-
-    if (rc ) {
-         return rc;
-    } else if (*reg_status) {
-        switch (*reg_status) {
-        case 1:
-            return ME_REG_ACCESS_DEV_BUSY;
-        case 2:
-            return ME_REG_ACCESS_VER_NOT_SUPP;
-        case 3:
-            return ME_REG_ACCESS_UNKNOWN_TLV;
-        case 4:
-            return ME_REG_ACCESS_REG_NOT_SUPP;
-        case 5:
-            return ME_REG_ACCESS_CLASS_NOT_SUPP;
-        case 6:
-            return ME_REG_ACCESS_METHOD_NOT_SUPP;
-        case 7:
-            return ME_REG_ACCESS_BAD_PARAM;
-        case 8:
-            return ME_REG_ACCESS_RES_NOT_AVLBL;
-        case 9:
-            return ME_REG_ACCESS_MSG_RECPT_ACK;
-        case 0x22:
-        	return ME_REG_ACCESS_CONF_CORRUPT;
-        case 0x24:
-        	return ME_REG_ACCESS_LEN_TOO_SMALL;
-        case 0x20:
-        	return ME_REG_ACCESS_BAD_CONFIG;
-        case 0x21:
-        	return ME_REG_ACCESS_ERASE_EXEEDED;
-        case 0x70:
-            return ME_REG_ACCESS_INTERNAL_ERROR;
-        default:
-            return ME_REG_ACCESS_UNKNOWN_ERR;
-        }
-    }
-
-    return ME_OK;
-}
-
-
-static int init_operation_tlv(struct OperationTlv *operation_tlv, u_int16_t reg_id, u_int8_t method)
-{
-    memset(operation_tlv, 0, sizeof(*operation_tlv));
-
-    operation_tlv->Type        = TLV_OPERATION;
-    operation_tlv->class       = MAD_CLASS_REG_ACCESS;
-    operation_tlv->len         = TLV_OPERATION_SIZE;
-    operation_tlv->method      = method;
-    operation_tlv->register_id = reg_id;
-    return 0;
+    return mwrite_buffer_ul(mf, offset, data, byte_len);
 }
 
-///////////////////  Function that sends the register via the correct interface ///////////////////////////
-
-static int mreg_send_wrapper(mfile* mf, u_int8_t *data, int r_icmd_size, int w_icmd_size)
+int maccess_reg(mfile *mf, u_int16_t reg_id, maccess_reg_method_t reg_method, void* reg_data, u_int32_t reg_size,
+        u_int32_t r_size_reg, u_int32_t w_size_reg, int *reg_status)
 {
-    int rc;
-    if (mf->access_type == MTCR_ACCESS_INBAND) {//inband access
-            rc = maccess_reg_mad(mf, data);
-            if (rc) {
-                //printf("-E- 2. Access reg mad failed with rc = %#x\n", rc);
-                return ME_MAD_SEND_FAILED;
-            }
-    } else if (supports_icmd(mf)) {
-    #if defined(MST_UL) && !defined(MST_UL_ICMD)
-        if (mf->vsec_supp) { // we support accessing fw via icmd space
-            rc = icmd_send_command_int(mf, FLASH_REG_ACCESS, data, w_icmd_size, r_icmd_size, 0);
-            if (rc) {
-                return rc;
-            }
-        } else { // send register via inband (maccess_reg_mad will open the device as inband thus consecutives calls will go to the first if)
-            rc = maccess_reg_mad(mf, data);
-            if (rc) {
-                //printf("-E- 2. Access reg mad failed with rc = %#x\n", rc);
-                return ME_MAD_SEND_FAILED;
-            }
-        }
-    #else
-        rc = icmd_send_command_int(mf, FLASH_REG_ACCESS, data, w_icmd_size, r_icmd_size, 0);
-         if (rc) {
-             return rc;
-         }
-    #endif
-    } else if (supports_tools_cmdif_reg(mf)) {
-    	rc = tools_cmdif_reg_access(mf, data, w_icmd_size, r_icmd_size);
-    	if (rc) {
-    		return rc;
-    	}
-    }else{
-        return ME_NOT_IMPLEMENTED;
-    }
-    return ME_OK;
+    return maccess_reg_ul(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
 }
 
-
-static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t  reg_size,\
-							u_int32_t r_size_reg, u_int32_t	w_size_reg, int *reg_status)
+int mget_max_reg_size(mfile *mf)
 {
-	//printf("-D- reg_id = %d, reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_id,reg_size,r_size_reg,w_size_reg);
-    int mad_rc, cmdif_size = 0;
-    struct OperationTlv tlv;
-    struct reg_tlv tlv_info;
-    u_int8_t buffer[1024];
-
-    init_operation_tlv(&(tlv), reg_id, method);
-    // Fill Reg TLV
-    memset(&tlv_info, 0, sizeof(tlv_info));
-    tlv_info.Type = TLV_REG;
-    tlv_info.len  = (reg_size + REG_TLV_HEADER_LEN) >> 2; // length is in dwords
-
-    // Pack the mad
-
-    cmdif_size += OperationTlv_pack(&tlv, buffer);
-    cmdif_size += reg_tlv_pack(&tlv_info, buffer + OP_TLV_SIZE);
-    //put the reg itself into the buffer
-    memcpy(buffer + OP_TLV_SIZE + REG_TLV_HEADER_LEN, reg_data, reg_size);
-    cmdif_size += reg_size;
-
-#ifdef _ENABLE_DEBUG_
-    	fprintf(stdout, "-I-Tlv's of Data Sent:\n");
-        fprintf(stdout, "\tOperation Tlv\n");
-        OperationTlv_dump(&tlv, stdout);
-    	fprintf(stdout, "\tReg Tlv\n");
-        reg_tlv_dump(&tlv_info, stdout);
-#endif
-    // printf("-D- reg_info.len = |%d, OP_TLV: %d, REG_TLV= %d, cmdif_size = %d\n", reg_info.len, OP_TLV_SIZE, REG_RLV_HEADER_LEN, cmdif_size);
-    // update r/w_size_reg with the size of op tlv and reg tlv as we need to read/write them as well
-    r_size_reg += OP_TLV_SIZE + REG_TLV_HEADER_LEN;
-    w_size_reg += OP_TLV_SIZE + REG_TLV_HEADER_LEN;
-	//printf("-D- reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_size,r_size_reg,w_size_reg);
-
-    mad_rc = mreg_send_wrapper(mf, buffer, r_size_reg, w_size_reg);
-    // Unpack the mad
-    OperationTlv_unpack(&tlv, buffer);
-    reg_tlv_unpack(&tlv_info, buffer + OP_TLV_SIZE);
-    // copy register back from the buffer
-    memcpy(reg_data, buffer + OP_TLV_SIZE + REG_TLV_HEADER_LEN, reg_size);
-
-#ifdef _ENABLE_DEBUG_
-    	fprintf(stdout, "-I-Tlv's of Data Recieved:\n");
-    	fprintf(stdout, "\tOperation Tlv\n");
-        OperationTlv_dump(&tlv, stdout);
-    	fprintf(stdout, "\tReg Tlv\n");
-        reg_tlv_dump(&tlv_info, stdout);
-#endif
-    // Check the return value
-    *reg_status = tlv.status;
-    if (mad_rc) {
-    	return mad_rc;
-    }
-    return ME_OK;
-}
-
-// needed device HW IDs
-#define CONNECTX3_PRO_HW_ID 0x1f7
-#define CONNECTX3_HW_ID 0x1f5
-#define SWITCHX_HW_ID 0x245
-#define INFINISCALE4_HW_ID 0x1b3
-
-#define HW_ID_ADDR 0xf0014
-
-
-static int supports_icmd(mfile* mf) {
-    u_int32_t dev_id;
-
-     if (mread4(mf,HW_ID_ADDR, &dev_id) != 4 ) {// cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports icmd
-         return 0;
-     }
-     switch (dev_id & 0xffff) { // that the hw device id
-         case CONNECTX3_HW_ID :
-         case CONNECTX3_PRO_HW_ID :
-         case INFINISCALE4_HW_ID :
-         case SWITCHX_HW_ID :
-            return 0;
-         default:
-             break;
-     }
-   return 1;
-}
-
-static int supports_tools_cmdif_reg(mfile* mf) {
-    u_int32_t dev_id;
-    if (mread4(mf,HW_ID_ADDR, &dev_id) != 4) { // cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports tools cmdif
-        return 0;
-    }
-    switch (dev_id & 0xffff) { // that the hw device id
-    case CONNECTX3_HW_ID : //Cx3
-    case CONNECTX3_PRO_HW_ID : // Cx3-pro
-        if (tools_cmdif_is_supported(mf) == ME_OK) {
-            return 1;
-        }
-        break;
-    default:
-        break;
-    }
-    return 0;
-}
-
-int mget_max_reg_size(mfile *mf) {
-    if (mf->acc_reg_params.max_reg_size) {
-        return mf->acc_reg_params.max_reg_size;
-    } else if (mf->access_type == MTCR_ACCESS_INBAND) {
-        mf->acc_reg_params.max_reg_size = INBAND_MAX_REG_SIZE;
-    } else if (supports_icmd(mf)){ // we support icmd and we dont use IB interface -> we use icmd for reg access
-        if (mf->vsec_supp) {
-            mf->acc_reg_params.max_reg_size = ICMD_MAX_REG_SIZE;
-        } else {
-            // we send via inband
-            mf->acc_reg_params.max_reg_size = INBAND_MAX_REG_SIZE;
-        }
-    }else if (supports_tools_cmdif_reg(mf)) {
-        mf->acc_reg_params.max_reg_size = TOOLS_HCR_MAX_REG_SIZE;
-    }
-    return mf->acc_reg_params.max_reg_size;
+    return mget_max_reg_size_ul(mf);
 }
 
 int mget_vsec_supp(mfile* mf)
@@ -2222,163 +233,41 @@ MTCR_API int mget_addr_space(mfile* mf)
 MTCR_API int mset_addr_space(mfile* mf, int space)
 {
     switch (space) {
-    case AS_CR_SPACE:
-    case AS_ICMD:
-    case AS_SEMAPHORE:
-        break;
-    default:
-        return -1;
+        case AS_CR_SPACE:
+        case AS_ICMD:
+        case AS_SEMAPHORE:
+            break;
+        default:
+            return -1;
     }
     mf->address_space = space;
     return 0;
 }
 
-/************************************
- * Function: m_err2str
- ************************************/
-const char* m_err2str(MError status)
+int mget_mdevs_flags(mfile *mf, u_int32_t *devs_flags)
 {
-   switch(status) {
-   case ME_OK:
-       return "ME_OK";
-   case ME_ERROR:
-       return "General error";
-   case ME_BAD_PARAMS:
-       return "ME_BAD_PARAMS";
-   case ME_CR_ERROR:
-       return "ME_CR_ERROR";
-   case ME_NOT_IMPLEMENTED:
-       return "ME_NOT_IMPLEMENTED";
-   case ME_SEM_LOCKED:
-       return "Semaphore locked";
-   case ME_MEM_ERROR:
-       return "ME_MEM_ERROR";
-   case ME_PCI_READ_ERROR:
-       return "ME_PCI_READ_ERROR";
-   case ME_PCI_WRITE_ERROR:
-       return "ME_PCI_WRITE_ERROR";
-    case ME_PCI_SPACE_NOT_SUPPORTED:
-        return "ME_PCI_SPACE_NOT_SUPPORTED";
-    case ME_PCI_IFC_TOUT:
-        return "ME_PCI_IFC_TOUT";
-
-   case ME_MAD_SEND_FAILED:
-       return "ME_MAD_SEND_FAILED";
-   case ME_UNKOWN_ACCESS_TYPE:
-       return "ME_UNKOWN_ACCESS_TYPE";
-   case ME_UNSUPPORTED_DEVICE:
-       return "ME_UNSUPPORTED_DEVICE";
-
-   // Reg access errors
-   case ME_REG_ACCESS_BAD_STATUS_ERR:
-       return "ME_REG_ACCESS_BAD_STATUS_ERR";
-   case ME_REG_ACCESS_BAD_METHOD:
-       return "Bad method";
-   case ME_REG_ACCESS_NOT_SUPPORTED:
-       return "Register access isn't supported by device";
-   case ME_REG_ACCESS_DEV_BUSY:
-       return "Device is busy";
-   case ME_REG_ACCESS_VER_NOT_SUPP:
-       return "Version not supported";
-   case ME_REG_ACCESS_UNKNOWN_TLV:
-       return "Unknown TLV";
-   case ME_REG_ACCESS_REG_NOT_SUPP:
-       return "Register not supported";
-   case ME_REG_ACCESS_CLASS_NOT_SUPP:
-       return "Class not supported";
-   case ME_REG_ACCESS_METHOD_NOT_SUPP:
-       return "Method not supported";
-   case ME_REG_ACCESS_BAD_PARAM:
-       return "Bad parameter";
-   case ME_REG_ACCESS_RES_NOT_AVLBL:
-       return "Resource not available";
-   case ME_REG_ACCESS_MSG_RECPT_ACK:
-       return "Message receipt ack";
-   case ME_REG_ACCESS_UNKNOWN_ERR:
-       return "Unknown register error";
-   case ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT:
-       return "Register is too large";
-   case ME_REG_ACCESS_CONF_CORRUPT:
-      return "Config Section Corrupted";
-   case ME_REG_ACCESS_LEN_TOO_SMALL:
-      return "given register length too small for Tlv";
-   case ME_REG_ACCESS_BAD_CONFIG:
-      return "configuration refused";
-   case ME_REG_ACCESS_ERASE_EXEEDED:
-      return	"erase count exceeds limit";
-   case ME_REG_ACCESS_INTERNAL_ERROR:
-      return "FW internal error";
+    if (mf == NULL || devs_flags == NULL) {
+        errno = EINVAL;
+        return 1;
+    }
 
-   // ICMD access errors
-   case ME_ICMD_STATUS_CR_FAIL:
-       return "ME_ICMD_STATUS_CR_FAIL";
-   case ME_ICMD_STATUS_SEMAPHORE_TO:
-       return "ME_ICMD_STATUS_SEMAPHORE_TO";
-   case ME_ICMD_STATUS_EXECUTE_TO:
-       return "ME_ICMD_STATUS_EXECUTE_TO";
-   case ME_ICMD_STATUS_IFC_BUSY:
-       return "ME_ICMD_STATUS_IFC_BUSY";
-   case ME_ICMD_STATUS_ICMD_NOT_READY:
-       return "ME_ICMD_STATUS_ICMD_NOT_READY";
-   case ME_ICMD_UNSUPPORTED_ICMD_VERSION:
-       return "ME_ICMD_UNSUPPORTED_ICMD_VERSION";
-   case ME_ICMD_NOT_SUPPORTED:
-       return "ME_REG_ACCESS_ICMD_NOT_SUPPORTED";
-   case ME_ICMD_INVALID_OPCODE:
-       return "ME_ICMD_INVALID_OPCODE";
-   case ME_ICMD_INVALID_CMD:
-       return "ME_ICMD_INVALID_CMD";
-   case ME_ICMD_OPERATIONAL_ERROR:
-       return "ME_ICMD_OPERATIONAL_ERROR";
-   case ME_ICMD_BAD_PARAM:
-       return "ME_ICMD_BAD_PARAM";
-   case ME_ICMD_BUSY:
-       return "ME_ICMD_BUSY";
-   case ME_ICMD_ICM_NOT_AVAIL:
-       return "ME_ICMD_ICM_NOT_AVAIL";
-   case ME_ICMD_WRITE_PROTECT:
-       return "ME_ICMD_WRITE_PROTECT";
-   case ME_ICMD_SIZE_EXCEEDS_LIMIT:
-       return "ME_ICMD_SIZE_EXCEEDS_LIMIT";
-   case ME_ICMD_UNKNOWN_STATUS:
-       return "ME_ICMD_UNKNOWN_STATUS";
+    *devs_flags = mf->flags;
+    return 0;
+}
 
-       // TOOLS HCR access errors
-   case ME_CMDIF_BUSY:
-	   return "Tools HCR busy";
-   case ME_CMDIF_TOUT:
-	   return "Tools HCR time out";
-   case ME_CMDIF_BAD_OP:
-	   return "Operation not supported";
-   case ME_CMDIF_NOT_SUPP:
-	   return "Tools HCR not supported";
-   case ME_CMDIF_BAD_SYS:
-	   return "bad system status (driver may be down or Fw does not support this operation)";
-   case ME_CMDIF_UNKN_TLV:
-       return "Unknown TLV";
-   case ME_CMDIF_RES_STATE:
-       return "Bad reset state";
-   case ME_CMDIF_UNKN_STATUS:
-       return "Unknown status";
+int mget_mdevs_type(mfile *mf, u_int32_t *mtype)
+{
+    if (mf == NULL || mtype == NULL) {
+        errno = EINVAL;
+        return 1;
+    }
 
-    // MAD IFC errors
-   case ME_MAD_BUSY:
-       return "Temporarily busy. MAD discarded. This is not an error";
-   case ME_MAD_REDIRECT:
-       return "Redirection. This is not an error";
-   case ME_MAD_BAD_VER:
-       return "Bad version";
-   case ME_MAD_METHOD_NOT_SUPP:
-       return "Method not supported";
-   case ME_MAD_METHOD_ATTR_COMB_NOT_SUPP:
-       return "Method and attribute combination isn't supported";
-   case ME_MAD_BAD_DATA:
-       return "Bad attribute modifer or field";
-   case ME_MAD_GENERAL_ERR:
-       return "Unknown MAD error";
+    *mtype = mf->tp;
+    return 0;
+}
 
-   default:
-       return "Unknown error code";
-   }
+int mclear_pci_semaphore(const char* name)
+{
+    return mclear_pci_semaphore_ul(name);
 }
 
diff --git a/mtcr_ul/mtcr_ul.c b/mtcr_ul/mtcr_ul_com.c
similarity index 56%
copy from mtcr_ul/mtcr_ul.c
copy to mtcr_ul/mtcr_ul_com.c
index b97d310..ea0ac9b 100644
--- a/mtcr_ul/mtcr_ul.c
+++ b/mtcr_ul/mtcr_ul_com.c
@@ -34,7 +34,6 @@
  *
  */
 
-
 //use memory mapped /dev/mem for access
 #define CONFIG_ENABLE_MMAP 1
 //mmap /dev/mem for memory access (does not work on sparc)
@@ -75,7 +74,6 @@
 #include <libgen.h>
 #include <sys/file.h>
 
-
 #if CONFIG_ENABLE_MMAP
 #include <sys/mman.h>
 #include <sys/pci.h>
@@ -83,14 +81,16 @@
 #endif
 
 #include <bit_slice.h>
-#include <mtcr.h>
 #include "tools_utils.h"
+#include "mtcr_ul_com.h"
 #include "mtcr_int_defs.h"
 #include "mtcr_ib.h"
 #include "packets_layout.h"
 #include "mtcr_tools_cif.h"
 #include "mtcr_icmd_cif.h"
-
+#ifndef MST_UL
+#include "../mtcr_mlnxos.h"
+#endif
 #ifndef __be32_to_cpu
 #define __be32_to_cpu(x) ntohl(x)
 #endif
@@ -121,24 +121,18 @@
 #endif
 #endif
 
-struct pcicr_context {
-    int              fd;
-    void            *ptr;
-    int              connectx_flush; /* For ConnectX/ConnectX3 */
-    int              need_flush; /* For ConnectX/ConnectX3 */
-};
-
-struct pciconf_context {
-    int              fd;
-};
-
 #define CX3_SW_ID    4099
 #define CX3PRO_SW_ID 4103
 
+typedef enum {
+    Clear_Vsec_Semaphore = 0x1,
+} adv_opt_t;
+
 /* Forward decl*/
 static int get_inband_dev_from_pci(char* inband_dev, char* pci_dev);
-
 int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, unsigned my_func);
+mfile *mopen_ul_int(const char *name, u_int32_t adv_opt);
+int init_dev_info_ul(mfile* mf, const char* dev_name, unsigned domain, unsigned bus, unsigned dev, unsigned func);
 /*
  * Lock file section:
  *
@@ -161,7 +155,8 @@ int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, uns
     }
 
 #define MAX_RETRY_CNT 4096
-static int _flock_int(int fdlock, int operation) {
+static int _flock_int(int fdlock, int operation)
+{
     int cnt = 0;
     if (fdlock == 0) { // in case we failed to create the lock file we ignore the locking mechanism
         return 0;
@@ -169,10 +164,10 @@ static int _flock_int(int fdlock, int operation) {
     do {
         if (flock(fdlock, operation | LOCK_NB) == 0) {
             return 0;
-        } else if(errno != EWOULDBLOCK){
+        } else if (errno != EWOULDBLOCK) {
             break; // BAD! lock/free failed
         }
-        if ((cnt & 0xf) == 0) {// sleep every 16 retries
+        if ((cnt & 0xf) == 0) { // sleep every 16 retries
             usleep(1);
         }
         cnt++;
@@ -182,17 +177,19 @@ static int _flock_int(int fdlock, int operation) {
 
 }
 
-static int _create_lock(mfile* mf, unsigned domain, unsigned bus, unsigned dev, unsigned func, mtcr_access_method_t access)
+static int _create_lock(mfile* mf, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 {
-    char fname[64] = {0};
+    char fname[64] = { 0 };
     int rc;
     int fd = 0;
-    snprintf(fname, 64,LOCK_FILE_FORMAT, domain, bus, dev, func, access == MTCR_ACCESS_CONFIG ? "config" : "mem");
-    rc = mkdir ("/tmp", 0777);
+    if (!(mf->ul_ctx)) {
+        goto cl_clean_up;
+    }
+    snprintf(fname, 64, LOCK_FILE_FORMAT, domain, bus, dev, func, mf->tp == MST_PCICONF ? "config" : "mem");
+    rc = mkdir("/tmp", 0777);
     if (rc && errno != EEXIST) {
         goto cl_clean_up;
     }
-
     rc = mkdir(LOCK_FILE_DIR, 0777);
     if (rc && errno != EEXIST) {
         goto cl_clean_up;
@@ -202,16 +199,18 @@ static int _create_lock(mfile* mf, unsigned domain, unsigned bus, unsigned dev,
     if (fd < 0) {
         goto cl_clean_up;
     }
-    mf->fdlock = fd;
+
+    ((ul_ctx_t*)mf->ul_ctx)->fdlock = fd;
     return 0;
 
 cl_clean_up:
-    fprintf(stderr, "Warrning: Failed to create lockfile: %s (parallel access not supported)\n" ,fname);
+    fprintf(stderr, "Warrning: Failed to create lockfile: %s (parallel access not supported)\n", fname);
     return 0;
 }
 /*End of Lock file section */
 
-static int _extract_dbdf_from_full_name(const char *name, unsigned* domain, unsigned* bus, unsigned* dev, unsigned* func)
+static int _extract_dbdf_from_full_name(const char *name, unsigned* domain, unsigned* bus, unsigned* dev,
+        unsigned* func)
 {
     if (sscanf(name, "/sys/bus/pci/devices/%4x:%2x:%2x.%d/resource0", domain, bus, dev, func) == 4) {
         return 0;
@@ -232,55 +231,57 @@ static int mtcr_connectx_flush(void *ptr, int fdlock)
 {
     u_int32_t value;
     int rc;
-    rc = _flock_int(fdlock, LOCK_EX); CHECK_LOCK(rc);
-    *((u_int32_t *)((char *)ptr + 0xf0380)) = 0x0;
+    rc = _flock_int(fdlock, LOCK_EX);
+    CHECK_LOCK(rc);
+    *((u_int32_t *) ((char *) ptr + 0xf0380)) = 0x0;
     do {
         asm volatile ("":::"memory");
-        value = __be32_to_cpu(*((u_int32_t *)((char *)ptr + 0xf0380)));
-    } while(value);
-    rc = _flock_int(fdlock, LOCK_UN); CHECK_LOCK(rc)
+        value = __be32_to_cpu(*((u_int32_t * )((char * )ptr + 0xf0380)));
+    } while (value);
+    rc = _flock_int(fdlock, LOCK_UN);
+    CHECK_LOCK(rc)
     return 0;
 }
 
-int mread4(mfile *mf, unsigned int offset, u_int32_t *value)
+int mread4_ul(mfile *mf, unsigned int offset, u_int32_t *value)
 {
-    return mf->mread4(mf,offset,value);
+    ul_ctx_t* ctx = mf->ul_ctx;
+    return ctx->mread4(mf, offset, value);
 }
 
-int mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
+int mwrite4_ul(mfile *mf, unsigned int offset, u_int32_t value)
 {
-    return mf->mwrite4(mf,offset,value);
+    ul_ctx_t* ctx = mf->ul_ctx;
+    return ctx->mwrite4(mf, offset, value);
 }
 
 // TODO: Verify change 'data' type from void* to u_in32_t* does not mess up things
-static int
-mread_chunk_as_multi_mread4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
+static int mread_chunk_as_multi_mread4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
 {
     int i;
     if (length % 4) {
         return EINVAL;
     }
-    for (i = 0; i < length ; i += 4) {
+    for (i = 0; i < length; i += 4) {
         u_int32_t value;
-        if (mread4(mf, offset + i, &value) != 4) {
+        if (mread4_ul(mf, offset + i, &value) != 4) {
             return -1;
         }
-        memcpy((char*)data + i , &value,4);
+        memcpy((char*) data + i, &value, 4);
     }
     return length;
 }
 
-static int
-mwrite_chunk_as_multi_mwrite4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
+static int mwrite_chunk_as_multi_mwrite4(mfile *mf, unsigned int offset, u_int32_t* data, int length)
 {
     int i;
     if (length % 4) {
         return EINVAL;
     }
-    for (i = 0; i < length ; i += 4) {
+    for (i = 0; i < length; i += 4) {
         u_int32_t value;
-        memcpy(&value, (char*)data + i ,4);
-        if (mwrite4(mf, offset + i, value) != 4) {
+        memcpy(&value, (char*) data + i, 4);
+        if (mwrite4_ul(mf, offset + i, value) != 4) {
             return -1;
         }
     }
@@ -288,19 +289,19 @@ mwrite_chunk_as_multi_mwrite4(mfile *mf, unsigned int offset, u_int32_t* data, i
 }
 
 /*
-* Return values:
-* 0:  OK
-* <0: Error
-* 1 : Device does not support memory access
-*
-*/
+ * Return values:
+ * 0:  OK
+ * <0: Error
+ * 1 : Device does not support memory access
+ *
+ */
 static
 int mtcr_check_signature(mfile *mf)
 {
     unsigned signature;
     int rc;
     char* connectx_flush = getenv("CONNECTX_FLUSH");
-    rc = mread4(mf, 0xF0014, &signature);
+    rc = mread4_ul(mf, 0xF0014, &signature);
     if (rc != 4) {
         if (!errno)
             errno = EIO;
@@ -308,20 +309,19 @@ int mtcr_check_signature(mfile *mf)
     }
 
     switch (signature) {
-    case 0xbad0cafe:  /* secure host mode device id */
-        return 0;
-    case 0xbadacce5:  /* returned upon mapping the UAR bar */
-    case 0xffffffff:  /* returned when pci mem access is disabled (driver down) */
-        return 1;
+        case 0xbad0cafe: /* secure host mode device id */
+            return 0;
+        case 0xbadacce5: /* returned upon mapping the UAR bar */
+        case 0xffffffff: /* returned when pci mem access is disabled (driver down) */
+            return 1;
     }
 
     if (connectx_flush == NULL || strcmp(connectx_flush, "0")) {
-        if ((signature == 0xa00190         ||
-            (signature & 0xffff) == 0x1f5  ||
-            (signature & 0xffff) == 0x1f7) && mf->access_type == MTCR_ACCESS_MEMORY) {
-            struct pcicr_context* ctx = mf->ctx;
+        if ((signature == 0xa00190 || (signature & 0xffff) == 0x1f5 || (signature & 0xffff) == 0x1f7)
+                && mf->tp == MST_PCI) {
+            ul_ctx_t* ctx = mf->ul_ctx;
             ctx->connectx_flush = 1;
-            if (mtcr_connectx_flush(ctx->ptr, mf->fdlock)) {
+            if (mtcr_connectx_flush(mf->ptr, ctx->fdlock)) {
                 return -1;
             }
         }
@@ -344,8 +344,7 @@ int mtcr_check_signature(mfile *mf)
 #define PCI_FUNC(devfn)     ((devfn) & 0x07)
 
 static
-unsigned long long mtcr_procfs_get_offset(unsigned my_bus, unsigned my_dev,
-                      unsigned my_func)
+unsigned long long mtcr_procfs_get_offset(unsigned my_bus, unsigned my_dev, unsigned my_func)
 {
     FILE* f;
     unsigned irq;
@@ -356,67 +355,51 @@ unsigned long long mtcr_procfs_get_offset(unsigned my_bus, unsigned my_dev,
     //unsigned device_id;
     unsigned int cnt;
 
-    unsigned long long offset = (unsigned long long)-1;
+    unsigned long long offset = (unsigned long long) -1;
 
     char buf[4048];
 
     f = fopen("/proc/bus/pci/devices", "r");
-    if (!f) return offset;
-
-    for(;;) if (fgets(buf, sizeof(buf) - 1, f)) {
-        unsigned dfn, vend;
-
-        cnt = sscanf(buf,
-                 "%x %x %x %llx %llx %llx %llx %llx %llx "
-                 "%llx %llx %llx %llx %llx %llx %llx %llx",
-                 &dfn,
-                 &vend,
-                 &irq,
-                 &base_addr[0],
-                 &base_addr[1],
-                 &base_addr[2],
-                 &base_addr[3],
-                 &base_addr[4],
-                 &base_addr[5],
-                 &rom_base_addr,
-                 &size[0],
-                 &size[1],
-                 &size[2],
-                 &size[3],
-                 &size[4],
-                 &size[5],
-                 &rom_size);
-        if (cnt != 9 && cnt != 10 && cnt != 17)
-        {
-            fprintf(stderr,"proc: parse error (read only %d items)\n", cnt);
-            fprintf(stderr,"the offending line in " "/proc/bus/pci/devices" " is "
-                "\"%.*s\"\n", (int)sizeof(buf), buf);
-            goto error;
-        }
-        bus = dfn >> 8U;
-        dev = PCI_SLOT(dfn & 0xff);
-        func = PCI_FUNC(dfn & 0xff);
-        //vendor_id = vend >> 16U;
-        //device_id = vend & 0xffff;
+    if (!f)
+        return offset;
 
-        if (bus == my_bus && dev == my_dev && func == my_func)
-            break;
-    }
-    else
-        goto error;
+    for (;;)
+        if (fgets(buf, sizeof(buf) - 1, f)) {
+            unsigned dfn, vend;
+
+            cnt = sscanf(buf, "%x %x %x %llx %llx %llx %llx %llx %llx "
+                    "%llx %llx %llx %llx %llx %llx %llx %llx", &dfn, &vend, &irq, &base_addr[0], &base_addr[1],
+                    &base_addr[2], &base_addr[3], &base_addr[4], &base_addr[5], &rom_base_addr, &size[0], &size[1],
+                    &size[2], &size[3], &size[4], &size[5], &rom_size);
+            if (cnt != 9 && cnt != 10 && cnt != 17) {
+                fprintf(stderr, "proc: parse error (read only %d items)\n", cnt);
+                fprintf(stderr, "the offending line in " "/proc/bus/pci/devices" " is "
+                        "\"%.*s\"\n", (int) sizeof(buf), buf);
+                goto error;
+            }
+            bus = dfn >> 8U;
+            dev = PCI_SLOT(dfn & 0xff);
+            func = PCI_FUNC(dfn & 0xff);
+            //vendor_id = vend >> 16U;
+            //device_id = vend & 0xffff;
+
+            if (bus == my_bus && dev == my_dev && func == my_func)
+                break;
+        } else
+            goto error;
 
     if (cnt != 17 || size[1] != 0 || size[0] != MTCR_MAP_SIZE) {
-        if (0) fprintf(stderr,"proc: unexpected region size values: "
-            "cnt=%d, size[0]=%#llx, size[1]=%#llx\n",
-            cnt,size[0],size[1]);
-        if (0) fprintf(stderr,"the offending line in " "/proc/bus/pci/devices"
-                   " is \"%.*s\"\n", (int)sizeof(buf), buf);
+        if (0)
+            fprintf(stderr, "proc: unexpected region size values: "
+                    "cnt=%d, size[0]=%#llx, size[1]=%#llx\n", cnt, size[0], size[1]);
+        if (0)
+            fprintf(stderr, "the offending line in " "/proc/bus/pci/devices"
+                    " is \"%.*s\"\n", (int) sizeof(buf), buf);
         goto error;
     }
 
-
-    offset = ((unsigned long long)(base_addr[1]) << 32) +
-        ((unsigned long long)(base_addr[0]) & ~(unsigned long long)(0xfffff));
+    offset = ((unsigned long long) (base_addr[1]) << 32)
+            + ((unsigned long long) (base_addr[0]) & ~(unsigned long long) (0xfffff));
 
     fclose(f);
     return offset;
@@ -428,16 +411,14 @@ error:
 }
 
 static
-unsigned long long mtcr_sysfs_get_offset(unsigned domain, unsigned bus,
-                     unsigned dev, unsigned func)
+unsigned long long mtcr_sysfs_get_offset(unsigned domain, unsigned bus, unsigned dev, unsigned func)
 {
     unsigned long long start, end, type;
-    unsigned long long offset = (unsigned long long)-1;
+    unsigned long long offset = (unsigned long long) -1;
     FILE *f;
     int cnt;
     char mbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/resource";
-    sprintf(mbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource",
-               domain, bus, dev, func);
+    sprintf(mbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource", domain, bus, dev, func);
 
     f = fopen(mbuf, "r");
     if (!f)
@@ -445,9 +426,9 @@ unsigned long long mtcr_sysfs_get_offset(unsigned domain, unsigned bus,
 
     cnt = fscanf(f, "0x%llx 0x%llx 0x%llx", &start, &end, &type);
     if (cnt != 3 || end != start + MTCR_MAP_SIZE - 1) {
-        if (0) fprintf(stderr,"proc: unexpected region size values: "
-            "cnt=%d, start=%#llx, end=%#llx\n",
-            cnt, start, end);
+        if (0)
+            fprintf(stderr, "proc: unexpected region size values: "
+                    "cnt=%d, start=%#llx, end=%#llx\n", cnt, start, end);
         goto error;
     }
 
@@ -467,63 +448,24 @@ error:
 static
 int mtcr_pcicr_mclose(mfile *mf)
 {
-    struct pcicr_context* ctx = mf->ctx;
-    struct pciconf_context* conf_ctx = mf->res_ctx;
-    if (ctx) {
-        if (ctx->ptr) {
-            munmap(ctx->ptr,MTCR_MAP_SIZE);
+    if (mf) {
+        if (mf->ptr) {
+            munmap(mf->ptr, MTCR_MAP_SIZE);
         }
-
-        if (ctx->fd != -1) {
-            close(ctx->fd);
+        if (mf->fd > 0) {
+            close(mf->fd);
         }
-        free(ctx);
-        mf->ctx = NULL;
-    }
-    if (conf_ctx) {
-        if (conf_ctx->fd != -1) {
-            close(conf_ctx->fd);
+        if (mf->res_fd > 0) {
+            close(mf->res_fd);
         }
-        free(conf_ctx);
-        mf->res_ctx = NULL;
     }
     return 0;
 }
 
 static
-int mtcr_mmap(struct pcicr_context *mf, const char *name, off_t off, int ioctl_needed)
+int mtcr_mmap(mfile *mf, const char *name, off_t off, int ioctl_needed)
 {
     int err;
-    /*
-    static const char sysbuspcidevices[] = "/sys/bus/pci/devices/";
-    // Enable PCI device before mmapping it
-    // this allows to flash a device even if mlx4_core fails to load with some kernels.
-    if (!strncmp(name, sysbuspcidevices, sizeof(sysbuspcidevices)-1)) {
-        // Accessing through sysfs: need to enable PCI device.
-        // We need to write 1 to 'enable' file located in
-        // parent dir for 'name'
-        int fd;
-        char fname[4096];
-        int i = strrchr(name, '/') - name;  //always ok
-        if (i + sizeof("enable") >= sizeof(fname)) {
-            return -1;
-            }
-        strncpy(fname, name, i+1);
-        strcpy(fname + i + 1, "enable");
-
-        fd = open(fname, O_WRONLY | O_SYNC);
-        if (fd < 0) {
-            return -1;
-            }
-        i = write(fd, "1", 1);
-        err = errno;
-        close(fd);
-        errno = err;
-        if (1 != i) {
-            return -1;
-            }
-        }
-     */
     mf->fd = open(name, O_RDWR | O_SYNC);
     if (mf->fd < 0)
         return -1;
@@ -535,8 +477,7 @@ int mtcr_mmap(struct pcicr_context *mf, const char *name, off_t off, int ioctl_n
         return -1;
     }
 
-    mf->ptr = mmap(NULL, MTCR_MAP_SIZE, PROT_READ | PROT_WRITE,
-               MAP_SHARED, mf->fd, off);
+    mf->ptr = mmap(NULL, MTCR_MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, mf->fd, off);
 
     if (!mf->ptr || mf->ptr == MAP_FAILED) {
         err = errno;
@@ -549,61 +490,55 @@ int mtcr_mmap(struct pcicr_context *mf, const char *name, off_t off, int ioctl_n
 
 int mtcr_pcicr_mread4(mfile *mf, unsigned int offset, u_int32_t *value)
 {
-    struct pcicr_context *ctx = mf->ctx;
+    ul_ctx_t *ctx = mf->ul_ctx;
 
     if (offset >= MTCR_MAP_SIZE) {
         errno = EINVAL;
         return 0;
     }
     if (ctx->need_flush) {
-        if (mtcr_connectx_flush(ctx->ptr, mf->fdlock)) {
+        if (mtcr_connectx_flush(mf->ptr, ctx->fdlock)) {
             return 0;
         }
         ctx->need_flush = 0;
     }
-    *value = __be32_to_cpu(*((u_int32_t *)((char *)ctx->ptr + offset)));
+    *value = __be32_to_cpu(*((u_int32_t * )((char * )mf->ptr + offset)));
     return 4;
 }
 
 int mtcr_pcicr_mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
 {
-    struct pcicr_context *ctx = mf->ctx;
+    ul_ctx_t *ctx = mf->ul_ctx;
 
     if (offset >= MTCR_MAP_SIZE) {
         errno = EINVAL;
         return 0;
     }
-    *((u_int32_t *)((char *)ctx->ptr + offset)) = __cpu_to_be32(value);
+    *((u_int32_t *) ((char *) mf->ptr + offset)) = __cpu_to_be32(value);
     ctx->need_flush = ctx->connectx_flush;
     return 4;
 }
 
 static
-int mtcr_pcicr_open(mfile *mf, const char *name, char* conf_name, off_t off, int ioctl_needed)
+int mtcr_pcicr_open(mfile *mf, const char *name, char* conf_name, off_t off, int ioctl_needed, u_int32_t adv_opt)
 {
     int rc;
-    struct pcicr_context *ctx;
-
-    mf->access_type   = MTCR_ACCESS_MEMORY;
+    ul_ctx_t *ctx = mf->ul_ctx;
 
-    mf->mread4        = mtcr_pcicr_mread4;
-    mf->mwrite4       = mtcr_pcicr_mwrite4;
-    mf->mread4_block  = mread_chunk_as_multi_mread4;
-    mf->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
-    mf->mclose        = mtcr_pcicr_mclose;
+    mf->tp = MST_PCI;
 
-    ctx = (struct pcicr_context*)malloc(sizeof(struct pcicr_context));
-    if (!ctx)
-        return 1;
+    ctx->mread4 = mtcr_pcicr_mread4;
+    ctx->mwrite4 = mtcr_pcicr_mwrite4;
+    ctx->mread4_block = mread_chunk_as_multi_mread4;
+    ctx->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
+    ctx->mclose = mtcr_pcicr_mclose;
 
-    ctx->ptr = NULL;
-    ctx->fd = -1;
+    mf->ptr = NULL;
+    mf->fd = -1;
     ctx->connectx_flush = 0;
     ctx->need_flush = 0;
 
-    mf->ctx = ctx;
-
-    rc = mtcr_mmap(ctx, name, off, ioctl_needed);
+    rc = mtcr_mmap(mf, name, off, ioctl_needed);
     if (rc) {
         goto end;
     }
@@ -613,18 +548,19 @@ end:
     if (rc) {
         mtcr_pcicr_mclose(mf);
     } else if (conf_name != NULL) {
-        mfile* conf_mf = mopen(conf_name);
+        mfile* conf_mf = mopen_ul_int(conf_name, adv_opt);
         if (conf_mf != NULL) {
-            mf->res_ctx = conf_mf->ctx;
-            mf->res_access_type = conf_mf->access_type;
+            mf->res_fd = conf_mf->fd;
+            ul_ctx_t *conf_ctx = conf_mf->ul_ctx;
+            mf->res_tp = conf_mf->tp;
             mf->vsec_addr = conf_mf->vsec_addr;
             mf->vsec_supp = conf_mf->vsec_supp;
             mf->address_space = conf_mf->address_space;
-            mf->res_fdlock = conf_mf->fdlock;
-            mf->res_mread4 = conf_mf->mread4;
-            mf->res_mwrite4 = conf_mf->mwrite4;
-            mf->res_mread4_block = conf_mf->mread4_block;
-            mf->res_mwrite4_block = conf_mf->mwrite4_block;
+            ctx->res_fdlock = conf_ctx->fdlock;
+            ctx->res_mread4 = conf_ctx->mread4;
+            ctx->res_mwrite4 = conf_ctx->mwrite4;
+            ctx->res_mread4_block = conf_ctx->mread4_block;
+            ctx->res_mwrite4_block = conf_ctx->mwrite4_block;
             free(conf_mf);
         }
     }
@@ -632,18 +568,14 @@ end:
     return rc;
 }
 
-
 //
 // PCI CONF ACCESS FUNCTIONS
 //
 
-
 #if CONFIG_ENABLE_PCICONF
 /* PCI address space related enum*/
 enum {
-    PCI_CAP_PTR = 0x34,
-    PCI_HDR_SIZE = 0x40,
-    PCI_EXT_SPACE_ADDR = 0xff,
+    PCI_CAP_PTR = 0x34, PCI_HDR_SIZE = 0x40, PCI_EXT_SPACE_ADDR = 0xff,
 
     PCI_CTRL_OFFSET = 0x4, // for space / semaphore / auto-increment bit
     PCI_COUNTER_OFFSET = 0x8,
@@ -662,32 +594,26 @@ enum {
 
 /* Mellanox vendor specific enum */
 enum {
-    CAP_ID = 0x9,
-    ICMD_DOMAIN = 0x1,
-    CR_SPACE_DOMAIN = 0x2,
-    SEMAPHORE_DOMAIN = 0xa,
-    IFC_MAX_RETRIES = 2048
+    CAP_ID = 0x9, ICMD_DOMAIN = 0x1, CR_SPACE_DOMAIN = 0x2, SEMAPHORE_DOMAIN = 0xa, IFC_MAX_RETRIES = 2048
 };
 
 /* PCI operation enum(read or write)*/
 enum {
-    READ_OP = 0,
-    WRITE_OP = 1,
+    READ_OP = 0, WRITE_OP = 1,
 };
 
-
 #define READ4_PCI(mf, val_ptr, pci_offs, err_prefix, action_on_fail)    \
     do {                                                                \
         int rc;                                                         \
         int lock_rc;                                                    \
-        struct pciconf_context *pci_ctx = mf->ctx;                      \
-        lock_rc = _flock_int(mf->fdlock, LOCK_EX);                      \
+        ul_ctx_t *pci_ctx = mf->ul_ctx;                                 \
+        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);                 \
         if (lock_rc) {                                                  \
             perror(err_prefix);                                         \
             action_on_fail;                                             \
         }                                                               \
-        rc = pread(pci_ctx->fd, val_ptr, 4, pci_offs);                  \
-        lock_rc = _flock_int(mf->fdlock, LOCK_UN);                      \
+        rc = pread(mf->fd, val_ptr, 4, pci_offs);                       \
+        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);                 \
         if (lock_rc) {                                                  \
             perror(err_prefix);                                         \
             action_on_fail;                                             \
@@ -705,15 +631,15 @@ enum {
             int rc;                                                         \
             int lock_rc;                                                    \
             u_int32_t val_le;                                               \
-            struct pciconf_context *pci_ctx = mf->ctx;                      \
+            ul_ctx_t *pci_ctx = mf->ul_ctx;                                 \
             val_le = __cpu_to_le32(val);                                    \
-            lock_rc = _flock_int(mf->fdlock, LOCK_EX);                      \
+            lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);                 \
             if (lock_rc) {                                                  \
                 perror(err_prefix);                                         \
                 action_on_fail;                                             \
             }                                                               \
-            rc = pwrite(pci_ctx->fd, &val_le, 4, pci_offs);                 \
-            lock_rc = _flock_int(mf->fdlock, LOCK_UN);                      \
+            rc = pwrite(mf->fd, &val_le, 4, pci_offs);                      \
+            lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);                 \
             if (lock_rc) {                                                  \
                 perror(err_prefix);                                         \
                 action_on_fail;                                             \
@@ -725,25 +651,24 @@ enum {
             }                                                               \
         } while (0)
 
-
 int pci_find_capability(mfile* mf, int cap_id)
 {
     unsigned offset;
-    unsigned char visited[256] = {}; /* Prevent infinite loops */
+    unsigned char visited[256] = { }; /* Prevent infinite loops */
     unsigned char data[2];
     int ret;
     int lock_ret;
-    struct pciconf_context *pci_ctx = mf->ctx;
+    ul_ctx_t *pci_ctx = mf->ul_ctx;
 
     // protect against parallel access
-    lock_ret = _flock_int(mf->fdlock, LOCK_EX);
+    lock_ret = _flock_int(pci_ctx->fdlock, LOCK_EX);
     if (lock_ret) {
         return 0;
     }
 
-    ret = pread(pci_ctx->fd, data, 1, PCI_CAP_PTR);
+    ret = pread(mf->fd, data, 1, PCI_CAP_PTR);
 
-    lock_ret = _flock_int(mf->fdlock, LOCK_UN);
+    lock_ret = _flock_int(pci_ctx->fdlock, LOCK_UN);
     if (lock_ret) {
         return 0;
     }
@@ -753,19 +678,19 @@ int pci_find_capability(mfile* mf, int cap_id)
     }
 
     offset = data[0];
-    while(1) {
+    while (1) {
         if (offset < PCI_HDR_SIZE || offset > PCI_EXT_SPACE_ADDR) {
             return 0;
         }
 
-        lock_ret = _flock_int(mf->fdlock, LOCK_EX);
+        lock_ret = _flock_int(pci_ctx->fdlock, LOCK_EX);
         if (lock_ret) {
             return 0;
         }
 
-        ret = pread(pci_ctx->fd, data, sizeof data, offset);
+        ret = pread(mf->fd, data, sizeof data, offset);
 
-        lock_ret = _flock_int(mf->fdlock, LOCK_UN);
+        lock_ret = _flock_int(pci_ctx->fdlock, LOCK_UN);
         if (lock_ret) {
             return 0;
         }
@@ -781,6 +706,10 @@ int pci_find_capability(mfile* mf, int cap_id)
         }
 
         offset = data[1];
+
+        if (offset > PCI_EXT_SPACE_ADDR) {
+            return 0;
+        }
         if (visited[offset]) {
             return 0;
         }
@@ -793,7 +722,7 @@ int mtcr_pciconf_cap9_sem(mfile* mf, int state)
     u_int32_t lock_val;
     u_int32_t counter = 0;
     int retries = 0;
-    if (!state) {// unlock
+    if (!state) { // unlock
         WRITE4_PCI(mf, 0, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "unlock semaphore", return ME_PCI_WRITE_ERROR);
     } else { // lock
         do {
@@ -810,7 +739,8 @@ int mtcr_pciconf_cap9_sem(mfile* mf, int state)
             //read ticket
             READ4_PCI(mf, &counter, mf->vsec_addr + PCI_COUNTER_OFFSET, "read counter", return ME_PCI_READ_ERROR);
             //write ticket to semaphore dword
-            WRITE4_PCI(mf, counter, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "write counter to semaphore", return ME_PCI_WRITE_ERROR);
+            WRITE4_PCI(mf, counter, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "write counter to semaphore",
+                    return ME_PCI_WRITE_ERROR);
             // read back semaphore make sure ticket == semaphore else repeat
             READ4_PCI(mf, &lock_val, mf->vsec_addr + PCI_SEMAPHORE_OFFSET, "read counter", return ME_PCI_READ_ERROR);
             retries++;
@@ -824,16 +754,16 @@ int mtcr_pciconf_wait_on_flag(mfile* mf, u_int8_t expected_val)
     int retries = 0;
     u_int32_t flag;
     do {
-         if (retries > IFC_MAX_RETRIES) {
-             return ME_PCI_IFC_TOUT;
-         }
-         READ4_PCI(mf, &flag, mf->vsec_addr + PCI_ADDR_OFFSET, "read flag", return ME_PCI_READ_ERROR);
-         flag = EXTRACT(flag, PCI_FLAG_BIT_OFFS, 1);
-         retries++;
-         if ((retries & 0xf) == 0) {// dont sleep always
-             msleep(1);
-         }
-     } while (flag != expected_val);
+        if (retries > IFC_MAX_RETRIES) {
+            return ME_PCI_IFC_TOUT;
+        }
+        READ4_PCI(mf, &flag, mf->vsec_addr + PCI_ADDR_OFFSET, "read flag", return ME_PCI_READ_ERROR);
+        flag = EXTRACT(flag, PCI_FLAG_BIT_OFFS, 1);
+        retries++;
+        if ((retries & 0xf) == 0) { // dont sleep always
+            msleep(1);
+        }
+    } while (flag != expected_val);
     return ME_OK;
 }
 
@@ -862,7 +792,7 @@ int mtcr_pciconf_rw(mfile *mf, unsigned int offset, u_int32_t* data, int rw)
         return ME_BAD_PARAMS;
     }
 
-    address = MERGE(address,(rw ? 1 : 0), PCI_FLAG_BIT_OFFS, 1);
+    address = MERGE(address, (rw ? 1 : 0), PCI_FLAG_BIT_OFFS, 1);
     if (rw == WRITE_OP) {
         // write data
         WRITE4_PCI(mf, *data, mf->vsec_addr + PCI_DATA_OFFSET, "write value", return ME_PCI_WRITE_ERROR);
@@ -899,7 +829,7 @@ int mtcr_pciconf_send_pci_cmd_int(mfile *mf, int space, unsigned int offset, u_i
 
     // read/write the data
     rc = mtcr_pciconf_rw(mf, offset, data, rw);
-cleanup:
+    cleanup:
     // clear semaphore
     mtcr_pciconf_cap9_sem(mf, 0);
     return rc;
@@ -936,7 +866,7 @@ static int block_op_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int
     // lock semaphore and set address space
     rc = mtcr_pciconf_cap9_sem(mf, 1);
     if (rc) {
-         return -1;
+        return -1;
     }
     // set address space
     rc = mtcr_pciconf_set_addr_space(mf, mf->address_space);
@@ -945,40 +875,37 @@ static int block_op_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int
         goto cleanup;
     }
 
-    for (i = 0; i < length ; i += 4) {
+    for (i = 0; i < length; i += 4) {
         if (mtcr_pciconf_rw(mf, offset + i, &(data[(i >> 2)]), rw)) {
             wrote_or_read = i;
             goto cleanup;
         }
     }
-cleanup:
-    mtcr_pciconf_cap9_sem(mf, 0);
+    cleanup: mtcr_pciconf_cap9_sem(mf, 0);
     return wrote_or_read;
 }
 
-static int
-mread4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
+static int mread4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
 {
     return block_op_pciconf(mf, offset, data, length, READ_OP);
 }
 
-static int
-mwrite4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
+static int mwrite4_block_pciconf(mfile *mf, unsigned int offset, u_int32_t* data, int length)
 {
     return block_op_pciconf(mf, offset, data, length, WRITE_OP);
 }
 
 int mtcr_pciconf_mread4_old(mfile *mf, unsigned int offset, u_int32_t *value)
 {
-    struct pciconf_context *ctx = mf->ctx;
+    ul_ctx_t *ctx = mf->ul_ctx;
     int rc;
     // adrianc: PCI registers always in le32
     offset = __cpu_to_le32(offset);
-    rc = _flock_int(mf->fdlock, LOCK_EX);
+    rc = _flock_int(ctx->fdlock, LOCK_EX);
     if (rc) {
         goto pciconf_read_cleanup;
     }
-    rc=pwrite(ctx->fd, &offset, 4, 22*4);
+    rc = pwrite(mf->fd, &offset, 4, 22 * 4);
     if (rc < 0) {
         perror("write offset");
         goto pciconf_read_cleanup;
@@ -988,27 +915,26 @@ int mtcr_pciconf_mread4_old(mfile *mf, unsigned int offset, u_int32_t *value)
         goto pciconf_read_cleanup;
     }
 
-    rc = pread(ctx->fd, value, 4, 23*4);
+    rc = pread(mf->fd, value, 4, 23 * 4);
     if (rc < 0) {
         perror("read value");
         goto pciconf_read_cleanup;
     }
     *value = __le32_to_cpu(*value);
-pciconf_read_cleanup:
-    _flock_int(mf->fdlock, LOCK_UN);
+    pciconf_read_cleanup: _flock_int(ctx->fdlock, LOCK_UN);
     return rc;
 }
 
 int mtcr_pciconf_mwrite4_old(mfile *mf, unsigned int offset, u_int32_t value)
 {
-    struct pciconf_context *ctx = mf->ctx;
+    ul_ctx_t *ctx = mf->ul_ctx;
     int rc;
     offset = __cpu_to_le32(offset);
-    rc = _flock_int(mf->fdlock, LOCK_EX);
+    rc = _flock_int(ctx->fdlock, LOCK_EX);
     if (rc) {
         goto pciconf_write_cleanup;
     }
-    rc = pwrite(ctx->fd, &offset, 4, 22*4);
+    rc = pwrite(mf->fd, &offset, 4, 22 * 4);
     if (rc < 0) {
         perror("write offset");
         goto pciconf_write_cleanup;
@@ -1018,98 +944,79 @@ int mtcr_pciconf_mwrite4_old(mfile *mf, unsigned int offset, u_int32_t value)
         goto pciconf_write_cleanup;
     }
     value = __cpu_to_le32(value);
-    rc = pwrite(ctx->fd, &value, 4, 23*4);
+    rc = pwrite(mf->fd, &value, 4, 23 * 4);
     if (rc < 0) {
         perror("write value");
         goto pciconf_write_cleanup;
     }
-pciconf_write_cleanup:
-    _flock_int(mf->fdlock, LOCK_UN);
+    pciconf_write_cleanup: _flock_int(ctx->fdlock, LOCK_UN);
     return rc;
 }
 
 static
 int mtcr_pciconf_mclose(mfile *mf)
 {
-    struct pciconf_context *ctx = mf->ctx;
     unsigned int word;
-    if (ctx) {
-        //TODO: apparently this read is useless here , need to check
-        // what happens if we remove it , (maybe something to do with ConnectX WA ??)
-        mread4(mf, 0xf0014, &word);
-        if (ctx->fd != -1) {
-            close(ctx->fd);
+    if (mf) {
+        // Adrianc: set address in PCI configuration space to be non-semaphore.
+        mread4_ul(mf, 0xf0014, &word);
+        if (mf->fd > 0) {
+            close(mf->fd);
         }
-        free(ctx);
-        mf->ctx = NULL;
     }
 
     return 0;
 }
 
 static
-int mtcr_pciconf_open(mfile *mf, const char *name)
+int mtcr_pciconf_open(mfile *mf, const char *name, u_int32_t adv_opt)
 {
-    int err;
-    int rc;
-    struct pciconf_context *ctx;
-
-    ctx = (struct pciconf_context*)malloc(sizeof(struct pciconf_context));
-    if (!ctx)
-        return 1;
-
-    mf->ctx = ctx;
-
-    ctx->fd = -1;
-    ctx->fd = open(name, O_RDWR | O_SYNC);
-    if (ctx->fd < 0) {
+    ul_ctx_t *ctx = mf->ul_ctx;
+    mf->fd = -1;
+    mf->fd = open(name, O_RDWR | O_SYNC);
+    if (mf->fd < 0) {
         return -1;
     }
 
-    mf->access_type   = MTCR_ACCESS_CONFIG;
+    mf->tp = MST_PCICONF;
 
     if ((mf->vsec_addr = pci_find_capability(mf, CAP_ID))) {
         // check if the needed spaces are supported
-        if (mtcr_pciconf_set_addr_space(mf, ICMD_DOMAIN) || \
-                mtcr_pciconf_set_addr_space(mf, SEMAPHORE_DOMAIN) || \
-                mtcr_pciconf_set_addr_space(mf, CR_SPACE_DOMAIN)) {
+        if (adv_opt & Clear_Vsec_Semaphore) {
+            mtcr_pciconf_cap9_sem(mf, 0);
+        }
+        if (mtcr_pciconf_cap9_sem(mf, 1)) {
+            close(mf->fd);
+            errno = EBUSY;
+            return -1;
+        }
+        if (mtcr_pciconf_set_addr_space(mf, ICMD_DOMAIN) || mtcr_pciconf_set_addr_space(mf, SEMAPHORE_DOMAIN)
+                || mtcr_pciconf_set_addr_space(mf, CR_SPACE_DOMAIN)) {
             mf->vsec_supp = 0;
         } else {
             mf->vsec_supp = 1;
         }
+        mtcr_pciconf_cap9_sem(mf, 0);
     }
 
     if (mf->vsec_supp) {
         mf->address_space = CR_SPACE_DOMAIN;
-        mf->mread4        = mtcr_pciconf_mread4;
-        mf->mwrite4       = mtcr_pciconf_mwrite4;
-        mf->mread4_block  = mread4_block_pciconf;
-        mf->mwrite4_block = mwrite4_block_pciconf;
+        ctx->mread4 = mtcr_pciconf_mread4;
+        ctx->mwrite4 = mtcr_pciconf_mwrite4;
+        ctx->mread4_block = mread4_block_pciconf;
+        ctx->mwrite4_block = mwrite4_block_pciconf;
     } else {
-        mf->mread4        = mtcr_pciconf_mread4_old;
-        mf->mwrite4       = mtcr_pciconf_mwrite4_old;
-        mf->mread4_block  = mread_chunk_as_multi_mread4;
-        mf->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
-    }
-    mf->mclose        = mtcr_pciconf_mclose;
-
-    rc = mtcr_check_signature(mf);
-    if (rc) {
-        rc = -1;
-        goto end;
-    }
-
-end:
-    if (rc) {
-        err = errno;
-        mtcr_pciconf_mclose(mf);
-        errno = err;
+        ctx->mread4 = mtcr_pciconf_mread4_old;
+        ctx->mwrite4 = mtcr_pciconf_mwrite4_old;
+        ctx->mread4_block = mread_chunk_as_multi_mread4;
+        ctx->mwrite4_block = mwrite_chunk_as_multi_mwrite4;
     }
-    return rc;
+    ctx->mclose = mtcr_pciconf_mclose;
+    return 0;
 }
 #else
 static
-int mtcr_pciconf_open(mfile *mf, const char *name)
+int mtcr_pciconf_open(mfile *mf, const char *name, u_int32_t adv_opt)
 {
     return -1;
 }
@@ -1119,21 +1026,24 @@ int mtcr_pciconf_open(mfile *mf, const char *name)
 // IN-BAND ACCESS FUNCTIONS
 //
 
-
 static
 int mtcr_inband_open(mfile* mf, const char* name)
 {
-
 #ifndef NO_INBAND
-    mf->access_type   = MTCR_ACCESS_INBAND;
-    mf->mread4        = mib_read4;
-    mf->mwrite4       = mib_write4;
-    mf->mread4_block  = mib_readblock;
-    mf->mwrite4_block = mib_writeblock;
-    mf->maccess_reg   = mib_acces_reg_mad;
-    mf->mclose        = mib_close;
-
-    return mib_open(name,mf,0);
+    ul_ctx_t *ctx = mf->ul_ctx;
+    mf->tp = MST_IB;
+    ctx->mread4 = mib_read4;
+    ctx->mwrite4 = mib_write4;
+    ctx->mread4_block = mib_readblock;
+    ctx->mwrite4_block = mib_writeblock;
+    ctx->maccess_reg = mib_acces_reg_mad;
+    ctx->mclose = mib_close;
+    char* p;
+    if ((p = strstr(name, "ibdr-")) != 0 || (p = strstr(name, "iblid-")) != 0 || (p = strstr(name, "lid-")) != 0) {
+        return mib_open(p, mf, 0);
+    } else {
+        return -1;
+    }
 
 #else
     (void) name;
@@ -1143,10 +1053,8 @@ int mtcr_inband_open(mfile* mf, const char* name)
 #endif
 }
 
-static
-enum mtcr_access_method mtcr_parse_name(const char* name, int *force,
-                        unsigned *domain_p, unsigned *bus_p,
-                        unsigned *dev_p, unsigned *func_p)
+static MType mtcr_parse_name(const char* name, int *force, unsigned *domain_p, unsigned *bus_p, unsigned *dev_p,
+        unsigned *func_p)
 {
     unsigned my_domain = 0;
     unsigned my_bus;
@@ -1163,54 +1071,49 @@ enum mtcr_access_method mtcr_parse_name(const char* name, int *force,
 
     if (len >= sizeof config && !strcmp(config, name + len + 1 - sizeof config)) {
         *force = 1;
-        return MTCR_ACCESS_CONFIG;
+        return MST_PCICONF;
     }
 
-    if (len >= sizeof resource0 &&
-        !strcmp(resource0, name + len + 1 - sizeof resource0)) {
+    if (len >= sizeof resource0 && !strcmp(resource0, name + len + 1 - sizeof resource0)) {
         *force = 1;
-        return MTCR_ACCESS_MEMORY;
+        return MST_PCI;
     }
 
-    if (!strncmp(name,"/proc/bus/pci/", sizeof procbuspci - 1)) {
+    if (!strncmp(name, "/proc/bus/pci/", sizeof procbuspci - 1)) {
         *force = 1;
-        return MTCR_ACCESS_CONFIG;
+        return MST_PCICONF;
     }
 
-    if (sscanf(name, "lid-%x", &tmp) == 1  ||
-        sscanf(name, "ibdr-%x", &tmp) == 1 ||
-        strstr(name, "lid-") != 0 || strstr(name, "ibdr-") != 0) {
+    if (sscanf(name, "lid-%x", &tmp) == 1 || sscanf(name, "ibdr-%x", &tmp) == 1 || strstr(name, "lid-") != 0
+            || strstr(name, "ibdr-") != 0) {
         *force = 1;
-        return MTCR_ACCESS_INBAND;
+        return MST_IB;
     }
 
-
-    if (sscanf(name, "mthca%x", &tmp) == 1 ||
-        sscanf(name, "mlx4_%x", &tmp) == 1 ||
-        sscanf(name, "mlx5_%x", &tmp) == 1) {
+    if (sscanf(name, "mthca%x", &tmp) == 1 || sscanf(name, "mlx4_%x", &tmp) == 1
+            || sscanf(name, "mlx5_%x", &tmp) == 1) {
         char mbuf[4048];
         char pbuf[4048];
         char *base;
 
         r = snprintf(mbuf, sizeof mbuf, "/sys/class/infiniband/%s/device", name);
-        if (r <= 0 || r >= (int)sizeof mbuf) {
-            fprintf(stderr,"Unable to print device name %s\n", name);
+        if (r <= 0 || r >= (int) sizeof mbuf) {
+            fprintf(stderr, "Unable to print device name %s\n", name);
             goto parse_error;
         }
 
         r = readlink(mbuf, pbuf, sizeof pbuf - 1);
         if (r < 0) {
             perror("read link");
-            fprintf(stderr,"Unable to read link %s\n", mbuf);
-            return MTCR_ACCESS_ERROR;
+            fprintf(stderr, "Unable to read link %s\n", mbuf);
+            return MST_ERROR;
         }
         pbuf[r] = '\0';
 
         base = basename(pbuf);
         if (!base)
             goto parse_error;
-        scnt = sscanf(base, "%x:%x:%x.%x",
-                  &my_domain, &my_bus, &my_dev, &my_func);
+        scnt = sscanf(base, "%x:%x:%x.%x", &my_domain, &my_bus, &my_dev, &my_func);
         if (scnt != 4)
             goto parse_error;
         if (sscanf(name, "mlx5_%x", &tmp) == 1) {
@@ -1231,10 +1134,22 @@ enum mtcr_access_method mtcr_parse_name(const char* name, int *force,
         goto name_parsed;
     }
 
+    scnt = sscanf(name, "pciconf-%x:%x.%x", &my_bus, &my_dev, &my_func);
+    if (scnt == 3) {
+        force_config = 1;
+        goto name_parsed;
+    }
+
+    scnt = sscanf(name, "pciconf-%x:%x:%x.%x", &my_domain, &my_bus, &my_dev, &my_func);
+    if (scnt == 4) {
+        force_config = 1;
+        goto name_parsed;
+    }
+
 parse_error:
-    fprintf(stderr,"Unable to parse device name %s\n", name);
+    fprintf(stderr, "Unable to parse device name %s\n", name);
     errno = EINVAL;
-    return MTCR_ACCESS_ERROR;
+    return MST_ERROR;
 
 name_parsed:
     *domain_p = my_domain;
@@ -1244,36 +1159,38 @@ name_parsed:
     *force = 0;
 #ifdef __aarch64__
     // on ARM processors MMAP not supported
-    (void)force_config; // avoid warrnings
-    return MTCR_ACCESS_CONFIG;
+    (void)force_config;
+    return MST_PCICONF;
 #else
     if (force_config) {
-        return MTCR_ACCESS_CONFIG;
+        return MST_PCICONF;
     }
-    return MTCR_ACCESS_MEMORY;
+    return MST_PCI;
 #endif
 }
 #endif
 
-int mread4_block (mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
+int mread4_block_ul(mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
 {
-    return mf->mread4_block(mf, offset, data, byte_len);
+    ul_ctx_t *ctx = mf->ul_ctx;
+    return ctx->mread4_block(mf, offset, data, byte_len);
 }
 
-int mwrite4_block (mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
+int mwrite4_block_ul(mfile *mf, unsigned int offset, u_int32_t* data, int byte_len)
 {
-    return mf->mwrite4_block(mf, offset, data, byte_len);
+    ul_ctx_t *ctx = mf->ul_ctx;
+    return ctx->mwrite4_block(mf, offset, data, byte_len);
 }
 
-int msw_reset(mfile *mf)
+int msw_reset_ul(mfile *mf)
 {
 #ifndef NO_INBAND
-    switch (mf->access_type) {
-    case MTCR_ACCESS_INBAND:
-        return mib_swreset(mf);
-    default:
-        errno = EPERM;
-        return -1;
+    switch (mf->tp) {
+        case MST_IB:
+            return mib_swreset(mf);
+        default:
+            errno = EPERM;
+            return -1;
     }
 #else
     (void)mf;
@@ -1281,49 +1198,96 @@ int msw_reset(mfile *mf)
 #endif
 }
 
-int mhca_reset(mfile *mf)
+int mhca_reset_ul(mfile *mf)
 {
-    (void)mf;
+    (void) mf;
     errno = ENOTSUP;
     return -1;
 }
 
+static long supported_dev_ids[] = {
+        /* CX2 */
+        0x6340, 0x634a, 0x6368, 0x6372,
+        0x6732, 0x673c, 0x6750, 0x675a,
+        0x676e, 0x6746, 0x6764,
+        /*****/
+        0x1003, //Connect-X3
+        0x1007, //Connect-X3Pro
+        0x1011, //Connect-IB
+        0x1013, //Connect-X4
+        0x1015, //Connect-X4Lx
+        0x1017, //Connect-X5
+        0xc738, //SwitchX
+        0xcb20, //Switch-IB
+        0xcb84, //Spectrum
+        0xcf08, //Switch-IB2
+        -1 };
+
+static long live_fish_id_database[] = {
+        0x191,
+        0x246,
+        0x249,
+        0x24b,
+        0x1F6,
+        0x1F8,
+        0x1FF,
+        0x247,
+        0x209,
+        0x20b,
+        0x20d,
+        -1
+};
+
+int is_supported_devid(long devid)
+{
+    int i = 0;
+    while (supported_dev_ids[i] != -1) {
+        if (devid == supported_dev_ids[i]) {
+            return 1;
+        }
+        i++;
+    }
+    i = 0;
+    while (live_fish_id_database[i] != -1) {
+        if (devid == live_fish_id_database[i]) {
+            return 1;
+        }
+        i++;
+    }
+    return 0;
+}
+
 int is_supported_device(char* devname)
 {
-    static char* unsupported_dev_ids[] = {
-            "0x0600", //FPGA
-            "-1"
-    };
+
     char fname[64];
-    char devid[64];
+    char inbuf[64];
     FILE* f;
-    int ret_val = 1;
-    int i = 0;
+    int ret_val = 0;
     sprintf(fname, "/sys/bus/pci/devices/%s/device", devname);
     f = fopen(fname, "r");
     if (f == NULL) {
         //printf("-D- Could not open file: %s\n", fname);
         return 1;
     }
-    if (fgets(devid, sizeof(devid), f)) {
-        while (strcmp(unsupported_dev_ids[i], "-1")) {
-            if (!strncmp(devid, unsupported_dev_ids[i], strlen(unsupported_dev_ids[i]))) {
-                //printf("-D- device: %s, with devid: %s is unsupported\n", devname, devid);
-                ret_val = 0;
-                break;
-            }
-            i++;
-        }
+    if (fgets(inbuf, sizeof(inbuf), f)) {
+        long devid = strtol(inbuf, NULL, 0);
+        ret_val = is_supported_devid(devid);
     }
     fclose(f);
     return ret_val;
 }
 
-int mdevices(char *buf, int len, int mask)
+int mdevices_ul(char *buf, int len, int mask)
+{
+    return mdevices_v_ul(buf, len, mask, 0);
+}
+
+int mdevices_v_ul(char *buf, int len, int mask, int verbosity)
 {
 
 #define MDEVS_TAVOR_CR  0x20
-#define MLNX_PCI_VENDOR_ID  "0x15b3"
+#define MLNX_PCI_VENDOR_ID  0x15b3
 
     FILE* f;
     DIR* d;
@@ -1350,9 +1314,9 @@ int mdevices(char *buf, int len, int mask)
             continue;
         }
         sz = strlen(dir->d_name);
-        if (sz > 2 && strcmp(dir->d_name + sz - 2, ".0")) {
+        if (sz > 2 && strcmp(dir->d_name + sz - 2, ".0") && !verbosity) {
             continue;
-        } else if (sz > 4 && strcmp(dir->d_name + sz - 4, "00.0")) {
+        } else if (sz > 4 && strcmp(dir->d_name + sz - 4, "00.0") && !verbosity) {
             // Skip virtual functions
             char physfn[64];
             DIR* physfndir;
@@ -1369,8 +1333,8 @@ int mdevices(char *buf, int len, int mask)
             goto cleanup_dir_opened;
         }
         if (fgets(inbuf, sizeof(inbuf), f)) {
-            if(!strncmp(inbuf, MLNX_PCI_VENDOR_ID, strlen(MLNX_PCI_VENDOR_ID)) &&
-                    is_supported_device(dir->d_name)) {
+            long venid = strtoul(inbuf, NULL, 0);
+            if (venid == MLNX_PCI_VENDOR_ID && is_supported_device(dir->d_name)) {
                 rsz = sz + 1; //dev name size + place for Null char
                 if ((pos + rsz) > len) {
                     ndevs = -1;
@@ -1401,7 +1365,7 @@ int read_pci_config_header(u_int16_t domain, u_int8_t bus, u_int8_t dev, u_int8_
     sprintf(proc_dev, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/config", domain, bus, dev, func);
     FILE* f = fopen(proc_dev, "r");
     if (!f) {
-        fprintf(stderr, "Failed to open (%s) for reading: %s\n", proc_dev, strerror(errno));
+        //fprintf(stderr, "Failed to open (%s) for reading: %s\n", proc_dev, strerror(errno));
         return 1;
     }
     setvbuf(f, NULL, _IONBF, 0);
@@ -1415,11 +1379,10 @@ int read_pci_config_header(u_int16_t domain, u_int8_t bus, u_int8_t dev, u_int8_
     return 0;
 }
 
-
 int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, unsigned my_func)
 {
     u_int8_t conf_header[0x40];
-    u_int32_t *conf_header_32p = (u_int32_t*)conf_header;
+    u_int32_t *conf_header_32p = (u_int32_t*) conf_header;
     if (read_pci_config_header(my_domain, my_bus, my_dev, my_func, conf_header)) {
         return 0;
     }
@@ -1429,9 +1392,111 @@ int check_force_config(unsigned my_domain, unsigned my_bus, unsigned my_dev, uns
     }
     return 1;
 }
+#define IB_INF "infiniband:"
+#define ETH_INF "net:"
 
+static char** get_ib_net_devs(int domain, int bus, int dev, int func, int ib_eth_)
+{
+    char** ib_net_devs = NULL;
+    int i;
+    int count = 0;
+    int plan_b = 0;
+    DIR           *dir;
+    struct dirent *dirent;
+    char** ib_net_devs_r;
+    char sysfs_path[256];
+    DIR* physfndir;
+    /* Check that the DBDF is not for Virtual function */
+    sprintf(sysfs_path, "/sys/bus/pci/devices/%04x:%02x:%02x.%x/physfn", domain, bus, dev, func);
+    if ((physfndir = opendir(sysfs_path)) != NULL) {
+        closedir(physfndir);
+        return NULL;
+    }
+    if (ib_eth_)
+        sprintf(sysfs_path, "/sys/bus/pci/devices/%04x:%02x:%02x.%x/infiniband", domain, bus, dev, func);
+    else
+        sprintf(sysfs_path, "/sys/bus/pci/devices/%04x:%02x:%02x.%x/net", domain, bus, dev, func);
 
-dev_info* mdevices_info(int mask, int* len)
+    if ((dir = opendir(sysfs_path)) == NULL) {
+        sprintf(sysfs_path, "/sys/bus/pci/devices/%04x:%02x:%02x.%x", domain, bus, dev, func);
+        if ((dir = opendir(sysfs_path)) == NULL) {
+            return NULL;
+        }
+        plan_b = 1;
+    }
+    while ((dirent = readdir(dir)) != NULL) {
+        char *name = dirent->d_name;
+        if (!strcmp(name, ".") || !strcmp(name, ".."))
+            continue;
+        if (plan_b) {
+            char* p = NULL;
+            char* devs_inf = ib_eth_ ? IB_INF : ETH_INF;
+            p = strstr(name, devs_inf);
+            if (! p) {
+                continue;
+            }
+            name = p + strlen(devs_inf);
+        }
+        count++;
+        ib_net_devs_r = (char**)realloc(ib_net_devs, (count+1)*sizeof(char*));
+        if (!ib_net_devs_r) {
+            closedir(dir);
+            goto mem_error;
+        }
+        ib_net_devs = ib_net_devs_r;
+
+        ib_net_devs[count - 1] = (char*)malloc(strlen(name) + 1);
+        if (!ib_net_devs[count - 1]) {
+            closedir(dir);
+            goto mem_error;
+        }
+        strcpy(ib_net_devs[count - 1], name);
+
+        // Set last entry to NULL
+        ib_net_devs[count] = NULL;
+    }
+    closedir(dir);
+    return ib_net_devs;
+
+mem_error:
+    fprintf(stderr, "Memory allocation failure for ib/net devices\n");
+    if (ib_net_devs) {
+        for (i = 0; i < count; i++) {
+            if (ib_net_devs[i])
+                free(ib_net_devs[i]);
+        }
+
+        free(ib_net_devs);
+    }
+
+    return NULL;
+}
+
+static void get_numa_node(u_int16_t domain, u_int8_t bus, u_int8_t dev, u_int8_t func, char* data)
+{
+    char numa_path[64];
+    int c;
+    int i = 0;
+    sprintf(numa_path, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/numa_node", domain, bus, dev, func);
+    FILE* f = fopen(numa_path, "rb");
+    if (!f) {
+        strcpy(data, "NA");
+        return;
+    }
+
+    while((c = getc(f)) != EOF && c != '\n') {
+        data[i++] = c;
+    }
+    data[i] = '\0';
+    fclose(f);
+}
+
+dev_info* mdevices_info_ul(int mask, int* len)
+{
+    return mdevices_info_v_ul(mask, len, 0);
+}
+
+dev_info* mdevices_info_v_ul(int mask, int* len, int verbosity)
 {
     char* devs = 0;
     char* dev_name;
@@ -1445,20 +1510,20 @@ dev_info* mdevices_info(int mask, int* len)
             free(devs);
         }
         size *= 2;
-        devs = (char*)malloc(size);
-        rc = mdevices(devs, size, mask);
+        devs = (char*) malloc(size);
+        rc = mdevices_v_ul(devs, size, mask, verbosity);
     } while (rc == -1);
 
-    if ( rc <= 0 ) {
-        len = 0;
+    if (rc <= 0) {
+        *len = 0;
         if (devs) {
             free(devs);
         }
         return NULL;
     }
     // For each device read
-    dev_info* dev_info_arr = (dev_info*) malloc(sizeof(dev_info)*rc);
-    memset(dev_info_arr, 0, sizeof(dev_info)*rc);
+    dev_info* dev_info_arr = (dev_info*) malloc(sizeof(dev_info) * rc);
+    memset(dev_info_arr, 0, sizeof(dev_info) * rc);
     dev_name = devs;
     for (i = 0; i < rc; i++) {
         int domain = 0;
@@ -1466,9 +1531,10 @@ dev_info* mdevices_info(int mask, int* len)
         int dev = 0;
         int func = 0;
 
-        dev_info_arr[i].type = (Mdevs)MDEVS_TAVOR_CR;
+        dev_info_arr[i].ul_mode = 1;
+        dev_info_arr[i].type = (Mdevs) MDEVS_TAVOR_CR;
         u_int8_t conf_header[0x40];
-        u_int32_t *conf_header_32p = (u_int32_t*)conf_header;
+        u_int32_t *conf_header_32p = (u_int32_t*) conf_header;
 
         // update default device name
         strncpy(dev_info_arr[i].dev_name, dev_name, sizeof(dev_info_arr[i].dev_name) - 1);
@@ -1487,6 +1553,16 @@ dev_info* mdevices_info(int mask, int* len)
         dev_info_arr[i].pci.dev = dev;
         dev_info_arr[i].pci.func = func;
 
+        // set pci conf device
+        snprintf(dev_info_arr[i].pci.conf_dev, sizeof(dev_info_arr[i].pci.conf_dev),
+                "/sys/bus/pci/devices/%04x:%02x:%02x.%x/config", domain, bus, dev, func);
+
+
+        // Get attached infiniband devices
+        dev_info_arr[i].pci.ib_devs  = get_ib_net_devs(domain, bus, dev, func, 1);
+        dev_info_arr[i].pci.net_devs = get_ib_net_devs(domain, bus, dev, func, 0);
+        get_numa_node(domain, bus, dev, func, (char*)(dev_info_arr[i].pci.numa_node));
+
         // read configuration space header
         if (read_pci_config_header(domain, bus, dev, func, conf_header)) {
             goto next;
@@ -1498,10 +1574,7 @@ dev_info* mdevices_info(int mask, int* len)
         dev_info_arr[i].pci.subsys_id = __le32_to_cpu(conf_header_32p[11]) >> 16;
         dev_info_arr[i].pci.subsys_vend_id = __le32_to_cpu(conf_header_32p[11]) & 0xffff;
 
-        // set pci conf device
-        snprintf(dev_info_arr[i].pci.conf_dev, sizeof(dev_info_arr[i].pci.conf_dev), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/config", domain, bus,dev, func);
-        //Copy to dev_name as default device
-        snprintf(dev_info_arr[i].dev_name, sizeof(dev_info_arr[i].dev_name), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/config", domain, bus,dev, func);
+
 
 next:
         dev_name += strlen(dev_name) + 1;
@@ -1513,90 +1586,179 @@ next:
 }
 
 
-void mdevices_info_destroy(dev_info* dev_info, int len)
+void mdevices_info_destroy_ul(dev_info* dev_info, int len)
 {
-    (void)len;
-    if (dev_info)
+    int i, j;
+    if (dev_info) {
+        for (i = 0; i < len; i++) {
+            if (dev_info[i].type == MDEVS_TAVOR_CR &&
+                dev_info[i].pci.ib_devs) {
+                for (j = 0; dev_info[i].pci.ib_devs[j]; j++) {
+                    if (dev_info[i].pci.ib_devs[j]) {
+                        free(dev_info[i].pci.ib_devs[j]);
+                    }
+                }
+                free(dev_info[i].pci.ib_devs);
+            }
+            if (dev_info[i].type == MDEVS_TAVOR_CR &&
+                dev_info[i].pci.net_devs) {
+                for (j = 0; dev_info[i].pci.net_devs[j]; j++) {
+                    if (dev_info[i].pci.net_devs[j]) {
+                        free(dev_info[i].pci.net_devs[j]);
+                    }
+                }
+                free(dev_info[i].pci.net_devs);
+            }
+
+        }
         free(dev_info);
+    }
+}
+
+/*
+ * This function used to change from running on CONF to CR
+ * and vice versa
+ */
+
+extern void mpci_change(mfile* mf)
+{
+    mf->mpci_change(mf);
+    return;
 }
 
-mfile *mopen(const char *name)
+ void mpci_change_ul(mfile* mf)
+{
+    if (mf->res_tp == MST_PCICONF) {
+        mf->res_tp = MST_PCI;
+        mf->tp = MST_PCICONF;
+    } else if (mf->res_tp == MST_PCI) {
+        mf->res_tp = MST_PCICONF;
+        mf->tp = MST_PCI;
+    } else {
+        return;
+    }
+    ul_ctx_t* ctx = mf->ul_ctx;
+    /***** Switching READ WRITE FUNCS ******/
+    f_mread4 tmp_mread4 = ctx->mread4;
+    ctx->mread4 = ctx->res_mread4;
+    ctx->res_mread4 = tmp_mread4;
+
+    f_mwrite4 tmp_mwrite4 = ctx->mwrite4;
+    ctx->mwrite4 = ctx->res_mwrite4;
+    ctx->res_mwrite4 = tmp_mwrite4;
+
+    f_mread4_block tmp_mread4_block = ctx->mread4_block;
+    ctx->mread4_block = ctx->res_mread4_block;
+    ctx->res_mread4_block = tmp_mread4_block;
+
+    f_mwrite4_block tmp_mwrite4_block = ctx->mwrite4_block;
+    ctx->mwrite4_block = ctx->res_mwrite4_block;
+    ctx->res_mwrite4_block = tmp_mwrite4_block;
+
+    /***** Switching FD LOCKs ******/
+    int tmp_lock = ctx->res_fdlock;
+    ctx->res_fdlock = ctx->fdlock;
+    ctx->fdlock = tmp_lock;
+    /***** Switching FDs ******/
+    int fd = mf->fd;
+    mf->fd = mf->res_fd;
+    mf->res_fd = fd;
+}
+
+mfile *mopen_ul_int(const char *name, u_int32_t adv_opt)
 {
     mfile *mf;
     off_t offset;
     unsigned domain = 0, bus = 0, dev = 0, func = 0;
-    mtcr_access_method_t access;
+    MType dev_type;
     int force;
     char rbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/resource0";
     char cbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/config";
     char pdbuf[] = "/proc/bus/pci/XXXX:XX/XX.X";
     char pbuf[] = "/proc/bus/pci/XX/XX.X";
-    char errbuf[4048]="";
+    char pcidev[] = "XXXX:XX:XX.X";
     int err;
     int rc;
 
     if (geteuid() != 0) {
-    	errno = EACCES;
-    	return NULL;
+        errno = EACCES;
+        return NULL;
     }
-    mf = (mfile *)malloc(sizeof(mfile));
-    if (!mf)
+    mf = (mfile *) malloc(sizeof(mfile));
+    if (!mf) {
         return NULL;
-
+    }
     memset(mf, 0, sizeof(mfile));
+    mf->ul_ctx = malloc (sizeof(ul_ctx_t));
+    if (!(mf->ul_ctx)) {
+        goto open_failed;
+    }
+    memset(mf->ul_ctx, 0, sizeof(ul_ctx_t));
     mf->dev_name = strdup(name);
-    if (!mf->dev_name)
+    if (!mf->dev_name) {
         goto open_failed;
-
-    access = mtcr_parse_name(name, &force, &domain, &bus, &dev, &func);
-    if (access == MTCR_ACCESS_ERROR)
+    }
+    mf->sock = -1; // we are not opening remotely
+    mf->fd = -1;
+    mf->res_fd = -1;
+    mf->mpci_change = mpci_change_ul;
+    dev_type = mtcr_parse_name(name, &force, &domain, &bus, &dev, &func);
+    if (dev_type == MST_ERROR) {
         goto open_failed;
-
-    if (access == MTCR_ACCESS_CONFIG || access == MTCR_ACCESS_MEMORY) {
+    }
+    mf->tp = dev_type;
+    mf->flags = MDEVS_TAVOR_CR;
+    if (dev_type == MST_PCICONF || dev_type == MST_PCI) {
         // allocate lock to sync between parallel cr space requests (CONF/MEMORY only)
         if (force) {
             // need to extract the dbdf format from the full name
-            if (_extract_dbdf_from_full_name(name, &domain, &bus, &dev, &func)){
+            if (_extract_dbdf_from_full_name(name, &domain, &bus, &dev, &func)) {
                 goto open_failed;
             }
         }
-        if (_create_lock(mf, domain, bus, dev, func , access)) {
+        if (_create_lock(mf, domain, bus, dev, func)) {
             goto open_failed;
         }
-    }
 
-    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config",
-        domain, bus, dev, func);
+        sprintf(pcidev, "%4.4x:%2.2x:%2.2x.%1.1x", domain, bus, dev, func);
+        if (!is_supported_device(pcidev)) {
+            errno = ENOTSUP;
+            goto open_failed;
+        }
 
-    if (force) {
-        switch (access) {
-        case MTCR_ACCESS_CONFIG:
-            rc = mtcr_pciconf_open(mf, name);
-            break;
-        case MTCR_ACCESS_MEMORY:
-            rc = mtcr_pcicr_open(mf, name, cbuf, 0, 0);
-            break;
-        case MTCR_ACCESS_INBAND:
-            rc = mtcr_inband_open(mf, name);
-            break;
-        default:
+        if (init_dev_info_ul(mf, name, domain, bus, dev, func)) {
             goto open_failed;
         }
+    }
+    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config", domain, bus, dev, func);
+
+    if (force) {
+        switch (dev_type) {
+            case MST_PCICONF:
+                rc = mtcr_pciconf_open(mf, name, adv_opt);
+                break;
+            case MST_PCI:
+                rc = mtcr_pcicr_open(mf, name, cbuf, 0, 0, adv_opt);
+                break;
+            case MST_IB:
+                rc = mtcr_inband_open(mf, name);
+                break;
+            default:
+                goto open_failed;
+        }
 
         if (0 == rc) {
             return mf;
-        } else {
-            goto open_failed;
         }
+        goto open_failed;
     }
 
-    if (access == MTCR_ACCESS_CONFIG)
+    if (dev_type == MST_PCICONF)
         goto access_config_forced;
 
-    sprintf(rbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource0",
-        domain, bus, dev, func);
+    sprintf(rbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/resource0", domain, bus, dev, func);
 
-    rc = mtcr_pcicr_open(mf, rbuf, cbuf, 0, 0);
+    rc = mtcr_pcicr_open(mf, rbuf, cbuf, 0, 0, adv_opt);
     if (rc == 0) {
         return mf;
     } else if (rc == 1) {
@@ -1608,186 +1770,178 @@ mfile *mopen(const char *name)
     if (offset == -1 && !domain)
         offset = mtcr_procfs_get_offset(bus, dev, func);
     if (offset == -1)
-        goto access_config;
+        goto access_config_forced;
 
-    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x",
-        domain, bus, dev, func);
-    rc = mtcr_pcicr_open(mf, pdbuf, cbuf, offset, 1);
+    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x", domain, bus, dev, func);
+    rc = mtcr_pcicr_open(mf, pdbuf, cbuf, offset, 1, adv_opt);
     if (rc == 0) {
         return mf;
     } else if (rc == 1) {
-        goto access_config;
+        goto access_config_forced;
     }
 
     if (!domain) {
-        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x",
-            bus, dev, func);
-        rc = mtcr_pcicr_open(mf, pbuf, cbuf, offset, 1);
+        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x", bus, dev, func);
+        rc = mtcr_pcicr_open(mf, pbuf, cbuf, offset, 1, adv_opt);
         if (rc == 0) {
             return mf;
         } else if (rc == 1) {
-            goto access_config;
+            goto access_config_forced;
         }
     }
 
 #if CONFIG_USE_DEV_MEM
     /* Non-portable, but helps some systems */
-    if (!mtcr_pcicr_open(mf, "/dev/mem", cbuf, offset, 0))
+    if (!mtcr_pcicr_open(mf, "/dev/mem", cbuf, offset, 0, adv_opt))
         return mf;
 #endif
 
-access_config:
-#if CONFIG_ENABLE_PCICONF && CONFIG_ENABLE_PCICONF
-    strerror_r(errno, errbuf, sizeof errbuf);
-    fprintf(stderr,
-            "Warning: memory access to device %s failed: %s. Switching to PCI config access.\n",
-            name, errbuf);
-#endif
-
 access_config_forced:
-
-    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config",
-        domain, bus, dev, func);
-    if (!mtcr_pciconf_open(mf, cbuf))
+    sprintf(cbuf, "/sys/bus/pci/devices/%4.4x:%2.2x:%2.2x.%1.1x/config", domain, bus, dev, func);
+    if (!mtcr_pciconf_open(mf, cbuf, adv_opt))
         return mf;
 
-    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x",
-        domain, bus, dev, func);
-    if (!mtcr_pciconf_open(mf, pdbuf))
+    sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x", domain, bus, dev, func);
+    if (!mtcr_pciconf_open(mf, pdbuf, adv_opt))
         return mf;
 
     if (!domain) {
-        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x",
-            bus, dev, func);
-        if (!mtcr_pciconf_open(mf, pdbuf))
+        sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x", bus, dev, func);
+        if (!mtcr_pciconf_open(mf, pdbuf, adv_opt))
             return mf;
     }
 
 open_failed:
-        err = errno;
-        mclose(mf);
-        errno = err;
-        return NULL;
-}
-
-
-mfile *mopend(const char *name, int type)
-{
-    if (type != 1) {
-        return NULL;
-    }
-    return mopen(name);
+    err = errno;
+    mclose_ul(mf);
+    errno = err;
+    return NULL;
 }
 
-int mclose(mfile *mf)
+int init_dev_info_ul(mfile* mf, const char* dev_name, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 {
-    if (mf != NULL){
-        if (mf->mclose != NULL && mf->ctx != NULL) {
-            // close icmd if if needed
-            if (mf->icmd.icmd_opened) {
-                icmd_close(mf);
+    int i;
+    int devs_len;
+    int ret = 0;
+    dev_info* devs = mdevices_info_v_ul(0xffffffff, &devs_len, 1);
+    for (i = 0; i < devs_len; i++) {
+        if (devs[i].pci.domain == domain &&
+            devs[i].pci.bus == bus &&
+            devs[i].pci.dev == dev &&
+            devs[i].pci.func == func) {
+                break;
             }
-            mf->mclose(mf);
-        }
-        if (mf->dev_name) {
-            free(mf->dev_name);
-        }
-        if (mf->fdlock) {
-            close(mf->fdlock);
-        }
-        if (mf->res_fdlock) {
-            close(mf->res_fdlock);
-        }
-        free(mf);
     }
-    return 0;
-}
 
-extern void mpci_change(mfile* mf)
-{
-    if (!mf->res_ctx) {
-        return;
-    }
-    if (mf->res_access_type == MTCR_ACCESS_CONFIG) {
-        mf->res_access_type = MTCR_ACCESS_MEMORY;
-        mf->access_type     = MTCR_ACCESS_CONFIG;
-    } else if (mf->res_access_type == MTCR_ACCESS_MEMORY) {
-        mf->res_access_type = MTCR_ACCESS_CONFIG;
-        mf->access_type     = MTCR_ACCESS_MEMORY;
-    } else {
-        return;
+    if (i == devs_len) {
+        ret = 1;
+        goto cleanup;
     }
 
-    /***** Switching READ WRITE FUNCS ******/
-    f_mread4 tmp_mread4 = mf->mread4;
-    mf->mread4 = mf->res_mread4;
-    mf->res_mread4 = tmp_mread4;
+    mf->dinfo = malloc(sizeof(*mf->dinfo));
+    if (!mf->dinfo) {
+        errno = ENOMEM;
+        ret = 2;
+        goto cleanup;
+    }
 
-    f_mwrite4 tmp_mwrite4 = mf->mwrite4;
-    mf->mwrite4 = mf->res_mwrite4;
-    mf->res_mwrite4 = tmp_mwrite4;
+    memcpy(mf->dinfo, &devs[i], sizeof(*mf->dinfo));
+    strncpy(mf->dinfo->dev_name, dev_name, sizeof(mf->dinfo->dev_name)/sizeof(mf->dinfo->dev_name[0])-1);
+    if (mf->dinfo->type == MDEVS_TAVOR_CR) {
+        if (devs[i].pci.ib_devs) {
+            // count ib devs
+            int j;
+            char** curr = devs[i].pci.ib_devs;
+            int cnt = 0;
+            while (*(curr++)) {
+                cnt++;
+            }
 
-    f_mread4_block tmp_mread4_block = mf->mread4_block;
-    mf->mread4_block = mf->res_mread4_block;
-    mf->res_mread4_block = tmp_mread4_block;
+            mf->dinfo->pci.ib_devs = malloc((cnt + 1) * sizeof(char*));
+            if (!mf->dinfo->pci.ib_devs) {
+                errno = ENOMEM;
+                free(mf->dinfo);
+                ret = 3;
+                goto cleanup;
+            }
 
-    f_mwrite4_block  tmp_mwrite4_block = mf->mwrite4_block;
-    mf->mwrite4_block = mf->res_mwrite4_block;
-    mf->res_mwrite4_block = tmp_mwrite4_block;
+            for (j = 0; j < cnt; j++) {
+                mf->dinfo->pci.ib_devs[j] = malloc(strlen(devs[i].pci.ib_devs[j]) + 1);
+                strcpy(mf->dinfo->pci.ib_devs[j], devs[i].pci.ib_devs[j]);
+            }
+            mf->dinfo->pci.ib_devs[cnt] = NULL;
+        }
 
-    /***** Switching FD LOCKs ******/
-    int tmp_lock = mf->res_fdlock;
-    mf->res_fdlock = mf->fdlock;
-    mf->fdlock = tmp_lock;
+        if (devs[i].pci.net_devs) {
+            // count net devs
+            int j;
+            char** curr = devs[i].pci.net_devs;
+            int cnt = 0;
+            while (*(curr++)) {
+                cnt++;
+            }
 
-    /***** Switching CNTX ******/
-    void* tmp_ctx = mf->res_ctx;
-    mf->res_ctx = mf->ctx;
-    mf->ctx = tmp_ctx;
-}
+            mf->dinfo->pci.net_devs = malloc((cnt + 1) * sizeof(char*));
+            if (!mf->dinfo->pci.net_devs) {
+                errno = ENOMEM;
+                if (mf->dinfo->pci.ib_devs) {
+                    free(mf->dinfo->pci.ib_devs);
+                }
+                free(mf->dinfo);
+                ret = 4;
+                goto cleanup;
+            }
 
-mfile *mopen_fw_ctx(void* fw_cmd_context, void* fw_cmd_func, void* extra_data)
-{
-	// not implemented
-    TOOLS_UNUSED(fw_cmd_context);
-    TOOLS_UNUSED(fw_cmd_func);
-    TOOLS_UNUSED(extra_data);
-	return NULL;
-}
+            for (j = 0; j < cnt; j++) {
+                mf->dinfo->pci.net_devs[j] = malloc(strlen(devs[i].pci.net_devs[j]) + 1);
+                strcpy(mf->dinfo->pci.net_devs[j], devs[i].pci.net_devs[j]);
+            }
+            mf->dinfo->pci.net_devs[cnt] = NULL;
+        }
+    }
 
-unsigned char mset_i2c_slave(mfile *mf, unsigned char new_i2c_slave)
-{
-    (void)mf;
-    (void)new_i2c_slave; /* compiler warning */
-    fprintf(stderr, "Warning: libmtcr: mset_i2c_slave() is not implemented and has no effect.\n");
-    return 0;
+    cleanup:
+    mdevices_info_destroy_ul(devs, devs_len);
+    return ret;
 }
 
 
-int mget_mdevs_flags(mfile *mf, u_int32_t *devs_flags)
+mfile *mopen_ul(const char *name)
 {
-    switch (mf->access_type) {
-    case MTCR_ACCESS_INBAND: *devs_flags = MDEVS_IB; break;
-    case MTCR_ACCESS_MEMORY:
-    case MTCR_ACCESS_CONFIG: *devs_flags = MDEVS_TAVOR_CR; break;
-    default:
-        return -1;
-    }
-    return 0;
+    mfile* mf = mopen_ul_int(name, 0);
+
+    return mf;
 }
 
-int mget_mdevs_type(mfile *mf, u_int32_t *mtype)
+int mclose_ul(mfile *mf)
 {
-    if (mf == NULL || mtype == NULL) {
-        errno = EINVAL;
-        return 1;
-    }
+    if (mf != NULL) {
+        ul_ctx_t *ctx = mf->ul_ctx;
+        if (ctx) {
+            if (ctx->mclose != NULL) {
+                // close icmd if if needed
+                if (mf->icmd.icmd_opened) {
+                    icmd_close(mf);
+                }
+                ctx->mclose(mf);
+            }
 
-    *mtype = mf->access_type;
+            if (ctx->fdlock) {
+                close(ctx->fdlock);
+            }
+            if (ctx->res_fdlock) {
+                close(ctx->res_fdlock);
+            }
+            free(ctx);
+        }
+        if (mf->dev_name) {
+            free(mf->dev_name);
+        }
+        free(mf);
+    }
     return 0;
 }
 
-
 #define IBDR_MAX_NAME_SIZE 128
 #define BDF_NAME_SIZE 12
 #define DEV_DIR_MAX_SIZE 128
@@ -1796,13 +1950,13 @@ int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
 {
     unsigned domain = 0, bus = 0, dev = 0, func = 0;
     int force = 0;
-    enum mtcr_access_method access;
+    MType dev_type;
     DIR* d;
     struct dirent *dir;
     char dirname[DEV_DIR_MAX_SIZE], subdirname[DEV_DIR_MAX_SIZE], linkname[DEV_DIR_MAX_SIZE];
     int found = 0;
 
-    access = mtcr_parse_name(pci_dev, &force, &domain, &bus, &dev, &func);
+    dev_type = mtcr_parse_name(pci_dev, &force, &domain, &bus, &dev, &func);
 
     strcpy(dirname, "/sys/class/infiniband");
     d = opendir(dirname);
@@ -1810,7 +1964,7 @@ int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
         errno = ENODEV;
         return -2;
     }
-  
+
     while ((dir = readdir(d)) != NULL) {
         unsigned curr_domain = 0, curr_bus = 0, curr_dev = 0, curr_func = 0;
         int curr_force = 0, link_size;
@@ -1819,8 +1973,9 @@ int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
         }
         sprintf(subdirname, "%s/%s/device", dirname, dir->d_name);
         link_size = readlink(subdirname, linkname, DEV_DIR_MAX_SIZE);
-        access = mtcr_parse_name(&linkname[link_size - BDF_NAME_SIZE], &curr_force, &curr_domain, &curr_bus, &curr_dev, &curr_func);
-                 
+        dev_type = mtcr_parse_name(&linkname[link_size - BDF_NAME_SIZE], &curr_force, &curr_domain, &curr_bus,
+                &curr_dev, &curr_func);
+
         if (domain == curr_domain && bus == curr_bus && dev == curr_dev && func == curr_func) {
             sprintf(inband_dev, "ibdr-0,%s,1", dir->d_name);
             found = 1;
@@ -1829,7 +1984,7 @@ int get_inband_dev_from_pci(char* inband_dev, char* pci_dev)
     }
 
     closedir(d);
-    (void)access; // avoid compiler warrnings
+    (void) dev_type; // avoid compiler warrnings
     if (found) {
         return 0;
     } else {
@@ -1849,7 +2004,7 @@ int reopen_pci_as_inband(mfile* mf)
         return -1;
     }
 
-    mf->mclose(mf);
+    ((ul_ctx_t*)mf->ul_ctx)->mclose(mf);
     free(mf->dev_name);
     mf->dev_name = strdup(inband_dev);
 
@@ -1857,7 +2012,7 @@ int reopen_pci_as_inband(mfile* mf)
     return rc;
 }
 
-int maccess_reg_mad(mfile *mf, u_int8_t *data)
+int maccess_reg_mad_ul(mfile *mf, u_int8_t *data)
 {
     int rc;
 
@@ -1865,7 +2020,7 @@ int maccess_reg_mad(mfile *mf, u_int8_t *data)
         return ME_BAD_PARAMS;
     }
 
-    if (mf->access_type != MTCR_ACCESS_INBAND) {
+    if (mf->tp != MST_IB) {
         // Close current device and re-open as inband
         rc = reopen_pci_as_inband(mf);
         if (rc) {
@@ -1874,51 +2029,31 @@ int maccess_reg_mad(mfile *mf, u_int8_t *data)
         }
     }
 
-    return mf->maccess_reg(mf, data);
-}
-
-int mos_reg_access(mfile *mf, int reg_access, void *reg_data, u_int32_t cmd_type)
-{
-    (void)mf;
-    (void)reg_data; /* compiler warning */
-    (void)cmd_type; /* compiler warning */
-    (void)reg_access; /* compiler warning */
-    fprintf(stderr, "Warning: libmtcr: mos_reg_access() is not implemented and has no effect.\n");
-    return ME_NOT_IMPLEMENTED;
-}
-
-int maccess_reg_cmdif(mfile *mf, reg_access_t reg_access, void *reg_data, u_int32_t cmd_type)
-{
-    (void)mf;
-    (void)reg_data; /* compiler warning */
-    (void)cmd_type; /* compiler warning */
-    (void)reg_access; /* compiler warning */
-    fprintf(stderr, "Warning: libmtcr: maccess_reg_cmdif() is not implemented and has no effect.\n");
-    return ME_NOT_IMPLEMENTED;
+    return ((ul_ctx_t*)mf->ul_ctx)->maccess_reg(mf, data);
 }
 
 static void mtcr_fix_endianness(u_int32_t *buf, int len)
 {
     int i;
 
-    for (i = 0; i < (len/4); ++i) {
+    for (i = 0; i < (len / 4); ++i) {
         buf[i] = __be32_to_cpu(buf[i]);
     }
 }
 
-int mread_buffer(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
+int mread_buffer_ul(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
 {
     int rc;
-    rc = mread4_block(mf, offset, (u_int32_t*)data, byte_len);
-    mtcr_fix_endianness((u_int32_t*)data, byte_len);
+    rc = mread4_block_ul(mf, offset, (u_int32_t*) data, byte_len);
+    mtcr_fix_endianness((u_int32_t*) data, byte_len);
     return rc;
 
 }
 
-int mwrite_buffer(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
+int mwrite_buffer_ul(mfile *mf, unsigned int offset, u_int8_t* data, int byte_len)
 {
-    mtcr_fix_endianness((u_int32_t*)data, byte_len);
-    return mwrite4_block(mf, offset, (u_int32_t*)data, byte_len);
+    mtcr_fix_endianness((u_int32_t*) data, byte_len);
+    return mwrite4_block_ul(mf, offset, (u_int32_t*) data, byte_len);
 }
 
 /*
@@ -1933,11 +2068,7 @@ enum {
     MAD_CLASS_REG_ACCESS = 1,
 };
 enum {
-    TLV_END       = 0,
-    TLV_OPERATION = 1,
-    TLV_DR        = 2,
-    TLV_REG       = 3,
-    TLV_USER_DATA = 4,
+    TLV_END = 0, TLV_OPERATION = 1, TLV_DR = 2, TLV_REG = 3, TLV_USER_DATA = 4,
 };
 
 #define REGISTER_HEADERS_SIZE 12
@@ -1949,99 +2080,100 @@ static int supports_icmd(mfile* mf);
 static int supports_tools_cmdif_reg(mfile* mf);
 static int init_operation_tlv(struct OperationTlv *operation_tlv, u_int16_t reg_id, u_int8_t method);
 static int mreg_send_wrapper(mfile* mf, u_int8_t *data, int r_icmd_size, int w_icmd_size);
-static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t  reg_size, u_int32_t r_size_reg, u_int32_t	w_size_reg, int *reg_status);
-int mget_max_reg_size(mfile *mf);
+static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t reg_size,
+        u_int32_t r_size_reg, u_int32_t w_size_reg, int *reg_status);
+
 
 // maccess_reg: Do a reg_access for the mf device.
 // - reg_data is both in and out
 // TODO: When the reg operation succeeds but the reg status is != 0,
 //       a specific
 
-int maccess_reg(mfile     *mf,
-                u_int16_t  reg_id,
-                maccess_reg_method_t reg_method,
-                void*      reg_data,
-                u_int32_t  reg_size,
-                u_int32_t	r_size_reg,
-                u_int32_t	w_size_reg,
-                int       *reg_status)
+int maccess_reg_ul(mfile *mf,
+        u_int16_t reg_id,
+        maccess_reg_method_t reg_method,
+        void*     reg_data,
+        u_int32_t reg_size,
+        u_int32_t r_size_reg,
+        u_int32_t w_size_reg,
+        int*      reg_status)
 {
     int rc;
     if (mf == NULL || reg_data == NULL || reg_status == NULL || reg_size <= 0) {
         return ME_BAD_PARAMS;
     }
     // check register size
-    unsigned int max_size = (unsigned int)mget_max_reg_size(mf);
-    if ( reg_size > (unsigned int)max_size) {
-    	//reg too big
-    	return ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT;
+    unsigned int max_size = (unsigned int) mget_max_reg_size_ul(mf);
+    if (reg_size > (unsigned int) max_size) {
+        //reg too big
+        return ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT;
     }
 #ifndef MST_UL
     // TODO: add specific checks for each FW access method where needed
-    if (mf->flags & MDEVS_MLNX_OS){
-    	rc = mos_reg_access_raw(mf, reg_id, reg_method, reg_data, reg_size, reg_status);
-    } else if ((mf->flags & (MDEVS_IB | MDEVS_FWCTX)) || (mf->flags != MDEVS_IB && (supports_icmd(mf) || supports_tools_cmdif_reg(mf)))) {
-    	rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
-    }else {
+    if (mf->flags & MDEVS_MLNX_OS) {
+        rc = mos_reg_access_raw(mf, reg_id, reg_method, reg_data, reg_size, reg_status);
+    } else if ((mf->flags & (MDEVS_IB | MDEVS_FWCTX)) ||
+               (mf->flags != MDEVS_IB && (supports_icmd(mf) || supports_tools_cmdif_reg(mf)))) {
+        rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
+    } else {
         return ME_REG_ACCESS_NOT_SUPPORTED;
     }
 #else
-    if (mf->access_type == MTCR_ACCESS_INBAND || (supports_icmd(mf) || supports_tools_cmdif_reg(mf)) ) {
-        	rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
-        }else {
-            return ME_REG_ACCESS_NOT_SUPPORTED;
-        }
+    if (mf->tp == MST_IB || (supports_icmd(mf) || supports_tools_cmdif_reg(mf)) ) {
+        rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
+    } else {
+        return ME_REG_ACCESS_NOT_SUPPORTED;
+    }
 #endif
 
-    if (rc ) {
-         return rc;
+    if (rc) {
+        return rc;
     } else if (*reg_status) {
         switch (*reg_status) {
-        case 1:
-            return ME_REG_ACCESS_DEV_BUSY;
-        case 2:
-            return ME_REG_ACCESS_VER_NOT_SUPP;
-        case 3:
-            return ME_REG_ACCESS_UNKNOWN_TLV;
-        case 4:
-            return ME_REG_ACCESS_REG_NOT_SUPP;
-        case 5:
-            return ME_REG_ACCESS_CLASS_NOT_SUPP;
-        case 6:
-            return ME_REG_ACCESS_METHOD_NOT_SUPP;
-        case 7:
-            return ME_REG_ACCESS_BAD_PARAM;
-        case 8:
-            return ME_REG_ACCESS_RES_NOT_AVLBL;
-        case 9:
-            return ME_REG_ACCESS_MSG_RECPT_ACK;
-        case 0x22:
-        	return ME_REG_ACCESS_CONF_CORRUPT;
-        case 0x24:
-        	return ME_REG_ACCESS_LEN_TOO_SMALL;
-        case 0x20:
-        	return ME_REG_ACCESS_BAD_CONFIG;
-        case 0x21:
-        	return ME_REG_ACCESS_ERASE_EXEEDED;
-        case 0x70:
-            return ME_REG_ACCESS_INTERNAL_ERROR;
-        default:
-            return ME_REG_ACCESS_UNKNOWN_ERR;
+            case 1:
+                return ME_REG_ACCESS_DEV_BUSY;
+            case 2:
+                return ME_REG_ACCESS_VER_NOT_SUPP;
+            case 3:
+                return ME_REG_ACCESS_UNKNOWN_TLV;
+            case 4:
+                return ME_REG_ACCESS_REG_NOT_SUPP;
+            case 5:
+                return ME_REG_ACCESS_CLASS_NOT_SUPP;
+            case 6:
+                return ME_REG_ACCESS_METHOD_NOT_SUPP;
+            case 7:
+                return ME_REG_ACCESS_BAD_PARAM;
+            case 8:
+                return ME_REG_ACCESS_RES_NOT_AVLBL;
+            case 9:
+                return ME_REG_ACCESS_MSG_RECPT_ACK;
+            case 0x22:
+                return ME_REG_ACCESS_CONF_CORRUPT;
+            case 0x24:
+                return ME_REG_ACCESS_LEN_TOO_SMALL;
+            case 0x20:
+                return ME_REG_ACCESS_BAD_CONFIG;
+            case 0x21:
+                return ME_REG_ACCESS_ERASE_EXEEDED;
+            case 0x70:
+                return ME_REG_ACCESS_INTERNAL_ERROR;
+            default:
+                return ME_REG_ACCESS_UNKNOWN_ERR;
         }
     }
 
     return ME_OK;
 }
 
-
 static int init_operation_tlv(struct OperationTlv *operation_tlv, u_int16_t reg_id, u_int8_t method)
 {
     memset(operation_tlv, 0, sizeof(*operation_tlv));
 
-    operation_tlv->Type        = TLV_OPERATION;
-    operation_tlv->class       = MAD_CLASS_REG_ACCESS;
-    operation_tlv->len         = TLV_OPERATION_SIZE;
-    operation_tlv->method      = method;
+    operation_tlv->Type = TLV_OPERATION;
+    operation_tlv->class = MAD_CLASS_REG_ACCESS;
+    operation_tlv->len = TLV_OPERATION_SIZE;
+    operation_tlv->method = method;
     operation_tlv->register_id = reg_id;
     return 0;
 }
@@ -2051,14 +2183,14 @@ static int init_operation_tlv(struct OperationTlv *operation_tlv, u_int16_t reg_
 static int mreg_send_wrapper(mfile* mf, u_int8_t *data, int r_icmd_size, int w_icmd_size)
 {
     int rc;
-    if (mf->access_type == MTCR_ACCESS_INBAND) {//inband access
-            rc = maccess_reg_mad(mf, data);
-            if (rc) {
-                //printf("-E- 2. Access reg mad failed with rc = %#x\n", rc);
-                return ME_MAD_SEND_FAILED;
-            }
+    if (mf->tp == MST_IB) { //inband access
+        rc = maccess_reg_mad(mf, data);
+        if (rc) {
+            //printf("-E- 2. Access reg mad failed with rc = %#x\n", rc);
+            return ME_MAD_SEND_FAILED;
+        }
     } else if (supports_icmd(mf)) {
-    #if defined(MST_UL) && !defined(MST_UL_ICMD)
+#if defined(MST_UL) && !defined(MST_UL_ICMD)
         if (mf->vsec_supp) { // we support accessing fw via icmd space
             rc = icmd_send_command_int(mf, FLASH_REG_ACCESS, data, w_icmd_size, r_icmd_size, 0);
             if (rc) {
@@ -2071,28 +2203,27 @@ static int mreg_send_wrapper(mfile* mf, u_int8_t *data, int r_icmd_size, int w_i
                 return ME_MAD_SEND_FAILED;
             }
         }
-    #else
+#else
         rc = icmd_send_command_int(mf, FLASH_REG_ACCESS, data, w_icmd_size, r_icmd_size, 0);
-         if (rc) {
-             return rc;
-         }
-    #endif
+        if (rc) {
+            return rc;
+        }
+#endif
     } else if (supports_tools_cmdif_reg(mf)) {
-    	rc = tools_cmdif_reg_access(mf, data, w_icmd_size, r_icmd_size);
-    	if (rc) {
-    		return rc;
-    	}
-    }else{
+        rc = tools_cmdif_reg_access(mf, data, w_icmd_size, r_icmd_size);
+        if (rc) {
+            return rc;
+        }
+    } else {
         return ME_NOT_IMPLEMENTED;
     }
     return ME_OK;
 }
 
-
-static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t  reg_size,\
-							u_int32_t r_size_reg, u_int32_t	w_size_reg, int *reg_status)
+static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t method, void *reg_data, u_int32_t reg_size,
+        u_int32_t r_size_reg, u_int32_t w_size_reg, int *reg_status)
 {
-	//printf("-D- reg_id = %d, reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_id,reg_size,r_size_reg,w_size_reg);
+    //printf("-D- reg_id = %d, reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_id,reg_size,r_size_reg,w_size_reg);
     int mad_rc, cmdif_size = 0;
     struct OperationTlv tlv;
     struct reg_tlv tlv_info;
@@ -2102,7 +2233,7 @@ static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t metho
     // Fill Reg TLV
     memset(&tlv_info, 0, sizeof(tlv_info));
     tlv_info.Type = TLV_REG;
-    tlv_info.len  = (reg_size + REG_TLV_HEADER_LEN) >> 2; // length is in dwords
+    tlv_info.len = (reg_size + REG_TLV_HEADER_LEN) >> 2; // length is in dwords
 
     // Pack the mad
 
@@ -2113,17 +2244,17 @@ static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t metho
     cmdif_size += reg_size;
 
 #ifdef _ENABLE_DEBUG_
-    	fprintf(stdout, "-I-Tlv's of Data Sent:\n");
-        fprintf(stdout, "\tOperation Tlv\n");
-        OperationTlv_dump(&tlv, stdout);
-    	fprintf(stdout, "\tReg Tlv\n");
-        reg_tlv_dump(&tlv_info, stdout);
+    fprintf(stdout, "-I-Tlv's of Data Sent:\n");
+    fprintf(stdout, "\tOperation Tlv\n");
+    OperationTlv_dump(&tlv, stdout);
+    fprintf(stdout, "\tReg Tlv\n");
+    reg_tlv_dump(&tlv_info, stdout);
 #endif
     // printf("-D- reg_info.len = |%d, OP_TLV: %d, REG_TLV= %d, cmdif_size = %d\n", reg_info.len, OP_TLV_SIZE, REG_RLV_HEADER_LEN, cmdif_size);
     // update r/w_size_reg with the size of op tlv and reg tlv as we need to read/write them as well
     r_size_reg += OP_TLV_SIZE + REG_TLV_HEADER_LEN;
     w_size_reg += OP_TLV_SIZE + REG_TLV_HEADER_LEN;
-	//printf("-D- reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_size,r_size_reg,w_size_reg);
+    //printf("-D- reg_size = %d, r_size_reg = %d , w_size_reg = %d \n",reg_size,r_size_reg,w_size_reg);
 
     mad_rc = mreg_send_wrapper(mf, buffer, r_size_reg, w_size_reg);
     // Unpack the mad
@@ -2133,104 +2264,100 @@ static int mreg_send_raw(mfile *mf, u_int16_t reg_id, maccess_reg_method_t metho
     memcpy(reg_data, buffer + OP_TLV_SIZE + REG_TLV_HEADER_LEN, reg_size);
 
 #ifdef _ENABLE_DEBUG_
-    	fprintf(stdout, "-I-Tlv's of Data Recieved:\n");
-    	fprintf(stdout, "\tOperation Tlv\n");
-        OperationTlv_dump(&tlv, stdout);
-    	fprintf(stdout, "\tReg Tlv\n");
-        reg_tlv_dump(&tlv_info, stdout);
+    fprintf(stdout, "-I-Tlv's of Data Received:\n");
+    fprintf(stdout, "\tOperation Tlv\n");
+    OperationTlv_dump(&tlv, stdout);
+    fprintf(stdout, "\tReg Tlv\n");
+    reg_tlv_dump(&tlv_info, stdout);
 #endif
     // Check the return value
     *reg_status = tlv.status;
     if (mad_rc) {
-    	return mad_rc;
+        return mad_rc;
     }
     return ME_OK;
 }
 
 // needed device HW IDs
 #define CONNECTX3_PRO_HW_ID 0x1f7
+#define CONNECTX2_HW_ID 0x190
 #define CONNECTX3_HW_ID 0x1f5
 #define SWITCHX_HW_ID 0x245
 #define INFINISCALE4_HW_ID 0x1b3
 
 #define HW_ID_ADDR 0xf0014
 
-
-static int supports_icmd(mfile* mf) {
+static int supports_icmd(mfile* mf)
+{
     u_int32_t dev_id;
 
-     if (mread4(mf,HW_ID_ADDR, &dev_id) != 4 ) {// cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports icmd
-         return 0;
-     }
-     switch (dev_id & 0xffff) { // that the hw device id
-         case CONNECTX3_HW_ID :
-         case CONNECTX3_PRO_HW_ID :
-         case INFINISCALE4_HW_ID :
-         case SWITCHX_HW_ID :
+    if (mread4_ul(mf, HW_ID_ADDR, &dev_id) != 4) { // cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports icmd
+        return 0;
+    }
+    switch (dev_id & 0xffff) { // that the hw device id
+        case CONNECTX2_HW_ID:
+        case CONNECTX3_HW_ID:
+        case CONNECTX3_PRO_HW_ID:
+        case INFINISCALE4_HW_ID:
+        case SWITCHX_HW_ID:
             return 0;
-         default:
-             break;
-     }
-   return 1;
+        default:
+            break;
+    }
+    return 1;
 }
 
-static int supports_tools_cmdif_reg(mfile* mf) {
+static int supports_tools_cmdif_reg(mfile* mf)
+{
     u_int32_t dev_id;
-    if (mread4(mf,HW_ID_ADDR, &dev_id) != 4) { // cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports tools cmdif
+    if (mread4_ul(mf, HW_ID_ADDR, &dev_id) != 4) { // cr might be locked and retured 0xbad0cafe but we dont care we search for device that supports tools cmdif
         return 0;
     }
     switch (dev_id & 0xffff) { // that the hw device id
-    case CONNECTX3_HW_ID : //Cx3
-    case CONNECTX3_PRO_HW_ID : // Cx3-pro
-        if (tools_cmdif_is_supported(mf) == ME_OK) {
-            return 1;
-        }
-        break;
-    default:
-        break;
+        case CONNECTX3_HW_ID: //Cx3
+        case CONNECTX3_PRO_HW_ID: // Cx3-pro
+            if (tools_cmdif_is_supported(mf) == ME_OK) {
+                return 1;
+            }
+            break;
+        default:
+            break;
     }
     return 0;
 }
 
-int mget_max_reg_size(mfile *mf) {
+int mget_max_reg_size_ul(mfile *mf)
+{
     if (mf->acc_reg_params.max_reg_size) {
         return mf->acc_reg_params.max_reg_size;
-    } else if (mf->access_type == MTCR_ACCESS_INBAND) {
+    } else if (mf->tp == MST_IB) {
         mf->acc_reg_params.max_reg_size = INBAND_MAX_REG_SIZE;
-    } else if (supports_icmd(mf)){ // we support icmd and we dont use IB interface -> we use icmd for reg access
+    } else if (supports_icmd(mf)) { // we support icmd and we dont use IB interface -> we use icmd for reg access
         if (mf->vsec_supp) {
             mf->acc_reg_params.max_reg_size = ICMD_MAX_REG_SIZE;
         } else {
             // we send via inband
             mf->acc_reg_params.max_reg_size = INBAND_MAX_REG_SIZE;
         }
-    }else if (supports_tools_cmdif_reg(mf)) {
+    } else if (supports_tools_cmdif_reg(mf)) {
         mf->acc_reg_params.max_reg_size = TOOLS_HCR_MAX_REG_SIZE;
     }
     return mf->acc_reg_params.max_reg_size;
 }
 
-int mget_vsec_supp(mfile* mf)
-{
-    return mf->vsec_supp;
-}
-
-MTCR_API int mget_addr_space(mfile* mf)
-{
-    return mf->address_space;
-}
-MTCR_API int mset_addr_space(mfile* mf, int space)
+int mclear_pci_semaphore_ul(const char* name)
 {
-    switch (space) {
-    case AS_CR_SPACE:
-    case AS_ICMD:
-    case AS_SEMAPHORE:
-        break;
-    default:
-        return -1;
-    }
-    mf->address_space = space;
-    return 0;
+   mfile* mf;
+   int rc = ME_OK;
+   mf = mopen_ul_int(name, Clear_Vsec_Semaphore);
+   if (!mf) {
+       return ME_ERROR;
+   }
+   if ((mf->tp & (MST_PCICONF | MST_PCI)) == 0) {
+       rc = ME_UNSUPPORTED_ACCESS_TYPE;
+   }
+   mclose_ul(mf);
+   return rc;
 }
 
 /************************************
@@ -2253,19 +2380,15 @@ const char* m_err2str(MError status)
        return "Semaphore locked";
    case ME_MEM_ERROR:
        return "ME_MEM_ERROR";
-   case ME_PCI_READ_ERROR:
-       return "ME_PCI_READ_ERROR";
-   case ME_PCI_WRITE_ERROR:
-       return "ME_PCI_WRITE_ERROR";
-    case ME_PCI_SPACE_NOT_SUPPORTED:
-        return "ME_PCI_SPACE_NOT_SUPPORTED";
-    case ME_PCI_IFC_TOUT:
-        return "ME_PCI_IFC_TOUT";
+   case ME_UNSUPPORTED_OPERATION:
+       return "ME_UNSUPPORTED_OPERATION";
 
    case ME_MAD_SEND_FAILED:
        return "ME_MAD_SEND_FAILED";
    case ME_UNKOWN_ACCESS_TYPE:
        return "ME_UNKOWN_ACCESS_TYPE";
+   case ME_UNSUPPORTED_ACCESS_TYPE:
+       return "ME_UNSUPPORTED_ACCESS_TYPE";
    case ME_UNSUPPORTED_DEVICE:
        return "ME_UNSUPPORTED_DEVICE";
 
@@ -2299,15 +2422,15 @@ const char* m_err2str(MError status)
    case ME_REG_ACCESS_SIZE_EXCCEEDS_LIMIT:
        return "Register is too large";
    case ME_REG_ACCESS_CONF_CORRUPT:
-      return "Config Section Corrupted";
+       return "Config Section Corrupted";
    case ME_REG_ACCESS_LEN_TOO_SMALL:
-      return "given register length too small for Tlv";
+       return "given register length too small for Tlv";
    case ME_REG_ACCESS_BAD_CONFIG:
-      return "configuration refused";
+       return "configuration refused";
    case ME_REG_ACCESS_ERASE_EXEEDED:
-      return	"erase count exceeds limit";
+       return   "erase count exceeds limit";
    case ME_REG_ACCESS_INTERNAL_ERROR:
-      return "FW internal error";
+       return "FW internal error";
 
    // ICMD access errors
    case ME_ICMD_STATUS_CR_FAIL:
@@ -2338,22 +2461,22 @@ const char* m_err2str(MError status)
        return "ME_ICMD_ICM_NOT_AVAIL";
    case ME_ICMD_WRITE_PROTECT:
        return "ME_ICMD_WRITE_PROTECT";
-   case ME_ICMD_SIZE_EXCEEDS_LIMIT:
-       return "ME_ICMD_SIZE_EXCEEDS_LIMIT";
    case ME_ICMD_UNKNOWN_STATUS:
        return "ME_ICMD_UNKNOWN_STATUS";
+   case ME_ICMD_SIZE_EXCEEDS_LIMIT:
+       return "ME_ICMD_SIZE_EXCEEDS_LIMIT";
 
        // TOOLS HCR access errors
    case ME_CMDIF_BUSY:
-	   return "Tools HCR busy";
+       return "Tools HCR busy";
    case ME_CMDIF_TOUT:
-	   return "Tools HCR time out";
+       return "Tools HCR time out.";
    case ME_CMDIF_BAD_OP:
-	   return "Operation not supported";
+       return "Operation not supported";
    case ME_CMDIF_NOT_SUPP:
-	   return "Tools HCR not supported";
+       return "Tools HCR not supported";
    case ME_CMDIF_BAD_SYS:
-	   return "bad system status (driver may be down or Fw does not support this operation)";
+       return "bad system status (driver may be down or Fw does not support this operation)";
    case ME_CMDIF_UNKN_TLV:
        return "Unknown TLV";
    case ME_CMDIF_RES_STATE:
@@ -2361,7 +2484,7 @@ const char* m_err2str(MError status)
    case ME_CMDIF_UNKN_STATUS:
        return "Unknown status";
 
-    // MAD IFC errors
+       // MAD IFC errors
    case ME_MAD_BUSY:
        return "Temporarily busy. MAD discarded. This is not an error";
    case ME_MAD_REDIRECT:
@@ -2373,7 +2496,7 @@ const char* m_err2str(MError status)
    case ME_MAD_METHOD_ATTR_COMB_NOT_SUPP:
        return "Method and attribute combination isn't supported";
    case ME_MAD_BAD_DATA:
-       return "Bad attribute modifer or field";
+       return "Bad attribute modifier or field";
    case ME_MAD_GENERAL_ERR:
        return "Unknown MAD error";
 
@@ -2381,4 +2504,3 @@ const char* m_err2str(MError status)
        return "Unknown error code";
    }
 }
-
diff --git a/mtcr_ul/mtcr_ul_com.h b/mtcr_ul/mtcr_ul_com.h
new file mode 100644
index 0000000..e336e80
--- /dev/null
+++ b/mtcr_ul/mtcr_ul_com.h
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ *
+ * mtcr_ul_com.h
+ *
+ *  Created on: Feb 16, 2016
+ *      Author: adham
+ */
+
+#ifndef USER_MTCR_MTCR_UL_COM_H_
+#define USER_MTCR_MTCR_UL_COM_H_
+
+#include "mtcr_com_defs.h"
+#include "mtcr_mf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Read 4 bytes, return number of succ. read bytes or -1 on failure
+ */
+int mread4_ul(mfile* mf, unsigned int offset, u_int32_t *value);
+
+/*
+ * Write 4 bytes, return number of succ. written bytes or -1 on failure
+ */
+int mwrite4_ul(mfile* mf, unsigned int offset, u_int32_t value);
+
+
+int mread4_block_ul(mfile* mf, unsigned int offset, u_int32_t* data, int byte_len);
+int mwrite4_block_ul(mfile* mf, unsigned int offset, u_int32_t* data, int byte_len);
+
+int msw_reset_ul(mfile* mf);
+int mhca_reset_ul(mfile* mf);
+
+/*
+ * Get list of MST_ul(Mellanox Software Tools) devices.
+ * Put all device names as null-terminated strings to buf.
+ *
+ * Return number of devices found or -1 if buf overflow
+ */
+int mdevices_ul(char *buf, int len, int mask);
+
+/*
+ * Get list of MST_ul(Mellanox Software Tools) devices.
+ * Put all device names as null-terminated strings to buf.
+ *
+ * Return number of devices found or -1 if buf overflow
+ */
+int mdevices_v_ul(char *buf, int len, int mask, int verbosity);
+
+/*
+ * Get list of MST_ul(Mellanox Software Tools) devices info records.
+ * Return a dynamic allocated array of dev_info records.
+ * len will be updated to hold the array length
+ *
+ */
+dev_info* mdevices_info_ul(int mask, int* len);
+
+/*
+ *  * Get list of MST (Mellanox Software Tools) devices info records.
+ *  * Return a dynamic allocated array of dev_info records.
+ *  * len will be updated to hold the array length
+ *  * Verbosity will decide whether to get all the Physical functions or not.
+ */
+dev_info* mdevices_info_v_ul(int mask, int* len, int verbosity);
+
+/*
+ * Open Mellanox Software tools_ul(mst) driver. Device type==INFINIHOST
+ * Return valid void ptr or 0 on failure
+ */
+mfile *mopen_ul(const char *name);
+
+/*
+ * Close Mellanox driver
+ * req. descriptor
+ */
+int mclose_ul(mfile* mf);
+
+int maccess_reg_mad_ul(mfile* mf, u_int8_t *data);
+
+int maccess_reg_ul(mfile*  mf,
+                u_int16_t  reg_id,
+                maccess_reg_method_t reg_method,
+                void*      reg_data,
+                u_int32_t  reg_size,
+                u_int32_t   r_size_reg, // used when sending via icmd interface_ul(how much data should be read back to the user)
+                u_int32_t   w_size_reg, // used when sending via icmd interface_ul(how much data should be written to the scratchpad)
+                                        // if you dont know what you are doing then r_size_reg = w_size_reg = your_register_size
+                int       *reg_status);
+
+
+
+int tools_cmdif_send_inline_cmd_ul(mfile* mf, u_int64_t in_param, u_int64_t* out_param,
+                                u_int32_t input_modifier, u_int16_t opcode, u_int8_t  opcode_modifier);
+
+int tools_cmdif_send_mbox_command_ul(mfile* mf, u_int32_t input_modifier, u_int16_t opcode, u_int8_t  opcode_modifier,
+                                  int data_offs_in_mbox, void* data, int data_size, int skip_write);
+
+int tools_cmdif_unlock_semaphore_ul(mfile* mf);
+
+
+int mget_max_reg_size_ul(mfile* mf);
+
+int mread_buffer_ul(mfile* mf, unsigned int offset, u_int8_t* data, int byte_len);
+int mwrite_buffer_ul(mfile* mf, unsigned int offset, u_int8_t* data, int byte_len);
+
+int mclear_pci_semaphore_ul(const char* name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* USER_MTCR_MTCR_UL_COM_H_ */
diff --git a/mtcr_ul/mtcr_ul_icmd_cif.c b/mtcr_ul/mtcr_ul_icmd_cif.c
index f44f5a2..fed5973 100644
--- a/mtcr_ul/mtcr_ul_icmd_cif.c
+++ b/mtcr_ul/mtcr_ul_icmd_cif.c
@@ -28,7 +28,6 @@
  * 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 <stdio.h>
@@ -40,7 +39,7 @@
 #include <bit_slice.h>
 #include <common/tools_utils.h>
 #include "mtcr_icmd_cif.h"
-
+#include "mtcr_ib_res_mgt.h"
 //#define _DEBUG_MODE   // un-comment this to enable debug prints
 
 #define IN
@@ -50,16 +49,23 @@
 #define STAT_CFG_NOT_DONE_ADDR_CIB   0xb0004
 #define STAT_CFG_NOT_DONE_ADDR_CX4   0xb0004
 #define STAT_CFG_NOT_DONE_ADDR_SW_IB   0x80010
-#define STAT_CFG_NOT_DONE_BITOFF_CIB 31
-#define STAT_CFG_NOT_DONE_BITOFF_CX4 31
+#define STAT_CFG_NOT_DONE_BITOFF_CIB   31
+#define STAT_CFG_NOT_DONE_BITOFF_CX4   31
 #define STAT_CFG_NOT_DONE_BITOFF_SW_IB 0
+#define ICMD_VERSION_BITOFF 24
+#define ICMD_VERSION_BITLEN 8
+#define CMD_PTR_ADDR_CIB        0x0
+#define CMD_PTR_ADDR_SW_IB      0x80000
+#define CMD_PTR_ADDR_CX4        CMD_PTR_ADDR_CIB
+#define CMD_PTR_BITOFF      0
+#define CMD_PTR_BITLEN      24
+#define CTRL_OFFSET         0x3fc
 #define BUSY_BITOFF         0
 #define BUSY_BITLEN         1
 #define OPCODE_BITOFF       16
 #define OPCODE_BITLEN       16
 #define STATUS_BITOFF       8
 #define STATUS_BITLEN       8
-
 #define VCR_CTRL_ADDR       0x0
 #define VCR_SEMAPHORE62     0x0 // semaphore Domain
 #define VCR_CMD_ADDR        0x100000 // mailbox addr
@@ -87,19 +93,19 @@
  */
 #define SET_SPACE_FOR_ICMD_ACCESS(mf)   \
     if (mf->vsec_supp) {               \
-        mf->address_space = AS_ICMD;   \
+        mset_addr_space(mf, AS_ICMD);   \
     }
 #define SET_SPACE_FOR_SEMAPHORE_ACCESS(mf)   \
     if (mf->vsec_supp) {               \
-        mf->address_space = AS_SEMAPHORE;   \
+        mset_addr_space(mf, AS_SEMAPHORE);   \
     }
-#define RESTORE_SPACE(mf) mf->address_space = AS_CR_SPACE
+#define RESTORE_SPACE(mf) mset_addr_space(mf, AS_CR_SPACE)
 
 #define MWRITE4_ICMD(mf, offset, value, action_on_fail)\
     do {\
         SET_SPACE_FOR_ICMD_ACCESS(mf);\
         if (mwrite4(mf, offset, value) != 4) {\
-            mf->address_space = AS_CR_SPACE;\
+            mset_addr_space(mf, AS_CR_SPACE);\
             action_on_fail;\
         }\
         RESTORE_SPACE(mf);\
@@ -108,6 +114,7 @@
 #define MREAD4_ICMD(mf, offset, ptr, action_on_fail)\
     do {\
         SET_SPACE_FOR_ICMD_ACCESS(mf);\
+        DBG_PRINTF("-D- MREAD4_ICMD: off: %x, addr_space: %x\n", offset, mf->address_space);\
         if (mread4(mf, offset, ptr) != 4) {\
             RESTORE_SPACE(mf);\
             action_on_fail;\
@@ -160,7 +167,6 @@
     }while(0)
 
 
-
 #ifdef _DEBUG_MODE
 #define DBG_PRINTF(...) fprintf(stderr, __VA_ARGS__)
 #else
@@ -182,8 +188,10 @@ enum {
 #define CIB_HW_ID 511
 #define CX4_HW_ID 521
 #define CX4LX_HW_ID 523
+#define CX5_HW_ID 525
 #define SW_IB_HW_ID 583
 #define SW_EN_HW_ID 585
+#define SW_IB2_HW_ID 587
 
 #define GET_ADDR(mf, addr_cib, addr_cx4, addr_sw_ib, addr)\
     do {\
@@ -192,10 +200,12 @@ enum {
         switch (_hw_id & 0xffff) {\
         case (CX4_HW_ID):\
         case (CX4LX_HW_ID):\
+        case (CX5_HW_ID):\
             addr = addr_cx4;\
             break;\
         case (SW_IB_HW_ID):\
         case (SW_EN_HW_ID):\
+        case (SW_IB2_HW_ID):\
             addr = addr_sw_ib;\
             break;\
         default:\
@@ -316,17 +326,19 @@ static int icmd_is_cmd_ifc_ready(mfile *mf) {
     return (bit_val == expected_val) ?  ME_OK: ME_ICMD_STATUS_ICMD_NOT_READY;
 }
 
+#define SMP_ICMD_SEM_ADDR 0x0
+
 /*
  * icmd_clear_semaphore
  */
-int icmd_clear_semaphore(mfile *mf) {
+int icmd_clear_semaphore(mfile *mf)
+{
     DBG_PRINTF("Clearing semaphore\n");
     // open icmd interface by demand
-	int ret;
-	if ((ret = icmd_open(mf))) {
-		return ret;
-	}
-
+    int ret;
+    if ((ret = icmd_open(mf))) {
+        return ret;
+    }
     MWRITE4_SEMAPHORE(mf, mf->icmd.semaphore_addr, 0, return ME_ICMD_STATUS_CR_FAIL);
     mf->icmd.took_semaphore = 0;
     return ME_OK;
@@ -335,16 +347,13 @@ int icmd_clear_semaphore(mfile *mf) {
 /*
  * icmd_take_semaphore
  */
-/*
- * icmd_take_semaphore
- */
+
 static int icmd_take_semaphore_com(mfile *mf, u_int32_t expected_read_val)
 {
     u_int32_t read_val;
     unsigned retries = 0;
 
     DBG_PRINTF("Taking semaphore...\n");
-
      do {    // loop while the semaphore is taken by someone else
          if (++retries > 256) {
              return ME_ICMD_STATUS_SEMAPHORE_TO;
@@ -412,6 +421,8 @@ int icmd_send_command_int(mfile    *mf,
     // check data size does not exceed mailbox size
     if (write_data_size > (int)mf->icmd.max_cmd_size || \
          read_data_size > (int)mf->icmd.max_cmd_size ) {
+        DBG_PRINTF("write_data_size <%x-%x> mf->icmd.max_cmd_size .. ", write_data_size, mf->icmd.max_cmd_size);
+        DBG_PRINTF("read_data_size <%x-%x> mf->icmd.max_cmd_size \n", read_data_size, mf->icmd.max_cmd_size);
         return ME_ICMD_SIZE_EXCEEDS_LIMIT;
     }
 
@@ -450,19 +461,12 @@ cleanup:
     return ret;
 }
 
-
-static int icmd_init_cr(mfile *mf)
-{
-    (void)mf;
-    return ME_NOT_IMPLEMENTED;
-}
-
 static int icmd_init_vcr(mfile* mf)
 {
      mf->icmd.cmd_addr = VCR_CMD_ADDR;
      mf->icmd.ctrl_addr = VCR_CTRL_ADDR;
      mf->icmd.semaphore_addr = VCR_SEMAPHORE62;
-
+     DBG_PRINTF("-D- Getting VCR_CMD_SIZE_ADDR\n");
      // get max command size
      MREAD4_ICMD(mf,VCR_CMD_SIZE_ADDR, &(mf->icmd.max_cmd_size), return ME_ICMD_STATUS_CR_FAIL;);
 
@@ -486,13 +490,12 @@ int icmd_open(mfile *mf)
     }
 
     mf->icmd.took_semaphore = 0;
+    mf->icmd.ib_semaphore_lock_supported = 0;
     // attempt to open via CR-Space
 #if defined(MST_UL) && !defined(MST_UL_ICMD)
     if (mf->vsec_supp) {
         return icmd_init_vcr(mf);
     }
-    // ugly hack avoid compiler warrnings
-    if (0) icmd_init_cr(mf);
     return ME_ICMD_NOT_SUPPORTED;
 #else
     if (mf->vsec_supp) {
diff --git a/reg_access/Makefile.am b/reg_access/Makefile.am
index 3e56406..caa0993 100644
--- a/reg_access/Makefile.am
+++ b/reg_access/Makefile.am
@@ -36,13 +36,13 @@ COMMON_DIR = $(top_srcdir)/common
 LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 USER_DIR = $(top_srcdir)
 
-INCLUDES = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
+AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
 
 AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC)
 
-noinst_LIBRARIES = libreg_access.a
+noinst_LTLIBRARIES = libreg_access.a
 
-libreg_access_a_SOURCES = reg_access.c
+libreg_access_a_SOURCES = reg_access.c reg_access.h
 libreg_access_a_DEPENDENCIES = $(USER_DIR)/tools_layouts/libtools_layouts.a
 libreg_access_a_LIBADD = $(libreg_access_a_DEPENDENCIES)
 
diff --git a/reg_access/Makefile.in b/reg_access/Makefile.in
index bf47cf7..e2868e0 100644
--- a/reg_access/Makefile.in
+++ b/reg_access/Makefile.in
@@ -121,15 +121,13 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_ at AM_V@)
-am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
-am__v_AR_0 = @echo "  AR      " $@;
-am__v_AR_1 = 
-libreg_access_a_AR = $(AR) $(ARFLAGS)
-am_libreg_access_a_OBJECTS = reg_access.$(OBJEXT)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am_libreg_access_a_OBJECTS = reg_access.lo
 libreg_access_a_OBJECTS = $(am_libreg_access_a_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -148,10 +146,6 @@ am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
@@ -262,6 +256,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -322,10 +317,10 @@ MTCR_DIR = $(top_srcdir)/mtcr_ul
 COMMON_DIR = $(top_srcdir)/common
 LAYOUTS_DIR = $(top_srcdir)/tools_layouts
 USER_DIR = $(top_srcdir)
-INCLUDES = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
+AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
 AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC)
-noinst_LIBRARIES = libreg_access.a
-libreg_access_a_SOURCES = reg_access.c
+noinst_LTLIBRARIES = libreg_access.a
+libreg_access_a_SOURCES = reg_access.c reg_access.h
 libreg_access_a_DEPENDENCIES = $(USER_DIR)/tools_layouts/libtools_layouts.a
 libreg_access_a_LIBADD = $(libreg_access_a_DEPENDENCIES)
 all: all-am
@@ -363,13 +358,19 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
-clean-noinstLIBRARIES:
-	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
 
 libreg_access.a: $(libreg_access_a_OBJECTS) $(libreg_access_a_DEPENDENCIES) $(EXTRA_libreg_access_a_DEPENDENCIES) 
-	$(AM_V_at)-rm -f libreg_access.a
-	$(AM_V_AR)$(libreg_access_a_AR) libreg_access.a $(libreg_access_a_OBJECTS) $(libreg_access_a_LIBADD)
-	$(AM_V_at)$(RANLIB) libreg_access.a
+	$(AM_V_CCLD)$(LINK)  $(libreg_access_a_OBJECTS) $(libreg_access_a_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -377,7 +378,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/reg_access.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/reg_access.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -490,7 +491,7 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LTLIBRARIES)
 installdirs:
 install: install-am
 install-exec: install-exec-am
@@ -524,7 +525,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
 	mostlyclean-am
 
 distclean: distclean-am
@@ -596,7 +597,7 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
 	ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
diff --git a/reg_access/reg_access.c b/reg_access/reg_access.c
index 727cb4c..b16f331 100644
--- a/reg_access/reg_access.c
+++ b/reg_access/reg_access.c
@@ -41,8 +41,11 @@
 #define REG_ID_MNVA  0x9024
 #define REG_ID_MNVI  0x9025
 #define REG_ID_MNVIA 0x9029 // 4th gen
+#define REG_ID_MVTS  0x902c
 #define REG_ID_NVQC  0x9030
 #define REG_ID_NVIA  0x9033 // 5th gen
+#define REG_ID_NVQGC 0x9034
+#define REG_ID_MNVGN 0x9035
 
 // TODO: get correct register ID for mfrl mfai
 #define REG_ID_MFRL 0x9028
@@ -71,29 +74,40 @@
 
 // register access for variable size registers (like mfba)
 
-#define REG_ACCCESS_VAR(mf, methdod, reg_id, data_struct, struct_name, reg_size , r_reg_size, w_reg_size, prefix)\
-    int status = 0;\
+#define REG_ACCESS_GENERIC_VAR_WITH_STATUS(mf, methdod, reg_id, data_struct, struct_name, reg_size , r_reg_size, w_reg_size, pack_func,\
+        unpack_func, size_func, print_func, status)\
     int rc;\
-    int max_data_size = prefix##_##struct_name##_size();\
+    int max_data_size = size_func();\
     u_int8_t data[max_data_size];\
     memset(data, 0, max_data_size);\
-    prefix##_##struct_name##_pack(data_struct, data);\
+    pack_func(data_struct, data);\
     if (method != REG_ACCESS_METHOD_GET && method != REG_ACCESS_METHOD_SET) {\
         return ME_REG_ACCESS_BAD_METHOD;\
     }\
-    DEBUG_PRINT_SEND(data_struct, struct_name, method, prefix);\
-    rc = maccess_reg(mf, reg_id, (maccess_reg_method_t)method, data, reg_size, r_reg_size, w_reg_size, &status);\
-    prefix##_##struct_name##_unpack(data_struct, data);\
-    DEBUG_PRINT_RECIEVE(data_struct, struct_name, method, prefix);\
+    DEBUG_PRINT_SEND(data_struct, struct_name, method, print_func);\
+    rc = maccess_reg(mf, reg_id, (maccess_reg_method_t)method, data, reg_size, r_reg_size, w_reg_size, status);\
+    unpack_func(data_struct, data);\
+    DEBUG_PRINT_RECIEVE(data_struct, struct_name, method, print_func);
+
+#define REG_ACCESS_GENERIC_VAR(mf, methdod, reg_id, data_struct, struct_name, reg_size , r_reg_size, w_reg_size, pack_func,\
+        unpack_func, size_func, print_func)\
+    int status = 0;\
+    REG_ACCESS_GENERIC_VAR_WITH_STATUS(mf, methdod, reg_id, data_struct, struct_name, reg_size , r_reg_size, w_reg_size, pack_func,\
+        unpack_func, size_func, print_func, &status)\
     if (rc || status) {\
         return (reg_access_status_t)rc;\
     }\
     return ME_OK
 
+#define REG_ACCCESS_VAR(mf, methdod, reg_id, data_struct, struct_name, reg_size , r_reg_size, w_reg_size, prefix)\
+    REG_ACCESS_GENERIC_VAR(mf, method, reg_id, data_struct, struct_name, reg_size, r_reg_size, w_reg_size,\
+            prefix##_##struct_name##_pack, prefix##_##struct_name##_unpack, prefix##_##struct_name##_size,\
+            prefix##_##struct_name##_print)
+
 // register access for static sized registers
 #define REG_ACCCESS(mf, methdod, reg_id, data_struct, struct_name, prefix)\
-	int data_size = prefix##_##struct_name##_size();\
-	REG_ACCCESS_VAR(mf, methdod, reg_id, data_struct, struct_name, data_size, data_size, data_size, prefix)
+    int data_size = prefix##_##struct_name##_size();\
+    REG_ACCCESS_VAR(mf, methdod, reg_id, data_struct, struct_name, data_size, data_size, data_size, prefix)
 
 /************************************
  * Function: reg_access_mfba
@@ -249,6 +263,46 @@ reg_access_status_t reg_access_nvqc (mfile* mf, reg_access_method_t method, stru
     }
     REG_ACCCESS(mf, method, REG_ID_NVQC, nvqc, nvqc, tools_open);
 }
+
+/************************************
+ * Function: reg_access_nvqgc
+ ************************************/
+reg_access_status_t reg_access_nvqgc (mfile* mf, reg_access_method_t method, struct tools_open_nvqgc* nvqgc)
+{
+    if (method != REG_ACCESS_METHOD_GET ) { // this register supports only get method
+        return ME_REG_ACCESS_BAD_METHOD;
+    }
+    REG_ACCCESS(mf, method, REG_ID_NVQGC, nvqgc, nvqgc, tools_open);
+}
+
+/************************************
+ * Function: reg_access_mvts
+ ************************************/
+reg_access_status_t reg_access_mvts (mfile* mf, reg_access_method_t method, struct tools_open_mvts* mvts)
+{
+    REG_ACCCESS(mf, method, REG_ID_MVTS, mvts, mvts, tools_open);
+}
+
+/************************************
+ * Function: reg_access_mnvgn
+ ************************************/
+reg_access_status_t reg_access_mnvgn (mfile* mf, reg_access_method_t method, struct tools_open_mnvgn* mnvgn, int *status)
+{
+    int data_size = tools_open_mnvgn_size();
+    if (method != REG_ACCESS_METHOD_GET ) { // this register supports only get method
+        return ME_REG_ACCESS_BAD_METHOD;
+    }
+
+    REG_ACCESS_GENERIC_VAR_WITH_STATUS(mf, method, REG_ID_MNVGN, mnvgn, mnvgn, data_size, data_size, data_size,\
+                tools_open_mnvgn_pack, tools_open_mnvgn_unpack, tools_open_mnvgn_size,\
+                tools_open_mnvgn_print, status);
+
+    if (rc || *status) {\
+        return (reg_access_status_t)rc;\
+    }\
+    return ME_OK;
+}
+
 /************************************
  * Function: reg_access_err2str
  ************************************/
diff --git a/reg_access/reg_access.h b/reg_access/reg_access.h
index ce8db97..b77eb67 100644
--- a/reg_access/reg_access.h
+++ b/reg_access/reg_access.h
@@ -71,6 +71,9 @@ reg_access_status_t reg_access_nvda (mfile* mf, reg_access_method_t method, stru
 reg_access_status_t reg_access_nvdi (mfile* mf, reg_access_method_t method, struct tools_open_nvdi* nvdi);
 reg_access_status_t reg_access_nvia (mfile* mf, reg_access_method_t method, struct tools_open_nvia* nvdia);
 reg_access_status_t reg_access_nvqc (mfile* mf, reg_access_method_t method, struct tools_open_nvqc* nvqc);
+reg_access_status_t reg_access_nvqgc (mfile* mf, reg_access_method_t method, struct tools_open_nvqgc* nvqgc);
+reg_access_status_t reg_access_mvts (mfile* mf, reg_access_method_t method, struct tools_open_mvts* mvts);
+reg_access_status_t reg_access_mnvgn (mfile* mf, reg_access_method_t method, struct tools_open_mnvgn* mnvgn, int *status);
 
 #ifdef __cplusplus
 }
diff --git a/small_utils/Makefile.am b/small_utils/Makefile.am
index 838a724..24c36f9 100644
--- a/small_utils/Makefile.am
+++ b/small_utils/Makefile.am
@@ -30,7 +30,7 @@
 # SOFTWARE.
 #--
 
-INCLUDES= -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS= -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
 
 LDADD= ../mtcr_ul/libmtcr_ul.a -ldl
 
diff --git a/small_utils/Makefile.in b/small_utils/Makefile.in
index 60f3de5..34f7f9f 100644
--- a/small_utils/Makefile.in
+++ b/small_utils/Makefile.in
@@ -312,6 +312,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -366,7 +367,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/include/mtcr_ul -I$(top_srcdir)/common
 LDADD = ../mtcr_ul/libmtcr_ul.a -ldl
 bin_SCRIPTS = hca_self_test.ofed
 mstmread_SOURCES = mread.c
diff --git a/small_utils/hca_self_test.ofed b/small_utils/hca_self_test.ofed
index 337331a..9695fa8 100755
--- a/small_utils/hca_self_test.ofed
+++ b/small_utils/hca_self_test.ofed
@@ -58,6 +58,8 @@ HERMON_FW_NEEDED=
 CX3_FW_NEEDED=
 CX3_PRO_FW_NEEDED=
 CONNECTIB_FW_NEEDED=
+CONNECTX4_FW_NEEDED=
+CONNECTX4LX_FW_NEEDED=
 ########################################################################################
 
 
@@ -94,9 +96,15 @@ elif [ -f /etc/debian_version ]; then
     INSTALL_PREFIX=/opt/topspin
     g_pkg_cmd="dpkg"
 else
-    echo "Error: hca_self_test does not support this OS."
-    EXIT_CODE=1
-    exit $EXIT_CODE
+    OUT=`grep -q "Wind River" /etc/issue`
+    is_wind_river=$?
+    if [ "$is_wind_river" -eq "0" ]; then
+        OS_TYPE="RED_HAT"
+    else
+        echo "Error: hca_self_test does not support this OS."
+        EXIT_CODE=1
+        exit $EXIT_CODE
+    fi
 fi
 
 for cmd in  lspci cat id $g_pkg_cmd uname grep ls awk egrep modprobe; do
@@ -153,6 +161,9 @@ if [ $OS_TYPE = "DEBIAN" ]; then
     RPM_USR_VER=`dpkg -s libibverbs1 2> /dev/null | wc -l`
     RPM_KER_VER=`dpkg -l 2> /dev/null | grep -E "ofed-kernel" | wc -l`
     RPM_KER_NAME=`echo $mlx4_core_ko | awk -F '/' '{print$4}'`
+    if [ $RPM_KER_VER -eq 0 ] && [ "$RPM_KER_NAME" != "" ]; then
+        RPM_KER_VER=1
+    fi
     BOOTED_KER=`uname -r`
     if [ "$BOOTED_KER" != "$RPM_KER_NAME" ]; then
         RPM_CUR_BOOTED_KER=0
@@ -263,7 +274,7 @@ function get_device_id {
     current_pci_info=`get_curr_ca_pci_info $loop_cnt`
     PCI_DEV=$(echo $current_pci_info | awk '{print $1}')
 
-    HexDevice_ID=$(lspci -n -d "15b3:"  2> /dev/null | grep $PCI_DEV |  tail -1 | cut -d ":" -f4 | cut -d " " -f1)
+    HexDevice_ID=$(lspci -D -n -d "15b3:"  2> /dev/null | grep $PCI_DEV |  tail -1 | cut -d ":" -f5 | cut -d " " -f1)
     if [ "$HexDevice_ID" != "" ]; then
         HexDevice_ID=0x$HexDevice_ID
         let "tmp=$HexDevice_ID"
@@ -279,6 +290,8 @@ g_connectx="ConnectX"
 g_connectx3="ConnectX-3"
 g_connectx3_pro="ConnectX-3_Pro"
 g_connectib="Connect-IB"
+g_connectx4="ConnectX-4"
+g_connectx4lx="ConnectX-4_Lx"
 g_InfiniHost_III_Ex="InfiniHost_III_Ex"
 g_InfiniHost_III_Ex_memfree="InfiniHost_III_Ex_m"
 g_InfiniHost_III_Lx="InfiniHost_III_Lx"
@@ -301,8 +314,12 @@ function  get_hca_name {
         ret_val=$g_connectx3_pro
     elif [ $dev_id -eq 4113 ]; then
         ret_val=$g_connectib
+    elif [ $dev_id -eq 4115 ]; then
+        ret_val=$g_connectx4
+    elif [ $dev_id -eq 4117 ]; then
+        ret_val=$g_connectx4lx
     else
-        ret_val=$g_connectx
+        ret_val=$g_connectx4
     fi
     echo $ret_val
 
@@ -318,7 +335,7 @@ function get_driver {
         if [ "$hca_name" != "" ]; then
             if [ "$hca_name" == "$g_connectx" ] || [ "$hca_name" == "$g_connectx3" ] || [ "$hca_name" == "$g_connectx3_pro" ]; then
                 driver_need=$HERMON_DRIVER_NEEDED
-            elif [ "$hca_name" == "$g_connectib" ]; then 
+            elif [ "$hca_name" == "$g_connectib" ] || [ "$hca_name" == "$g_connectx4" ] || [ "$hca_name" == "$g_connectx4lx" ]; then 
                 driver_need=$CONNECTIB_DRIVER_NEEDED
             else
                 driver_need=$MTHCA_DRIVER_NEEDED
@@ -411,6 +428,14 @@ if [ $NUM_HCAS -ne 0 ]; then
                         FW_NEEDED=$CONNECTIB_FW_NEEDED
                         DRIVER_NEEDED=$CONNECTIB_DRIVER_NEEDED
                         device_num=$mlx5_dev_num
+                    elif [ "$hca_name" == "$g_connectx4" ]; then
+                        FW_NEEDED=$CONNECTX4_FW_NEEDED
+                        DRIVER_NEEDED=$CONNECTIB_DRIVER_NEEDED
+                        device_num=$mlx5_dev_num
+                    elif [ "$hca_name" == "$g_connectx4lx" ]; then
+                        FW_NEEDED=$CONNECTX4LX_FW_NEEDED
+                        DRIVER_NEEDED=$CONNECTIB_DRIVER_NEEDED
+                        device_num=$mlx5_dev_num
                     elif [ "$hca_name" == "$g_InfiniHost" ]; then
                         FW_NEEDED=$TAVOR_FW_NEEDED
                     fi
@@ -421,7 +446,7 @@ if [ $NUM_HCAS -ne 0 ]; then
                     "$g_connectx"|"$g_connectx3"|"$g_connectx3_pro")
                         let "mlx_dev_num=$mlx_dev_num + 1"
                     ;;
-                    "$g_connectib")
+                    "$g_connectib"|"$g_connectx4"|"$g_connectx4lx")
                         let "mlx5_dev_num=$mlx5_dev_num + 1"
                     ;;                    *)
                         let "mthca_dev_num=$mthca_dev_num + 1"
diff --git a/small_utils/mcra.c b/small_utils/mcra.c
index 2fc9a30..9cdf872 100644
--- a/small_utils/mcra.c
+++ b/small_utils/mcra.c
@@ -59,7 +59,7 @@
 void usage(const char *n, int with_exit)
 {
     printf("  Mellanox Configuration Registers Access tool\n");
-    printf("  Usage: %s [-s <i2c-slave>] [-a <adb dump>] [-v] [-h] <device>\n", n);
+    printf("  Usage: %s [-s <i2c-slave>] [-a <adb dump>] [-v] [-h] [-c] <device>\n", n);
     printf("         <addr[.<bit offset>:<bit size>]|[,<bytes number>]> [data]\n");
     printf("         If data is given, operation is write. Otherwise it is read.\n");
     printf("         If a bit range is given in the address (E.G.: 0xf0014.16:8):\n");
@@ -71,6 +71,7 @@ void usage(const char *n, int with_exit)
            "                          number of dwords should be (bytes number/4).\n\n");
     printf("  -s <i2c-slave> : I2C slave address.\n");
     printf("  -a <dump file> : adb dump file, used for access by path.\n");
+    printf("  -c             : clear the device's PCI semaphore.\n");
     printf("  -h             : Print this help message.\n");
     printf("  -v             : Display version info\n");
     printf("\n");
@@ -100,6 +101,7 @@ int main(int argc, char *argv[])
     int           bit_size = 32;
     int           byte_size = 0;
     int           read_block = 0;       /* if 0 then read field according to "addr.bit:size", else read block of size "byte_size" */
+    int          clear_semaphore = 0;
     const char*   op_name = "cr write";
 
 #if 0
@@ -118,7 +120,7 @@ int main(int argc, char *argv[])
         usage(argv[0], 1);
     }
 
-    while ((c = getopt(argc, argv, "s:a:hv")) != -1) {
+    while ((c = getopt(argc, argv, "s:a:hvc")) != -1) {
         switch (c)  {
         case 's':
             i2c_slave  = strtoul(optarg, &endp, 0);
@@ -140,9 +142,13 @@ int main(int argc, char *argv[])
             usage(argv[0], 0);
             exit(0);
 
-        case '?':
+        case 'c':
+            clear_semaphore = 1;
             break;
 
+        case '?':
+            exit(1);
+
         default:
             fprintf(stderr, "-E- Unknown flag \"%c\"\n", c);
             exit(1);
@@ -158,6 +164,15 @@ int main(int argc, char *argv[])
         optind++;
     }
 
+    if (clear_semaphore) {
+        if ((rc = mclear_pci_semaphore(dev))) {
+            fprintf(stderr, "-E- Failed to clear PCI semaphore for device: %s. %s\n", dev, m_err2str((MError)rc));
+            exit(1);
+        }
+        printf("-I- PCI Semaphore cleared successfully.\n");
+        exit(0);
+    }
+
     if (optind >= argc) {
         fprintf(stderr, "-E- Missing address argument\n");
         exit(1);
@@ -251,7 +266,7 @@ int main(int argc, char *argv[])
     }
     strncpy(device, dev, MAX_DEV_LEN -1);
     // Do the job
-    mf = mopen((const char *)device);
+    mf = mopen_adv((const char *)device, (MType)(MST_DEFAULT | MST_CABLE));
     if (!mf) {
         perror("mopen");
         return 1;
diff --git a/small_utils/vpd.c b/small_utils/vpd.c
index 8cab06c..3c6d0ed 100644
--- a/small_utils/vpd.c
+++ b/small_utils/vpd.c
@@ -629,17 +629,17 @@ int main(int argc, char **argv)
 	return 0;
 
 usage:
-	fprintf(stderr, "Usage: %s [-m|-n] [-t ##] <file> [-- keyword ...]\n", argv[0]);
-	fprintf(stderr, "-h\tPrint this help.\n");
-	fprintf(stderr, "-v\tPrint tool version.\n");
-	fprintf(stderr, "-m\tDump raw VPD data to stdout.\n");
-	fprintf(stderr, "-n\tDo not validate check sum.\n");
-	fprintf(stderr, "-r\tDo not check and display the VPD_W tag in the vpd data.\n");
-	fprintf(stderr, "-t ##\tTime out after ## seconds. (Default is 30.)\n\n");
-	fprintf(stderr, "file\tThe PCI id number of the HCA (for example, \"2:00.0\"),\n");
-	fprintf(stderr, "\tthe device name (such as \"mlx4_0\")\n");
-	fprintf(stderr, "\tthe absolute path to the device (\"/sys/class/infiniband/mlx4_0/device\")\n");
-	fprintf(stderr, "\tor '-' to read VPD data from the standard input.\n\n");
-	fprintf(stderr, "keyword(s): Only display the requested information. (ID, PN, EC, SN, etc...)\n");
+	printf("Usage: %s [-m|-n] [-t ##] <file> [-- keyword ...]\n", argv[0]);
+	printf("-h\tPrint this help.\n");
+	printf("-v\tPrint tool version.\n");
+	printf("-m\tDump raw VPD data to stdout.\n");
+	printf("-n\tDo not validate check sum.\n");
+	printf("-r\tDo not check and display the VPD_W tag in the vpd data.\n");
+	printf("-t ##\tTime out after ## seconds. (Default is 30.)\n\n");
+	printf("file\tThe PCI id number of the HCA (for example, \"2:00.0\"),\n");
+	printf("\tthe device name (such as \"mlx4_0\")\n");
+	printf("\tthe absolute path to the device (\"/sys/class/infiniband/mlx4_0/device\")\n");
+	printf("\tor '-' to read VPD data from the standard input.\n\n");
+	printf("keyword(s): Only display the requested information. (ID, PN, EC, SN, etc...)\n");
 	return rc;
 }
diff --git a/mft_utils/Makefile.am b/tools_crypto/Makefile.am
similarity index 83%
copy from mft_utils/Makefile.am
copy to tools_crypto/Makefile.am
index ad9ad8e..784d94f 100644
--- a/mft_utils/Makefile.am
+++ b/tools_crypto/Makefile.am
@@ -1,5 +1,5 @@
 #--
-# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
+# Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -32,13 +32,9 @@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
 USER_DIR = $(top_srcdir)
-INCLUDES = -I. -I$(USER_DIR)/common
+AM_CPPFLAGS = -I$(USER_DIR) -I$(USER_DIR)/common
+AM_CFLAGS =  -MD -pipe -Wall -W -DMST_UL -g
 
-AM_CFLAGS = -MD -pipe -Wall -W -Werror
-
-noinst_HEADERS = mft_sig_handler.h errmsg.h
-
-noinst_LIBRARIES = libmftutils.a
-
-libmftutils_a_SOURCES =  mft_sig_handler.c errmsg.cpp
+noinst_LIBRARIES = libtools_crypto.a
+libtools_crypto_a_SOURCES = tools_md5.c tools_md5.h
 
diff --git a/cmdif/Makefile.in b/tools_crypto/Makefile.in
similarity index 94%
copy from cmdif/Makefile.in
copy to tools_crypto/Makefile.in
index 048ea79..47530e4 100644
--- a/cmdif/Makefile.in
+++ b/tools_crypto/Makefile.in
@@ -14,7 +14,8 @@
 
 @SET_MAKE@
 
-# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
+#--
+# Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -45,8 +46,6 @@
 # SOFTWARE.
 #--
 
-# Makefile.am -- Process this file with automake to produce Makefile.in
-
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
@@ -111,7 +110,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = cmdif
+subdir = tools_crypto
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/config/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -128,10 +127,10 @@ AM_V_AR = $(am__v_AR_ at AM_V@)
 am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
 am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
-libcmdif_a_AR = $(AR) $(ARFLAGS)
-libcmdif_a_LIBADD =
-am_libcmdif_a_OBJECTS = tools_cif.$(OBJEXT)
-libcmdif_a_OBJECTS = $(am_libcmdif_a_OBJECTS)
+libtools_crypto_a_AR = $(AR) $(ARFLAGS)
+libtools_crypto_a_LIBADD =
+am_libtools_crypto_a_OBJECTS = tools_md5.$(OBJEXT)
+libtools_crypto_a_OBJECTS = $(am_libtools_crypto_a_OBJECTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -170,8 +169,8 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libcmdif_a_SOURCES)
-DIST_SOURCES = $(libcmdif_a_SOURCES)
+SOURCES = $(libtools_crypto_a_SOURCES)
+DIST_SOURCES = $(libtools_crypto_a_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -264,6 +263,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -318,14 +318,13 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+
+# Makefile.am -- Process this file with automake to produce Makefile.in
 USER_DIR = $(top_srcdir)
-MTCR_DIR = $(USER_DIR)/include/mtcr_ul
-TOOLS_LAYOUTS_DIR = $(USER_DIR)/tools_layouts
-INCLUDES = -I. -I../common -I../tools_layouts  -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
-AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) -DCMDIF_EXPORTS
-CMDIF_VERSION = 1
-noinst_LIBRARIES = libcmdif.a
-libcmdif_a_SOURCES = tools_cif.c
+AM_CPPFLAGS = -I$(USER_DIR) -I$(USER_DIR)/common
+AM_CFLAGS = -MD -pipe -Wall -W -DMST_UL -g
+noinst_LIBRARIES = libtools_crypto.a
+libtools_crypto_a_SOURCES = tools_md5.c tools_md5.h
 all: all-am
 
 .SUFFIXES:
@@ -339,9 +338,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cmdif/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools_crypto/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign cmdif/Makefile
+	  $(AUTOMAKE) --foreign tools_crypto/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -364,10 +363,10 @@ $(am__aclocal_m4_deps):
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 
-libcmdif.a: $(libcmdif_a_OBJECTS) $(libcmdif_a_DEPENDENCIES) $(EXTRA_libcmdif_a_DEPENDENCIES) 
-	$(AM_V_at)-rm -f libcmdif.a
-	$(AM_V_AR)$(libcmdif_a_AR) libcmdif.a $(libcmdif_a_OBJECTS) $(libcmdif_a_LIBADD)
-	$(AM_V_at)$(RANLIB) libcmdif.a
+libtools_crypto.a: $(libtools_crypto_a_OBJECTS) $(libtools_crypto_a_DEPENDENCIES) $(EXTRA_libtools_crypto_a_DEPENDENCIES) 
+	$(AM_V_at)-rm -f libtools_crypto.a
+	$(AM_V_AR)$(libtools_crypto_a_AR) libtools_crypto.a $(libtools_crypto_a_OBJECTS) $(libtools_crypto_a_LIBADD)
+	$(AM_V_at)$(RANLIB) libtools_crypto.a
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -375,7 +374,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_cif.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_md5.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/mflash/mflash_access_layer.h b/tools_crypto/tools_md5.c
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to tools_crypto/tools_md5.c
index 23931fa..6b34b72
--- a/mflash/mflash_access_layer.h
+++ b/tools_crypto/tools_md5.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,12 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
-
-#include <compatibility.h>
-//#include "cib_cif.h"
-
-#include "mflash_common_structs.h"
-
-#define BOOT_CR_SPACE_ADDR 0xf0000
-
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
-
+#include <openssl/md5.h>
+#include "tools_md5.h"
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+u_int8_t *tools_md5(const u_int8_t* src, u_int32_t src_len, u_int8_t dst[16])
+{
+    return MD5((const unsigned char*)src, src_len, (unsigned char*)dst);
+}
diff --git a/mflash/mflash_access_layer.h b/tools_crypto/tools_md5.h
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to tools_crypto/tools_md5.h
index 23931fa..42296c7
--- a/mflash/mflash_access_layer.h
+++ b/tools_crypto/tools_md5.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,20 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
-
-#include <compatibility.h>
-//#include "cib_cif.h"
-
-#include "mflash_common_structs.h"
+#ifndef TOOLS_MD5_H
+#define TOOLS_MD5_H
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
+#include <common/compatibility.h>
+u_int8_t *tools_md5(const u_int8_t* src, u_int32_t src_len, u_int8_t dst[16]);
 
+#ifdef __cplusplus
+}
+#endif
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+#endif // TOOLS_MD5_H
diff --git a/tools_layouts/Makefile.am b/tools_layouts/Makefile.am
index f085849..7726c7f 100644
--- a/tools_layouts/Makefile.am
+++ b/tools_layouts/Makefile.am
@@ -31,13 +31,15 @@
 #--
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/mtcr_ul -I$(top_srcdir)/common
 AM_CFLAGS = -Wall -W -g -MP -MD -pipe $(COMPILER_FPIC)
-noinst_LIBRARIES = libtools_layouts.a
+
+noinst_LTLIBRARIES = libtools_layouts.a
 
 libtools_layouts_a_SOURCES = adb_to_c_utils.c adb_to_c_utils.h \
 				cibfw_layouts.c cibfw_layouts.h \
 				register_access_open_layouts.h register_access_open_layouts.c \
 				tools_open_layouts.c tools_open_layouts.h\
 				register_access_sib_layouts.h register_access_sib_layouts.c \
-				cx4fw_layouts.c cx4fw_layouts.h
+				cx4fw_layouts.c cx4fw_layouts.h\
+				connectib_layouts.c connectib_layouts.h
diff --git a/tools_layouts/Makefile.in b/tools_layouts/Makefile.in
index 5ba65f7..e2a9bcf 100644
--- a/tools_layouts/Makefile.in
+++ b/tools_layouts/Makefile.in
@@ -121,19 +121,17 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_ at AM_V@)
-am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
-am__v_AR_0 = @echo "  AR      " $@;
-am__v_AR_1 = 
-libtools_layouts_a_AR = $(AR) $(ARFLAGS)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
 libtools_layouts_a_LIBADD =
-am_libtools_layouts_a_OBJECTS = adb_to_c_utils.$(OBJEXT) \
-	cibfw_layouts.$(OBJEXT) register_access_open_layouts.$(OBJEXT) \
-	tools_open_layouts.$(OBJEXT) \
-	register_access_sib_layouts.$(OBJEXT) cx4fw_layouts.$(OBJEXT)
+am_libtools_layouts_a_OBJECTS = adb_to_c_utils.lo cibfw_layouts.lo \
+	register_access_open_layouts.lo tools_open_layouts.lo \
+	register_access_sib_layouts.lo cx4fw_layouts.lo \
+	connectib_layouts.lo
 libtools_layouts_a_OBJECTS = $(am_libtools_layouts_a_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -152,10 +150,6 @@ am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
@@ -266,6 +260,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -322,15 +317,16 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # Makefile.am -- Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/mtcr_ul -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/mtcr_ul -I$(top_srcdir)/common
 AM_CFLAGS = -Wall -W -g -MP -MD -pipe $(COMPILER_FPIC)
-noinst_LIBRARIES = libtools_layouts.a
+noinst_LTLIBRARIES = libtools_layouts.a
 libtools_layouts_a_SOURCES = adb_to_c_utils.c adb_to_c_utils.h \
 				cibfw_layouts.c cibfw_layouts.h \
 				register_access_open_layouts.h register_access_open_layouts.c \
 				tools_open_layouts.c tools_open_layouts.h\
 				register_access_sib_layouts.h register_access_sib_layouts.c \
-				cx4fw_layouts.c cx4fw_layouts.h
+				cx4fw_layouts.c cx4fw_layouts.h\
+				connectib_layouts.c connectib_layouts.h
 
 all: all-am
 
@@ -367,13 +363,19 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
-clean-noinstLIBRARIES:
-	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
 
 libtools_layouts.a: $(libtools_layouts_a_OBJECTS) $(libtools_layouts_a_DEPENDENCIES) $(EXTRA_libtools_layouts_a_DEPENDENCIES) 
-	$(AM_V_at)-rm -f libtools_layouts.a
-	$(AM_V_AR)$(libtools_layouts_a_AR) libtools_layouts.a $(libtools_layouts_a_OBJECTS) $(libtools_layouts_a_LIBADD)
-	$(AM_V_at)$(RANLIB) libtools_layouts.a
+	$(AM_V_CCLD)$(LINK)  $(libtools_layouts_a_OBJECTS) $(libtools_layouts_a_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -381,12 +383,13 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/adb_to_c_utils.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cibfw_layouts.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cx4fw_layouts.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/register_access_open_layouts.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/register_access_sib_layouts.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_open_layouts.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/adb_to_c_utils.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cibfw_layouts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/connectib_layouts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cx4fw_layouts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/register_access_open_layouts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/register_access_sib_layouts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_open_layouts.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -499,7 +502,7 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LTLIBRARIES)
 installdirs:
 install: install-am
 install-exec: install-exec-am
@@ -533,7 +536,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
 	mostlyclean-am
 
 distclean: distclean-am
@@ -605,7 +608,7 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
 	ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
diff --git a/tools_layouts/adb_to_c_utils.c b/tools_layouts/adb_to_c_utils.c
index cd39ab9..5b2b2c0 100644
--- a/tools_layouts/adb_to_c_utils.c
+++ b/tools_layouts/adb_to_c_utils.c
@@ -31,7 +31,7 @@
  */
 
 /***
- *** This file was generated at "2015-06-17 12:05:46"
+ *** This file was generated at "2016-04-22 14:35:59"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/tools_open/tools_open.adb --file-prefix tools_open --prefix tools_open_
  ***/
@@ -48,12 +48,12 @@ u_int32_t adb2c_calc_array_field_address(u_int32_t start_bit_offset, u_int32_t a
 {
     u_int32_t offs;
 
-	if (arr_elemnt_size > 32)
-	{
-		assert(!(arr_elemnt_size % 32));
-    	start_bit_offset += arr_elemnt_size*(u_int32_t)arr_idx;                                                                                     
-		return start_bit_offset;
-	}
+    if (arr_elemnt_size > 32)
+    {
+        assert(!(arr_elemnt_size % 32));
+        start_bit_offset += arr_elemnt_size*(u_int32_t)arr_idx;                                                                                     
+        return start_bit_offset;
+    }
 
     if (is_big_endian_arr)
     {
diff --git a/tools_layouts/adb_to_c_utils.h b/tools_layouts/adb_to_c_utils.h
index c0e22f1..ebbe933 100644
--- a/tools_layouts/adb_to_c_utils.h
+++ b/tools_layouts/adb_to_c_utils.h
@@ -31,7 +31,7 @@
  */
 
 /***
- *** This file was generated at "2015-06-17 12:05:46"
+ *** This file was generated at "2016-04-22 14:35:59"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/tools_open/tools_open.adb --file-prefix tools_open --prefix tools_open_
  ***/
diff --git a/tools_layouts/connectib_layouts.c b/tools_layouts/connectib_layouts.c
new file mode 100644
index 0000000..9b72bb4
--- /dev/null
+++ b/tools_layouts/connectib_layouts.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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 "connectib_layouts.h"
+
+void connectib_FW_VERSION_pack(const struct connectib_FW_VERSION *ptr_struct, u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=0;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->MAJOR);
+
+    offset=48;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->SUBMINOR);
+
+    offset=32;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->MINOR);
+
+    offset=80;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->Hour);
+
+    offset=72;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->Minutes);
+
+    offset=64;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->Seconds);
+
+    offset=120;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->Day);
+
+    offset=112;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->Month);
+
+    offset=96;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->Year);
+
+}
+
+void connectib_FW_VERSION_unpack(struct connectib_FW_VERSION *ptr_struct, const u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    u_int8_t val=0;
+    (void)val;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=0;
+    ptr_struct->MAJOR = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+    offset=48;
+    ptr_struct->SUBMINOR = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+    offset=32;
+    ptr_struct->MINOR = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+    offset=80;
+    ptr_struct->Hour = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+    offset=72;
+    ptr_struct->Minutes = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+    offset=64;
+    ptr_struct->Seconds = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+    offset=120;
+    ptr_struct->Day = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+    offset=112;
+    ptr_struct->Month = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+    offset=96;
+    ptr_struct->Year = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+}
+
+void connectib_FW_VERSION_print(const struct connectib_FW_VERSION *ptr_struct, FILE* file, int indent_level){
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "======== connectib_FW_VERSION ========\n");
+    int i=0;
+    (void)i;(void)ptr_struct;
+    (void)file;
+    (void)indent_level;
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "MAJOR                : "UH_FMT"\n", ptr_struct->MAJOR);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "SUBMINOR             : "UH_FMT"\n", ptr_struct->SUBMINOR);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "MINOR                : "UH_FMT"\n", ptr_struct->MINOR);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Hour                 : "UH_FMT"\n", ptr_struct->Hour);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Minutes              : "UH_FMT"\n", ptr_struct->Minutes);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Seconds              : "UH_FMT"\n", ptr_struct->Seconds);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Day                  : "UH_FMT"\n", ptr_struct->Day);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Month                : "UH_FMT"\n", ptr_struct->Month);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "Year                 : "UH_FMT"\n", ptr_struct->Year);
+
+}
+
+int connectib_FW_VERSION_size(void){
+     return 16;
+}
+
+void connectib_FW_VERSION_dump(const struct connectib_FW_VERSION *ptr_struct, FILE* file) {
+    connectib_FW_VERSION_print(ptr_struct, file, 0);
+}
+
+void connectib_icmd_get_fw_info_pack(const struct connectib_icmd_get_fw_info *ptr_struct, u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=0;
+    connectib_FW_VERSION_pack(&(ptr_struct->fw_version), ptr_buff + offset/8);
+
+    offset=144;
+    adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->hash_signature);
+
+}
+
+void connectib_icmd_get_fw_info_unpack(struct connectib_icmd_get_fw_info *ptr_struct, const u_int8_t* ptr_buff){
+    u_int32_t offset;
+    int i=0;
+    u_int8_t val=0;
+    (void)val;
+    (void)offset;
+    (void)i;
+    (void)ptr_struct;
+    (void)ptr_buff;
+
+    offset=0;
+    connectib_FW_VERSION_unpack(&(ptr_struct->fw_version), ptr_buff + offset/8);
+
+    offset=144;
+    ptr_struct->hash_signature = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+}
+
+void connectib_icmd_get_fw_info_print(const struct connectib_icmd_get_fw_info *ptr_struct, FILE* file, int indent_level){
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "======== connectib_icmd_get_fw_info ========\n");
+    int i=0;
+    (void)i;(void)ptr_struct;
+    (void)file;
+    (void)indent_level;
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "fw_version:\n");
+    connectib_FW_VERSION_print(&(ptr_struct->fw_version), file, indent_level + 1);
+
+    adb2c_add_indentation(file, indent_level);
+    fprintf(file, "hash_signature       : "UH_FMT"\n", ptr_struct->hash_signature);
+
+}
+
+int connectib_icmd_get_fw_info_size(void){
+     return 32;
+}
+
+void connectib_icmd_get_fw_info_dump(const struct connectib_icmd_get_fw_info *ptr_struct, FILE* file) {
+    connectib_icmd_get_fw_info_print(ptr_struct, file, 0);
+}
+
diff --git a/tools_layouts/connectib_layouts.h b/tools_layouts/connectib_layouts.h
new file mode 100644
index 0000000..3681455
--- /dev/null
+++ b/tools_layouts/connectib_layouts.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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.
+ */
+
+#ifndef CONNECTIB_LAYOUTS_H
+#define CONNECTIB_LAYOUTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "adb_to_c_utils.h"
+
+/* Description -   */
+/* Size in bytes - 16 */
+struct connectib_FW_VERSION {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+    /* Description -  */
+    /* 0.16 - 4.31 */
+     u_int16_t MAJOR;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+    /* Description -  */
+    /* 4.0 - 4.15 */
+     u_int16_t SUBMINOR;
+    /* Description -  */
+    /* 4.16 - 8.31 */
+     u_int16_t MINOR;
+/*---------------- DWORD[2] (Offset 0x8) ----------------*/
+    /* Description -  */
+    /* 8.8 - 8.15 */
+     u_int8_t Hour;
+    /* Description -  */
+    /* 8.16 - 8.23 */
+     u_int8_t Minutes;
+    /* Description -  */
+    /* 8.24 - 12.31 */
+     u_int8_t Seconds;
+/*---------------- DWORD[3] (Offset 0xc) ----------------*/
+    /* Description -  */
+    /* 12.0 - 12.7 */
+     u_int8_t Day;
+    /* Description -  */
+    /* 12.8 - 12.15 */
+     u_int8_t Month;
+    /* Description -  */
+    /* 12.16 - 16.31 */
+     u_int16_t Year;
+};
+
+/* Description -   */
+/* Size in bytes - 32 */
+struct connectib_icmd_get_fw_info {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+    /* Description -  */
+    /* 0.0 - 16.31 */
+     struct connectib_FW_VERSION fw_version;
+/*---------------- DWORD[4] (Offset 0x10) ----------------*/
+    /* Description - Hash gen file signature */
+    /* 16.0 - 16.15 */
+     u_int16_t hash_signature;
+};
+
+/* FW_VERSION */
+void connectib_FW_VERSION_pack(const struct connectib_FW_VERSION *ptr_struct, u_int8_t* ptr_buff);
+void connectib_FW_VERSION_unpack(struct connectib_FW_VERSION *ptr_struct, const u_int8_t* ptr_buff);
+void connectib_FW_VERSION_print(const struct connectib_FW_VERSION *ptr_struct, FILE* file, int indent_level);
+int connectib_FW_VERSION_size(void);
+#define CONNECTIB_FW_VERSION_SIZE    (0x10)
+/* icmd_get_fw_info */
+void connectib_icmd_get_fw_info_pack(const struct connectib_icmd_get_fw_info *ptr_struct, u_int8_t* ptr_buff);
+void connectib_icmd_get_fw_info_unpack(struct connectib_icmd_get_fw_info *ptr_struct, const u_int8_t* ptr_buff);
+void connectib_icmd_get_fw_info_print(const struct connectib_icmd_get_fw_info *ptr_struct, FILE* file, int indent_level);
+int connectib_icmd_get_fw_info_size(void);
+#define CONNECTIB_ICMD_GET_FW_INFO_SIZE    (0x20)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // CONNECTIB_LAYOUTS_H
diff --git a/tools_layouts/cx4fw_layouts.c b/tools_layouts/cx4fw_layouts.c
index d723ac7..2eeb44d 100644
--- a/tools_layouts/cx4fw_layouts.c
+++ b/tools_layouts/cx4fw_layouts.c
@@ -29,7 +29,6 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
- 
 
 /***
  *** This file was generated at "2015-04-20 13:45:40"
diff --git a/tools_layouts/register_access_open_layouts.c b/tools_layouts/register_access_open_layouts.c
index 7387ba7..c6d2e8f 100644
--- a/tools_layouts/register_access_open_layouts.c
+++ b/tools_layouts/register_access_open_layouts.c
@@ -29,75 +29,78 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+ 
 
 /***
- *** This file was generated at "2015-02-05 17:01:35"
+ *** This file was generated at "2016-05-02 14:45:27"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/register_access_open/register_access_open.adb --file-prefix register_access_open --prefix register_access_
  ***/
 #include "register_access_open_layouts.h"
 
-void register_access_mfba_pack(const struct register_access_mfba *ptr_struct, u_int8_t* ptr_buff){
+void register_access_mfba_pack(const struct register_access_mfba *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->fs);
 
-	offset=23;
+	offset = 23;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->p);
 
-	offset=55;
+	offset = 55;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 9, (u_int32_t)ptr_struct->size);
 
-	offset=72;
+	offset = 72;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->address);
 
-	for (i=0; i < 64; i++) {
-	offset=adb2c_calc_array_field_address(96, 32, i, 2144, 0);
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(96, 32, i, 2144, 0);
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->data[i]);
 	}
 
 }
 
-void register_access_mfba_unpack(struct register_access_mfba *ptr_struct, const u_int8_t* ptr_buff){
+void register_access_mfba_unpack(struct register_access_mfba *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	ptr_struct->fs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=23;
+	offset = 23;
 	ptr_struct->p = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=55;
+	offset = 55;
 	ptr_struct->size = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 9);
 
-	offset=72;
+	offset = 72;
 	ptr_struct->address = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
-	for (i=0; i < 64; i++) {
-	offset=adb2c_calc_array_field_address(96, 32, i, 2144, 0);
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(96, 32, i, 2144, 0);
 	ptr_struct->data[i] = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 	}
 
 }
 
-void register_access_mfba_print(const struct register_access_mfba *ptr_struct, FILE* file, int indent_level){
+void register_access_mfba_print(const struct register_access_mfba *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== register_access_mfba ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -113,96 +116,112 @@ void register_access_mfba_print(const struct register_access_mfba *ptr_struct, F
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "address              : "UH_FMT"\n", ptr_struct->address);
 
-	for (i=0; i < 64; i++) {
+	for (i = 0; i < 64; i++) {
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "data_%03d            : "U32H_FMT"\n", i, ptr_struct->data[i]);
 	}
 
 }
 
-int register_access_mfba_size(void){
+int register_access_mfba_size(void)
+{
 	 return 268;
 }
 
-void register_access_mfba_dump(const struct register_access_mfba *ptr_struct, FILE* file) {
+void register_access_mfba_dump(const struct register_access_mfba *ptr_struct, FILE* file)
+{
 	register_access_mfba_print(ptr_struct, file, 0);
 }
 
-void register_access_mfpa_pack(const struct register_access_mfpa *ptr_struct, u_int8_t* ptr_buff){
+void register_access_mfpa_pack(const struct register_access_mfpa *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->fs);
 
-	offset=23;
+	offset = 23;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->p);
 
-	offset=40;
+	offset = 40;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->boot_address);
 
-	offset=156;
+	offset = 156;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->flash_num);
 
-	offset=168;
+	offset = 130;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->bulk_64kb_erase_en);
+
+	offset = 129;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->bulk_32kb_erase_en);
+
+	offset = 168;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->jedec_id);
 
-	offset=214;
+	offset = 214;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->sector_size);
 
-	offset=200;
+	offset = 200;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->block_allignment);
 
-	offset=224;
+	offset = 224;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->capability_mask);
 
 }
 
-void register_access_mfpa_unpack(struct register_access_mfpa *ptr_struct, const u_int8_t* ptr_buff){
+void register_access_mfpa_unpack(struct register_access_mfpa *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	ptr_struct->fs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=23;
+	offset = 23;
 	ptr_struct->p = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=40;
+	offset = 40;
 	ptr_struct->boot_address = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
-	offset=156;
+	offset = 156;
 	ptr_struct->flash_num = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=168;
+	offset = 130;
+	ptr_struct->bulk_64kb_erase_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 129;
+	ptr_struct->bulk_32kb_erase_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 168;
 	ptr_struct->jedec_id = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
-	offset=214;
+	offset = 214;
 	ptr_struct->sector_size = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=200;
+	offset = 200;
 	ptr_struct->block_allignment = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=224;
+	offset = 224;
 	ptr_struct->capability_mask = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void register_access_mfpa_print(const struct register_access_mfpa *ptr_struct, FILE* file, int indent_level){
+void register_access_mfpa_print(const struct register_access_mfpa *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== register_access_mfpa ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -219,6 +238,12 @@ void register_access_mfpa_print(const struct register_access_mfpa *ptr_struct, F
 	fprintf(file, "flash_num            : "UH_FMT"\n", ptr_struct->flash_num);
 
 	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "bulk_64kb_erase_en   : "UH_FMT"\n", ptr_struct->bulk_64kb_erase_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "bulk_32kb_erase_en   : "UH_FMT"\n", ptr_struct->bulk_32kb_erase_en);
+
+	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "jedec_id             : "UH_FMT"\n", ptr_struct->jedec_id);
 
 	adb2c_add_indentation(file, indent_level);
@@ -232,59 +257,75 @@ void register_access_mfpa_print(const struct register_access_mfpa *ptr_struct, F
 
 }
 
-int register_access_mfpa_size(void){
-	 return 36;
+int register_access_mfpa_size(void)
+{
+	 return 32;
 }
 
-void register_access_mfpa_dump(const struct register_access_mfpa *ptr_struct, FILE* file) {
+void register_access_mfpa_dump(const struct register_access_mfpa *ptr_struct, FILE* file)
+{
 	register_access_mfpa_print(ptr_struct, file, 0);
 }
 
-void register_access_mfbe_pack(const struct register_access_mfbe *ptr_struct, u_int8_t* ptr_buff){
+void register_access_mfbe_pack(const struct register_access_mfbe *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->fs);
 
-	offset=23;
+	offset = 23;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->p);
 
-	offset=72;
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->bulk_64kb_erase);
+
+	offset = 1;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->bulk_32kb_erase);
+
+	offset = 72;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->address);
 
 }
 
-void register_access_mfbe_unpack(struct register_access_mfbe *ptr_struct, const u_int8_t* ptr_buff){
+void register_access_mfbe_unpack(struct register_access_mfbe *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=26;
+	offset = 26;
 	ptr_struct->fs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=23;
+	offset = 23;
 	ptr_struct->p = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=72;
+	offset = 2;
+	ptr_struct->bulk_64kb_erase = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 1;
+	ptr_struct->bulk_32kb_erase = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 72;
 	ptr_struct->address = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
 }
 
-void register_access_mfbe_print(const struct register_access_mfbe *ptr_struct, FILE* file, int indent_level){
+void register_access_mfbe_print(const struct register_access_mfbe *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== register_access_mfbe ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -295,15 +336,23 @@ void register_access_mfbe_print(const struct register_access_mfbe *ptr_struct, F
 	fprintf(file, "p                    : "UH_FMT"\n", ptr_struct->p);
 
 	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "bulk_64kb_erase      : "UH_FMT"\n", ptr_struct->bulk_64kb_erase);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "bulk_32kb_erase      : "UH_FMT"\n", ptr_struct->bulk_32kb_erase);
+
+	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "address              : "UH_FMT"\n", ptr_struct->address);
 
 }
 
-int register_access_mfbe_size(void){
+int register_access_mfbe_size(void)
+{
 	 return 12;
 }
 
-void register_access_mfbe_dump(const struct register_access_mfbe *ptr_struct, FILE* file) {
+void register_access_mfbe_dump(const struct register_access_mfbe *ptr_struct, FILE* file)
+{
 	register_access_mfbe_print(ptr_struct, file, 0);
 }
 
@@ -317,11 +366,13 @@ void register_access_register_access_open_Nodes_unpack(union register_access_reg
 	register_access_mfba_unpack(&(ptr_struct->mfba), ptr_buff);
 }
 
-void register_access_register_access_open_Nodes_print(const union register_access_register_access_open_Nodes *ptr_struct, FILE* file, int indent_level){
+void register_access_register_access_open_Nodes_print(const union register_access_register_access_open_Nodes *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== register_access_register_access_open_Nodes ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -339,11 +390,13 @@ void register_access_register_access_open_Nodes_print(const union register_acces
 
 }
 
-int register_access_register_access_open_Nodes_size(void){
+int register_access_register_access_open_Nodes_size(void)
+{
 	 return 268;
 }
 
-void register_access_register_access_open_Nodes_dump(const union register_access_register_access_open_Nodes *ptr_struct, FILE* file) {
+void register_access_register_access_open_Nodes_dump(const union register_access_register_access_open_Nodes *ptr_struct, FILE* file)
+{
 	register_access_register_access_open_Nodes_print(ptr_struct, file, 0);
 }
 
diff --git a/tools_layouts/register_access_open_layouts.h b/tools_layouts/register_access_open_layouts.h
index 8ca4e39..e455493 100644
--- a/tools_layouts/register_access_open_layouts.h
+++ b/tools_layouts/register_access_open_layouts.h
@@ -30,8 +30,9 @@
  * SOFTWARE.
  */
 
+
 /***
- *** This file was generated at "2015-06-17 12:05:44"
+ *** This file was generated at "2016-05-02 14:45:27"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/register_access_open/register_access_open.adb --file-prefix register_access_open --prefix register_access_
  ***/
@@ -68,7 +69,7 @@ struct register_access_mfba {
 };
 
 /* Description -   */
-/* Size in bytes - 36 */
+/* Size in bytes - 32 */
 struct register_access_mfpa {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
 	/* Description - Flash Select */
@@ -85,6 +86,12 @@ struct register_access_mfpa {
 	/* Description - number of flash devices connected */
 	/* 16.0 - 16.3 */
 	 u_int8_t flash_num;
+	/* Description - If set, MFBE register supports 64KB bulk erase operation. */
+	/* 16.29 - 16.29 */
+	 u_int8_t bulk_64kb_erase_en;
+	/* Description - If set, MFBE register supports 32KB bulk erase operation. */
+	/* 16.30 - 16.30 */
+	 u_int8_t bulk_32kb_erase_en;
 /*---------------- DWORD[5] (Offset 0x14) ----------------*/
 	/* Description - Flash JEDEC ID */
 	/* 20.0 - 20.23 */
@@ -112,6 +119,12 @@ struct register_access_mfbe {
 	/* Description - Parallel */
 	/* 0.8 - 0.8 */
 	 u_int8_t p;
+	/* Description - Erase a 64KB flash area in one bulk operation. */
+	/* 0.29 - 0.29 */
+	 u_int8_t bulk_64kb_erase;
+	/* Description - Erase a 32KB flash area in one bulk operation. */
+	/* 0.30 - 0.30 */
+	 u_int8_t bulk_32kb_erase;
 /*---------------- DWORD[2] (Offset 0x8) ----------------*/
 	/* Description - address in bytes */
 	/* 8.0 - 8.23 */
@@ -126,7 +139,7 @@ union register_access_register_access_open_Nodes {
 	/* 0.0 - 12.31 */
 	 struct register_access_mfbe mfbe;
 	/* Description -  */
-	/* 0.0 - 36.31 */
+	/* 0.0 - 32.31 */
 	 struct register_access_mfpa mfpa;
 	/* Description -  */
 	/* 0.0 - 268.31 */
@@ -147,7 +160,7 @@ void register_access_mfpa_pack(const struct register_access_mfpa *ptr_struct, u_
 void register_access_mfpa_unpack(struct register_access_mfpa *ptr_struct, const u_int8_t* ptr_buff);
 void register_access_mfpa_print(const struct register_access_mfpa *ptr_struct, FILE* file, int indent_level);
 int register_access_mfpa_size(void);
-#define REGISTER_ACCESS_MFPA_SIZE    (0x24)
+#define REGISTER_ACCESS_MFPA_SIZE    (0x20)
 void register_access_mfpa_dump(const struct register_access_mfpa *ptr_struct, FILE* file);
 /* mfbe */
 void register_access_mfbe_pack(const struct register_access_mfbe *ptr_struct, u_int8_t* ptr_buff);
diff --git a/tools_layouts/tools_open_layouts.c b/tools_layouts/tools_open_layouts.c
index fa3945a..a5858eb 100644
--- a/tools_layouts/tools_open_layouts.c
+++ b/tools_layouts/tools_open_layouts.c
@@ -29,47 +29,50 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+ 
 
 /***
- *** This file was generated at "2015-08-31 18:48:47"
+ *** This file was generated at "2016-05-09 12:11:56"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/tools_open/tools_open.adb --file-prefix tools_open --prefix tools_open_
  ***/
 #include "tools_open_layouts.h"
 
-void tools_open_tlv_type_dw_pack(const struct tools_open_tlv_type_dw *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_tlv_type_dw_pack(const struct tools_open_tlv_type_dw *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->tlv_type_dw);
 
 }
 
-void tools_open_tlv_type_dw_unpack(struct tools_open_tlv_type_dw *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_tlv_type_dw_unpack(struct tools_open_tlv_type_dw *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	ptr_struct->tlv_type_dw = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_tlv_type_dw_print(const struct tools_open_tlv_type_dw *ptr_struct, FILE* file, int indent_level){
+void tools_open_tlv_type_dw_print(const struct tools_open_tlv_type_dw *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_tlv_type_dw ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -78,59 +81,63 @@ void tools_open_tlv_type_dw_print(const struct tools_open_tlv_type_dw *ptr_struc
 
 }
 
-int tools_open_tlv_type_dw_size(void){
+int tools_open_tlv_type_dw_size(void)
+{
 	 return 4;
 }
 
-void tools_open_tlv_type_dw_dump(const struct tools_open_tlv_type_dw *ptr_struct, FILE* file) {
+void tools_open_tlv_type_dw_dump(const struct tools_open_tlv_type_dw *ptr_struct, FILE* file)
+{
 	tools_open_tlv_type_dw_print(ptr_struct, file, 0);
 }
 
-void tools_open_per_port_type_pack(const struct tools_open_per_port_type *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_per_port_type_pack(const struct tools_open_per_port_type *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->param_idx);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->port);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->param_class);
 
 }
 
-void tools_open_per_port_type_unpack(struct tools_open_per_port_type *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_per_port_type_unpack(struct tools_open_per_port_type *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->param_idx = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->port = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->param_class = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_per_port_type_print(const struct tools_open_per_port_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_per_port_type_print(const struct tools_open_per_port_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_per_port_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -145,65 +152,69 @@ void tools_open_per_port_type_print(const struct tools_open_per_port_type *ptr_s
 
 }
 
-int tools_open_per_port_type_size(void){
+int tools_open_per_port_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_per_port_type_dump(const struct tools_open_per_port_type *ptr_struct, FILE* file) {
+void tools_open_per_port_type_dump(const struct tools_open_per_port_type *ptr_struct, FILE* file)
+{
 	tools_open_per_port_type_print(ptr_struct, file, 0);
 }
 
-void tools_open_bmc_type_pack(const struct tools_open_bmc_type *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_bmc_type_pack(const struct tools_open_bmc_type *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=19;
+	offset = 19;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 13, (u_int32_t)ptr_struct->param_idx);
 
-	offset=14;
+	offset = 14;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 5, (u_int32_t)ptr_struct->channel);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->host);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->param_class);
 
 }
 
-void tools_open_bmc_type_unpack(struct tools_open_bmc_type *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_bmc_type_unpack(struct tools_open_bmc_type *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=19;
+	offset = 19;
 	ptr_struct->param_idx = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 13);
 
-	offset=14;
+	offset = 14;
 	ptr_struct->channel = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 5);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->host = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->param_class = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_bmc_type_print(const struct tools_open_bmc_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_bmc_type_print(const struct tools_open_bmc_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_bmc_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -221,65 +232,69 @@ void tools_open_bmc_type_print(const struct tools_open_bmc_type *ptr_struct, FIL
 
 }
 
-int tools_open_bmc_type_size(void){
+int tools_open_bmc_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_bmc_type_dump(const struct tools_open_bmc_type *ptr_struct, FILE* file) {
+void tools_open_bmc_type_dump(const struct tools_open_bmc_type *ptr_struct, FILE* file)
+{
 	tools_open_bmc_type_print(ptr_struct, file, 0);
 }
 
-void tools_open_per_host_type_pack(const struct tools_open_per_host_type *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_per_host_type_pack(const struct tools_open_per_host_type *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=22;
+	offset = 22;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->param_idx);
 
-	offset=14;
+	offset = 14;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->function);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->host);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->param_class);
 
 }
 
-void tools_open_per_host_type_unpack(struct tools_open_per_host_type *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_per_host_type_unpack(struct tools_open_per_host_type *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=22;
+	offset = 22;
 	ptr_struct->param_idx = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=14;
+	offset = 14;
 	ptr_struct->function = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->host = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->param_class = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_per_host_type_print(const struct tools_open_per_host_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_per_host_type_print(const struct tools_open_per_host_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_per_host_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -297,65 +312,69 @@ void tools_open_per_host_type_print(const struct tools_open_per_host_type *ptr_s
 
 }
 
-int tools_open_per_host_type_size(void){
+int tools_open_per_host_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_per_host_type_dump(const struct tools_open_per_host_type *ptr_struct, FILE* file) {
+void tools_open_per_host_type_dump(const struct tools_open_per_host_type *ptr_struct, FILE* file)
+{
 	tools_open_per_host_type_print(ptr_struct, file, 0);
 }
 
-void tools_open_eswitch_type_pack(const struct tools_open_eswitch_type *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_eswitch_type_pack(const struct tools_open_eswitch_type *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->param_idx);
 
-	offset=14;
+	offset = 14;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->port);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->host);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->param_class);
 
 }
 
-void tools_open_eswitch_type_unpack(struct tools_open_eswitch_type *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_eswitch_type_unpack(struct tools_open_eswitch_type *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->param_idx = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=14;
+	offset = 14;
 	ptr_struct->port = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->host = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->param_class = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_eswitch_type_print(const struct tools_open_eswitch_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_eswitch_type_print(const struct tools_open_eswitch_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_eswitch_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -373,53 +392,57 @@ void tools_open_eswitch_type_print(const struct tools_open_eswitch_type *ptr_str
 
 }
 
-int tools_open_eswitch_type_size(void){
+int tools_open_eswitch_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_eswitch_type_dump(const struct tools_open_eswitch_type *ptr_struct, FILE* file) {
+void tools_open_eswitch_type_dump(const struct tools_open_eswitch_type *ptr_struct, FILE* file)
+{
 	tools_open_eswitch_type_print(ptr_struct, file, 0);
 }
 
-void tools_open_global_type_pack(const struct tools_open_global_type *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_global_type_pack(const struct tools_open_global_type *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->param_idx);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->param_class);
 
 }
 
-void tools_open_global_type_unpack(struct tools_open_global_type *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_global_type_unpack(struct tools_open_global_type *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=8;
+	offset = 8;
 	ptr_struct->param_idx = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->param_class = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_global_type_print(const struct tools_open_global_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_global_type_print(const struct tools_open_global_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_global_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -431,11 +454,13 @@ void tools_open_global_type_print(const struct tools_open_global_type *ptr_struc
 
 }
 
-int tools_open_global_type_size(void){
+int tools_open_global_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_global_type_dump(const struct tools_open_global_type *ptr_struct, FILE* file) {
+void tools_open_global_type_dump(const struct tools_open_global_type *ptr_struct, FILE* file)
+{
 	tools_open_global_type_print(ptr_struct, file, 0);
 }
 
@@ -449,11 +474,13 @@ void tools_open_tlv_type_unpack(union tools_open_tlv_type *ptr_struct, const u_i
 	tools_open_tlv_type_dw_unpack(&(ptr_struct->tlv_type_dw), ptr_buff);
 }
 
-void tools_open_tlv_type_print(const union tools_open_tlv_type *ptr_struct, FILE* file, int indent_level){
+void tools_open_tlv_type_print(const union tools_open_tlv_type *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_tlv_type ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -483,53 +510,226 @@ void tools_open_tlv_type_print(const union tools_open_tlv_type *ptr_struct, FILE
 
 }
 
-int tools_open_tlv_type_size(void){
+int tools_open_tlv_type_size(void)
+{
 	 return 4;
 }
 
-void tools_open_tlv_type_dump(const union tools_open_tlv_type *ptr_struct, FILE* file) {
+void tools_open_tlv_type_dump(const union tools_open_tlv_type *ptr_struct, FILE* file)
+{
 	tools_open_tlv_type_print(ptr_struct, file, 0);
 }
 
-void tools_open_pmdio_addr_data_pack(const struct tools_open_pmdio_addr_data *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_ts_entry_pack(const struct tools_open_ts_entry *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 24;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->ts_day);
+
+	offset = 16;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->ts_month);
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->ts_year);
+
+	offset = 48;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->ts_seconds);
+
+	offset = 40;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->ts_minutes);
+
+	offset = 32;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->ts_hour);
+
+}
+
+void tools_open_ts_entry_unpack(struct tools_open_ts_entry *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 24;
+	ptr_struct->ts_day = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 16;
+	ptr_struct->ts_month = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 0;
+	ptr_struct->ts_year = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+	offset = 48;
+	ptr_struct->ts_seconds = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 40;
+	ptr_struct->ts_minutes = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 32;
+	ptr_struct->ts_hour = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+}
+
+void tools_open_ts_entry_print(const struct tools_open_ts_entry *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_ts_entry ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_day               : "UH_FMT"\n", ptr_struct->ts_day);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_month             : "UH_FMT"\n", ptr_struct->ts_month);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_year              : "UH_FMT"\n", ptr_struct->ts_year);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_seconds           : "UH_FMT"\n", ptr_struct->ts_seconds);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_minutes           : "UH_FMT"\n", ptr_struct->ts_minutes);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_hour              : "UH_FMT"\n", ptr_struct->ts_hour);
+
+}
+
+int tools_open_ts_entry_size(void)
+{
+	 return 8;
+}
+
+void tools_open_ts_entry_dump(const struct tools_open_ts_entry *ptr_struct, FILE* file)
+{
+	tools_open_ts_entry_print(ptr_struct, file, 0);
+}
+
+void tools_open_fw_version_pack(const struct tools_open_fw_version *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->fw_ver_major);
+
+	offset = 48;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->fw_ver_subminor);
+
+	offset = 32;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->fw_ver_minor);
+
+}
+
+void tools_open_fw_version_unpack(struct tools_open_fw_version *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	ptr_struct->fw_ver_major = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+	offset = 48;
+	ptr_struct->fw_ver_subminor = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+	offset = 32;
+	ptr_struct->fw_ver_minor = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+}
+
+void tools_open_fw_version_print(const struct tools_open_fw_version *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_fw_version ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_ver_major         : "UH_FMT"\n", ptr_struct->fw_ver_major);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_ver_subminor      : "UH_FMT"\n", ptr_struct->fw_ver_subminor);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_ver_minor         : "UH_FMT"\n", ptr_struct->fw_ver_minor);
+
+}
+
+int tools_open_fw_version_size(void)
+{
+	 return 8;
+}
+
+void tools_open_fw_version_dump(const struct tools_open_fw_version *ptr_struct, FILE* file)
+{
+	tools_open_fw_version_print(ptr_struct, file, 0);
+}
+
+void tools_open_pmdio_addr_data_pack(const struct tools_open_pmdio_addr_data *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->data);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->addr);
 
 }
 
-void tools_open_pmdio_addr_data_unpack(struct tools_open_pmdio_addr_data *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_pmdio_addr_data_unpack(struct tools_open_pmdio_addr_data *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->data = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->addr = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
 }
 
-void tools_open_pmdio_addr_data_print(const struct tools_open_pmdio_addr_data *ptr_struct, FILE* file, int indent_level){
+void tools_open_pmdio_addr_data_print(const struct tools_open_pmdio_addr_data *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_pmdio_addr_data ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -541,83 +741,93 @@ void tools_open_pmdio_addr_data_print(const struct tools_open_pmdio_addr_data *p
 
 }
 
-int tools_open_pmdio_addr_data_size(void){
+int tools_open_pmdio_addr_data_size(void)
+{
 	 return 4;
 }
 
-void tools_open_pmdio_addr_data_dump(const struct tools_open_pmdio_addr_data *ptr_struct, FILE* file) {
+void tools_open_pmdio_addr_data_dump(const struct tools_open_pmdio_addr_data *ptr_struct, FILE* file)
+{
 	tools_open_pmdio_addr_data_print(ptr_struct, file, 0);
 }
 
-void tools_open_nv_hdr_fifth_gen_pack(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_nv_hdr_fifth_gen_pack(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->length);
 
-	offset=20;
+	offset = 20;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->shadow);
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->version);
 
-	offset=7;
+	offset = 9;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_supported);
+
+	offset = 8;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_);
+
+	offset = 7;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->rd_en);
 
-	offset=6;
+	offset = 6;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->over_en);
 
-	offset=3;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_);
-
-	offset=32;
+	offset = 32;
 	tools_open_tlv_type_pack(&(ptr_struct->type), ptr_buff + offset/8);
 
 }
 
-void tools_open_nv_hdr_fifth_gen_unpack(struct tools_open_nv_hdr_fifth_gen *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_nv_hdr_fifth_gen_unpack(struct tools_open_nv_hdr_fifth_gen *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	ptr_struct->length = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=20;
+	offset = 20;
 	ptr_struct->shadow = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=16;
+	offset = 16;
 	ptr_struct->version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=7;
+	offset = 9;
+	ptr_struct->default_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 8;
+	ptr_struct->default_ = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 7;
 	ptr_struct->rd_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=6;
+	offset = 6;
 	ptr_struct->over_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=3;
-	ptr_struct->default_ = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
-
-	offset=32;
+	offset = 32;
 	tools_open_tlv_type_unpack(&(ptr_struct->type), ptr_buff + offset/8);
 
 }
 
-void tools_open_nv_hdr_fifth_gen_print(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, FILE* file, int indent_level){
+void tools_open_nv_hdr_fifth_gen_print(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_nv_hdr_fifth_gen ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -631,13 +841,16 @@ void tools_open_nv_hdr_fifth_gen_print(const struct tools_open_nv_hdr_fifth_gen
 	fprintf(file, "version              : "UH_FMT"\n", ptr_struct->version);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "rd_en                : "UH_FMT"\n", ptr_struct->rd_en);
+	fprintf(file, "default_supported    : "UH_FMT"\n", ptr_struct->default_supported);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "over_en              : "UH_FMT"\n", ptr_struct->over_en);
+	fprintf(file, "default_             : "UH_FMT"\n", ptr_struct->default_);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_             : "UH_FMT"\n", ptr_struct->default_);
+	fprintf(file, "rd_en                : "UH_FMT"\n", ptr_struct->rd_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "over_en              : "UH_FMT"\n", ptr_struct->over_en);
 
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "type:\n");
@@ -645,77 +858,145 @@ void tools_open_nv_hdr_fifth_gen_print(const struct tools_open_nv_hdr_fifth_gen
 
 }
 
-int tools_open_nv_hdr_fifth_gen_size(void){
+int tools_open_nv_hdr_fifth_gen_size(void)
+{
 	 return 12;
 }
 
-void tools_open_nv_hdr_fifth_gen_dump(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, FILE* file) {
+void tools_open_nv_hdr_fifth_gen_dump(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, FILE* file)
+{
 	tools_open_nv_hdr_fifth_gen_print(ptr_struct, file, 0);
 }
 
-void tools_open_nv_hdr_pack(const struct tools_open_nv_hdr *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_timestamp_pack(const struct tools_open_timestamp *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_fw_version_pack(&(ptr_struct->fw_version), ptr_buff + offset/8);
+
+	offset = 64;
+	tools_open_ts_entry_pack(&(ptr_struct->ts_entry), ptr_buff + offset/8);
+
+}
+
+void tools_open_timestamp_unpack(struct tools_open_timestamp *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_fw_version_unpack(&(ptr_struct->fw_version), ptr_buff + offset/8);
+
+	offset = 64;
+	tools_open_ts_entry_unpack(&(ptr_struct->ts_entry), ptr_buff + offset/8);
+
+}
+
+void tools_open_timestamp_print(const struct tools_open_timestamp *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_timestamp ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_version:\n");
+	tools_open_fw_version_print(&(ptr_struct->fw_version), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "ts_entry:\n");
+	tools_open_ts_entry_print(&(ptr_struct->ts_entry), file, indent_level + 1);
+
+}
+
+int tools_open_timestamp_size(void)
+{
+	 return 16;
+}
+
+void tools_open_timestamp_dump(const struct tools_open_timestamp *ptr_struct, FILE* file)
+{
+	tools_open_timestamp_print(ptr_struct, file, 0);
+}
+
+void tools_open_nv_hdr_pack(const struct tools_open_nv_hdr *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->type);
 
-	offset=2;
+	offset = 2;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->length);
 
-	offset=40;
+	offset = 40;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->type_mod);
 
-	offset=39;
+	offset = 39;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->shadow);
 
-	offset=37;
+	offset = 37;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->pad_cnt);
 
-	offset=32;
+	offset = 32;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->version);
 
 }
 
-void tools_open_nv_hdr_unpack(struct tools_open_nv_hdr *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_nv_hdr_unpack(struct tools_open_nv_hdr *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->type = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=2;
+	offset = 2;
 	ptr_struct->length = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
 
-	offset=40;
+	offset = 40;
 	ptr_struct->type_mod = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=39;
+	offset = 39;
 	ptr_struct->shadow = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=37;
+	offset = 37;
 	ptr_struct->pad_cnt = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=32;
+	offset = 32;
 	ptr_struct->version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_nv_hdr_print(const struct tools_open_nv_hdr *ptr_struct, FILE* file, int indent_level){
+void tools_open_nv_hdr_print(const struct tools_open_nv_hdr *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_nv_hdr ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -739,1240 +1020,2431 @@ void tools_open_nv_hdr_print(const struct tools_open_nv_hdr *ptr_struct, FILE* f
 
 }
 
-int tools_open_nv_hdr_size(void){
+int tools_open_nv_hdr_size(void)
+{
 	 return 8;
 }
 
-void tools_open_nv_hdr_dump(const struct tools_open_nv_hdr *ptr_struct, FILE* file) {
+void tools_open_nv_hdr_dump(const struct tools_open_nv_hdr *ptr_struct, FILE* file)
+{
 	tools_open_nv_hdr_print(ptr_struct, file, 0);
 }
 
-void tools_open_pmdio_pack(const struct tools_open_pmdio *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_aux_tlv_header_pack(const struct tools_open_aux_tlv_header *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=29;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->operation);
+	offset = 24;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->minor_version);
 
-	offset=22;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->clause);
+	offset = 16;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->major_version);
 
-	offset=8;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->local_port);
+	offset = 8;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->type);
 
-	offset=0;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lock);
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->header_type);
 
-	offset=59;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 5, (u_int32_t)ptr_struct->reg_adr_mmd);
+	offset = 32;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->length);
 
-	offset=48;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->last_op_idx);
+	offset = 80;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->crc);
 
-	offset=40;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->num_ops_done);
+	offset = 96;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->reserved0);
 
-	for (i=0; i < 64; i++) {
-	offset=adb2c_calc_array_field_address(64, 32, i, 2112, 1);
-	tools_open_pmdio_addr_data_pack(&(ptr_struct->mdio_trans[i]), ptr_buff + offset/8);
-	}
+	offset = 128;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->reserved1);
 
 }
 
-void tools_open_pmdio_unpack(struct tools_open_pmdio *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_aux_tlv_header_unpack(struct tools_open_aux_tlv_header *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=29;
-	ptr_struct->operation = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
+	offset = 24;
+	ptr_struct->minor_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=22;
-	ptr_struct->clause = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+	offset = 16;
+	ptr_struct->major_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=8;
-	ptr_struct->local_port = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 8;
+	ptr_struct->type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=0;
-	ptr_struct->lock = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 0;
+	ptr_struct->header_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=59;
-	ptr_struct->reg_adr_mmd = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 5);
+	offset = 32;
+	ptr_struct->length = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	offset=48;
-	ptr_struct->last_op_idx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 80;
+	ptr_struct->crc = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=40;
-	ptr_struct->num_ops_done = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 96;
+	ptr_struct->reserved0 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	for (i=0; i < 64; i++) {
-	offset=adb2c_calc_array_field_address(64, 32, i, 2112, 1);
-	tools_open_pmdio_addr_data_unpack(&(ptr_struct->mdio_trans[i]), ptr_buff + offset/8);
-	}
+	offset = 128;
+	ptr_struct->reserved1 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_pmdio_print(const struct tools_open_pmdio *ptr_struct, FILE* file, int indent_level){
+void tools_open_aux_tlv_header_print(const struct tools_open_aux_tlv_header *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_pmdio ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_aux_tlv_header ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "operation            : "UH_FMT"\n", ptr_struct->operation);
+	fprintf(file, "minor_version        : "UH_FMT"\n", ptr_struct->minor_version);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "clause               : "UH_FMT"\n", ptr_struct->clause);
+	fprintf(file, "major_version        : "UH_FMT"\n", ptr_struct->major_version);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "local_port           : "UH_FMT"\n", ptr_struct->local_port);
+	fprintf(file, "type                 : "UH_FMT"\n", ptr_struct->type);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "lock                 : "UH_FMT"\n", ptr_struct->lock);
+	fprintf(file, "header_type          : "UH_FMT"\n", ptr_struct->header_type);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "reg_adr_mmd          : "UH_FMT"\n", ptr_struct->reg_adr_mmd);
+	fprintf(file, "length               : "U32H_FMT"\n", ptr_struct->length);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "last_op_idx          : "UH_FMT"\n", ptr_struct->last_op_idx);
+	fprintf(file, "crc                  : "UH_FMT"\n", ptr_struct->crc);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "num_ops_done         : "UH_FMT"\n", ptr_struct->num_ops_done);
+	fprintf(file, "reserved0            : "U32H_FMT"\n", ptr_struct->reserved0);
 
-	for (i=0; i < 64; i++) {
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mdio_trans_%03d:\n", i);
-	tools_open_pmdio_addr_data_print(&(ptr_struct->mdio_trans[i]), file, indent_level + 1);
-	}
+	fprintf(file, "reserved1            : "U32H_FMT"\n", ptr_struct->reserved1);
 
 }
 
-int tools_open_pmdio_size(void){
-	 return 264;
+int tools_open_aux_tlv_header_size(void)
+{
+	 return 20;
 }
 
-void tools_open_pmdio_dump(const struct tools_open_pmdio *ptr_struct, FILE* file) {
-	tools_open_pmdio_print(ptr_struct, file, 0);
+void tools_open_aux_tlv_header_dump(const struct tools_open_aux_tlv_header *ptr_struct, FILE* file)
+{
+	tools_open_aux_tlv_header_print(ptr_struct, file, 0);
 }
 
-void tools_open_pmdic_pack(const struct tools_open_pmdic *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_pmdio_pack(const struct tools_open_pmdio *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=8;
+	offset = 29;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->operation);
+
+	offset = 22;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->clause);
+
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->local_port);
 
-	offset=56;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->operation_cap);
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lock);
 
-	offset=38;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->clause);
+	offset = 59;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 5, (u_int32_t)ptr_struct->reg_adr_mmd);
 
-	offset=32;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->mdio_preset);
+	offset = 48;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->last_op_idx);
 
-	offset=88;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->misc_cap);
+	offset = 40;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->num_ops_done);
+
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(64, 32, i, 2112, 1);
+	tools_open_pmdio_addr_data_pack(&(ptr_struct->mdio_trans[i]), ptr_buff + offset/8);
+	}
 
 }
 
-void tools_open_pmdic_unpack(struct tools_open_pmdic *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_pmdio_unpack(struct tools_open_pmdio *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=8;
+	offset = 29;
+	ptr_struct->operation = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
+
+	offset = 22;
+	ptr_struct->clause = (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=56;
-	ptr_struct->operation_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 0;
+	ptr_struct->lock = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=38;
-	ptr_struct->clause = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+	offset = 59;
+	ptr_struct->reg_adr_mmd = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 5);
 
-	offset=32;
-	ptr_struct->mdio_preset = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+	offset = 48;
+	ptr_struct->last_op_idx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=88;
-	ptr_struct->misc_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 40;
+	ptr_struct->num_ops_done = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(64, 32, i, 2112, 1);
+	tools_open_pmdio_addr_data_unpack(&(ptr_struct->mdio_trans[i]), ptr_buff + offset/8);
+	}
 
 }
 
-void tools_open_pmdic_print(const struct tools_open_pmdic *ptr_struct, FILE* file, int indent_level){
+void tools_open_pmdio_print(const struct tools_open_pmdio *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_pmdic ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_pmdio ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "operation            : "UH_FMT"\n", ptr_struct->operation);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "clause               : "UH_FMT"\n", ptr_struct->clause);
+
+	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "local_port           : "UH_FMT"\n", ptr_struct->local_port);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "operation_cap        : "UH_FMT"\n", ptr_struct->operation_cap);
+	fprintf(file, "lock                 : "UH_FMT"\n", ptr_struct->lock);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "clause               : "UH_FMT"\n", ptr_struct->clause);
+	fprintf(file, "reg_adr_mmd          : "UH_FMT"\n", ptr_struct->reg_adr_mmd);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mdio_preset          : "UH_FMT"\n", ptr_struct->mdio_preset);
+	fprintf(file, "last_op_idx          : "UH_FMT"\n", ptr_struct->last_op_idx);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "misc_cap             : "UH_FMT"\n", ptr_struct->misc_cap);
+	fprintf(file, "num_ops_done         : "UH_FMT"\n", ptr_struct->num_ops_done);
 
-}
+	for (i = 0; i < 64; i++) {
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mdio_trans_%03d:\n", i);
+	tools_open_pmdio_addr_data_print(&(ptr_struct->mdio_trans[i]), file, indent_level + 1);
+	}
 
-int tools_open_pmdic_size(void){
-	 return 12;
 }
 
-void tools_open_pmdic_dump(const struct tools_open_pmdic *ptr_struct, FILE* file) {
-	tools_open_pmdic_print(ptr_struct, file, 0);
+int tools_open_pmdio_size(void)
+{
+	 return 264;
 }
 
-void tools_open_nvdi_pack(const struct tools_open_nvdi *ptr_struct, u_int8_t* ptr_buff){
-	u_int32_t offset;
-	int i=0;
-	(void)offset;
-	(void)i;
-	(void)ptr_struct;
-	(void)ptr_buff;
-
-	offset=0;
-	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
-
+void tools_open_pmdio_dump(const struct tools_open_pmdio *ptr_struct, FILE* file)
+{
+	tools_open_pmdio_print(ptr_struct, file, 0);
 }
 
-void tools_open_nvdi_unpack(struct tools_open_nvdi *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_pmdic_pack(const struct tools_open_pmdic *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
-
-}
+	offset = 8;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->local_port);
 
-void tools_open_nvdi_print(const struct tools_open_nvdi *ptr_struct, FILE* file, int indent_level){
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_nvdi ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
-	(void)file;
-	(void)indent_level;
+	offset = 56;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->operation_cap);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_hdr:\n");
-	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+	offset = 38;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->clause);
 
-}
+	offset = 32;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->mdio_preset);
 
-int tools_open_nvdi_size(void){
-	 return 12;
-}
+	offset = 88;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->misc_cap);
 
-void tools_open_nvdi_dump(const struct tools_open_nvdi *ptr_struct, FILE* file) {
-	tools_open_nvdi_print(ptr_struct, file, 0);
 }
 
-void tools_open_nvda_pack(const struct tools_open_nvda *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_pmdic_unpack(struct tools_open_pmdic *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
-
-	for (i=0; i < 128; i++) {
-	offset=adb2c_calc_array_field_address(120, 8, i, 2048, 1);
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->data[i]);
-	}
+	offset = 8;
+	ptr_struct->local_port = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-}
+	offset = 56;
+	ptr_struct->operation_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-void tools_open_nvda_unpack(struct tools_open_nvda *ptr_struct, const u_int8_t* ptr_buff){
-	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
-	(void)offset;
-	(void)i;
-	(void)ptr_struct;
-	(void)ptr_buff;
+	offset = 38;
+	ptr_struct->clause = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=0;
-	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 32;
+	ptr_struct->mdio_preset = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	for (i=0; i < 128; i++) {
-	offset=adb2c_calc_array_field_address(120, 8, i, 2048, 1);
-	ptr_struct->data[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
-	}
+	offset = 88;
+	ptr_struct->misc_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_nvda_print(const struct tools_open_nvda *ptr_struct, FILE* file, int indent_level){
+void tools_open_pmdic_print(const struct tools_open_pmdic *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_nvda ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_pmdic ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_hdr:\n");
-	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+	fprintf(file, "local_port           : "UH_FMT"\n", ptr_struct->local_port);
 
-	for (i=0; i < 128; i++) {
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "data_%03d            : "UH_FMT"\n", i, ptr_struct->data[i]);
-	}
+	fprintf(file, "operation_cap        : "UH_FMT"\n", ptr_struct->operation_cap);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "clause               : "UH_FMT"\n", ptr_struct->clause);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mdio_preset          : "UH_FMT"\n", ptr_struct->mdio_preset);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "misc_cap             : "UH_FMT"\n", ptr_struct->misc_cap);
 
 }
 
-int tools_open_nvda_size(void){
-	 return 256;
+int tools_open_pmdic_size(void)
+{
+	 return 12;
 }
 
-void tools_open_nvda_dump(const struct tools_open_nvda *ptr_struct, FILE* file) {
-	tools_open_nvda_print(ptr_struct, file, 0);
+void tools_open_pmdic_dump(const struct tools_open_pmdic *ptr_struct, FILE* file)
+{
+	tools_open_pmdic_print(ptr_struct, file, 0);
 }
 
-void tools_open_nvia_pack(const struct tools_open_nvia *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_mnvgn_pack(const struct tools_open_mnvgn *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->nv_pointer);
+
+	offset = 128;
 	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
-	offset=125;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->target);
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(248, 8, i, 1248, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->nv_data[i]);
+	}
 
 }
 
-void tools_open_nvia_unpack(struct tools_open_nvia *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_mnvgn_unpack(struct tools_open_mnvgn *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
+	ptr_struct->nv_pointer = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+
+	offset = 128;
 	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
-	offset=125;
-	ptr_struct->target = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(248, 8, i, 1248, 1);
+	ptr_struct->nv_data[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
 
 }
 
-void tools_open_nvia_print(const struct tools_open_nvia *ptr_struct, FILE* file, int indent_level){
+void tools_open_mnvgn_print(const struct tools_open_mnvgn *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_nvia ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_mnvgn ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_pointer           : "U32H_FMT"\n", ptr_struct->nv_pointer);
+
+	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "nv_hdr:\n");
 	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
 
+	for (i = 0; i < 128; i++) {
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "target               : "UH_FMT"\n", ptr_struct->target);
+	fprintf(file, "nv_data_%03d         : "UH_FMT"\n", i, ptr_struct->nv_data[i]);
+	}
 
 }
 
-int tools_open_nvia_size(void){
-	 return 20;
+int tools_open_mnvgn_size(void)
+{
+	 return 156;
 }
 
-void tools_open_nvia_dump(const struct tools_open_nvia *ptr_struct, FILE* file) {
-	tools_open_nvia_print(ptr_struct, file, 0);
+void tools_open_mnvgn_dump(const struct tools_open_mnvgn *ptr_struct, FILE* file)
+{
+	tools_open_mnvgn_print(ptr_struct, file, 0);
 }
 
-void tools_open_nvqc_pack(const struct tools_open_nvqc *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_mvts_pack(const struct tools_open_mvts *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_tlv_type_pack(&(ptr_struct->type), ptr_buff + offset/8);
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->check_timestamp_flag);
 
-	offset=63;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->support_rd);
+	offset = 1;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->running_flag);
 
-	offset=62;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->support_wr);
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->clear_all_ts_flag);
 
-	offset=56;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->version);
+	offset = 32;
+	tools_open_timestamp_pack(&(ptr_struct->timestamp), ptr_buff + offset/8);
 
 }
 
-void tools_open_nvqc_unpack(struct tools_open_nvqc *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_mvts_unpack(struct tools_open_mvts *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_tlv_type_unpack(&(ptr_struct->type), ptr_buff + offset/8);
+	offset = 2;
+	ptr_struct->check_timestamp_flag = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=63;
-	ptr_struct->support_rd = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 1;
+	ptr_struct->running_flag = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=62;
-	ptr_struct->support_wr = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 0;
+	ptr_struct->clear_all_ts_flag = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=56;
-	ptr_struct->version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+	offset = 32;
+	tools_open_timestamp_unpack(&(ptr_struct->timestamp), ptr_buff + offset/8);
 
 }
 
-void tools_open_nvqc_print(const struct tools_open_nvqc *ptr_struct, FILE* file, int indent_level){
+void tools_open_mvts_print(const struct tools_open_mvts *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_nvqc ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_mvts ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "type:\n");
-	tools_open_tlv_type_print(&(ptr_struct->type), file, indent_level + 1);
+	fprintf(file, "check_timestamp_flag : "UH_FMT"\n", ptr_struct->check_timestamp_flag);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "support_rd           : "UH_FMT"\n", ptr_struct->support_rd);
+	fprintf(file, "running_flag         : "UH_FMT"\n", ptr_struct->running_flag);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "support_wr           : "UH_FMT"\n", ptr_struct->support_wr);
+	fprintf(file, "clear_all_ts_flag    : "UH_FMT"\n", ptr_struct->clear_all_ts_flag);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "version              : "UH_FMT"\n", ptr_struct->version);
+	fprintf(file, "timestamp:\n");
+	tools_open_timestamp_print(&(ptr_struct->timestamp), file, indent_level + 1);
 
 }
 
-int tools_open_nvqc_size(void){
-	 return 8;
+int tools_open_mvts_size(void)
+{
+	 return 20;
 }
 
-void tools_open_nvqc_dump(const struct tools_open_nvqc *ptr_struct, FILE* file) {
-	tools_open_nvqc_print(ptr_struct, file, 0);
+void tools_open_mvts_dump(const struct tools_open_mvts *ptr_struct, FILE* file)
+{
+	tools_open_mvts_print(ptr_struct, file, 0);
 }
 
-void tools_open_mnvia_pack(const struct tools_open_mnvia *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_nvqgc_pack(const struct tools_open_nvqgc *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 31;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->read_factory_settings_support);
 
 }
 
-void tools_open_mnvia_unpack(struct tools_open_mnvia *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_nvqgc_unpack(struct tools_open_nvqgc *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 31;
+	ptr_struct->read_factory_settings_support = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_mnvia_print(const struct tools_open_mnvia *ptr_struct, FILE* file, int indent_level){
+void tools_open_nvqgc_print(const struct tools_open_nvqgc *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_mnvia ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_nvqgc ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_hdr:\n");
-	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+	fprintf(file, "read_factory_settings_support : "UH_FMT"\n", ptr_struct->read_factory_settings_support);
 
 }
 
-int tools_open_mnvia_size(void){
-	 return 8;
+int tools_open_nvqgc_size(void)
+{
+	 return 16;
 }
 
-void tools_open_mnvia_dump(const struct tools_open_mnvia *ptr_struct, FILE* file) {
-	tools_open_mnvia_print(ptr_struct, file, 0);
+void tools_open_nvqgc_dump(const struct tools_open_nvqgc *ptr_struct, FILE* file)
+{
+	tools_open_nvqgc_print(ptr_struct, file, 0);
 }
 
-void tools_open_mnvi_pack(const struct tools_open_mnvi *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_nvdi_pack(const struct tools_open_nvdi *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
 }
 
-void tools_open_mnvi_unpack(struct tools_open_mnvi *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_nvdi_unpack(struct tools_open_nvdi *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
 }
 
-void tools_open_mnvi_print(const struct tools_open_mnvi *ptr_struct, FILE* file, int indent_level){
+void tools_open_nvdi_print(const struct tools_open_nvdi *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_mnvi ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_nvdi ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "nv_hdr:\n");
-	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
 
 }
 
-int tools_open_mnvi_size(void){
-	 return 8;
+int tools_open_nvdi_size(void)
+{
+	 return 12;
 }
 
-void tools_open_mnvi_dump(const struct tools_open_mnvi *ptr_struct, FILE* file) {
-	tools_open_mnvi_print(ptr_struct, file, 0);
+void tools_open_nvdi_dump(const struct tools_open_nvdi *ptr_struct, FILE* file)
+{
+	tools_open_nvdi_print(ptr_struct, file, 0);
 }
 
-void tools_open_mnva_pack(const struct tools_open_mnva *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_nvda_pack(const struct tools_open_nvda *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
-	for (i=0; i < 128; i++) {
-	offset=adb2c_calc_array_field_address(88, 8, i, 2048, 1);
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(120, 8, i, 2048, 1);
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->data[i]);
 	}
 
 }
 
-void tools_open_mnva_unpack(struct tools_open_mnva *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_nvda_unpack(struct tools_open_nvda *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
-	for (i=0; i < 128; i++) {
-	offset=adb2c_calc_array_field_address(88, 8, i, 2048, 1);
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(120, 8, i, 2048, 1);
 	ptr_struct->data[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 	}
 
 }
 
-void tools_open_mnva_print(const struct tools_open_mnva *ptr_struct, FILE* file, int indent_level){
+void tools_open_nvda_print(const struct tools_open_nvda *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_mnva ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_nvda ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "nv_hdr:\n");
-	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
 
-	for (i=0; i < 128; i++) {
+	for (i = 0; i < 128; i++) {
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "data_%03d            : "UH_FMT"\n", i, ptr_struct->data[i]);
 	}
 
 }
 
-int tools_open_mnva_size(void){
+int tools_open_nvda_size(void)
+{
 	 return 256;
 }
 
-void tools_open_mnva_dump(const struct tools_open_mnva *ptr_struct, FILE* file) {
-	tools_open_mnva_print(ptr_struct, file, 0);
+void tools_open_nvda_dump(const struct tools_open_nvda *ptr_struct, FILE* file)
+{
+	tools_open_nvda_print(ptr_struct, file, 0);
 }
 
-void tools_open_query_def_params_per_port_pack(const struct tools_open_query_def_params_per_port *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_nvia_pack(const struct tools_open_nvia *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=13;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_vpi);
-
-	offset=12;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_wol);
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
 
-	offset=0;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->fw_default_config_payload_version);
+	offset = 125;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->target);
 
-	offset=52;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->default_boot_vlan);
+}
 
-	offset=44;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->default_boot_protocol);
+void tools_open_nvia_unpack(struct tools_open_nvia *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_fifth_gen_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+	offset = 125;
+	ptr_struct->target = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
+
+}
+
+void tools_open_nvia_print(const struct tools_open_nvia *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_nvia ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_hdr:\n");
+	tools_open_nv_hdr_fifth_gen_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "target               : "UH_FMT"\n", ptr_struct->target);
+
+}
+
+int tools_open_nvia_size(void)
+{
+	 return 20;
+}
+
+void tools_open_nvia_dump(const struct tools_open_nvia *ptr_struct, FILE* file)
+{
+	tools_open_nvia_print(ptr_struct, file, 0);
+}
+
+void tools_open_nvqc_pack(const struct tools_open_nvqc *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_tlv_type_pack(&(ptr_struct->type), ptr_buff + offset/8);
+
+	offset = 63;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->support_rd);
+
+	offset = 62;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->support_wr);
+
+	offset = 56;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->version);
+
+}
+
+void tools_open_nvqc_unpack(struct tools_open_nvqc *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_tlv_type_unpack(&(ptr_struct->type), ptr_buff + offset/8);
+
+	offset = 63;
+	ptr_struct->support_rd = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 62;
+	ptr_struct->support_wr = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 56;
+	ptr_struct->version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+
+}
+
+void tools_open_nvqc_print(const struct tools_open_nvqc *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_nvqc ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "type:\n");
+	tools_open_tlv_type_print(&(ptr_struct->type), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "support_rd           : "UH_FMT"\n", ptr_struct->support_rd);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "support_wr           : "UH_FMT"\n", ptr_struct->support_wr);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "version              : "UH_FMT"\n", ptr_struct->version);
+
+}
+
+int tools_open_nvqc_size(void)
+{
+	 return 8;
+}
+
+void tools_open_nvqc_dump(const struct tools_open_nvqc *ptr_struct, FILE* file)
+{
+	tools_open_nvqc_print(ptr_struct, file, 0);
+}
+
+void tools_open_mnvia_pack(const struct tools_open_mnvia *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+}
+
+void tools_open_mnvia_unpack(struct tools_open_mnvia *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+}
+
+void tools_open_mnvia_print(const struct tools_open_mnvia *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_mnvia ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_hdr:\n");
+	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+
+}
+
+int tools_open_mnvia_size(void)
+{
+	 return 8;
+}
+
+void tools_open_mnvia_dump(const struct tools_open_mnvia *ptr_struct, FILE* file)
+{
+	tools_open_mnvia_print(ptr_struct, file, 0);
+}
+
+void tools_open_mnvi_pack(const struct tools_open_mnvi *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+}
+
+void tools_open_mnvi_unpack(struct tools_open_mnvi *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+}
+
+void tools_open_mnvi_print(const struct tools_open_mnvi *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_mnvi ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_hdr:\n");
+	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+
+}
+
+int tools_open_mnvi_size(void)
+{
+	 return 8;
+}
+
+void tools_open_mnvi_dump(const struct tools_open_mnvi *ptr_struct, FILE* file)
+{
+	tools_open_mnvi_print(ptr_struct, file, 0);
+}
+
+void tools_open_mnva_pack(const struct tools_open_mnva *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_pack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(88, 8, i, 2048, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->data[i]);
+	}
+
+}
+
+void tools_open_mnva_unpack(struct tools_open_mnva *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_nv_hdr_unpack(&(ptr_struct->nv_hdr), ptr_buff + offset/8);
+
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(88, 8, i, 2048, 1);
+	ptr_struct->data[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+}
+
+void tools_open_mnva_print(const struct tools_open_mnva *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_mnva ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_hdr:\n");
+	tools_open_nv_hdr_print(&(ptr_struct->nv_hdr), file, indent_level + 1);
+
+	for (i = 0; i < 128; i++) {
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "data_%03d            : "UH_FMT"\n", i, ptr_struct->data[i]);
+	}
+
+}
+
+int tools_open_mnva_size(void)
+{
+	 return 256;
+}
+
+void tools_open_mnva_dump(const struct tools_open_mnva *ptr_struct, FILE* file)
+{
+	tools_open_mnva_print(ptr_struct, file, 0);
+}
+
+void tools_open_mfg_info_pack(const struct tools_open_mfg_info *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(24, 8, i, 2560, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->psid[i]);
+	}
+
+	offset = 232;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->minor_version);
+
+	offset = 224;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->major_version);
+
+	for (i = 0; i < 96; i++) {
+	offset = adb2c_calc_array_field_address(792, 8, i, 2560, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->orig_prs_name[i]);
+	}
+
+}
+
+void tools_open_mfg_info_unpack(struct tools_open_mfg_info *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(24, 8, i, 2560, 1);
+	ptr_struct->psid[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->psid[16] = '\0';
+	offset = 232;
+	ptr_struct->minor_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 224;
+	ptr_struct->major_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	for (i = 0; i < 96; i++) {
+	offset = adb2c_calc_array_field_address(792, 8, i, 2560, 1);
+	ptr_struct->orig_prs_name[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->orig_prs_name[96] = '\0';
+}
+
+void tools_open_mfg_info_print(const struct tools_open_mfg_info *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_mfg_info ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	fprintf(file, "psid                 : \"%s\"\n", ptr_struct->psid);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "minor_version        : "UH_FMT"\n", ptr_struct->minor_version);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "major_version        : "UH_FMT"\n", ptr_struct->major_version);
+
+	fprintf(file, "orig_prs_name        : \"%s\"\n", ptr_struct->orig_prs_name);
+}
+
+int tools_open_mfg_info_size(void)
+{
+	 return 320;
+}
+
+void tools_open_mfg_info_dump(const struct tools_open_mfg_info *ptr_struct, FILE* file)
+{
+	tools_open_mfg_info_print(ptr_struct, file, 0);
+}
+
+void tools_open_image_info_pack(const struct tools_open_image_info *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 8;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->minor_version);
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->major_version);
+
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(312, 8, i, 8192, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->psid[i]);
+	}
+
+	for (i = 0; i < 256; i++) {
+	offset = adb2c_calc_array_field_address(3736, 8, i, 8192, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->description[i]);
+	}
+
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(6680, 8, i, 8192, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->name[i]);
+	}
+
+	for (i = 0; i < 96; i++) {
+	offset = adb2c_calc_array_field_address(7192, 8, i, 8192, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->prs_name[i]);
+	}
+
+}
+
+void tools_open_image_info_unpack(struct tools_open_image_info *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 8;
+	ptr_struct->minor_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 0;
+	ptr_struct->major_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(312, 8, i, 8192, 1);
+	ptr_struct->psid[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->psid[16] = '\0';
+	for (i = 0; i < 256; i++) {
+	offset = adb2c_calc_array_field_address(3736, 8, i, 8192, 1);
+	ptr_struct->description[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->description[256] = '\0';
+	for (i = 0; i < 64; i++) {
+	offset = adb2c_calc_array_field_address(6680, 8, i, 8192, 1);
+	ptr_struct->name[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->name[64] = '\0';
+	for (i = 0; i < 96; i++) {
+	offset = adb2c_calc_array_field_address(7192, 8, i, 8192, 1);
+	ptr_struct->prs_name[i] = (char)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+	ptr_struct->prs_name[96] = '\0';
+}
+
+void tools_open_image_info_print(const struct tools_open_image_info *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_image_info ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "minor_version        : "UH_FMT"\n", ptr_struct->minor_version);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "major_version        : "UH_FMT"\n", ptr_struct->major_version);
+
+	fprintf(file, "psid                 : \"%s\"\n", ptr_struct->psid);
+	fprintf(file, "description          : \"%s\"\n", ptr_struct->description);
+	fprintf(file, "name                 : \"%s\"\n", ptr_struct->name);
+	fprintf(file, "prs_name             : \"%s\"\n", ptr_struct->prs_name);
+}
+
+int tools_open_image_info_size(void)
+{
+	 return 1024;
+}
+
+void tools_open_image_info_dump(const struct tools_open_image_info *ptr_struct, FILE* file)
+{
+	tools_open_image_info_print(ptr_struct, file, 0);
+}
+
+void tools_open_aux_tlv_pack(const struct tools_open_aux_tlv *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_aux_tlv_header_pack(&(ptr_struct->aux_tlv_header), ptr_buff + offset/8);
+
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(184, 8, i, 2048, 1);
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->data[i]);
+	}
+
+}
+
+void tools_open_aux_tlv_unpack(struct tools_open_aux_tlv *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	tools_open_aux_tlv_header_unpack(&(ptr_struct->aux_tlv_header), ptr_buff + offset/8);
+
+	for (i = 0; i < 128; i++) {
+	offset = adb2c_calc_array_field_address(184, 8, i, 2048, 1);
+	ptr_struct->data[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	}
+
+}
+
+void tools_open_aux_tlv_print(const struct tools_open_aux_tlv *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_aux_tlv ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "aux_tlv_header:\n");
+	tools_open_aux_tlv_header_print(&(ptr_struct->aux_tlv_header), file, indent_level + 1);
+
+	for (i = 0; i < 128; i++) {
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "data_%03d            : "UH_FMT"\n", i, ptr_struct->data[i]);
+	}
+
+}
+
+int tools_open_aux_tlv_size(void)
+{
+	 return 256;
+}
+
+void tools_open_aux_tlv_dump(const struct tools_open_aux_tlv *ptr_struct, FILE* file)
+{
+	tools_open_aux_tlv_print(ptr_struct, file, 0);
+}
+
+void tools_open_aux_data_hdr_pack(const struct tools_open_aux_data_hdr *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->signature0);
+
+	offset = 32;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->signature1);
+
+	offset = 64;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->signature2);
+
+	offset = 96;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->signature3);
+
+}
+
+void tools_open_aux_data_hdr_unpack(struct tools_open_aux_data_hdr *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	ptr_struct->signature0 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+
+	offset = 32;
+	ptr_struct->signature1 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+
+	offset = 64;
+	ptr_struct->signature2 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+
+	offset = 96;
+	ptr_struct->signature3 = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+
+}
+
+void tools_open_aux_data_hdr_print(const struct tools_open_aux_data_hdr *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_aux_data_hdr ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "signature0           : "U32H_FMT"\n", ptr_struct->signature0);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "signature1           : "U32H_FMT"\n", ptr_struct->signature1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "signature2           : "U32H_FMT"\n", ptr_struct->signature2);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "signature3           : "U32H_FMT"\n", ptr_struct->signature3);
+
+}
+
+int tools_open_aux_data_hdr_size(void)
+{
+	 return 16;
+}
+
+void tools_open_aux_data_hdr_dump(const struct tools_open_aux_data_hdr *ptr_struct, FILE* file)
+{
+	tools_open_aux_data_hdr_print(ptr_struct, file, 0);
+}
+
+void tools_open_query_def_params_per_port_pack(const struct tools_open_query_def_params_per_port *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 13;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_vpi);
+
+	offset = 12;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_wol);
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->fw_default_config_payload_version);
+
+	offset = 52;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->default_boot_vlan);
+
+	offset = 44;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->default_boot_protocol);
+
+	offset = 40;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->default_boot_retry_cnt);
+
+	offset = 37;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->default_network_link_type);
+
+	offset = 36;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_en_wol_magic);
+
+	offset = 35;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_boot_vlan_en);
+
+	offset = 34;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_boot_option_rom_en);
+
+	offset = 33;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_pprx);
+
+	offset = 32;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_pptx);
+
+	offset = 80;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->default_boot_pkey);
+
+	offset = 70;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->boot_ip_ver);
+
+	offset = 68;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_infiniband_dhcp_settings);
+
+	offset = 67;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_infiniband_boot_settings);
+
+	offset = 66;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_dhcp_iscsi_parameters);
+
+	offset = 65;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_iscsi_parameters);
+
+	offset = 64;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_boot_parameters);
+
+	offset = 108;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->client_indentifier);
+
+	offset = 106;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->mac_admin_bit);
+
+	offset = 104;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->iscsi_boot_to_target);
+
+	offset = 101;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_vlan_en);
+
+	offset = 100;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_tcp_timestamps_en);
+
+	offset = 99;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_chap_mutual_auth_en);
+
+	offset = 98;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_chap_auth_en);
+
+	offset = 97;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_dhcp_params_en);
+
+	offset = 96;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_ipv4_dhcp_en);
+
+	offset = 152;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->iscsi_lun_busy_retry_cnt);
+
+	offset = 144;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->iscsi_link_up_delay_time);
+
+}
+
+void tools_open_query_def_params_per_port_unpack(struct tools_open_query_def_params_per_port *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 13;
+	ptr_struct->nv_config_vpi = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 12;
+	ptr_struct->nv_config_wol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 0;
+	ptr_struct->fw_default_config_payload_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 52;
+	ptr_struct->default_boot_vlan = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
+
+	offset = 44;
+	ptr_struct->default_boot_protocol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+
+	offset = 40;
+	ptr_struct->default_boot_retry_cnt = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+
+	offset = 37;
+	ptr_struct->default_network_link_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 36;
+	ptr_struct->default_en_wol_magic = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 35;
+	ptr_struct->default_boot_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 34;
+	ptr_struct->default_boot_option_rom_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 33;
+	ptr_struct->default_pprx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 32;
+	ptr_struct->default_pptx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 80;
+	ptr_struct->default_boot_pkey = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+
+	offset = 70;
+	ptr_struct->boot_ip_ver = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 68;
+	ptr_struct->nv_config_infiniband_dhcp_settings = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 67;
+	ptr_struct->nv_config_infiniband_boot_settings = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 66;
+	ptr_struct->nv_config_dhcp_iscsi_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 65;
+	ptr_struct->nv_config_iscsi_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 64;
+	ptr_struct->nv_config_boot_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 108;
+	ptr_struct->client_indentifier = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 106;
+	ptr_struct->mac_admin_bit = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 104;
+	ptr_struct->iscsi_boot_to_target = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 101;
+	ptr_struct->iscsi_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 100;
+	ptr_struct->iscsi_tcp_timestamps_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 99;
+	ptr_struct->iscsi_chap_mutual_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 98;
+	ptr_struct->iscsi_chap_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 97;
+	ptr_struct->iscsi_dhcp_params_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 96;
+	ptr_struct->iscsi_ipv4_dhcp_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 152;
+	ptr_struct->iscsi_lun_busy_retry_cnt = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 144;
+	ptr_struct->iscsi_link_up_delay_time = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+}
+
+void tools_open_query_def_params_per_port_print(const struct tools_open_query_def_params_per_port *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_query_def_params_per_port ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_vpi        : "UH_FMT"\n", ptr_struct->nv_config_vpi);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_wol        : "UH_FMT"\n", ptr_struct->nv_config_wol);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_default_config_payload_version : "UH_FMT"\n", ptr_struct->fw_default_config_payload_version);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_vlan    : "UH_FMT"\n", ptr_struct->default_boot_vlan);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_protocol : "UH_FMT"\n", ptr_struct->default_boot_protocol);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_retry_cnt : "UH_FMT"\n", ptr_struct->default_boot_retry_cnt);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_network_link_type : "UH_FMT"\n", ptr_struct->default_network_link_type);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_en_wol_magic : "UH_FMT"\n", ptr_struct->default_en_wol_magic);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_vlan_en : "UH_FMT"\n", ptr_struct->default_boot_vlan_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_option_rom_en : "UH_FMT"\n", ptr_struct->default_boot_option_rom_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_pprx         : "UH_FMT"\n", ptr_struct->default_pprx);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_pptx         : "UH_FMT"\n", ptr_struct->default_pptx);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "default_boot_pkey    : "UH_FMT"\n", ptr_struct->default_boot_pkey);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "boot_ip_ver          : "UH_FMT"\n", ptr_struct->boot_ip_ver);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_infiniband_dhcp_settings : "UH_FMT"\n", ptr_struct->nv_config_infiniband_dhcp_settings);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_infiniband_boot_settings : "UH_FMT"\n", ptr_struct->nv_config_infiniband_boot_settings);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_dhcp_iscsi_parameters : "UH_FMT"\n", ptr_struct->nv_config_dhcp_iscsi_parameters);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_iscsi_parameters : "UH_FMT"\n", ptr_struct->nv_config_iscsi_parameters);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nv_config_boot_parameters : "UH_FMT"\n", ptr_struct->nv_config_boot_parameters);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "client_indentifier   : "UH_FMT"\n", ptr_struct->client_indentifier);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mac_admin_bit        : "UH_FMT"\n", ptr_struct->mac_admin_bit);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_boot_to_target : "UH_FMT"\n", ptr_struct->iscsi_boot_to_target);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_vlan_en        : "UH_FMT"\n", ptr_struct->iscsi_vlan_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_tcp_timestamps_en : "UH_FMT"\n", ptr_struct->iscsi_tcp_timestamps_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_chap_mutual_auth_en : "UH_FMT"\n", ptr_struct->iscsi_chap_mutual_auth_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_chap_auth_en   : "UH_FMT"\n", ptr_struct->iscsi_chap_auth_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_dhcp_params_en : "UH_FMT"\n", ptr_struct->iscsi_dhcp_params_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_ipv4_dhcp_en   : "UH_FMT"\n", ptr_struct->iscsi_ipv4_dhcp_en);
 
-	offset=40;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->default_boot_retry_cnt);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_lun_busy_retry_cnt : "UH_FMT"\n", ptr_struct->iscsi_lun_busy_retry_cnt);
 
-	offset=37;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->default_network_link_type);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "iscsi_link_up_delay_time : "UH_FMT"\n", ptr_struct->iscsi_link_up_delay_time);
 
-	offset=36;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_en_wol_magic);
+}
 
-	offset=35;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_boot_vlan_en);
+int tools_open_query_def_params_per_port_size(void)
+{
+	 return 28;
+}
 
-	offset=34;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_boot_option_rom_en);
+void tools_open_query_def_params_per_port_dump(const struct tools_open_query_def_params_per_port *ptr_struct, FILE* file)
+{
+	tools_open_query_def_params_per_port_print(ptr_struct, file, 0);
+}
 
-	offset=33;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_pprx);
+void tools_open_query_def_params_global_pack(const struct tools_open_query_def_params_global *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	offset=32;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->default_pptx);
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->fw_default_config_payload_version);
 
-	offset=80;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->default_boot_pkey);
+	offset = 56;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->num_vfs);
 
-	offset=68;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_infiniband_dhcp_settings);
+	offset = 52;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->uar_bar_size);
 
-	offset=67;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_infiniband_boot_settings);
+	offset = 48;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->max_uar_bar_size);
 
-	offset=66;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_dhcp_iscsi_parameters);
+	offset = 42;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->boot_ip_ver);
 
-	offset=65;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_iscsi_parameters);
+	offset = 32;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_en);
 
-	offset=64;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->nv_config_boot_parameters);
+}
 
-	offset=108;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->client_indentifier);
+void tools_open_query_def_params_global_unpack(struct tools_open_query_def_params_global *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	offset=106;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->mac_admin_bit);
+	offset = 0;
+	ptr_struct->fw_default_config_payload_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=104;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->iscsi_boot_to_target);
+	offset = 56;
+	ptr_struct->num_vfs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=101;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_vlan_en);
+	offset = 52;
+	ptr_struct->uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=100;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_tcp_timestamps_en);
+	offset = 48;
+	ptr_struct->max_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=99;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_chap_mutual_auth_en);
+	offset = 42;
+	ptr_struct->boot_ip_ver = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=98;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_chap_auth_en);
+	offset = 32;
+	ptr_struct->sriov_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=97;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_dhcp_params_en);
+}
 
-	offset=96;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->iscsi_ipv4_dhcp_en);
+void tools_open_query_def_params_global_print(const struct tools_open_query_def_params_global *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_query_def_params_global ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
 
-	offset=152;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->iscsi_lun_busy_retry_cnt);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "fw_default_config_payload_version : "UH_FMT"\n", ptr_struct->fw_default_config_payload_version);
 
-	offset=144;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->iscsi_link_up_delay_time);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "num_vfs              : "UH_FMT"\n", ptr_struct->num_vfs);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "uar_bar_size         : "UH_FMT"\n", ptr_struct->uar_bar_size);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "max_uar_bar_size     : "UH_FMT"\n", ptr_struct->max_uar_bar_size);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "boot_ip_ver          : "UH_FMT"\n", ptr_struct->boot_ip_ver);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "sriov_en             : "UH_FMT"\n", ptr_struct->sriov_en);
 
 }
 
-void tools_open_query_def_params_per_port_unpack(struct tools_open_query_def_params_per_port *ptr_struct, const u_int8_t* ptr_buff){
-	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
-	(void)offset;
+int tools_open_query_def_params_global_size(void)
+{
+	 return 20;
+}
+
+void tools_open_query_def_params_global_dump(const struct tools_open_query_def_params_global *ptr_struct, FILE* file)
+{
+	tools_open_query_def_params_global_print(ptr_struct, file, 0);
+}
+
+void tools_open_phy_reg_pack(const union tools_open_phy_reg *ptr_struct, u_int8_t* ptr_buff)
+{
+	tools_open_pmdio_pack(&(ptr_struct->pmdio), ptr_buff);
+}
+
+void tools_open_phy_reg_unpack(union tools_open_phy_reg *ptr_struct, const u_int8_t* ptr_buff)
+{
+	tools_open_pmdio_unpack(&(ptr_struct->pmdio), ptr_buff);
+}
+
+void tools_open_phy_reg_print(const union tools_open_phy_reg *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_phy_reg ========\n");
+	int i = 0;
 	(void)i;
 	(void)ptr_struct;
-	(void)ptr_buff;
+	(void)file;
+	(void)indent_level;
 
-	offset=13;
-	ptr_struct->nv_config_vpi = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "pmdic:\n");
+	tools_open_pmdic_print(&(ptr_struct->pmdic), file, indent_level + 1);
 
-	offset=12;
-	ptr_struct->nv_config_wol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "pmdio:\n");
+	tools_open_pmdio_print(&(ptr_struct->pmdio), file, indent_level + 1);
 
-	offset=0;
-	ptr_struct->fw_default_config_payload_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+}
 
-	offset=52;
-	ptr_struct->default_boot_vlan = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
+int tools_open_phy_reg_size(void)
+{
+	 return 264;
+}
 
-	offset=44;
-	ptr_struct->default_boot_protocol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+void tools_open_phy_reg_dump(const union tools_open_phy_reg *ptr_struct, FILE* file)
+{
+	tools_open_phy_reg_print(ptr_struct, file, 0);
+}
 
-	offset=40;
-	ptr_struct->default_boot_retry_cnt = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+void tools_open_mnv_cfg_pack(const union tools_open_mnv_cfg *ptr_struct, u_int8_t* ptr_buff)
+{
+	tools_open_mnvgn_pack(&(ptr_struct->mnvgn), ptr_buff);
+}
 
-	offset=37;
-	ptr_struct->default_network_link_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+void tools_open_mnv_cfg_unpack(union tools_open_mnv_cfg *ptr_struct, const u_int8_t* ptr_buff)
+{
+	tools_open_mnvgn_unpack(&(ptr_struct->mnvgn), ptr_buff);
+}
 
-	offset=36;
-	ptr_struct->default_en_wol_magic = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+void tools_open_mnv_cfg_print(const union tools_open_mnv_cfg *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_mnv_cfg ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
 
-	offset=35;
-	ptr_struct->default_boot_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mnva:\n");
+	tools_open_mnva_print(&(ptr_struct->mnva), file, indent_level + 1);
 
-	offset=34;
-	ptr_struct->default_boot_option_rom_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mnvi:\n");
+	tools_open_mnvi_print(&(ptr_struct->mnvi), file, indent_level + 1);
 
-	offset=33;
-	ptr_struct->default_pprx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mnvia:\n");
+	tools_open_mnvia_print(&(ptr_struct->mnvia), file, indent_level + 1);
 
-	offset=32;
-	ptr_struct->default_pptx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nvqc:\n");
+	tools_open_nvqc_print(&(ptr_struct->nvqc), file, indent_level + 1);
 
-	offset=80;
-	ptr_struct->default_boot_pkey = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nvia:\n");
+	tools_open_nvia_print(&(ptr_struct->nvia), file, indent_level + 1);
 
-	offset=68;
-	ptr_struct->nv_config_infiniband_dhcp_settings = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nvda:\n");
+	tools_open_nvda_print(&(ptr_struct->nvda), file, indent_level + 1);
 
-	offset=67;
-	ptr_struct->nv_config_infiniband_boot_settings = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nvdi:\n");
+	tools_open_nvdi_print(&(ptr_struct->nvdi), file, indent_level + 1);
 
-	offset=66;
-	ptr_struct->nv_config_dhcp_iscsi_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "nvqgc:\n");
+	tools_open_nvqgc_print(&(ptr_struct->nvqgc), file, indent_level + 1);
 
-	offset=65;
-	ptr_struct->nv_config_iscsi_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mvts:\n");
+	tools_open_mvts_print(&(ptr_struct->mvts), file, indent_level + 1);
 
-	offset=64;
-	ptr_struct->nv_config_boot_parameters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mnvgn:\n");
+	tools_open_mnvgn_print(&(ptr_struct->mnvgn), file, indent_level + 1);
 
-	offset=108;
-	ptr_struct->client_indentifier = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+}
 
-	offset=106;
-	ptr_struct->mac_admin_bit = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+int tools_open_mnv_cfg_size(void)
+{
+	 return 256;
+}
 
-	offset=104;
-	ptr_struct->iscsi_boot_to_target = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+void tools_open_mnv_cfg_dump(const union tools_open_mnv_cfg *ptr_struct, FILE* file)
+{
+	tools_open_mnv_cfg_print(ptr_struct, file, 0);
+}
 
-	offset=101;
-	ptr_struct->iscsi_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+void tools_open_lldp_nb_dcbx_pack(const struct tools_open_lldp_nb_dcbx *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	offset=100;
-	ptr_struct->iscsi_tcp_timestamps_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 31;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->ieee_dcbx_en);
 
-	offset=99;
-	ptr_struct->iscsi_chap_mutual_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 30;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->cee_dcbx_en);
 
-	offset=98;
-	ptr_struct->iscsi_chap_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 29;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->dcbx_willing);
 
-	offset=97;
-	ptr_struct->iscsi_dhcp_params_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+}
 
-	offset=96;
-	ptr_struct->iscsi_ipv4_dhcp_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+void tools_open_lldp_nb_dcbx_unpack(struct tools_open_lldp_nb_dcbx *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	offset=152;
-	ptr_struct->iscsi_lun_busy_retry_cnt = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 31;
+	ptr_struct->ieee_dcbx_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=144;
-	ptr_struct->iscsi_link_up_delay_time = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+	offset = 30;
+	ptr_struct->cee_dcbx_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 29;
+	ptr_struct->dcbx_willing = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_query_def_params_per_port_print(const struct tools_open_query_def_params_per_port *ptr_struct, FILE* file, int indent_level){
+void tools_open_lldp_nb_dcbx_print(const struct tools_open_lldp_nb_dcbx *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_query_def_params_per_port ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_lldp_nb_dcbx ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_vpi        : "UH_FMT"\n", ptr_struct->nv_config_vpi);
+	fprintf(file, "ieee_dcbx_en         : "UH_FMT"\n", ptr_struct->ieee_dcbx_en);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_wol        : "UH_FMT"\n", ptr_struct->nv_config_wol);
+	fprintf(file, "cee_dcbx_en          : "UH_FMT"\n", ptr_struct->cee_dcbx_en);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "fw_default_config_payload_version : "UH_FMT"\n", ptr_struct->fw_default_config_payload_version);
+	fprintf(file, "dcbx_willing         : "UH_FMT"\n", ptr_struct->dcbx_willing);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_vlan    : "UH_FMT"\n", ptr_struct->default_boot_vlan);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_protocol : "UH_FMT"\n", ptr_struct->default_boot_protocol);
+int tools_open_lldp_nb_dcbx_size(void)
+{
+	 return 4;
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_retry_cnt : "UH_FMT"\n", ptr_struct->default_boot_retry_cnt);
+void tools_open_lldp_nb_dcbx_dump(const struct tools_open_lldp_nb_dcbx *ptr_struct, FILE* file)
+{
+	tools_open_lldp_nb_dcbx_print(ptr_struct, file, 0);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_network_link_type : "UH_FMT"\n", ptr_struct->default_network_link_type);
+void tools_open_lldp_nb_cap_pack(const struct tools_open_lldp_nb_cap *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_en_wol_magic : "UH_FMT"\n", ptr_struct->default_en_wol_magic);
+	offset = 4;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lldp_nb_dcbx_en);
+
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->lldp_nb_rx_cap);
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->lldp_nb_tx_cap);
+
+}
 
+void tools_open_lldp_nb_cap_unpack(struct tools_open_lldp_nb_cap *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 4;
+	ptr_struct->lldp_nb_dcbx_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 2;
+	ptr_struct->lldp_nb_rx_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+	offset = 0;
+	ptr_struct->lldp_nb_tx_cap = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+}
+
+void tools_open_lldp_nb_cap_print(const struct tools_open_lldp_nb_cap *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_vlan_en : "UH_FMT"\n", ptr_struct->default_boot_vlan_en);
+	fprintf(file, "======== tools_open_lldp_nb_cap ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_option_rom_en : "UH_FMT"\n", ptr_struct->default_boot_option_rom_en);
+	fprintf(file, "lldp_nb_dcbx_en      : "UH_FMT"\n", ptr_struct->lldp_nb_dcbx_en);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_pprx         : "UH_FMT"\n", ptr_struct->default_pprx);
+	fprintf(file, "lldp_nb_rx_cap       : "UH_FMT"\n", ptr_struct->lldp_nb_rx_cap);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_pptx         : "UH_FMT"\n", ptr_struct->default_pptx);
+	fprintf(file, "lldp_nb_tx_cap       : "UH_FMT"\n", ptr_struct->lldp_nb_tx_cap);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "default_boot_pkey    : "UH_FMT"\n", ptr_struct->default_boot_pkey);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_infiniband_dhcp_settings : "UH_FMT"\n", ptr_struct->nv_config_infiniband_dhcp_settings);
+int tools_open_lldp_nb_cap_size(void)
+{
+	 return 12;
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_infiniband_boot_settings : "UH_FMT"\n", ptr_struct->nv_config_infiniband_boot_settings);
+void tools_open_lldp_nb_cap_dump(const struct tools_open_lldp_nb_cap *ptr_struct, FILE* file)
+{
+	tools_open_lldp_nb_cap_print(ptr_struct, file, 0);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_dhcp_iscsi_parameters : "UH_FMT"\n", ptr_struct->nv_config_dhcp_iscsi_parameters);
+void tools_open_lldp_client_settings_pack(const struct tools_open_lldp_client_settings *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_iscsi_parameters : "UH_FMT"\n", ptr_struct->nv_config_iscsi_parameters);
+	offset = 4;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lldp_nb_dcbx);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nv_config_boot_parameters : "UH_FMT"\n", ptr_struct->nv_config_boot_parameters);
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->lldp_nb_rx_mode);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "client_indentifier   : "UH_FMT"\n", ptr_struct->client_indentifier);
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->lldp_nb_tx_mode);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mac_admin_bit        : "UH_FMT"\n", ptr_struct->mac_admin_bit);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_boot_to_target : "UH_FMT"\n", ptr_struct->iscsi_boot_to_target);
+void tools_open_lldp_client_settings_unpack(struct tools_open_lldp_client_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_vlan_en        : "UH_FMT"\n", ptr_struct->iscsi_vlan_en);
+	offset = 4;
+	ptr_struct->lldp_nb_dcbx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_tcp_timestamps_en : "UH_FMT"\n", ptr_struct->iscsi_tcp_timestamps_en);
+	offset = 2;
+	ptr_struct->lldp_nb_rx_mode = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_chap_mutual_auth_en : "UH_FMT"\n", ptr_struct->iscsi_chap_mutual_auth_en);
+	offset = 0;
+	ptr_struct->lldp_nb_tx_mode = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_chap_auth_en   : "UH_FMT"\n", ptr_struct->iscsi_chap_auth_en);
+}
 
+void tools_open_lldp_client_settings_print(const struct tools_open_lldp_client_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_dhcp_params_en : "UH_FMT"\n", ptr_struct->iscsi_dhcp_params_en);
+	fprintf(file, "======== tools_open_lldp_client_settings ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_ipv4_dhcp_en   : "UH_FMT"\n", ptr_struct->iscsi_ipv4_dhcp_en);
+	fprintf(file, "lldp_nb_dcbx         : "UH_FMT"\n", ptr_struct->lldp_nb_dcbx);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_lun_busy_retry_cnt : "UH_FMT"\n", ptr_struct->iscsi_lun_busy_retry_cnt);
+	fprintf(file, "lldp_nb_rx_mode      : "UH_FMT"\n", ptr_struct->lldp_nb_rx_mode);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "iscsi_link_up_delay_time : "UH_FMT"\n", ptr_struct->iscsi_link_up_delay_time);
+	fprintf(file, "lldp_nb_tx_mode      : "UH_FMT"\n", ptr_struct->lldp_nb_tx_mode);
 
 }
 
-int tools_open_query_def_params_per_port_size(void){
-	 return 28;
+int tools_open_lldp_client_settings_size(void)
+{
+	 return 12;
 }
 
-void tools_open_query_def_params_per_port_dump(const struct tools_open_query_def_params_per_port *ptr_struct, FILE* file) {
-	tools_open_query_def_params_per_port_print(ptr_struct, file, 0);
+void tools_open_lldp_client_settings_dump(const struct tools_open_lldp_client_settings *ptr_struct, FILE* file)
+{
+	tools_open_lldp_client_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_query_def_params_global_pack(const struct tools_open_query_def_params_global *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_qos_cap_pack(const struct tools_open_qos_cap *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->fw_default_config_payload_version);
-
-	offset=56;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->num_vfs);
-
-	offset=52;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->uar_bar_size);
-
-	offset=48;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->max_uar_bar_size);
+	offset = 28;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->max_num_of_vl);
 
-	offset=32;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_en);
+	offset = 24;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->max_num_of_tc);
 
 }
 
-void tools_open_query_def_params_global_unpack(struct tools_open_query_def_params_global *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_qos_cap_unpack(struct tools_open_qos_cap *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	ptr_struct->fw_default_config_payload_version = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
-
-	offset=56;
-	ptr_struct->num_vfs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
-
-	offset=52;
-	ptr_struct->uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
-
-	offset=48;
-	ptr_struct->max_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+	offset = 28;
+	ptr_struct->max_num_of_vl = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=32;
-	ptr_struct->sriov_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 24;
+	ptr_struct->max_num_of_tc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_query_def_params_global_print(const struct tools_open_query_def_params_global *ptr_struct, FILE* file, int indent_level){
+void tools_open_qos_cap_print(const struct tools_open_qos_cap *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_query_def_params_global ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_qos_cap ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "fw_default_config_payload_version : "UH_FMT"\n", ptr_struct->fw_default_config_payload_version);
-
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "num_vfs              : "UH_FMT"\n", ptr_struct->num_vfs);
-
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "uar_bar_size         : "UH_FMT"\n", ptr_struct->uar_bar_size);
-
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "max_uar_bar_size     : "UH_FMT"\n", ptr_struct->max_uar_bar_size);
+	fprintf(file, "max_num_of_vl        : "UH_FMT"\n", ptr_struct->max_num_of_vl);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "sriov_en             : "UH_FMT"\n", ptr_struct->sriov_en);
+	fprintf(file, "max_num_of_tc        : "UH_FMT"\n", ptr_struct->max_num_of_tc);
 
 }
 
-int tools_open_query_def_params_global_size(void){
-	 return 20;
+int tools_open_qos_cap_size(void)
+{
+	 return 12;
 }
 
-void tools_open_query_def_params_global_dump(const struct tools_open_query_def_params_global *ptr_struct, FILE* file) {
-	tools_open_query_def_params_global_print(ptr_struct, file, 0);
+void tools_open_qos_cap_dump(const struct tools_open_qos_cap *ptr_struct, FILE* file)
+{
+	tools_open_qos_cap_print(ptr_struct, file, 0);
 }
 
-void tools_open_phy_reg_pack(const union tools_open_phy_reg *ptr_struct, u_int8_t* ptr_buff)
+void tools_open_qos_pack(const struct tools_open_qos *ptr_struct, u_int8_t* ptr_buff)
 {
-	tools_open_pmdio_pack(&(ptr_struct->pmdio), ptr_buff);
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 28;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->num_of_vl);
+
+	offset = 24;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->num_of_tc);
+
 }
 
-void tools_open_phy_reg_unpack(union tools_open_phy_reg *ptr_struct, const u_int8_t* ptr_buff)
+void tools_open_qos_unpack(struct tools_open_qos *ptr_struct, const u_int8_t* ptr_buff)
 {
-	tools_open_pmdio_unpack(&(ptr_struct->pmdio), ptr_buff);
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 28;
+	ptr_struct->num_of_vl = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+
+	offset = 24;
+	ptr_struct->num_of_tc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
+
 }
 
-void tools_open_phy_reg_print(const union tools_open_phy_reg *ptr_struct, FILE* file, int indent_level){
+void tools_open_qos_print(const struct tools_open_qos *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_phy_reg ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_qos ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "pmdic:\n");
-	tools_open_pmdic_print(&(ptr_struct->pmdic), file, indent_level + 1);
+	fprintf(file, "num_of_vl            : "UH_FMT"\n", ptr_struct->num_of_vl);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "pmdio:\n");
-	tools_open_pmdio_print(&(ptr_struct->pmdio), file, indent_level + 1);
+	fprintf(file, "num_of_tc            : "UH_FMT"\n", ptr_struct->num_of_tc);
 
 }
 
-int tools_open_phy_reg_size(void){
-	 return 264;
+int tools_open_qos_size(void)
+{
+	 return 12;
 }
 
-void tools_open_phy_reg_dump(const union tools_open_phy_reg *ptr_struct, FILE* file) {
-	tools_open_phy_reg_print(ptr_struct, file, 0);
+void tools_open_qos_dump(const struct tools_open_qos *ptr_struct, FILE* file)
+{
+	tools_open_qos_print(ptr_struct, file, 0);
 }
 
-void tools_open_mnv_cfg_pack(const union tools_open_mnv_cfg *ptr_struct, u_int8_t* ptr_buff)
+void tools_open_option_rom_capability_pack(const struct tools_open_option_rom_capability *ptr_struct, u_int8_t* ptr_buff)
 {
-	tools_open_nvdi_pack(&(ptr_struct->nvdi), ptr_buff);
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->ip_ver);
+
 }
 
-void tools_open_mnv_cfg_unpack(union tools_open_mnv_cfg *ptr_struct, const u_int8_t* ptr_buff)
+void tools_open_option_rom_capability_unpack(struct tools_open_option_rom_capability *ptr_struct, const u_int8_t* ptr_buff)
 {
-	tools_open_nvdi_unpack(&(ptr_struct->nvdi), ptr_buff);
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 0;
+	ptr_struct->ip_ver = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
 }
 
-void tools_open_mnv_cfg_print(const union tools_open_mnv_cfg *ptr_struct, FILE* file, int indent_level){
+void tools_open_option_rom_capability_print(const struct tools_open_option_rom_capability *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_mnv_cfg ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_option_rom_capability ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mnva:\n");
-	tools_open_mnva_print(&(ptr_struct->mnva), file, indent_level + 1);
+	fprintf(file, "ip_ver               : "UH_FMT"\n", ptr_struct->ip_ver);
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mnvi:\n");
-	tools_open_mnvi_print(&(ptr_struct->mnvi), file, indent_level + 1);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "mnvia:\n");
-	tools_open_mnvia_print(&(ptr_struct->mnvia), file, indent_level + 1);
+int tools_open_option_rom_capability_size(void)
+{
+	 return 4;
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nvqc:\n");
-	tools_open_nvqc_print(&(ptr_struct->nvqc), file, indent_level + 1);
+void tools_open_option_rom_capability_dump(const struct tools_open_option_rom_capability *ptr_struct, FILE* file)
+{
+	tools_open_option_rom_capability_print(ptr_struct, file, 0);
+}
 
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nvia:\n");
-	tools_open_nvia_print(&(ptr_struct->nvia), file, indent_level + 1);
+void tools_open_boot_settings_ext_pack(const struct tools_open_boot_settings_ext *ptr_struct, u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
+
+	offset = 22;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->ip_ver);
+
+}
+
+void tools_open_boot_settings_ext_unpack(struct tools_open_boot_settings_ext *ptr_struct, const u_int8_t* ptr_buff)
+{
+	u_int32_t offset;
+	int i = 0;
+	(void)offset;
+	(void)i;
+	(void)ptr_struct;
+	(void)ptr_buff;
 
+	offset = 22;
+	ptr_struct->ip_ver = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+
+}
+
+void tools_open_boot_settings_ext_print(const struct tools_open_boot_settings_ext *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nvda:\n");
-	tools_open_nvda_print(&(ptr_struct->nvda), file, indent_level + 1);
+	fprintf(file, "======== tools_open_boot_settings_ext ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "nvdi:\n");
-	tools_open_nvdi_print(&(ptr_struct->nvdi), file, indent_level + 1);
+	fprintf(file, "ip_ver               : "UH_FMT"\n", ptr_struct->ip_ver);
 
 }
 
-int tools_open_mnv_cfg_size(void){
-	 return 256;
+int tools_open_boot_settings_ext_size(void)
+{
+	 return 4;
 }
 
-void tools_open_mnv_cfg_dump(const union tools_open_mnv_cfg *ptr_struct, FILE* file) {
-	tools_open_mnv_cfg_print(ptr_struct, file, 0);
+void tools_open_boot_settings_ext_dump(const struct tools_open_boot_settings_ext *ptr_struct, FILE* file)
+{
+	tools_open_boot_settings_ext_print(ptr_struct, file, 0);
 }
 
-void tools_open_lldp_nb_capability_pack(const struct tools_open_lldp_nb_capability *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_external_port_pack(const struct tools_open_external_port *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lldp_nb_supported);
+	offset = 31;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->port_owner);
 
-	offset=48;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->max_total_lldp_tlv_len);
-
-	for (i=0; i < 16; i++) {
-	offset=adb2c_calc_array_field_address(88, 8, i, 192, 1);
-	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->supported_lldp_tx_tlv_mask[i]);
-	}
+	offset = 30;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->allow_rd_counters);
 
 }
 
-void tools_open_lldp_nb_capability_unpack(struct tools_open_lldp_nb_capability *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_external_port_unpack(struct tools_open_external_port *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
-	ptr_struct->lldp_nb_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
-
-	offset=48;
-	ptr_struct->max_total_lldp_tlv_len = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
+	offset = 31;
+	ptr_struct->port_owner = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	for (i=0; i < 16; i++) {
-	offset=adb2c_calc_array_field_address(88, 8, i, 192, 1);
-	ptr_struct->supported_lldp_tx_tlv_mask[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
-	}
+	offset = 30;
+	ptr_struct->allow_rd_counters = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_lldp_nb_capability_print(const struct tools_open_lldp_nb_capability *ptr_struct, FILE* file, int indent_level){
+void tools_open_external_port_print(const struct tools_open_external_port *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_lldp_nb_capability ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	fprintf(file, "======== tools_open_external_port ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "lldp_nb_supported    : "UH_FMT"\n", ptr_struct->lldp_nb_supported);
-
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "max_total_lldp_tlv_len : "UH_FMT"\n", ptr_struct->max_total_lldp_tlv_len);
+	fprintf(file, "port_owner           : "UH_FMT"\n", ptr_struct->port_owner);
 
-	for (i=0; i < 16; i++) {
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "supported_lldp_tx_tlv_mask_%03d : "UH_FMT"\n", i, ptr_struct->supported_lldp_tx_tlv_mask[i]);
-	}
+	fprintf(file, "allow_rd_counters    : "UH_FMT"\n", ptr_struct->allow_rd_counters);
 
 }
 
-int tools_open_lldp_nb_capability_size(void){
-	 return 24;
+int tools_open_external_port_size(void)
+{
+	 return 8;
 }
 
-void tools_open_lldp_nb_capability_dump(const struct tools_open_lldp_nb_capability *ptr_struct, FILE* file) {
-	tools_open_lldp_nb_capability_print(ptr_struct, file, 0);
+void tools_open_external_port_dump(const struct tools_open_external_port *ptr_struct, FILE* file)
+{
+	tools_open_external_port_print(ptr_struct, file, 0);
 }
 
-void tools_open_lldp_nb_pack(const struct tools_open_lldp_nb *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_lldp_nb_pack(const struct tools_open_lldp_nb *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lldp_nb_rx_en);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->lldp_nb_tx_en);
 
-	offset=84;
+	offset = 84;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->lldp_msg_tx_interval);
 
-	for (i=0; i < 16; i++) {
-	offset=adb2c_calc_array_field_address(120, 8, i, 224, 1);
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(120, 8, i, 224, 1);
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->lldp_tx_tlv_mask[i]);
 	}
 
 }
 
-void tools_open_lldp_nb_unpack(struct tools_open_lldp_nb *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_lldp_nb_unpack(struct tools_open_lldp_nb *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=1;
+	offset = 1;
 	ptr_struct->lldp_nb_rx_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->lldp_nb_tx_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=84;
+	offset = 84;
 	ptr_struct->lldp_msg_tx_interval = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
 
-	for (i=0; i < 16; i++) {
-	offset=adb2c_calc_array_field_address(120, 8, i, 224, 1);
+	for (i = 0; i < 16; i++) {
+	offset = adb2c_calc_array_field_address(120, 8, i, 224, 1);
 	ptr_struct->lldp_tx_tlv_mask[i] = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 	}
 
 }
 
-void tools_open_lldp_nb_print(const struct tools_open_lldp_nb *ptr_struct, FILE* file, int indent_level){
+void tools_open_lldp_nb_print(const struct tools_open_lldp_nb *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_lldp_nb ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -1985,162 +3457,166 @@ void tools_open_lldp_nb_print(const struct tools_open_lldp_nb *ptr_struct, FILE*
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "lldp_msg_tx_interval : "UH_FMT"\n", ptr_struct->lldp_msg_tx_interval);
 
-	for (i=0; i < 16; i++) {
+	for (i = 0; i < 16; i++) {
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "lldp_tx_tlv_mask_%03d : "UH_FMT"\n", i, ptr_struct->lldp_tx_tlv_mask[i]);
 	}
 
 }
 
-int tools_open_lldp_nb_size(void){
+int tools_open_lldp_nb_size(void)
+{
 	 return 28;
 }
 
-void tools_open_lldp_nb_dump(const struct tools_open_lldp_nb *ptr_struct, FILE* file) {
+void tools_open_lldp_nb_dump(const struct tools_open_lldp_nb *ptr_struct, FILE* file)
+{
 	tools_open_lldp_nb_print(ptr_struct, file, 0);
 }
 
-void tools_open_roce_cc_ecn_pack(const struct tools_open_roce_cc_ecn *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_roce_cc_ecn_pack(const struct tools_open_roce_cc_ecn *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->clamp_tgt_rate_after_time_inc);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->clamp_tgt_rate);
 
-	offset=47;
+	offset = 47;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rpg_time_reset);
 
-	offset=81;
+	offset = 81;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 15, (u_int32_t)ptr_struct->rpg_byte_reset);
 
-	offset=123;
+	offset = 123;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 5, (u_int32_t)ptr_struct->rpg_threshold);
 
-	offset=129;
+	offset = 129;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 31, (u_int32_t)ptr_struct->rpg_max_rate);
 
-	offset=175;
+	offset = 175;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rpg_ai_rate);
 
-	offset=207;
+	offset = 207;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rpg_hai_rate);
 
-	offset=252;
+	offset = 252;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->rpg_gd);
 
-	offset=280;
+	offset = 280;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->rpg_min_dec_fac);
 
-	offset=303;
+	offset = 303;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rpg_min_rate);
 
-	offset=335;
+	offset = 335;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rate_to_set_on_first_cnp);
 
-	offset=374;
+	offset = 374;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->dce_tcp_g);
 
-	offset=399;
+	offset = 399;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->dce_tcp_rtt);
 
-	offset=431;
+	offset = 431;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->rate_reduce_monitor_period);
 
-	offset=470;
+	offset = 470;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->initial_alpha_value);
 
-	offset=495;
+	offset = 495;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 17, (u_int32_t)ptr_struct->min_time_between_cnps);
 
-	offset=541;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->cnp_dscp);
+	offset = 541;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->cnp_802p_prio);
 
-	offset=530;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->cnp_802p_prio);
+	offset = 530;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->cnp_dscp);
 
 }
 
-void tools_open_roce_cc_ecn_unpack(struct tools_open_roce_cc_ecn *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_roce_cc_ecn_unpack(struct tools_open_roce_cc_ecn *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=1;
+	offset = 1;
 	ptr_struct->clamp_tgt_rate_after_time_inc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->clamp_tgt_rate = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=47;
+	offset = 47;
 	ptr_struct->rpg_time_reset = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=81;
+	offset = 81;
 	ptr_struct->rpg_byte_reset = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 15);
 
-	offset=123;
+	offset = 123;
 	ptr_struct->rpg_threshold = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 5);
 
-	offset=129;
+	offset = 129;
 	ptr_struct->rpg_max_rate = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 31);
 
-	offset=175;
+	offset = 175;
 	ptr_struct->rpg_ai_rate = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=207;
+	offset = 207;
 	ptr_struct->rpg_hai_rate = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=252;
+	offset = 252;
 	ptr_struct->rpg_gd = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=280;
+	offset = 280;
 	ptr_struct->rpg_min_dec_fac = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=303;
+	offset = 303;
 	ptr_struct->rpg_min_rate = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=335;
+	offset = 335;
 	ptr_struct->rate_to_set_on_first_cnp = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=374;
+	offset = 374;
 	ptr_struct->dce_tcp_g = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=399;
+	offset = 399;
 	ptr_struct->dce_tcp_rtt = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=431;
+	offset = 431;
 	ptr_struct->rate_reduce_monitor_period = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=470;
+	offset = 470;
 	ptr_struct->initial_alpha_value = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=495;
+	offset = 495;
 	ptr_struct->min_time_between_cnps = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 17);
 
-	offset=541;
-	ptr_struct->cnp_dscp = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
+	offset = 541;
+	ptr_struct->cnp_802p_prio = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
 
-	offset=530;
-	ptr_struct->cnp_802p_prio = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
+	offset = 530;
+	ptr_struct->cnp_dscp = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
 }
 
-void tools_open_roce_cc_ecn_print(const struct tools_open_roce_cc_ecn *ptr_struct, FILE* file, int indent_level){
+void tools_open_roce_cc_ecn_print(const struct tools_open_roce_cc_ecn *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_roce_cc_ecn ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2196,60 +3672,64 @@ void tools_open_roce_cc_ecn_print(const struct tools_open_roce_cc_ecn *ptr_struc
 	fprintf(file, "min_time_between_cnps : "UH_FMT"\n", ptr_struct->min_time_between_cnps);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "cnp_dscp             : "UH_FMT"\n", ptr_struct->cnp_dscp);
+	fprintf(file, "cnp_802p_prio        : "UH_FMT"\n", ptr_struct->cnp_802p_prio);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "cnp_802p_prio        : "UH_FMT"\n", ptr_struct->cnp_802p_prio);
+	fprintf(file, "cnp_dscp             : "UH_FMT"\n", ptr_struct->cnp_dscp);
 
 }
 
-int tools_open_roce_cc_ecn_size(void){
+int tools_open_roce_cc_ecn_size(void)
+{
 	 return 68;
 }
 
-void tools_open_roce_cc_ecn_dump(const struct tools_open_roce_cc_ecn *ptr_struct, FILE* file) {
+void tools_open_roce_cc_ecn_dump(const struct tools_open_roce_cc_ecn *ptr_struct, FILE* file)
+{
 	tools_open_roce_cc_ecn_print(ptr_struct, file, 0);
 }
 
-void tools_open_roce_cc_pack(const struct tools_open_roce_cc *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_roce_cc_pack(const struct tools_open_roce_cc *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->roce_cc_enable_priority);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->roce_cc_algorithm);
 
 }
 
-void tools_open_roce_cc_unpack(struct tools_open_roce_cc *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_roce_cc_unpack(struct tools_open_roce_cc *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	ptr_struct->roce_cc_enable_priority = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->roce_cc_algorithm = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_roce_cc_print(const struct tools_open_roce_cc *ptr_struct, FILE* file, int indent_level){
+void tools_open_roce_cc_print(const struct tools_open_roce_cc *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_roce_cc ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2261,47 +3741,51 @@ void tools_open_roce_cc_print(const struct tools_open_roce_cc *ptr_struct, FILE*
 
 }
 
-int tools_open_roce_cc_size(void){
+int tools_open_roce_cc_size(void)
+{
 	 return 4;
 }
 
-void tools_open_roce_cc_dump(const struct tools_open_roce_cc *ptr_struct, FILE* file) {
+void tools_open_roce_cc_dump(const struct tools_open_roce_cc *ptr_struct, FILE* file)
+{
 	tools_open_roce_cc_print(ptr_struct, file, 0);
 }
 
-void tools_open_roce_v_1_5_next_protocol_pack(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_roce_v_1_5_next_protocol_pack(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->roce_over_ip_next_protocol);
 
 }
 
-void tools_open_roce_v_1_5_next_protocol_unpack(struct tools_open_roce_v_1_5_next_protocol *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_roce_v_1_5_next_protocol_unpack(struct tools_open_roce_v_1_5_next_protocol *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	ptr_struct->roce_over_ip_next_protocol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_roce_v_1_5_next_protocol_print(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, FILE* file, int indent_level){
+void tools_open_roce_v_1_5_next_protocol_print(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_roce_v_1_5_next_protocol ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2310,53 +3794,57 @@ void tools_open_roce_v_1_5_next_protocol_print(const struct tools_open_roce_v_1_
 
 }
 
-int tools_open_roce_v_1_5_next_protocol_size(void){
+int tools_open_roce_v_1_5_next_protocol_size(void)
+{
 	 return 4;
 }
 
-void tools_open_roce_v_1_5_next_protocol_dump(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, FILE* file) {
+void tools_open_roce_v_1_5_next_protocol_dump(const struct tools_open_roce_v_1_5_next_protocol *ptr_struct, FILE* file)
+{
 	tools_open_roce_v_1_5_next_protocol_print(ptr_struct, file, 0);
 }
 
-void tools_open_vpi_settings_pack(const struct tools_open_vpi_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_vpi_settings_pack(const struct tools_open_vpi_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=30;
+	offset = 30;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->network_link_type);
 
-	offset=28;
+	offset = 28;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->default_link_type);
 
 }
 
-void tools_open_vpi_settings_unpack(struct tools_open_vpi_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_vpi_settings_unpack(struct tools_open_vpi_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=30;
+	offset = 30;
 	ptr_struct->network_link_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=28;
+	offset = 28;
 	ptr_struct->default_link_type = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
 }
 
-void tools_open_vpi_settings_print(const struct tools_open_vpi_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_vpi_settings_print(const struct tools_open_vpi_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_vpi_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2368,47 +3856,51 @@ void tools_open_vpi_settings_print(const struct tools_open_vpi_settings *ptr_str
 
 }
 
-int tools_open_vpi_settings_size(void){
+int tools_open_vpi_settings_size(void)
+{
 	 return 4;
 }
 
-void tools_open_vpi_settings_dump(const struct tools_open_vpi_settings *ptr_struct, FILE* file) {
+void tools_open_vpi_settings_dump(const struct tools_open_vpi_settings *ptr_struct, FILE* file)
+{
 	tools_open_vpi_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_bar_size_pack(const struct tools_open_bar_size *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_bar_size_pack(const struct tools_open_bar_size *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->log_uar_bar_size);
 
 }
 
-void tools_open_bar_size_unpack(struct tools_open_bar_size *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_bar_size_unpack(struct tools_open_bar_size *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	ptr_struct->log_uar_bar_size = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_bar_size_print(const struct tools_open_bar_size *ptr_struct, FILE* file, int indent_level){
+void tools_open_bar_size_print(const struct tools_open_bar_size *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_bar_size ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2417,53 +3909,57 @@ void tools_open_bar_size_print(const struct tools_open_bar_size *ptr_struct, FIL
 
 }
 
-int tools_open_bar_size_size(void){
+int tools_open_bar_size_size(void)
+{
 	 return 4;
 }
 
-void tools_open_bar_size_dump(const struct tools_open_bar_size *ptr_struct, FILE* file) {
+void tools_open_bar_size_dump(const struct tools_open_bar_size *ptr_struct, FILE* file)
+{
 	tools_open_bar_size_print(ptr_struct, file, 0);
 }
 
-void tools_open_sriov_pack(const struct tools_open_sriov *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_sriov_pack(const struct tools_open_sriov *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->total_vfs);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_en);
 
 }
 
-void tools_open_sriov_unpack(struct tools_open_sriov *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_sriov_unpack(struct tools_open_sriov *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->total_vfs = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->sriov_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_sriov_print(const struct tools_open_sriov *ptr_struct, FILE* file, int indent_level){
+void tools_open_sriov_print(const struct tools_open_sriov *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_sriov ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2475,71 +3971,75 @@ void tools_open_sriov_print(const struct tools_open_sriov *ptr_struct, FILE* fil
 
 }
 
-int tools_open_sriov_size(void){
+int tools_open_sriov_size(void)
+{
 	 return 4;
 }
 
-void tools_open_sriov_dump(const struct tools_open_sriov *ptr_struct, FILE* file) {
+void tools_open_sriov_dump(const struct tools_open_sriov *ptr_struct, FILE* file)
+{
 	tools_open_sriov_print(ptr_struct, file, 0);
 }
 
-void tools_open_preboot_flow_ctrl_pack(const struct tools_open_preboot_flow_ctrl *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_preboot_flow_ctrl_pack(const struct tools_open_preboot_flow_ctrl *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->pfcrx);
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->pfctx);
 
-	offset=2;
+	offset = 2;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pfc_willing);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pprx);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pptx);
 
 }
 
-void tools_open_preboot_flow_ctrl_unpack(struct tools_open_preboot_flow_ctrl *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_preboot_flow_ctrl_unpack(struct tools_open_preboot_flow_ctrl *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=24;
+	offset = 24;
 	ptr_struct->pfcrx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=16;
+	offset = 16;
 	ptr_struct->pfctx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=2;
+	offset = 2;
 	ptr_struct->pfc_willing = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->pprx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->pptx = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_preboot_flow_ctrl_print(const struct tools_open_preboot_flow_ctrl *ptr_struct, FILE* file, int indent_level){
+void tools_open_preboot_flow_ctrl_print(const struct tools_open_preboot_flow_ctrl *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_preboot_flow_ctrl ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2560,71 +4060,75 @@ void tools_open_preboot_flow_ctrl_print(const struct tools_open_preboot_flow_ctr
 
 }
 
-int tools_open_preboot_flow_ctrl_size(void){
+int tools_open_preboot_flow_ctrl_size(void)
+{
 	 return 4;
 }
 
-void tools_open_preboot_flow_ctrl_dump(const struct tools_open_preboot_flow_ctrl *ptr_struct, FILE* file) {
+void tools_open_preboot_flow_ctrl_dump(const struct tools_open_preboot_flow_ctrl *ptr_struct, FILE* file)
+{
 	tools_open_preboot_flow_ctrl_print(ptr_struct, file, 0);
 }
 
-void tools_open_preboot_boot_settings_pack(const struct tools_open_preboot_boot_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_preboot_boot_settings_pack(const struct tools_open_preboot_boot_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=20;
+	offset = 20;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->boot_vlan);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->legacy_boot_protocol);
 
-	offset=5;
+	offset = 5;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->boot_retry_count);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->boot_vlan_en);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->boot_option_rom_en);
 
 }
 
-void tools_open_preboot_boot_settings_unpack(struct tools_open_preboot_boot_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_preboot_boot_settings_unpack(struct tools_open_preboot_boot_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=20;
+	offset = 20;
 	ptr_struct->boot_vlan = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->legacy_boot_protocol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=5;
+	offset = 5;
 	ptr_struct->boot_retry_count = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->boot_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->boot_option_rom_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_preboot_boot_settings_print(const struct tools_open_preboot_boot_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_preboot_boot_settings_print(const struct tools_open_preboot_boot_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_preboot_boot_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2645,71 +4149,75 @@ void tools_open_preboot_boot_settings_print(const struct tools_open_preboot_boot
 
 }
 
-int tools_open_preboot_boot_settings_size(void){
+int tools_open_preboot_boot_settings_size(void)
+{
 	 return 4;
 }
 
-void tools_open_preboot_boot_settings_dump(const struct tools_open_preboot_boot_settings *ptr_struct, FILE* file) {
+void tools_open_preboot_boot_settings_dump(const struct tools_open_preboot_boot_settings *ptr_struct, FILE* file)
+{
 	tools_open_preboot_boot_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_boot_settings_pack(const struct tools_open_boot_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_boot_settings_pack(const struct tools_open_boot_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=20;
+	offset = 20;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->boot_vlan);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->legacy_boot_protocol);
 
-	offset=5;
+	offset = 5;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 3, (u_int32_t)ptr_struct->boot_retry_conut);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->boot_vlan_en);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->boot_option_rom_en);
 
 }
 
-void tools_open_boot_settings_unpack(struct tools_open_boot_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_boot_settings_unpack(struct tools_open_boot_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=20;
+	offset = 20;
 	ptr_struct->boot_vlan = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->legacy_boot_protocol = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=5;
+	offset = 5;
 	ptr_struct->boot_retry_conut = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 3);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->boot_vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->boot_option_rom_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_boot_settings_print(const struct tools_open_boot_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_boot_settings_print(const struct tools_open_boot_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_boot_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2730,47 +4238,51 @@ void tools_open_boot_settings_print(const struct tools_open_boot_settings *ptr_s
 
 }
 
-int tools_open_boot_settings_size(void){
+int tools_open_boot_settings_size(void)
+{
 	 return 4;
 }
 
-void tools_open_boot_settings_dump(const struct tools_open_boot_settings *ptr_struct, FILE* file) {
+void tools_open_boot_settings_dump(const struct tools_open_boot_settings *ptr_struct, FILE* file)
+{
 	tools_open_boot_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_infiniband_boot_settings_pack(const struct tools_open_infiniband_boot_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_infiniband_boot_settings_pack(const struct tools_open_infiniband_boot_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->boot_pkey);
 
 }
 
-void tools_open_infiniband_boot_settings_unpack(struct tools_open_infiniband_boot_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_infiniband_boot_settings_unpack(struct tools_open_infiniband_boot_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=16;
+	offset = 16;
 	ptr_struct->boot_pkey = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
 }
 
-void tools_open_infiniband_boot_settings_print(const struct tools_open_infiniband_boot_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_infiniband_boot_settings_print(const struct tools_open_infiniband_boot_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_infiniband_boot_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2779,113 +4291,117 @@ void tools_open_infiniband_boot_settings_print(const struct tools_open_infiniban
 
 }
 
-int tools_open_infiniband_boot_settings_size(void){
+int tools_open_infiniband_boot_settings_size(void)
+{
 	 return 4;
 }
 
-void tools_open_infiniband_boot_settings_dump(const struct tools_open_infiniband_boot_settings *ptr_struct, FILE* file) {
+void tools_open_infiniband_boot_settings_dump(const struct tools_open_infiniband_boot_settings *ptr_struct, FILE* file)
+{
 	tools_open_infiniband_boot_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_iscsi_settings_pack(const struct tools_open_iscsi_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_iscsi_settings_pack(const struct tools_open_iscsi_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=10;
+	offset = 10;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->target_as_first_hdd_en);
 
-	offset=8;
+	offset = 8;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->boot_to_target);
 
-	offset=7;
+	offset = 7;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->ipv6_auto_config_en);
 
-	offset=5;
+	offset = 5;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->vlan_en);
 
-	offset=4;
+	offset = 4;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->tcp_timestamps_en);
 
-	offset=3;
+	offset = 3;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->chap_mutual_auth_en);
 
-	offset=2;
+	offset = 2;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->chap_auth_en);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->dhcp_iscsi_en);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->ipv4_dhcp_en);
 
-	offset=52;
+	offset = 52;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 12, (u_int32_t)ptr_struct->vlan);
 
-	offset=88;
+	offset = 88;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->lun_busy_retry_count);
 
-	offset=80;
+	offset = 80;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->link_up_delay_time);
 
 }
 
-void tools_open_iscsi_settings_unpack(struct tools_open_iscsi_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_iscsi_settings_unpack(struct tools_open_iscsi_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=10;
+	offset = 10;
 	ptr_struct->target_as_first_hdd_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=8;
+	offset = 8;
 	ptr_struct->boot_to_target = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
 
-	offset=7;
+	offset = 7;
 	ptr_struct->ipv6_auto_config_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=5;
+	offset = 5;
 	ptr_struct->vlan_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=4;
+	offset = 4;
 	ptr_struct->tcp_timestamps_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=3;
+	offset = 3;
 	ptr_struct->chap_mutual_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=2;
+	offset = 2;
 	ptr_struct->chap_auth_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->dhcp_iscsi_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->ipv4_dhcp_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=52;
+	offset = 52;
 	ptr_struct->vlan = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 12);
 
-	offset=88;
+	offset = 88;
 	ptr_struct->lun_busy_retry_count = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
-	offset=80;
+	offset = 80;
 	ptr_struct->link_up_delay_time = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
 
 }
 
-void tools_open_iscsi_settings_print(const struct tools_open_iscsi_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_iscsi_settings_print(const struct tools_open_iscsi_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_iscsi_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -2927,192 +4443,227 @@ void tools_open_iscsi_settings_print(const struct tools_open_iscsi_settings *ptr
 
 }
 
-int tools_open_iscsi_settings_size(void){
+int tools_open_iscsi_settings_size(void)
+{
 	 return 12;
 }
 
-void tools_open_iscsi_settings_dump(const struct tools_open_iscsi_settings *ptr_struct, FILE* file) {
+void tools_open_iscsi_settings_dump(const struct tools_open_iscsi_settings *ptr_struct, FILE* file)
+{
 	tools_open_iscsi_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_port_boot_state_pack(const struct tools_open_port_boot_state *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_port_boot_state_pack(const struct tools_open_port_boot_state *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=30;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 2, (u_int32_t)ptr_struct->port_boot_state);
+	offset = 24;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 8, (u_int32_t)ptr_struct->aux_power_indication_gpio);
+
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->aux_power_indication_gpio_en);
+
+	offset = 1;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->standby_on_aux);
+
+	offset = 0;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->power_up_on_aux);
 
 }
 
-void tools_open_port_boot_state_unpack(struct tools_open_port_boot_state *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_port_boot_state_unpack(struct tools_open_port_boot_state *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=30;
-	ptr_struct->port_boot_state = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 2);
+	offset = 24;
+	ptr_struct->aux_power_indication_gpio = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 8);
+
+	offset = 2;
+	ptr_struct->aux_power_indication_gpio_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 1;
+	ptr_struct->standby_on_aux = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+
+	offset = 0;
+	ptr_struct->power_up_on_aux = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_port_boot_state_print(const struct tools_open_port_boot_state *ptr_struct, FILE* file, int indent_level){
+void tools_open_port_boot_state_print(const struct tools_open_port_boot_state *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_port_boot_state ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "port_boot_state      : "UH_FMT"\n", ptr_struct->port_boot_state);
+	fprintf(file, "aux_power_indication_gpio : "UH_FMT"\n", ptr_struct->aux_power_indication_gpio);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "aux_power_indication_gpio_en : "UH_FMT"\n", ptr_struct->aux_power_indication_gpio_en);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "standby_on_aux       : "UH_FMT"\n", ptr_struct->standby_on_aux);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "power_up_on_aux      : "UH_FMT"\n", ptr_struct->power_up_on_aux);
 
 }
 
-int tools_open_port_boot_state_size(void){
+int tools_open_port_boot_state_size(void)
+{
 	 return 4;
 }
 
-void tools_open_port_boot_state_dump(const struct tools_open_port_boot_state *ptr_struct, FILE* file) {
+void tools_open_port_boot_state_dump(const struct tools_open_port_boot_state *ptr_struct, FILE* file)
+{
 	tools_open_port_boot_state_print(ptr_struct, file, 0);
 }
 
-void tools_open_pci_configuration_pack(const struct tools_open_pci_configuration *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_pci_configuration_pack(const struct tools_open_pci_configuration *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=7;
+	offset = 7;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pf_bar_size_valid);
 
-	offset=6;
+	offset = 6;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->vf_bar_size_valid);
 
-	offset=5;
+	offset = 5;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_pfs_msix_valid);
 
-	offset=4;
+	offset = 4;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_vfs_msix_valid);
 
-	offset=3;
+	offset = 3;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_pfs_valid);
 
-	offset=2;
+	offset = 2;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->fpp_valid);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->full_vf_qos_valid);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_valid);
 
-	offset=48;
+	offset = 48;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->total_vfs);
 
-	offset=44;
+	offset = 44;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->num_pfs);
 
-	offset=34;
+	offset = 34;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->fpp_en);
 
-	offset=33;
+	offset = 33;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->full_vf_qos);
 
-	offset=32;
+	offset = 32;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_en);
 
-	offset=90;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->log_vf_uar_bar_size);
-
-	offset=84;
+	offset = 90;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->log_pf_uar_bar_size);
 
-	offset=74;
+	offset = 84;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->log_vf_uar_bar_size);
+
+	offset = 74;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->num_pf_msix);
 
-	offset=64;
+	offset = 64;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->num_vf_msix);
 
 }
 
-void tools_open_pci_configuration_unpack(struct tools_open_pci_configuration *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_pci_configuration_unpack(struct tools_open_pci_configuration *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=7;
+	offset = 7;
 	ptr_struct->pf_bar_size_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=6;
+	offset = 6;
 	ptr_struct->vf_bar_size_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=5;
+	offset = 5;
 	ptr_struct->num_pfs_msix_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=4;
+	offset = 4;
 	ptr_struct->num_vfs_msix_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=3;
+	offset = 3;
 	ptr_struct->num_pfs_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=2;
+	offset = 2;
 	ptr_struct->fpp_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->full_vf_qos_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->sriov_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=48;
+	offset = 48;
 	ptr_struct->total_vfs = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=44;
+	offset = 44;
 	ptr_struct->num_pfs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=34;
+	offset = 34;
 	ptr_struct->fpp_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=33;
+	offset = 33;
 	ptr_struct->full_vf_qos = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=32;
+	offset = 32;
 	ptr_struct->sriov_en = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=90;
-	ptr_struct->log_vf_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
-
-	offset=84;
+	offset = 90;
 	ptr_struct->log_pf_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=74;
+	offset = 84;
+	ptr_struct->log_vf_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
+
+	offset = 74;
 	ptr_struct->num_pf_msix = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=64;
+	offset = 64;
 	ptr_struct->num_vf_msix = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
 }
 
-void tools_open_pci_configuration_print(const struct tools_open_pci_configuration *ptr_struct, FILE* file, int indent_level){
+void tools_open_pci_configuration_print(const struct tools_open_pci_configuration *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_pci_configuration ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3156,10 +4707,10 @@ void tools_open_pci_configuration_print(const struct tools_open_pci_configuratio
 	fprintf(file, "sriov_en             : "UH_FMT"\n", ptr_struct->sriov_en);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "log_vf_uar_bar_size  : "UH_FMT"\n", ptr_struct->log_vf_uar_bar_size);
+	fprintf(file, "log_pf_uar_bar_size  : "UH_FMT"\n", ptr_struct->log_pf_uar_bar_size);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "log_pf_uar_bar_size  : "UH_FMT"\n", ptr_struct->log_pf_uar_bar_size);
+	fprintf(file, "log_vf_uar_bar_size  : "UH_FMT"\n", ptr_struct->log_vf_uar_bar_size);
 
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "num_pf_msix          : "UH_FMT"\n", ptr_struct->num_pf_msix);
@@ -3169,155 +4720,159 @@ void tools_open_pci_configuration_print(const struct tools_open_pci_configuratio
 
 }
 
-int tools_open_pci_configuration_size(void){
+int tools_open_pci_configuration_size(void)
+{
 	 return 12;
 }
 
-void tools_open_pci_configuration_dump(const struct tools_open_pci_configuration *ptr_struct, FILE* file) {
+void tools_open_pci_configuration_dump(const struct tools_open_pci_configuration *ptr_struct, FILE* file)
+{
 	tools_open_pci_configuration_print(ptr_struct, file, 0);
 }
 
-void tools_open_pci_capabilities_pack(const struct tools_open_pci_capabilities *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_pci_capabilities_pack(const struct tools_open_pci_capabilities *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=7;
+	offset = 7;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->pf_bar_size_supported);
 
-	offset=6;
+	offset = 6;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->vf_bar_size_supported);
 
-	offset=5;
+	offset = 5;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_pf_msix_supported);
 
-	offset=4;
+	offset = 4;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_vf_msix_supported);
 
-	offset=3;
+	offset = 3;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->num_pfs_supported);
 
-	offset=2;
-	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->log_max_total_bar_valid);
+	offset = 2;
+	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->max_total_bar_valid);
 
-	offset=1;
+	offset = 1;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->max_total_msix_valid);
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->max_vfs_per_pf_valid);
 
-	offset=48;
+	offset = 48;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 16, (u_int32_t)ptr_struct->max_vfs_per_pf);
 
-	offset=44;
+	offset = 44;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->max_num_pfs);
 
-	offset=34;
+	offset = 34;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->fpp_support);
 
-	offset=33;
+	offset = 33;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->vf_qos_control_support);
 
-	offset=32;
+	offset = 32;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->sriov_support);
 
-	offset=90;
+	offset = 90;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->log_max_pf_uar_bar_size1);
 
-	offset=84;
+	offset = 84;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 6, (u_int32_t)ptr_struct->log_max_vf_uar_bar_size);
 
-	offset=74;
+	offset = 74;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->max_num_pf_msix);
 
-	offset=64;
+	offset = 64;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 10, (u_int32_t)ptr_struct->max_num_vf_msix);
 
-	offset=96;
+	offset = 96;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->max_total_msix);
 
-	offset=128;
-	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->log_max_total_bar);
+	offset = 128;
+	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->max_total_bar);
 
 }
 
-void tools_open_pci_capabilities_unpack(struct tools_open_pci_capabilities *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_pci_capabilities_unpack(struct tools_open_pci_capabilities *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=7;
+	offset = 7;
 	ptr_struct->pf_bar_size_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=6;
+	offset = 6;
 	ptr_struct->vf_bar_size_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=5;
+	offset = 5;
 	ptr_struct->num_pf_msix_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=4;
+	offset = 4;
 	ptr_struct->num_vf_msix_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=3;
+	offset = 3;
 	ptr_struct->num_pfs_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=2;
-	ptr_struct->log_max_total_bar_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
+	offset = 2;
+	ptr_struct->max_total_bar_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=1;
+	offset = 1;
 	ptr_struct->max_total_msix_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=0;
+	offset = 0;
 	ptr_struct->max_vfs_per_pf_valid = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=48;
+	offset = 48;
 	ptr_struct->max_vfs_per_pf = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 16);
 
-	offset=44;
+	offset = 44;
 	ptr_struct->max_num_pfs = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
-	offset=34;
+	offset = 34;
 	ptr_struct->fpp_support = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=33;
+	offset = 33;
 	ptr_struct->vf_qos_control_support = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=32;
+	offset = 32;
 	ptr_struct->sriov_support = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=90;
+	offset = 90;
 	ptr_struct->log_max_pf_uar_bar_size1 = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=84;
+	offset = 84;
 	ptr_struct->log_max_vf_uar_bar_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 6);
 
-	offset=74;
+	offset = 74;
 	ptr_struct->max_num_pf_msix = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=64;
+	offset = 64;
 	ptr_struct->max_num_vf_msix = (u_int16_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 10);
 
-	offset=96;
+	offset = 96;
 	ptr_struct->max_total_msix = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	offset=128;
-	ptr_struct->log_max_total_bar = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
+	offset = 128;
+	ptr_struct->max_total_bar = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_pci_capabilities_print(const struct tools_open_pci_capabilities *ptr_struct, FILE* file, int indent_level){
+void tools_open_pci_capabilities_print(const struct tools_open_pci_capabilities *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_pci_capabilities ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3337,7 +4892,7 @@ void tools_open_pci_capabilities_print(const struct tools_open_pci_capabilities
 	fprintf(file, "num_pfs_supported    : "UH_FMT"\n", ptr_struct->num_pfs_supported);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "log_max_total_bar_valid : "UH_FMT"\n", ptr_struct->log_max_total_bar_valid);
+	fprintf(file, "max_total_bar_valid  : "UH_FMT"\n", ptr_struct->max_total_bar_valid);
 
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "max_total_msix_valid : "UH_FMT"\n", ptr_struct->max_total_msix_valid);
@@ -3376,51 +4931,55 @@ void tools_open_pci_capabilities_print(const struct tools_open_pci_capabilities
 	fprintf(file, "max_total_msix       : "U32H_FMT"\n", ptr_struct->max_total_msix);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "log_max_total_bar    : "U32H_FMT"\n", ptr_struct->log_max_total_bar);
+	fprintf(file, "max_total_bar        : "U32H_FMT"\n", ptr_struct->max_total_bar);
 
 }
 
-int tools_open_pci_capabilities_size(void){
+int tools_open_pci_capabilities_size(void)
+{
 	 return 20;
 }
 
-void tools_open_pci_capabilities_dump(const struct tools_open_pci_capabilities *ptr_struct, FILE* file) {
+void tools_open_pci_capabilities_dump(const struct tools_open_pci_capabilities *ptr_struct, FILE* file)
+{
 	tools_open_pci_capabilities_print(ptr_struct, file, 0);
 }
 
-void tools_open_tpt_configuration_pack(const struct tools_open_tpt_configuration *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_tpt_configuration_pack(const struct tools_open_tpt_configuration *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=28;
+	offset = 28;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 4, (u_int32_t)ptr_struct->log_max_payload_size);
 
 }
 
-void tools_open_tpt_configuration_unpack(struct tools_open_tpt_configuration *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_tpt_configuration_unpack(struct tools_open_tpt_configuration *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=28;
+	offset = 28;
 	ptr_struct->log_max_payload_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_tpt_configuration_print(const struct tools_open_tpt_configuration *ptr_struct, FILE* file, int indent_level){
+void tools_open_tpt_configuration_print(const struct tools_open_tpt_configuration *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_tpt_configuration ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3429,47 +4988,51 @@ void tools_open_tpt_configuration_print(const struct tools_open_tpt_configuratio
 
 }
 
-int tools_open_tpt_configuration_size(void){
+int tools_open_tpt_configuration_size(void)
+{
 	 return 4;
 }
 
-void tools_open_tpt_configuration_dump(const struct tools_open_tpt_configuration *ptr_struct, FILE* file) {
+void tools_open_tpt_configuration_dump(const struct tools_open_tpt_configuration *ptr_struct, FILE* file)
+{
 	tools_open_tpt_configuration_print(ptr_struct, file, 0);
 }
 
-void tools_open_tpt_capabilities_pack(const struct tools_open_tpt_capabilities *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_tpt_capabilities_pack(const struct tools_open_tpt_capabilities *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->log_max_payload_size_supported);
 
 }
 
-void tools_open_tpt_capabilities_unpack(struct tools_open_tpt_capabilities *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_tpt_capabilities_unpack(struct tools_open_tpt_capabilities *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	ptr_struct->log_max_payload_size_supported = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_tpt_capabilities_print(const struct tools_open_tpt_capabilities *ptr_struct, FILE* file, int indent_level){
+void tools_open_tpt_capabilities_print(const struct tools_open_tpt_capabilities *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_tpt_capabilities ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3478,53 +5041,57 @@ void tools_open_tpt_capabilities_print(const struct tools_open_tpt_capabilities
 
 }
 
-int tools_open_tpt_capabilities_size(void){
+int tools_open_tpt_capabilities_size(void)
+{
 	 return 4;
 }
 
-void tools_open_tpt_capabilities_dump(const struct tools_open_tpt_capabilities *ptr_struct, FILE* file) {
+void tools_open_tpt_capabilities_dump(const struct tools_open_tpt_capabilities *ptr_struct, FILE* file)
+{
 	tools_open_tpt_capabilities_print(ptr_struct, file, 0);
 }
 
-void tools_open_infiniband_dc_settings_pack(const struct tools_open_infiniband_dc_settings *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_infiniband_dc_settings_pack(const struct tools_open_infiniband_dc_settings *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=27;
+	offset = 27;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 5, (u_int32_t)ptr_struct->log_dcr_hash_table_size);
 
-	offset=40;
+	offset = 40;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 24, (u_int32_t)ptr_struct->dcr_lifo_size);
 
 }
 
-void tools_open_infiniband_dc_settings_unpack(struct tools_open_infiniband_dc_settings *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_infiniband_dc_settings_unpack(struct tools_open_infiniband_dc_settings *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=27;
+	offset = 27;
 	ptr_struct->log_dcr_hash_table_size = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 5);
 
-	offset=40;
+	offset = 40;
 	ptr_struct->dcr_lifo_size = (u_int32_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 24);
 
 }
 
-void tools_open_infiniband_dc_settings_print(const struct tools_open_infiniband_dc_settings *ptr_struct, FILE* file, int indent_level){
+void tools_open_infiniband_dc_settings_print(const struct tools_open_infiniband_dc_settings *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_infiniband_dc_settings ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3536,65 +5103,69 @@ void tools_open_infiniband_dc_settings_print(const struct tools_open_infiniband_
 
 }
 
-int tools_open_infiniband_dc_settings_size(void){
+int tools_open_infiniband_dc_settings_size(void)
+{
 	 return 8;
 }
 
-void tools_open_infiniband_dc_settings_dump(const struct tools_open_infiniband_dc_settings *ptr_struct, FILE* file) {
+void tools_open_infiniband_dc_settings_dump(const struct tools_open_infiniband_dc_settings *ptr_struct, FILE* file)
+{
 	tools_open_infiniband_dc_settings_print(ptr_struct, file, 0);
 }
 
-void tools_open_infiniband_dc_capabilities_pack(const struct tools_open_infiniband_dc_capabilities *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_infiniband_dc_capabilities_pack(const struct tools_open_infiniband_dc_capabilities *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->min_log_dcr_hash_table_size);
 
-	offset=32;
+	offset = 32;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->max_log_dcr_hash_table_size);
 
-	offset=64;
+	offset = 64;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->min_dcr_lifo_size);
 
-	offset=96;
+	offset = 96;
 	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->max_dcr_lifo_size);
 
 }
 
-void tools_open_infiniband_dc_capabilities_unpack(struct tools_open_infiniband_dc_capabilities *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_infiniband_dc_capabilities_unpack(struct tools_open_infiniband_dc_capabilities *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=0;
+	offset = 0;
 	ptr_struct->min_log_dcr_hash_table_size = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	offset=32;
+	offset = 32;
 	ptr_struct->max_log_dcr_hash_table_size = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	offset=64;
+	offset = 64;
 	ptr_struct->min_dcr_lifo_size = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
-	offset=96;
+	offset = 96;
 	ptr_struct->max_dcr_lifo_size = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
 
 }
 
-void tools_open_infiniband_dc_capabilities_print(const struct tools_open_infiniband_dc_capabilities *ptr_struct, FILE* file, int indent_level){
+void tools_open_infiniband_dc_capabilities_print(const struct tools_open_infiniband_dc_capabilities *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_infiniband_dc_capabilities ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3612,83 +5183,87 @@ void tools_open_infiniband_dc_capabilities_print(const struct tools_open_infinib
 
 }
 
-int tools_open_infiniband_dc_capabilities_size(void){
+int tools_open_infiniband_dc_capabilities_size(void)
+{
 	 return 16;
 }
 
-void tools_open_infiniband_dc_capabilities_dump(const struct tools_open_infiniband_dc_capabilities *ptr_struct, FILE* file) {
+void tools_open_infiniband_dc_capabilities_dump(const struct tools_open_infiniband_dc_capabilities *ptr_struct, FILE* file)
+{
 	tools_open_infiniband_dc_capabilities_print(ptr_struct, file, 0);
 }
 
-void tools_open_wol_pack(const struct tools_open_wol *ptr_struct, u_int8_t* ptr_buff){
+void tools_open_wol_pack(const struct tools_open_wol *ptr_struct, u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=22;
+	offset = 22;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_psswd_magic);
 
-	offset=21;
+	offset = 21;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_magic);
 
-	offset=20;
+	offset = 20;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_arp);
 
-	offset=19;
+	offset = 19;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_bc);
 
-	offset=18;
+	offset = 18;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_mc);
 
-	offset=17;
+	offset = 17;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_uc);
 
-	offset=16;
+	offset = 16;
 	adb2c_push_bits_to_buff(ptr_buff, offset, 1, (u_int32_t)ptr_struct->en_wol_phy);
 
 }
 
-void tools_open_wol_unpack(struct tools_open_wol *ptr_struct, const u_int8_t* ptr_buff){
+void tools_open_wol_unpack(struct tools_open_wol *ptr_struct, const u_int8_t* ptr_buff)
+{
 	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
+	int i = 0;
 	(void)offset;
 	(void)i;
 	(void)ptr_struct;
 	(void)ptr_buff;
 
-	offset=22;
+	offset = 22;
 	ptr_struct->en_wol_psswd_magic = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=21;
+	offset = 21;
 	ptr_struct->en_wol_magic = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=20;
+	offset = 20;
 	ptr_struct->en_wol_arp = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=19;
+	offset = 19;
 	ptr_struct->en_wol_bc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=18;
+	offset = 18;
 	ptr_struct->en_wol_mc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=17;
+	offset = 17;
 	ptr_struct->en_wol_uc = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
-	offset=16;
+	offset = 16;
 	ptr_struct->en_wol_phy = (u_int8_t)adb2c_pop_bits_from_buff(ptr_buff, offset, 1);
 
 }
 
-void tools_open_wol_print(const struct tools_open_wol *ptr_struct, FILE* file, int indent_level){
+void tools_open_wol_print(const struct tools_open_wol *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_wol ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3715,14 +5290,96 @@ void tools_open_wol_print(const struct tools_open_wol *ptr_struct, FILE* file, i
 
 }
 
-int tools_open_wol_size(void){
+int tools_open_wol_size(void)
+{
 	 return 8;
 }
 
-void tools_open_wol_dump(const struct tools_open_wol *ptr_struct, FILE* file) {
+void tools_open_wol_dump(const struct tools_open_wol *ptr_struct, FILE* file)
+{
 	tools_open_wol_print(ptr_struct, file, 0);
 }
 
+void tools_open_misc_structs_pack(const union tools_open_misc_structs *ptr_struct, u_int8_t* ptr_buff)
+{
+	tools_open_mfg_info_pack(&(ptr_struct->mfg_info), ptr_buff);
+}
+
+void tools_open_misc_structs_unpack(union tools_open_misc_structs *ptr_struct, const u_int8_t* ptr_buff)
+{
+	tools_open_mfg_info_unpack(&(ptr_struct->mfg_info), ptr_buff);
+}
+
+void tools_open_misc_structs_print(const union tools_open_misc_structs *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_misc_structs ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "image_info:\n");
+	tools_open_image_info_print(&(ptr_struct->image_info), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "mfg_info:\n");
+	tools_open_mfg_info_print(&(ptr_struct->mfg_info), file, indent_level + 1);
+
+}
+
+int tools_open_misc_structs_size(void)
+{
+	 return 1024;
+}
+
+void tools_open_misc_structs_dump(const union tools_open_misc_structs *ptr_struct, FILE* file)
+{
+	tools_open_misc_structs_print(ptr_struct, file, 0);
+}
+
+void tools_open_aux_img_data_pack(const union tools_open_aux_img_data *ptr_struct, u_int8_t* ptr_buff)
+{
+	tools_open_aux_tlv_pack(&(ptr_struct->aux_tlv), ptr_buff);
+}
+
+void tools_open_aux_img_data_unpack(union tools_open_aux_img_data *ptr_struct, const u_int8_t* ptr_buff)
+{
+	tools_open_aux_tlv_unpack(&(ptr_struct->aux_tlv), ptr_buff);
+}
+
+void tools_open_aux_img_data_print(const union tools_open_aux_img_data *ptr_struct, FILE* file, int indent_level)
+{
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "======== tools_open_aux_img_data ========\n");
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
+	(void)file;
+	(void)indent_level;
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "aux_data_hdr:\n");
+	tools_open_aux_data_hdr_print(&(ptr_struct->aux_data_hdr), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "aux_tlv:\n");
+	tools_open_aux_tlv_print(&(ptr_struct->aux_tlv), file, indent_level + 1);
+
+}
+
+int tools_open_aux_img_data_size(void)
+{
+	 return 256;
+}
+
+void tools_open_aux_img_data_dump(const union tools_open_aux_img_data *ptr_struct, FILE* file)
+{
+	tools_open_aux_img_data_print(ptr_struct, file, 0);
+}
+
 void tools_open_hcr_cmds_pack(const union tools_open_hcr_cmds *ptr_struct, u_int8_t* ptr_buff)
 {
 	tools_open_query_def_params_per_port_pack(&(ptr_struct->query_def_params_per_port), ptr_buff);
@@ -3733,11 +5390,13 @@ void tools_open_hcr_cmds_unpack(union tools_open_hcr_cmds *ptr_struct, const u_i
 	tools_open_query_def_params_per_port_unpack(&(ptr_struct->query_def_params_per_port), ptr_buff);
 }
 
-void tools_open_hcr_cmds_print(const union tools_open_hcr_cmds *ptr_struct, FILE* file, int indent_level){
+void tools_open_hcr_cmds_print(const union tools_open_hcr_cmds *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_hcr_cmds ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3751,11 +5410,13 @@ void tools_open_hcr_cmds_print(const union tools_open_hcr_cmds *ptr_struct, FILE
 
 }
 
-int tools_open_hcr_cmds_size(void){
+int tools_open_hcr_cmds_size(void)
+{
 	 return 264;
 }
 
-void tools_open_hcr_cmds_dump(const union tools_open_hcr_cmds *ptr_struct, FILE* file) {
+void tools_open_hcr_cmds_dump(const union tools_open_hcr_cmds *ptr_struct, FILE* file)
+{
 	tools_open_hcr_cmds_print(ptr_struct, file, 0);
 }
 
@@ -3769,11 +5430,13 @@ void tools_open_access_registers_unpack(union tools_open_access_registers *ptr_s
 	tools_open_phy_reg_unpack(&(ptr_struct->PhyReg), ptr_buff);
 }
 
-void tools_open_access_registers_print(const union tools_open_access_registers *ptr_struct, FILE* file, int indent_level){
+void tools_open_access_registers_print(const union tools_open_access_registers *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_access_registers ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3787,29 +5450,33 @@ void tools_open_access_registers_print(const union tools_open_access_registers *
 
 }
 
-int tools_open_access_registers_size(void){
+int tools_open_access_registers_size(void)
+{
 	 return 512;
 }
 
-void tools_open_access_registers_dump(const union tools_open_access_registers *ptr_struct, FILE* file) {
+void tools_open_access_registers_dump(const union tools_open_access_registers *ptr_struct, FILE* file)
+{
 	tools_open_access_registers_print(ptr_struct, file, 0);
 }
 
 void tools_open_nv_cfg_pack(const union tools_open_nv_cfg *ptr_struct, u_int8_t* ptr_buff)
 {
-	tools_open_lldp_nb_capability_pack(&(ptr_struct->lldp_nb_capability), ptr_buff);
+	tools_open_lldp_nb_dcbx_pack(&(ptr_struct->lldp_nb_dcbx), ptr_buff);
 }
 
 void tools_open_nv_cfg_unpack(union tools_open_nv_cfg *ptr_struct, const u_int8_t* ptr_buff)
 {
-	tools_open_lldp_nb_capability_unpack(&(ptr_struct->lldp_nb_capability), ptr_buff);
+	tools_open_lldp_nb_dcbx_unpack(&(ptr_struct->lldp_nb_dcbx), ptr_buff);
 }
 
-void tools_open_nv_cfg_print(const union tools_open_nv_cfg *ptr_struct, FILE* file, int indent_level){
+void tools_open_nv_cfg_print(const union tools_open_nv_cfg *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_nv_cfg ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3894,34 +5561,66 @@ void tools_open_nv_cfg_print(const union tools_open_nv_cfg *ptr_struct, FILE* fi
 	tools_open_lldp_nb_print(&(ptr_struct->lldp_nb), file, indent_level + 1);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "lldp_nb_capability:\n");
-	tools_open_lldp_nb_capability_print(&(ptr_struct->lldp_nb_capability), file, indent_level + 1);
+	fprintf(file, "external_port:\n");
+	tools_open_external_port_print(&(ptr_struct->external_port), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "boot_settings_ext:\n");
+	tools_open_boot_settings_ext_print(&(ptr_struct->boot_settings_ext), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "option_rom_capability:\n");
+	tools_open_option_rom_capability_print(&(ptr_struct->option_rom_capability), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "qos:\n");
+	tools_open_qos_print(&(ptr_struct->qos), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "qos_cap:\n");
+	tools_open_qos_cap_print(&(ptr_struct->qos_cap), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "lldp_client_settings:\n");
+	tools_open_lldp_client_settings_print(&(ptr_struct->lldp_client_settings), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "lldp_nb_cap:\n");
+	tools_open_lldp_nb_cap_print(&(ptr_struct->lldp_nb_cap), file, indent_level + 1);
+
+	adb2c_add_indentation(file, indent_level);
+	fprintf(file, "lldp_nb_dcbx:\n");
+	tools_open_lldp_nb_dcbx_print(&(ptr_struct->lldp_nb_dcbx), file, indent_level + 1);
 
 }
 
-int tools_open_nv_cfg_size(void){
+int tools_open_nv_cfg_size(void)
+{
 	 return 256;
 }
 
-void tools_open_nv_cfg_dump(const union tools_open_nv_cfg *ptr_struct, FILE* file) {
+void tools_open_nv_cfg_dump(const union tools_open_nv_cfg *ptr_struct, FILE* file)
+{
 	tools_open_nv_cfg_print(ptr_struct, file, 0);
 }
 
 void tools_open_tools_open_pack(const union tools_open_tools_open *ptr_struct, u_int8_t* ptr_buff)
 {
-	tools_open_hcr_cmds_pack(&(ptr_struct->HcrCmds), ptr_buff);
+	tools_open_misc_structs_pack(&(ptr_struct->MiscStructs), ptr_buff);
 }
 
 void tools_open_tools_open_unpack(union tools_open_tools_open *ptr_struct, const u_int8_t* ptr_buff)
 {
-	tools_open_hcr_cmds_unpack(&(ptr_struct->HcrCmds), ptr_buff);
+	tools_open_misc_structs_unpack(&(ptr_struct->MiscStructs), ptr_buff);
 }
 
-void tools_open_tools_open_print(const union tools_open_tools_open *ptr_struct, FILE* file, int indent_level){
+void tools_open_tools_open_print(const union tools_open_tools_open *ptr_struct, FILE* file, int indent_level)
+{
 	adb2c_add_indentation(file, indent_level);
 	fprintf(file, "======== tools_open_tools_open ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
+	int i = 0;
+	(void)i;
+	(void)ptr_struct;
 	(void)file;
 	(void)indent_level;
 
@@ -3937,71 +5636,23 @@ void tools_open_tools_open_print(const union tools_open_tools_open *ptr_struct,
 	fprintf(file, "HcrCmds:\n");
 	tools_open_hcr_cmds_print(&(ptr_struct->HcrCmds), file, indent_level + 1);
 
-}
-
-int tools_open_tools_open_size(void){
-	 return 1048576;
-}
-
-void tools_open_tools_open_dump(const union tools_open_tools_open *ptr_struct, FILE* file) {
-	tools_open_tools_open_print(ptr_struct, file, 0);
-}
-
-void tools_open_uint64_pack(const struct tools_open_uint64 *ptr_struct, u_int8_t* ptr_buff){
-	u_int32_t offset;
-	int i=0;
-	(void)offset;
-	(void)i;
-	(void)ptr_struct;
-	(void)ptr_buff;
-
-	offset=0;
-	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->hi);
-
-	offset=32;
-	adb2c_push_integer_to_buff(ptr_buff, offset, 4, (u_int64_t)ptr_struct->lo);
-
-}
-
-void tools_open_uint64_unpack(struct tools_open_uint64 *ptr_struct, const u_int8_t* ptr_buff){
-	u_int32_t offset;
-	int i=0;
-	u_int8_t val=0;
-	(void)val;
-	(void)offset;
-	(void)i;
-	(void)ptr_struct;
-	(void)ptr_buff;
-
-	offset=0;
-	ptr_struct->hi = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
-
-	offset=32;
-	ptr_struct->lo = (u_int32_t)adb2c_pop_integer_from_buff(ptr_buff, offset, 4);
-
-}
-
-void tools_open_uint64_print(const struct tools_open_uint64 *ptr_struct, FILE* file, int indent_level){
-	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "======== tools_open_uint64 ========\n");
-	int i=0;
-	(void)i;(void)ptr_struct;
-	(void)file;
-	(void)indent_level;
-
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "hi                   : "U32H_FMT"\n", ptr_struct->hi);
+	fprintf(file, "AuxImgData:\n");
+	tools_open_aux_img_data_print(&(ptr_struct->AuxImgData), file, indent_level + 1);
 
 	adb2c_add_indentation(file, indent_level);
-	fprintf(file, "lo                   : "U32H_FMT"\n", ptr_struct->lo);
+	fprintf(file, "MiscStructs:\n");
+	tools_open_misc_structs_print(&(ptr_struct->MiscStructs), file, indent_level + 1);
 
 }
 
-int tools_open_uint64_size(void){
-	 return 8;
+int tools_open_tools_open_size(void)
+{
+	 return 1048576;
 }
 
-void tools_open_uint64_dump(const struct tools_open_uint64 *ptr_struct, FILE* file) {
-	tools_open_uint64_print(ptr_struct, file, 0);
+void tools_open_tools_open_dump(const union tools_open_tools_open *ptr_struct, FILE* file)
+{
+	tools_open_tools_open_print(ptr_struct, file, 0);
 }
 
diff --git a/tools_layouts/tools_open_layouts.h b/tools_layouts/tools_open_layouts.h
index 1d7afd7..318db63 100644
--- a/tools_layouts/tools_open_layouts.h
+++ b/tools_layouts/tools_open_layouts.h
@@ -31,7 +31,7 @@
  */
 
 /***
- *** This file was generated at "2015-08-31 18:48:47"
+ *** This file was generated at "2016-05-09 12:11:56"
  *** by:
  ***    > /mswg/release/eat_me/last_release/adabe_plugins/adb2c/adb2pack.py --input adb/tools_open/tools_open.adb --file-prefix tools_open --prefix tools_open_
  ***/
@@ -158,6 +158,47 @@ union tools_open_tlv_type {
 };
 
 /* Description -   */
+/* Size in bytes - 8 */
+struct tools_open_ts_entry {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - Timestamp day     - 2 packed BCD */
+	/* 0.0 - 0.7 */
+	 u_int8_t ts_day;
+	/* Description - Timestamp month   - 2 packed BCD */
+	/* 0.8 - 0.15 */
+	 u_int8_t ts_month;
+	/* Description - Timestamp year    - 4 packed BCD */
+	/* 0.16 - 4.31 */
+	 u_int16_t ts_year;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+	/* Description - Timestamp seconds - 2 packed BCD */
+	/* 4.8 - 4.15 */
+	 u_int8_t ts_seconds;
+	/* Description - Timestamp minotes - 2 packed BCD */
+	/* 4.16 - 4.23 */
+	 u_int8_t ts_minutes;
+	/* Description - Timestamp hour    - 2 packed BCD */
+	/* 4.24 - 8.31 */
+	 u_int8_t ts_hour;
+};
+
+/* Description -   */
+/* Size in bytes - 8 */
+struct tools_open_fw_version {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - fw_version_major */
+	/* 0.16 - 4.31 */
+	 u_int16_t fw_ver_major;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+	/* Description - fw version subminor */
+	/* 4.0 - 4.15 */
+	 u_int16_t fw_ver_subminor;
+	/* Description - fw_version_minor */
+	/* 4.16 - 8.31 */
+	 u_int16_t fw_ver_minor;
+};
+
+/* Description -   */
 /* Size in bytes - 4 */
 struct tools_open_pmdio_addr_data {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -185,6 +226,12 @@ struct tools_open_nv_hdr_fifth_gen {
 	/* Description - Configuration item version */
 	/* 0.12 - 0.15 */
 	 u_int8_t version;
+	/* Description - when set, the default field is supported. */
+	/* 0.22 - 0.22 */
+	 u_int8_t default_supported;
+	/* Description - when set in query , will display the default configuration */
+	/* 0.23 - 0.23 */
+	 u_int8_t default_;
 	/* Description - enables reading the TLV by lower priorities
 0 - TLV can be read by the subsequent lifecycle priorities.
 1 - TLV cannot be read by the subsequent lifecycle priorities.
@@ -198,9 +245,6 @@ struct tools_open_nv_hdr_fifth_gen {
  */
 	/* 0.25 - 0.25 */
 	 u_int8_t over_en;
-	/* Description - when set in query , will display the default configuration */
-	/* 0.28 - 0.28 */
-	 u_int8_t default_;
 /*---------------- DWORD[1] (Offset 0x4) ----------------*/
 	/* Description -  */
 	/* 4.0 - 8.31 */
@@ -208,6 +252,19 @@ struct tools_open_nv_hdr_fifth_gen {
 };
 
 /* Description -   */
+/* Size in bytes - 16 */
+struct tools_open_timestamp {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - fw_version */
+	/* 0.0 - 8.31 */
+	 struct tools_open_fw_version fw_version;
+/*---------------- DWORD[2] (Offset 0x8) ----------------*/
+	/* Description - Timestamp */
+	/* 8.0 - 16.31 */
+	 struct tools_open_ts_entry ts_entry;
+};
+
+/* Description -   */
 /* Size in bytes - 8 */
 struct tools_open_nv_hdr {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -233,6 +290,40 @@ struct tools_open_nv_hdr {
 };
 
 /* Description -   */
+/* Size in bytes - 20 */
+struct tools_open_aux_tlv_header {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 0.7 */
+	 u_int8_t minor_version;
+	/* Description -  */
+	/* 0.8 - 0.15 */
+	 u_int8_t major_version;
+	/* Description -  */
+	/* 0.16 - 0.23 */
+	 u_int8_t type;
+	/* Description -  */
+	/* 0.28 - 4.31 */
+	 u_int8_t header_type;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+	/* Description -  */
+	/* 4.0 - 8.31 */
+	 u_int32_t length;
+/*---------------- DWORD[2] (Offset 0x8) ----------------*/
+	/* Description -  */
+	/* 8.0 - 8.15 */
+	 u_int16_t crc;
+/*---------------- DWORD[3] (Offset 0xc) ----------------*/
+	/* Description -  */
+	/* 12.0 - 16.31 */
+	 u_int32_t reserved0;
+/*---------------- DWORD[4] (Offset 0x10) ----------------*/
+	/* Description -  */
+	/* 16.0 - 20.31 */
+	 u_int32_t reserved1;
+};
+
+/* Description -   */
 /* Size in bytes - 264 */
 struct tools_open_pmdio {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -321,6 +412,51 @@ Used for external Phy FW burning. When set, the MDIO I/F is used for an external
 };
 
 /* Description -   */
+/* Size in bytes - 156 */
+struct tools_open_mnvgn {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - Pointer to the NV parameter */
+	/* 0.0 - 4.31 */
+	 u_int32_t nv_pointer;
+/*---------------- DWORD[4] (Offset 0x10) ----------------*/
+	/* Description -  */
+	/* 16.0 - 28.31 */
+	 struct tools_open_nv_hdr_fifth_gen nv_hdr;
+/*---------------- DWORD[7] (Offset 0x1c) ----------------*/
+	/* Description -  */
+	/* 28.24 - 156.23 */
+	 u_int8_t nv_data[128];
+};
+
+/* Description -   */
+/* Size in bytes - 20 */
+struct tools_open_mvts {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - A SET operation with this flag set will only check if the new timestamp can be configured without upda ting NVRAM */
+	/* 0.29 - 0.29 */
+	 u_int8_t check_timestamp_flag;
+	/* Description - A GET operation with this flag set, will return the running FW version instead */
+	/* 0.30 - 0.30 */
+	 u_int8_t running_flag;
+	/* Description - A SET operation with this flag on will clear the running and other bank timestamps */
+	/* 0.31 - 4.31 */
+	 u_int8_t clear_all_ts_flag;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+	/* Description - Timestamp entry */
+	/* 4.0 - 20.31 */
+	 struct tools_open_timestamp timestamp;
+};
+
+/* Description -   */
+/* Size in bytes - 16 */
+struct tools_open_nvqgc {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - NVDA read factory settings. 0: Unsupported. 1: Supported. */
+	/* 0.0 - 0.0 */
+	 u_int8_t read_factory_settings_support;
+};
+
+/* Description -   */
 /* Size in bytes - 12 */
 struct tools_open_nvdi {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -409,6 +545,89 @@ struct tools_open_mnva {
 };
 
 /* Description -   */
+/* Size in bytes - 320 */
+struct tools_open_mfg_info {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.24 - 16.23 */
+	 char psid[17];
+/*---------------- DWORD[7] (Offset 0x1c) ----------------*/
+	/* Description - MFG_INFO section minor version */
+	/* 28.16 - 28.23 */
+	 u_int8_t minor_version;
+	/* Description - MFG_INFO section major version */
+	/* 28.24 - 32.31 */
+	 u_int8_t major_version;
+/*---------------- DWORD[24] (Offset 0x60) ----------------*/
+	/* Description - original PRS used to generate the FW binary */
+	/* 96.24 - 192.23 */
+	 char orig_prs_name[97];
+};
+
+/* Description -   */
+/* Size in bytes - 1024 */
+struct tools_open_image_info {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - IMAGE_INFO section minor version */
+	/* 0.16 - 0.23 */
+	 u_int8_t minor_version;
+	/* Description - IMAGE_INFO section major version */
+	/* 0.24 - 4.31 */
+	 u_int8_t major_version;
+/*---------------- DWORD[9] (Offset 0x24) ----------------*/
+	/* Description -  */
+	/* 36.24 - 52.23 */
+	 char psid[17];
+/*---------------- DWORD[116] (Offset 0x1d0) ----------------*/
+	/* Description - Product description */
+	/* 464.24 - 720.23 */
+	 char description[257];
+/*---------------- DWORD[208] (Offset 0x340) ----------------*/
+	/* Description - Product name */
+	/* 832.24 - 896.23 */
+	 char name[65];
+/*---------------- DWORD[224] (Offset 0x380) ----------------*/
+	/* Description - PRS used to generate the FW binary */
+	/* 896.24 - 992.23 */
+	 char prs_name[97];
+};
+
+/* Description -   */
+/* Size in bytes - 256 */
+struct tools_open_aux_tlv {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 20.31 */
+	 struct tools_open_aux_tlv_header aux_tlv_header;
+/*---------------- DWORD[5] (Offset 0x14) ----------------*/
+	/* Description - tlv data */
+	/* 20.24 - 148.23 */
+	 u_int8_t data[128];
+};
+
+/* Description -   */
+/* Size in bytes - 16 */
+struct tools_open_aux_data_hdr {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - 0x544c563a : ascii for "TLV:"
+ */
+	/* 0.0 - 4.31 */
+	 u_int32_t signature0;
+/*---------------- DWORD[1] (Offset 0x4) ----------------*/
+	/* Description - 0x6548bc86 */
+	/* 4.0 - 8.31 */
+	 u_int32_t signature1;
+/*---------------- DWORD[2] (Offset 0x8) ----------------*/
+	/* Description - 0x01020305 */
+	/* 8.0 - 12.31 */
+	 u_int32_t signature2;
+/*---------------- DWORD[3] (Offset 0xc) ----------------*/
+	/* Description - 0x080d1522 */
+	/* 12.0 - 16.31 */
+	 u_int32_t signature3;
+};
+
+/* Description -   */
 /* Size in bytes - 28 */
 struct tools_open_query_def_params_per_port {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -453,6 +672,9 @@ struct tools_open_query_def_params_per_port {
 	/* Description -  */
 	/* 8.0 - 8.15 */
 	 u_int16_t default_boot_pkey;
+	/* Description -  */
+	/* 8.24 - 8.25 */
+	 u_int8_t boot_ip_ver;
 	/* Description - Legacy option ROM supports NV config setting 0x2023. */
 	/* 8.27 - 8.27 */
 	 u_int8_t nv_config_infiniband_dhcp_settings;
@@ -522,6 +744,9 @@ struct tools_open_query_def_params_global {
 	/* Description - maximum value allowed for the uar bar size (log2 base) */
 	/* 4.12 - 4.15 */
 	 u_int8_t max_uar_bar_size;
+	/* Description -  */
+	/* 4.21 - 4.21 */
+	 u_int8_t boot_ip_ver;
 	/* Description - default value of sriov (enabled or disabled) */
 	/* 4.31 - 8.31 */
 	 u_int8_t sriov_en;
@@ -564,30 +789,114 @@ union tools_open_mnv_cfg {
 	/* Description -  */
 	/* 0.0 - 12.31 */
 	 struct tools_open_nvdi nvdi;
+	/* Description -  */
+	/* 0.0 - 16.31 */
+	 struct tools_open_nvqgc nvqgc;
+	/* Description -  */
+	/* 0.0 - 20.31 */
+	 struct tools_open_mvts mvts;
+	/* Description -  */
+	/* 0.0 - 156.31 */
+	 struct tools_open_mnvgn mnvgn;
 };
 
 /* Description -   */
-/* Size in bytes - 24 */
-struct tools_open_lldp_nb_capability {
+/* Size in bytes - 4 */
+struct tools_open_lldp_nb_dcbx {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
-	/* Description - Indicate if LLDP-NB is supported by this firmware
-Default: Enabled
- */
+	/* Description -  */
+	/* 0.0 - 0.0 */
+	 u_int8_t ieee_dcbx_en;
+	/* Description -  */
+	/* 0.1 - 0.1 */
+	 u_int8_t cee_dcbx_en;
+	/* Description -  */
+	/* 0.2 - 0.2 */
+	 u_int8_t dcbx_willing;
+};
+
+/* Description -   */
+/* Size in bytes - 12 */
+struct tools_open_lldp_nb_cap {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.27 - 0.27 */
+	 u_int8_t lldp_nb_dcbx_en;
+	/* Description -  */
+	/* 0.28 - 0.29 */
+	 u_int8_t lldp_nb_rx_cap;
+	/* Description -  */
+	/* 0.30 - 4.31 */
+	 u_int8_t lldp_nb_tx_cap;
+};
+
+/* Description -   */
+/* Size in bytes - 12 */
+struct tools_open_lldp_client_settings {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.27 - 0.27 */
+	 u_int8_t lldp_nb_dcbx;
+	/* Description -  */
+	/* 0.28 - 0.29 */
+	 u_int8_t lldp_nb_rx_mode;
+	/* Description -  */
+	/* 0.30 - 4.31 */
+	 u_int8_t lldp_nb_tx_mode;
+};
+
+/* Description -   */
+/* Size in bytes - 12 */
+struct tools_open_qos_cap {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 0.3 */
+	 u_int8_t max_num_of_vl;
+	/* Description -  */
+	/* 0.4 - 0.7 */
+	 u_int8_t max_num_of_tc;
+};
+
+/* Description -   */
+/* Size in bytes - 12 */
+struct tools_open_qos {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 0.3 */
+	 u_int8_t num_of_vl;
+	/* Description -  */
+	/* 0.4 - 0.7 */
+	 u_int8_t num_of_tc;
+};
+
+/* Description -   */
+/* Size in bytes - 4 */
+struct tools_open_option_rom_capability {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - flexboot supports configuration of PXE boot IP version defined in boot settings ext parameter */
 	/* 0.31 - 4.31 */
-	 u_int8_t lldp_nb_supported;
-/*---------------- DWORD[1] (Offset 0x4) ----------------*/
-	/* Description - The overall (scratchpad) memory size for holding LLDP-TLVs. The memory is first filled with TLVs that the LLDP need to send (TX) the rest of the area is used for incoming TLVs
+	 u_int8_t ip_ver;
+};
 
-Default: 3000 octets 
- */
-	/* 4.0 - 4.15 */
-	 u_int16_t max_total_lldp_tlv_len;
-/*---------------- DWORD[2] (Offset 0x8) ----------------*/
-	/* Description - A bitmask saying which of the LLDP-TLV the client is capable of sending
-TBD: we think that this is redundant
- */
-	/* 8.24 - 24.23 */
-	 u_int8_t supported_lldp_tx_tlv_mask[16];
+/* Description -   */
+/* Size in bytes - 4 */
+struct tools_open_boot_settings_ext {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - Select which IP protocol version will be used by flexboot */
+	/* 0.8 - 0.9 */
+	 u_int8_t ip_ver;
+};
+
+/* Description -   */
+/* Size in bytes - 8 */
+struct tools_open_external_port {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 0.0 */
+	 u_int8_t port_owner;
+	/* Description -  */
+	/* 0.1 - 0.1 */
+	 u_int8_t allow_rd_counters;
 };
 
 /* Description -   */
@@ -728,16 +1037,16 @@ Default: 0
 	/* 60.0 - 60.16 */
 	 u_int32_t min_time_between_cnps;
 /*---------------- DWORD[16] (Offset 0x40) ----------------*/
-	/* Description - The DiffServ Code Point of the generated CNP for this port
-Default: 0
- */
-	/* 64.0 - 64.2 */
-	 u_int8_t cnp_dscp;
 	/* Description - The 802.1p priority value of the generated CNP for this port
 Default: 7
  */
-	/* 64.8 - 64.13 */
+	/* 64.0 - 64.2 */
 	 u_int8_t cnp_802p_prio;
+	/* Description - The DiffServ Code Point of the generated CNP for this port
+Default: 0
+ */
+	/* 64.8 - 64.13 */
+	 u_int8_t cnp_dscp;
 };
 
 /* Description -   */
@@ -967,13 +1276,24 @@ struct tools_open_iscsi_settings {
 /* Size in bytes - 4 */
 struct tools_open_port_boot_state {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
-	/* Description - 0 Normal operation
-1 SFP power off
-2 SERDES power off
-3 admin linkDown
- */
-	/* 0.0 - 0.1 */
-	 u_int8_t port_boot_state;
+	/* Description - The number of the GPIO that is connected to the AUX power setting circuitry */
+	/* 0.0 - 0.7 */
+	 u_int8_t aux_power_indication_gpio;
+	/* Description - 0  not present
+ 1 present
+ if the NIC has a circuitry that can indicate when the device is working on AUX power. */
+	/* 0.29 - 0.29 */
+	 u_int8_t aux_power_indication_gpio_en;
+	/* Description - 0  disabled
+ 1 enabled
+ When enabled, the device will response to standby indication from PCI or GPIO (if configured) and reduce power consumption while keeping the SMBUS on. To meet the power requirement, the NIC will disable the network ports and cage power on standby mode (indicate with PCIe L2/L3 message sequence of with the GPIO */
+	/* 0.30 - 0.30 */
+	 u_int8_t standby_on_aux;
+	/* Description - 0 Normal (admin-on)
+ 1 low power
+ When set to low-power the device will boot with minimal power until the GPIO detects that the PCIe power rails are active. The low power mode is effective ONLY when there is a circuitry to detect AUX power condition (with GPIO indication) */
+	/* 0.31 - 4.31 */
+	 u_int8_t power_up_on_aux;
 };
 
 /* Description -   */
@@ -1023,12 +1343,12 @@ struct tools_open_pci_configuration {
 	/* 4.31 - 8.31 */
 	 u_int8_t sriov_en;
 /*---------------- DWORD[2] (Offset 0x8) ----------------*/
-	/* Description - Log 2 of the size of a VF's UAR BAR */
-	/* 8.0 - 8.5 */
-	 u_int8_t log_vf_uar_bar_size;
 	/* Description - Log 2 of the size of a PF's UAR BAR */
-	/* 8.6 - 8.11 */
+	/* 8.0 - 8.5 */
 	 u_int8_t log_pf_uar_bar_size;
+	/* Description - Log 2 of the size of a VF's UAR BAR */
+	/* 8.6 - 8.11 */
+	 u_int8_t log_vf_uar_bar_size;
 	/* Description - Number of MSI-X vectors and EQs per PF */
 	/* 8.12 - 8.21 */
 	 u_int16_t num_pf_msix;
@@ -1056,9 +1376,9 @@ struct tools_open_pci_capabilities {
 	/* Description - 1 when the num_pfs field is configurable and max_num_pfs is valid */
 	/* 0.28 - 0.28 */
 	 u_int8_t num_pfs_supported;
-	/* Description - 1 when the log_max_total_bar field is valid */
+	/* Description - 1 when the max_total_bar field is valid */
 	/* 0.29 - 0.29 */
-	 u_int8_t log_max_total_bar_valid;
+	 u_int8_t max_total_bar_valid;
 	/* Description - 1 when the total_msix field is valid */
 	/* 0.30 - 0.30 */
 	 u_int8_t max_total_msix_valid;
@@ -1099,9 +1419,9 @@ struct tools_open_pci_capabilities {
 	/* 12.0 - 16.31 */
 	 u_int32_t max_total_msix;
 /*---------------- DWORD[4] (Offset 0x10) ----------------*/
-	/* Description - Log 2 of the maximum total of the MMIO space for all PFs and VFs combined */
+	/* Description - Maximum total of the MMIO space for all PFs and VFs combined, in megabytes. */
 	/* 16.0 - 20.31 */
-	 u_int32_t log_max_total_bar;
+	 u_int32_t max_total_bar;
 };
 
 /* Description -   */
@@ -1190,6 +1510,30 @@ struct tools_open_wol {
 };
 
 /* Description -   */
+/* Size in bytes - 1024 */
+union tools_open_misc_structs {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description -  */
+	/* 0.0 - 1024.31 */
+	 struct tools_open_image_info image_info;
+	/* Description -  */
+	/* 0.0 - 320.31 */
+	 struct tools_open_mfg_info mfg_info;
+};
+
+/* Description -   */
+/* Size in bytes - 256 */
+union tools_open_aux_img_data {
+/*---------------- DWORD[0] (Offset 0x0) ----------------*/
+	/* Description - image aux data section header */
+	/* 0.0 - 16.31 */
+	 struct tools_open_aux_data_hdr aux_data_hdr;
+	/* Description - image tlv entry */
+	/* 0.0 - 256.31 */
+	 struct tools_open_aux_tlv aux_tlv;
+};
+
+/* Description -   */
 /* Size in bytes - 264 */
 union tools_open_hcr_cmds {
 /*---------------- DWORD[0] (Offset 0x0) ----------------*/
@@ -1278,8 +1622,29 @@ union tools_open_nv_cfg {
 	/* 0.0 - 28.31 */
 	 struct tools_open_lldp_nb lldp_nb;
 	/* Description -  */
-	/* 0.0 - 24.31 */
-	 struct tools_open_lldp_nb_capability lldp_nb_capability;
+	/* 0.0 - 8.31 */
+	 struct tools_open_external_port external_port;
+	/* Description -  */
+	/* 0.0 - 4.31 */
+	 struct tools_open_boot_settings_ext boot_settings_ext;
+	/* Description -  */
+	/* 0.0 - 4.31 */
+	 struct tools_open_option_rom_capability option_rom_capability;
+	/* Description -  */
+	/* 0.0 - 12.31 */
+	 struct tools_open_qos qos;
+	/* Description -  */
+	/* 0.0 - 12.31 */
+	 struct tools_open_qos_cap qos_cap;
+	/* Description -  */
+	/* 0.0 - 12.31 */
+	 struct tools_open_lldp_client_settings lldp_client_settings;
+	/* Description -  */
+	/* 0.0 - 12.31 */
+	 struct tools_open_lldp_nb_cap lldp_nb_cap;
+	/* Description -  */
+	/* 0.0 - 4.31 */
+	 struct tools_open_lldp_nb_dcbx lldp_nb_dcbx;
 };
 
 /* Description -   */
@@ -1295,19 +1660,12 @@ union tools_open_tools_open {
 	/* Description - Tools HCR commands structs */
 	/* 0.0 - 264.31 */
 	 union tools_open_hcr_cmds HcrCmds;
-};
-
-/* Description -   */
-/* Size in bytes - 8 */
-struct tools_open_uint64 {
-/*---------------- DWORD[0] (Offset 0x0) ----------------*/
-	/* Description -  */
-	/* 0.0 - 4.31 */
-	 u_int32_t hi;
-/*---------------- DWORD[1] (Offset 0x4) ----------------*/
-	/* Description -  */
-	/* 4.0 - 8.31 */
-	 u_int32_t lo;
+	/* Description - aux image data layout */
+	/* 0.0 - 256.31 */
+	 union tools_open_aux_img_data AuxImgData;
+	/* Description - Misc structs needed for integration on new FW features */
+	/* 0.0 - 1024.31 */
+	 union tools_open_misc_structs MiscStructs;
 };
 
 
@@ -1361,6 +1719,20 @@ void tools_open_tlv_type_print(const union tools_open_tlv_type *ptr_struct, FILE
 int tools_open_tlv_type_size(void);
 #define TOOLS_OPEN_TLV_TYPE_SIZE    (0x4)
 void tools_open_tlv_type_dump(const union tools_open_tlv_type *ptr_struct, FILE* file);
+/* ts_entry */
+void tools_open_ts_entry_pack(const struct tools_open_ts_entry *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_ts_entry_unpack(struct tools_open_ts_entry *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_ts_entry_print(const struct tools_open_ts_entry *ptr_struct, FILE* file, int indent_level);
+int tools_open_ts_entry_size(void);
+#define TOOLS_OPEN_TS_ENTRY_SIZE    (0x8)
+void tools_open_ts_entry_dump(const struct tools_open_ts_entry *ptr_struct, FILE* file);
+/* fw_version */
+void tools_open_fw_version_pack(const struct tools_open_fw_version *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_fw_version_unpack(struct tools_open_fw_version *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_fw_version_print(const struct tools_open_fw_version *ptr_struct, FILE* file, int indent_level);
+int tools_open_fw_version_size(void);
+#define TOOLS_OPEN_FW_VERSION_SIZE    (0x8)
+void tools_open_fw_version_dump(const struct tools_open_fw_version *ptr_struct, FILE* file);
 /* pmdio_addr_data */
 void tools_open_pmdio_addr_data_pack(const struct tools_open_pmdio_addr_data *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_pmdio_addr_data_unpack(struct tools_open_pmdio_addr_data *ptr_struct, const u_int8_t* ptr_buff);
@@ -1375,6 +1747,13 @@ void tools_open_nv_hdr_fifth_gen_print(const struct tools_open_nv_hdr_fifth_gen
 int tools_open_nv_hdr_fifth_gen_size(void);
 #define TOOLS_OPEN_NV_HDR_FIFTH_GEN_SIZE    (0xc)
 void tools_open_nv_hdr_fifth_gen_dump(const struct tools_open_nv_hdr_fifth_gen *ptr_struct, FILE* file);
+/* timestamp */
+void tools_open_timestamp_pack(const struct tools_open_timestamp *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_timestamp_unpack(struct tools_open_timestamp *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_timestamp_print(const struct tools_open_timestamp *ptr_struct, FILE* file, int indent_level);
+int tools_open_timestamp_size(void);
+#define TOOLS_OPEN_TIMESTAMP_SIZE    (0x10)
+void tools_open_timestamp_dump(const struct tools_open_timestamp *ptr_struct, FILE* file);
 /* nv_hdr */
 void tools_open_nv_hdr_pack(const struct tools_open_nv_hdr *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_nv_hdr_unpack(struct tools_open_nv_hdr *ptr_struct, const u_int8_t* ptr_buff);
@@ -1382,6 +1761,13 @@ void tools_open_nv_hdr_print(const struct tools_open_nv_hdr *ptr_struct, FILE* f
 int tools_open_nv_hdr_size(void);
 #define TOOLS_OPEN_NV_HDR_SIZE    (0x8)
 void tools_open_nv_hdr_dump(const struct tools_open_nv_hdr *ptr_struct, FILE* file);
+/* aux_tlv_header */
+void tools_open_aux_tlv_header_pack(const struct tools_open_aux_tlv_header *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_aux_tlv_header_unpack(struct tools_open_aux_tlv_header *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_aux_tlv_header_print(const struct tools_open_aux_tlv_header *ptr_struct, FILE* file, int indent_level);
+int tools_open_aux_tlv_header_size(void);
+#define TOOLS_OPEN_AUX_TLV_HEADER_SIZE    (0x14)
+void tools_open_aux_tlv_header_dump(const struct tools_open_aux_tlv_header *ptr_struct, FILE* file);
 /* pmdio */
 void tools_open_pmdio_pack(const struct tools_open_pmdio *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_pmdio_unpack(struct tools_open_pmdio *ptr_struct, const u_int8_t* ptr_buff);
@@ -1396,6 +1782,27 @@ void tools_open_pmdic_print(const struct tools_open_pmdic *ptr_struct, FILE* fil
 int tools_open_pmdic_size(void);
 #define TOOLS_OPEN_PMDIC_SIZE    (0xc)
 void tools_open_pmdic_dump(const struct tools_open_pmdic *ptr_struct, FILE* file);
+/* mnvgn */
+void tools_open_mnvgn_pack(const struct tools_open_mnvgn *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_mnvgn_unpack(struct tools_open_mnvgn *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_mnvgn_print(const struct tools_open_mnvgn *ptr_struct, FILE* file, int indent_level);
+int tools_open_mnvgn_size(void);
+#define TOOLS_OPEN_MNVGN_SIZE    (0x9c)
+void tools_open_mnvgn_dump(const struct tools_open_mnvgn *ptr_struct, FILE* file);
+/* mvts */
+void tools_open_mvts_pack(const struct tools_open_mvts *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_mvts_unpack(struct tools_open_mvts *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_mvts_print(const struct tools_open_mvts *ptr_struct, FILE* file, int indent_level);
+int tools_open_mvts_size(void);
+#define TOOLS_OPEN_MVTS_SIZE    (0x14)
+void tools_open_mvts_dump(const struct tools_open_mvts *ptr_struct, FILE* file);
+/* nvqgc */
+void tools_open_nvqgc_pack(const struct tools_open_nvqgc *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_nvqgc_unpack(struct tools_open_nvqgc *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_nvqgc_print(const struct tools_open_nvqgc *ptr_struct, FILE* file, int indent_level);
+int tools_open_nvqgc_size(void);
+#define TOOLS_OPEN_NVQGC_SIZE    (0x10)
+void tools_open_nvqgc_dump(const struct tools_open_nvqgc *ptr_struct, FILE* file);
 /* nvdi */
 void tools_open_nvdi_pack(const struct tools_open_nvdi *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_nvdi_unpack(struct tools_open_nvdi *ptr_struct, const u_int8_t* ptr_buff);
@@ -1445,6 +1852,34 @@ void tools_open_mnva_print(const struct tools_open_mnva *ptr_struct, FILE* file,
 int tools_open_mnva_size(void);
 #define TOOLS_OPEN_MNVA_SIZE    (0x100)
 void tools_open_mnva_dump(const struct tools_open_mnva *ptr_struct, FILE* file);
+/* mfg_info */
+void tools_open_mfg_info_pack(const struct tools_open_mfg_info *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_mfg_info_unpack(struct tools_open_mfg_info *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_mfg_info_print(const struct tools_open_mfg_info *ptr_struct, FILE* file, int indent_level);
+int tools_open_mfg_info_size(void);
+#define TOOLS_OPEN_MFG_INFO_SIZE    (0x140)
+void tools_open_mfg_info_dump(const struct tools_open_mfg_info *ptr_struct, FILE* file);
+/* image_info */
+void tools_open_image_info_pack(const struct tools_open_image_info *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_image_info_unpack(struct tools_open_image_info *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_image_info_print(const struct tools_open_image_info *ptr_struct, FILE* file, int indent_level);
+int tools_open_image_info_size(void);
+#define TOOLS_OPEN_IMAGE_INFO_SIZE    (0x400)
+void tools_open_image_info_dump(const struct tools_open_image_info *ptr_struct, FILE* file);
+/* aux_tlv */
+void tools_open_aux_tlv_pack(const struct tools_open_aux_tlv *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_aux_tlv_unpack(struct tools_open_aux_tlv *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_aux_tlv_print(const struct tools_open_aux_tlv *ptr_struct, FILE* file, int indent_level);
+int tools_open_aux_tlv_size(void);
+#define TOOLS_OPEN_AUX_TLV_SIZE    (0x100)
+void tools_open_aux_tlv_dump(const struct tools_open_aux_tlv *ptr_struct, FILE* file);
+/* aux_data_hdr */
+void tools_open_aux_data_hdr_pack(const struct tools_open_aux_data_hdr *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_aux_data_hdr_unpack(struct tools_open_aux_data_hdr *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_aux_data_hdr_print(const struct tools_open_aux_data_hdr *ptr_struct, FILE* file, int indent_level);
+int tools_open_aux_data_hdr_size(void);
+#define TOOLS_OPEN_AUX_DATA_HDR_SIZE    (0x10)
+void tools_open_aux_data_hdr_dump(const struct tools_open_aux_data_hdr *ptr_struct, FILE* file);
 /* query_def_params_per_port */
 void tools_open_query_def_params_per_port_pack(const struct tools_open_query_def_params_per_port *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_query_def_params_per_port_unpack(struct tools_open_query_def_params_per_port *ptr_struct, const u_int8_t* ptr_buff);
@@ -1473,13 +1908,62 @@ void tools_open_mnv_cfg_print(const union tools_open_mnv_cfg *ptr_struct, FILE*
 int tools_open_mnv_cfg_size(void);
 #define TOOLS_OPEN_MNV_CFG_SIZE    (0x100)
 void tools_open_mnv_cfg_dump(const union tools_open_mnv_cfg *ptr_struct, FILE* file);
-/* lldp_nb_capability */
-void tools_open_lldp_nb_capability_pack(const struct tools_open_lldp_nb_capability *ptr_struct, u_int8_t* ptr_buff);
-void tools_open_lldp_nb_capability_unpack(struct tools_open_lldp_nb_capability *ptr_struct, const u_int8_t* ptr_buff);
-void tools_open_lldp_nb_capability_print(const struct tools_open_lldp_nb_capability *ptr_struct, FILE* file, int indent_level);
-int tools_open_lldp_nb_capability_size(void);
-#define TOOLS_OPEN_LLDP_NB_CAPABILITY_SIZE    (0x18)
-void tools_open_lldp_nb_capability_dump(const struct tools_open_lldp_nb_capability *ptr_struct, FILE* file);
+/* lldp_nb_dcbx */
+void tools_open_lldp_nb_dcbx_pack(const struct tools_open_lldp_nb_dcbx *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_lldp_nb_dcbx_unpack(struct tools_open_lldp_nb_dcbx *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_lldp_nb_dcbx_print(const struct tools_open_lldp_nb_dcbx *ptr_struct, FILE* file, int indent_level);
+int tools_open_lldp_nb_dcbx_size(void);
+#define TOOLS_OPEN_LLDP_NB_DCBX_SIZE    (0x4)
+void tools_open_lldp_nb_dcbx_dump(const struct tools_open_lldp_nb_dcbx *ptr_struct, FILE* file);
+/* lldp_nb_cap */
+void tools_open_lldp_nb_cap_pack(const struct tools_open_lldp_nb_cap *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_lldp_nb_cap_unpack(struct tools_open_lldp_nb_cap *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_lldp_nb_cap_print(const struct tools_open_lldp_nb_cap *ptr_struct, FILE* file, int indent_level);
+int tools_open_lldp_nb_cap_size(void);
+#define TOOLS_OPEN_LLDP_NB_CAP_SIZE    (0xc)
+void tools_open_lldp_nb_cap_dump(const struct tools_open_lldp_nb_cap *ptr_struct, FILE* file);
+/* lldp_client_settings */
+void tools_open_lldp_client_settings_pack(const struct tools_open_lldp_client_settings *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_lldp_client_settings_unpack(struct tools_open_lldp_client_settings *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_lldp_client_settings_print(const struct tools_open_lldp_client_settings *ptr_struct, FILE* file, int indent_level);
+int tools_open_lldp_client_settings_size(void);
+#define TOOLS_OPEN_LLDP_CLIENT_SETTINGS_SIZE    (0xc)
+void tools_open_lldp_client_settings_dump(const struct tools_open_lldp_client_settings *ptr_struct, FILE* file);
+/* qos_cap */
+void tools_open_qos_cap_pack(const struct tools_open_qos_cap *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_qos_cap_unpack(struct tools_open_qos_cap *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_qos_cap_print(const struct tools_open_qos_cap *ptr_struct, FILE* file, int indent_level);
+int tools_open_qos_cap_size(void);
+#define TOOLS_OPEN_QOS_CAP_SIZE    (0xc)
+void tools_open_qos_cap_dump(const struct tools_open_qos_cap *ptr_struct, FILE* file);
+/* qos */
+void tools_open_qos_pack(const struct tools_open_qos *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_qos_unpack(struct tools_open_qos *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_qos_print(const struct tools_open_qos *ptr_struct, FILE* file, int indent_level);
+int tools_open_qos_size(void);
+#define TOOLS_OPEN_QOS_SIZE    (0xc)
+void tools_open_qos_dump(const struct tools_open_qos *ptr_struct, FILE* file);
+/* option_rom_capability */
+void tools_open_option_rom_capability_pack(const struct tools_open_option_rom_capability *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_option_rom_capability_unpack(struct tools_open_option_rom_capability *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_option_rom_capability_print(const struct tools_open_option_rom_capability *ptr_struct, FILE* file, int indent_level);
+int tools_open_option_rom_capability_size(void);
+#define TOOLS_OPEN_OPTION_ROM_CAPABILITY_SIZE    (0x4)
+void tools_open_option_rom_capability_dump(const struct tools_open_option_rom_capability *ptr_struct, FILE* file);
+/* boot_settings_ext */
+void tools_open_boot_settings_ext_pack(const struct tools_open_boot_settings_ext *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_boot_settings_ext_unpack(struct tools_open_boot_settings_ext *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_boot_settings_ext_print(const struct tools_open_boot_settings_ext *ptr_struct, FILE* file, int indent_level);
+int tools_open_boot_settings_ext_size(void);
+#define TOOLS_OPEN_BOOT_SETTINGS_EXT_SIZE    (0x4)
+void tools_open_boot_settings_ext_dump(const struct tools_open_boot_settings_ext *ptr_struct, FILE* file);
+/* external_port */
+void tools_open_external_port_pack(const struct tools_open_external_port *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_external_port_unpack(struct tools_open_external_port *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_external_port_print(const struct tools_open_external_port *ptr_struct, FILE* file, int indent_level);
+int tools_open_external_port_size(void);
+#define TOOLS_OPEN_EXTERNAL_PORT_SIZE    (0x8)
+void tools_open_external_port_dump(const struct tools_open_external_port *ptr_struct, FILE* file);
 /* lldp_nb */
 void tools_open_lldp_nb_pack(const struct tools_open_lldp_nb *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_lldp_nb_unpack(struct tools_open_lldp_nb *ptr_struct, const u_int8_t* ptr_buff);
@@ -1620,6 +2104,20 @@ void tools_open_wol_print(const struct tools_open_wol *ptr_struct, FILE* file, i
 int tools_open_wol_size(void);
 #define TOOLS_OPEN_WOL_SIZE    (0x8)
 void tools_open_wol_dump(const struct tools_open_wol *ptr_struct, FILE* file);
+/* misc_structs */
+void tools_open_misc_structs_pack(const union tools_open_misc_structs *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_misc_structs_unpack(union tools_open_misc_structs *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_misc_structs_print(const union tools_open_misc_structs *ptr_struct, FILE* file, int indent_level);
+int tools_open_misc_structs_size(void);
+#define TOOLS_OPEN_MISC_STRUCTS_SIZE    (0x400)
+void tools_open_misc_structs_dump(const union tools_open_misc_structs *ptr_struct, FILE* file);
+/* aux_img_data */
+void tools_open_aux_img_data_pack(const union tools_open_aux_img_data *ptr_struct, u_int8_t* ptr_buff);
+void tools_open_aux_img_data_unpack(union tools_open_aux_img_data *ptr_struct, const u_int8_t* ptr_buff);
+void tools_open_aux_img_data_print(const union tools_open_aux_img_data *ptr_struct, FILE* file, int indent_level);
+int tools_open_aux_img_data_size(void);
+#define TOOLS_OPEN_AUX_IMG_DATA_SIZE    (0x100)
+void tools_open_aux_img_data_dump(const union tools_open_aux_img_data *ptr_struct, FILE* file);
 /* hcr_cmds */
 void tools_open_hcr_cmds_pack(const union tools_open_hcr_cmds *ptr_struct, u_int8_t* ptr_buff);
 void tools_open_hcr_cmds_unpack(union tools_open_hcr_cmds *ptr_struct, const u_int8_t* ptr_buff);
@@ -1648,13 +2146,6 @@ void tools_open_tools_open_print(const union tools_open_tools_open *ptr_struct,
 int tools_open_tools_open_size(void);
 #define TOOLS_OPEN_TOOLS_OPEN_SIZE    (0x100000)
 void tools_open_tools_open_dump(const union tools_open_tools_open *ptr_struct, FILE* file);
-/* uint64 */
-void tools_open_uint64_pack(const struct tools_open_uint64 *ptr_struct, u_int8_t* ptr_buff);
-void tools_open_uint64_unpack(struct tools_open_uint64 *ptr_struct, const u_int8_t* ptr_buff);
-void tools_open_uint64_print(const struct tools_open_uint64 *ptr_struct, FILE* file, int indent_level);
-int tools_open_uint64_size(void);
-#define TOOLS_OPEN_UINT64_SIZE    (0x8)
-void tools_open_uint64_dump(const struct tools_open_uint64 *ptr_struct, FILE* file);
 
 
 #ifdef __cplusplus
diff --git a/tools_res_mgmt/Makefile.am b/tools_res_mgmt/Makefile.am
index e155ed4..4b513f4 100644
--- a/tools_res_mgmt/Makefile.am
+++ b/tools_res_mgmt/Makefile.am
@@ -33,10 +33,14 @@
 
 USER_DIR = $(top_srcdir)
 MTCR_DIR = $(USER_DIR)/include/mtcr_ul
-INCLUDES = -I. -I../common -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
+AM_CPPFLAGS = -I. -I../common -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
 
 AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) 
 noinst_LIBRARIES = libtools_res_mgmt.a
 
-libtools_res_mgmt_a_SOURCES = tools_res_mgmt.c
+libtools_res_mgmt_a_SOURCES = tools_res_mgmt.c tools_time.c
 
+if ENABLE_INBAND
+else
+AM_CFLAGS += -DNO_INBAND
+endif
diff --git a/tools_res_mgmt/Makefile.in b/tools_res_mgmt/Makefile.in
index 6c95c54..9e1947c 100644
--- a/tools_res_mgmt/Makefile.in
+++ b/tools_res_mgmt/Makefile.in
@@ -111,6 +111,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+ at ENABLE_INBAND_FALSE@am__append_1 = -DNO_INBAND
 subdir = tools_res_mgmt
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/config/depcomp
@@ -130,7 +131,8 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 libtools_res_mgmt_a_AR = $(AR) $(ARFLAGS)
 libtools_res_mgmt_a_LIBADD =
-am_libtools_res_mgmt_a_OBJECTS = tools_res_mgmt.$(OBJEXT)
+am_libtools_res_mgmt_a_OBJECTS = tools_res_mgmt.$(OBJEXT) \
+	tools_time.$(OBJEXT)
 libtools_res_mgmt_a_OBJECTS = $(am_libtools_res_mgmt_a_OBJECTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -264,6 +266,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+TOOLS_CRYPTO = @TOOLS_CRYPTO@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -320,10 +323,11 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 USER_DIR = $(top_srcdir)
 MTCR_DIR = $(USER_DIR)/include/mtcr_ul
-INCLUDES = -I. -I../common -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
-AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) 
+AM_CPPFLAGS = -I. -I../common -I$(MTCR_DIR) -I.. -I$(USER_DIR)/mtcr_ul
+AM_CFLAGS = -W -Wall -Werror -g -MP -MD $(COMPILER_FPIC) \
+	$(am__append_1)
 noinst_LIBRARIES = libtools_res_mgmt.a
-libtools_res_mgmt_a_SOURCES = tools_res_mgmt.c
+libtools_res_mgmt_a_SOURCES = tools_res_mgmt.c tools_time.c
 all: all-am
 
 .SUFFIXES:
@@ -374,6 +378,7 @@ distclean-compile:
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_res_mgmt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tools_time.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/tools_res_mgmt/tools_res_mgmt.c b/tools_res_mgmt/tools_res_mgmt.c
index 08ee072..94ee40a 100644
--- a/tools_res_mgmt/tools_res_mgmt.c
+++ b/tools_res_mgmt/tools_res_mgmt.c
@@ -31,18 +31,25 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include <common/tools_utils.h>
 #include <common/bit_slice.h>
 #include <common/compatibility.h>
 #include <dev_mgt/tools_dev_types.h>
-#include "tools_res_mgmt.h"
+
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+#include <mtcr_ib_res_mgt.h>
+#endif
 
 #ifdef __WIN__
 #include <process.h>
 #define getpid() _getpid()
 #endif
 
+#include "tools_res_mgmt.h"
+#include "tools_time.h"
+
 #define VSEC_SEM_NUM 10
 #define HW_SEM_NUM VSEC_SEM_NUM
 
@@ -90,7 +97,8 @@ static const char* status_to_str[] =
         "Tools resource management interface not available",
         "Device not supported",
         "Resource not supported",
-        "CR-Space access error"
+        "CR-Space access error",
+        "Memory allocation failed"
 };
 
 struct device_sem_info
@@ -106,11 +114,6 @@ static u_int32_t g_vsec_sem_addr[VSEC_SEM_NUM] = {0x0, 0x10};
 
 static struct device_sem_info g_dev_sem_info_db[] = {
         {
-                DeviceConnectX,             // dev_id
-                {0xf03bc},                  // hw_sem_addr
-                0,                          // vsec_sem_supported
-        },
-        {
                 DeviceConnectX2,            // dev_id
                 {0xf03bc},                  // hw_sem_addr
                 0,                          // vsec_sem_supported
@@ -160,6 +163,31 @@ static struct device_sem_info g_dev_sem_info_db[] = {
                 {0xe250c},       // hw_sem_addr
                 1,               // vsec_sem_supported
         },
+        {
+                DeviceSwitchIB2,  // dev_id
+                {0xa24f8},       // hw_sem_addr
+                0,               // vsec_sem_supported
+        },
+        {
+                DeviceConnectX5, // dev_id
+                {0xe250c},       // hw_sem_addr
+                1,               // vsec_sem_supported
+        },
+};
+
+#define MAX_SEMAPHORE_ADDRES 8
+
+struct mad_lock_info {
+    u_int32_t lock_key;
+    u_int32_t lease_time_ms;
+    tt_ctx_t  start_time;
+};
+
+struct trm_t {
+        mfile* mf;
+        const struct device_sem_info* dev_sem_info;
+        struct mad_lock_info mad_lock[MAX_SEMAPHORE_ADDRES];
+        int ib_semaphore_lock_is_supported;
 };
 
 /************************************
@@ -232,6 +260,107 @@ static trm_sts unlock_vsec_semaphore(mfile* mf, u_int32_t addr)
     return TRM_STS_OK;
 }
 
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+/************************************
+ * Function: release_vs_mad_semaphore()
+ ************************************/
+#define GET_LEASE_TIME_MS(is_leaseable, lease_time_exp) ((is_leaseable) ? (50 * (1 << (lease_time_exp))) : 0)
+
+static trm_sts release_vs_mad_semaphore(trm_ctx trm, trm_resourse resource)
+{
+    u_int32_t lock_key;
+    u_int8_t new_lease_exponent;
+    int is_leaseable = 0;
+
+    int rc = TRM_STS_OK;
+    if (!trm->mad_lock[resource].lock_key) {
+        return TRM_STS_OK;
+    }
+    if (trm->ib_semaphore_lock_is_supported == 0) {
+        return TRM_STS_RES_NOT_SUPPORTED;
+    }
+    rc = mib_semaphore_lock_vs_mad(trm->mf, SMP_SEM_RELEASE, g_vsec_sem_addr[resource],
+                                   trm->mad_lock[resource].lock_key, &lock_key, &is_leaseable, &new_lease_exponent, SEM_LOCK_SET);
+    if (rc == ME_MAD_BUSY) {
+        return TRM_STS_RES_BUSY;
+    } else if (rc) {
+        return TRM_STS_RES_NOT_SUPPORTED;
+    } else if (lock_key != 0) {
+        return TRM_STS_CR_ACCESS_ERR;
+    }
+    trm->mad_lock[resource].lock_key = 0;
+    trm->mad_lock[resource].lease_time_ms = 0;
+    return TRM_STS_OK;
+}
+
+/************************************
+ * Function: lock_vs_mad_semaphore()
+ ************************************/
+
+
+static trm_sts lock_vs_mad_semaphore(trm_ctx trm, trm_resourse resource, unsigned int max_retries)
+{
+    u_int32_t new_lock_key;
+    u_int8_t new_lease_exponent;
+    int is_leaseable = 0;
+    tt_ctx_t curr_time;
+    int rc = TRM_STS_OK;
+    unsigned int cnt = 0;
+
+    if (trm->ib_semaphore_lock_is_supported == 0) {
+        return TRM_STS_RES_NOT_SUPPORTED;
+    }
+
+    // check if we got lock_key
+    if (trm->mad_lock[resource].lock_key) {
+        // TODO: use threads to extend lock every ~20 seconds untill releasing the lock
+        // check if extension is needed
+        if (trm->mad_lock[resource].lease_time_ms == 0) {
+            // no need to extend lease is untill device reboot
+            return TRM_STS_OK;
+        }
+
+        tt_get_time(&curr_time);
+        double diff = tt_diff_in_ms(trm->mad_lock[resource].start_time, curr_time);
+        if ( diff <= trm->mad_lock[resource].lease_time_ms * 0.6) {
+            return TRM_STS_OK;
+        }
+        // extension needed try to extend
+        rc = mib_semaphore_lock_vs_mad(trm->mf, SMP_SEM_EXTEND, g_vsec_sem_addr[resource],
+                trm->mad_lock[resource].lock_key, &new_lock_key, &is_leaseable, &new_lease_exponent, SEM_LOCK_SET);
+        if (rc == ME_OK && new_lock_key == trm->mad_lock[resource].lock_key) {
+            // extend OK
+            trm->mad_lock[resource].lease_time_ms = GET_LEASE_TIME_MS(is_leaseable, new_lease_exponent);
+            trm->mad_lock[resource].start_time = curr_time;
+            return TRM_STS_OK;
+        } else {
+            // extend failed try to re-lock the semaphore
+            trm->mad_lock[resource].lock_key = 0;
+            trm->mad_lock[resource].lease_time_ms = 0;
+            new_lock_key = 0;
+        }
+    }
+    // if not or extend failed try to lock
+    do {
+        if (cnt++ > max_retries) {
+            return TRM_STS_RES_BUSY;
+        }
+        rc = mib_semaphore_lock_vs_mad(trm->mf, SMP_SEM_LOCK, g_vsec_sem_addr[resource],
+                                       0, &new_lock_key, &is_leaseable, &new_lease_exponent, SEM_LOCK_SET);
+        if (rc == ME_MAD_BUSY || new_lock_key == 0) {
+            msleep(((rand() % 5) + 1));
+        }
+    } while (rc == ME_MAD_BUSY || new_lock_key == 0) ;
+
+    if (rc) {
+        return TRM_STS_RES_NOT_SUPPORTED;
+    }
+    trm->mad_lock[resource].lock_key = new_lock_key;
+    trm->mad_lock[resource].lease_time_ms = GET_LEASE_TIME_MS(is_leaseable, new_lease_exponent);
+    tt_get_time(&(trm->mad_lock[resource].start_time));
+    return TRM_STS_OK;
+}
+#endif
 /************************************
  * Function: get_device_sem_info
  ************************************/
@@ -248,48 +377,97 @@ static struct device_sem_info* get_device_sem_info(dm_dev_id_t dev_id)
 }
 
 /************************************
- * Function: trm_lock
+ * Function: trm_create
  ************************************/
-trm_sts trm_lock(mfile* mf, trm_resourse res, unsigned int max_retries)
+trm_sts trm_create(trm_ctx* trm_p, mfile* mf)
 {
-    dm_dev_id_t dev_id;
+    dm_dev_id_t dev_id = DeviceStartMarker;
     u_int32_t hw_dev_id;
     u_int32_t chip_rev;
-    struct device_sem_info* dev_sem_info;
 
-    if (dm_get_device_id(mf, &dev_id, &hw_dev_id, &chip_rev)) {
-        return TRM_STS_CR_ACCESS_ERR;
+    *trm_p = (trm_ctx) malloc (sizeof(struct trm_t));
+    if (! (*trm_p)) {
+        return TRM_STS_MEM_ERROR;
+    }
+    memset((*trm_p), 0, sizeof(struct trm_t));
+    (*trm_p)->mf = mf;
+
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+    u_int32_t dev_flags = 0;
+    if (!mget_mdevs_flags(mf, &dev_flags)) {
+        if ((dev_flags & MDEVS_IB) && mib_semaphore_lock_is_supported(mf) == 1) {
+            (*trm_p)->ib_semaphore_lock_is_supported = 1;
+        }
+    }
+#endif
+
+    if (dm_get_device_id((*trm_p)->mf, &dev_id, &hw_dev_id, &chip_rev)) {
+        free(*trm_p);
+        *trm_p = (trm_ctx)NULL;
+        return dev_id == DeviceUnknown ? TRM_STS_DEV_NOT_SUPPORTED : TRM_STS_CR_ACCESS_ERR;
     }
 
-    dev_sem_info = get_device_sem_info(dev_id);
+    (*trm_p)->dev_sem_info = get_device_sem_info(dev_id);
 
     // Not supported device
-    if (!dev_sem_info) {
+    if (!((*trm_p)->dev_sem_info)) {
+        free(*trm_p);
+        *trm_p = (trm_ctx)NULL;
         return TRM_STS_DEV_NOT_SUPPORTED;
     }
 
+    return TRM_STS_OK;
+}
+
+/************************************
+ * Function: trm_destroy
+ ************************************/
+trm_sts trm_destroy(trm_ctx trm)
+{
+    if (trm) {
+        free(trm);
+    }
+    return TRM_STS_OK;
+}
+
+/************************************
+ * Function: trm_lock
+ ************************************/
+trm_sts trm_lock(trm_ctx trm, trm_resourse res, unsigned int max_retries)
+{
+    u_int32_t dev_type = 0;
+    mget_mdevs_flags(trm->mf, &dev_type);
+
     // lock resource on appropriate ifc if supported
     switch ((int)res) {
     case TRM_RES_ICMD:
-        if (dev_sem_info->vsec_sem_supported && mget_vsec_supp(mf)) {
-            return lock_vsec_semaphore(mf, g_vsec_sem_addr[TRM_RES_ICMD], max_retries);
-        } else if (dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return lock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK], max_retries);
+        if (trm->dev_sem_info->vsec_sem_supported && mget_vsec_supp(trm->mf)) {
+            return lock_vsec_semaphore(trm->mf, g_vsec_sem_addr[TRM_RES_ICMD], max_retries);
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+        } else if (trm->dev_sem_info->vsec_sem_supported && (dev_type & MDEVS_IB)) {
+            return lock_vs_mad_semaphore(trm, TRM_RES_ICMD, max_retries);
+#endif
+        } else if (trm->dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]) { // lock hw semaphore
+            return lock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK], max_retries);
         }
         break;
     case TRM_RES_FLASH_PROGRAMING:
-        if (dev_sem_info->vsec_sem_supported && mget_vsec_supp(mf)) {
-            return lock_vsec_semaphore(mf, g_vsec_sem_addr[TRM_RES_FLASH_PROGRAMING], max_retries);
+        if (trm->dev_sem_info->vsec_sem_supported && mget_vsec_supp(trm->mf)) {
+            return lock_vsec_semaphore(trm->mf, g_vsec_sem_addr[TRM_RES_FLASH_PROGRAMING], max_retries);
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+        } else if (trm->dev_sem_info->vsec_sem_supported && (dev_type & MDEVS_IB)) {
+            return lock_vs_mad_semaphore(trm, TRM_RES_FLASH_PROGRAMING, max_retries);
+#endif
         }
         break;
     case TRM_RES_HCR_FLASH_PROGRAMING:
-        if (dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return lock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK], max_retries);
+        if (trm->dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]){ // lock hw semaphore
+            return lock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK], max_retries);
         }
         break;
     case TRM_RES_HW_TRACER:
-        if (dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return lock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK], max_retries);
+        if (trm->dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]){ // lock hw semaphore
+            return lock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK], max_retries);
         }
     break;
     default:
@@ -301,54 +479,49 @@ trm_sts trm_lock(mfile* mf, trm_resourse res, unsigned int max_retries)
 /************************************
  * Function: trm_try_lock
  ************************************/
-trm_sts trm_try_lock(mfile* mf, trm_resourse res)
+trm_sts trm_try_lock(trm_ctx trm, trm_resourse res)
 {
-    return trm_lock(mf, res, 1);
+    return trm_lock(trm, res, 1);
 }
 
 /************************************
  * Function: trm_unlock
  ************************************/
-trm_sts trm_unlock(mfile* mf, trm_resourse res)
+trm_sts trm_unlock(trm_ctx trm, trm_resourse res)
 {
-    dm_dev_id_t dev_id;
-    u_int32_t hw_dev_id;
-    u_int32_t chip_rev;
-    struct device_sem_info* dev_sem_info;
-
-    if (dm_get_device_id(mf, &dev_id, &hw_dev_id, &chip_rev)) {
-        return TRM_STS_CR_ACCESS_ERR;
-    }
-
-    dev_sem_info = get_device_sem_info(dev_id);
-
-    // Not supported device
-    if (!dev_sem_info) {
-        return TRM_STS_DEV_NOT_SUPPORTED;
-    }
+    u_int32_t dev_type = 0;
+    mget_mdevs_flags(trm->mf, &dev_type);
 
     // lock resource on appropriate ifc if supported
     switch ((int)res) {
     case TRM_RES_ICMD:
-        if (dev_sem_info->vsec_sem_supported && mget_vsec_supp(mf)) {
-            return unlock_vsec_semaphore(mf, g_vsec_sem_addr[TRM_RES_ICMD]);
-        } else if (dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return unlock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]);
+        if (trm->dev_sem_info->vsec_sem_supported && mget_vsec_supp(trm->mf)) {
+            return unlock_vsec_semaphore(trm->mf, g_vsec_sem_addr[TRM_RES_ICMD]);
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+        } else if (trm->dev_sem_info->vsec_sem_supported && (dev_type & MDEVS_IB)) {
+            return release_vs_mad_semaphore(trm, TRM_RES_ICMD);
+#endif
+        } else if (trm->dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]){ // lock hw semaphore
+            return unlock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_MAIN_SEM & HW_SEM_ADDR_MASK]);
         }
         break;
     case TRM_RES_FLASH_PROGRAMING:
-        if (dev_sem_info->vsec_sem_supported && mget_vsec_supp(mf)) {
-                   return unlock_vsec_semaphore(mf, g_vsec_sem_addr[TRM_RES_FLASH_PROGRAMING]);
+        if (trm->dev_sem_info->vsec_sem_supported && mget_vsec_supp(trm->mf)) {
+                   return unlock_vsec_semaphore(trm->mf, g_vsec_sem_addr[TRM_RES_FLASH_PROGRAMING]);
+#if !defined(__FreeBSD__) && !defined(UEFI_BUILD)
+        } else if (trm->dev_sem_info->vsec_sem_supported && (dev_type & MDEVS_IB)) {
+            return release_vs_mad_semaphore(trm, TRM_RES_FLASH_PROGRAMING);
+#endif
         }
         break;
     case TRM_RES_HCR_FLASH_PROGRAMING:
-        if (dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return unlock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]);
+        if (trm->dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]){ // lock hw semaphore
+            return unlock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_HCR_FLASH_PROGRAMING & HW_SEM_ADDR_MASK]);
         }
         break;
     case TRM_RES_HW_TRACER:
-        if (dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]){ // lock hw semaphore
-            return unlock_hw_semaphore(mf, dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]);
+        if (trm->dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]){ // lock hw semaphore
+            return unlock_hw_semaphore(trm->mf, trm->dev_sem_info->hw_sem_addr[TRM_RES_HW_TRACER & HW_SEM_ADDR_MASK]);
         }
     break;
     default:
diff --git a/tools_res_mgmt/tools_res_mgmt.h b/tools_res_mgmt/tools_res_mgmt.h
index caed2b7..e4335cd 100644
--- a/tools_res_mgmt/tools_res_mgmt.h
+++ b/tools_res_mgmt/tools_res_mgmt.h
@@ -44,7 +44,8 @@ typedef enum {
     TRM_STS_IFC_NA,
     TRM_STS_DEV_NOT_SUPPORTED,
     TRM_STS_RES_NOT_SUPPORTED,
-    TRM_STS_CR_ACCESS_ERR
+    TRM_STS_CR_ACCESS_ERR,
+    TRM_STS_MEM_ERROR
 } trm_sts;
 
 typedef enum {
@@ -59,6 +60,25 @@ typedef enum {
     TRM_RES_ALL                  = 0xffff,
 } trm_resourse;
 
+typedef struct trm_t* trm_ctx;
+
+
+/*
+ * Create tools resource context
+ * trm_p: trm_ctx pointer to be allocated
+ * Parameter (mf)  - an opened mst device handler
+ * Return TOOLS_STS_OK on success of creating the context, otherwise any other error code.
+ */
+trm_sts trm_create(trm_ctx* trm_p, mfile* mf);
+
+
+/*
+ * Destroy the context
+ * trm: trm_ctx to be destroyed
+ * Return TOOLS_STS_OK on success of destroying the context, otherwise any other error code.
+ */
+trm_sts trm_destroy(trm_ctx trm);
+
 /*
  * Lock tools resource
  * Parameter (mf)  - an opened mst device handler
@@ -66,7 +86,7 @@ typedef enum {
  * Parameter (max_retry) - max retry count before declaring resource busy.
  * Return TOOLS_STS_OK on success of locking all the desired resources, otherwise any other error code.
  */
-trm_sts trm_lock(mfile* mf, trm_resourse res, unsigned int max_retry);
+trm_sts trm_lock(trm_ctx trm, trm_resourse res, unsigned int max_retry);
 
 /*
  * Try to lock tools resource (returns immediately if resource busy)
@@ -74,7 +94,7 @@ trm_sts trm_lock(mfile* mf, trm_resourse res, unsigned int max_retry);
  * Parameter (res) - resource to acquire.
  * Return TOOLS_STS_OK on success of locking all the desired resources, otherwise any other error code.
  */
-trm_sts trm_try_lock(mfile* mf, trm_resourse res);
+trm_sts trm_try_lock(trm_ctx trm, trm_resourse res);
 
 /*
  * Unlock tools resource
@@ -82,7 +102,7 @@ trm_sts trm_try_lock(mfile* mf, trm_resourse res);
  * Parameter (res) - resource to release.
  * Return TOOLS_STS_OK if all given resources were unlocked successfully.
  */
-trm_sts trm_unlock(mfile* mf, trm_resourse res);
+trm_sts trm_unlock(trm_ctx trm, trm_resourse res);
 
 /*
  * Translate tools_sem_mgmt_sts status code to a human readable string.
diff --git a/mflash/mflash_access_layer.h b/tools_res_mgmt/tools_time.c
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to tools_res_mgmt/tools_time.c
index 23931fa..2b68d8b
--- a/mflash/mflash_access_layer.h
+++ b/tools_res_mgmt/tools_time.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,29 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "tools_time.h"
+
 
-#include <compatibility.h>
-//#include "cib_cif.h"
 
-#include "mflash_common_structs.h"
+void tt_get_time(tt_ctx_t* tt)
+{
+    if (!tt) {
+        return;
+    }
+    time(&(tt->now));
+    return;
+}
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+double tt_diff_in_ms(tt_ctx_t t1, tt_ctx_t t2)
+{
+    return difftime(t2.now, t1.now) * 1000;
+}
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
 
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
diff --git a/mflash/mflash_access_layer.h b/tools_res_mgmt/tools_time.h
old mode 100755
new mode 100644
similarity index 63%
copy from mflash/mflash_access_layer.h
copy to tools_res_mgmt/tools_time.h
index 23931fa..1cbcaf7
--- a/mflash/mflash_access_layer.h
+++ b/tools_res_mgmt/tools_time.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Mellanox Technologies Ltd.  All rights reserved.
+/*
+ * Copyright (C) Jan 2013 Mellanox Technologies Ltd. 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
@@ -27,27 +28,23 @@
  * 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.
- *
- *  Version: $Id$
- *
  */
 
-#ifndef MFLASH_ACCESS_LAYER_H_
-#define MFLASH_ACCESS_LAYER_H_
-
-#include <compatibility.h>
-//#include "cib_cif.h"
-
-#include "mflash_common_structs.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-#define BOOT_CR_SPACE_ADDR 0xf0000
+#include <time.h>
 
-int sx_get_flash_info_by_type(mflash* mfl, unsigned *type_index, int *log2size, u_int8_t *no_flash);
-int sx_block_read_by_type(mflash* mfl, u_int32_t blk_addr, u_int32_t blk_size, u_int8_t* data);
-int sx_block_write_by_type(mflash* mfl, u_int32_t addr, u_int32_t size, u_int8_t* data);
-int sx_flash_lock_by_type(mflash* mfl, int lock_state);
-int sx_erase_sect_by_type(mflash* mfl, u_int32_t addr);
-int mf_update_boot_addr_by_type(mflash* mfl, u_int32_t boot_addr);
+typedef struct tt_ctx {
+    time_t now;
+} tt_ctx_t;
 
+// update context with the current time
+void tt_get_time(tt_ctx_t* tt);
+// get diff in ms between the time t1 was created and t2
+double tt_diff_in_ms(tt_ctx_t t1, tt_ctx_t t2);
 
-#endif /* MFLASH_ACCESS_LAYER_H_ */
+#ifdef __cplusplus
+}
+#endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/mstflint.git



More information about the Pkg-ofed-commits mailing list