@@ -40,6 +40,7 @@ extern "C" {
40
40
#include " sl_si91x_driver.h"
41
41
#include " sl_si91x_host_interface.h"
42
42
#include " sl_si91x_types.h"
43
+ #include " sl_wifi.h"
43
44
#include " sl_wifi_callback_framework.h"
44
45
#include " sl_wifi_constants.h"
45
46
#include " sl_wifi_types.h"
@@ -347,12 +348,16 @@ static SemaphoreHandle_t ethout_sem;
347
348
static err_t low_level_output (struct netif * netif, struct pbuf * p)
348
349
{
349
350
#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;
353
359
#else
354
360
void * packet;
355
- #endif
356
361
struct pbuf * q;
357
362
uint16_t framelength = 0 ;
358
363
uint16_t datalength = 0 ;
@@ -381,27 +386,14 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
381
386
xSemaphoreGive (ethout_sem);
382
387
return ERR_IF;
383
388
}
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
391
389
packet = wfx_rsi_alloc_pkt ();
392
390
if (!packet)
393
- #endif // SLI_SI91X_MCU_INTERFACE
394
391
{
395
392
ChipLogProgress (DeviceLayer, " EN-RSI:No buf" );
396
393
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
402
394
return ERR_IF;
403
395
}
404
- # endif // SLI_SI91X_MCU_INTERFACE
396
+
405
397
#ifdef WIFI_DEBUG_ENABLED
406
398
uint8_t * b = (uint8_t *) p->payload ;
407
399
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)
422
414
ChipLogProgress (DeviceLayer, " EN-RSI: Sending %d" , framelength);
423
415
#endif
424
416
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
433
417
/* forward the generated packet to RSI to
434
418
* send the data over wifi network
435
419
*/
436
420
if (wfx_rsi_send_data (packet, datalength))
437
- #endif
438
421
{
439
422
ChipLogProgress (DeviceLayer, " *ERR*EN-RSI:Send fail" );
440
423
xSemaphoreGive (ethout_sem);
@@ -447,6 +430,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
447
430
xSemaphoreGive (ethout_sem);
448
431
449
432
return ERR_OK;
433
+ #endif // RS9116
450
434
}
451
435
452
436
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
0 commit comments