wifi: conn_mgr connectivity bindings

Bind WiFi network devices to the generic WiFi connectivity backend if
the appropriate option is set.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2024-01-21 21:38:43 +10:00 committed by Anas Nashif
parent 9ff1fcf7e7
commit ef21569ac9
6 changed files with 18 additions and 0 deletions

View file

@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(esp32_wifi, CONFIG_WIFI_LOG_LEVEL);
#include <zephyr/net/net_pkt.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#include <zephyr/device.h>
#include <soc.h>
#include "esp_networking_priv.h"
@ -672,3 +673,5 @@ NET_DEVICE_DT_INST_DEFINE(0,
&esp32_data, NULL, CONFIG_WIFI_INIT_PRIORITY,
&esp32_api, ETHERNET_L2,
NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);
CONNECTIVITY_WIFI_MGMT_BIND(Z_DEVICE_DT_DEV_ID(DT_DRV_INST(0)));

View file

@ -25,6 +25,7 @@ LOG_MODULE_REGISTER(wifi_esp_at, CONFIG_WIFI_LOG_LEVEL);
#include <zephyr/net/net_ip.h>
#include <zephyr/net/net_offload.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#include "esp.h"
@ -1284,6 +1285,8 @@ NET_DEVICE_DT_INST_OFFLOAD_DEFINE(0, esp_init, NULL,
CONFIG_WIFI_INIT_PRIORITY, &esp_api,
ESP_MTU);
CONNECTIVITY_WIFI_MGMT_BIND(Z_DEVICE_DT_DEV_ID(DT_DRV_INST(0)));
static int esp_init(const struct device *dev)
{
#if DT_INST_NODE_HAS_PROP(0, power_gpios) || DT_INST_NODE_HAS_PROP(0, reset_gpios)

View file

@ -23,6 +23,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/net/net_context.h>
#include <zephyr/net/net_offload.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#include <zephyr/net/ethernet.h>
#include <net_private.h>
@ -806,3 +807,5 @@ NET_DEVICE_DT_INST_OFFLOAD_DEFINE(0, eswifi_init, NULL,
CONFIG_WIFI_INIT_PRIORITY,
&eswifi_offload_api,
1500);
CONNECTIVITY_WIFI_MGMT_BIND(Z_DEVICE_DT_DEV_ID(DT_DRV_INST(0)));

View file

@ -12,6 +12,7 @@
#define DT_DRV_COMPAT infineon_airoc_wifi
#include <zephyr/logging/log.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#include <airoc_wifi.h>
LOG_MODULE_REGISTER(infineon_airoc_wifi, CONFIG_WIFI_LOG_LEVEL);
@ -770,3 +771,5 @@ static const struct net_wifi_mgmt_offload airoc_api = {
NET_DEVICE_DT_INST_DEFINE(0, airoc_init, NULL, &airoc_wifi_data, &airoc_wifi_config,
CONFIG_WIFI_INIT_PRIORITY, &airoc_api, ETHERNET_L2,
NET_L2_GET_CTX_TYPE(ETHERNET_L2), WHD_LINK_MTU);
CONNECTIVITY_WIFI_MGMT_BIND(Z_DEVICE_DT_DEV_ID(DT_DRV_INST(0)));

View file

@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/net/net_if.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/net_offload.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#ifdef CONFIG_NET_SOCKETS_OFFLOAD
#include <zephyr/net/socket_offload.h>
#endif
@ -302,3 +303,5 @@ NET_DEVICE_OFFLOAD_INIT(simplelink, CONFIG_WIFI_SIMPLELINK_NAME,
&simplelink_data, NULL,
CONFIG_WIFI_INIT_PRIORITY, &simplelink_api,
CONFIG_WIFI_SIMPLELINK_MAX_PACKET_SIZE);
CONNECTIVITY_WIFI_MGMT_BIND(simplelink);

View file

@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/net/net_context.h>
#include <zephyr/net/net_offload.h>
#include <zephyr/net/wifi_mgmt.h>
#include <zephyr/net/conn_mgr/connectivity_wifi_mgmt.h>
#include <zephyr/sys/printk.h>
@ -1187,3 +1188,5 @@ NET_DEVICE_OFFLOAD_INIT(winc1500, CONFIG_WIFI_WINC1500_NAME,
winc1500_init, NULL, &w1500_data, NULL,
CONFIG_WIFI_INIT_PRIORITY, &winc1500_api,
CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE);
CONNECTIVITY_WIFI_MGMT_BIND(winc1500);