Skip to content

Commit 64755b6

Browse files
rosahay-silabsrestyled-commits
authored andcommitted
[Silabs] Removes RS911X legacy socket macro cleanup (#25941)
* Removes RS911X_SOCKETS support * Removes use_rs911x_sockets * Restyled by gn --------- Co-authored-by: Restyled.io <[email protected]>
1 parent c993605 commit 64755b6

File tree

12 files changed

+25
-193
lines changed

12 files changed

+25
-193
lines changed

examples/platform/silabs/SiWx917/SiWx917/rsi_if.c

-62
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,7 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t
205205
* Join was complete - Do the DHCP
206206
*/
207207
WFX_RSI_LOG("%s: join completed.", __func__);
208-
#ifdef RS911X_SOCKETS
209-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DO_DHCP);
210-
#else
211208
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_CONN);
212-
#endif
213209
wfx_rsi.join_retries = 0;
214210
retryInterval = WLAN_MIN_RETRY_TIMER_MS;
215211
if (is_wifi_disconnection_event)
@@ -235,34 +231,7 @@ static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t * buf, uint32_t len)
235231
is_wifi_disconnection_event = true;
236232
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_START_JOIN);
237233
}
238-
#ifdef RS911X_SOCKETS
239-
240-
/******************************************************************
241-
* @fn wfx_rsi_ipchange_cb(uint16_t status, uint8_t *buf, uint32_t len)
242-
* @brief
243-
* DHCP should end up here
244-
* @param[in] status:
245-
* @param[in] buf:
246-
* @param[in] len:
247-
* @return
248-
* None
249-
*********************************************************************/
250-
static void wfx_rsi_ipchange_cb(uint16_t status, uint8_t * buf, uint32_t len)
251-
{
252-
WFX_RSI_LOG("%s: status: %02x", __func__, status);
253-
if (status != RSI_SUCCESS)
254-
{
255-
/* Restart DHCP? */
256-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DO_DHCP);
257-
}
258-
else
259-
{
260-
wfx_rsi.dev_state |= WFX_RSI_ST_STA_DHCP_DONE;
261-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DHCP_DONE);
262-
}
263-
}
264234

265-
#else
266235
/*************************************************************************************
267236
* @fn wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t *buf, uint32_t len)
268237
* @brief
@@ -282,7 +251,6 @@ static void wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t * buf, uint32_t len)
282251
}
283252
wfx_host_received_sta_frame_cb(buf, len);
284253
}
285-
#endif /* !Socket support */
286254

