Skip to content

Commit c97fc36

Browse files
committed
drivers: wifi: nrf7002: Fix formatting and style issues
This commit addresses code formatting and styling issues in the nRF7002 Wi-Fi driver based on review feedback. It includes fixes for inconsistent indentation, spacing, and general cleanup to align with Zephyr's coding guidelines and driver conventions. These changes are non-functional and do not affect the behavior of the driver, but improve code readability and maintainability. Signed-off-by: Signed-off-by: Hanan Arshad <[email protected]>
1 parent d0ace12 commit c97fc36

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

drivers/wifi/nrf_wifi/Kconfig.nrfwifi

+7-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ config NRF70_AP_MODE
8383
default y if WIFI_NM_WPA_SUPPLICANT_AP
8484

8585
config NRF70_WIFI_ENABLE_DUAL_VIF
86-
bool "Enable dual virtual Wi-Fi interfaces"
87-
default y if WIFI_NM_MAX_MANAGED_INTERFACES = 2
88-
default n
89-
depends on WIFI_NRF7002 && NET_L2_ETHERNET
90-
help
91-
Enable support for two virtual Wi-Fi interfaces (VIFs).
92-
When enabled, the driver can operate two VIFs simultaneously,
93-
allowing use cases such as one interface in AP mode and another in STA mode.
86+
bool "Dual virtual Wi-Fi interfaces"
87+
default y if WIFI_NM_MAX_MANAGED_INTERFACES = 2
88+
depends on WIFI_NRF7002 && NET_L2_ETHERNET
89+
help
90+
Enable support for two virtual Wi-Fi interfaces (VIFs).
91+
When enabled, the driver can operate two VIFs simultaneously,
92+
allowing use cases such as one interface in AP mode and another in STA mode.
9493

9594
config NRF70_P2P_MODE
9695
bool "P2P support in driver"

drivers/wifi/nrf_wifi/src/fmac_main.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,12 @@ void nrf_wifi_event_proc_cookie_rsp(void *vif_ctx,
446446
cookie_rsp_event->mac_addr[5]);
447447

448448
/* Notify all vif */
449-
for(int idx = 0; idx < vif_ctx_cnt; ++idx) {
449+
for (int idx = 0; idx < vif_ctx_cnt; ++idx) {
450450
vif_ctx_zep = nrf_wifi_get_vif_ctx_by_idx(idx);
451-
if(vif_ctx_zep)
451+
if (vif_ctx_zep) {
452452
vif_ctx_zep->cookie_resp_received = true;
453-
}
453+
}
454+
}
454455
/* TODO: When supp_callbk_fns.mgmt_tx_status is implemented, add logic
455456
* here to use the cookie and host_cookie to map requests to responses.
456457
*/
@@ -726,13 +727,13 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
726727
struct nrf_wifi_ctx_zep *rpu_ctx_zep = &rpu_drv_priv_zep.rpu_ctx_zep;
727728
unsigned int vif_ctx_cnt = nrf_wifi_fmac_get_num_vifs(rpu_ctx_zep->rpu_ctx);
728729

729-
if(vif_ctx_cnt >= MAX_NUM_VIFS){
730+
if (vif_ctx_cnt >= MAX_NUM_VIFS) {
730731
LOG_ERR("%s: Max number of VIFs reached", __func__);
731732
return -ENOMEM;
732733
}
733734

734735
if (vif_ctx_cnt > 1) {
735-
// FMAC is already initialized for VIF-0
736+
/* FMAC is already initialized for VIF-0 */
736737
return 0;
737738
}
738739

@@ -962,11 +963,11 @@ ETH_NET_DEVICE_DT_INST_DEFINE(0,
962963
&wifi_offload_ops, /* api */
963964
CONFIG_NRF_WIFI_IFACE_MTU); /*mtu */
964965
#ifdef CONFIG_NRF70_WIFI_ENABLE_DUAL_VIF
965-
// Register second interface
966+
/* Register second interface */
966967
ETH_NET_DEVICE_DT_INST_DEFINE(1,
967-
nrf_wifi_drv_main_zep, /* init_fn */
968-
NULL, /* pm_action_cb */
969-
&rpu_drv_priv_zep.rpu_ctx_zep.vif_ctx_zep[1], /* data */
968+
nrf_wifi_drv_main_zep, /* init_fn */
969+
NULL, /* pm_action_cb */
970+
&rpu_drv_priv_zep.rpu_ctx_zep.vif_ctx_zep[1], /* data */
970971
#ifdef CONFIG_NRF70_STA_MODE
971972
&wpa_supp_ops, /* cfg */
972973
#else /* CONFIG_NRF70_STA_MODE */

drivers/wifi/nrf_wifi/src/net_if.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ void nrf_wifi_set_iface_event_handler(void *os_vif_ctx,
6363
vif_ctx_cnt = nrf_wifi_fmac_get_num_vifs(rpu_ctx_zep->rpu_ctx);
6464

6565
/* Notify all vif */
66-
for(int idx = 0; idx < vif_ctx_cnt; ++idx) {
66+
for (int idx = 0; idx < vif_ctx_cnt; ++idx) {
6767
vif_ctx_zep = nrf_wifi_get_vif_ctx_by_idx(idx);
68-
if(vif_ctx_zep)
69-
{
68+
if (vif_ctx_zep) {
7069
vif_ctx_zep->set_if_event_received = true;
7170
vif_ctx_zep->set_if_status = event->return_value;
7271
}

drivers/wifi/nrf_wifi/src/wpa_supp_if.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ void *nrf_wifi_wpa_supp_dev_init(void *supp_drv_if_ctx, const char *iface_name,
443443
struct zep_wpa_supp_dev_callbk_fns *supp_callbk_fns)
444444
{
445445
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
446-
// Get device for Each interface
447-
const int if_idx = net_if_get_by_name(iface_name);
446+
/* Get device for Each interface */
447+
int if_idx = net_if_get_by_name(iface_name);
448448
struct net_if* iface = net_if_get_by_index(if_idx);
449449
const struct device *device = net_if_get_device(iface);
450450

0 commit comments

Comments
 (0)