Skip to content

Commit 15b1e94

Browse files
CuRahmanmykrupp
authored andcommitted
Changes necessary for WiFi SDK lwip component usage vs. source/header file reference
1 parent b88ac27 commit 15b1e94

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

examples/platform/silabs/efr32/rs911x/rsi_if.c

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "em_usart.h"
2727

2828
#include "sl_status.h"
29+
#include "FreeRTOS.h"
2930
#include <cmsis_os2.h>
3031
// TODO Fix include order issue #33120
3132
#include "wfx_host_events.h"

src/platform/silabs/PlatformManagerImpl.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ namespace DeviceLayer {
4747
PlatformManagerImpl PlatformManagerImpl::sInstance;
4848

4949
#if defined(SL_MBEDTLS_USE_TINYCRYPT)
50-
sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL;
50+
sys_mutex_t PlatformManagerImpl::rngMutexHandle = nullptr;
5151

5252
int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size)
5353
{
54-
sys_mutex_lock(&rngMutexHandle);
54+
osMutexAcquire(rngMutexHandle, osWaitForever);
5555
int res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
56-
sys_mutex_unlock(&rngMutexHandle);
56+
osMutexRelease(rngMutexHandle);
5757

5858
return res;
5959
}
@@ -97,7 +97,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
9797
ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16));
9898
#endif // !SLI_SI91X_MCU_INTERFACE
9999
/* Set RNG function for tinycrypt operations. */
100-
VerifyOrExit(sys_mutex_new(&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY);
100+
rngMutexHandle = osMutexNew(nullptr);
101+
VerifyOrExit((&rngMutexHandle != nullptr), err = CHIP_ERROR_NO_MEMORY);
101102
uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function);
102103
#endif // SL_MBEDTLS_USE_TINYCRYPT
103104

src/platform/silabs/PlatformManagerImpl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
2929
#include "wfx_host_events.h"
3030
#endif
31+
#include <cmsis_os2.h>
3132

3233
namespace chip {
3334
namespace DeviceLayer {
@@ -45,7 +46,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener
4546
// Since the RNG callback will be called from multiple threads,
4647
// use this mutex to lock/unlock the call to Matter RNG API, which
4748
// uses some global variables.
48-
static sys_mutex_t rngMutexHandle;
49+
static osMutexId_t rngMutexHandle;
4950

5051
// Callback used by tinycrypt to generate random numbers.
5152
// It must be set before calling any sign operations,

src/platform/silabs/SiWx917/wifi/ethernetif.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <stdio.h>
2121
#include <stdlib.h>
2222
#include <string.h>
23+
#include <FreeRTOS.h>
2324

2425
#include "wfx_host_events.h"
2526
#include "wifi_config.h"

src/platform/silabs/SiWx917/wifi/wfx_host_events.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "wfx_msgs.h"
2424

2525
/* LwIP includes. */
26-
#include "lwip/apps/httpd.h"
2726
#include "lwip/ip_addr.h"
2827
#include "lwip/netif.h"
2928
#include "lwip/netifapi.h"

src/platform/silabs/efr32/wifi/wfx_host_events.h

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
117117
#endif /* WF200 */
118118

119119
/* LwIP includes. */
120-
#include "lwip/apps/httpd.h"
121120
#include "lwip/ip_addr.h"
122121
#include "lwip/netif.h"
123122
#include "lwip/netifapi.h"

0 commit comments

Comments
 (0)