Skip to content

Commit 8895952

Browse files
Merge branch 'master_devel'
Signed-off-by: Adham Masarwah <[email protected]>
2 parents db6c302 + 485e479 commit 8895952

File tree

184 files changed

+36616
-4824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+36616
-4824
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# SOFTWARE.
3131
#--
3232

33-
SUBDIRS = common mft_utils ext_libs $(TOOLS_CRYPTO) tools_layouts mtcr_ul mtcr_py $(MAD_IFC) reg_access cmdif dev_mgt tools_res_mgmt mflash fw_comps_mgr mlxconfig mlxfwops cmdparser flint small_utils mstdump
33+
SUBDIRS = common mft_utils ext_libs $(TOOLS_CRYPTO) tools_layouts mtcr_ul mtcr_py $(MAD_IFC) reg_access cmdif dev_mgt tools_res_mgmt mvpd mflash fw_comps_mgr mlxconfig mlxfwops cmdparser $(MLXFWUPDATE) flint small_utils mstdump
3434

3535
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
3636

autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test -d config || mkdir config
66
sh gitversion.sh ./common/gitversion.h
77

88
set -x
9-
aclocal -I config
9+
aclocal -I config -I m4
1010
libtoolize --force --copy
1111
autoheader
1212
automake --foreign --add-missing --copy

cmdif/cmdif.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11

2-
#--
3-
# - Mellanox Confidential and Proprietary -
2+
# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
3+
#
4+
# This software is available to you under a choice of one of two
5+
# licenses. You may choose to be licensed under the terms of the GNU
6+
# General Public License (GPL) Version 2, available from the file
7+
# COPYING in the main directory of this source tree, or the
8+
# OpenIB.org BSD license below:
9+
#
10+
# Redistribution and use in source and binary forms, with or
11+
# without modification, are permitted provided that the following
12+
# conditions are met:
13+
#
14+
# - Redistributions of source code must retain the above
15+
# copyright notice, this list of conditions and the following
16+
# disclaimer.
417
#
5-
# Copyright (C) Jan 2013, Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
18+
# - Redistributions in binary form must reproduce the above
19+
# copyright notice, this list of conditions and the following
20+
# disclaimer in the documentation and/or other materials
21+
# provided with the distribution.
622
#
7-
# Except as specifically permitted herein, no portion of the information,
8-
# including but not limited to object code and source code, may be reproduced,
9-
# modified, distributed, republished or otherwise exploited in any form or by
10-
# any means for any purpose without the prior written permission of Mellanox
11-
# Technologies Ltd. Use of software subject to the terms and conditions
12-
# detailed in the file "LICENSE.txt".
23+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27+
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28+
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
# SOFTWARE.
1331
#--
1432

1533
import os

cmdif/icmd_cif_macros.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,21 @@ int convert_rc(int rc);
5656
#define SEND_ICMD_FLOW_GENERIC(mf, op, struct_name, cmd_struct, should_pack, skip_write, pack_func, unpack_func)\
5757
int _rc;\
5858
int _cmd_size = struct_name##_size();\
59-
u_int8_t _data[_cmd_size];\
60-
memset(_data, 0, _cmd_size);\
59+
u_int8_t *_data = (u_int8_t *)malloc(sizeof(u_int8_t) * _cmd_size);\
60+
if (!_data) {\
61+
return GCIF_STATUS_NO_MEM;\
62+
}\
63+
memset(_data, 0, sizeof(u_int8_t) * _cmd_size);\
6164
if (should_pack) {\
6265
pack_func(cmd_struct, _data);\
6366
}\
6467
_rc = icmd_send_command(mf, op, _data, _cmd_size, skip_write);\
6568
if (_rc) {\
69+
free(_data);\
6670
return convert_rc(_rc);\
6771
}\
6872
unpack_func(cmd_struct, _data);\
73+
free(_data);\
6974
return GCIF_STATUS_SUCCESS
7075

