Migration issue 2.7.0 -> 2.9.0 with NET_EVENT_WPA_SUPP_IFACE_ADDED

Hi,

The following code : 

net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_WPA_SUPP_IFACE_ADDED);
net_mgmt_add_event_callback(&sWifiInitCb);

Was working fine in 2.7.0. The callback was called and the event was NET_EVENT_WPA_SUPP_IFACE_ADDED. It is declared in nrf/blabla/supp_events.h but in 2.9.0, this file doesn't exist anymore.

The migration guide tells that WPA_SUPP is replaced by WIFI_NM_WPA_SUPPLICANT but NET_EVENT_WIFI_NM_WPA_SUPPLICANT_IFACE_ADDED doesn't exist. I modified the code as the following : 

	net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_SUPPLICANT_IFACE_ADDED);
	net_mgmt_add_event_callback(&sWifiInitCb);

NET_EVENT_SUPPLICANT_IFACE_ADDED is declared in zephyr/blabla/supp_events.h but the callback is not executed anymore. 

How do I fix this? 

Thank you for your help

Parents
  • Hi again Benoit

    Can you explain what you mean by the "callback isn't executed anymore"? In the latest versions of NCS, the calls to IFACE_ADDED are a little bit different than SDK v2.7.0. In supp_events.c and supp_main.c there are events that generate the NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED callback. The Wi-Fi WPA supplicant was switched to Zephyr upstream's fork instead of nRF Connect SDK, and the WPA supplicant now uses kernel heap instead of the application (libc) heap.

    Best regards,

    Simon

  • Hi,

    Can you explain what you mean by the "callback isn't executed anymore"?

    Well, this piece of code : 

    net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_WPA_SUPP_IFACE_ADDED);
    net_mgmt_add_event_callback(&sWifiInitCb);

    Was used to register wifi_wpa_supp_iface_added_cb as a callback in reaction to the event_mask NET_WPA_SUPP_IFACE_ADDED. This event doesn't exist in 2.9.0. I tried to find an equivalent: NET_EVENT_SUPPLICANT_IFACE_ADDED. But with this event, wifi_wpa_supp_iface_added_cb is not executed anymore. In means that if I put a breakpoint within wifi_wpa_supp_iface_added_cb : 

    -in 2.7.0 the program stopsand the event is actually NET_EVENT_WPA_SUPP_IFACE_ADDED, which is good, everything works as expected

    -in 2.9.0, with NET_EVENT_SUPPLICANT_IFACE_ADDED, the program doesn't stops anymore within wifi_wpa_supp_iface_added_cb. It means wifi_wpa_supp_iface_added_cb was not executed.

    In supp_events.c and supp_main.c there are events that generate the NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED callback.

    I don't understand, as NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED is defined in supp_events.h as an enum, and not a callback. 

    The Wi-Fi WPA supplicant was switched to Zephyr upstream's fork instead of nRF Connect SDK, and the WPA supplicant now uses kernel heap instead of the application (libc) heap.

    Sorry, I don't understand how to use this info to fix my issue.

    net_mgmt_init_event_callback is part of zephyr, which I suppose is probably aware that WPA supplicant is now using its kernel heap, so it would be expected to work seemless as long as the right enum is given to net_mgmt_init_event_callback right? 

    To be short, what is the way to migrate this piece of code from 2.7.0 to 2.9.0?: 

    net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_WPA_SUPP_IFACE_ADDED);
    net_mgmt_add_event_callback(&sWifiInitCb);

    Thank you for your help

    Best regards

Reply
  • Hi,

    Can you explain what you mean by the "callback isn't executed anymore"?

    Well, this piece of code : 

    net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_WPA_SUPP_IFACE_ADDED);
    net_mgmt_add_event_callback(&sWifiInitCb);

    Was used to register wifi_wpa_supp_iface_added_cb as a callback in reaction to the event_mask NET_WPA_SUPP_IFACE_ADDED. This event doesn't exist in 2.9.0. I tried to find an equivalent: NET_EVENT_SUPPLICANT_IFACE_ADDED. But with this event, wifi_wpa_supp_iface_added_cb is not executed anymore. In means that if I put a breakpoint within wifi_wpa_supp_iface_added_cb : 

    -in 2.7.0 the program stopsand the event is actually NET_EVENT_WPA_SUPP_IFACE_ADDED, which is good, everything works as expected

    -in 2.9.0, with NET_EVENT_SUPPLICANT_IFACE_ADDED, the program doesn't stops anymore within wifi_wpa_supp_iface_added_cb. It means wifi_wpa_supp_iface_added_cb was not executed.

    In supp_events.c and supp_main.c there are events that generate the NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED callback.

    I don't understand, as NET_EVENT_SUPPLICANT_CMD_IFACE_ADDED is defined in supp_events.h as an enum, and not a callback. 

    The Wi-Fi WPA supplicant was switched to Zephyr upstream's fork instead of nRF Connect SDK, and the WPA supplicant now uses kernel heap instead of the application (libc) heap.

    Sorry, I don't understand how to use this info to fix my issue.

    net_mgmt_init_event_callback is part of zephyr, which I suppose is probably aware that WPA supplicant is now using its kernel heap, so it would be expected to work seemless as long as the right enum is given to net_mgmt_init_event_callback right? 

    To be short, what is the way to migrate this piece of code from 2.7.0 to 2.9.0?: 

    net_mgmt_init_event_callback(&sWifiInitCb, wifi_wpa_supp_iface_added_cb, NET_EVENT_WPA_SUPP_IFACE_ADDED);
    net_mgmt_add_event_callback(&sWifiInitCb);

    Thank you for your help

    Best regards

Children
No Data
Related