From 2754009069790631187db38a7cba03e7fc702614 Mon Sep 17 00:00:00 2001 From: srningap <107042150+srningap@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:24:05 +0530 Subject: [PATCH] [Silabs] wifi removing warnings for 917SoC (#26051) * Addressed warnings for 917 * removed cflags from gni, removed comments * Applied restyle * updated matter_support pointer to latest commit * addressed redefined warning --------- Co-authored-by: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> --- .../SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c | 2 +- examples/platform/silabs/SiWx917/SiWx917/rsi_if.c | 8 ++++---- .../platform/silabs/SiWx917/SiWx917/wfx_rsi.h | 1 + .../silabs/SiWx917/device/src/startup_RS1xxxx.c | 10 +++++----- .../silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp | 15 +-------------- .../silabs/SiWx917/bluetooth/wfx_sl_ble_init.h | 2 ++ third_party/silabs/SiWx917_sdk.gni | 8 -------- third_party/silabs/matter_support | 2 +- 8 files changed, 15 insertions(+), 33 deletions(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c index e7141d4646060c..023fb47497ca1f 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c +++ b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c @@ -23,7 +23,7 @@ #ifdef RSI_WITH_OS /* FreeRTOS includes. */ #include "FreeRTOS.h" -#include "StackMacros.h" +#include "stack_macros.h" #include "task.h" #include "timers.h" diff --git a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c index 403dff68ce6a2f..745586a9868852 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c @@ -491,14 +491,14 @@ static void wfx_rsi_do_join(void) void wfx_rsi_task(void * arg) { EventBits_t flags; - int32_t status = 0; + int32_t status; TickType_t last_dhcp_poll, now; struct netif * sta_netif; (void) arg; - uint32_t rsi_status = wfx_rsi_init(); - if (rsi_status != RSI_SUCCESS) + status = wfx_rsi_init(); + if (status != RSI_SUCCESS) { - SILABS_LOG("%s: error: wfx_rsi_init with status: %02x", __func__, rsi_status); + SILABS_LOG("%s: error: wfx_rsi_init with status: %02x", __func__, status); return; } wfx_lwip_start(); diff --git a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h index 1a586931be5f18..09a44344bafb45 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h +++ b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h @@ -89,6 +89,7 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap); int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info); int32_t wfx_rsi_reset_count(); int32_t wfx_rsi_disconnect(); +int32_t wfx_rsi_init_platform(); #define SILABS_LOG(...) efr32Log(__VA_ARGS__); #ifdef __cplusplus diff --git a/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c b/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c index a62ea68bbbef12..db9b05fad220bb 100644 --- a/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c +++ b/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c @@ -37,11 +37,11 @@ __attribute__((section(".co_stack"))) unsigned long pulStack[STACK_SIZE]; #define WEAK __attribute__((weak)) /*----------Declaration of the default fault handlers-------------------------*/ -// #ifndef __START -// extern void _start(void) __attribute__((noreturn)); /* Pre Main (C library entry point) */ -// #else -// extern int __START(void) __attribute__((noreturn)); /* main entry point */ -// #endif +#ifndef __START +extern void _start(void) __attribute__((noreturn)); /* Pre Main (C library entry point) */ +#else +extern int __START(void) __attribute__((noreturn)); /* main entry point */ +#endif /* System exception vector handler */ __attribute__((used)) void WEAK Reset_Handler(void); diff --git a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp index 9f88a1937f8eb7..1d8c9a293d438d 100644 --- a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp @@ -842,7 +842,6 @@ static inline Spake2p_Context * to_inner_spake2p_context(Spake2pOpaqueContext * CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) { CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); @@ -864,11 +863,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) G = curve_G; return error; - -exit: - _log_mbedTLS_error(result); - Clear(); - return error; } void Spake2p_P256_SHA256_HKDF_HMAC::Clear() @@ -926,20 +920,18 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::MacVerify(const uint8_t * key, size_t CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FELoad(const uint8_t * in, size_t in_len, void * fe) { CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; uECC_word_t tmp[2 * NUM_ECC_WORDS] = { 0 }; uECC_vli_bytesToNative(tmp, in, NUM_ECC_BYTES); uECC_vli_mmod((uECC_word_t *) fe, tmp, curve_n); -exit: - _log_mbedTLS_error(result); return error; } CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEWrite(const void * fe, uint8_t * out, size_t out_len) { + (void) out_len; uECC_vli_nativeToBytes(out, NUM_ECC_BYTES, (const unsigned int *) fe); return CHIP_NO_ERROR; @@ -967,12 +959,9 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEGenerate(void * fe) CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEMul(void * fer, const void * fe1, const void * fe2) { CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; uECC_vli_modMult((uECC_word_t *) fer, (const uECC_word_t *) fe1, (const uECC_word_t *) fe2, (const uECC_word_t *) curve_n); -exit: - _log_mbedTLS_error(result); return error; } @@ -1018,7 +1007,6 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointAddMul(void * R, const void * P1, uECC_word_t R1[2 * NUM_ECC_WORDS]; uECC_word_t R2[2 * NUM_ECC_WORDS]; uECC_word_t z[NUM_ECC_WORDS]; - uint8_t ret = UECC_SUCCESS; if (EccPoint_mult_safer(R1, (const uECC_word_t *) P1, (const uECC_word_t *) fe1) != UECC_SUCCESS) { @@ -1490,7 +1478,6 @@ CHIP_ERROR ExtractPubkeyFromX509Cert(const ByteSpan & certificate, Crypto::P256P CHIP_ERROR error = CHIP_NO_ERROR; mbedtls_x509_crt mbed_cert; mbedtls_uecc_keypair * keypair = nullptr; - size_t pubkey_size = 0; mbedtls_x509_crt_init(&mbed_cert); diff --git a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h index 02f835d62ad6e0..bdc93f3a3ccbf9 100644 --- a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h +++ b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h @@ -17,7 +17,9 @@ #ifndef WFX_SL_BLE_INIT #define WFX_SL_BLE_INIT +#ifndef RSI_BLE_ENABLE #define RSI_BLE_ENABLE (1) +#endif // RSI_BLE_ENABLE // BLE include file to refer BLE APIs #include "FreeRTOS.h" diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index e56d949feaca46..22a24c9fa69215 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -181,15 +181,7 @@ template("siwx917_sdk") { cflags += [ "-Wno-maybe-uninitialized", "-Wno-shadow", - "-Wno-empty-body", - "-Wno-cpp", - "-Wno-missing-braces", - "-Wno-sign-compare", "-Wno-error", - "-Wno-unknown-warning-option", - "-Wno-unused-variable", - "-Wno-implicit-function-declaration", - "-Wno-unused-function", ] if (defined(invoker.defines)) { diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 060f2a7bd92b4a..53c27ef4ed0cff 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 060f2a7bd92b4ac42a90415e59a07d25bf4dab42 +Subproject commit 53c27ef4ed0cff01ad913b9e25d57ccb58cd49f4