diff --git a/src/platform/silabs/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp index 741a0b6b8676e1..14dd4f78f2487e 100644 --- a/src/platform/silabs/PlatformManagerImpl.cpp +++ b/src/platform/silabs/PlatformManagerImpl.cpp @@ -47,13 +47,13 @@ namespace DeviceLayer { PlatformManagerImpl PlatformManagerImpl::sInstance; #if defined(SL_MBEDTLS_USE_TINYCRYPT) -sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL; +osMutexId_t PlatformManagerImpl::rngMutexHandle = nullptr; int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size) { - sys_mutex_lock(&rngMutexHandle); + osMutexAcquire(rngMutexHandle, osWaitForever); int res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0; - sys_mutex_unlock(&rngMutexHandle); + osMutexRelease(rngMutexHandle); return res; } @@ -97,7 +97,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16)); #endif // !SLI_SI91X_MCU_INTERFACE /* Set RNG function for tinycrypt operations. */ - VerifyOrExit(sys_mutex_new(&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY); + rngMutexHandle = osMutexNew(nullptr); + VerifyOrExit((&rngMutexHandle != nullptr), err = CHIP_ERROR_NO_MEMORY); uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function); #endif // SL_MBEDTLS_USE_TINYCRYPT diff --git a/src/platform/silabs/PlatformManagerImpl.h b/src/platform/silabs/PlatformManagerImpl.h index b44fbadbfa3308..25813afb4839f9 100644 --- a/src/platform/silabs/PlatformManagerImpl.h +++ b/src/platform/silabs/PlatformManagerImpl.h @@ -28,6 +28,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION #include "wfx_host_events.h" #endif +#include namespace chip { namespace DeviceLayer { @@ -45,7 +46,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // Since the RNG callback will be called from multiple threads, // use this mutex to lock/unlock the call to Matter RNG API, which // uses some global variables. - static sys_mutex_t rngMutexHandle; + static osMutexId_t rngMutexHandle; // Callback used by tinycrypt to generate random numbers. // It must be set before calling any sign operations, diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h index 745de9b38410ba..beee667f58f261 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h +++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h @@ -23,7 +23,6 @@ #include "wfx_msgs.h" /* LwIP includes. */ -#include "lwip/apps/httpd.h" #include "lwip/ip_addr.h" #include "lwip/netif.h" #include "lwip/netifapi.h" diff --git a/src/platform/silabs/efr32/wifi/wfx_host_events.h b/src/platform/silabs/efr32/wifi/wfx_host_events.h index 3e83f3b07d46c5..24e5b6ea707a7a 100644 --- a/src/platform/silabs/efr32/wifi/wfx_host_events.h +++ b/src/platform/silabs/efr32/wifi/wfx_host_events.h @@ -117,7 +117,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s #endif /* WF200 */ /* LwIP includes. */ -#include "lwip/apps/httpd.h" #include "lwip/ip_addr.h" #include "lwip/netif.h" #include "lwip/netifapi.h"