Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
wifi_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Intel Corporation.
3 * Copyright 2024 NXP
4 * Copyright (c) 2024 Nordic Semiconductor ASA
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
13
14#ifndef ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
15#define ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
16
17#include <zephyr/net/net_mgmt.h>
18#include <zephyr/net/wifi.h>
19#include <zephyr/net/ethernet.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30
31/* Management part definitions */
32
34
35#define NET_WIFI_LAYER NET_MGMT_LAYER_L2
36#define NET_WIFI_CODE NET_MGMT_LAYER_CODE_WIFI
37#define NET_WIFI_BASE (NET_MGMT_IFACE_BIT | \
38 NET_MGMT_LAYER(NET_WIFI_LAYER) | \
39 NET_MGMT_LAYER_CODE(NET_WIFI_CODE))
40#define NET_WIFI_EVENT (NET_WIFI_BASE | NET_MGMT_EVENT_BIT)
41
42#ifdef CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX
43#define WIFI_MGMT_SCAN_SSID_FILT_MAX CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX
44#else
45#define WIFI_MGMT_SCAN_SSID_FILT_MAX 1
46#endif /* CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX */
47
48#ifdef CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL
49#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL
50#else
51#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL 1
52#endif /* CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL */
53
54#ifdef CONFIG_WIFI_ENT_IDENTITY_MAX_USERS
55#define WIFI_ENT_IDENTITY_MAX_USERS CONFIG_WIFI_ENT_IDENTITY_MAX_USERS
56#else
57#define WIFI_ENT_IDENTITY_MAX_USERS 1
58#endif /* CONFIG_WIFI_ENT_IDENTITY_MAX_USERS */
59
60#define WIFI_MGMT_BAND_STR_SIZE_MAX 8
61#define WIFI_MGMT_SCAN_MAX_BSS_CNT 65535
62
63#define WIFI_MGMT_SKIP_INACTIVITY_POLL IS_ENABLED(CONFIG_WIFI_MGMT_AP_STA_SKIP_INACTIVITY_POLL)
64
65#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
66#define WIFI_NAN_MAX_SSI_LEN 128
67#define WIFI_NAN_MAX_SERVICE_NAME_LEN 64
68#define WIFI_NAN_RESP_SIZE 64
69#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
71
134#ifdef CONFIG_WIFI_CREDENTIALS_CONNECT_STORED
136 NET_REQUEST_WIFI_CMD_CONNECT_STORED,
137#endif
153 NET_REQUEST_WIFI_CMD_MAX
155};
156
158#define NET_REQUEST_WIFI_SCAN \
159 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN)
160
162
164#define NET_REQUEST_WIFI_CONNECT \
165 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT)
166
168
170#define NET_REQUEST_WIFI_DISCONNECT \
171 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT)
172
174
176#define NET_REQUEST_WIFI_AP_ENABLE \
177 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE)
178
180
182#define NET_REQUEST_WIFI_AP_DISABLE \
183 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE)
184
186
188#define NET_REQUEST_WIFI_AP_RTS_THRESHOLD \
189 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_RTS_THRESHOLD)
190
192
194#define NET_REQUEST_WIFI_IFACE_STATUS \
195 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS)
196
198
199#define NET_REQUEST_WIFI_11K_CONFIG \
200 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_11K_CONFIG)
201
203
204#define NET_REQUEST_WIFI_11K_NEIGHBOR_REQUEST \
205 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_11K_NEIGHBOR_REQUEST)
206
208
210#define NET_REQUEST_WIFI_PS \
211 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS)
212
214
216#define NET_REQUEST_WIFI_TWT \
217 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT)
218
220
221#define NET_REQUEST_WIFI_BTWT \
222 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BTWT)
223
225
227#define NET_REQUEST_WIFI_PS_CONFIG \
228 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG)
229
231
233#define NET_REQUEST_WIFI_REG_DOMAIN \
234 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN)
235
237
239#define NET_REQUEST_WIFI_MODE \
240 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_MODE)
241
243
245#define NET_REQUEST_WIFI_PACKET_FILTER \
246 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PACKET_FILTER)
247
249
251#define NET_REQUEST_WIFI_CHANNEL \
252 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CHANNEL)
253
255
257#define NET_REQUEST_WIFI_AP_STA_DISCONNECT \
258 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT)
259
261
263#define NET_REQUEST_WIFI_VERSION \
264 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_VERSION)
265
267
269#define NET_REQUEST_WIFI_CONN_PARAMS \
270 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONN_PARAMS)
271
273
275#define NET_REQUEST_WIFI_RTS_THRESHOLD \
276 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_RTS_THRESHOLD)
277
279
281#define NET_REQUEST_WIFI_AP_CONFIG_PARAM \
282 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_CONFIG_PARAM)
283
285
287#define NET_REQUEST_WIFI_CONFIG_PARAM \
288 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONFIG_PARAM)
289
291
292#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
294#define NET_REQUEST_WIFI_DPP \
295 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DPP)
296
297NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP);
298#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
299
300#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
302#define NET_REQUEST_WIFI_NAN \
303 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_NAN)
304
305NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NAN);
306#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
307
309#define NET_REQUEST_WIFI_BTM_QUERY (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BTM_QUERY)
310
312
314#define NET_REQUEST_WIFI_PMKSA_FLUSH \
315 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PMKSA_FLUSH)
316
318
320#define NET_REQUEST_WIFI_ENTERPRISE_CREDS \
321 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_ENTERPRISE_CREDS)
322
324
326#define NET_REQUEST_WIFI_RTS_THRESHOLD_CONFIG \
327 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_RTS_THRESHOLD_CONFIG)
328
330
331#define NET_REQUEST_WIFI_WPS_CONFIG (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_WPS_CONFIG)
332
334#ifdef CONFIG_WIFI_CREDENTIALS_CONNECT_STORED
335#define NET_REQUEST_WIFI_CONNECT_STORED (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT_STORED)
336
337NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_CONNECT_STORED);
338#endif
339
340#define NET_REQUEST_WIFI_START_ROAMING \
341 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_START_ROAMING)
342
344
345#define NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE \
346 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_NEIGHBOR_REP_COMPLETE)
347
349
350#define NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD \
351 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD)
352
354
355#define NET_REQUEST_WIFI_BGSCAN \
356 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BGSCAN)
357
359
360#define NET_REQUEST_WIFI_P2P_OPER \
361 (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_P2P_OPER)
362
364
366
367enum {
368 NET_EVENT_WIFI_CMD_SCAN_RESULT_VAL,
369 NET_EVENT_WIFI_CMD_SCAN_DONE_VAL,
370 NET_EVENT_WIFI_CMD_CONNECT_RESULT_VAL,
371 NET_EVENT_WIFI_CMD_DISCONNECT_RESULT_VAL,
372 NET_EVENT_WIFI_CMD_IFACE_STATUS_VAL,
373 NET_EVENT_WIFI_CMD_TWT_VAL,
374 NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE_VAL,
375 NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT_VAL,
376 NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE_VAL,
377 NET_EVENT_WIFI_CMD_SIGNAL_CHANGE_VAL,
378 NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED_VAL,
379 NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE_VAL,
380 NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT_VAL,
381 NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT_VAL,
382 NET_EVENT_WIFI_CMD_AP_STA_CONNECTED_VAL,
383 NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED_VAL,
384 NET_EVENT_WIFI_CMD_SUPPLICANT_VAL,
385 NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND_VAL,
386 NET_EVENT_WIFI_CMD_NAN_DISCOVERY_RESULT_VAL,
387 NET_EVENT_WIFI_CMD_NAN_REPLIED_VAL,
388 NET_EVENT_WIFI_CMD_NAN_PUBLISH_TERMINATED_VAL,
389 NET_EVENT_WIFI_CMD_NAN_SUBSCRIBE_TERMINATED_VAL,
390 NET_EVENT_WIFI_CMD_NAN_RECEIVE_VAL,
391
392 NET_EVENT_WIFI_CMD_MAX,
393};
394
395BUILD_ASSERT(NET_EVENT_WIFI_CMD_MAX <= NET_MGMT_MAX_COMMANDS,
396 "Number of events in net_event_wifi_cmd exceeds the limit");
397
399
403 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SCAN_RESULT),
405 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SCAN_DONE),
407 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_CONNECT_RESULT),
409 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_DISCONNECT_RESULT),
411 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_IFACE_STATUS),
413 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_TWT),
417 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE),
419 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT),
421 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE),
423 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SIGNAL_CHANGE),
425 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED),
427 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE),
429 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT),
431 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT),
433 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_CONNECTED),
435 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED),
437 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SUPPLICANT),
439 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND),
440#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
442 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NAN_DISCOVERY_RESULT),
444 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NAN_REPLIED),
446 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NAN_PUBLISH_TERMINATED),
448 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NAN_SUBSCRIBE_TERMINATED),
450 NET_MGMT_CMD(NET_EVENT_WIFI_CMD_NAN_RECEIVE),
451#endif
452};
453
455#define NET_EVENT_WIFI_SCAN_RESULT \
456 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT)
457
459#define NET_EVENT_WIFI_SCAN_DONE \
460 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE)
461
463#define NET_EVENT_WIFI_CONNECT_RESULT \
464 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT)
465
467#define NET_EVENT_WIFI_DISCONNECT_RESULT \
468 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT)
469
471#define NET_EVENT_WIFI_IFACE_STATUS \
472 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS)
473
475#define NET_EVENT_WIFI_TWT \
476 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT)
477
479#define NET_EVENT_WIFI_TWT_SLEEP_STATE \
480 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE)
481
483#define NET_EVENT_WIFI_RAW_SCAN_RESULT \
484 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT)
485
487#define NET_EVENT_WIFI_DISCONNECT_COMPLETE \
488 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE)
489
491#define NET_EVENT_WIFI_SIGNAL_CHANGE \
492 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SIGNAL_CHANGE)
493
495#define NET_EVENT_WIFI_NEIGHBOR_REP_COMP \
496 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NEIGHBOR_REP_COMPLETE)
497
499#define NET_EVENT_WIFI_AP_ENABLE_RESULT \
500 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT)
501
503#define NET_EVENT_WIFI_AP_DISABLE_RESULT \
504 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT)
505
507#define NET_EVENT_WIFI_AP_STA_CONNECTED \
508 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_CONNECTED)
509
511#define NET_EVENT_WIFI_AP_STA_DISCONNECTED \
512 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED)
513
515#define NET_EVENT_WIFI_P2P_DEVICE_FOUND \
516 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND)
517
518#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P
520#define WIFI_P2P_DEVICE_NAME_MAX_LEN 32
522#define WIFI_P2P_PRI_DEV_TYPE_SIZE 8
524#define WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN 32
526#define WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN 16
528#define WIFI_P2P_MANUFACTURER_MAX_LEN 64
530#define WIFI_P2P_MODEL_NAME_MAX_LEN 32
531
533struct wifi_p2p_device_info {
537 char device_name[WIFI_P2P_DEVICE_NAME_MAX_LEN + 1];
539 uint8_t pri_dev_type[WIFI_P2P_PRI_DEV_TYPE_SIZE];
541 char pri_dev_type_str[WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN];
543 int8_t rssi;
545 uint16_t config_methods;
547 char config_methods_str[WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN];
549 uint8_t dev_capab;
551 uint8_t group_capab;
553 char manufacturer[WIFI_P2P_MANUFACTURER_MAX_LEN + 1];
555 char model_name[WIFI_P2P_MODEL_NAME_MAX_LEN + 1];
556};
557#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */
558
559#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
561#define NET_EVENT_WIFI_NAN_DISCOVERY_RESULT \
562 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NAN_DISCOVERY_RESULT)
563
565#define NET_EVENT_WIFI_NAN_REPLIED \
566 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NAN_REPLIED)
567
569#define NET_EVENT_WIFI_NAN_PUBLISH_TERMINATED \
570 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NAN_PUBLISH_TERMINATED)
571
573#define NET_EVENT_WIFI_NAN_SUBSCRIBE_TERMINATED \
574 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NAN_SUBSCRIBE_TERMINATED)
575
577#define NET_EVENT_WIFI_NAN_RECEIVE \
578 (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_NAN_RECEIVE)
579#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
580
584 const char *drv_version;
586 const char *fw_version;
587};
588
598
650
676
867
883
886
908
922
960
987
988#define WIFI_BTWT_AGREEMENT_MAX 5
989
1001
1068
1070
1071/* Flow ID is only 3 bits */
1072#define WIFI_MAX_TWT_FLOWS 8
1073/* The TWT interval is encoded per IEEE 802.11 as mantissa * 2^exponent
1074 * micro-seconds, with a 16-bit mantissa and a 5-bit exponent. The maximum
1075 * representable interval is therefore UINT16_MAX * 2^WIFI_MAX_TWT_EXPONENT us.
1076 */
1077#define WIFI_MAX_TWT_EXPONENT 31
1078#define WIFI_MAX_TWT_INTERVAL_US ((uint64_t)UINT16_MAX << WIFI_MAX_TWT_EXPONENT)
1079/* 256 (u8) * 1TU */
1080#define WIFI_MAX_TWT_WAKE_INTERVAL_US 262144
1081#define WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US (LONG_MAX - 1)
1082
1084
1108
1148
1158
1166
1176
1178#define MAX_REG_CHAN_NUM 42
1179
1183 unsigned short center_frequency;
1185 unsigned short max_power:8;
1187 unsigned short supported:1;
1189 unsigned short passive_only:1;
1191 unsigned short dfs:1;
1192} __packed;
1193
1209
1217
1218#if defined(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS) || defined(__DOXYGEN__)
1226 unsigned short frequency;
1228 uint8_t data[CONFIG_WIFI_MGMT_RAW_SCAN_RESULT_LENGTH];
1229};
1230#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
1231
1243
1244#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
1246struct wifi_nan_discovery_result_event {
1248 uint8_t subscribe_id;
1250 uint8_t publish_id;
1252 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1254 bool fsd;
1256 bool fsd_gas;
1258 uint8_t srv_proto_type;
1260 size_t ssi_len;
1262 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1263};
1264
1266struct wifi_nan_replied_event {
1268 uint8_t publish_id;
1270 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1272 uint8_t subscribe_id;
1274 uint8_t srv_proto_type;
1276 size_t ssi_len;
1278 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1279};
1280
1282struct wifi_nan_terminated_event {
1284 uint8_t id;
1286 char reason[32];
1287};
1288
1290struct wifi_nan_receive_event {
1292 uint8_t id;
1294 uint8_t peer_instance_id;
1296 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1298 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1300 size_t ssi_len;
1301};
1302#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
1303
1305
1306/* for use in max info size calculations */
1307union wifi_mgmt_events {
1308 struct wifi_scan_result scan_result;
1309 struct wifi_status connect_status;
1310 struct wifi_iface_status iface_status;
1311#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
1312 struct wifi_raw_scan_result raw_scan_result;
1313#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
1314 struct wifi_twt_params twt_params;
1315 struct wifi_ap_sta_info ap_sta_info;
1316#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P
1317 struct wifi_p2p_device_info p2p_device_info;
1318#endif
1319#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
1320 struct wifi_nan_discovery_result_event nan_discovery_result;
1321 struct wifi_nan_replied_event nan_replied;
1322 struct wifi_nan_terminated_event nan_publish_terminated;
1323 struct wifi_nan_terminated_event nan_subscribe_terminated;
1324 struct wifi_nan_receive_event nan_receive;
1325#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
1326};
1327
1329
1339
1351
1366
1368#define WIFI_AP_STA_MAX_INACTIVITY (LONG_MAX - 1)
1369#define WIFI_AP_IEEE_80211_CAPAB_MAX_LEN 64
1371
1382#if defined(CONFIG_WIFI_NM_HOSTAPD_AP)
1384 char ht_capab[WIFI_AP_IEEE_80211_CAPAB_MAX_LEN + 1];
1386 char vht_capab[WIFI_AP_IEEE_80211_CAPAB_MAX_LEN + 1];
1387#endif
1388};
1389
1397
1398#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
1401#define WIFI_DPP_QRCODE_MAX_LEN 255
1402
1404enum wifi_dpp_op {
1406 WIFI_DPP_OP_INVALID = 0,
1408 WIFI_DPP_CONFIGURATOR_ADD,
1410 WIFI_DPP_AUTH_INIT,
1412 WIFI_DPP_QR_CODE,
1414 WIFI_DPP_CHIRP,
1416 WIFI_DPP_LISTEN,
1418 WIFI_DPP_BOOTSTRAP_GEN,
1420 WIFI_DPP_BOOTSTRAP_GET_URI,
1422 WIFI_DPP_SET_CONF_PARAM,
1424 WIFI_DPP_SET_WAIT_RESP_TIME,
1426 WIFI_DPP_RECONFIG
1427};
1428
1430enum wifi_dpp_curves {
1432 WIFI_DPP_CURVES_DEFAULT = 0,
1434 WIFI_DPP_CURVES_P_256,
1436 WIFI_DPP_CURVES_P_384,
1438 WIFI_DPP_CURVES_P_512,
1440 WIFI_DPP_CURVES_BP_256,
1442 WIFI_DPP_CURVES_BP_384,
1444 WIFI_DPP_CURVES_BP_512
1445};
1446
1448enum wifi_dpp_role {
1450 WIFI_DPP_ROLE_UNSET = 0,
1452 WIFI_DPP_ROLE_CONFIGURATOR,
1454 WIFI_DPP_ROLE_ENROLLEE,
1456 WIFI_DPP_ROLE_EITHER
1457};
1458
1463enum wifi_dpp_conf {
1465 WIFI_DPP_CONF_UNSET = 0,
1467 WIFI_DPP_CONF_STA,
1469 WIFI_DPP_CONF_AP,
1471 WIFI_DPP_CONF_QUERY
1472};
1473
1478enum wifi_dpp_bootstrap_type {
1480 WIFI_DPP_BOOTSTRAP_TYPE_UNSET = 0,
1482 WIFI_DPP_BOOTSTRAP_TYPE_QRCODE,
1484 WIFI_DPP_BOOTSTRAP_TYPE_PKEX,
1486 WIFI_DPP_BOOTSTRAP_TYPE_NFC_URI
1487};
1488
1490struct wifi_dpp_configurator_add_params {
1492 int curve;
1494 int net_access_key_curve;
1495};
1496
1498struct wifi_dpp_auth_init_params {
1500 int peer;
1502 int configurator;
1504 int role;
1506 int conf;
1508 char ssid[WIFI_SSID_MAX_LEN + 1];
1509};
1510
1512struct wifi_dpp_chirp_params {
1514 int id;
1516 int freq;
1517};
1518
1520struct wifi_dpp_listen_params {
1522 int freq;
1524 int role;
1525};
1526
1528struct wifi_dpp_bootstrap_gen_params {
1530 int type;
1532 int op_class;
1534 int chan;
1536 int curve;
1539};
1540
1542struct wifi_dpp_configurator_set_params {
1544 int peer;
1546 int configurator;
1548 int role;
1550 int conf;
1552 int curve;
1554 int net_access_key_curve;
1556 char ssid[WIFI_SSID_MAX_LEN + 1];
1557};
1558
1561struct wifi_dpp_params {
1563 int action;
1564 union {
1566 struct wifi_dpp_configurator_add_params configurator_add;
1568 struct wifi_dpp_auth_init_params auth_init;
1570 struct wifi_dpp_chirp_params chirp;
1572 struct wifi_dpp_listen_params listen;
1574 struct wifi_dpp_bootstrap_gen_params bootstrap_gen;
1576 struct wifi_dpp_configurator_set_params configurator_set;
1578 int id;
1580 int dpp_resp_wait_time;
1582 int network_id;
1584 uint8_t dpp_qr_code[WIFI_DPP_QRCODE_MAX_LEN + 1];
1589 char resp[WIFI_DPP_QRCODE_MAX_LEN + 1];
1590 };
1591};
1592#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
1593
1594#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
1596enum wifi_nan_operation {
1597 WIFI_NAN_OP_PUBLISH,
1598 WIFI_NAN_OP_CANCEL_PUBLISH,
1599 WIFI_NAN_OP_UPDATE_PUBLISH,
1600 WIFI_NAN_OP_SUBSCRIBE,
1601 WIFI_NAN_OP_CANCEL_SUBSCRIBE,
1602 WIFI_NAN_OP_TRANSMIT,
1603};
1604
1606enum wifi_nan_service_protocol_type {
1608 WIFI_NAN_SRV_PROTO_BONJOUR = 1,
1610 WIFI_NAN_SRV_PROTO_GENERIC = 2,
1612 WIFI_NAN_SRV_PROTO_CSA_MATTER = 3,
1613};
1614
1616struct wifi_nan_publish_params {
1617 /* Service name for NAN */
1618 char service_name[WIFI_NAN_MAX_SERVICE_NAME_LEN];
1619 /* NAN service protocol type */
1620 enum wifi_nan_service_protocol_type srv_proto_type;
1621 /* Time to live (in seconds); 0 = one TX only */
1622 uint32_t ttl;
1623 /* Default frequency in MHz (defaultPublishChannel) */
1624 uint32_t freq;
1625 /* Multi-channel frequencies */
1626 char freq_list[64];
1627 /* Service specific information (binary data) */
1628 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1629 /* Actual length of SSI data */
1630 uint8_t ssi_len;
1631 /* Unsolicited transmission (true by default) */
1632 bool unsolicited;
1633 /* Solicited transmission (true by default) */
1634 bool solicited;
1635 /* Further Service Discovery (true by default) */
1636 bool fsd;
1637};
1638
1639/* This structure is used to configure nan update publish parameters */
1640struct wifi_nan_update_publish_params {
1641 uint8_t publish_id;
1642 /* Service specific information (binary data) */
1643 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1644 /* Actual length of SSI data */
1645 uint8_t ssi_len;
1646};
1647
1649struct wifi_nan_subscribe_params {
1650 /* Service name for NAN */
1651 char service_name[WIFI_NAN_MAX_SERVICE_NAME_LEN];
1652 /* NAN service protocol type */
1653 enum wifi_nan_service_protocol_type srv_proto_type;
1654 /* Subscribe type */
1655 bool active;
1656 /* Time to live (in seconds); 0 = until first result */
1657 unsigned int ttl;
1658 /* Selected frequency in MHz */
1659 unsigned int freq;
1660 /* Service specific information (binary data) */
1661 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1662 /* Actual length of SSI data */
1663 uint8_t ssi_len;
1664};
1665
1667struct wifi_nan_transmit_params {
1668 /* publish_id or subscribe_id */
1669 uint8_t handle;
1670 /* peer publish_id or subscribe_id */
1671 uint8_t req_instance_id;
1672 /* peer MAC address */
1673 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1674 /* Service specific information (binary data) */
1675 uint8_t ssi[WIFI_NAN_MAX_SSI_LEN];
1676 /* Actual length of SSI data */
1677 uint8_t ssi_len;
1678};
1679
1681struct wifi_nan_params {
1683 enum wifi_nan_operation op;
1684
1686 union {
1688 struct wifi_nan_publish_params publish;
1690 struct wifi_nan_update_publish_params update_publish;
1692 struct wifi_nan_subscribe_params subscribe;
1694 struct wifi_nan_transmit_params transmit;
1696 uint8_t cancel_id;
1697 };
1698
1699 /* Save the returned ID */
1700 char resp[WIFI_NAN_RESP_SIZE];
1701};
1702
1703#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
1704
1705
1706#define WIFI_WPS_PIN_MAX_LEN 8
1707
1717
1725
1726#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P
1728enum wifi_p2p_op {
1730 WIFI_P2P_FIND = 0,
1732 WIFI_P2P_STOP_FIND,
1736 WIFI_P2P_PEER,
1738 WIFI_P2P_CONNECT,
1740 WIFI_P2P_GROUP_ADD,
1742 WIFI_P2P_GROUP_REMOVE,
1744 WIFI_P2P_INVITE,
1746 WIFI_P2P_POWER_SAVE,
1748 WIFI_P2P_LIST_NETWORKS,
1750 WIFI_P2P_PERSISTENT_REMOVE,
1751};
1752
1754enum wifi_p2p_discovery_type {
1756 WIFI_P2P_FIND_START_WITH_FULL = 0,
1758 WIFI_P2P_FIND_ONLY_SOCIAL,
1760 WIFI_P2P_FIND_PROGRESSIVE,
1761};
1762
1764enum wifi_p2p_connection_method {
1766 WIFI_P2P_METHOD_PBC = 0,
1768 WIFI_P2P_METHOD_DISPLAY,
1770 WIFI_P2P_METHOD_KEYPAD,
1771};
1772
1774#define WIFI_P2P_MAX_PEERS CONFIG_WIFI_P2P_MAX_PEERS
1775#define WIFI_P2P_LIST_NETWORKS_BUF_SIZE 2048
1776
1778struct wifi_p2p_params {
1780 enum wifi_p2p_op oper;
1782 enum wifi_p2p_discovery_type discovery_type;
1784 uint16_t timeout;
1786 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1788 bool discovered_only;
1790 struct wifi_p2p_device_info *peers;
1792 uint16_t peer_count;
1794 bool power_save;
1796 struct {
1798 enum wifi_p2p_connection_method method;
1803 char pin[WIFI_WPS_PIN_MAX_LEN + 1];
1805 uint8_t go_intent;
1807 unsigned int freq;
1809 bool join;
1811 bool persistent_set;
1812 } connect;
1814 struct {
1816 int freq;
1818 int persistent;
1820 bool persistent_set;
1822 bool ht40;
1824 bool vht;
1826 bool he;
1828 bool edmg;
1830 uint8_t go_bssid[WIFI_MAC_ADDR_LEN];
1832 uint8_t go_bssid_length;
1833 } group_add;
1835 struct {
1837 char ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1];
1838 } group_remove;
1840 struct {
1842 enum {
1843 WIFI_P2P_INVITE_PERSISTENT = 0,
1844 WIFI_P2P_INVITE_GROUP,
1845 } type;
1847 int persistent_id;
1849 char group_ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1];
1851 uint8_t peer_addr[WIFI_MAC_ADDR_LEN];
1853 int freq;
1855 uint8_t go_dev_addr[WIFI_MAC_ADDR_LEN];
1857 uint8_t go_dev_addr_length;
1858 } invite;
1860 struct {
1862 char *buf;
1864 size_t buf_size;
1865 } list_networks;
1867 struct {
1872 int id;
1873 } persistent_remove;
1874};
1875#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */
1876
1889
1890#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__)
1900
1914#endif
1915
1916/* Extended Capabilities */
1924
1925#include <zephyr/net/net_if.h>
1926
1933typedef void (*scan_result_cb_t)(struct net_if *iface, int status,
1934 struct wifi_scan_result *entry);
1935
1936#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
1943typedef void (*raw_scan_result_cb_t)(struct net_if *iface, int status,
1944 struct wifi_raw_scan_result *entry);
1945#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
1946
1961 int (*scan)(const struct device *dev,
1962 struct net_if *iface,
1963 struct wifi_scan_params *params,
1964 scan_result_cb_t cb);
1973 int (*connect)(const struct device *dev,
1974 struct net_if *iface,
1975 struct wifi_connect_req_params *params);
1983 int (*disconnect)(const struct device *dev,
1984 struct net_if *iface);
1993 int (*ap_enable)(const struct device *dev,
1994 struct net_if *iface,
1995 struct wifi_connect_req_params *params);
2002 int (*ap_disable)(const struct device *dev, struct net_if *iface);
2011 int (*ap_sta_disconnect)(const struct device *dev, struct net_if *iface,
2012 const uint8_t *mac);
2021 int (*iface_status)(const struct device *dev,
2022 struct net_if *iface,
2023 struct wifi_iface_status *status);
2024#if defined(CONFIG_NET_STATISTICS_WIFI) || defined(__DOXYGEN__)
2033 int (*get_stats)(const struct device *dev,
2034 struct net_if *iface,
2035 struct net_stats_wifi *stats);
2043 int (*reset_stats)(const struct device *dev, struct net_if *iface);
2044#endif /* CONFIG_NET_STATISTICS_WIFI */
2053 int (*cfg_11k)(const struct device *dev,
2054 struct net_if *iface,
2055 struct wifi_11k_params *params);
2064 int (*send_11k_neighbor_request)(const struct device *dev,
2065 struct net_if *iface,
2066 struct wifi_11k_params *params);
2075 int (*set_power_save)(const struct device *dev,
2076 struct net_if *iface,
2077 struct wifi_ps_params *params);
2086 int (*set_twt)(const struct device *dev,
2087 struct net_if *iface,
2088 struct wifi_twt_params *params);
2097 int (*set_btwt)(const struct device *dev,
2098 struct net_if *iface,
2099 struct wifi_twt_params *params);
2108 int (*get_power_save_config)(const struct device *dev,
2109 struct net_if *iface,
2110 struct wifi_ps_config *config);
2119 int (*reg_domain)(const struct device *dev,
2120 struct net_if *iface,
2121 struct wifi_reg_domain *reg_domain);
2130 int (*filter)(const struct device *dev,
2131 struct net_if *iface,
2132 struct wifi_filter_info *filter);
2141 int (*mode)(const struct device *dev, struct net_if *iface, struct wifi_mode_info *mode);
2150 int (*channel)(const struct device *dev,
2151 struct net_if *iface,
2152 struct wifi_channel_info *channel);
2153
2162 int (*btm_query)(const struct device *dev, struct net_if *iface, uint8_t reason);
2163
2170 bool (*bss_support_neighbor_rep)(const struct device *dev, struct net_if *iface);
2171
2180 int (*bss_ext_capab)(const struct device *dev, struct net_if *iface, int capab);
2181
2189 int (*legacy_roam)(const struct device *dev, struct net_if *iface);
2190
2204 int (*get_version)(const struct device *dev,
2205 struct net_if *iface,
2206 struct wifi_version *params);
2215 int (*get_conn_params)(const struct device *dev,
2216 struct net_if *iface,
2217 struct wifi_connect_req_params *params);
2226 int (*set_rts_threshold)(const struct device *dev,
2227 struct net_if *iface,
2228 unsigned int rts_threshold);
2237 int (*ap_config_params)(const struct device *dev,
2238 struct net_if *iface,
2239 struct wifi_ap_config_params *params);
2248 int (*config_params)(const struct device *dev,
2249 struct net_if *iface,
2250 struct wifi_config_params *params);
2251#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
2260 int (*dpp_dispatch)(const struct device *dev,
2261 struct net_if *iface,
2262 struct wifi_dpp_params *params);
2263#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
2264#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN
2273 int (*nan_cfg)(const struct device *dev,
2274 struct net_if *iface,
2275 struct wifi_nan_params *params);
2276#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_NAN */
2277
2285 int (*pmksa_flush)(const struct device *dev, struct net_if *iface);
2294#ifdef CONFIG_WIFI_CERTIFICATE_LIB
2295 int (*enterprise_creds)(const struct device *dev,
2296 struct net_if *iface,
2297 struct wifi_enterprise_creds_params *creds);
2298#endif
2307 int (*get_rts_threshold)(const struct device *dev,
2308 struct net_if *iface,
2309 unsigned int *rts_threshold);
2318 int (*wps_config)(const struct device *dev,
2319 struct net_if *iface,
2320 struct wifi_wps_config_params *params);
2329 int (*candidate_scan)(const struct device *dev,
2330 struct net_if *iface,
2331 struct wifi_scan_params *params);
2341 __deprecated int (*start_11r_roaming)(const struct device *dev, struct net_if *iface);
2350 int (*set_bss_max_idle_period)(const struct device *dev,
2351 struct net_if *iface,
2352 unsigned short bss_max_idle_period);
2353#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__)
2362 int (*set_bgscan)(const struct device *dev,
2363 struct net_if *iface,
2364 struct wifi_bgscan_params *params);
2365#endif
2366#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P
2376 int (*p2p_oper)(const struct device *dev,
2377 struct net_if *iface,
2378 struct wifi_p2p_params *params);
2379#endif
2380};
2381
2390#if defined(CONFIG_WIFI_USE_NATIVE_NETWORKING) || defined(__DOXYGEN__)
2393#else
2396#endif
2398 const struct wifi_mgmt_ops *const wifi_mgmt_api;
2399
2400#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT) || defined(__DOXYGEN__)
2402 const void *wifi_drv_ops;
2403#endif
2404};
2405
2406#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)
2407/* Make sure wifi_drv_ops is after wifi_mgmt_api */
2408BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_mgmt_api) <
2409 offsetof(struct net_wifi_mgmt_offload, wifi_drv_ops));
2410#endif
2411
2412/* Make sure that the network interface API is properly setup inside
2413 * Wifi mgmt offload API struct (it is the first one).
2414 */
2415BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0);
2416
2422void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status);
2423
2429void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status);
2430
2438
2445 struct wifi_twt_params *twt_params);
2446
2452void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, int twt_sleep_state);
2453
2454#if defined(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS) || defined(__DOXYGEN__)
2461 struct wifi_raw_scan_result *raw_scan_info);
2462#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
2463
2470
2471#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_ROAMING
2478void wifi_mgmt_raise_neighbor_rep_recv_event(struct net_if *iface,
2479 char *inbuf, size_t buf_len);
2480#endif
2481
2488
2495
2502 struct wifi_ap_sta_info *sta_info);
2503
2509 struct wifi_ap_sta_info *sta_info);
2510
2511#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P
2518void wifi_mgmt_raise_p2p_device_found_event(struct net_if *iface,
2519 struct wifi_p2p_device_info *peer_info);
2520#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */
2521
2525#ifdef __cplusplus
2526}
2527#endif
2528
2529#endif /* ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_ */
Ethernet.
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Declare a request handler function for the given network event.
Definition net_mgmt.h:129
void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status)
Wi-Fi management connect result event.
wifi_ext_capab
Definition wifi_mgmt.h:1917
wifi_sap_iface_state
Wi-Fi AP status.
Definition wifi_mgmt.h:1879
wifi_ps
Wi-Fi power save states.
Definition wifi.h:464
#define NET_REQUEST_WIFI_PS_CONFIG
Request a Wi-Fi power save configuration.
Definition wifi_mgmt.h:227
void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, int twt_sleep_state)
Wi-Fi management TWT sleep state event.
const char * wifi_disconn_reason_txt(enum wifi_disconn_reason reason)
Helper function to get user-friendly disconnect reason name.
#define NET_REQUEST_WIFI_SCAN
Request a Wi-Fi scan.
Definition wifi_mgmt.h:158
wifi_frequency_bands
IEEE 802.11 operational frequency bands (not exhaustive).
Definition wifi.h:279
wifi_mfp_options
IEEE 802.11w - Management frame protection.
Definition wifi.h:258
#define NET_REQUEST_WIFI_RTS_THRESHOLD
Request a Wi-Fi RTS threshold.
Definition wifi_mgmt.h:275
#define WIFI_WPS_PIN_MAX_LEN
Definition wifi_mgmt.h:1706
#define NET_REQUEST_WIFI_RTS_THRESHOLD_CONFIG
Request a Wi-Fi RTS threshold configuration.
Definition wifi_mgmt.h:326
#define WIFI_MAC_ADDR_LEN
MAC address length.
Definition wifi.h:332
#define NET_REQUEST_WIFI_REG_DOMAIN
Request a Wi-Fi regulatory domain.
Definition wifi_mgmt.h:233
wifi_ps_exit_strategy
Wi-Fi power save exit strategy.
Definition wifi.h:673
#define NET_REQUEST_WIFI_PACKET_FILTER
Request Wi-Fi packet filter.
Definition wifi_mgmt.h:245
wifi_twt_setup_cmd
Wi-Fi Target Wake Time (TWT) setup commands.
Definition wifi.h:546
#define NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD
Definition wifi_mgmt.h:350
#define NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE
Definition wifi_mgmt.h:345
wifi_twt_sleep_state
Wi-Fi TWT sleep states.
Definition wifi_mgmt.h:1211
#define WIFI_BTWT_AGREEMENT_MAX
Definition wifi_mgmt.h:988
void wifi_mgmt_raise_twt_event(struct net_if *iface, struct wifi_twt_params *twt_params)
Wi-Fi management TWT event.
wifi_frequency_bandwidths
IEEE 802.11 operational frequency bandwidths (not exhaustive).
Definition wifi.h:301
void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status)
Wi-Fi management disconnect result event.
#define NET_REQUEST_WIFI_IFACE_STATUS
Request a Wi-Fi network interface status.
Definition wifi_mgmt.h:194
#define NET_REQUEST_WIFI_VERSION
Request a Wi-Fi version.
Definition wifi_mgmt.h:263
wifi_wpa3_enterprise_type
WPA3 Enterprise security types.
Definition wifi.h:161
void wifi_mgmt_raise_ap_sta_disconnected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info)
Wi-Fi management AP mode STA disconnected event.
#define NET_REQUEST_WIFI_11K_NEIGHBOR_REQUEST
Definition wifi_mgmt.h:204
#define NET_REQUEST_WIFI_P2P_OPER
Definition wifi_mgmt.h:360
wifi_wps_op
Operation for WPS.
Definition wifi_mgmt.h:1709
wifi_twt_setup_resp_status
Wi-Fi Target Wake Time (TWT) negotiation status.
Definition wifi.h:569
#define NET_REQUEST_WIFI_CONFIG_PARAM
Request a Wi-Fi STA parameters configuration.
Definition wifi_mgmt.h:287
#define NET_REQUEST_WIFI_BTM_QUERY
Request a Wi-Fi BTM query.
Definition wifi_mgmt.h:309
wifi_iface_mode
Wi-Fi interface modes.
Definition wifi.h:397
#define NET_REQUEST_WIFI_AP_ENABLE
Request a Wi-Fi access point enable.
Definition wifi_mgmt.h:176
#define NET_REQUEST_WIFI_WPS_CONFIG
Definition wifi_mgmt.h:331
#define WIFI_COUNTRY_CODE_LEN
Length of the country code string.
Definition wifi.h:28
void wifi_mgmt_raise_ap_enable_result_event(struct net_if *iface, enum wifi_ap_status status)
Wi-Fi management AP mode enable result event.
#define NET_REQUEST_WIFI_PS
Request a Wi-Fi power save.
Definition wifi_mgmt.h:210
wifi_twt_negotiation_type
Wi-Fi Target Wake Time (TWT) negotiation types.
Definition wifi.h:533
void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, struct wifi_raw_scan_result *raw_scan_info)
Wi-Fi management raw scan result event.
void wifi_mgmt_raise_iface_status_event(struct net_if *iface, struct wifi_iface_status *iface_status)
Wi-Fi management interface status event.
wifi_config_param
Wi-Fi STA mode configuration parameter.
Definition wifi.h:767
wifi_ap_config_param
Wi-Fi AP mode configuration parameter.
Definition wifi.h:753
wifi_conn_status
Wi-Fi connect result codes.
Definition wifi.h:44
#define NET_REQUEST_WIFI_START_ROAMING
Definition wifi_mgmt.h:340
#define NET_REQUEST_WIFI_PMKSA_FLUSH
Request a Wi-Fi PMKSA cache entries flush.
Definition wifi_mgmt.h:314
#define NET_REQUEST_WIFI_DISCONNECT
Request a Wi-Fi disconnect.
Definition wifi_mgmt.h:170
wifi_twt_fail_reason
Target Wake Time (TWT) error codes.
Definition wifi.h:577
#define NET_REQUEST_WIFI_AP_RTS_THRESHOLD
Request a Wi-Fi RTS threshold.
Definition wifi_mgmt.h:188
net_request_wifi_cmd
Wi-Fi management commands.
Definition wifi_mgmt.h:73
#define NET_REQUEST_WIFI_MODE
Request current Wi-Fi mode.
Definition wifi_mgmt.h:239
#define NET_REQUEST_WIFI_BGSCAN
Definition wifi_mgmt.h:355
#define NET_REQUEST_WIFI_AP_STA_DISCONNECT
Request a Wi-Fi access point to disconnect a station.
Definition wifi_mgmt.h:257
void wifi_mgmt_raise_disconnect_complete_event(struct net_if *iface, int status)
Wi-Fi management disconnect complete event.
#define NET_REQUEST_WIFI_CONNECT
Request a Wi-Fi connect.
Definition wifi_mgmt.h:164
wifi_bgscan_type
Wi-Fi background scan implementation.
Definition wifi_mgmt.h:1892
wifi_ap_status
Wi-Fi AP mode result codes.
Definition wifi_mgmt.h:890
#define NET_REQUEST_WIFI_TWT
Request a Wi-Fi TWT.
Definition wifi_mgmt.h:216
wifi_link_mode
Wi-Fi link operating modes.
Definition wifi.h:425
wifi_ps_param_type
Wi-Fi power save parameters.
Definition wifi.h:644
net_event_wifi_cmd
Wi-Fi management events.
Definition wifi_mgmt.h:401
#define NET_REQUEST_WIFI_CONN_PARAMS
Request a Wi-Fi connection parameters.
Definition wifi_mgmt.h:269
wifi_disconn_reason
Wi-Fi disconnect reason codes.
Definition wifi_mgmt.h:871
wifi_ps_wakeup_mode
Wi-Fi power save modes.
Definition wifi.h:660
void wifi_mgmt_raise_ap_sta_connected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info)
Wi-Fi management AP mode STA connected event.
wifi_twt_operation
Wi-Fi Target Wake Time (TWT) operations.
Definition wifi.h:522
wifi_scan_type
Wi-Fi scanning types.
Definition wifi.h:456
void(* scan_result_cb_t)(struct net_if *iface, int status, struct wifi_scan_result *entry)
Scan result callback.
Definition wifi_mgmt.h:1933
wifi_twt_teardown_status
Wi-Fi Target Wake Time (TWT) teradown status.
Definition wifi.h:603
#define WIFI_SSID_MAX_LEN
Max SSID length.
Definition wifi.h:320
#define NET_REQUEST_WIFI_CHANNEL
Request a Wi-Fi channel.
Definition wifi_mgmt.h:251
wifi_config_ps_param_fail_reason
Wi-Fi power save error codes.
Definition wifi.h:694
#define NET_REQUEST_WIFI_11K_CONFIG
Definition wifi_mgmt.h:199
wifi_security_type
IEEE 802.11 security types.
Definition wifi.h:69
void wifi_mgmt_raise_ap_disable_result_event(struct net_if *iface, enum wifi_ap_status status)
Wi-Fi management AP mode disable result event.
wifi_mgmt_op
Generic get/set operation for any command.
Definition wifi_mgmt.h:1160
#define NET_REQUEST_WIFI_ENTERPRISE_CREDS
Set Wi-Fi enterprise mode CA/client Cert and key.
Definition wifi_mgmt.h:320
#define NET_REQUEST_WIFI_BTWT
Definition wifi_mgmt.h:221
#define NET_REQUEST_WIFI_AP_CONFIG_PARAM
Request a Wi-Fi AP parameters configuration.
Definition wifi_mgmt.h:281
#define NET_REQUEST_WIFI_AP_DISABLE
Request a Wi-Fi access point disable.
Definition wifi_mgmt.h:182
wifi_wep_key_type
WEP key type (based on key length).
Definition wifi.h:131
wifi_ps_mode
Wi-Fi power save modes.
Definition wifi.h:475
@ WIFI_EXT_CAPAB_GLK
Definition wifi_mgmt.h:1919
@ WIFI_EXT_CAPAB_20_40_COEX
Definition wifi_mgmt.h:1918
@ WIFI_EXT_CAPAB_BSS_TRANSITION
Definition wifi_mgmt.h:1922
@ WIFI_EXT_CAPAB_EXT_CHAN_SWITCH
Definition wifi_mgmt.h:1920
@ WIFI_EXT_CAPAB_TIM_BROADCAST
Definition wifi_mgmt.h:1921
@ WIFI_SAP_IFACE_COUNTRY_UPDATE
Definition wifi_mgmt.h:1882
@ WIFI_SAP_IFACE_DISABLED
Definition wifi_mgmt.h:1881
@ WIFI_SAP_IFACE_HT_SCAN
Definition wifi_mgmt.h:1884
@ WIFI_SAP_IFACE_ENABLED
Definition wifi_mgmt.h:1887
@ WIFI_SAP_IFACE_ACS
Definition wifi_mgmt.h:1883
@ WIFI_SAP_IFACE_UNINITIALIZED
Definition wifi_mgmt.h:1880
@ WIFI_SAP_IFACE_NO_IR
Definition wifi_mgmt.h:1886
@ WIFI_SAP_IFACE_DFS
Definition wifi_mgmt.h:1885
@ WIFI_TWT_STATE_SLEEP
TWT sleep state: sleeping.
Definition wifi_mgmt.h:1213
@ WIFI_TWT_STATE_AWAKE
TWT sleep state: awake.
Definition wifi_mgmt.h:1215
@ WIFI_WPS_PBC
WPS pbc.
Definition wifi_mgmt.h:1711
@ WIFI_WPS_PIN_SET
Set WPS pin number.
Definition wifi_mgmt.h:1715
@ WIFI_WPS_PIN_GET
Get WPS pin number.
Definition wifi_mgmt.h:1713
@ NET_REQUEST_WIFI_CMD_AP_CONFIG_PARAM
Configure AP parameter.
Definition wifi_mgmt.h:117
@ NET_REQUEST_WIFI_CMD_TWT
Setup or teardown TWT flow.
Definition wifi_mgmt.h:95
@ NET_REQUEST_WIFI_CMD_PMKSA_FLUSH
Flush PMKSA cache entries.
Definition wifi_mgmt.h:127
@ NET_REQUEST_WIFI_CMD_P2P_OPER
Wi-Fi Direct (P2P) operations.
Definition wifi_mgmt.h:151
@ NET_REQUEST_WIFI_CMD_PACKET_FILTER
Set or get packet filter setting for current mode.
Definition wifi_mgmt.h:105
@ NET_REQUEST_WIFI_CMD_AP_ENABLE
Enable AP mode.
Definition wifi_mgmt.h:81
@ NET_REQUEST_WIFI_CMD_START_ROAMING
Start roaming.
Definition wifi_mgmt.h:139
@ NET_REQUEST_WIFI_CMD_REG_DOMAIN
Set or get regulatory domain.
Definition wifi_mgmt.h:101
@ NET_REQUEST_WIFI_CMD_AP_RTS_THRESHOLD
Set AP RTS threshold.
Definition wifi_mgmt.h:85
@ NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD
Configure BSS maximum idle period.
Definition wifi_mgmt.h:147
@ NET_REQUEST_WIFI_CMD_11K_NEIGHBOR_REQUEST
Send 11k neighbor request.
Definition wifi_mgmt.h:91
@ NET_REQUEST_WIFI_CMD_SCAN
Scan for Wi-Fi networks.
Definition wifi_mgmt.h:75
@ NET_REQUEST_WIFI_CMD_IFACE_STATUS
Get interface status.
Definition wifi_mgmt.h:87
@ NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT
Disconnect a STA from AP.
Definition wifi_mgmt.h:109
@ NET_REQUEST_WIFI_CMD_DPP
DPP actions.
Definition wifi_mgmt.h:121
@ NET_REQUEST_WIFI_CMD_AP_DISABLE
Disable AP mode.
Definition wifi_mgmt.h:83
@ NET_REQUEST_WIFI_CMD_RTS_THRESHOLD
Set RTS threshold.
Definition wifi_mgmt.h:115
@ NET_REQUEST_WIFI_CMD_CONNECT
Connect to a Wi-Fi network.
Definition wifi_mgmt.h:77
@ NET_REQUEST_WIFI_CMD_VERSION
Get Wi-Fi driver and Firmware versions.
Definition wifi_mgmt.h:111
@ NET_REQUEST_WIFI_CMD_BGSCAN
Configure background scanning.
Definition wifi_mgmt.h:149
@ NET_REQUEST_WIFI_CMD_CONFIG_PARAM
Configure STA parameter.
Definition wifi_mgmt.h:119
@ NET_REQUEST_WIFI_CMD_ENTERPRISE_CREDS
Set enterprise mode credential.
Definition wifi_mgmt.h:129
@ NET_REQUEST_WIFI_CMD_CONN_PARAMS
Get Wi-Fi latest connection parameters.
Definition wifi_mgmt.h:113
@ NET_REQUEST_WIFI_CMD_11K_CONFIG
Set or get 11k status.
Definition wifi_mgmt.h:89
@ NET_REQUEST_WIFI_CMD_CHANNEL
Set or get Wi-Fi channel for Monitor or TX-Injection mode.
Definition wifi_mgmt.h:107
@ NET_REQUEST_WIFI_CMD_NAN
NAN actions.
Definition wifi_mgmt.h:123
@ NET_REQUEST_WIFI_CMD_BTWT
Setup BTWT flow.
Definition wifi_mgmt.h:97
@ NET_REQUEST_WIFI_CMD_MODE
Set or get Mode of operation.
Definition wifi_mgmt.h:103
@ NET_REQUEST_WIFI_CMD_RTS_THRESHOLD_CONFIG
Get RTS threshold.
Definition wifi_mgmt.h:131
@ NET_REQUEST_WIFI_CMD_CANDIDATE_SCAN
Specific scan.
Definition wifi_mgmt.h:143
@ NET_REQUEST_WIFI_CMD_BTM_QUERY
BSS transition management query.
Definition wifi_mgmt.h:125
@ NET_REQUEST_WIFI_CMD_PS
Set power save status.
Definition wifi_mgmt.h:93
@ NET_REQUEST_WIFI_CMD_DISCONNECT
Disconnect from a Wi-Fi network.
Definition wifi_mgmt.h:79
@ NET_REQUEST_WIFI_CMD_NEIGHBOR_REP_COMPLETE
Neighbor report complete.
Definition wifi_mgmt.h:141
@ NET_REQUEST_WIFI_CMD_AP_WPS_CONFIG
AP WPS config.
Definition wifi_mgmt.h:145
@ NET_REQUEST_WIFI_CMD_PS_CONFIG
Get power save config.
Definition wifi_mgmt.h:99
@ NET_REQUEST_WIFI_CMD_WPS_CONFIG
WPS config.
Definition wifi_mgmt.h:133
@ WIFI_BGSCAN_SIMPLE
Simple, periodic scan based on signal strength.
Definition wifi_mgmt.h:1896
@ WIFI_BGSCAN_NONE
None, background scan is disabled.
Definition wifi_mgmt.h:1894
@ WIFI_BGSCAN_LEARN
Learn channels used by the network (experimental).
Definition wifi_mgmt.h:1898
@ WIFI_STATUS_AP_CHANNEL_NOT_ALLOWED
AP mode enable failed - channel not allowed.
Definition wifi_mgmt.h:898
@ WIFI_STATUS_AP_SUCCESS
AP mode enable or disable successful.
Definition wifi_mgmt.h:892
@ WIFI_STATUS_AP_OP_NOT_SUPPORTED
AP mode enable failed - operation not supported.
Definition wifi_mgmt.h:904
@ WIFI_STATUS_AP_OP_NOT_PERMITTED
AP mode enable failed - operation not permitted.
Definition wifi_mgmt.h:906
@ WIFI_STATUS_AP_CHANNEL_NOT_SUPPORTED
AP mode enable failed - channel not supported.
Definition wifi_mgmt.h:896
@ WIFI_STATUS_AP_FAIL
AP mode enable or disable failed - generic failure.
Definition wifi_mgmt.h:894
@ WIFI_STATUS_AP_AUTH_TYPE_NOT_SUPPORTED
AP mode enable failed - authentication type not supported.
Definition wifi_mgmt.h:902
@ WIFI_STATUS_AP_SSID_NOT_ALLOWED
AP mode enable failed - SSID not allowed.
Definition wifi_mgmt.h:900
@ NET_MGMT_CMD
Scan results available.
Definition wifi_mgmt.h:403
@ WIFI_REASON_DISCONN_INACTIVITY
Disconnected due to inactivity.
Definition wifi_mgmt.h:881
@ WIFI_REASON_DISCONN_AP_LEAVING
Disconnected due to AP leaving.
Definition wifi_mgmt.h:879
@ WIFI_REASON_DISCONN_SUCCESS
Success, overload status as reason.
Definition wifi_mgmt.h:873
@ WIFI_REASON_DISCONN_UNSPECIFIED
Unspecified reason.
Definition wifi_mgmt.h:875
@ WIFI_REASON_DISCONN_USER_REQUEST
Disconnected due to user request.
Definition wifi_mgmt.h:877
@ WIFI_MGMT_GET
Get operation.
Definition wifi_mgmt.h:1162
@ WIFI_MGMT_SET
Set operation.
Definition wifi_mgmt.h:1164
#define BUILD_ASSERT(EXPR, MSG...)
Definition llvm.h:51
Public API for network interface.
Network Management API public header.
Offloaded network device iface API.
int listen(int sock, int backlog)
int connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
#define bool
Definition stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Ethernet L2 API operations.
Definition ethernet.h:485
Network Interface structure.
Definition net_if.h:744
All Wi-Fi specific statistics.
Definition net_stats.h:727
Wi-Fi management offload API.
Definition wifi_mgmt.h:2383
struct ethernet_api wifi_iface
Mandatory to get in first position.
Definition wifi_mgmt.h:2392
const struct wifi_mgmt_ops *const wifi_mgmt_api
Wi-Fi management API.
Definition wifi_mgmt.h:2398
const void * wifi_drv_ops
Wi-Fi supplicant driver API.
Definition wifi_mgmt.h:2402
Extended net_if_api for offloaded ifaces/network devices, allowing handling of admin up/down state ch...
Definition offloaded_netdev.h:53
Wi-Fi 11k parameters.
Definition wifi_mgmt.h:1168
uint8_t ssid[WIFI_SSID_MAX_LEN+1]
SSID.
Definition wifi_mgmt.h:1174
bool enable_11k
11k enable/disable
Definition wifi_mgmt.h:1172
enum wifi_mgmt_op oper
11k command operation
Definition wifi_mgmt.h:1170
Wi-Fi AP configuration parameter.
Definition wifi_mgmt.h:1373
uint32_t max_inactivity
Parameter used for setting maximum inactivity duration for stations.
Definition wifi_mgmt.h:1377
enum wifi_ap_config_param type
Parameter used to identify the different AP parameters.
Definition wifi_mgmt.h:1375
uint32_t max_num_sta
Parameter used for setting maximum number of stations.
Definition wifi_mgmt.h:1379
enum wifi_frequency_bandwidths bandwidth
Parameter used for frequency band.
Definition wifi_mgmt.h:1381
AP mode - connected STA details.
Definition wifi_mgmt.h:1233
enum wifi_link_mode link_mode
Link mode, see enum wifi_link_mode.
Definition wifi_mgmt.h:1235
uint8_t mac[WIFI_MAC_ADDR_LEN]
MAC address.
Definition wifi_mgmt.h:1237
uint8_t mac_length
MAC address length.
Definition wifi_mgmt.h:1239
bool twt_capable
is TWT capable ?
Definition wifi_mgmt.h:1241
Wi-Fi structure to uniquely identify a band-channel pair.
Definition wifi_mgmt.h:592
uint8_t band
Frequency band.
Definition wifi_mgmt.h:594
uint8_t channel
Channel.
Definition wifi_mgmt.h:596
Wi-Fi background scan parameters.
Definition wifi_mgmt.h:1902
enum wifi_bgscan_type type
The type of background scanning.
Definition wifi_mgmt.h:1904
uint16_t long_interval
Long scan interval in seconds.
Definition wifi_mgmt.h:1908
uint16_t btm_queries
Number of BSS Transition Management (BTM) queries.
Definition wifi_mgmt.h:1912
int8_t rssi_threshold
Signal strength threshold in dBm.
Definition wifi_mgmt.h:1910
uint16_t short_interval
Short scan interval in seconds.
Definition wifi_mgmt.h:1906
Wi-Fi broadcast TWT parameters.
Definition wifi_mgmt.h:991
uint8_t btwt_nominal_wake
Broadcast TWT range.
Definition wifi_mgmt.h:999
uint16_t btwt_mantissa
Broadcast TWT mantissa.
Definition wifi_mgmt.h:995
uint8_t btwt_exponent
Broadcast TWT exponent.
Definition wifi_mgmt.h:997
uint8_t btwt_id
Broadcast TWT ID.
Definition wifi_mgmt.h:993
Wi-Fi channel setting for monitor and TX-injection modes.
Definition wifi_mgmt.h:1353
uint8_t if_index
Interface index.
Definition wifi_mgmt.h:1362
uint16_t channel
Channel value to set or get.
Definition wifi_mgmt.h:1355
enum wifi_mgmt_op oper
Get or set operation.
Definition wifi_mgmt.h:1364
enum wifi_frequency_bands band
Frequency band for the channel (2.4 / 5 / 6 GHz).
Definition wifi_mgmt.h:1360
Wi-Fi STA configuration parameter.
Definition wifi_mgmt.h:1391
int okc
Parameter used for opportunistic key caching.
Definition wifi_mgmt.h:1395
enum wifi_config_param type
Parameter used to identify the different STA parameters.
Definition wifi_mgmt.h:1393
Wi-Fi connect request parameters.
Definition wifi_mgmt.h:678
const uint8_t * key2_passwd
Password for a secondary private key, if required by the authentication method.
Definition wifi_mgmt.h:737
uint8_t server_cert_domain_exact_len
Length of the server_cert_domain_exact string, maximum 128 bytes.
Definition wifi_mgmt.h:846
bool ft_used
Indicates if Fast BSS Transition (802.11r) is used.
Definition wifi_mgmt.h:804
enum wifi_frequency_bandwidths bandwidth
Parameter used for frequency band.
Definition wifi_mgmt.h:841
enum wifi_security_type security
Security type.
Definition wifi_mgmt.h:702
const uint8_t * passwords[WIFI_ENT_IDENTITY_MAX_USERS]
Array of pointers to user password strings for EAP authentication.
Definition wifi_mgmt.h:833
const uint8_t * identities[WIFI_ENT_IDENTITY_MAX_USERS]
Array of pointers to user identity strings for EAP authentication.
Definition wifi_mgmt.h:826
uint8_t aid_length
Length of the anonymous identity, maximum 64 bytes.
Definition wifi_mgmt.h:719
const uint8_t * server_cert_domain_exact
Full domain name to verify in the server certificate.
Definition wifi_mgmt.h:844
const uint8_t * sae_password
SAE password (same as PSK but with no length restrictions), optional.
Definition wifi_mgmt.h:694
const uint8_t * key_passwd
Private key password for Wi-Fi Enterprise authentication.
Definition wifi_mgmt.h:727
uint8_t eap_id_length
Length of the EAP identity, maximum 64 bytes.
Definition wifi_mgmt.h:778
uint8_t channel
Channel.
Definition wifi_mgmt.h:700
uint8_t ssid_length
SSID length.
Definition wifi_mgmt.h:682
int timeout
Connect timeout in seconds, SYS_FOREVER_MS for no timeout.
Definition wifi_mgmt.h:708
uint8_t transition_disable
WPA3 Transition Disable bitmap (WPA3 Spec v3.0, Table 5).
Definition wifi_mgmt.h:865
bool psk_is_pbkdf2
Pre-shared key is the pre-computed PBKDF2 output.
Definition wifi_mgmt.h:692
int nusers
Number of EAP user identities provided.
Definition wifi_mgmt.h:812
enum wifi_mfp_options mfp
MFP options.
Definition wifi_mgmt.h:704
uint8_t sae_password_length
SAE password length.
Definition wifi_mgmt.h:696
const uint8_t * anon_id
Anonymous identity used in EAP authentication (Phase 1) for Wi-Fi Enterprise networks.
Definition wifi_mgmt.h:716
int eap_ver
EAP (Extensible Authentication Protocol) version to use.
Definition wifi_mgmt.h:766
uint8_t key_passwd_length
Length of the private key password, maximum 128 bytes.
Definition wifi_mgmt.h:730
uint8_t band
Frequency band.
Definition wifi_mgmt.h:698
uint8_t TLS_cipher
TLS cipher suite to use for EAP-TLS authentication.
Definition wifi_mgmt.h:758
const uint8_t * psk
Pre-shared key.
Definition wifi_mgmt.h:684
uint8_t bssid[WIFI_MAC_ADDR_LEN]
BSSID.
Definition wifi_mgmt.h:706
bool verify_peer_cert
Whether to verify the server's certificate authority (CA) during authentication.
Definition wifi_mgmt.h:797
uint8_t passwds
Number of EAP passwords provided.
Definition wifi_mgmt.h:819
uint8_t psk_length
Pre-shared key length.
Definition wifi_mgmt.h:686
const uint8_t * eap_identity
Identity string for EAP authentication (Phase 2, inner authentication).
Definition wifi_mgmt.h:775
const uint8_t * ssid
SSID.
Definition wifi_mgmt.h:680
uint8_t ssid_protection
SSID protection in 4-way handshake (needs RSNXE support) 0: Disable (default) 1: Enable.
Definition wifi_mgmt.h:856
const uint8_t * server_cert_domain_suffix
Domain name suffix to verify in the server certificate.
Definition wifi_mgmt.h:849
enum wifi_wpa3_enterprise_type wpa3_ent_mode
WPA3 Enterprise mode type.
Definition wifi_mgmt.h:750
uint8_t eap_passwd_length
Length of the EAP password, maximum 128 bytes.
Definition wifi_mgmt.h:789
uint8_t key2_passwd_length
Length of the secondary private key password, maximum 128 bytes.
Definition wifi_mgmt.h:740
uint8_t server_cert_domain_suffix_len
Length of the server_cert_domain_suffix string, maximum 64 bytes.
Definition wifi_mgmt.h:851
uint8_t ignore_broadcast_ssid
Hidden SSID configure 0: disabled (default) 1: send empty (length=0) SSID in beacon and ignore probe ...
Definition wifi_mgmt.h:839
const uint8_t * eap_password
Password string for EAP authentication (Phase 2, inner authentication).
Definition wifi_mgmt.h:786
Wi-Fi enterprise mode credentials.
Definition wifi_mgmt.h:1110
uint32_t client_key_len
Client key length.
Definition wifi_mgmt.h:1122
uint8_t * client_cert2
Client certification of phase2.
Definition wifi_mgmt.h:1128
uint32_t client_key2_len
Phase2 Client key length.
Definition wifi_mgmt.h:1134
uint32_t client_cert_len
Client certification length.
Definition wifi_mgmt.h:1118
uint32_t ca_cert_len
CA certification length.
Definition wifi_mgmt.h:1114
uint8_t * client_cert
Client certification.
Definition wifi_mgmt.h:1116
uint8_t * client_key
Client key.
Definition wifi_mgmt.h:1120
uint32_t server_key_len
Server key length.
Definition wifi_mgmt.h:1142
uint8_t * dh_param
Diffie–Hellman parameter.
Definition wifi_mgmt.h:1144
uint8_t * client_key2
Client key of phase2.
Definition wifi_mgmt.h:1132
uint32_t ca_cert2_len
Phase2 CA certification length.
Definition wifi_mgmt.h:1126
uint32_t dh_param_len
Diffie–Hellman parameter length.
Definition wifi_mgmt.h:1146
uint8_t * server_key
Server key.
Definition wifi_mgmt.h:1140
uint32_t server_cert_len
Server certification length.
Definition wifi_mgmt.h:1138
uint8_t * server_cert
Server certification.
Definition wifi_mgmt.h:1136
uint8_t * ca_cert2
CA certification of phase2.
Definition wifi_mgmt.h:1124
uint32_t client_cert2_len
Phase2 Client certification length.
Definition wifi_mgmt.h:1130
uint8_t * ca_cert
CA certification.
Definition wifi_mgmt.h:1112
Wi-Fi filter setting for monitor, prmoiscuous, TX-injection modes.
Definition wifi_mgmt.h:1341
uint16_t buffer_size
Filter buffer size.
Definition wifi_mgmt.h:1347
uint8_t filter
Filter setting.
Definition wifi_mgmt.h:1343
enum wifi_mgmt_op oper
Get or set operation.
Definition wifi_mgmt.h:1349
uint8_t if_index
Interface index.
Definition wifi_mgmt.h:1345
Wi-Fi interface status.
Definition wifi_mgmt.h:924
unsigned short beacon_interval
Beacon interval.
Definition wifi_mgmt.h:954
enum wifi_wpa3_enterprise_type wpa3_ent_type
WPA3 enterprise type.
Definition wifi_mgmt.h:942
char ssid[WIFI_SSID_MAX_LEN+1]
SSID.
Definition wifi_mgmt.h:930
float current_phy_tx_rate
The current 802.11 PHY TX data rate (in Mbps).
Definition wifi_mgmt.h:958
int rssi
RSSI.
Definition wifi_mgmt.h:950
char bssid[WIFI_MAC_ADDR_LEN]
BSSID.
Definition wifi_mgmt.h:932
enum wifi_security_type security
Security type, see enum wifi_security_type.
Definition wifi_mgmt.h:944
unsigned int channel
Channel.
Definition wifi_mgmt.h:936
enum wifi_wep_key_type wep_key_type
WEP key type (64-bit or 128-bit), see enum wifi_wep_key_type.
Definition wifi_mgmt.h:946
enum wifi_mfp_options mfp
MFP options, see enum wifi_mfp_options.
Definition wifi_mgmt.h:948
unsigned char dtim_period
DTIM period.
Definition wifi_mgmt.h:952
int state
Interface state, see enum wifi_iface_state.
Definition wifi_mgmt.h:926
bool twt_capable
is TWT capable?
Definition wifi_mgmt.h:956
enum wifi_iface_mode iface_mode
Interface mode, see enum wifi_iface_mode.
Definition wifi_mgmt.h:938
unsigned int ssid_len
SSID length.
Definition wifi_mgmt.h:928
enum wifi_frequency_bands band
Frequency band.
Definition wifi_mgmt.h:934
enum wifi_link_mode link_mode
Link mode, see enum wifi_link_mode.
Definition wifi_mgmt.h:940
Wi-Fi management API.
Definition wifi_mgmt.h:1948
int(* ap_config_params)(const struct device *dev, struct net_if *iface, struct wifi_ap_config_params *params)
Configure AP parameter.
Definition wifi_mgmt.h:2237
int(* set_bgscan)(const struct device *dev, struct net_if *iface, struct wifi_bgscan_params *params)
Configure background scanning.
Definition wifi_mgmt.h:2362
int(* mode)(const struct device *dev, struct net_if *iface, struct wifi_mode_info *mode)
Set or get mode of operation.
Definition wifi_mgmt.h:2141
int(* send_11k_neighbor_request)(const struct device *dev, struct net_if *iface, struct wifi_11k_params *params)
Send 11k neighbor request.
Definition wifi_mgmt.h:2064
int(* set_bss_max_idle_period)(const struct device *dev, struct net_if *iface, unsigned short bss_max_idle_period)
Set BSS max idle period.
Definition wifi_mgmt.h:2350
int(* ap_disable)(const struct device *dev, struct net_if *iface)
Disable AP mode.
Definition wifi_mgmt.h:2002
int(* channel)(const struct device *dev, struct net_if *iface, struct wifi_channel_info *channel)
Set or get current channel of operation.
Definition wifi_mgmt.h:2150
int(* set_power_save)(const struct device *dev, struct net_if *iface, struct wifi_ps_params *params)
Set power save status.
Definition wifi_mgmt.h:2075
int(* set_btwt)(const struct device *dev, struct net_if *iface, struct wifi_twt_params *params)
Setup BTWT flow.
Definition wifi_mgmt.h:2097
int(* filter)(const struct device *dev, struct net_if *iface, struct wifi_filter_info *filter)
Set or get packet filter settings for monitor and promiscuous modes.
Definition wifi_mgmt.h:2130
bool(* bss_support_neighbor_rep)(const struct device *dev, struct net_if *iface)
Check if ap support Neighbor Report or not.
Definition wifi_mgmt.h:2170
int(* config_params)(const struct device *dev, struct net_if *iface, struct wifi_config_params *params)
Configure STA parameter.
Definition wifi_mgmt.h:2248
int(* connect)(const struct device *dev, struct net_if *iface, struct wifi_connect_req_params *params)
Connect to a Wi-Fi network.
Definition wifi_mgmt.h:1973
int(* candidate_scan)(const struct device *dev, struct net_if *iface, struct wifi_scan_params *params)
Trigger candidate scan.
Definition wifi_mgmt.h:2329
int(* pmksa_flush)(const struct device *dev, struct net_if *iface)
Flush PMKSA cache entries.
Definition wifi_mgmt.h:2285
int(* get_version)(const struct device *dev, struct net_if *iface, struct wifi_version *params)
Get Version of WiFi driver and Firmware.
Definition wifi_mgmt.h:2204
int(* reset_stats)(const struct device *dev, struct net_if *iface)
Reset Wi-Fi statistics.
Definition wifi_mgmt.h:2043
int(* reg_domain)(const struct device *dev, struct net_if *iface, struct wifi_reg_domain *reg_domain)
Set or get regulatory domain.
Definition wifi_mgmt.h:2119
int(* disconnect)(const struct device *dev, struct net_if *iface)
Disconnect from a Wi-Fi network.
Definition wifi_mgmt.h:1983
int(* legacy_roam)(const struct device *dev, struct net_if *iface)
Send legacy scan.
Definition wifi_mgmt.h:2189
int(* get_power_save_config)(const struct device *dev, struct net_if *iface, struct wifi_ps_config *config)
Get power save config.
Definition wifi_mgmt.h:2108
int(* iface_status)(const struct device *dev, struct net_if *iface, struct wifi_iface_status *status)
Get interface status.
Definition wifi_mgmt.h:2021
int(* ap_enable)(const struct device *dev, struct net_if *iface, struct wifi_connect_req_params *params)
Enable AP mode.
Definition wifi_mgmt.h:1993
int(* cfg_11k)(const struct device *dev, struct net_if *iface, struct wifi_11k_params *params)
Set or get 11K status.
Definition wifi_mgmt.h:2053
int(* get_conn_params)(const struct device *dev, struct net_if *iface, struct wifi_connect_req_params *params)
Get Wi-Fi connection parameters recently used.
Definition wifi_mgmt.h:2215
int(* wps_config)(const struct device *dev, struct net_if *iface, struct wifi_wps_config_params *params)
Start a WPS PBC/PIN connection.
Definition wifi_mgmt.h:2318
int(* get_stats)(const struct device *dev, struct net_if *iface, struct net_stats_wifi *stats)
Get Wi-Fi statistics.
Definition wifi_mgmt.h:2033
int(* start_11r_roaming)(const struct device *dev, struct net_if *iface)
Start 11r roaming.
Definition wifi_mgmt.h:2341
int(* bss_ext_capab)(const struct device *dev, struct net_if *iface, int capab)
Judge ap whether support the capability.
Definition wifi_mgmt.h:2180
int(* scan)(const struct device *dev, struct net_if *iface, struct wifi_scan_params *params, scan_result_cb_t cb)
Scan for Wi-Fi networks.
Definition wifi_mgmt.h:1961
int(* btm_query)(const struct device *dev, struct net_if *iface, uint8_t reason)
Send BTM query.
Definition wifi_mgmt.h:2162
int(* get_rts_threshold)(const struct device *dev, struct net_if *iface, unsigned int *rts_threshold)
Set Wi-Fi enterprise mode CA/client Cert and key.
Definition wifi_mgmt.h:2307
int(* ap_sta_disconnect)(const struct device *dev, struct net_if *iface, const uint8_t *mac)
Disconnect a STA from AP.
Definition wifi_mgmt.h:2011
int(* set_rts_threshold)(const struct device *dev, struct net_if *iface, unsigned int rts_threshold)
Set RTS threshold value.
Definition wifi_mgmt.h:2226
int(* set_twt)(const struct device *dev, struct net_if *iface, struct wifi_twt_params *params)
Setup or teardown TWT flow.
Definition wifi_mgmt.h:2086
Wi-Fi mode setup.
Definition wifi_mgmt.h:1331
enum wifi_mgmt_op oper
Get or set operation.
Definition wifi_mgmt.h:1337
uint8_t mode
Mode setting for a specific mode of operation.
Definition wifi_mgmt.h:1333
uint8_t if_index
Interface index.
Definition wifi_mgmt.h:1335
Wi-Fi power save configuration.
Definition wifi_mgmt.h:1150
struct wifi_ps_params ps_params
Power save configuration.
Definition wifi_mgmt.h:1156
char num_twt_flows
Number of TWT flows.
Definition wifi_mgmt.h:1152
struct wifi_twt_flow_info twt_flows[WIFI_MAX_TWT_FLOWS]
TWT flow details.
Definition wifi_mgmt.h:1154
Wi-Fi power save parameters.
Definition wifi_mgmt.h:962
enum wifi_ps_mode mode
Wi-Fi power save mode.
Definition wifi_mgmt.h:970
enum wifi_config_ps_param_fail_reason fail_reason
Wi-Fi power save fail reason.
Definition wifi_mgmt.h:983
enum wifi_ps_wakeup_mode wakeup_mode
Wi-Fi power save wakeup mode.
Definition wifi_mgmt.h:968
unsigned short listen_interval
Listen interval.
Definition wifi_mgmt.h:966
enum wifi_ps_exit_strategy exit_strategy
Wi-Fi power save exit strategy.
Definition wifi_mgmt.h:985
enum wifi_ps enabled
Power save state.
Definition wifi_mgmt.h:964
unsigned int timeout_ms
Wi-Fi power save timeout.
Definition wifi_mgmt.h:979
enum wifi_ps_param_type type
Wi-Fi power save type.
Definition wifi_mgmt.h:981
Wi-Fi raw scan result.
Definition wifi_mgmt.h:1220
int8_t rssi
RSSI.
Definition wifi_mgmt.h:1222
uint8_t data[CONFIG_WIFI_MGMT_RAW_SCAN_RESULT_LENGTH]
Raw scan data.
Definition wifi_mgmt.h:1228
int frame_length
Frame length.
Definition wifi_mgmt.h:1224
unsigned short frequency
Frequency.
Definition wifi_mgmt.h:1226
Per-channel regulatory attributes.
Definition wifi_mgmt.h:1181
unsigned short center_frequency
Center frequency in MHz.
Definition wifi_mgmt.h:1183
unsigned short dfs
Is a DFS channel.
Definition wifi_mgmt.h:1191
unsigned short supported
Is channel supported or not.
Definition wifi_mgmt.h:1187
unsigned short passive_only
Passive transmissions only.
Definition wifi_mgmt.h:1189
unsigned short max_power
Maximum transmission power (in dBm).
Definition wifi_mgmt.h:1185
Regulatory domain information or configuration.
Definition wifi_mgmt.h:1195
unsigned int num_channels
Number of channels supported.
Definition wifi_mgmt.h:1205
enum wifi_mgmt_op oper
Regulatory domain operation.
Definition wifi_mgmt.h:1197
struct wifi_reg_chan_info * chan_info
Channels information.
Definition wifi_mgmt.h:1207
bool force
Ignore all other regulatory hints over this one, the behavior is implementation specific.
Definition wifi_mgmt.h:1201
uint8_t country_code[WIFI_COUNTRY_CODE_LEN]
Country code: ISO/IEC 3166-1 alpha-2.
Definition wifi_mgmt.h:1203
Wi-Fi scan parameters structure.
Definition wifi_mgmt.h:604
uint16_t max_bss_cnt
Specifies the maximum number of scan results to return.
Definition wifi_mgmt.h:633
uint16_t dwell_time_active
Active scan dwell time (in ms) on a channel.
Definition wifi_mgmt.h:619
enum wifi_scan_type scan_type
Scan type, see enum wifi_scan_type.
Definition wifi_mgmt.h:612
uint8_t bands
Bitmap of bands to be scanned.
Definition wifi_mgmt.h:616
uint16_t dwell_time_passive
Passive scan dwell time (in ms) on a channel.
Definition wifi_mgmt.h:622
struct wifi_band_channel band_chan[WIFI_MGMT_SCAN_CHAN_MAX_MANUAL]
Channel information array indexed on Wi-Fi frequency bands and channels within that band.
Definition wifi_mgmt.h:648
const char * ssids[WIFI_MGMT_SCAN_SSID_FILT_MAX]
Array of SSID strings to scan.
Definition wifi_mgmt.h:625
Wi-Fi scan result, each result is provided to the net_mgmt_event_callback via its info attribute (see...
Definition wifi_mgmt.h:654
uint8_t ssid_length
SSID length.
Definition wifi_mgmt.h:658
uint8_t band
Frequency band.
Definition wifi_mgmt.h:660
uint8_t mac[WIFI_MAC_ADDR_LEN]
BSSID.
Definition wifi_mgmt.h:672
int8_t rssi
RSSI.
Definition wifi_mgmt.h:670
uint8_t mac_length
BSSID length.
Definition wifi_mgmt.h:674
uint8_t ssid[WIFI_SSID_MAX_LEN+1]
SSID.
Definition wifi_mgmt.h:656
enum wifi_wpa3_enterprise_type wpa3_ent_type
WPA3 enterprise type.
Definition wifi_mgmt.h:666
enum wifi_mfp_options mfp
MFP options.
Definition wifi_mgmt.h:668
uint8_t channel
Channel.
Definition wifi_mgmt.h:662
enum wifi_security_type security
Security type.
Definition wifi_mgmt.h:664
Generic Wi-Fi status for commands and events.
Definition wifi_mgmt.h:910
enum wifi_ap_status ap_status
Access point status.
Definition wifi_mgmt.h:919
enum wifi_conn_status conn_status
Connection status.
Definition wifi_mgmt.h:915
enum wifi_disconn_reason disconn_reason
Disconnection reason status.
Definition wifi_mgmt.h:917
int status
Status value.
Definition wifi_mgmt.h:913
Wi-Fi TWT flow information.
Definition wifi_mgmt.h:1086
uint8_t dialog_token
Dialog token, used to map requests to responses.
Definition wifi_mgmt.h:1090
enum wifi_twt_negotiation_type negotiation_type
TWT negotiation type, see enum wifi_twt_negotiation_type.
Definition wifi_mgmt.h:1094
uint32_t twt_wake_ahead_duration
Wake ahead duration.
Definition wifi_mgmt.h:1106
bool trigger
Trigger enabled or disabled.
Definition wifi_mgmt.h:1098
bool responder
Requestor or responder.
Definition wifi_mgmt.h:1096
uint8_t flow_id
Flow ID, used to map setup with teardown.
Definition wifi_mgmt.h:1092
uint64_t twt_interval
Interval = Wake up time + Sleeping time.
Definition wifi_mgmt.h:1088
uint32_t twt_wake_interval
Wake up time.
Definition wifi_mgmt.h:1104
bool implicit
Implicit or explicit.
Definition wifi_mgmt.h:1100
bool announce
Announced or unannounced.
Definition wifi_mgmt.h:1102
Wi-Fi TWT parameters.
Definition wifi_mgmt.h:1003
bool announce
Announced or unannounced.
Definition wifi_mgmt.h:1030
bool teardown_all
Teardown all flows.
Definition wifi_mgmt.h:1062
enum wifi_twt_setup_cmd setup_cmd
TWT setup command, see enum wifi_twt_setup_cmd.
Definition wifi_mgmt.h:1009
uint16_t btwt_offset
Broadcast TWT offset.
Definition wifi_mgmt.h:1051
bool trigger
Trigger enabled or disabled.
Definition wifi_mgmt.h:1026
enum wifi_twt_negotiation_type negotiation_type
TWT negotiation type, see enum wifi_twt_negotiation_type.
Definition wifi_mgmt.h:1007
enum wifi_twt_operation operation
TWT operation, see enum wifi_twt_operation.
Definition wifi_mgmt.h:1005
uint32_t twt_wake_ahead_duration
Wake ahead notification is sent earlier than TWT Service period (SP) start based on this duration.
Definition wifi_mgmt.h:1038
enum wifi_twt_fail_reason fail_reason
TWT fail reason, see enum wifi_twt_fail_reason.
Definition wifi_mgmt.h:1066
uint32_t twt_wake_interval
Wake up time.
Definition wifi_mgmt.h:1032
uint8_t btwt_li
In multiple of 4 beacon interval.
Definition wifi_mgmt.h:1053
enum wifi_twt_setup_resp_status resp_status
TWT setup response status, see enum wifi_twt_setup_resp_status.
Definition wifi_mgmt.h:1011
bool implicit
Implicit or explicit.
Definition wifi_mgmt.h:1028
uint8_t flow_id
Flow ID, used to map setup with teardown.
Definition wifi_mgmt.h:1017
struct wifi_twt_params::@142010065304112155221017375176376104176123122145::@133136031370272243054104113363023054234327020330 setup
Setup specific parameters.
enum wifi_twt_teardown_status teardown_status
TWT teardown cmd status, see enum wifi_twt_teardown_status.
Definition wifi_mgmt.h:1013
uint8_t btwt_sta_wait
Broadcast TWT station wait time.
Definition wifi_mgmt.h:1049
struct wifi_btwt_params btwt_set_cfg[5]
Broadcast TWT agreement sets.
Definition wifi_mgmt.h:1057
struct wifi_twt_params::@142010065304112155221017375176376104176123122145::@354056177023017106017062105137255212157035234147 btwt
Setup specific parameters.
uint8_t twt_exponent
TWT exponent.
Definition wifi_mgmt.h:1042
uint16_t twt_mantissa
TWT Mantissa Range: [0-sizeof(UINT16)].
Definition wifi_mgmt.h:1044
uint64_t twt_interval
Interval = Wake up time + Sleeping time.
Definition wifi_mgmt.h:1022
struct wifi_twt_params::@142010065304112155221017375176376104176123122145::@373031221051136207356324125344151215231253205055 teardown
Teardown specific parameters.
bool twt_info_disable
TWT info enabled or disable.
Definition wifi_mgmt.h:1040
uint8_t dialog_token
Dialog token, used to map requests to responses.
Definition wifi_mgmt.h:1015
bool responder
Requestor or responder.
Definition wifi_mgmt.h:1024
uint8_t btwt_count
Broadcast TWT agreement count.
Definition wifi_mgmt.h:1055
Wi-Fi version.
Definition wifi_mgmt.h:582
const char * fw_version
Firmware version.
Definition wifi_mgmt.h:586
const char * drv_version
Driver version.
Definition wifi_mgmt.h:584
Wi-Fi wps setup.
Definition wifi_mgmt.h:1719
char pin[8+1]
pin value
Definition wifi_mgmt.h:1723
enum wifi_wps_op oper
wps operation
Definition wifi_mgmt.h:1721
IEEE 802.11 protocol and general Wi-Fi definitions.