34#ifndef CYW43_INCLUDED_CYW43_LL_H
35#define CYW43_INCLUDED_CYW43_LL_H
39#include "cyw43_config.h"
56#define CYW43_IOCTL_GET_SSID (0x32)
57#define CYW43_IOCTL_GET_CHANNEL (0x3a)
58#define CYW43_IOCTL_SET_DISASSOC (0x69)
59#define CYW43_IOCTL_GET_ANTDIV (0x7e)
60#define CYW43_IOCTL_SET_ANTDIV (0x81)
61#define CYW43_IOCTL_SET_MONITOR (0xd9)
62#define CYW43_IOCTL_GET_RSSI (0xfe)
63#define CYW43_IOCTL_GET_VAR (0x20c)
64#define CYW43_IOCTL_SET_VAR (0x20f)
67#define CYW43_EV_SET_SSID (0)
68#define CYW43_EV_JOIN (1)
69#define CYW43_EV_AUTH (3)
70#define CYW43_EV_DEAUTH (5)
71#define CYW43_EV_DEAUTH_IND (6)
72#define CYW43_EV_ASSOC (7)
73#define CYW43_EV_DISASSOC (11)
74#define CYW43_EV_DISASSOC_IND (12)
75#define CYW43_EV_LINK (16)
76#define CYW43_EV_PRUNE (23)
77#define CYW43_EV_PSK_SUP (46)
78#define CYW43_EV_ICV_ERROR (49)
79#define CYW43_EV_ESCAN_RESULT (69)
80#define CYW43_EV_CSA_COMPLETE_IND (80)
81#define CYW43_EV_ASSOC_REQ_IE (87)
82#define CYW43_EV_ASSOC_RESP_IE (88)
85#define CYW43_STATUS_SUCCESS (0)
86#define CYW43_STATUS_FAIL (1)
87#define CYW43_STATUS_TIMEOUT (2)
88#define CYW43_STATUS_NO_NETWORKS (3)
89#define CYW43_STATUS_ABORT (4)
90#define CYW43_STATUS_NO_ACK (5)
91#define CYW43_STATUS_UNSOLICITED (6)
92#define CYW43_STATUS_ATTEMPT (7)
93#define CYW43_STATUS_PARTIAL (8)
94#define CYW43_STATUS_NEWSCAN (9)
95#define CYW43_STATUS_NEWASSOC (10)
98#define CYW43_SUP_DISCONNECTED (0)
99#define CYW43_SUP_CONNECTING (1)
100#define CYW43_SUP_IDREQUIRED (2)
101#define CYW43_SUP_AUTHENTICATING (3)
102#define CYW43_SUP_AUTHENTICATED (4)
103#define CYW43_SUP_KEYXCHANGE (5)
104#define CYW43_SUP_KEYED (6)
105#define CYW43_SUP_TIMEOUT (7)
106#define CYW43_SUP_LAST_BASIC_STATE (8)
107#define CYW43_SUP_KEYXCHANGE_WAIT_M1 CYW43_SUP_AUTHENTICATED
108#define CYW43_SUP_KEYXCHANGE_PREP_M2 CYW43_SUP_KEYXCHANGE
109#define CYW43_SUP_KEYXCHANGE_WAIT_M3 CYW43_SUP_LAST_BASIC_STATE
110#define CYW43_SUP_KEYXCHANGE_PREP_M4 (9)
111#define CYW43_SUP_KEYXCHANGE_WAIT_G1 (10)
112#define CYW43_SUP_KEYXCHANGE_PREP_G2 (11)
115#define CYW43_REASON_INITIAL_ASSOC (0)
116#define CYW43_REASON_LOW_RSSI (1)
117#define CYW43_REASON_DEAUTH (2)
118#define CYW43_REASON_DISASSOC (3)
119#define CYW43_REASON_BCNS_LOST (4)
120#define CYW43_REASON_FAST_ROAM_FAILED (5)
121#define CYW43_REASON_DIRECTED_ROAM (6)
122#define CYW43_REASON_TSPEC_REJECTED (7)
123#define CYW43_REASON_BETTER_AP (8)
126#define CYW43_REASON_PRUNE_ENCR_MISMATCH (1)
127#define CYW43_REASON_PRUNE_BCAST_BSSID (2)
128#define CYW43_REASON_PRUNE_MAC_DENY (3)
129#define CYW43_REASON_PRUNE_MAC_NA (4)
130#define CYW43_REASON_PRUNE_REG_PASSV (5)
131#define CYW43_REASON_PRUNE_SPCT_MGMT (6)
132#define CYW43_REASON_PRUNE_RADAR (7)
133#define CYW43_REASON_RSN_MISMATCH (8)
134#define CYW43_REASON_PRUNE_NO_COMMON_RATES (9)
135#define CYW43_REASON_PRUNE_BASIC_RATES (10)
136#define CYW43_REASON_PRUNE_CCXFAST_PREVAP (11)
137#define CYW43_REASON_PRUNE_CIPHER_NA (12)
138#define CYW43_REASON_PRUNE_KNOWN_STA (13)
139#define CYW43_REASON_PRUNE_CCXFAST_DROAM (14)
140#define CYW43_REASON_PRUNE_WDS_PEER (15)
141#define CYW43_REASON_PRUNE_QBSS_LOAD (16)
142#define CYW43_REASON_PRUNE_HOME_AP (17)
143#define CYW43_REASON_PRUNE_AP_BLOCKED (18)
144#define CYW43_REASON_PRUNE_NO_DIAG_SUPPORT (19)
147#define CYW43_REASON_SUP_OTHER (0)
148#define CYW43_REASON_SUP_DECRYPT_KEY_DATA (1)
149#define CYW43_REASON_SUP_BAD_UCAST_WEP128 (2)
150#define CYW43_REASON_SUP_BAD_UCAST_WEP40 (3)
151#define CYW43_REASON_SUP_UNSUP_KEY_LEN (4)
152#define CYW43_REASON_SUP_PW_KEY_CIPHER (5)
153#define CYW43_REASON_SUP_MSG3_TOO_MANY_IE (6)
154#define CYW43_REASON_SUP_MSG3_IE_MISMATCH (7)
155#define CYW43_REASON_SUP_NO_INSTALL_FLAG (8)
156#define CYW43_REASON_SUP_MSG3_NO_GTK (9)
157#define CYW43_REASON_SUP_GRP_KEY_CIPHER (10)
158#define CYW43_REASON_SUP_GRP_MSG1_NO_GTK (11)
159#define CYW43_REASON_SUP_GTK_DECRYPT_FAIL (12)
160#define CYW43_REASON_SUP_SEND_FAIL (13)
161#define CYW43_REASON_SUP_DEAUTH (14)
162#define CYW43_REASON_SUP_WPA_PSK_TMO (15)
170#define CYW43_AUTH_OPEN (0)
171#define CYW43_AUTH_WPA_TKIP_PSK (0x00200002)
172#define CYW43_AUTH_WPA2_AES_PSK (0x00400004)
173#define CYW43_AUTH_WPA2_MIXED_PSK (0x00400006)
174#define CYW43_AUTH_WPA3_SAE_AES_PSK (0x01000004)
175#define CYW43_AUTH_WPA3_WPA2_AES_PSK (0x01400004)
181#define CYW43_NO_POWERSAVE_MODE (0)
182#define CYW43_PM1_POWERSAVE_MODE (1)
183#define CYW43_PM2_POWERSAVE_MODE (2)
187#define CYW43_BUS_MAX_BLOCK_SIZE 64
188#define CYW43_BACKPLANE_READ_PAD_LEN_BYTES 16
189#define CYW43_LL_STATE_SIZE_WORDS (526 + 1 + ((CYW43_BACKPLANE_READ_PAD_LEN_BYTES / 4) + 1) + CYW43_INCLUDE_LEGACY_F1_OVERFLOW_WORKAROUND_VARIABLES * 4)
191#define CYW43_BUS_MAX_BLOCK_SIZE 16384
192#define CYW43_BACKPLANE_READ_PAD_LEN_BYTES 0
193#define CYW43_LL_STATE_SIZE_WORDS (526 + 1)
199#define CYW43_CHANNEL_NONE (0xffffffff)
242} cyw43_async_event_t;
267 uint32_t opaque[CYW43_LL_STATE_SIZE_WORDS];
270void cyw43_ll_init(cyw43_ll_t *self,
void *cb_data);
271void cyw43_ll_deinit(cyw43_ll_t *self);
273int cyw43_ll_bus_init(cyw43_ll_t *self,
const uint8_t *mac);
274void cyw43_ll_bus_sleep(cyw43_ll_t *self,
bool can_sleep);
275void cyw43_ll_process_packets(cyw43_ll_t *self);
276int cyw43_ll_ioctl(cyw43_ll_t *self, uint32_t cmd,
size_t len, uint8_t *buf, uint32_t iface);
277int cyw43_ll_send_ethernet(cyw43_ll_t *self,
int itf,
size_t len,
const void *buf,
bool is_pbuf);
279int cyw43_ll_wifi_on(cyw43_ll_t *self, uint32_t country);
280int cyw43_ll_wifi_pm(cyw43_ll_t *self, uint32_t pm, uint32_t pm_sleep_ret, uint32_t li_bcn, uint32_t li_dtim, uint32_t li_assoc);
281int cyw43_ll_wifi_get_pm(cyw43_ll_t *self, uint32_t *pm, uint32_t *pm_sleep_ret, uint32_t *li_bcn, uint32_t *li_dtim, uint32_t *li_assoc);
284int cyw43_ll_wifi_join(cyw43_ll_t *self,
size_t ssid_len,
const uint8_t *ssid,
size_t key_len,
const uint8_t *key, uint32_t auth_type,
const uint8_t *bssid, uint32_t channel);
285void cyw43_ll_wifi_set_wpa_auth(cyw43_ll_t *self);
286void cyw43_ll_wifi_rejoin(cyw43_ll_t *self);
287int cyw43_ll_wifi_get_bssid(cyw43_ll_t *self_in, uint8_t *bssid);
289int cyw43_ll_wifi_ap_init(cyw43_ll_t *self,
size_t ssid_len,
const uint8_t *ssid, uint32_t auth,
size_t key_len,
const uint8_t *key, uint32_t channel);
290int cyw43_ll_wifi_ap_set_up(cyw43_ll_t *self,
bool up);
291int cyw43_ll_wifi_ap_get_stas(cyw43_ll_t *self,
int *num_stas, uint8_t *macs);
294int cyw43_ll_gpio_set(cyw43_ll_t *self,
int gpio_n,
bool gpio_en);
295int cyw43_ll_gpio_get(cyw43_ll_t *self_in,
int gpio_n,
bool *gpio_en);
299int cyw43_ll_wifi_get_mac(cyw43_ll_t *self_in, uint8_t *addr);
302int cyw43_ll_wifi_update_multicast_filter(cyw43_ll_t *self_in, uint8_t *addr,
bool add);
305bool cyw43_ll_has_work(cyw43_ll_t *self);
306bool cyw43_ll_bt_has_work(cyw43_ll_t *self);
309int cyw43_cb_read_host_interrupt_pin(
void *cb_data);
310void cyw43_cb_ensure_awake(
void *cb_data);
311void cyw43_cb_process_async_event(
void *cb_data,
const cyw43_async_event_t *ev);
312void cyw43_cb_process_ethernet(
void *cb_data,
int itf,
size_t len,
const uint8_t *buf);
315void cyw43_ll_write_backplane_reg(cyw43_ll_t *self_in, uint32_t addr, uint32_t val);
316uint32_t cyw43_ll_read_backplane_reg(cyw43_ll_t *self_in, uint32_t addr);
317int cyw43_ll_write_backplane_mem(cyw43_ll_t *self_in, uint32_t addr, uint32_t len,
const uint8_t *buf);
318int cyw43_ll_read_backplane_mem(cyw43_ll_t *self_in, uint32_t addr, uint32_t len, uint8_t *buf);
struct _cyw43_wifi_scan_options_t cyw43_wifi_scan_options_t
wifi scan options passed to cyw43_wifi_scan
struct _cyw43_ev_scan_result_t cyw43_ev_scan_result_t
Structure to return wifi scan results.
@ CYW43_ITF_STA
Client interface STA mode.
Definition cyw43_ll.h:207
@ CYW43_ITF_AP
Access point (AP) interface mode.
Definition cyw43_ll.h:208
Definition cyw43_ll.h:230
Structure to return wifi scan results.
Definition cyw43_ll.h:216
uint8_t auth_mode
wifi auth mode CYW43_AUTH_
Definition cyw43_ll.h:225
int16_t rssi
signal strength
Definition cyw43_ll.h:226
uint8_t ssid_len
length of wlan access point name
Definition cyw43_ll.h:220
uint8_t ssid[32]
wlan access point name
Definition cyw43_ll.h:221
uint8_t bssid[6]
access point mac address
Definition cyw43_ll.h:218
uint16_t channel
wifi channel
Definition cyw43_ll.h:223
Definition cyw43_ll.h:266
wifi scan options passed to cyw43_wifi_scan
Definition cyw43_ll.h:248
uint8_t ssid[32]
ssid name
Definition cyw43_ll.h:253
int32_t home_time
home time (not used)
Definition cyw43_ll.h:260
int32_t passive_time
passive time (not used)
Definition cyw43_ll.h:259
int8_t scan_type
scan type 0=active, 1=passive
Definition cyw43_ll.h:256
int32_t channel_num
number of channels (not used)
Definition cyw43_ll.h:261
uint32_t version
version (not used)
Definition cyw43_ll.h:249
uint16_t _
not used
Definition cyw43_ll.h:251
uint16_t channel_list[1]
channel list (not used)
Definition cyw43_ll.h:262
int32_t active_time
active time (not used)
Definition cyw43_ll.h:258
uint8_t bssid[6]
bssid (not used)
Definition cyw43_ll.h:254
uint16_t action
action (not used)
Definition cyw43_ll.h:250
int32_t nprobes
number of probes (not used)
Definition cyw43_ll.h:257
int8_t bss_type
bssid type (not used)
Definition cyw43_ll.h:255
uint32_t ssid_len
ssid length, 0=all
Definition cyw43_ll.h:252