287255
/*************************************************************************************
288256
* @fn static int32_t wfx_rsi_init(void)
@@ -357,15 +325,11 @@ static int32_t wfx_rsi_init(void)
357325
WFX_RSI_LOG("%s: RSI callback register join failed with status: %02x", __func__, status);
358326
return status;
359327
}
360-
#ifdef RS911X_SOCKETS
361-
(void) rsi_wlan_register_callbacks(RSI_IP_CHANGE_NOTIFY_CB, wfx_rsi_ipchange_cb);
362-
#else
363328
if ((status = rsi_wlan_register_callbacks(RSI_WLAN_DATA_RECEIVE_NOTIFY_CB, wfx_rsi_wlan_pkt_cb)) != RSI_SUCCESS)
364329
{
365330
WFX_RSI_LOG("%s: RSI callback register data-notify failed with status: %02x", __func__, status);
366331
return status;
367332
}
368-
#endif
369333
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
370334
rsi_semaphore_post(&sl_rs_ble_init_sem);
371335
WFX_RSI_LOG("%s: RSI: OK", __func__);
@@ -538,22 +502,18 @@ void wfx_rsi_task(void * arg)
538502
{
539503
EventBits_t flags;
540504
int32_t status = 0;
541-
#ifndef RS911X_SOCKETS
542505
TickType_t last_dhcp_poll, now;
543506
struct netif * sta_netif;
544-
#endif
545507
(void) arg;
546508
uint32_t rsi_status = wfx_rsi_init();
547509
if (rsi_status != RSI_SUCCESS)
548510
{
549511
WFX_RSI_LOG("%s: error: wfx_rsi_init with status: %02x", __func__, rsi_status);
550512
return;
551513
}
552-
#ifndef RS911X_SOCKETS
553514
wfx_lwip_start();
554515
last_dhcp_poll = xTaskGetTickCount();
555516
sta_netif = wfx_get_netif(SL_WFX_STA_INTERFACE);
556-
#endif
557517
wfx_started_notify();
558518

559519
WFX_RSI_LOG("%s: starting event wait", __func__);
@@ -566,9 +526,6 @@ void wfx_rsi_task(void * arg)
566526
*/
567527
flags = xEventGroupWaitBits(wfx_rsi.events,
568528
WFX_EVT_STA_CONN | WFX_EVT_STA_DISCONN | WFX_EVT_STA_START_JOIN
569-
#ifdef RS911X_SOCKETS
570-
| WFX_EVT_STA_DO_DHCP | WFX_EVT_STA_DHCP_DONE
571-
#endif /* RS911X_SOCKETS */
572529
#ifdef SL_WFX_CONFIG_SOFTAP
573530
| WFX_EVT_AP_START | WFX_EVT_AP_STOP
574531
#endif /* SL_WFX_CONFIG_SOFTAP */
@@ -584,20 +541,6 @@ void wfx_rsi_task(void * arg)
584541
{
585542
WFX_RSI_LOG("%s: wait event encountered: %x", __func__, flags);
586543
}
587-
#ifdef RS911X_SOCKETS
588-
if (flags & WFX_EVT_STA_DO_DHCP)
589-
{
590-
/*
591-
* Do DHCP -
592-
*/
593-
if ((status = rsi_config_ipaddress(RSI_IP_VERSION_4, RSI_DHCP | RSI_DHCP_UNICAST_OFFER, NULL, NULL, NULL,
594-
&wfx_rsi.ip4_addr[0], IP_CONF_RSP_BUFF_LENGTH_4, STATION)) != RSI_SUCCESS)
595-
{
596-
/* We should try this again.. (perhaps sleep) */
597-
/* TODO - Figure out what to do here */
598-
}
599-
}
600-
#else /* !RS911X_SOCKET - using LWIP */
601544
/*
602545
* Let's handle DHCP polling here
603546
*/
@@ -639,7 +582,6 @@ void wfx_rsi_task(void * arg)
639582
last_dhcp_poll = now;
640583
}
641584
}
642-
#endif /* RS911X_SOCKETS */
643585
if (flags & WFX_EVT_STA_START_JOIN)
644586
{
645587
// saving the AP related info
@@ -654,14 +596,12 @@ void wfx_rsi_task(void * arg)
654596
*/
655597
WFX_RSI_LOG("%s: starting LwIP STA", __func__);
656598
wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTED;
657-
#ifndef RS911X_SOCKETS
658599
hasNotifiedWifiConnectivity = false;
659600
#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
660601
hasNotifiedIPV4 = false;
661602
#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4
662603
hasNotifiedIPV6 = false;
663604
wfx_lwip_set_sta_link_up();
664-
#endif /* !RS911X_SOCKETS */
665605
/* We need to get AP Mac - TODO */
666606
// Uncomment once the hook into MATTER is moved to IP connectivity instead
667607
// of AP connectivity. wfx_connected_notify(0, &wfx_rsi.ap_mac); // This
@@ -673,7 +613,6 @@ void wfx_rsi_task(void * arg)
673613
~(WFX_RSI_ST_STA_READY | WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE);
674614
WFX_RSI_LOG("%s: disconnect notify", __func__);
675615
/* TODO: Implement disconnect notify */
676-
#ifndef RS911X_SOCKETS
677616
wfx_lwip_set_sta_link_down(); // Internally dhcpclient_poll(netif) ->
678617
// wfx_ip_changed_notify(0) for IPV4
679618
#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
@@ -683,7 +622,6 @@ void wfx_rsi_task(void * arg)
683622
wfx_ipv6_notify(GET_IPV6_FAIL);
684623
hasNotifiedIPV6 = false;
685624
hasNotifiedWifiConnectivity = false;
686-
#endif /* !RS911X_SOCKETS */
687625
}
688626
#ifdef SL_WFX_CONFIG_SCAN
689627
if (flags & WFX_EVT_SCAN)

examples/platform/silabs/efr32/rs911x/rsi_if.c

-63
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,7 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t
233233
* Join was complete - Do the DHCP
234234
*/
235235
WFX_RSI_LOG("%s: join completed.", __func__);
236-
#ifdef RS911X_SOCKETS
237-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DO_DHCP);
238-
#else
239236
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_CONN);
240-
#endif
241237
wfx_rsi.join_retries = 0;
242238
retryInterval = WLAN_MIN_RETRY_TIMER_MS;
243239
}
@@ -261,34 +257,6 @@ static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t * buf, uint32_t len)
261257
is_wifi_disconnection_event = true;
262258
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_START_JOIN);
263259
}
264-
#ifdef RS911X_SOCKETS
265-
266-
/******************************************************************
267-
* @fn wfx_rsi_ipchange_cb(uint16_t status, uint8_t *buf, uint32_t len)
268-
* @brief
269-
* DHCP should end up here
270-
* @param[in] status:
271-
* @param[in] buf:
272-
* @param[in] len:
273-
* @return
274-
* None
275-
*********************************************************************/
276-
static void wfx_rsi_ipchange_cb(uint16_t status, uint8_t * buf, uint32_t len)
277-
{
278-
WFX_RSI_LOG("%s: status: %02x", __func__, status);
279-
if (status != RSI_SUCCESS)
280-
{
281-
/* Restart DHCP? */
282-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DO_DHCP);
283-
}
284-
else
285-
{
286-
wfx_rsi.dev_state |= WFX_RSI_ST_STA_DHCP_DONE;
287-
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_DHCP_DONE);
288-
}
289-
}
290-
291-
#else
292260
/*************************************************************************************
293261
* @fn wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t *buf, uint32_t len)
294262
* @brief
@@ -308,7 +276,6 @@ static void wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t * buf, uint32_t len)
308276
}
309277
wfx_host_received_sta_frame_cb(buf, len);
310278
}
311-
#endif /* !Socket support */
312279

