Skip to content

Commit

Permalink
[Silabs] Wi-fi: Header and source dhcp files cleanup (#35143)
Browse files Browse the repository at this point in the history
* dhcp client source and header files cleanup

* Resolved build errors for Siwx917 BRD4338A board

* Resolved build errors for efr boards

* Resolved review comments

* Build errors resolved

* Added TO-DO cleanup for wifi files

* Moved wifi include to common efr32_sdk.gni

* Removed EFR platform headers from dhcp_client.cpp
  • Loading branch information
bhmanda-silabs authored Sep 9, 2024
1 parent 7d57f07 commit 78830a0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 205 deletions.
7 changes: 5 additions & 2 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ declare_args() {

# Sanity check
assert(chip_enable_wifi)
silabs_plat_dir = "${chip_root}/src/platform/silabs"
silabs_plat_si91x_wifi_dir = "${chip_root}/src/platform/silabs/SiWx917/wifi"
import("${silabs_common_plat_dir}/args.gni")

import("${silabs_common_plat_dir}/args.gni")
config("chip_examples_project_config") {
include_dirs = [ "project_include" ]

Expand Down Expand Up @@ -181,9 +182,11 @@ source_set("siwx917-common") {
include_dirs = [
".",
"SiWx917/",
"${silabs_plat_dir}/wifi",
"${silabs_plat_si91x_wifi_dir}",
]

#TO-DO Cleanup to be done for all the wifi files into common folder
sources = [
"${silabs_common_plat_dir}/BaseApplication.cpp",
"${silabs_common_plat_dir}/LEDWidget.cpp",
Expand All @@ -193,7 +196,7 @@ source_set("siwx917-common") {
"${silabs_common_plat_dir}/syscalls_stubs.cpp",
"${silabs_common_plat_dir}/wifi/wfx_notify.cpp",
"${silabs_common_plat_dir}/wifi/wfx_rsi_host.cpp",
"${silabs_plat_si91x_wifi_dir}/dhcp_client.cpp",
"${silabs_plat_dir}/wifi/dhcp_client.cpp",
"${silabs_plat_si91x_wifi_dir}/ethernetif.cpp",
"${silabs_plat_si91x_wifi_dir}/lwip_netif.cpp",
"SiWx917/sl_wifi_if.cpp",
Expand Down
12 changes: 11 additions & 1 deletion examples/platform/silabs/efr32/wf200/host_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,19 @@ bool wfx_hw_ready(void)
******************************************************************************/
void wfx_dhcp_got_ipv4(uint32_t ip)
{
/* Acquire the new IP address
/*
* Acquire the new IP address
*/
uint8_t ip4_addr[4];

ip4_addr[0] = (ip) &HEX_VALUE_FF;
ip4_addr[1] = (ip >> 8) & HEX_VALUE_FF;
ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF;
ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF;

ChipLogDetail(DeviceLayer, "DHCP IP=%d.%d.%d.%d", ip4_addr[0], ip4_addr[1], ip4_addr[2], ip4_addr[3]);
sta_ip = ip;

wfx_ip_changed_notify(IP_STATUS_SUCCESS);
}
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
Expand Down
3 changes: 1 addition & 2 deletions src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ static_library("efr32") {

if (use_wf200 || use_rs9116 || use_SiWx917) {
sources += [
"wifi/dhcp_client.cpp",
"wifi/dhcp_client.h",
"${silabs_platform_dir}/wifi/dhcp_client.cpp",
"wifi/ethernetif.cpp",
"wifi/ethernetif.h",
"wifi/lwip_netif.cpp",
Expand Down
150 changes: 0 additions & 150 deletions src/platform/silabs/efr32/wifi/dhcp_client.cpp

This file was deleted.

45 changes: 0 additions & 45 deletions src/platform/silabs/efr32/wifi/dhcp_client.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ uint8_t dhcpclient_poll(void * arg)
if (dhcp_supplied_address(netif))
{
dhcp_state = DHCP_ADDRESS_ASSIGNED;

uint64_t addr = netif->ip_addr.u_addr.ip4.addr;
ChipLogProgress(DeviceLayer, "DHCP IP: %d.%d.%d.%d", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
}
else
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ template("siwx917_sdk") {
}

defines += [ "LWIP_NETIF_API=1" ]
if (lwip_ipv4) {
if (chip_enable_wifi_ipv4) {
defines += [
"LWIP_IPV4=1",

Expand Down
3 changes: 3 additions & 0 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ template("efr32_sdk") {
if (use_rs9116 || use_SiWx917) {
_include_dirs += [ "${chip_root}/src/platform/silabs/rs911x" ]
}
if (use_wf200 || use_rs9116 || use_SiWx917) {
_include_dirs += [ "${chip_root}/src/platform/silabs/wifi" ]
}
if (silabs_family != "mgm24") {
_include_dirs += [
"${efr32_sdk_root}/platform/radio/rail_lib/hal",
Expand Down

0 comments on commit 78830a0

Please sign in to comment.