Skip to content

Commit 9c43c13

Browse files
krish2718bjarki-andreasen
authored andcommitted
[nrf fromlist] modules: hostap: Use net_mgmt context
Using a separate workqueue causes issues without any special locking to synchronize with networking threads e.g., interface being removed while the workqueue is trying to synchronize with WPA supplicant. It's easier to use the net_mgmt thread which is in better sync with networking. Upstream PR: zephyrproject-rtos/zephyr#79231 Signed-off-by: Chaitanya Tata <[email protected]>
1 parent d7b5410 commit 9c43c13

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

modules/hostap/src/supp_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,6 @@ static void submit_iface_work(struct supplicant_context *ctx,
475475
static void interface_handler(struct net_mgmt_event_callback *cb,
476476
uint32_t mgmt_event, struct net_if *iface)
477477
{
478-
struct supplicant_context *ctx = CONTAINER_OF(cb, struct supplicant_context,
479-
cb);
480-
481478
if ((mgmt_event & INTERFACE_EVENT_MASK) != mgmt_event) {
482479
return;
483480
}
@@ -490,13 +487,13 @@ static void interface_handler(struct net_mgmt_event_callback *cb,
490487

491488
if (mgmt_event == NET_EVENT_IF_ADMIN_UP) {
492489
LOG_INF("Network interface %d (%p) up", net_if_get_by_iface(iface), iface);
493-
submit_iface_work(ctx, iface, add_interface);
490+
add_interface(get_default_context(), iface);
494491
return;
495492
}
496493

497494
if (mgmt_event == NET_EVENT_IF_ADMIN_DOWN) {
498495
LOG_INF("Network interface %d (%p) down", net_if_get_by_iface(iface), iface);
499-
submit_iface_work(ctx, iface, del_interface);
496+
del_interface(get_default_context(), iface);
500497
return;
501498
}
502499
}

0 commit comments

Comments
 (0)