313280
/*************************************************************************************
314281
* @fn static int32_t wfx_rsi_init(void)
@@ -403,15 +370,11 @@ static int32_t wfx_rsi_init(void)
403370
WFX_RSI_LOG("%s: RSI callback register join failed with status: %02x", __func__, status);
404371
return status;
405372
}
406-
#ifdef RS911X_SOCKETS
407-
(void) rsi_wlan_register_callbacks(RSI_IP_CHANGE_NOTIFY_CB, wfx_rsi_ipchange_cb);
408-
#else
409373
if ((status = rsi_wlan_register_callbacks(RSI_WLAN_DATA_RECEIVE_NOTIFY_CB, wfx_rsi_wlan_pkt_cb)) != RSI_SUCCESS)
410374
{
411375
WFX_RSI_LOG("%s: RSI callback register data-notify failed with status: %02x", __func__, status);
412376
return status;
413377
}
414-
#endif
415378

416379
#if (RSI_BLE_ENABLE)
417380
rsi_semaphore_post(&sl_rs_ble_init_sem);
@@ -590,22 +553,18 @@ static void wfx_rsi_do_join(void)
590553
void wfx_rsi_task(void * arg)
591554
{
592555
EventBits_t flags;
593-
#ifndef RS911X_SOCKETS
594556
TickType_t last_dhcp_poll, now;
595557
struct netif * sta_netif;
596-
#endif
597558
(void) arg;
598559
uint32_t rsi_status = wfx_rsi_init();
599560
if (rsi_status != RSI_SUCCESS)
600561
{
601562
WFX_RSI_LOG("%s: error: wfx_rsi_init with status: %02x", __func__, rsi_status);
602563
return;
603564
}
604-
#ifndef RS911X_SOCKETS
605565
wfx_lwip_start();
606566
last_dhcp_poll = xTaskGetTickCount();
607567
sta_netif = wfx_get_netif(SL_WFX_STA_INTERFACE);
608-
#endif
609568
wfx_started_notify();
610569

611570
WFX_RSI_LOG("%s: starting event wait", __func__);
@@ -618,9 +577,6 @@ void wfx_rsi_task(void * arg)
618577
*/
619578
flags = xEventGroupWaitBits(wfx_rsi.events,
620579
WFX_EVT_STA_CONN | WFX_EVT_STA_DISCONN | WFX_EVT_STA_START_JOIN
621-
#ifdef RS911X_SOCKETS
622-
| WFX_EVT_STA_DO_DHCP | WFX_EVT_STA_DHCP_DONE
623-
#endif /* RS911X_SOCKETS */
624580
#ifdef SL_WFX_CONFIG_SOFTAP
625581
| WFX_EVT_AP_START | WFX_EVT_AP_STOP
626582
#endif /* SL_WFX_CONFIG_SOFTAP */
@@ -636,20 +592,6 @@ void wfx_rsi_task(void * arg)
636592
{
637593
WFX_RSI_LOG("%s: wait event encountered: %x", __func__, flags);
638594
}
639-
#ifdef RS911X_SOCKETS
640-
if (flags & WFX_EVT_STA_DO_DHCP)
641-
{
642-
/*
643-
* Do DHCP -
644-
*/
645-
if ((status = rsi_config_ipaddress(RSI_IP_VERSION_4, RSI_DHCP | RSI_DHCP_UNICAST_OFFER, NULL, NULL, NULL,
646-
&wfx_rsi.ip4_addr[0], IP_CONF_RSP_BUFF_LENGTH_4, STATION)) != RSI_SUCCESS)
647-
{
648-
/* We should try this again.. (perhaps sleep) */
649-
/* TODO - Figure out what to do here */
650-
}
651-
}
652-
#else /* !RS911X_SOCKET - using LWIP */
653595
/*
654596
* Let's handle DHCP polling here
655597
*/
@@ -705,7 +647,6 @@ void wfx_rsi_task(void * arg)
705647
last_dhcp_poll = now;
706648
}
707649
}
708-
#endif /* RS911X_SOCKETS */
709650
if (flags & WFX_EVT_STA_START_JOIN)
710651
{
711652
// saving the AP related info
@@ -720,14 +661,12 @@ void wfx_rsi_task(void * arg)
720661
*/
721662
WFX_RSI_LOG("%s: starting LwIP STA", __func__);
722663
wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTED;
723-
#ifndef RS911X_SOCKETS
724664
hasNotifiedWifiConnectivity = false;
725665
#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
726666
hasNotifiedIPV4 = false;
727667
#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4
728668
hasNotifiedIPV6 = false;
729669
wfx_lwip_set_sta_link_up();
730-
#endif /* !RS911X_SOCKETS */
731670
/* We need to get AP Mac - TODO */
732671
// Uncomment once the hook into MATTER is moved to IP connectivty instead
733672
// of AP connectivity. wfx_connected_notify(0, &wfx_rsi.ap_mac); // This
@@ -739,7 +678,6 @@ void wfx_rsi_task(void * arg)
739678
~(WFX_RSI_ST_STA_READY | WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE);
740679
WFX_RSI_LOG("%s: disconnect notify", __func__);
741680
/* TODO: Implement disconnect notify */
742-
#ifndef RS911X_SOCKETS
743681
wfx_lwip_set_sta_link_down(); // Internally dhcpclient_poll(netif) ->
744682
// wfx_ip_changed_notify(0) for IPV4
745683
#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
@@ -749,7 +687,6 @@ void wfx_rsi_task(void * arg)
749687
wfx_ipv6_notify(GET_IPV6_FAIL);
750688
hasNotifiedIPV6 = false;
751689
hasNotifiedWifiConnectivity = false;
752-
#endif /* !RS911X_SOCKETS */
753690
}
754691
#ifdef SL_WFX_CONFIG_SCAN
755692
if (flags & WFX_EVT_SCAN)