7176
#define SEND_ICMD_FLOW(mf, op, struct_name, cmd_struct, should_pack, skip_write)\
@@ -74,16 +79,21 @@ int convert_rc(int rc);
7479
#define SEND_UNION_ICMD_FLOW(mf, op, struct_name, cmd_struct, should_pack, skip_write)\
7580
int _rc;\
7681
int _cmd_size = struct_name##_size();\
77-
u_int8_t _data[_cmd_size];\
78-
memset(_data, 0, _cmd_size);\
82+
u_int8_t *_data = (u_int8_t *)malloc(sizeof(u_int8_t) * _cmd_size);\
83+
if (!_data) {\
84+
return GCIF_STATUS_NO_MEM;\
85+
}\
86+
memset(_data, 0, sizeof(u_int8_t) * _cmd_size);\
7987
if (should_pack) {\
8088
struct_name##_in_pack(&(cmd_struct->in), _data);\
8189
}\
8290
_rc = icmd_send_command(mf, op, _data, _cmd_size, skip_write);\
8391
if (_rc) {\
92+
free(_data);\
8493
return convert_rc(_rc);\
8594
}\
8695
struct_name##_unpack(cmd_struct, _data);\
96+
free(_data);\
8797
return GCIF_STATUS_SUCCESS
8898

8999

cmdif/tools_cif.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#define QPC_WRITE_OP 0x69
5151

5252
#define CHECK_RC(rc) \
53-
if (rc) return rc;
53+
if (rc) return (MError)rc;
5454

5555
#define BE32_TO_CPU(s, n) do { \
5656
u_int32_t i; \
@@ -122,7 +122,7 @@ MError tcif_qpc_context_write(mfile* dev, u_int32_t qpn, u_int32_t source, u_int
122122

123123
MError tcif_hw_access(mfile* dev, u_int64_t key, int lock_unlock)
124124
{
125-
return tools_cmdif_send_inline_cmd(dev, key, NULL, 0, HW_ACCESS_OP, lock_unlock);
125+
return (MError)tools_cmdif_send_inline_cmd(dev, key, NULL, 0, HW_ACCESS_OP, lock_unlock);
126126
}
127127
const char* tcif_err2str(MError rc) {
128128
return m_err2str(rc);
@@ -135,7 +135,7 @@ MError tcif_cr_mbox_supported(mfile* dev)
135135
(void)dev;
136136
return ME_NOT_IMPLEMENTED;
137137
#else
138-
return tools_cmdif_is_cr_mbox_supported(dev);
138+
return (MError)tools_cmdif_is_cr_mbox_supported(dev);
139139
#endif
140140

141141
}

configure.ac

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
dnl Process this file with autoconf to produce a configure script.
22

3-
AC_INIT(mstflint, 4.7.0, [email protected])
3+
AC_INIT(mstflint, 4.8.0, [email protected])
44

55
AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.])
66
AC_SUBST([PROJECT])
77

8-
AC_DEFINE_UNQUOTED([VERSION], ["4.7.0"], [Define the project version.])
8+
AC_DEFINE_UNQUOTED([VERSION], ["4.8.0"], [Define the project version.])
99
AC_SUBST([VERSION])
1010

1111
AC_CONFIG_AUX_DIR(config)
@@ -23,6 +23,7 @@ dnl Checks for headers
2323
AC_CHECK_HEADER(termios.h,[CXXFLAGS="${CXXFLAGS} -DHAVE_TERMIOS_H"])
2424
TOOLS_CRYPTO=""
2525
MAD_IFC=""
26+
MLXFWUPDATE=""
2627

2728
COMPILER_FPIC="-fPIC"
2829
AC_SUBST(COMPILER_FPIC)
@@ -38,14 +39,35 @@ if test "$enable_dc" = "yes"; then
3839
AC_CHECK_LIB(z, uncompress,, AC_MSG_ERROR([cannot find zlib uncompress() function. Use --disable-dc to remove this dependaency]))
3940
fi
4041

