Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
eswifi_core.c File Reference
#include "eswifi_log.h"
#include <zephyr.h>
#include <kernel.h>
#include <device.h>
#include <string.h>
#include <errno.h>
#include <drivers/gpio.h>
#include <net/net_pkt.h>
#include <net/net_if.h>
#include <net/net_context.h>
#include <net/net_offload.h>
#include <net/wifi_mgmt.h>
#include <net/ethernet.h>
#include <net_private.h>
#include <net/net_core.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/printk.h>
#include "eswifi.h"

Macros

#define DT_DRV_COMPAT   inventek_eswifi
 
#define ESWIFI_WORKQUEUE_STACK_SIZE   1024
 

Functions

 LOG_MODULE_REGISTER (wifi_eswifi)
 
 K_KERNEL_STACK_DEFINE (eswifi_work_q_stack, 1024)
 
static int eswifi_reset (struct eswifi_dev *eswifi)
 
int eswifi_at_cmd_rsp (struct eswifi_dev *eswifi, char *cmd, char **rsp)
 
int eswifi_at_cmd (struct eswifi_dev *eswifi, char *cmd)
 
struct eswifi_deveswifi_by_iface_idx (uint8_t iface)
 
static void eswifi_scan (struct eswifi_dev *eswifi)
 
static int eswifi_connect (struct eswifi_dev *eswifi)
 
static int eswifi_disconnect (struct eswifi_dev *eswifi)
 
static void eswifi_request_work (struct k_work *item)
 
static int eswifi_get_mac_addr (struct eswifi_dev *eswifi, uint8_t addr[6])
 
static void eswifi_iface_init (struct net_if *iface)
 
static int eswifi_mgmt_scan (const struct device *dev, scan_result_cb_t cb)
 
static int eswifi_mgmt_disconnect (const struct device *dev)
 
static int eswifi_mgmt_connect (const struct device *dev, struct wifi_connect_req_params *params)
 
void eswifi_async_msg (struct eswifi_dev *eswifi, char *msg, size_t len)
 
static int eswifi_mgmt_ap_enable (const struct device *dev, struct wifi_connect_req_params *params)
 
static int eswifi_mgmt_ap_disable (const struct device *dev)
 
static int eswifi_init (const struct device *dev)
 
 NET_DEVICE_DT_INST_OFFLOAD_DEFINE (0, eswifi_init, NULL, &eswifi0, NULL, CONFIG_WIFI_INIT_PRIORITY, &eswifi_offload_api, 1500)
 

Variables

static struct eswifi_dev eswifi0
 
static const struct net_wifi_mgmt_offload eswifi_offload_api
 

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   inventek_eswifi

Copyright (c) 2018 Linaro

SPDX-License-Identifier: Apache-2.0

◆ ESWIFI_WORKQUEUE_STACK_SIZE

#define ESWIFI_WORKQUEUE_STACK_SIZE   1024

Function Documentation

◆ eswifi_async_msg()

void eswifi_async_msg ( struct eswifi_dev eswifi,
char *  msg,
size_t  len 
)

◆ eswifi_at_cmd()

int eswifi_at_cmd ( struct eswifi_dev eswifi,
char *  cmd 
)

◆ eswifi_at_cmd_rsp()

int eswifi_at_cmd_rsp ( struct eswifi_dev eswifi,
char *  cmd,
char **  rsp 
)

◆ eswifi_by_iface_idx()

struct eswifi_dev * eswifi_by_iface_idx ( uint8_t  iface)

◆ eswifi_connect()

static int eswifi_connect ( struct eswifi_dev eswifi)
static

◆ eswifi_disconnect()

static int eswifi_disconnect ( struct eswifi_dev eswifi)
static

◆ eswifi_get_mac_addr()

static int eswifi_get_mac_addr ( struct eswifi_dev eswifi,
uint8_t  addr[6] 
)
static

◆ eswifi_iface_init()

static void eswifi_iface_init ( struct net_if iface)
static

◆ eswifi_init()

static int eswifi_init ( const struct device dev)
static

◆ eswifi_mgmt_ap_disable()

static int eswifi_mgmt_ap_disable ( const struct device dev)
static

◆ eswifi_mgmt_ap_enable()

static int eswifi_mgmt_ap_enable ( const struct device dev,
struct wifi_connect_req_params params 
)
static

◆ eswifi_mgmt_connect()

static int eswifi_mgmt_connect ( const struct device dev,
struct wifi_connect_req_params params 
)
static

◆ eswifi_mgmt_disconnect()

static int eswifi_mgmt_disconnect ( const struct device dev)
static

◆ eswifi_mgmt_scan()

static int eswifi_mgmt_scan ( const struct device dev,
scan_result_cb_t  cb 
)
static

◆ eswifi_request_work()

static void eswifi_request_work ( struct k_work item)
static

◆ eswifi_reset()

static int eswifi_reset ( struct eswifi_dev eswifi)
static

◆ eswifi_scan()

static void eswifi_scan ( struct eswifi_dev eswifi)
static

◆ K_KERNEL_STACK_DEFINE()

K_KERNEL_STACK_DEFINE ( eswifi_work_q_stack  ,
1024   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( wifi_eswifi  )

◆ NET_DEVICE_DT_INST_OFFLOAD_DEFINE()

NET_DEVICE_DT_INST_OFFLOAD_DEFINE ( ,
eswifi_init  ,
NULL  ,
eswifi0,
NULL  ,
CONFIG_WIFI_INIT_PRIORITY  ,
eswifi_offload_api,
1500   
)

Variable Documentation

◆ eswifi0

struct eswifi_dev eswifi0
static

◆ eswifi_offload_api

const struct net_wifi_mgmt_offload eswifi_offload_api
static
Initial value:
= {
.iface_api.init = eswifi_iface_init,
.connect = eswifi_mgmt_connect,
.disconnect = eswifi_mgmt_disconnect,
.ap_enable = eswifi_mgmt_ap_enable,
.ap_disable = eswifi_mgmt_ap_disable,
}
static void eswifi_iface_init(struct net_if *iface)
Definition: eswifi_core.c:381
static int eswifi_mgmt_connect(const struct device *dev, struct wifi_connect_req_params *params)
Definition: eswifi_core.c:480
static int eswifi_mgmt_scan(const struct device *dev, scan_result_cb_t cb)
Definition: eswifi_core.c:418
static int eswifi_mgmt_ap_disable(const struct device *dev)
Definition: eswifi_core.c:615
static int eswifi_mgmt_ap_enable(const struct device *dev, struct wifi_connect_req_params *params)
Definition: eswifi_core.c:607
static int eswifi_mgmt_disconnect(const struct device *dev)
Definition: eswifi_core.c:435