Skip to content

treewide: Align networking code with net_mgmt API change #22993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/serial_lte_modem/src/slm_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static void ppp_work_fn(struct k_work *work)
}

static void ppp_net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_PPP_PHASE_RUNNING:
Expand Down
2 changes: 1 addition & 1 deletion lib/location/scan_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static void scan_wifi_done_handle(struct net_mgmt_event_callback *cb)

void scan_wifi_net_mgmt_event_handler(
struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
ARG_UNUSED(iface);
Expand Down
4 changes: 2 additions & 2 deletions modules/wfa-qt/src/wpas_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ static void handle_wpa_supp_ready(struct net_mgmt_event_callback *cb)
}

static void wpa_supp_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
/* TODO: Handle other events */
switch (mgmt_event) {
case NET_EVENT_SUPPLICANT_READY:
handle_wpa_supp_ready(cb);
break;
default:
LOG_DBG("Unhandled event (%d)", mgmt_event);
LOG_DBG("Unhandled event (%llu)", mgmt_event);
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/cellular/modem_shell/src/ppp/ppp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void ppp_ctrl_restart_worker(struct k_work *work_item)
static struct net_mgmt_event_callback ppp_ctrl_net_if_mgmt_event_ppp_cb;

static void ppp_ctrl_net_if_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
if (net_if_l2(iface) != &NET_L2_GET_NAME(PPP)) {
Expand All @@ -200,7 +200,7 @@ static void ppp_ctrl_net_if_mgmt_event_handler(struct net_mgmt_event_callback *c
static struct net_mgmt_event_callback ppp_ctrl_net_mgmt_event_ppp_cb;

static void ppp_ctrl_net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
switch (mgmt_event) {
Expand Down Expand Up @@ -231,7 +231,7 @@ static void ppp_ctrl_net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
static struct net_mgmt_event_callback ipv4_level_net_mgmt_event_cb;
static void
ppp_ctrl_net_mgmt_event_ipv4_levelhandler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
if (iface != ppp_iface_global) {
Expand All @@ -248,7 +248,7 @@ ppp_ctrl_net_mgmt_event_ipv4_levelhandler(struct net_mgmt_event_callback *cb,
static struct net_mgmt_event_callback ipv6_level_net_mgmt_event_cb;
static void
ppp_ctrl_net_mgmt_event_ipv6_levelhandler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
if (iface != ppp_iface_global) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static bool connect_cloud(void)
*/
static struct net_mgmt_event_callback l4_callback;
static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event, struct net_if *iface)
uint64_t event, struct net_if *iface)
{
if (event == NET_EVENT_L4_CONNECTED) {
LOG_INF("Network connectivity gained!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static K_WORK_DEFINE(start_provisioning_work, start_provisioning_work_fn);
static struct net_mgmt_event_callback l4_callback;

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event, struct net_if *iface)
uint64_t event, struct net_if *iface)
{
if (event == NET_EVENT_L4_CONNECTED) {
/* Mark network as up. */
Expand Down
4 changes: 2 additions & 2 deletions samples/cellular/nrf_cloud_rest_cell_location/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ int init(void)

/* Callback to track network connectivity */
static struct net_mgmt_event_callback l4_callback;
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event,
struct net_if *iface)
{
if ((event & CONN_LAYER_EVENT_MASK) != event) {
Expand All @@ -570,7 +570,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
/* Callback to track connectivity layer events */
static struct net_mgmt_event_callback conn_cb;
static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static int setup(void)

/* Callback to track network connectivity */
static struct net_mgmt_event_callback l4_callback;
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event,
struct net_if *iface)
{
if ((event & EVENT_MASK) != event) {
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/nrf_cloud_rest_fota/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static void sample_reboot(enum nrf_cloud_fota_reboot_status status)

/* Callback to track network connectivity */
static struct net_mgmt_event_callback l4_callback;
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event,
struct net_if *iface)
{
if ((event & EVENT_MASK) != event) {
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/nrf_provisioning/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static K_WORK_DEFINE(start_provisioning_work, start_provisioning_work_fn);
/* Callback to track network connectivity */
static struct net_mgmt_event_callback l4_callback;
static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event, struct net_if *iface)
uint64_t event, struct net_if *iface)
{
if ((event & EVENT_MASK) != event) {
return;
Expand Down
6 changes: 3 additions & 3 deletions samples/debug/memfault/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void on_connect(void)
memfault_zephyr_port_post_data();
}

static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
static void l4_event_handler(struct net_mgmt_event_callback *cb, uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -131,12 +131,12 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
LOG_INF("Network connectivity lost");
break;
default:
LOG_DBG("Unknown event: 0x%08X", event);
LOG_DBG("Unknown event: 0x%08llX", event);
return;
}
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
static void connectivity_event_handler(struct net_mgmt_event_callback *cb, uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void aws_iot_event_handler(const struct aws_iot_evt *const evt)
}

static void l4_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event,
uint64_t mgmt_event,
struct net_if *iface)
{
switch (mgmt_event) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/aws_iot/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static void aws_iot_event_handler(const struct aws_iot_evt *const evt)
}

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -344,7 +344,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/azure_iot_hub/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void on_net_event_l4_disconnected(void)


static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -421,7 +421,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/coap_client/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static int periodic_coap_request_loop(void)
}

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -186,7 +186,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}
}
static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/download/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void on_net_event_l4_connected(void)
}

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -166,7 +166,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
int err;
Expand Down
4 changes: 2 additions & 2 deletions samples/net/http_server/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int tcp6_accepted[MAX_CLIENT_QUEUE];
static struct http_parser_settings parser_settings;

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -139,7 +139,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/https_client/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void on_net_event_l4_connected(void)
}

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -195,7 +195,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/mqtt/src/modules/network/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static struct net_mgmt_event_callback l4_cb;
static struct net_mgmt_event_callback conn_cb;

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
int err;
Expand Down Expand Up @@ -54,7 +54,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/net/udp/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void on_net_event_l4_disconnected(void)
}

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand All @@ -133,7 +133,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
4 changes: 2 additions & 2 deletions samples/wifi/ble_coex/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb)
}

