Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
csk_wifi.c File Reference

Data Structures

struct  csk_wifi_ctrl_msg_t
 
struct  csk_wifi_config
 
struct  csk_wifi_object_t
 

Macros

#define DT_DRV_COMPAT   listenai_csk_wifi
 
#define MAC_BYTES_LEN   6
 
#define MAC_STRING_LEN   18
 

Enumerations

enum  wifi_ctrl_msg_type_t { WIFI_COMMAND , WIFI_EVENT , WIFI_COMMAND , WIFI_EVENT }
 

Functions

 LOG_MODULE_DECLARE (csk_wifi, CONFIG_WIFI_LOG_LEVEL)
 
 K_MSGQ_DEFINE (wifi_result_msgq, sizeof(wifi_ret_msg_t), 1, 4)
 
 K_MSGQ_DEFINE (wifi_interactive_msgq, sizeof(csk_wifi_ctrl_msg_t), 4, 4)
 
static void wifi_control_thread (void *, void *, void *)
 
 K_SEM_DEFINE (init_sem, 0, 1)
 
 K_THREAD_DEFINE (wifi_ctrl_thread_id, CONFIG_WIFI_CTRL_STACK_SIZE, wifi_control_thread, NULL, NULL, NULL, CONFIG_WIFI_CTRL_PRIORITY, 0, 0)
 
static void wifi_virtual_netif_init (const struct device *dev)
 
static void csk_wifi_receive_pkt (struct network_handle *virtual_netif, void *arg)
 
wifi_sta_state_machine_t wifi_obj_get_sm (void)
 
static void wifi_obj_set_sm (wifi_sta_state_machine_t sm)
 
static int wifi_give_result (wifi_ret_msg_t *ret_msg)
 
int wifi_take_result (wifi_ret_msg_t *ret_msg, k_timeout_t timeout)
 
int wifi_send_command (const struct device *dev, wifi_cmd_t command, k_timeout_t timeouts)
 
static wifi_auth_mode_t wifi_get_drv_encryption_mode (csk_wifi_encryption_mode_t mode)
 
static csk_wifi_encryption_mode_t wifi_get_csk_encryption_mode (wifi_auth_mode_t mode)
 
static wifi_mode_t wifi_get_drv_wifi_mode (csk_wifi_mode_t mode)
 
static int wifi_send_event (const struct device *dev, csk_wifi_event_t event, void *event_data, uint32_t data_len, k_timeout_t timeouts)
 
static int wifi_get_message (csk_wifi_ctrl_msg_t *msg, k_timeout_t timeouts)
 
const struct devicewifi_obj_get_dev (csk_wifi_mode_t mode)
 
static int convert_str_to_bytes (uint8_t *out, const char *s)
 
static void hosted_event_handler (hosted_event_t events, void *arg)
 
static int wifi_driver_init (void)
 
static csk_wifi_result_t wifi_sta_connect (const struct device *dev)
 
static csk_wifi_result_t wifi_sta_get_connected_info (const struct device *dev)
 
static csk_wifi_result_t wifi_sta_disconnect (const struct device *dev)
 
static csk_wifi_result_t wifi_sotfap_start (const struct device *dev)
 
static csk_wifi_result_t wifi_sotfap_stop (const struct device *dev)
 
static csk_wifi_result_t wifi_scan_list (int *ap_count, esp_hosted_wifi_scanlist_t **ap_list)
 
static void wifi_command_handler (const struct device *dev, wifi_cmd_t command)
 
static void wifi_event_handler (const struct device *dev, csk_wifi_event_t event)
 
static void csk_wifi_netif_init (struct net_if *netif)
 
static int csk_wifi_send_pkt (const struct device *dev, struct net_pkt *pkt)
 
static int csk_eth_dev_init (const struct device *dev)
 

Variables

static csk_wifi_object_t s_csk_wifi_obj = {0}
 
static hosted_event_callback_t s_driver_event_cb
 
const char * WIFI_STA_SM_STRINGS []
 
const char * WLAN_EVENT_STRINGS []
 
static const struct ethernet_api csk_eth_apis
 

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   listenai_csk_wifi

◆ MAC_BYTES_LEN

#define MAC_BYTES_LEN   6

◆ MAC_STRING_LEN

#define MAC_STRING_LEN   18

Enumeration Type Documentation

◆ wifi_ctrl_msg_type_t

Enumerator
WIFI_COMMAND 
WIFI_EVENT 
WIFI_COMMAND 
WIFI_EVENT 

Function Documentation

◆ convert_str_to_bytes()

static int convert_str_to_bytes ( uint8_t out,
const char *  s 
)
static

◆ csk_eth_dev_init()

static int csk_eth_dev_init ( const struct device dev)
static

◆ csk_wifi_netif_init()

static void csk_wifi_netif_init ( struct net_if netif)
static

◆ csk_wifi_receive_pkt()

static void csk_wifi_receive_pkt ( struct network_handle *  virtual_netif,
void arg 
)
static

◆ csk_wifi_send_pkt()

static int csk_wifi_send_pkt ( const struct device dev,
struct net_pkt pkt 
)
static

◆ hosted_event_handler()

static void hosted_event_handler ( hosted_event_t  events,
void arg 
)
static

