34 #ifndef CYW43_INCLUDED_CYW43_LL_H 35 #define CYW43_INCLUDED_CYW43_LL_H 38 #include "cyw43_config.h" 54 #define CYW43_IOCTL_GET_SSID (0x32) 55 #define CYW43_IOCTL_GET_CHANNEL (0x3a) 56 #define CYW43_IOCTL_SET_DISASSOC (0x69) 57 #define CYW43_IOCTL_GET_ANTDIV (0x7e) 58 #define CYW43_IOCTL_SET_ANTDIV (0x81) 59 #define CYW43_IOCTL_SET_MONITOR (0xd9) 60 #define CYW43_IOCTL_GET_RSSI (0xfe) 61 #define CYW43_IOCTL_GET_VAR (0x20c) 62 #define CYW43_IOCTL_SET_VAR (0x20f) 65 #define CYW43_EV_SET_SSID (0) 66 #define CYW43_EV_JOIN (1) 67 #define CYW43_EV_AUTH (3) 68 #define CYW43_EV_DEAUTH (5) 69 #define CYW43_EV_DEAUTH_IND (6) 70 #define CYW43_EV_ASSOC (7) 71 #define CYW43_EV_DISASSOC (11) 72 #define CYW43_EV_DISASSOC_IND (12) 73 #define CYW43_EV_LINK (16) 74 #define CYW43_EV_PRUNE (23) 75 #define CYW43_EV_PSK_SUP (46) 76 #define CYW43_EV_ESCAN_RESULT (69) 77 #define CYW43_EV_CSA_COMPLETE_IND (80) 78 #define CYW43_EV_ASSOC_REQ_IE (87) 79 #define CYW43_EV_ASSOC_RESP_IE (88) 82 #define CYW43_STATUS_SUCCESS (0) 83 #define CYW43_STATUS_FAIL (1) 84 #define CYW43_STATUS_TIMEOUT (2) 85 #define CYW43_STATUS_NO_NETWORKS (3) 86 #define CYW43_STATUS_ABORT (4) 87 #define CYW43_STATUS_NO_ACK (5) 88 #define CYW43_STATUS_UNSOLICITED (6) 89 #define CYW43_STATUS_ATTEMPT (7) 90 #define CYW43_STATUS_PARTIAL (8) 91 #define CYW43_STATUS_NEWSCAN (9) 92 #define CYW43_STATUS_NEWASSOC (10) 95 #define CYW43_SUP_DISCONNECTED (0) // Disconnected 96 #define CYW43_SUP_CONNECTING (1) // Connecting 97 #define CYW43_SUP_IDREQUIRED (2) // ID Required 98 #define CYW43_SUP_AUTHENTICATING (3) // Authenticating 99 #define CYW43_SUP_AUTHENTICATED (4) // Authenticated 100 #define CYW43_SUP_KEYXCHANGE (5) // Key Exchange 101 #define CYW43_SUP_KEYED (6) // Key Exchanged 102 #define CYW43_SUP_TIMEOUT (7) // Timeout 103 #define CYW43_SUP_LAST_BASIC_STATE (8) // Last Basic State 104 #define CYW43_SUP_KEYXCHANGE_WAIT_M1 CYW43_SUP_AUTHENTICATED // Waiting to receive handshake msg M1 105 #define CYW43_SUP_KEYXCHANGE_PREP_M2 CYW43_SUP_KEYXCHANGE // Preparing to send handshake msg M2 106 #define CYW43_SUP_KEYXCHANGE_WAIT_M3 CYW43_SUP_LAST_BASIC_STATE // Waiting to receive handshake msg M3 107 #define CYW43_SUP_KEYXCHANGE_PREP_M4 (9) // Preparing to send handshake msg M4 108 #define CYW43_SUP_KEYXCHANGE_WAIT_G1 (10) // Waiting to receive handshake msg G1 109 #define CYW43_SUP_KEYXCHANGE_PREP_G2 (11) // Preparing to send handshake msg G2 112 #define CYW43_REASON_INITIAL_ASSOC (0) // initial assoc 113 #define CYW43_REASON_LOW_RSSI (1) // roamed due to low RSSI 114 #define CYW43_REASON_DEAUTH (2) // roamed due to DEAUTH indication 115 #define CYW43_REASON_DISASSOC (3) // roamed due to DISASSOC indication 116 #define CYW43_REASON_BCNS_LOST (4) // roamed due to lost beacons 117 #define CYW43_REASON_FAST_ROAM_FAILED (5) // roamed due to fast roam failure 118 #define CYW43_REASON_DIRECTED_ROAM (6) // roamed due to request by AP 119 #define CYW43_REASON_TSPEC_REJECTED (7) // roamed due to TSPEC rejection 120 #define CYW43_REASON_BETTER_AP (8) // roamed due to finding better AP 123 #define CYW43_REASON_PRUNE_ENCR_MISMATCH (1) // encryption mismatch 124 #define CYW43_REASON_PRUNE_BCAST_BSSID (2) // AP uses a broadcast BSSID 125 #define CYW43_REASON_PRUNE_MAC_DENY (3) // STA's MAC addr is in AP's MAC deny list 126 #define CYW43_REASON_PRUNE_MAC_NA (4) // STA's MAC addr is not in AP's MAC allow list 127 #define CYW43_REASON_PRUNE_REG_PASSV (5) // AP not allowed due to regulatory restriction 128 #define CYW43_REASON_PRUNE_SPCT_MGMT (6) // AP does not support STA locale spectrum mgmt 129 #define CYW43_REASON_PRUNE_RADAR (7) // AP is on a radar channel of STA locale 130 #define CYW43_REASON_RSN_MISMATCH (8) // STA does not support AP's RSN 131 #define CYW43_REASON_PRUNE_NO_COMMON_RATES (9) // No rates in common with AP 132 #define CYW43_REASON_PRUNE_BASIC_RATES (10) // STA does not support all basic rates of BSS 133 #define CYW43_REASON_PRUNE_CCXFAST_PREVAP (11) // CCX FAST ROAM: prune previous AP 134 #define CYW43_REASON_PRUNE_CIPHER_NA (12) // BSS's cipher not supported 135 #define CYW43_REASON_PRUNE_KNOWN_STA (13) // AP is already known to us as a STA 136 #define CYW43_REASON_PRUNE_CCXFAST_DROAM (14) // CCX FAST ROAM: prune unqualified AP 137 #define CYW43_REASON_PRUNE_WDS_PEER (15) // AP is already known to us as a WDS peer 138 #define CYW43_REASON_PRUNE_QBSS_LOAD (16) // QBSS LOAD - AAC is too low 139 #define CYW43_REASON_PRUNE_HOME_AP (17) // prune home AP 140 #define CYW43_REASON_PRUNE_AP_BLOCKED (18) // prune blocked AP 141 #define CYW43_REASON_PRUNE_NO_DIAG_SUPPORT (19) // prune due to diagnostic mode not supported 144 #define CYW43_REASON_SUP_OTHER (0) // Other reason 145 #define CYW43_REASON_SUP_DECRYPT_KEY_DATA (1) // Decryption of key data failed 146 #define CYW43_REASON_SUP_BAD_UCAST_WEP128 (2) // Illegal use of ucast WEP128 147 #define CYW43_REASON_SUP_BAD_UCAST_WEP40 (3) // Illegal use of ucast WEP40 148 #define CYW43_REASON_SUP_UNSUP_KEY_LEN (4) // Unsupported key length 149 #define CYW43_REASON_SUP_PW_KEY_CIPHER (5) // Unicast cipher mismatch in pairwise key 150 #define CYW43_REASON_SUP_MSG3_TOO_MANY_IE (6) // WPA IE contains > 1 RSN IE in key msg 3 151 #define CYW43_REASON_SUP_MSG3_IE_MISMATCH (7) // WPA IE mismatch in key message 3 152 #define CYW43_REASON_SUP_NO_INSTALL_FLAG (8) // INSTALL flag unset in 4-way msg 153 #define CYW43_REASON_SUP_MSG3_NO_GTK (9) // encapsulated GTK missing from msg 3 154 #define CYW43_REASON_SUP_GRP_KEY_CIPHER (10) // Multicast cipher mismatch in group key 155 #define CYW43_REASON_SUP_GRP_MSG1_NO_GTK (11) // encapsulated GTK missing from group msg 1 156 #define CYW43_REASON_SUP_GTK_DECRYPT_FAIL (12) // GTK decrypt failure 157 #define CYW43_REASON_SUP_SEND_FAIL (13) // message send failure 158 #define CYW43_REASON_SUP_DEAUTH (14) // received FC_DEAUTH 159 #define CYW43_REASON_SUP_WPA_PSK_TMO (15) // WPA PSK 4-way handshake timeout 162 #define CYW43_WPA_AUTH_PSK (0x0004) 163 #define CYW43_WPA2_AUTH_PSK (0x0080) 170 #define CYW43_AUTH_OPEN (0) 172 #define CYW43_AUTH_WPA_TKIP_PSK (0x00200002) 173 #define CYW43_AUTH_WPA2_AES_PSK (0x00400004) 174 #define CYW43_AUTH_WPA2_MIXED_PSK (0x00400006) 180 #define CYW43_NO_POWERSAVE_MODE (0) 181 #define CYW43_PM1_POWERSAVE_MODE (1) 182 #define CYW43_PM2_POWERSAVE_MODE (2) 186 #define CYW43_BUS_MAX_BLOCK_SIZE 64 188 #define CYW43_BUS_MAX_BLOCK_SIZE 16384 194 #define CYW43_CHANNEL_NONE (0xffffffff) 257 uint16_t channel_list[1];
262 uint32_t opaque[526 + 7];
265 void cyw43_ll_init(
cyw43_ll_t *
self,
void *cb_data);
268 int cyw43_ll_bus_init(
cyw43_ll_t *
self,
const uint8_t *mac);
269 void cyw43_ll_bus_sleep(
cyw43_ll_t *
self,
bool can_sleep);
270 void cyw43_ll_process_packets(
cyw43_ll_t *
self);
271 int cyw43_ll_ioctl(
cyw43_ll_t *
self, uint32_t cmd,
size_t len, uint8_t *buf, uint32_t iface);
272 int cyw43_ll_send_ethernet(
cyw43_ll_t *
self,
int itf,
size_t len,
const void *buf,
bool is_pbuf);
274 int cyw43_ll_wifi_on(
cyw43_ll_t *
self, uint32_t country);
275 int 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);
276 int 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);
279 int 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);
280 void cyw43_ll_wifi_set_wpa_auth(
cyw43_ll_t *
self);
284 int 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);
285 int cyw43_ll_wifi_ap_set_up(
cyw43_ll_t *
self,
bool up);
286 int cyw43_ll_wifi_ap_get_stas(
cyw43_ll_t *
self,
int *num_stas, uint8_t *macs);
289 int cyw43_ll_gpio_set(
cyw43_ll_t *
self,
int gpio_n,
bool gpio_en);
290 int cyw43_ll_gpio_get(
cyw43_ll_t *self_in,
int gpio_n,
bool *gpio_en);
294 int cyw43_ll_wifi_get_mac(
cyw43_ll_t *self_in, uint8_t *addr);
297 int cyw43_ll_wifi_update_multicast_filter(
cyw43_ll_t *self_in, uint8_t *addr,
bool add);
304 int cyw43_cb_read_host_interrupt_pin(
void *cb_data);
305 void cyw43_cb_ensure_awake(
void *cb_data);
307 void cyw43_cb_process_ethernet(
void *cb_data,
int itf,
size_t len,
const uint8_t *buf);
310 void cyw43_ll_write_backplane_reg(
cyw43_ll_t *self_in, uint32_t addr, uint32_t val);
311 uint32_t cyw43_ll_read_backplane_reg(
cyw43_ll_t *self_in, uint32_t addr);
312 int cyw43_ll_write_backplane_mem(
cyw43_ll_t *self_in, uint32_t addr, uint32_t len,
const uint8_t *buf);
313 int cyw43_ll_read_backplane_mem(
cyw43_ll_t *self_in, uint32_t addr, uint32_t len, uint8_t *buf);
317 #endif // CYW43_INCLUDED_CYW43_LL_H wifi scan options passed to cyw43_wifi_scan
Definition: cyw43_ll.h:243
int32_t passive_time
passive time (not used)
Definition: cyw43_ll.h:254
Definition: cyw43_ll.h:261
uint32_t version
version (not used)
Definition: cyw43_ll.h:244
Access point (AP) interface mode.
Definition: cyw43_ll.h:203
uint16_t channel
wifi channel
Definition: cyw43_ll.h:218
uint8_t ssid_len
length of wlan access point name
Definition: cyw43_ll.h:215
int32_t home_time
home time (not used)
Definition: cyw43_ll.h:255
Structure to return wifi scan results.
Definition: cyw43_ll.h:211
uint8_t auth_mode
wifi auth mode CYW43_AUTH_
Definition: cyw43_ll.h:220
int8_t scan_type
scan type 0=active, 1=passive
Definition: cyw43_ll.h:251
uint16_t action
action (not used)
Definition: cyw43_ll.h:245
int8_t bss_type
bssid type (not used)
Definition: cyw43_ll.h:250
uint16_t _
not used
Definition: cyw43_ll.h:246
Client interface STA mode.
Definition: cyw43_ll.h:202
int32_t channel_num
number of channels (not used)
Definition: cyw43_ll.h:256
uint32_t ssid_len
ssid length, 0=all
Definition: cyw43_ll.h:247
Definition: cyw43_ll.h:225
int16_t rssi
signal strength
Definition: cyw43_ll.h:221
uint8_t bssid[6]
access point mac address
Definition: cyw43_ll.h:213
int32_t nprobes
number of probes (not used)
Definition: cyw43_ll.h:252
int32_t active_time
active time (not used)
Definition: cyw43_ll.h:253
struct _cyw43_wifi_scan_options_t cyw43_wifi_scan_options_t
wifi scan options passed to cyw43_wifi_scan
uint8_t ssid[32]
wlan access point name
Definition: cyw43_ll.h:216
struct _cyw43_ev_scan_result_t cyw43_ev_scan_result_t
Structure to return wifi scan results.