Skip to content

Commit

Permalink
drivers: siwx917_wifi: Update net_context state
Browse files Browse the repository at this point in the history
The Zephyr stack does not update net_context state when
CONFIG_NET_OFFLOAD=y. However, this field is still used in some
not-offloaded operations (eg. poll()).

So, update net_context state manually.

Reported-by: Tibor Laczko <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
  • Loading branch information
jerome-pouiller committed Sep 25, 2024
1 parent 5c639ba commit 87d2386
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/wifi/siwx917/siwx917_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ static int siwx917_sock_connect(struct net_context *context,
SL_SI91X_FD_SET(sockfd, &sidev->fds_watch);
sl_si91x_select(NUMBER_OF_BSD_SOCKETS, &sidev->fds_watch, NULL, NULL, NULL,
siwx917_sock_on_recv);
net_context_set_state(context, NET_CONTEXT_CONNECTED);
if (cb) {
cb(context, ret, user_data);
}
Expand All @@ -473,6 +474,7 @@ static int siwx917_sock_listen(struct net_context *context, int backlog)
if (ret) {
return -errno;
}
net_context_set_state(context, NET_CONTEXT_LISTENING);
return 0;
}

Expand Down

0 comments on commit 87d2386

Please sign in to comment.