42+
# FWMANAGER
43+
AC_MSG_CHECKING(--enable-fw-mgr argument)
44+
AC_ARG_ENABLE(fw-mgr,
45+
[ --enable-fw-mgr Enable compiling mstfwmanager tool and features],
46+
[enable_fw_mgr="yes"],
47+
[enable_fw_mgr="no"])
48+
AC_MSG_RESULT($enable_fw_mgr)
49+
if test "x$enable_fw_mgr" = "xyes"; then
50+
AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([cannot find zlib.h . this header is needed for compiling fw manager tool]))
51+
AC_CHECK_HEADER(curl/curl.h,,AC_MSG_ERROR([cannot find curl/curl.h . this header is needed for compiling fw manager tool]))
52+
AC_CHECK_LIB(z, uncompress,, AC_MSG_ERROR([cannot find zlib uncompress() function.]))
53+
AC_CHECK_LIB(boost_regex, regcompA,, AC_MSG_ERROR([cannot find boost_regex regcompA() function. Try re-installing the library...]))
54+
CURL_INC_DIR=/usr/include/curl/
55+
fi
56+
57+
AC_SUBST(CURL_INC_DIR)
58+
59+
AM_CONDITIONAL(ENABLE_FWMGR, [test "x$enable_fw_mgr" = "xyes" ])
60+
AC_SUBST(ENABLE_FWMGR)
61+
62+
AC_SUBST(ENABLE_FWMGR)
4163
# XML2
4264
AC_MSG_CHECKING(--enable-xml2 argument)
4365
AC_ARG_ENABLE(xml2,
4466
[ --enable-xml2 Enable mstflint libxml2 dependant features],
4567
[enable_xml2="yes"],
4668
[enable_xml2="no"])
4769
AC_MSG_RESULT($enable_xml2)
48-
if test "x$enable_xml2" = "xyes"; then
70+
if test [ "x$enable_xml2" = "xyes" ] || [ test "x$enable_fw_mgr" = "xyes" ]; then
4971
# XML2 checks
5072
if test ! -f /usr/include/libxml2/libxml/xpath.h; then
5173
AC_MSG_NOTICE([checking for libxml2... no])
@@ -57,6 +79,7 @@ if test "x$enable_xml2" = "xyes"; then
5779
AC_CHECK_LIB(xml2, xmlDocDumpFormatMemoryEnc,, AC_MSG_ERROR([cannot find xml2 xmlDocDumpFormatMemoryEnc() function. Try re-installing the library...]))
5880
AC_SUBST(XML2_INC_DIR)
5981
fi
82+
6083
AM_CONDITIONAL(DISABLE_XML2, [test "x$enable_xml2" = "xno"])
6184
AC_SUBST(DISABLE_XML2)
6285

@@ -126,13 +149,12 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
126149

127150
AC_CONFIG_FILES( mstflint.spec )
128151

129-
AS_IF([test "x$enable_cs" = "xyes" || test "x$enable_openssl" = "xyes"], [
130-
AC_CONFIG_FILES(tools_crypto/Makefile)
131-
])
132-
133-
AS_IF([test "x$enable_openssl" = "xyes"], [
134-
AC_CONFIG_FILES(mlxsign_lib/Makefile)
135-
])
152+
#Check for new ignore flags needed for GCC >= 7
153+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [CXXFLAGS="$CXXFLAGS -Wno-implicit-fallthrough"], [], [])
154+
AX_CHECK_COMPILE_FLAG([-Wno-format-overflow], [CFLAGS="$CFLAGS -Wno-format-overflow"], [], [])
155+
AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [CFLAGS="$CFLAGS -Wno-implicit-fallthrough"], [], [])
156+
AX_CHECK_COMPILE_FLAG([-Wno-format-overflow], [CXXFLAGS="$CXXFLAGS -Wno-format-overflow"], [], [])
157+
136158

