Morse Micro IoT SDK  2.12.3
mmwlan.h
1/*
2 * Copyright 2021-2024 Morse Micro
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
33#pragma once
34
35#include <stdarg.h>
36#include <stdint.h>
37#include <stdlib.h>
38#include <stdbool.h>
39#include <string.h>
40
41#include "mmpkt.h"
42
43#ifdef __cplusplus
44extern "C"
45{
46#endif
47
50{
87};
88
90#define MMWLAN_SSID_MAXLEN (32)
91
93#define MMWLAN_PASSPHRASE_MAXLEN (100)
94
96#define MMWLAN_MAC_ADDR_LEN (6)
97
99#define MMWLAN_MAX_EC_GROUPS (4)
100
102#define MMWLAN_OUI_SIZE (3)
103
108{
115};
116
119{
126};
127
130{
136
149#define MMWLAN_SKIP_OP_CLASS_CHECK -1
150
153{
167 uint8_t bw_mhz;
176};
177
179#define MMWLAN_COUNTRY_CODE_LEN 3
180
183{
187 unsigned num_channels;
190};
191
197{
199 unsigned num_domains;
200
203};
204
215 const struct mmwlan_regulatory_db *db,
216 const char *country_code)
217{
218 unsigned ii;
219
220 if (db == NULL)
221 {
222 return NULL;
223 }
224
225 for (ii = 0; ii < db->num_domains; ii++)
226 {
227 const struct mmwlan_s1g_channel_list *channel_list = db->domains[ii];
228 if (channel_list->country_code[0] == country_code[0] &&
229 channel_list->country_code[1] == country_code[1])
230 {
231 return channel_list;
232 }
233 }
234 return NULL;
235}
236
254
257{
262};
263
276
281{
283 uint32_t duty_cycle;
290};
291
300
312#define MMWLAN_MORSELIB_VERSION_MAXLEN (32)
314#define MMWLAN_FW_VERSION_MAXLEN (32)
316#define MMWLAN_CHIP_ID_STRING_MAXLEN (32)
317
320{
329};
330
342
344#define MMWLAN_BCF_BOARD_DESC_MAXLEN (31)
346#define MMWLAN_BCF_BUILD_VERSION_MAXLEN (31)
347
350{
352 struct
353 {
355 uint16_t major;
357 uint8_t minor;
359 uint8_t patch;
361
369
377};
378
387
405enum mmwlan_status mmwlan_override_max_tx_power(uint16_t tx_power_dbm);
406
417enum mmwlan_status mmwlan_set_rts_threshold(unsigned rts_threshold);
418
434
449enum mmwlan_status mmwlan_set_subbands_enabled(bool subbands_enabled);
450
462
467#define MMWLAN_MINIMUM_FRAGMENT_THRESHOLD (256)
468
488enum mmwlan_status mmwlan_set_fragment_threshold(unsigned fragment_threshold);
489
491#define MMWLAN_QOS_QUEUE_NUM_ACIS 4
492
495{
497 uint8_t aci;
499 uint8_t aifs;
501 uint16_t cw_min;
503 uint16_t cw_max;
505 uint32_t txop_max_us;
506};
507
528 size_t count);
529
532{
540
549
563
567#ifndef MMWLAN_DEFAULT_MIN_HEALTH_CHECK_INTERVAL_MS
568#define MMWLAN_DEFAULT_MIN_HEALTH_CHECK_INTERVAL_MS 60000
569#endif
570
574#ifndef MMWLAN_DEFAULT_MAX_HEALTH_CHECK_INTERVAL_MS
575#define MMWLAN_DEFAULT_MAX_HEALTH_CHECK_INTERVAL_MS 120000
576#endif
577
590 uint32_t max_interval_ms);
591
610{
615 const uint8_t *sta_mac_addr_override;
616};
617
623#define MMWLAN_BOOT_ARGS_INIT { NULL }
624
639
649
672enum mmwlan_status mmwlan_get_vif_mac_addr(enum mmwlan_vif vif, uint8_t *mac_addr);
673
688static inline enum mmwlan_status mmwlan_get_mac_addr(uint8_t *mac_addr)
689{
690 return mmwlan_get_vif_mac_addr(MMWLAN_VIF_STA, mac_addr);
691}
692
705{
707 int16_t rssi;
709 const uint8_t *bssid;
711 const uint8_t *ssid;
713 const uint8_t *ies;
719 uint16_t ies_len;
721 uint8_t ssid_len;
725 uint8_t bw_mhz;
727 uint8_t op_bw_mhz;
732 int8_t noise_dbm;
734 uint64_t tsf;
735};
736
738typedef void (*mmwlan_scan_rx_cb_t)(const struct mmwlan_scan_result *result, void *arg);
739
752{
760
773
781};
782
784#define MMWLAN_SCAN_CONFIG_INIT \
785 { MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS, false, MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS }
786
797#define MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS (30)
799#define MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS (200)
800
802#define MMWLAN_SCAN_MIN_DWELL_TIME_MS (15)
803
808{
816};
817
819typedef void (*mmwlan_scan_complete_cb_t)(enum mmwlan_scan_state scan_state, void *arg);
820
826{
838 uint8_t *extra_ies;
847 uint16_t ssid_len;
854};
855
865#define MMWLAN_SCAN_ARGS_INIT \
866 { \
867 .dwell_time_ms = MMWLAN_SCAN_DEFAULT_DWELL_TIME_MS, \
868 .extra_ies = NULL, \
869 .extra_ies_len = 0, \
870 .ssid = { 0 }, \
871 .ssid_len = 0, \
872 .dwell_on_home_ms = MMWLAN_SCAN_DEFAULT_DWELL_ON_HOME_MS, \
873 }
874
879{
888};
889
899#define MMWLAN_SCAN_REQ_INIT { NULL, NULL, NULL, MMWLAN_SCAN_ARGS_INIT }
900
919
929
942#define DEFAULT_BGSCAN_SHORT_INTERVAL_S (0)
943
945#define DEFAULT_BGSCAN_THRESHOLD_DBM (0)
946
949#define DEFAULT_BGSCAN_LONG_INTERVAL_S (0)
950
952#define DEFAULT_TWT_WAKE_INTERVAL_US (300000000)
953
955#define DEFAULT_TWT_MIN_WAKE_DURATION_US (65280)
956
958#define MMWLAN_DEFAULT_SCAN_INTERVAL_BASE_S (2)
959
961#define MMWLAN_DEFAULT_SCAN_INTERVAL_LIMIT_S (512)
962
964#define MMWLAN_RAW_MAX_PRIORITY (7)
965
968{
974
977{
982};
983
986{
992
997{
998 MMWLAN_STA_TYPE_SENSOR = 0x01,
999 MMWLAN_STA_TYPE_NON_SENSOR = 0x02,
1000};
1001
1006{
1007 MMWLAN_STA_DISABLED,
1008 MMWLAN_STA_CONNECTING,
1009 MMWLAN_STA_CONNECTED,
1010};
1011
1013typedef void (*mmwlan_sta_status_cb_t)(enum mmwlan_sta_state sta_state);
1014
1022{
1042};
1043
1046{
1049};
1050
1057typedef void (*mmwlan_sta_event_cb_t)(const struct mmwlan_sta_event_cb_args *sta_event, void *arg);
1058
1074{
1078 uint16_t ssid_len;
1187};
1188
1194#define MMWLAN_STA_ARGS_INIT \
1195 { \
1196 .ssid = { 0 }, \
1197 .ssid_len = 0, \
1198 .bssid = { 0 }, \
1199 .security_type = MMWLAN_OPEN, \
1200 .passphrase = { 0 }, \
1201 .passphrase_len = 0, \
1202 .pmf_mode = MMWLAN_PMF_REQUIRED, \
1203 .raw_sta_priority = -1, \
1204 .sta_type = MMWLAN_STA_TYPE_NON_SENSOR, \
1205 .sae_owe_ec_groups = { 0 }, \
1206 .cac_mode = MMWLAN_CAC_DISABLED, \
1207 .bgscan_short_interval_s = DEFAULT_BGSCAN_SHORT_INTERVAL_S, \
1208 .bgscan_signal_threshold_dbm = DEFAULT_BGSCAN_THRESHOLD_DBM, \
1209 .bgscan_long_interval_s = DEFAULT_BGSCAN_LONG_INTERVAL_S, \
1210 .scan_rx_cb = NULL, \
1211 .scan_rx_cb_arg = NULL, \
1212 .scan_interval_base_s = MMWLAN_DEFAULT_SCAN_INTERVAL_BASE_S, \
1213 .scan_interval_limit_s = MMWLAN_DEFAULT_SCAN_INTERVAL_LIMIT_S, \
1214 .extra_assoc_ies = NULL, \
1215 .extra_assoc_ies_len = 0, \
1216 .sta_evt_cb = NULL, \
1217 .sta_evt_cb_arg = NULL, \
1218 .use_4addr = MMWLAN_4ADDR_MODE_DISABLED, \
1219 }
1220
1243 mmwlan_sta_status_cb_t sta_status_cb);
1244
1255
1262
1274
1276#define MMWLAN_DEFAULT_DYNAMIC_PS_TIMEOUT_MS 100;
1277
1301
1318enum mmwlan_status mmwlan_set_non_tim_mode_enabled(bool non_tim_mode_enabled);
1319
1326{
1334
1337{
1345
1348{
1371};
1372
1382#define MMWLAN_TWT_CONFIG_ARGS_INIT \
1383 { \
1384 .twt_mode = MMWLAN_TWT_DISABLED, \
1385 .twt_wake_interval_us = DEFAULT_TWT_WAKE_INTERVAL_US, \
1386 .twt_wake_interval_mantissa = 0, \
1387 .twt_wake_interval_exponent = 0, \
1388 .twt_min_wake_duration_us = DEFAULT_TWT_MIN_WAKE_DURATION_US, \
1389 .twt_setup_command = MMWLAN_TWT_SETUP_REQUEST, \
1390 }
1391
1403 const struct mmwlan_twt_config_args *twt_config_args);
1404
1410uint16_t mmwlan_get_aid(void);
1411
1420enum mmwlan_status mmwlan_get_bssid(uint8_t *bssid);
1421
1429int32_t mmwlan_get_rssi(void);
1430
1442
1482{
1487};
1488
1498#define MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT { false, false }
1499
1527 const struct mmwlan_set_wnm_sleep_enabled_args *args);
1528
1554static inline enum mmwlan_status mmwlan_set_wnm_sleep_enabled(bool wnm_sleep_enabled)
1555{
1556 struct mmwlan_set_wnm_sleep_enabled_args wnm_sleep_args =
1558 wnm_sleep_args.wnm_sleep_enabled = wnm_sleep_enabled;
1559 return mmwlan_set_wnm_sleep_enabled_ext(&wnm_sleep_args);
1560}
1561
1582{
1587};
1588
1596{
1597 /* QR code presence announcement (chirp) */
1602
1603 /* Push Button flow */
1610
1611 /* DPP Authentication phase */
1620
1621 /* DPP Configuration phase */
1630};
1631
1639{
1646};
1647
1655{
1662};
1663
1671{
1678};
1679
1687{
1690
1692 union
1693 {
1695 struct
1696 {
1700
1702 struct
1703 {
1705 const uint8_t *ssid;
1707 uint16_t ssid_len;
1709 const char *passphrase;
1711
1713 struct
1714 {
1716 const uint8_t *peer_mac;
1718
1720 struct
1721 {
1724 const uint8_t *peer_mac;
1726
1728 struct
1729 {
1734
1736 struct
1737 {
1741
1743 struct
1744 {
1749};
1750
1752#define MMWLAN_DPP_BOOTSTRAP_KEY_MAX_LEN 128
1753
1761{
1799};
1800
1808{
1810 void (*dpp_event_cb)(const struct mmwlan_dpp_cb_args *dpp_event, void *arg);
1817};
1818
1824#define MMWLAN_DPP_ARGS_INIT \
1825 { \
1826 .dpp_event_cb = NULL, \
1827 .dpp_event_cb_arg = NULL, \
1828 .mode = MMWLAN_DPP_MODE_PUSH_BUTTON, \
1829 .qr = { 0 }, \
1830 }
1831
1849
1859
1875enum mmwlan_status mmwlan_dpp_get_uri(char *uri_buf, size_t buf_len);
1876
1891#define MMWLAN_DEFAULT_AP_BEACON_INTERVAL_TUS (100)
1892
1894#define MMWLAN_DEFAULT_AP_DTIM_PERIOD (1)
1895
1897#define MMWLAN_DEFAULT_AP_MAX_STAS (4)
1898
1900#define MMWLAN_AP_MAX_STAS_LIMIT (20)
1901
1909{
1918};
1919
1927{
1931 uint16_t aid;
1934};
1935
1945typedef void (*mmwlan_ap_sta_status_cb_t)(const struct mmwlan_ap_sta_status *sta_status, void *arg);
1946
1959enum mmwlan_status mmwlan_ap_get_sta_status(const uint8_t *sta_addr,
1960 struct mmwlan_ap_sta_status *sta_status);
1961
1980{
1984 uint16_t ssid_len;
2016 uint16_t op_class;
2040 uint16_t dtim_period;
2051 uint8_t pri_bw_mhz;
2077 uint8_t max_stas;
2085};
2086
2092#define MMWLAN_AP_ARGS_INIT \
2093 { \
2094 .ssid = { 0 }, \
2095 .ssid_len = 0, \
2096 .bssid = { 0 }, \
2097 .security_type = MMWLAN_OPEN, \
2098 .passphrase = { 0 }, \
2099 .passphrase_len = 0, \
2100 .pmf_mode = MMWLAN_PMF_REQUIRED, \
2101 .sae_owe_ec_groups = { 0 }, \
2102 .op_class = 0, \
2103 .s1g_chan_num = 0, \
2104 .beacon_interval_tus = 0, \
2105 .dtim_period = 0, \
2106 .pri_bw_mhz = 0, \
2107 .pri_1mhz_chan_idx = 0, \
2108 .sta_status_cb = NULL, \
2109 .sta_status_cb_arg = NULL, \
2110 .max_stas = 0, \
2111 .async_start = false, \
2112 }
2113
2136
2152
2163static inline enum mmwlan_status mmwlan_ap_get_bssid(uint8_t *bssid)
2164{
2166}
2167
2183#define MMWLAN_RELAY_DEFAULT_FORWARDING_TABLE_SIZE (64)
2184
2203{
2210
2213};
2214
2220#define MMWLAN_RELAY_ARGS_INIT \
2221 { \
2222 .forwarding_table_size = 0, \
2223 .is_root_node = false, \
2224 }
2225
2239
2250
2265#define MMWLAN_BEACON_VENDOR_IE_MAX_OUI_FILTERS (5)
2266
2275typedef void (
2276 *mmwlan_beacon_vendor_ie_filter_cb_t)(const uint8_t *ies, uint32_t ies_len, void *arg);
2277
2280
2283{
2294 void *cb_arg;
2297 uint8_t n_ouis;
2300};
2301
2315
2318/*
2319 * ---------------------------------------------------------------------------------------------
2320 */
2321
2338void mmwlan_init(void);
2339
2347void mmwlan_deinit(void);
2348
2351/*
2352 * ---------------------------------------------------------------------------------------------
2353 */
2354
2365{
2368};
2369
2376typedef void (*mmwlan_link_state_cb_t)(enum mmwlan_link_state link_state, void *arg);
2377
2398
2401{
2406};
2407
2414typedef void (*mmwlan_vif_state_cb_t)(const struct mmwlan_vif_state *state, void *arg);
2415
2433 mmwlan_vif_state_cb_t callback,
2434 void *arg);
2435
2440{
2442 uint16_t op_class;
2446 uint8_t pri_bw_mhz;
2449};
2450
2461 struct mmwlan_vif_channel_info *info);
2462
2472typedef void (*mmwlan_rx_cb_t)(uint8_t *header,
2473 unsigned header_len,
2474 uint8_t *payload,
2475 unsigned payload_len,
2476 void *arg);
2477
2491
2499typedef void (*mmwlan_rx_pkt_cb_t)(struct mmpkt *mmpkt, void *arg);
2500
2514
2517{
2520
2522 uint8_t tid;
2523
2525 const uint8_t *ta;
2526};
2527
2539typedef void (*mmwlan_rx_pkt_ext_cb_t)(struct mmpkt *mmpkt,
2540 const struct mmwlan_rx_metadata *metadata,
2541 void *arg);
2542
2559 mmwlan_rx_pkt_ext_cb_t callback,
2560 void *arg);
2561
2572
2586struct mmpkt *mmwlan_alloc_mmpkt_for_tx(uint32_t payload_len, uint8_t tid);
2587
2589#define MMWLAN_TX_DEFAULT_TIMEOUT_MS (1000)
2590
2592#define MMWLAN_TX_DEFAULT_QOS_TID (0)
2593
2595#define MMWLAN_MAX_QOS_TID (7)
2596
2612{
2617 uint8_t tid;
2618
2628
2631 const uint8_t *ra;
2632};
2633
2637#define MMWLAN_TX_METADATA_INIT { MMWLAN_TX_DEFAULT_QOS_TID, MMWLAN_VIF_UNSPECIFIED, NULL }
2638
2672enum mmwlan_status mmwlan_tx_pkt(struct mmpkt *pkt, const struct mmwlan_tx_metadata *metadata);
2673
2699static inline enum mmwlan_status mmwlan_tx_tid(const uint8_t *data, unsigned len, uint8_t tid)
2700{
2701 enum mmwlan_status status;
2702 struct mmpkt *pkt;
2703 struct mmpktview *pktview;
2705
2707 if (status != MMWLAN_SUCCESS)
2708 {
2709 return status;
2710 }
2711
2712 pkt = mmwlan_alloc_mmpkt_for_tx(len, tid);
2713 if (pkt == NULL)
2714 {
2715 return MMWLAN_NO_MEM;
2716 }
2717
2718 pktview = mmpkt_open(pkt);
2719 mmpkt_append_data(pktview, data, len);
2720 mmpkt_close(&pktview);
2721
2722 metadata.tid = tid;
2723 return mmwlan_tx_pkt(pkt, &metadata);
2724}
2725
2750static inline enum mmwlan_status mmwlan_tx(const uint8_t *data, unsigned len)
2751{
2752 return mmwlan_tx_tid(data, len, MMWLAN_TX_DEFAULT_QOS_TID);
2753}
2754
2760{
2763};
2764
2777typedef void (*mmwlan_tx_flow_control_cb_t)(enum mmwlan_tx_flow_control_state state, void *arg);
2778
2792
2795{
2797 void *arg;
2799 uint32_t fileid;
2801 uint32_t line;
2802};
2803
2810
2824
2827/*
2828 * ---------------------------------------------------------------------------------------------
2829 */
2830
2841{
2843 uint32_t n_entries;
2845 uint32_t *rate_info;
2847 uint32_t *total_sent;
2849 uint32_t *total_success;
2850};
2851
2868{
2869 MMWLAN_RC_STATS_RATE_INFO_BW_OFFSET = 0,
2870 MMWLAN_RC_STATS_RATE_INFO_RATE_OFFSET = 4,
2871 MMWLAN_RC_STATS_RATE_INFO_GUARD_OFFSET = 8,
2872};
2873
2882
2889
2895{
2897 uint8_t *buf;
2899 uint32_t len;
2900};
2901
2914struct mmwlan_morse_stats *mmwlan_get_morse_stats(uint32_t core_num, bool reset);
2915
2922
2932
2942
2949
2954/*
2955 * ---------------------------------------------------------------------------------------------
2956 */
2957
2968{
2982
2985{
2992};
2993
2996{
3001};
3002
3016 enum mmwlan_bw bandwidth_override,
3017 enum mmwlan_gi gi_override);
3018
3037 uint32_t command_len,
3038 uint8_t *response,
3039 uint32_t *response_len);
3040
3043#ifdef __cplusplus
3044}
3045#endif
3046
struct mmwlan_beacon_vendor_ie_filter filter
Filter structure used when calling mmwlan_update_beacon_vendor_ie_filter().
static void mmpkt_append_data(struct mmpktview *view, const uint8_t *data, uint32_t len)
Appends the given data to the data already in the mmpkt.
Definition: mmpkt.h:462
static void mmpkt_close(struct mmpktview **view)
Close the given view.
Definition: mmpkt.h:266
static struct mmpktview * mmpkt_open(struct mmpkt *mmpkt)
Open a view of the given mmpkt.
Definition: mmpkt.h:251
mmwlan_ap_sta_state
Enumeration of STA states.
Definition: mmwlan.h:1909
enum mmwlan_status mmwlan_ap_disable(void)
Disable AP mode.
enum mmwlan_status mmwlan_ap_get_sta_status(const uint8_t *sta_addr, struct mmwlan_ap_sta_status *sta_status)
Gets the STA status of the STA with the given MAC address.
enum mmwlan_status mmwlan_ap_enable(const struct mmwlan_ap_args *args)
Enable AP mode.
void(* mmwlan_ap_sta_status_cb_t)(const struct mmwlan_ap_sta_status *sta_status, void *arg)
Type definition for callback to be invoked on change in status of a connected STA.
Definition: mmwlan.h:1945
static enum mmwlan_status mmwlan_ap_get_bssid(uint8_t *bssid)
Gets the BSSID address of the AP, if it is active.
Definition: mmwlan.h:2163
@ MMWLAN_AP_STA_AUTHORIZED
The STA is fully connected and authorized for data transmission.
Definition: mmwlan.h:1917
@ MMWLAN_AP_STA_ASSOCIATED
The STA is associated but not yet authorized for data transmission.
Definition: mmwlan.h:1915
@ MMWLAN_AP_STA_UNKNOWN
The STA is not known.
Definition: mmwlan.h:1911
@ MMWLAN_AP_STA_AUTHENTICATED
The STA is authenticated but not associated.
Definition: mmwlan.h:1913
enum mmwlan_status mmwlan_update_beacon_vendor_ie_filter(const struct mmwlan_beacon_vendor_ie_filter *filter)
Function to update the filter used to pass beacon back.
#define MMWLAN_BEACON_VENDOR_IE_MAX_OUI_FILTERS
Max number of OUIs supported in vendor IE OUI filter, mmwlan_beacon_vendor_ie_filter.
Definition: mmwlan.h:2265
void(* mmwlan_beacon_vendor_ie_filter_cb_t)(const uint8_t *ies, uint32_t ies_len, void *arg)
Beacon vendor ie filter callback function prototype.
Definition: mmwlan.h:2276
uint8_t mmwlan_oui_t[MMWLAN_OUI_SIZE]
24-bit OUI type.
Definition: mmwlan.h:2279
enum mmwlan_status mmwlan_get_version(struct mmwlan_version *version)
Retrieve version information from morselib and the connected Morse transceiver.
static enum mmwlan_status mmwlan_get_mac_addr(uint8_t *mac_addr)
Gets the MAC address of the STA interface.
Definition: mmwlan.h:688
enum mmwlan_status mmwlan_boot(const struct mmwlan_boot_args *args)
Boot the Morse Micro transceiver and leave it in an idle state.
enum mmwlan_status mmwlan_get_vif_mac_addr(enum mmwlan_vif vif, uint8_t *mac_addr)
Gets the MAC address of the given interface.
enum mmwlan_status mmwlan_set_ampdu_enabled(bool ampdu_enabled)
Sets whether or not Aggregated MAC Protocol Data Unit (A-MPDU) support is enabled.
enum mmwlan_status mmwlan_set_sgi_enabled(bool sgi_enabled)
Sets whether or not Short Guard Interval (SGI) support is enabled.
#define MMWLAN_BCF_BOARD_DESC_MAXLEN
Maximum length of a BCF board description string (excluding null terminator).
Definition: mmwlan.h:344
enum mmwlan_status mmwlan_set_control_response_preamble_1mhz_out_en(bool enabled)
Enables the 1MHz control response override.
enum mmwlan_status mmwlan_shutdown(void)
Perform a clean shutdown of the Morse Micro transceiver, including cleanly disconnecting from a conne...
#define MMWLAN_BCF_BUILD_VERSION_MAXLEN
Maximum length of a BCF build version string (excluding null terminator).
Definition: mmwlan.h:346
enum mmwlan_status mmwlan_get_bcf_metadata(struct mmwlan_bcf_metadata *metadata)
Read the metadata from the board configuration file (BCF).
mmwlan_mcs10_mode
Enumeration of configuration states for MCS10 behavior.
Definition: mmwlan.h:532
enum mmwlan_status mmwlan_set_health_check_interval(uint32_t min_interval_ms, uint32_t max_interval_ms)
Specify the upper and lower bound for the periodic health check interval.
enum mmwlan_status mmwlan_set_subbands_enabled(bool subbands_enabled)
Sets whether or not sub-band support is enabled for transmit.
enum mmwlan_status mmwlan_set_fragment_threshold(unsigned fragment_threshold)
Set the Fragmentation threshold.
enum mmwlan_status mmwlan_override_max_tx_power(uint16_t tx_power_dbm)
Override the maximum TX power.
#define MMWLAN_CHIP_ID_STRING_MAXLEN
Maximum length of the chip id string.
Definition: mmwlan.h:316
enum mmwlan_status mmwlan_set_rts_threshold(unsigned rts_threshold)
Set the RTS threshold.
enum mmwlan_status mmwlan_set_default_qos_queue_params(const struct mmwlan_qos_queue_params *params, size_t count)
Updates the default QoS queue configuration to the given values.
#define MMWLAN_FW_VERSION_MAXLEN
Maximum length of the firmware version string.
Definition: mmwlan.h:314
#define MMWLAN_MORSELIB_VERSION_MAXLEN
Maximum length of the Morselib version string.
Definition: mmwlan.h:312
enum mmwlan_status mmwlan_set_mcs10_mode(enum mmwlan_mcs10_mode mcs10_mode)
Configure the rate adaptation behavior around selecting MCS10.
@ MMWLAN_MCS10_MODE_AUTO
Use MCS10 on retries instead of MCS 0 if the bandwidth is 1 MHz.
Definition: mmwlan.h:538
@ MMWLAN_MCS10_MODE_FORCED
Always use MCS10 instead of MCS 0 if the bandwidth is 1 MHz.
Definition: mmwlan.h:536
@ MMWLAN_MCS10_MODE_DISABLED
MCS10 is disabled.
Definition: mmwlan.h:534
static enum mmwlan_status mmwlan_tx_tid(const uint8_t *data, unsigned len, uint8_t tid)
Transmit the given packet using the given QoS Traffic ID (TID).
Definition: mmwlan.h:2699
enum mmwlan_status mmwlan_register_rx_cb(mmwlan_rx_cb_t callback, void *arg)
Register a receive callback.
enum mmwlan_status mmwlan_register_rx_pkt_ext_cb(enum mmwlan_vif vif, mmwlan_rx_pkt_ext_cb_t callback, void *arg)
Register an extended receive callback which may consume an mmpkt.
enum mmwlan_status mmwlan_get_vif_channel_info(enum mmwlan_vif vif, struct mmwlan_vif_channel_info *info)
Gets the channel information for the specified VIF.
void mmwlan_register_fatal_error_handler(mmwlan_fatal_error_handler_t handler, void *arg)
Register a fatal error handler to be called in the event of an unrecoverable error.
void(* mmwlan_vif_state_cb_t)(const struct mmwlan_vif_state *state, void *arg)
Prototype for VIF state change callbacks.
Definition: mmwlan.h:2414
enum mmwlan_status mmwlan_tx_wait_until_ready(uint32_t timeout_ms)
Blocks until the transmit path is ready for transmit.
enum mmwlan_status mmwlan_register_rx_pkt_cb(mmwlan_rx_pkt_cb_t callback, void *arg)
Register a receive callback which consumes an mmpkt.
void(* mmwlan_link_state_cb_t)(enum mmwlan_link_state link_state, void *arg)
Prototype for link state change callbacks.
Definition: mmwlan.h:2376
void(* mmwlan_fatal_error_handler_t)(struct mmwlan_fatal_error_args *args)
Function type of fatal error handler.
Definition: mmwlan.h:2809
#define MMWLAN_TX_DEFAULT_QOS_TID
Default QoS Traffic ID (TID) to use for transmit (mmwlan_tx()).
Definition: mmwlan.h:2592
enum mmwlan_status mmwlan_register_link_state_cb(mmwlan_link_state_cb_t callback, void *arg)
Register a link status callback for use in STA mode.
enum mmwlan_status mmwlan_register_tx_flow_control_cb(mmwlan_tx_flow_control_cb_t cb, void *arg)
Register a transmit flow control callback.
mmwlan_tx_flow_control_state
Enumeration of states that can be returned by the transmit flow control callback (as registered by mm...
Definition: mmwlan.h:2760
mmwlan_link_state
Enumeration of link states.
Definition: mmwlan.h:2365
enum mmwlan_status mmwlan_register_vif_state_cb(enum mmwlan_vif vif, mmwlan_vif_state_cb_t callback, void *arg)
Register a VIF state callback.
struct mmpkt * mmwlan_alloc_mmpkt_for_tx(uint32_t payload_len, uint8_t tid)
Allocate an mmpkt data structure for transmission with at least enough space for the given payload le...
void(* mmwlan_rx_cb_t)(uint8_t *header, unsigned header_len, uint8_t *payload, unsigned payload_len, void *arg)
Receive data packet callback function.
Definition: mmwlan.h:2472
void(* mmwlan_tx_flow_control_cb_t)(enum mmwlan_tx_flow_control_state state, void *arg)
Transmit flow control callback function type.
Definition: mmwlan.h:2777
static enum mmwlan_status mmwlan_tx(const uint8_t *data, unsigned len)
Transmit the given packet using MMWLAN_TX_DEFAULT_QOS_TID.
Definition: mmwlan.h:2750
enum mmwlan_status mmwlan_tx_pkt(struct mmpkt *pkt, const struct mmwlan_tx_metadata *metadata)
Transmit the given packet.
#define MMWLAN_TX_METADATA_INIT
Initializer for mmwlan_tx_metadata.
Definition: mmwlan.h:2637
void(* mmwlan_rx_pkt_ext_cb_t)(struct mmpkt *mmpkt, const struct mmwlan_rx_metadata *metadata, void *arg)
Extended receive data packet callback function, consuming an mmpkt.
Definition: mmwlan.h:2539
void(* mmwlan_rx_pkt_cb_t)(struct mmpkt *mmpkt, void *arg)
Receive data packet callback function, consuming an mmpkt.
Definition: mmwlan.h:2499
#define MMWLAN_TX_DEFAULT_TIMEOUT_MS
Default transmit timeout.
Definition: mmwlan.h:2589
@ MMWLAN_TX_READY
Transmit data path ready for packets (not paused).
Definition: mmwlan.h:2761
@ MMWLAN_TX_PAUSED
Transmit data path paused (blocked).
Definition: mmwlan.h:2762
@ MMWLAN_LINK_UP
The link is up.
Definition: mmwlan.h:2367
@ MMWLAN_LINK_DOWN
The link is down.
Definition: mmwlan.h:2366
mmwlan_dpp_auth_failure_reason
Reason codes for MMWLAN_DPP_EVT_AUTH_FAILURE.
Definition: mmwlan.h:1655
enum mmwlan_status mmwlan_dpp_get_uri(char *uri_buf, size_t buf_len)
Retrieve the DPP bootstrap URI for the current QR enrollee session.
mmwlan_dpp_mode
Enumeration of DPP modes.
Definition: mmwlan.h:1582
mmwlan_dpp_conf_failure_reason
Reason codes for MMWLAN_DPP_EVT_CONF_FAILED.
Definition: mmwlan.h:1671
enum mmwlan_status mmwlan_dpp_stop(void)
Function to stop the DPP process.
mmwlan_dpp_pb_result
Enumeration of results for MMWLAN_DPP_EVT_PB_RESULT.
Definition: mmwlan.h:1639
enum mmwlan_status mmwlan_dpp_start(const struct mmwlan_dpp_args *args)
Function to start the Device Provisioning Protocol (DPP) process.
mmwlan_dpp_event
Enumeration of DPP events.
Definition: mmwlan.h:1596
@ MMWLAN_DPP_AUTH_FAILURE_INIT_FAILED
Exhausted all retry attempts without a response.
Definition: mmwlan.h:1661
@ MMWLAN_DPP_AUTH_FAILURE_NO_CONFIRM
Authentication confirmation was not received in time.
Definition: mmwlan.h:1659
@ MMWLAN_DPP_AUTH_FAILURE_NO_RESPONSE
Responder never replied to the Authentication Request.
Definition: mmwlan.h:1657
@ MMWLAN_DPP_MODE_PUSH_BUTTON
DPP Push Button mode.
Definition: mmwlan.h:1584
@ MMWLAN_DPP_MODE_QR_ENROLLEE
DPP QR Code Enrollee mode.
Definition: mmwlan.h:1586
@ MMWLAN_DPP_CONF_FAILURE_RESPONSE_ERROR
Config response contained an error status.
Definition: mmwlan.h:1673
@ MMWLAN_DPP_CONF_FAILURE_RESULT_TIMEOUT
Timed out waiting for the DPP2 Configuration Result.
Definition: mmwlan.h:1677
@ MMWLAN_DPP_CONF_FAILURE_TIMEOUT
Timed out waiting for the config response.
Definition: mmwlan.h:1675
@ MMWLAN_DPP_PB_RESULT_SUCCESS
DPP push button process was successful.
Definition: mmwlan.h:1641
@ MMWLAN_DPP_PB_RESULT_SESSION_OVERLAP
A session overlap occurred during the DPP push button process.
Definition: mmwlan.h:1645
@ MMWLAN_DPP_PB_RESULT_ERROR
An error occurred during the DPP push button process.
Definition: mmwlan.h:1643
@ MMWLAN_DPP_EVT_CONF_FAILED
Configuration exchange failed after authentication succeeded.
Definition: mmwlan.h:1629
@ MMWLAN_DPP_EVT_AUTH_FAILURE
DPP authentication could not complete.
Definition: mmwlan.h:1619
@ MMWLAN_DPP_EVT_AUTH_REQ_RX
Enrollee received and validated a DPP Authentication Request.
Definition: mmwlan.h:1613
@ MMWLAN_DPP_EVT_CHIRP_STARTED
QR enrollee began broadcasting presence announcements.
Definition: mmwlan.h:1599
@ MMWLAN_DPP_EVT_CONF_REQ_TX
Enrollee sent a DPP Configuration Request.
Definition: mmwlan.h:1623
@ MMWLAN_DPP_EVT_AUTH_SUCCESS
DPP authentication phase succeeded (both PB and QR flows).
Definition: mmwlan.h:1617
@ MMWLAN_DPP_EVT_CONF_RESULT_TX
Enrollee sent a DPP Configuration Result (DPP2+).
Definition: mmwlan.h:1627
@ MMWLAN_DPP_EVT_PB_DISCOVERY
Push Button configurator discovered.
Definition: mmwlan.h:1607
@ MMWLAN_DPP_EVT_AUTH_RESP_TX
Enrollee sent a DPP Authentication Response.
Definition: mmwlan.h:1615
@ MMWLAN_DPP_EVT_CONF_RECEIVED
DPP configuration received (any DPP mode).
Definition: mmwlan.h:1625
@ MMWLAN_DPP_EVT_CHIRP_STOPPED
QR enrollee presence announcement process has stopped.
Definition: mmwlan.h:1601
@ MMWLAN_DPP_EVT_PB_STARTED
Push Button enrollment started (enrollee).
Definition: mmwlan.h:1605
@ MMWLAN_DPP_EVT_PB_RESULT
DPP push button result.
Definition: mmwlan.h:1609
void mmwlan_deinit(void)
Deinitialize the MMWLAN subsystem, freeing any allocated memory.
void mmwlan_init(void)
Initialize the MMWLAN subsystem.
enum mmwlan_status mmwlan_get_duty_cycle_stats(struct mmwlan_duty_cycle_stats *stats)
Retrieve the transmit duty cycle configuration and statistics.
static const struct mmwlan_s1g_channel_list * mmwlan_lookup_regulatory_domain(const struct mmwlan_regulatory_db *db, const char *country_code)
Look up the given country code in the regulatory database and return the matching channel list if fou...
Definition: mmwlan.h:214
mmwlan_duty_cycle_mode
Enumeration of Duty Cycle modes.
Definition: mmwlan.h:257
enum mmwlan_status mmwlan_set_channel_list(const struct mmwlan_s1g_channel_list *channel_list)
Set the list of channels that are supported by the regulatory domain in which the device resides.
enum mmwlan_status mmwlan_set_duty_cycle_mode(enum mmwlan_duty_cycle_mode duty_cycle_mode)
Configure the duty cycle behavior for air time distribution.
#define MMWLAN_COUNTRY_CODE_LEN
Length of the two character country code string (null-terminated).
Definition: mmwlan.h:179
@ MMWLAN_DUTY_CYCLE_MODE_SPREAD
Duty cycle air time evenly spread.
Definition: mmwlan.h:259
@ MMWLAN_DUTY_CYCLE_MODE_BURST
Duty cycle air time available in burst.
Definition: mmwlan.h:261
enum mmwlan_status mmwlan_relay_enable(const struct mmwlan_relay_args *args)
Enable S1G Relay mode.
enum mmwlan_status mmwlan_relay_disable(void)
Disable S1G Relay mode.
mmwlan_scan_state
Enumeration of states in Scan mode.
Definition: mmwlan.h:808
void(* mmwlan_scan_rx_cb_t)(const struct mmwlan_scan_result *result, void *arg)
mmwlan scan rx callback function prototype.
Definition: mmwlan.h:738
enum mmwlan_status mmwlan_scan_abort(void)
Abort in progress or pending scans.
enum mmwlan_status mmwlan_set_scan_config(const struct mmwlan_scan_config *config)
Update the scan configuration with the given settings.
void(* mmwlan_scan_complete_cb_t)(enum mmwlan_scan_state scan_state, void *arg)
mmwlan scan complete callback function prototype.
Definition: mmwlan.h:819
enum mmwlan_status mmwlan_scan_request(const struct mmwlan_scan_req *scan_req)
Request a scan.
@ MMWLAN_SCAN_SUCCESSFUL
Scan was successful and all channels were scanned.
Definition: mmwlan.h:810
@ MMWLAN_SCAN_RUNNING
Scanning in progress.
Definition: mmwlan.h:815
@ MMWLAN_SCAN_TERMINATED
Scan was incomplete.
Definition: mmwlan.h:813
void mmwlan_free_rc_stats(struct mmwlan_rc_stats *stats)
Free a mmwlan_rc_stats structure that was allocated with mmwlan_get_rc_stats().
mmwlan_rc_stats_rate_info_offsets
Enumeration defined offsets into the bit field of rate information (rate_info in mmwlan_rc_stats).
Definition: mmwlan.h:2868
struct mmwlan_rc_stats * mmwlan_get_rc_stats(void)
Retrieves WLAN rate control statistics.
struct mmwlan_morse_stats * mmwlan_get_morse_stats(uint32_t core_num, bool reset)
Retrieves statistics from the Morse transceiver.
enum mmwlan_status mmwlan_clear_umac_stats(void)
Clear all current values of the UMAC statistics.
enum mmwlan_status mmwlan_get_umac_stats(struct mmwlan_stats_umac_data *stats_dest)
Gets the current values of the UMAC statistics.
void mmwlan_free_morse_stats(struct mmwlan_morse_stats *stats)
Frees a mmwlan_morse_stats instance that was returned by mmwlan_get_morse_stats().
enum mmwlan_status mmwlan_set_listen_interval(uint16_t interval)
Sets the listen interval to be indicated in the association response frame.
int32_t mmwlan_get_rssi(void)
Gets the RSSI measured from the AP.
void(* mmwlan_sta_event_cb_t)(const struct mmwlan_sta_event_cb_args *sta_event, void *arg)
STA event callback prototype.
Definition: mmwlan.h:1057
mmwlan_sta_event
Enumeration of STA events.
Definition: mmwlan.h:1022
mmwlan_sta_state
Enumeration of states in STA mode.
Definition: mmwlan.h:1006
enum mmwlan_sta_state mmwlan_get_sta_state(void)
Gets the current WLAN STA state.
void(* mmwlan_sta_status_cb_t)(enum mmwlan_sta_state sta_state)
STA status callback function prototype.
Definition: mmwlan.h:1013
enum mmwlan_status mmwlan_get_bssid(uint8_t *bssid)
Gets the BSSID of the AP to which the STA is associated.
mmwlan_station_type
Enumeration of S1G non-AP STA types.
Definition: mmwlan.h:997
enum mmwlan_status mmwlan_set_power_save_mode(enum mmwlan_ps_mode mode)
Sets whether or not the 802.11 power save is enabled.
enum mmwlan_status mmwlan_twt_add_configuration(const struct mmwlan_twt_config_args *twt_config_args)
Add configurations for Target Wake Time (TWT).
enum mmwlan_status mmwlan_sta_enable(const struct mmwlan_sta_args *args, mmwlan_sta_status_cb_t sta_status_cb)
Enable station mode.
enum mmwlan_status mmwlan_set_dynamic_ps_timeout(uint32_t timeout_ms)
Sets the time after network activity before the STA will notify the AP that it will go to sleep using...
mmwlan_twt_setup_command
Enumeration of Target Wake Time (TWT) setup commands.
Definition: mmwlan.h:1337
mmwlan_4addr_mode
Enumeration of Linux 4-address mode settings.
Definition: mmwlan.h:977
mmwlan_ps_mode
Enumeration of supported 802.11 power save modes.
Definition: mmwlan.h:986
uint16_t mmwlan_get_aid(void)
Gets the station's AID.
mmwlan_twt_mode
Enumeration of Target Wake Time (TWT) modes.
Definition: mmwlan.h:1326
enum mmwlan_status mmwlan_set_non_tim_mode_enabled(bool non_tim_mode_enabled)
Sets whether or not non-TIM mode support is enabled.
enum mmwlan_status mmwlan_sta_disable(void)
Disable station mode.
mmwlan_cac_mode
Enumeration of Centralized Authentication Control (CAC) modes.
Definition: mmwlan.h:968
@ MMWLAN_STA_EVT_CTRL_PORT_OPEN
The Supplicant IEEE 802.1X Controlled Port is now open meaning that the STA is fully authenticated an...
Definition: mmwlan.h:1039
@ MMWLAN_STA_EVT_SCAN_ABORT
The STA has aborted a scan early.
Definition: mmwlan.h:1028
@ MMWLAN_STA_EVT_CTRL_PORT_CLOSED
The Supplicant IEEE 802.1X Controlled Port is now closed.
Definition: mmwlan.h:1041
@ MMWLAN_STA_EVT_SCAN_COMPLETE
The STA has finished a scan.
Definition: mmwlan.h:1026
@ MMWLAN_STA_EVT_SCAN_REQUEST
The STA is starting a scan.
Definition: mmwlan.h:1024
@ MMWLAN_STA_EVT_AUTH_REQUEST
The STA is sending an authentication request to the AP.
Definition: mmwlan.h:1030
@ MMWLAN_STA_EVT_ASSOC_REQUEST
The STA is sending an association request to the AP.
Definition: mmwlan.h:1032
@ MMWLAN_STA_EVT_DEAUTH_TX
The STA is sending a de-authorization request to the AP.
Definition: mmwlan.h:1034
@ MMWLAN_TWT_SETUP_SUGGEST
TWT setup suggest command.
Definition: mmwlan.h:1341
@ MMWLAN_TWT_SETUP_REQUEST
TWT setup request command.
Definition: mmwlan.h:1339
@ MMWLAN_TWT_SETUP_DEMAND
TWT setup demand command.
Definition: mmwlan.h:1343
@ MMWLAN_4ADDR_MODE_ENABLED
4 Address Mode enabled
Definition: mmwlan.h:981
@ MMWLAN_4ADDR_MODE_DISABLED
4 Address Mode disabled
Definition: mmwlan.h:979
@ MMWLAN_PS_DISABLED
Power save disabled.
Definition: mmwlan.h:988
@ MMWLAN_PS_ENABLED
Power save enabled.
Definition: mmwlan.h:990
@ MMWLAN_TWT_DISABLED
TWT disabled.
Definition: mmwlan.h:1328
@ MMWLAN_TWT_RESPONDER
TWT enabled as a responder.
Definition: mmwlan.h:1332
@ MMWLAN_TWT_REQUESTER
TWT enabled as a requester.
Definition: mmwlan.h:1330
@ MMWLAN_CAC_DISABLED
CAC disabled.
Definition: mmwlan.h:970
@ MMWLAN_CAC_ENABLED
CAC enabled.
Definition: mmwlan.h:972
enum mmwlan_status mmwlan_ate_override_rate_control(enum mmwlan_mcs tx_rate_override, enum mmwlan_bw bandwidth_override, enum mmwlan_gi gi_override)
Enable/disable override of rate control parameters.
mmwlan_mcs
Enumeration of MCS rates.
Definition: mmwlan.h:2968
enum mmwlan_status mmwlan_ate_execute_command(uint8_t *command, uint32_t command_len, uint8_t *response, uint32_t *response_len)
Execute a test/debug command.
mmwlan_bw
Enumeration of bandwidths.
Definition: mmwlan.h:2985
mmwlan_gi
Enumeration of guard intervals.
Definition: mmwlan.h:2996
@ MMWLAN_MCS_7
MCS7.
Definition: mmwlan.h:2977
@ MMWLAN_MCS_3
MCS3.
Definition: mmwlan.h:2973
@ MMWLAN_MCS_8
MCS8.
Definition: mmwlan.h:2978
@ MMWLAN_MCS_NONE
Use-case specific special value.
Definition: mmwlan.h:2969
@ MMWLAN_MCS_9
MCS9.
Definition: mmwlan.h:2979
@ MMWLAN_MCS_0
MCS0.
Definition: mmwlan.h:2970
@ MMWLAN_MCS_4
MCS4.
Definition: mmwlan.h:2974
@ MMWLAN_MCS_6
MCS6.
Definition: mmwlan.h:2976
@ MMWLAN_MCS_MAX
Maximum supported MCS rate.
Definition: mmwlan.h:2980
@ MMWLAN_MCS_5
MCS5.
Definition: mmwlan.h:2975
@ MMWLAN_MCS_2
MCS2.
Definition: mmwlan.h:2972
@ MMWLAN_MCS_1
MCS1.
Definition: mmwlan.h:2971
@ MMWLAN_BW_NONE
Use-case specific special value.
Definition: mmwlan.h:2986
@ MMWLAN_BW_2MHZ
2 MHz bandwidth
Definition: mmwlan.h:2988
@ MMWLAN_BW_4MHZ
4 MHz bandwidth
Definition: mmwlan.h:2989
@ MMWLAN_BW_MAX
Maximum supported bandwidth.
Definition: mmwlan.h:2991
@ MMWLAN_BW_8MHZ
8 MHz bandwidth
Definition: mmwlan.h:2990
@ MMWLAN_BW_1MHZ
1 MHz bandwidth
Definition: mmwlan.h:2987
@ MMWLAN_GI_MAX
Maximum valid value of this enum.
Definition: mmwlan.h:3000
@ MMWLAN_GI_LONG
Long guard interval.
Definition: mmwlan.h:2999
@ MMWLAN_GI_SHORT
Short guard interval.
Definition: mmwlan.h:2998
@ MMWLAN_GI_NONE
Use-case specific special value.
Definition: mmwlan.h:2997
static enum mmwlan_status mmwlan_set_wnm_sleep_enabled(bool wnm_sleep_enabled)
Sets whether WNM sleep mode is enabled.
Definition: mmwlan.h:1554
#define MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT
Initializer for mmwlan_set_wnm_sleep_enabled_args.
Definition: mmwlan.h:1498
enum mmwlan_status mmwlan_set_wnm_sleep_enabled_ext(const struct mmwlan_set_wnm_sleep_enabled_args *args)
Sets extended WNM sleep mode.
mmwlan_status
Enumeration of status return codes.
Definition: mmwlan.h:50
#define MMWLAN_PASSPHRASE_MAXLEN
Maximum allowable length of a passphrase when connecting to an AP.
Definition: mmwlan.h:93
mmwlan_pmf_mode
Enumeration of Protected Management Frame (PMF) modes (802.11w).
Definition: mmwlan.h:130
#define MMWLAN_MAX_EC_GROUPS
Maximum allowable number of EC Groups.
Definition: mmwlan.h:99
mmwlan_security_type
Enumeration of supported security types.
Definition: mmwlan.h:119
#define MMWLAN_OUI_SIZE
Size of an 802.11 OUI element in octets.
Definition: mmwlan.h:102
#define MMWLAN_SSID_MAXLEN
Maximum allowable length of an SSID.
Definition: mmwlan.h:90
#define MMWLAN_MAC_ADDR_LEN
Length of a WLAN MAC address.
Definition: mmwlan.h:96
mmwlan_vif
Enumeration of Virtual Interfaces supported by the MMWLAN API.
Definition: mmwlan.h:108
@ MMWLAN_INVALID_ARGUMENT
The operation failed due to an invalid argument.
Definition: mmwlan.h:56
@ MMWLAN_NOT_RUNNING
Indicates that the operation failed because the system was not running (e.g., the device was not boot...
Definition: mmwlan.h:75
@ MMWLAN_TIMED_OUT
Failed due to timeout.
Definition: mmwlan.h:65
@ MMWLAN_SHUTDOWN_BLOCKED
Used to indicate that a call to mmwlan_sta_disable() did not shutdown the transceiver.
Definition: mmwlan.h:68
@ MMWLAN_SUCCESS
The operation was successful.
Definition: mmwlan.h:52
@ MMWLAN_NOT_SUPPORTED
Support for the given functionality is not supported by the build time configuration or has not yet b...
Definition: mmwlan.h:84
@ MMWLAN_COMMAND_ERROR
The MM-chip reported an error when executing a command.
Definition: mmwlan.h:86
@ MMWLAN_VIF_ERROR
Indicates that the specified VIF is not active or that no VIF was specified and a VIF could not be au...
Definition: mmwlan.h:81
@ MMWLAN_CHANNEL_INVALID
Attempted to tune to a channel that was not in the regulatory database or not supported.
Definition: mmwlan.h:70
@ MMWLAN_NO_MEM
Failed due to memory allocation failure.
Definition: mmwlan.h:63
@ MMWLAN_CHANNEL_LIST_NOT_SET
Unable to proceed because channel list has not been set.
Definition: mmwlan.h:61
@ MMWLAN_ERROR
The operation failed with an unspecified error.
Definition: mmwlan.h:54
@ MMWLAN_NOT_INITIALIZED
Indicates that the operation failed because MMWLAN has not been initialized, see mmwlan_init()
Definition: mmwlan.h:78
@ MMWLAN_UNAVAILABLE
Functionality is temporarily unavailable.
Definition: mmwlan.h:58
@ MMWLAN_NOT_FOUND
The request could not be completed because the given resource was not found.
Definition: mmwlan.h:72
@ MMWLAN_PMF_DISABLED
No protected management frames.
Definition: mmwlan.h:134
@ MMWLAN_PMF_REQUIRED
Protected management frames must be used.
Definition: mmwlan.h:132
@ MMWLAN_OPEN
Open (no security)
Definition: mmwlan.h:121
@ MMWLAN_SAE
Simultaneous Authentication of Equals (SAE)
Definition: mmwlan.h:125
@ MMWLAN_OWE
Opportunistic Wireless Encryption (OWE)
Definition: mmwlan.h:123
@ MMWLAN_VIF_AP
AP VIF.
Definition: mmwlan.h:114
@ MMWLAN_VIF_STA
STA VIF.
Definition: mmwlan.h:112
@ MMWLAN_VIF_UNSPECIFIED
VIF is unspecified.
Definition: mmwlan.h:110
Core mmpkt data structure.
Definition: mmpkt.h:88
Arguments data structure for mmwlan_ap_enable().
Definition: mmwlan.h:1980
uint16_t beacon_interval_tus
The Beacon period in units of TUs.
Definition: mmwlan.h:2034
void * sta_status_cb_arg
Optional opaque argument to be passed to sta_status_cb.
Definition: mmwlan.h:2070
int sae_owe_ec_groups[MMWLAN_MAX_EC_GROUPS]
Preference list of enabled elliptic curve groups for SAE and OWE.
Definition: mmwlan.h:2003
uint16_t s1g_chan_num
S1G channel number of the channel to use.
Definition: mmwlan.h:2028
uint8_t pri_1mhz_chan_idx
Index of the primary 1 Mhz channel within the operating channel.
Definition: mmwlan.h:2060
enum mmwlan_pmf_mode pmf_mode
Protected Management Frame mode to use (802.11w)
Definition: mmwlan.h:1998
uint16_t op_class
Operating Class to use (S1G or Global).
Definition: mmwlan.h:2016
uint8_t pri_bw_mhz
Bandwidth to use for the primary channel.
Definition: mmwlan.h:2051
bool async_start
Whether the function should return immediately instead of waiting for the AP interface to be fully st...
Definition: mmwlan.h:2084
uint8_t max_stas
Maximum number of stations that can connect to the AP simultaneously.
Definition: mmwlan.h:2077
uint16_t ssid_len
Length of the SSID.
Definition: mmwlan.h:1984
uint8_t bssid[MMWLAN_MAC_ADDR_LEN]
Optional BSSID of the AP.
Definition: mmwlan.h:1990
uint8_t ssid[MMWLAN_SSID_MAXLEN]
SSID of the AP.
Definition: mmwlan.h:1982
mmwlan_ap_sta_status_cb_t sta_status_cb
Optional callback to be invoked when the status of a connected STA changes.
Definition: mmwlan.h:2065
char passphrase[MMWLAN_PASSPHRASE_MAXLEN+1]
Passphrase (only used if security_type is MMWLAN_SAE, otherwise ignored.
Definition: mmwlan.h:1994
enum mmwlan_security_type security_type
Type of security to use.
Definition: mmwlan.h:1992
uint16_t passphrase_len
Length of passphrase.
Definition: mmwlan.h:1996
uint16_t dtim_period
The Delivery Traffic Indication Map (DTIM) interval in beacons.
Definition: mmwlan.h:2040
Data structure for communicating STA status information for stations connected to an AP.
Definition: mmwlan.h:1927
uint16_t aid
The AID of the STA.
Definition: mmwlan.h:1931
enum mmwlan_ap_sta_state state
The current state of the STA.
Definition: mmwlan.h:1929
uint8_t mac_addr[MMWLAN_MAC_ADDR_LEN]
The MAC address of the STA.
Definition: mmwlan.h:1933
Board configuration file (BCF) metadata.
Definition: mmwlan.h:350
char board_desc[MMWLAN_BCF_BOARD_DESC_MAXLEN+1]
Board description string.
Definition: mmwlan.h:368
uint8_t patch
Patch version field.
Definition: mmwlan.h:359
struct mmwlan_bcf_metadata::@1 version
BCF semantic version.
uint16_t major
Major version field.
Definition: mmwlan.h:355
uint8_t minor
Minor version field.
Definition: mmwlan.h:357
char build_version[MMWLAN_BCF_BUILD_VERSION_MAXLEN+1]
Build version string.
Definition: mmwlan.h:376
Structure for storing beacon vendor ie filter parameter.
Definition: mmwlan.h:2283
void * cb_arg
Opaque argument to be passed to the callbacks.
Definition: mmwlan.h:2294
mmwlan_beacon_vendor_ie_filter_cb_t cb
Callback that will be executed upon reception of a beacon containing a Vendor Specific information el...
Definition: mmwlan.h:2292
mmwlan_oui_t ouis[MMWLAN_BEACON_VENDOR_IE_MAX_OUI_FILTERS]
List of OUIs to filter on.
Definition: mmwlan.h:2299
uint8_t n_ouis
Number of OUIs contained within ouis.
Definition: mmwlan.h:2297
Arguments data structure for mmwlan_boot().
Definition: mmwlan.h:610
const uint8_t * sta_mac_addr_override
Optional override for the MAC address that will be used in STA mode and when scanning.
Definition: mmwlan.h:615
Structure to hold the arguments used for the DPP process.
Definition: mmwlan.h:1808
void(* dpp_event_cb)(const struct mmwlan_dpp_cb_args *dpp_event, void *arg)
DPP event callback prototype.
Definition: mmwlan.h:1810
void * dpp_event_cb_arg
Optional user argument that will be passed back to the DPP event callback.
Definition: mmwlan.h:1812
enum mmwlan_dpp_mode mode
DPP mode to use.
Definition: mmwlan.h:1814
struct mmwlan_dpp_qr_args qr
QR enrollee specific arguments.
Definition: mmwlan.h:1816
Structure passed back when a DPP event occurs.
Definition: mmwlan.h:1687
union mmwlan_dpp_cb_args::@2 args
Union of arguments for DPP events.
const uint8_t * ssid
SSID of the AP to connect to.
Definition: mmwlan.h:1705
struct mmwlan_dpp_cb_args::@2::@4 conf_received
Argument for MMWLAN_DPP_EVT_CONF_RECEIVED event.
struct mmwlan_dpp_cb_args::@2::@8 auth_failure
Argument for MMWLAN_DPP_EVT_AUTH_FAILURE event.
bool initiator
true if this device initiated the authentication exchange, false if it responded.
Definition: mmwlan.h:1732
struct mmwlan_dpp_cb_args::@2::@7 auth_success
Argument for MMWLAN_DPP_EVT_AUTH_SUCCESS event.
const uint8_t * peer_mac
MAC address of the discovered PB configurator.
Definition: mmwlan.h:1716
enum mmwlan_dpp_conf_failure_reason reason
Reason for the configuration failure.
Definition: mmwlan.h:1746
struct mmwlan_dpp_cb_args::@2::@9 conf_failed
Argument for MMWLAN_DPP_EVT_CONF_FAILED event.
uint16_t ssid_len
Length of the SSID.
Definition: mmwlan.h:1707
enum mmwlan_dpp_auth_failure_reason reason
Reason for the authentication failure.
Definition: mmwlan.h:1739
const char * passphrase
Passphrase, NULL terminated.
Definition: mmwlan.h:1709
enum mmwlan_dpp_pb_result result
Result of DPP push button.
Definition: mmwlan.h:1698
struct mmwlan_dpp_cb_args::@2::@6 auth_req_rx
Argument for MMWLAN_DPP_EVT_AUTH_REQ_RX event.
struct mmwlan_dpp_cb_args::@2::@3 pb_result
Argument for MMWLAN_DPP_EVT_PB_RESULT event.
struct mmwlan_dpp_cb_args::@2::@5 pb_discovery
Argument for MMWLAN_DPP_EVT_PB_DISCOVERY event.
enum mmwlan_dpp_event event
The DPP event that has occurred.
Definition: mmwlan.h:1689
Structure to hold the QR enrollee specific arguments for the DPP process.
Definition: mmwlan.h:1761
uint16_t bootstrap_private_key_len
Length of bootstrap_private_key in bytes.
Definition: mmwlan.h:1780
const uint8_t * bootstrap_private_key
DER-encoded EC private key for the DPP bootstrap identity (P-256 / prime256v1).
Definition: mmwlan.h:1778
uint16_t chirp_iterations
Number of chirp iterations (0 = default of 1).
Definition: mmwlan.h:1798
Duty cycle configuration and statistics.
Definition: mmwlan.h:281
uint32_t burst_window_duration_us
Burst window duration (us) - applicable in burst mode only.
Definition: mmwlan.h:289
uint32_t burst_airtime_remaining_us
Airtime remaining (us) - applicable in burst mode only.
Definition: mmwlan.h:287
uint32_t duty_cycle
Target duty cycle in 100th of a %, i.e.
Definition: mmwlan.h:283
enum mmwlan_duty_cycle_mode mode
Configured duty cycle mode, see mmwlan_duty_cycle_mode.
Definition: mmwlan.h:285
Arguments for fatal error handler.
Definition: mmwlan.h:2795
void * arg
Context to be passed to fatal error handler.
Definition: mmwlan.h:2797
uint32_t fileid
ID of file in which fatal error was detected.
Definition: mmwlan.h:2799
uint32_t line
Line number at which fatal error was detected.
Definition: mmwlan.h:2801
Data structure used to represent an opaque buffer containing Morse statistics.
Definition: mmwlan.h:2895
uint8_t * buf
Buffer containing the stats.
Definition: mmwlan.h:2897
uint32_t len
Length of stats in buf.
Definition: mmwlan.h:2899
Structure for storing QoS queue parameters
Definition: mmwlan.h:495
uint8_t aci
Access Category Index [0..3].
Definition: mmwlan.h:497
uint32_t txop_max_us
Maximum burst time in microseconds, 0 meaning disabled.
Definition: mmwlan.h:505
uint16_t cw_min
Minimum Contention Window.
Definition: mmwlan.h:501
uint8_t aifs
Arbitration Inter-frame Space [2..255].
Definition: mmwlan.h:499
uint16_t cw_max
Maximum Contention Window.
Definition: mmwlan.h:503
Rate control statistics data structure.
Definition: mmwlan.h:2841
uint32_t * total_success
Total successes for each rate table entry.
Definition: mmwlan.h:2849
uint32_t n_entries
The number of rate table entries.
Definition: mmwlan.h:2843
uint32_t * rate_info
Rate info for each rate table entry.
Definition: mmwlan.h:2845
uint32_t * total_sent
Total number of packets sent for each rate table entry.
Definition: mmwlan.h:2847
Regulatory database data structure.
Definition: mmwlan.h:197
unsigned num_domains
Number of regulatory domains in the database.
Definition: mmwlan.h:199
const struct mmwlan_s1g_channel_list ** domains
The regulatory domain data.
Definition: mmwlan.h:202
Arguments data structure for mmwlan_relay_enable().
Definition: mmwlan.h:2203
bool is_root_node
Indicates whether this is the root node.
Definition: mmwlan.h:2212
unsigned forwarding_table_size
Maximum number of entries in the forward table.
Definition: mmwlan.h:2209
Receive data packet metadata.
Definition: mmwlan.h:2517
uint8_t tid
QoS Traffic ID.
Definition: mmwlan.h:2522
enum mmwlan_vif vif
The virtual interface that the packet was received on.
Definition: mmwlan.h:2519
const uint8_t * ta
Transmitter Address (TA) of the received packet.
Definition: mmwlan.h:2525
A list of S1G channels supported by a given regulatory domain.
Definition: mmwlan.h:183
unsigned num_channels
The number of channels in the list.
Definition: mmwlan.h:187
uint8_t country_code[MMWLAN_COUNTRY_CODE_LEN]
Two character country code (null-terminated) used to identify the regulatory domain.
Definition: mmwlan.h:185
const struct mmwlan_s1g_channel * channels
The channel data.
Definition: mmwlan.h:189
Regulatory domain information about an S1G channel.
Definition: mmwlan.h:153
int8_t max_tx_eirp_dbm
Maximum transmit power (EIRP in dBm).
Definition: mmwlan.h:169
uint32_t airtime_min_us
The minimum packet airtime duration to trigger spacing (in microseconds).
Definition: mmwlan.h:173
int16_t s1g_operating_class
S1G operating class.
Definition: mmwlan.h:163
int16_t global_operating_class
Global operating class.
Definition: mmwlan.h:161
uint32_t airtime_max_us
The maximum allowable packet airtime duration (in microseconds).
Definition: mmwlan.h:175
uint32_t centre_freq_hz
Center frequency of the channel (in Hz).
Definition: mmwlan.h:155
bool duty_cycle_omit_ctrl_resp
Boolean indicating whether to omit control response frames from duty cycle.
Definition: mmwlan.h:159
uint16_t duty_cycle_sta
STA Duty Cycle (in 100th of %).
Definition: mmwlan.h:157
uint8_t s1g_chan_num
S1G channel number.
Definition: mmwlan.h:165
uint32_t pkt_spacing_us
The length of time to close the tx window between packets (in microseconds).
Definition: mmwlan.h:171
uint8_t bw_mhz
Channel operating bandwidth (in MHz).
Definition: mmwlan.h:167
Structure to hold scan arguments.
Definition: mmwlan.h:826
uint8_t * extra_ies
Extra Information Elements to include in Probe Request frames.
Definition: mmwlan.h:838
uint8_t ssid[MMWLAN_SSID_MAXLEN]
SSID used for scan.
Definition: mmwlan.h:845
uint32_t dwell_on_home_ms
Time to dwell on home channel in between channels during a scan, to allow traffic to still pass.
Definition: mmwlan.h:853
size_t extra_ies_len
Length of extra_ies.
Definition: mmwlan.h:840
uint16_t ssid_len
Length of the SSID.
Definition: mmwlan.h:847
uint32_t dwell_time_ms
Minimum time to dwell on a channel waiting for probe responses/beacons.
Definition: mmwlan.h:833
Scan configuration data structure.
Definition: mmwlan.h:752
bool ndp_probe_enabled
Boolean value indicating whether NDP probe support should be enabled.
Definition: mmwlan.h:772
uint32_t home_channel_dwell_time_ms
Set the home channel dwell time to use for scans that are requested internally within the mmwlan driv...
Definition: mmwlan.h:780
uint32_t dwell_time_ms
Set the per-channel dwell time to use for scans that are requested internally within the mmwlan drive...
Definition: mmwlan.h:759
Structure to hold arguments specific to a given instance of a scan.
Definition: mmwlan.h:879
mmwlan_scan_rx_cb_t scan_rx_cb
Scan response receive callback.
Definition: mmwlan.h:881
void * scan_cb_arg
Opaque argument to be passed to the callbacks.
Definition: mmwlan.h:885
mmwlan_scan_complete_cb_t scan_complete_cb
Scan complete callback.
Definition: mmwlan.h:883
struct mmwlan_scan_args args
Scan arguments to be used mmwlan_scan_args.
Definition: mmwlan.h:887
Result of the scan request.
Definition: mmwlan.h:705
uint8_t ssid_len
Length of the SSID (ssid).
Definition: mmwlan.h:721
uint8_t bw_mhz
Bandwidth, in MHz, where the frame was received.
Definition: mmwlan.h:725
const uint8_t * ies
Pointer to the start of the Information Elements within the Probe Response frame.
Definition: mmwlan.h:713
uint16_t capability_info
Value of the Capability Information field.
Definition: mmwlan.h:717
uint16_t ies_len
Length of the Information Elements (ies).
Definition: mmwlan.h:719
const uint8_t * bssid
Pointer to the BSSID field within the Probe Response frame.
Definition: mmwlan.h:709
uint32_t channel_freq_hz
Center frequency in Hz of the channel where the frame was received.
Definition: mmwlan.h:723
uint16_t beacon_interval
Value of the Beacon Interval field.
Definition: mmwlan.h:715
uint64_t tsf
TSF timestamp in the Probe Response frame.
Definition: mmwlan.h:734
uint8_t op_bw_mhz
Operating bandwidth, in MHz, of the access point.
Definition: mmwlan.h:727
int16_t rssi
RSSI of the received frame.
Definition: mmwlan.h:707
int8_t noise_dbm
Background noise measured by the chip on the channel at the time the probe response was received.
Definition: mmwlan.h:732
const uint8_t * ssid
Pointer to the SSID within the SSID IE of the Probe Response frame.
Definition: mmwlan.h:711
Structure for storing WNM sleep extended arguments.
Definition: mmwlan.h:1482
bool wnm_sleep_enabled
Boolean indicating whether WNM sleep is enabled.
Definition: mmwlan.h:1484
bool chip_powerdown_enabled
Boolean indicating whether chip should be powered down during WNM sleep.
Definition: mmwlan.h:1486
Arguments data structure for mmwlan_sta_enable().
Definition: mmwlan.h:1074
mmwlan_scan_rx_cb_t scan_rx_cb
Optional callback for scan results which are received during the connection process.
Definition: mmwlan.h:1137
int bgscan_signal_threshold_dbm
Background scan signal strength threshold that switches between short and long intervals.
Definition: mmwlan.h:1124
int16_t raw_sta_priority
Priority used by the AP to assign a STA to a Restricted Access Window (RAW) group.
Definition: mmwlan.h:1096
int sae_owe_ec_groups[MMWLAN_MAX_EC_GROUPS]
Preference list of enabled elliptic curve groups for SAE and OWE.
Definition: mmwlan.h:1103
uint16_t scan_interval_base_s
The base scan interval (in seconds) to use when (re)connecting.
Definition: mmwlan.h:1149
uint8_t ssid[MMWLAN_SSID_MAXLEN]
SSID of the AP to connect to.
Definition: mmwlan.h:1076
char passphrase[MMWLAN_PASSPHRASE_MAXLEN+1]
Passphrase (only used if security_type is MMWLAN_SAE, otherwise ignored.
Definition: mmwlan.h:1087
enum mmwlan_4addr_mode use_4addr
Whether the station should use Linux 4-address mode.
Definition: mmwlan.h:1186
enum mmwlan_pmf_mode pmf_mode
Protected Management Frame mode to use (802.11w)
Definition: mmwlan.h:1091
mmwlan_sta_event_cb_t sta_evt_cb
STA event callback with a user-defined opaque parameter.
Definition: mmwlan.h:1173
uint8_t * extra_assoc_ies
Extra Information Elements to include in association request frames.
Definition: mmwlan.h:1164
enum mmwlan_security_type security_type
Type of security to use.
Definition: mmwlan.h:1085
uint16_t passphrase_len
Length of passphrase.
Definition: mmwlan.h:1089
uint16_t bgscan_long_interval_s
Background scan long interval, measured in seconds.
Definition: mmwlan.h:1135
uint16_t bgscan_short_interval_s
Background scan short interval, measured in seconds.
Definition: mmwlan.h:1116
enum mmwlan_cac_mode cac_mode
Whether Centralized Authentication Controlled is enabled on the STA.
Definition: mmwlan.h:1105
uint8_t bssid[MMWLAN_MAC_ADDR_LEN]
BSSID of the AP to connect to.
Definition: mmwlan.h:1083
void * scan_rx_cb_arg
Opaque argument to be passed to scan_rx_cb.
Definition: mmwlan.h:1139
size_t extra_assoc_ies_len
Length of extra_assoc_ies.
Definition: mmwlan.h:1166
uint16_t ssid_len
Length of the SSID.
Definition: mmwlan.h:1078
void * sta_evt_cb_arg
STA event callback argument to be passed to sta_evt_cb.
Definition: mmwlan.h:1181
uint16_t scan_interval_limit_s
The maximum interval between scan attempts when (re)connecting.
Definition: mmwlan.h:1157
enum mmwlan_station_type sta_type
S1G non-AP STA type.
Definition: mmwlan.h:1098
Argument passed to the STA event callback.
Definition: mmwlan.h:1046
enum mmwlan_sta_event event
The event that triggered the callback.
Definition: mmwlan.h:1048
Data structure to contain all stats from the UMAC.
Definition: mmwlan_stats.h:50
Structure for storing Target Wake Time (TWT) configuration arguments.
Definition: mmwlan.h:1348
enum mmwlan_twt_setup_command twt_setup_command
TWT setup command, mmwlan_twt_setup_command.
Definition: mmwlan.h:1370
uint64_t twt_wake_interval_us
TWT service period interval in micro seconds.
Definition: mmwlan.h:1356
uint32_t twt_min_wake_duration_us
Minimum TWT wake duration in micro seconds.
Definition: mmwlan.h:1368
uint8_t twt_wake_interval_exponent
TWT Wake interval exponent If non-zero, this parameter will be used to calculate twt_wake_interval_us...
Definition: mmwlan.h:1366
uint16_t twt_wake_interval_mantissa
TWT Wake interval mantissa If non-zero, this parameter will be used to calculate twt_wake_interval_us...
Definition: mmwlan.h:1361
enum mmwlan_twt_mode twt_mode
Target Wake Time (TWT) modes, mmwlan_twt_mode.
Definition: mmwlan.h:1350
Metadata for TX packets.
Definition: mmwlan.h:2612
const uint8_t * ra
Optional Receiver Address (RA).
Definition: mmwlan.h:2631
enum mmwlan_vif vif
VIF to transmit on.
Definition: mmwlan.h:2627
uint8_t tid
Traffic ID (TID) to use.
Definition: mmwlan.h:2617
Structure for retrieving version information from the mmwlan subsystem.
Definition: mmwlan.h:320
char morselib_version[MMWLAN_MORSELIB_VERSION_MAXLEN]
Morselib version string.
Definition: mmwlan.h:322
char morse_chip_id_string[MMWLAN_CHIP_ID_STRING_MAXLEN]
Morse transceiver chip ID user-friendly string.
Definition: mmwlan.h:328
char morse_fw_version[MMWLAN_FW_VERSION_MAXLEN]
Morse transceiver firmware version string.
Definition: mmwlan.h:324
uint32_t morse_chip_id
Morse transceiver chip ID.
Definition: mmwlan.h:326
Channel information for a VIF.
Definition: mmwlan.h:2440
uint8_t pri_bw_mhz
Bandwidth of the primary channel.
Definition: mmwlan.h:2446
uint16_t op_class
Operating class for the BSS.
Definition: mmwlan.h:2442
uint16_t s1g_chan_num
S1G operating channel number.
Definition: mmwlan.h:2444
uint8_t pri_1mhz_chan_idx
Index of the primary 1 MHz channel within the operating channel.
Definition: mmwlan.h:2448
VIF state used by mmwlan_vif_state_cb_t.
Definition: mmwlan.h:2401
enum mmwlan_vif vif
The VIF that this applies to.
Definition: mmwlan.h:2403
enum mmwlan_link_state link_state
The current link state of the VIF.
Definition: mmwlan.h:2405