examples/platform/silabs/efr32/rs911x/rsi_wlan_config.h

-12
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,8 @@
3737
#define RSI_FEATURE_BIT_MAP (FEAT_SECURITY_OPEN)
3838

3939
//! TCP IP BYPASS feature check
40-
#ifdef RS911X_SOCKETS
41-
#define RSI_TCP_IP_BYPASS RSI_DISABLE
42-
43-
#define RSI_TCP_IP_FEATURE_BIT_MAP \
44-
(TCP_IP_FEAT_DHCPV4_CLIENT | /*TCP_IP_FEAT_HTTP_CLIENT | */ \
45-
TCP_IP_FEAT_EXTENSION_VALID | /*TCP_IP_FEAT_SSL |*/ /*TCP_IP_FEAT_DNS_CLIENT |*/ \
46-
0)
47-
//! To set custom feature select bit map
48-
#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID
49-
50-
#else /* Don't use RSI_SOCKETS */
5140
#define RSI_TCP_IP_BYPASS RSI_ENABLE
5241
#define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_BYPASS /*| TCP_IP_FEAT_EXTENSION_VALID*/)
53-
#endif
5442

5543
//! To set Extended custom feature select bit map
5644
#if WIFI_ENABLE_SECURITY_WPA3

src/platform/silabs/SiWx917/BUILD.gn

-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ if (chip_crypto == "platform") {
3030
config("siwx917-platform-wifi-config") {
3131
include_dirs = [ "wifi" ]
3232
defines = []
33-
34-
if (use_rs911x_sockets) {
35-
include_dirs += [ "wifi/rsi-sockets" ]
36-
defines += [
37-
"RS911X_SOCKETS",
38-
"RSI_IPV6_ENABLE",
39-
]
40-
}
4133
}
4234
static_library("SiWx917") {
4335
sources = [

src/platform/silabs/SiWx917/wifi/lwip_netif.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef RS911X_SOCKETS
1918
#include <stdio.h>
2019
#include <stdlib.h>
2120
#include <string.h>
@@ -149,5 +148,3 @@ struct netif * wfx_get_netif(sl_wfx_interface_t interface)
149148
#endif
150149
return (struct netif *) 0;
151150
}
152-
153-
#endif /* RS911X_SOCKETS */

src/platform/silabs/SiWx917/wifi/wfx_host_events.h

-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#define SL_WFX_SCAN_COMPLETE_ID 4
2828
#define WFX_RSI_SSID_SIZE 64
2929

30-
#ifndef RS911X_SOCKETS
3130
/* LwIP includes. */
3231
#include "lwip/apps/httpd.h"
3332
#include "lwip/ip_addr.h"
@@ -44,8 +43,6 @@
4443
#define SL_WFX_SCAN_COMPLETE (1 << 6)
4544
#define SL_WFX_RETRY_CONNECT (1 << 7)
4645

47-
#endif /* RS911X_SOCKETS */
48-
4946
#include "sl_status.h"
5047

5148
#define WLAN_TASK_STACK_SIZE 1024

0 commit comments

Comments
 (0)