Skip to content

Commit 4b83b23

Browse files
jukkarfabiobaltieri
authored andcommitted
hostap: Use proper value when generating supplicant event
The previous NET_EVENT_SUPPLICANT_CMD_INT_EVENT is from "enum net_event_supplicant_cmd" but the supplicant_send_wifi_mgmt_event() has the event parameter as an "enum net_event_wifi_cmd" and those event number spaces are different. This meant that the wrong event value NET_EVENT_SUPPLICANT_CMD_INT_EVENT maps to NET_EVENT_WIFI_CMD_TWT (from "enum net_event_wifi_cmd") which fortunately did not cause issue in this case because the supplicant_send_wifi_mgmt_event() has no handling for this TWT event value. It is important we fix this as this can cause great confusion in the future. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent d403d73 commit 4b83b23

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ enum net_event_wifi_cmd {
288288
NET_EVENT_WIFI_CMD_AP_STA_CONNECTED,
289289
/** STA disconnected from AP */
290290
NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED,
291+
/** Supplicant specific event */
292+
NET_EVENT_WIFI_CMD_SUPPLICANT,
291293
};
292294

293295
/** Event emitted for Wi-Fi scan result */

modules/hostap/src/supp_events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ int supplicant_send_wifi_mgmt_event(const char *ifname, enum net_event_wifi_cmd
386386
(struct wifi_ap_sta_info *)supplicant_status);
387387
break;
388388
#endif /* CONFIG_AP */
389-
case NET_EVENT_SUPPLICANT_CMD_INT_EVENT:
389+
case NET_EVENT_WIFI_CMD_SUPPLICANT:
390390
event_data.data = &data;
391391
if (supplicant_process_status(&event_data, (char *)supplicant_status) > 0) {
392392
net_mgmt_event_notify_with_info(NET_EVENT_SUPPLICANT_INT_EVENT,

0 commit comments

Comments
 (0)