Skip to content

Commit

Permalink
[Silabs] Adds debug prints for rs911x platform for better understandi…
Browse files Browse the repository at this point in the history
…ng (#37102)

* Improve error logging for WiFi data transmission failures in low_level_output

* Adds SLAAC IPv6 print

* Revert line for define check

* Adds missing includes

* Update status initialization

* Revert "Update status initialization"

This reverts commit f8f8377.

* Adds change based on comments

* Fix compilation

---------

Co-authored-by: Rohan S <[email protected]>
  • Loading branch information
rosahay-silabs and brosahay authored Jan 21, 2025
1 parent 65c861d commit e6e9614
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/platform/silabs/wifi/lwip-support/ethernetif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ 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);
sl_status_t status = sl_wifi_send_raw_data_frame(SL_WIFI_CLIENT_INTERFACE, (uint8_t *) p->payload, p->len);
if (status != SL_STATUS_OK)
{
return ERR_IF;
Expand Down Expand Up @@ -367,14 +366,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 +401,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))
int32_t 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 @@ -502,6 +503,9 @@ void HandleDHCPPolling(void)
*/
if ((ip6_addr_ispreferred(netif_ip6_addr_state(sta_netif, 0))) && !HasNotifiedIPv6Change())
{
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);
WifiPlatformEvent event = WifiPlatformEvent::kStationDhcpDone;
PostWifiPlatformEvent(event);
Expand Down

0 comments on commit e6e9614

Please sign in to comment.