137159
TOOLS_BUILD_TIME=`date +"%b %d %Y\, %H:%M:%S"`
138160
AC_SUBST(TOOLS_BUILD_TIME)
@@ -149,8 +171,28 @@ if test x"$TOOLS_GIT_SHA" == x; then
149171
fi
150172
AC_SUBST(TOOLS_GIT_SHA)
151173

174+
AS_IF([test "x$enable_cs" = "xyes" || test "x$enable_openssl" = "xyes"], [
175+
AC_CONFIG_FILES(tools_crypto/Makefile)
176+
])
177+
178+
AS_IF([test "x$enable_openssl" = "xyes"], [
179+
AC_CONFIG_FILES(mlxsign_lib/Makefile)
180+
])
181+
182+
AS_IF([test "x$enable_fw_mgr" = "xyes"], [
183+
AC_CONFIG_FILES(mlxfwupdate/Makefile)
184+
AC_CONFIG_FILES(libmfa/Makefile)
185+
AC_CONFIG_FILES(xz_utils/Makefile)
186+
AC_CONFIG_FILES(ext_libs/iniParser/Makefile)
187+
AC_CONFIG_FILES(ext_libs/json/Makefile)
188+
AC_CONFIG_FILES(ext_libs/minixz/Makefile)
189+
MLXFWUPDATE="libmfa xz_utils mlxfwupdate"
190+
])
191+
192+
AC_SUBST(MLXFWUPDATE)
193+
152194
AC_OUTPUT( Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile mtcr_py/Makefile ext_libs/Makefile ext_libs/sqlite/Makefile ext_libs/muparser/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile \
153195
cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mlxconfig/mlxconfig_dbs/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
154-
small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile \
196+
small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile mvpd/Makefile \
155197
fw_comps_mgr/Makefile mad_ifc/Makefile )
156198

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
mstflint (4.8.0-1) unstable; urgency=low
2+
3+
* Updated from MFT-4.8.0
4+
5+
-- Adham Masarwah <adham@unknown> Wed, 18 Oct 2017 17:52:33 +0200
6+
7+
18
mstflint (4.7.0-1) unstable; urgency=low
29

310
* Updated from MFT-4.7.0

dev_mgt/dev_mgt.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1-
#--
2-
# - Mellanox Confidential and Proprietary -
1+
# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
2+
#
3+
# This software is available to you under a choice of one of two
4+
# licenses. You may choose to be licensed under the terms of the GNU
5+
# General Public License (GPL) Version 2, available from the file
6+
# COPYING in the main directory of this source tree, or the
7+
# OpenIB.org BSD license below:
8+
#
9+
# Redistribution and use in source and binary forms, with or
10+
# without modification, are permitted provided that the following
11+
# conditions are met:
12+
#
13+
# - Redistributions of source code must retain the above
14+
# copyright notice, this list of conditions and the following
15+
# disclaimer.
316
#
4-
# Copyright (C) Jan 2013, Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
17+
# - Redistributions in binary form must reproduce the above
18+
# copyright notice, this list of conditions and the following
19+
# disclaimer in the documentation and/or other materials
20+
# provided with the distribution.
521
#
6-
# Except as specifically permitted herein, no portion of the information,
7-
# including but not limited to object code and source code, may be reproduced,
8-
# modified, distributed, republished or otherwise exploited in any form or by
9-
# any means for any purpose without the prior written permission of Mellanox
10-
# Technologies Ltd. Use of software subject to the terms and conditions
11-
# detailed in the file "LICENSE.txt".
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
26+
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27+
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29+
# SOFTWARE.
1230
#--
1331

1432
import os

ext_libs/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@
3333
# Makefile.am -- Process this file with automake to produce Makefile.in
3434

3535
SUBDIRS = muparser sqlite
36-
36+
if ENABLE_FWMGR
37+
SUBDIRS += iniParser minixz json
38+
endif
3739

ext_libs/iniParser/AUTHORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Author: Nicolas Devillard <[email protected]>
2+
3+
Many thanks to the many people who contributed ideas, code, suggestions,
4+
corrections, enhancements.

0 commit comments

Comments
 (0)