◆ K_MSGQ_DEFINE() [1/2]

K_MSGQ_DEFINE ( wifi_interactive_msgq  ,
sizeof(csk_wifi_ctrl_msg_t ,
,
 
)

◆ K_MSGQ_DEFINE() [2/2]

K_MSGQ_DEFINE ( wifi_result_msgq  ,
sizeof(wifi_ret_msg_t ,
,
 
)

◆ K_SEM_DEFINE()

K_SEM_DEFINE ( init_sem  ,
,
 
)

◆ K_THREAD_DEFINE()

K_THREAD_DEFINE ( wifi_ctrl_thread_id  ,
CONFIG_WIFI_CTRL_STACK_SIZE  ,
wifi_control_thread  ,
NULL  ,
NULL  ,
NULL  ,
CONFIG_WIFI_CTRL_PRIORITY  ,
,
 
)

◆ LOG_MODULE_DECLARE()

LOG_MODULE_DECLARE ( csk_wifi  ,
CONFIG_WIFI_LOG_LEVEL   
)

◆ wifi_command_handler()

static void wifi_command_handler ( const struct device dev,
wifi_cmd_t  command 
)
static

◆ wifi_control_thread()

static void wifi_control_thread ( void arg1,
void arg2,
void arg3 
)
static

◆ wifi_driver_init()

static int wifi_driver_init ( void  )
static

◆ wifi_event_handler()

static void wifi_event_handler ( const struct device dev,
csk_wifi_event_t  event 
)
static

◆ wifi_get_csk_encryption_mode()

static csk_wifi_encryption_mode_t wifi_get_csk_encryption_mode ( wifi_auth_mode_t  mode)
static

◆ wifi_get_drv_encryption_mode()

static wifi_auth_mode_t wifi_get_drv_encryption_mode ( csk_wifi_encryption_mode_t  mode)
static

◆ wifi_get_drv_wifi_mode()

static wifi_mode_t wifi_get_drv_wifi_mode ( csk_wifi_mode_t  mode)
static

◆ wifi_get_message()

static int wifi_get_message ( csk_wifi_ctrl_msg_t msg,
k_timeout_t  timeouts 
)
inlinestatic

◆ wifi_give_result()

static int wifi_give_result ( wifi_ret_msg_t ret_msg)
inlinestatic

◆ wifi_obj_get_dev()

const struct device * wifi_obj_get_dev ( csk_wifi_mode_t  mode)

◆ wifi_obj_get_sm()

wifi_sta_state_machine_t wifi_obj_get_sm ( void  )

◆ wifi_obj_set_sm()

static void wifi_obj_set_sm ( wifi_sta_state_machine_t  sm)
inlinestatic

◆ wifi_scan_list()

static csk_wifi_result_t wifi_scan_list ( int *  ap_count,
esp_hosted_wifi_scanlist_t **  ap_list 
)
static

◆ wifi_send_command()

int wifi_send_command ( const struct device dev,
wifi_cmd_t  command,
k_timeout_t  timeouts 
)

◆ wifi_send_event()

static int wifi_send_event ( const struct device dev,
csk_wifi_event_t  event,
void event_data,
uint32_t  data_len,
k_timeout_t  timeouts 
)
inlinestatic

◆ wifi_sotfap_start()

static csk_wifi_result_t wifi_sotfap_start ( const struct device dev)
static

◆ wifi_sotfap_stop()

static csk_wifi_result_t wifi_sotfap_stop ( const struct device dev)
static

◆ wifi_sta_connect()

static csk_wifi_result_t wifi_sta_connect ( const struct device dev)
static

◆ wifi_sta_disconnect()

static csk_wifi_result_t wifi_sta_disconnect ( const struct device dev)
static

◆ wifi_sta_get_connected_info()

static csk_wifi_result_t wifi_sta_get_connected_info ( const struct device dev)
static

◆ wifi_take_result()

int wifi_take_result ( wifi_ret_msg_t ret_msg,
k_timeout_t  timeout 
)

◆ wifi_virtual_netif_init()

static void wifi_virtual_netif_init ( const struct device dev)
static

Variable Documentation

◆ csk_eth_apis

const struct ethernet_api csk_eth_apis
static
Initial value:
= {
.iface_api.init = csk_wifi_netif_init,
}
static void csk_wifi_netif_init(struct net_if *netif)
Definition: csk_wifi.c:610
static int csk_wifi_send_pkt(const struct device *dev, struct net_pkt *pkt)
Definition: csk_wifi.c:620

◆ s_csk_wifi_obj

csk_wifi_object_t s_csk_wifi_obj = {0}
static

◆ s_driver_event_cb

hosted_event_callback_t s_driver_event_cb
static

◆ WIFI_STA_SM_STRINGS

const char* WIFI_STA_SM_STRINGS[]
Initial value:
= {
}
#define FOREACH_WIFI_STA_SM(WIFI_SM)
Definition: csk_wifi_priv.h:57
#define GENERATE_STRING(STRING)
Definition: csk_wifi_priv.h:95

◆ WLAN_EVENT_STRINGS

const char* WLAN_EVENT_STRINGS[]
Initial value:
= {
}
#define FOREACH_WLAN_EVENT(WLAN_EVENT)
Definition: csk_wifi_priv.h:72