include $(TOPDIR)/rules.mk
PKG_NAME:=mstflint
-PKG_VERSION:=4.30.0
+PKG_VERSION:=4.31.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-1.tar.gz
PKG_SOURCE_URL:=https://github.com/Mellanox/$(PKG_NAME)/releases/download/v$(PKG_VERSION)-1
-PKG_SOURCE_DATE:=2024-11-06
-PKG_HASH:=f2fd1a795cb56466f335d2fbd55d6a9bab20132d1edde6f61750cff0bde6da7b
+PKG_SOURCE_DATE:=2025-02-06
+PKG_HASH:=c0152414e7580a18925c7707ebe2cb659d3a1ed7b80015a35bea4d723b64f8e7
PKG_LICENSE:=GPL-2.0-only
--- /dev/null
+From 215d3c274125321ea6254b59dc28996370705d5e Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Feb 2025 14:26:52 +0100
+Subject: [PATCH 1/3] fwctrl: include missing function declarations
+
+The fwctrl fails to build with the following error:
+
+fwctrl.c: In function 'fwctl_control_access_register':
+fwctrl.c:190:27: error: implicit declaration of function 'return_by_reg_status' [-Wimplicit-function-declaration]
+ 190 | *reg_status = return_by_reg_status(cmd_status);
+ | ^~~~~~~~~~~~~~~~~~~~
+In file included from fwctrl.c:45:
+fwctrl.c:195:56: error: implicit declaration of function 'm_err2str' [-Wimplicit-function-declaration]
+ 195 | reg_id, cmd_status, *reg_status, m_err2str(status));
+ |
+
+This commit adds the return_by_reg_status prototype to the
+mtcr_ul_com.h file and includes mtcr_ul_com.h and mtcr.h
+(where the m_err2str prototype is defined) inside fwctrl.c.
+
+---
+ mtcr_ul/fwctrl.c | 2 ++
+ mtcr_ul/mtcr_ul_com.h | 2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/mtcr_ul/fwctrl.c
++++ b/mtcr_ul/fwctrl.c
+@@ -40,7 +40,9 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <stddef.h>
++#include "mtcr.h"
+ #include "mtcr_mf.h"
++#include "mtcr_ul_com.h"
+ #include "fwctrl.h"
+ #include "fwctrl_ioctl.h"
+
+--- a/mtcr_ul/mtcr_ul_com.h
++++ b/mtcr_ul/mtcr_ul_com.h
+@@ -165,6 +165,8 @@ int mclear_pci_semaphore_ul(const char*
+
+ int mvpd_read4_ul(mfile* mf, unsigned int offset, u_int8_t value[4]);
+
++int return_by_reg_status(int reg_status);
++
+ int space_to_cap_offset(int space);
+
+ int get_dma_pages(mfile* mf, struct mtcr_page_info* page_info, int page_amount);
--- /dev/null
+From 873c1822521b0524571ba54f4ce5d565fbf59c1f Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Feb 2025 14:42:25 +0100
+Subject: [PATCH 2/3] fwctrl: fix reg status typo
+
+There is the following build error:
+
+fwctrl.c: In function 'fwctl_control_access_register':
+fwctrl.c:197:66: error: incompatible type for argument 1 of 'm_err2str'
+ 197 | reg_id, cmd_status, *reg_status, m_err2str(status));
+ | ^~~~~~
+ | |
+ | void *
+../include/mtcr_ul/fwctrl_ioctl.h:47:81: note: in definition of macro 'FWCTL_DEBUG_PRINT'
+ 47 | printf("%s: %s %d: " format, FWCTL_ENV_VAR_DEBUG, __func__, __LINE__, ##arg); \
+ | ^~~
+In file included from fwctrl.c:43:
+../include/mtcr_ul/mtcr.h:173:30: note: expected 'MError' but argument is of type 'void *'
+ 173 | const char* m_err2str(MError status);
+ | ~~~~~~~^~~~~~
+
+Looking at the format string, this seems to be just a typo,
+so fix that to the correct variable name.
+
+---
+ mtcr_ul/fwctrl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mtcr_ul/fwctrl.c
++++ b/mtcr_ul/fwctrl.c
+@@ -194,7 +194,7 @@ int fwctl_control_access_register(int
+ }
+
+ FWCTL_DEBUG_PRINT(mf, "register id = 0x%x, command status = 0x%x, reg status code: 0x%x, reg status: %s\n",
+- reg_id, cmd_status, *reg_status, m_err2str(status));
++ reg_id, cmd_status, *reg_status, m_err2str(*reg_status));
+ out:
+ free(out);
+ free(in);
--- /dev/null
+From dea0155b131b55cdc1bb3bc867ad53c1782fa724 Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Feb 2025 14:52:35 +0100
+Subject: [PATCH 3/3] dev_mgt: include missing function declaration
+
+The dev_mgt fails to build with the following error:
+
+tools_dev_types.c: In function 'dm_get_device_id_inner':
+tools_dev_types.c:695:13: error: implicit declaration of function 'read_device_id'; did you mean 'dm_get_device_id'? [-Wimplicit-function-declaration]
+ 695 | if (read_device_id(mf, &dword) != 4) {
+ | ^~~~~~~~~~~~~~
+ | dm_get_device_id
+
+This commit includes mtcr_ul_com.h (where read_device_id
+is defined) into tools_dev_types.c to fix the error.
+
+---
+ dev_mgt/tools_dev_types.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/dev_mgt/tools_dev_types.c
++++ b/dev_mgt/tools_dev_types.c
+@@ -48,6 +48,7 @@
+ #include <tools_layouts/reg_access_hca_layouts.h>
+ #include "tools_dev_types.h"
+ #include "mflash/mflash_types.h"
++#include "mtcr_ul/mtcr_ul_com.h"
+
+ enum dm_dev_type {
+ DM_UNKNOWN = -1,