From fbb38dafd20cbc7d69f861343007d5fb5fbe6443 Mon Sep 17 00:00:00 2001 From: Rohan Sahay <103027015+rosahay-silabs@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:47:25 +0530 Subject: [PATCH 1/2] Improve error logging for WiFi data transmission failures in low_level_output --- src/platform/silabs/wifi/lwip-support/ethernetif.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platform/silabs/wifi/lwip-support/ethernetif.cpp b/src/platform/silabs/wifi/lwip-support/ethernetif.cpp index 7e880f62e9..ed0ff80abf 100644 --- a/src/platform/silabs/wifi/lwip-support/ethernetif.cpp +++ b/src/platform/silabs/wifi/lwip-support/ethernetif.cpp @@ -354,6 +354,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p) struct pbuf * q; uint16_t framelength = 0; uint16_t datalength = 0; + int32_t status = 0; #ifdef WIFI_DEBUG_ENABLED ChipLogProgress(DeviceLayer, "LWIP : low_level_output"); #endif @@ -375,14 +376,14 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p) #endif if ((netif->flags & (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP)) != (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP)) { - ChipLogProgress(DeviceLayer, "EN-RSI:NOT UP"); + ChipLogError(DeviceLayer, "EN-RSI:NOT UP"); xSemaphoreGive(ethout_sem); return ERR_IF; } packet = wfx_rsi_alloc_pkt(); if (!packet) { - ChipLogProgress(DeviceLayer, "EN-RSI:No buf"); + ChipLogError(DeviceLayer, "EN-RSI:No buf"); xSemaphoreGive(ethout_sem); return ERR_IF; } @@ -410,9 +411,10 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p) /* forward the generated packet to RSI to * send the data over wifi network */ - if (wfx_rsi_send_data(packet, datalength)) + status = wfx_rsi_send_data(packet, datalength); + if (status != 0) { - ChipLogProgress(DeviceLayer, "*ERR*EN-RSI:Send fail"); + ChipLogError(DeviceLayer, "*ERR*EN-RSI:Send fail: %d", status); xSemaphoreGive(ethout_sem); return ERR_IF; } From cfbffab0a758a708cdca204df321cfc38dd109ef Mon Sep 17 00:00:00 2001 From: Rohan Sahay <103027015+rosahay-silabs@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:35:14 +0530 Subject: [PATCH 2/2] Adds SLAAC IPv6 print --- src/platform/silabs/wifi/lwip-support/ethernetif.cpp | 2 +- src/platform/silabs/wifi/rs911x/WifiInterface.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/silabs/wifi/lwip-support/ethernetif.cpp b/src/platform/silabs/wifi/lwip-support/ethernetif.cpp index ed0ff80abf..0e438161c5 100644 --- a/src/platform/silabs/wifi/lwip-support/ethernetif.cpp +++ b/src/platform/silabs/wifi/lwip-support/ethernetif.cpp @@ -414,7 +414,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p) status = wfx_rsi_send_data(packet, datalength); if (status != 0) { - ChipLogError(DeviceLayer, "*ERR*EN-RSI:Send fail: %d", status); + ChipLogError(DeviceLayer, "*ERR*EN-RSI:Send fail: %ld", status); xSemaphoreGive(ethout_sem); return ERR_IF; } diff --git a/src/platform/silabs/wifi/rs911x/WifiInterface.cpp b/src/platform/silabs/wifi/rs911x/WifiInterface.cpp index e78507c4f1..9f2c7b3c0e 100644 --- a/src/platform/silabs/wifi/rs911x/WifiInterface.cpp +++ b/src/platform/silabs/wifi/rs911x/WifiInterface.cpp @@ -19,6 +19,7 @@ #include "silabs_utils.h" #include "sl_status.h" #include +#include #include #include #include @@ -599,6 +600,9 @@ void HandleDHCPPolling(void) */ if ((ip6_addr_ispreferred(netif_ip6_addr_state(sta_netif, 0))) && !hasNotifiedIPV6) { + char addrStr[chip::Inet::IPAddress::kMaxStringLength] = { 0 }; + VerifyOrReturn(ip6addr_ntoa_r(netif_ip6_addr(sta_netif, 0), addrStr, sizeof(addrStr)) != nullptr); + ChipLogProgress(DeviceLayer, "SLAAC OK: linklocal addr: %s", addrStr); wfx_ipv6_notify(GET_IPV6_SUCCESS); hasNotifiedIPV6 = true; WifiEvent event = WifiEvent::kStationDhcpDone;