14#include "netdev_api.h"
15#include "hosted/hosted.h"
18#include "net/wlan/wlan_defs.h"
19#include "net/wlan/wlan.h"
20#include "net/wlan/wlan_ext_req.h"
22#error "Please select a wifi module driver"
31#define CSK_WIFI_CHECK(cond, ret_val) ({ \
33 LOG_ERR("%s:%d Check failed", __FUNCTION__, __LINE__); \
39#define CSK_WIFI_CHECK_RETURN(cond, ret_val, format, ...) ({ \
41 LOG_ERR("%s:%d Check failed", __FUNCTION__, __LINE__); \
42 LOG_ERR(format, ##__VA_ARGS__); \
48#define CSK_WIFI_CHECK_GOTO(cond, label, format, ...) ({ \
50 LOG_ERR("%s:%d Check failed", __FUNCTION__, __LINE__); \
51 LOG_ERR(format, ##__VA_ARGS__); \
57#define FOREACH_WIFI_STA_SM(WIFI_SM) \
58 WIFI_SM(WIFI_SM_ON_STARTUP) \
59 WIFI_SM(WIFI_SM_STARTUP_DONE) \
60 WIFI_SM(WIFI_SM_STA_CONNECTED) \
61 WIFI_SM(WIFI_SM_STA_DISCONNECTED) \
62 WIFI_SM(WIFI_SM_STA_ON_CONNECT) \
63 WIFI_SM(WIFI_SM_STA_ON_CONNECT_SCAN) \
64 WIFI_SM(WIFI_SM_STA_ON_AUTH_EXCEPTION) \
65 WIFI_SM(WIFI_SM_STA_ON_ASSOC_EXCEPTION) \
66 WIFI_SM(WIFI_SM_STA_ON_HANDSHAKE_EXCEPTION) \
67 WIFI_SM(WIFI_SM_ON_CMDTIMEOUT_EXCEPTION) \
68 WIFI_SM(WIFI_SM_STA_ON_DISCONNECT) \
69 WIFI_SM(WIFI_SM_STA_ON_SCAN) \
70 WIFI_SM(WIFI_SM_STA_SCAN_DONE) \
72#define FOREACH_WLAN_EVENT(WLAN_EVENT) \
73 WLAN_EVENT(WLAN_EVENT_CONNECTED) \
74 WLAN_EVENT(WLAN_EVENT_DISCONNECTED) \
75 WLAN_EVENT(WLAN_EVENT_SCAN_SUCCESS) \
76 WLAN_EVENT(WLAN_EVENT_SCAN_FAILED) \
77 WLAN_EVENT(WLAN_EVENT_4WAY_HANDSHAKE_FAILED) \
78 WLAN_EVENT(WLAN_EVENT_SSID_NOT_FOUND) \
79 WLAN_EVENT(WLAN_EVENT_AUTH_TIMEOUT) \
80 WLAN_EVENT(WLAN_EVENT_ASSOC_TIMEOUT) \
81 WLAN_EVENT(WLAN_EVENT_CONNECT_FAILED) \
82 WLAN_EVENT(WLAN_EVENT_CONNECTION_LOSS) \
83 WLAN_EVENT(WLAN_EVENT_AUTH_FAILED) \
84 WLAN_EVENT(WLAN_EVENT_ASSOC_FAILED) \
85 WLAN_EVENT(WLAN_EVENT_DEV_HANG) \
86 WLAN_EVENT(WLAN_EVENT_AP_STA_CONNECTED) \
87 WLAN_EVENT(WLAN_EVENT_AP_STA_DISCONNECTED) \
88 WLAN_EVENT(WLAN_EVENT_REKEY_COMPLETE) \
89 WLAN_EVENT(WLAN_EVENT_FW_CMD_TIMEOUT) \
90 WLAN_EVENT(WLAN_EVENT_FW_STARTUP_DONE) \
91 WLAN_EVENT(WLAN_EVENT_MAX) \
94#define GENERATE_ENUM(ENUM) ENUM,
95#define GENERATE_STRING(STRING) #STRING,
120#define WIFI_STA_SM_PRIMARY_GET(a) ((uint16_t)((a)))
121#define WIFI_STA_SM_PRIMARY_SET(a, b) do { \
122 const char *a_sm_str = WIFI_STA_SM_STRINGS[(a)]; \
123 const char *b_sm_str = WIFI_STA_SM_STRINGS[(b)]; \
124 LOG_DBG("(%d)STA_SM: current[%s], next[%s]", __LINE__, a_sm_str, b_sm_str); \
138#ifdef CONFIG_CSK_WIFI_XR819S
187#ifdef CONFIG_CSK_WIFI_XR819S
ZTEST_BMEM int timeout
Definition: main.c:31
ZTEST_BMEM int count
Definition: main.c:33
struct timeout_order timeouts[]
Definition: main.c:876
wifi_sta_state_machine_t wifi_obj_get_sm(void)
Definition: csk_wifi.c:73
csk_wifi_event_t
CSK WiFi events structure.
Definition: csk_wifi.h:95
csk_wifi_encryption_mode_t
CSK WiFi encryption mode.
Definition: csk_wifi.h:24
csk_wifi_result_t
CSK WiFi operation(API) results structure.
Definition: csk_wifi.h:83
csk_wifi_encryption_mode_t wifi_get_encryption_mode(csk_wifi_encryption_mode_t mode)
Definition: csk_wifi_819s.c:154
uint32_t wifi_fsm_t
Definition: csk_wifi_priv.h:97
const char * WIFI_STA_SM_STRINGS[]
Definition: csk_wifi.c:65
wifi_sta_state_machine_t
Definition: csk_wifi_priv.h:99
int wifi_send_command(const struct device *dev, wifi_cmd_t command, k_timeout_t timeouts)
Definition: csk_wifi.c:97
int wifi_take_result(wifi_ret_msg_t *ret_msg, k_timeout_t timeout)
Definition: csk_wifi.c:92
csk_wifi_mode_t
Definition: csk_wifi_priv.h:142
@ CSK_WIFI_MODE_STA
Definition: csk_wifi_priv.h:143
@ CSK_WIFI_MODE_AP
Definition: csk_wifi_priv.h:144
@ CSK_WIFI_MODE_MAX
Definition: csk_wifi_priv.h:145
#define FOREACH_WIFI_STA_SM(WIFI_SM)
Definition: csk_wifi_priv.h:57
const struct device * wifi_obj_get_dev(csk_wifi_mode_t mode)
Definition: csk_wifi.c:211
#define GENERATE_ENUM(ENUM)
Definition: csk_wifi_priv.h:94
wifi_cmd_t
Definition: csk_wifi_priv.h:148
@ WIFI_CMD_STA_INIT
Definition: csk_wifi_priv.h:151
@ WIFI_CMD_STA_CONNECT
Definition: csk_wifi_priv.h:152
@ WIFI_CMD_SCAN
Definition: csk_wifi_priv.h:157
@ WIFI_CMD_DEINIT
Definition: csk_wifi_priv.h:150
@ WIFI_CMD_AP_STOP
Definition: csk_wifi_priv.h:156
@ WIFI_CMD_AP_START
Definition: csk_wifi_priv.h:155
@ WIFI_CMD_INIT
Definition: csk_wifi_priv.h:149
@ WIFI_CMD_AP_INIT
Definition: csk_wifi_priv.h:154
@ WIFI_CMD_STA_DISCONNECT
Definition: csk_wifi_priv.h:153
void wifi_dispatch_callbacks(csk_wifi_event_t events, void *event_data, uint32_t event_data_len)
Definition: csk_wifi_api.c:10
struct result result[2]
Definition: errno.c:41
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition: ft8xx_reference_api.h:153
state
Definition: http_parser_state.h:30
Public API for network interface.
Network packet buffer descriptor API.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Definition: csk_wifi_priv.h:127
struct net_if * netif
Definition: csk_wifi_priv.h:130
uint8_t mac_addr[6]
Definition: csk_wifi_priv.h:131
const struct device * dev
Definition: csk_wifi_priv.h:128
void * virtual_netif
Definition: csk_wifi_priv.h:129
csk_wifi_softap_config_t ap_config
Definition: csk_wifi_priv.h:134
csk_wifi_sta_config_t sta_config
Definition: csk_wifi_priv.h:133
bool sta_is_connected
Definition: csk_wifi_priv.h:136
CSK WiFi scan info type.
Definition: csk_wifi.h:72
CSK WiFi softap configuration struct.
Definition: csk_wifi.h:59
CSK WiFi station configuration struct.
Definition: csk_wifi.h:47
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
Kernel timeout type.
Definition: sys_clock.h:65
Network Interface structure.
Definition: net_if.h:468
Definition: csk_wifi_priv.h:160
Definition: csk_wifi_priv.h:165
Definition: csk_wifi_priv.h:170