hostapd: Use dedicated WPA supplicant workqueue

This should solve latency issues with using system workqueue and can now
closely implement the configured timeout.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2023-10-11 00:56:29 +05:30 committed by Alberto Escolar
parent 68fb2e97ae
commit 65ebae81dc
2 changed files with 9 additions and 2 deletions

View File

@ -43,6 +43,7 @@ enum status_thread_state {
K_MUTEX_DEFINE(wpa_supplicant_mutex);
extern struct k_work_q *get_workq(void);
struct wpa_supp_api_ctrl {
const struct device *dev;
@ -164,7 +165,8 @@ static void supp_shell_connect_status(struct k_work *work)
goto out;
}
k_work_reschedule(&wpa_supp_status_work, K_SECONDS(OP_STATUS_POLLING_INTERVAL));
k_work_reschedule_for_queue(get_workq(), &wpa_supp_status_work,
K_SECONDS(OP_STATUS_POLLING_INTERVAL));
ctrl->status_thread_state = STATUS_THREAD_RUNNING;
k_mutex_unlock(&wpa_supplicant_mutex);
return;
@ -184,7 +186,7 @@ static inline void wpa_supp_restart_status_work(void)
wpas_api_ctrl.terminate = 0;
/* Start afresh */
k_work_reschedule(&wpa_supp_status_work, K_MSEC(10));
k_work_reschedule_for_queue(get_workq(), &wpa_supp_status_work, K_MSEC(10));
}
static inline int chan_to_freq(int chan)

View File

@ -86,6 +86,11 @@ struct wpa_global *zephyr_get_default_supplicant_context(void)
return get_default_context()->supplicant;
}
struct k_work_q *get_workq(void)
{
return &get_default_context()->iface_wq;
}
int zephyr_wifi_send_event(const struct wpa_supplicant_event_msg *msg)
{
struct supplicant_context *ctx;