Skip to content

Commit d0ce054

Browse files
fix wifi ncp builds
1 parent bf405be commit d0ce054

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_interrupt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void rsi_gpio_irq_cb(uint8_t irqnum)
6262
if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ)
6363
return;
6464
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
65-
sl_si91x_host_set_bus_event(NCP_HOST_BUS_RX_EVENT);
65+
sl_si91x_host_set_bus_event(SL_SI91X_NCP_HOST_BUS_RX_EVENT);
6666
#else
6767
GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
6868
if (call_back != NULL)

src/platform/silabs/efr32/wifi/ethernetif.cpp

+11-27
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ extern "C" {
4040
#include "sl_si91x_driver.h"
4141
#include "sl_si91x_host_interface.h"
4242
#include "sl_si91x_types.h"
43+
#include "sl_wifi.h"
4344
#include "sl_wifi_callback_framework.h"
4445
#include "sl_wifi_constants.h"
4546
#include "sl_wifi_types.h"
@@ -347,12 +348,16 @@ static SemaphoreHandle_t ethout_sem;
347348
static err_t low_level_output(struct netif * netif, struct pbuf * p)
348349
{
349350
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
350-
sl_wifi_buffer_t * buffer;
351-
sl_si91x_packet_t * packet;
352-
sl_status_t status = SL_STATUS_OK;
351+
UNUSED_PARAMETER(netif);
352+
sl_status_t status;
353+
status = sl_wifi_send_raw_data_frame(SL_WIFI_CLIENT_INTERFACE, (uint8_t *) p->payload, p->len);
354+
if (status != SL_STATUS_OK)
355+
{
356+
return ERR_IF;
357+
}
358+
return ERR_OK;
353359
#else
354360
void * packet;
355-
#endif
356361
struct pbuf * q;
357362
uint16_t framelength = 0;
358363
uint16_t datalength = 0;
@@ -381,27 +386,14 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
381386
xSemaphoreGive(ethout_sem);
382387
return ERR_IF;
383388
}
384-
/* Confirm if packet is allocated */
385-
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
386-
status = sl_si91x_allocate_command_buffer(&buffer, (void **) &packet, sizeof(sl_si91x_packet_t) + framelength,
387-
SL_WIFI_ALLOCATE_COMMAND_BUFFER_WAIT_TIME_MS);
388-
VERIFY_STATUS_AND_RETURN(status);
389-
if (packet == NULL)
390-
#else // RS9116
391389
packet = wfx_rsi_alloc_pkt();
392390
if (!packet)
393-
#endif // SLI_SI91X_MCU_INTERFACE
394391
{
395392
ChipLogProgress(DeviceLayer, "EN-RSI:No buf");
396393
xSemaphoreGive(ethout_sem);
397-
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
398-
return SL_STATUS_ALLOCATION_FAILED;
399-
}
400-
memset(packet->desc, 0, sizeof(packet->desc));
401-
#else // RS9116
402394
return ERR_IF;
403395
}
404-
#endif // SLI_SI91X_MCU_INTERFACE
396+
405397
#ifdef WIFI_DEBUG_ENABLED
406398
uint8_t * b = (uint8_t *) p->payload;
407399
ChipLogProgress(DeviceLayer, "EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0],
@@ -422,19 +414,10 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
422414
ChipLogProgress(DeviceLayer, "EN-RSI: Sending %d", framelength);
423415
#endif
424416

425-
/* forward the generated packet to RSI to
426-
* send the data over wifi network
427-
*/
428-
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
429-
packet->length = framelength & 0xFFF;
430-
packet->command = RSI_SEND_RAW_DATA;
431-
if (sl_si91x_driver_send_data_packet(SI91X_WLAN_CMD_QUEUE, buffer, 1000))
432-
#else
433417
/* forward the generated packet to RSI to
434418
* send the data over wifi network
435419
*/
436420
if (wfx_rsi_send_data(packet, datalength))
437-
#endif
438421
{
439422
ChipLogProgress(DeviceLayer, "*ERR*EN-RSI:Send fail");
440423
xSemaphoreGive(ethout_sem);
@@ -447,6 +430,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
447430
xSemaphoreGive(ethout_sem);
448431

449432
return ERR_OK;
433+
#endif // RS9116
450434
}
451435

452436
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)

third_party/silabs/efr32_sdk.gni

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ template("efr32_sdk") {
531531
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config",
532532
"${efr32_sdk_root}/platform/service/device_init/config/s2/",
533533
"${efr32_sdk_root}/platform/emdrv/spidrv/inc",
534+
"${efr32_sdk_root}/platform/emdrv/spidrv/config",
534535
"${efr32_sdk_root}/platform/emdrv/dmadrv/inc/s2_signals",
535536
]
536537

0 commit comments

Comments
 (0)