/
eswifi_offload.h
48 lines (40 loc) · 1000 Bytes
/
eswifi_offload.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Copyright (c) 2018 Linaro
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_WIFI_ESWIFI_ESWIFI_OFFLOAD_H_
#define ZEPHYR_DRIVERS_WIFI_ESWIFI_ESWIFI_OFFLOAD_H_
#include <net/net_offload.h>
#include "eswifi.h"
#define ESWIFI_OFFLOAD_MAX_SOCKETS 4
enum eswifi_transport_type {
ESWIFI_TRANSPORT_TCP,
ESWIFI_TRANSPORT_UDP,
ESWIFI_TRANSPORT_UDP_LITE,
ESWIFI_TRANSPORT_TCP_SSL,
};
enum eswifi_socket_state {
ESWIFI_SOCKET_STATE_NONE,
ESWIFI_SOCKET_STATE_CONNECTING,
ESWIFI_SOCKET_STATE_CONNECTED,
};
struct eswifi_off_socket {
u8_t index;
enum eswifi_transport_type type;
enum eswifi_socket_state state;
struct net_context *context;
net_context_recv_cb_t recv_cb;
net_context_connect_cb_t conn_cb;
net_context_send_cb_t send_cb;
void *recv_data;
void *conn_data;
void *send_data;
struct net_pkt *tx_pkt;
struct k_work connect_work;
struct k_work send_work;
struct k_delayed_work read_work;
struct sockaddr peer_addr;
struct k_sem read_sem;
};
#endif