static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_WIFI_CONNECT_RESULT:
Expand Down Expand Up @@ -179,7 +179,7 @@ static void print_dhcp_ip(struct net_mgmt_event_callback *cb)
}

static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_IPV4_DHCP_BOUND:
Expand Down
4 changes: 2 additions & 2 deletions samples/wifi/promiscuous/src/wifi_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb)
}

static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_WIFI_CONNECT_RESULT:
Expand Down Expand Up @@ -153,7 +153,7 @@ static void print_dhcp_ip(struct net_mgmt_event_callback *cb)
}

static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_IPV4_DHCP_BOUND:
Expand Down
4 changes: 2 additions & 2 deletions samples/wifi/provisioning/softap/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static struct net_mgmt_event_callback l4_cb;
static struct net_mgmt_event_callback conn_cb;

static void l4_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
switch (event) {
Expand Down Expand Up @@ -67,7 +67,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
}

static void connectivity_event_handler(struct net_mgmt_event_callback *cb,
uint32_t event,
uint64_t event,
struct net_if *iface)
{
if (event == NET_EVENT_CONN_IF_FATAL_ERROR) {
Expand Down
2 changes: 1 addition & 1 deletion samples/wifi/raw_tx_packet/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static void wifi_send_raw_tx_packets(void)

/* Net iface events handler */
static void net_events_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_IF_UP:
Expand Down
4 changes: 2 additions & 2 deletions samples/wifi/raw_tx_packet/src/wifi_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static void handle_wifi_disconnect_result(struct net_mgmt_event_callback *cb)
}

static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_WIFI_CONNECT_RESULT:
Expand Down Expand Up @@ -153,7 +153,7 @@ static void print_dhcp_ip(struct net_mgmt_event_callback *cb)
}

static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb,
uint32_t mgmt_event, struct net_if *iface)
uint64_t mgmt_event, struct net_if *iface)
{
switch (mgmt_event) {
case NET_EVENT_IPV4_DHCP_BOUND:
Expand Down
Loading
Loading