Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Adds debug prints for rs911x platform for better understanding #37102

Merged
11 changes: 6 additions & 5 deletions src/platform/silabs/wifi/lwip-support/ethernetif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ StaticSemaphore_t xEthernetIfSemaBuffer;
#define LWIP_FRAME_ALIGNMENT 60

uint32_t gOverrunCount = 0;
sl_status_t status = 0;
rosahay-silabs marked this conversation as resolved.
Show resolved Hide resolved

/*****************************************************************************
* Variables
Expand Down Expand Up @@ -334,7 +335,6 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
{
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
UNUSED_PARAMETER(netif);
sl_status_t status;
status = sl_wifi_send_raw_data_frame(SL_WIFI_CLIENT_INTERFACE, (uint8_t *) p->payload, p->len);
if (status != SL_STATUS_OK)
{
Expand Down Expand Up @@ -367,14 +367,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;
}
Expand Down Expand Up @@ -402,9 +402,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: %ld", status);
xSemaphoreGive(ethout_sem);
return ERR_IF;
}
Expand Down
4 changes: 4 additions & 0 deletions src/platform/silabs/wifi/rs911x/WifiInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "silabs_utils.h"
#include "sl_status.h"
#include <cmsis_os2.h>
#include <inet/IPAddress.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/CodeUtils.h>
Expand Down Expand Up @@ -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);
NotifyIPv6Change(true);
hasNotifiedIPV6 = true;
WifiPlatformEvent event = WifiPlatformEvent::kStationDhcpDone;
Expand Down
Loading