Skip to content

Commit 1f2c99e

Browse files
committed
Changes necessary for WiFi SDK lwip component usage vs. source/header file reference
1 parent 7dae0ce commit 1f2c99e

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
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.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/PlatformManagerImpl.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,16 @@ namespace DeviceLayer {
4848

4949
PlatformManagerImpl PlatformManagerImpl::sInstance;
5050
#if defined(TINYCRYPT_PRIMITIVES)
51-
sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL;
51+
osMutexId_t PlatformManagerImpl::rngMutexHandle = nullptr;
5252
#endif
5353

5454
#if defined(TINYCRYPT_PRIMITIVES)
5555
int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size)
5656
{
5757
int res;
58-
59-
sys_mutex_lock(&rngMutexHandle);
58+
osMutexAcquire(rngMutexHandle, osWaitForever);
6059
res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
61-
sys_mutex_unlock(&rngMutexHandle);
60+
osMutexRelease(rngMutexHandle);
6261

6362
return res;
6463
}
@@ -103,8 +102,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
103102
#if defined(TINYCRYPT_PRIMITIVES)
104103
/* Set RNG function for tinycrypt operations. */
105104
err_t ret;
106-
ret = sys_mutex_new(&rngMutexHandle);
107-
VerifyOrExit((ERR_OK == ret), err = CHIP_ERROR_NO_MEMORY);
105+
rngMutexHandle = osMutexNew(nullptr);
106+
VerifyOrExit((&rngMutexHandle != nullptr), err = CHIP_ERROR_NO_MEMORY);
108107
uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function);
109108
#endif
110109

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-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "wfx_msgs.h"
2424

2525
/* LwIP includes. */
26-
#include "lwip/apps/httpd.h"
26+
// #include "lwip/apps/httpd.h" // Do we need ?
2727
#include "lwip/ip_addr.h"
2828
#include "lwip/netif.h"
2929
#include "lwip/netifapi.h"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
119119
#endif /* WF200 */
120120

121121
/* LwIP includes. */
122-
#include "lwip/apps/httpd.h"
122+
// #include "lwip/apps/httpd.h" Needed ?
123123
#include "lwip/ip_addr.h"
124124
#include "lwip/netif.h"
125125
#include "lwip/netifapi.h"

0 commit comments

Comments
 (0)