1
1
/*
2
- * Copyright 2019 Cypress Semiconductor Corporation
2
+ * Copyright 2020 Cypress Semiconductor Corporation
3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
23
23
#include <stdint.h>
24
24
#include "cy_result.h"
25
25
#include "cyhal_hw_types.h"
26
- #include "gpio_api.h"
27
26
28
27
#ifndef INCLUDED_WHD_TYPES_H_
29
28
#define INCLUDED_WHD_TYPES_H_
@@ -45,6 +44,7 @@ extern "C"
45
44
#define WPA_SECURITY 0x00200000 /**< Flag to enable WPA Security */
46
45
#define WPA2_SECURITY 0x00400000 /**< Flag to enable WPA2 Security */
47
46
#define WPA3_SECURITY 0x01000000 /**< Flag to enable WPA3 PSK Security */
47
+ #define SECURITY_MASK (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED) /**< Flag to Security mask */
48
48
49
49
#define ENTERPRISE_ENABLED 0x02000000 /**< Flag to enable Enterprise Security */
50
50
#define WPS_ENABLED 0x10000000 /**< Flag to enable WPS Security */
@@ -77,6 +77,11 @@ typedef void *whd_buffer_t;
77
77
typedef struct wl_bss_info_struct whd_bss_info_t ;
78
78
typedef struct edcf_acparam whd_edcf_ac_param_t ;
79
79
typedef struct wl_af_params whd_af_params_t ;
80
+ typedef struct whd_arp_stats_s whd_arp_stats_t ;
81
+ typedef struct wl_pkt_filter_stats whd_pkt_filter_stats_t ;
82
+ typedef struct whd_tko_retry whd_tko_retry_t ;
83
+ typedef struct whd_tko_connect whd_tko_connect_t ;
84
+ typedef struct whd_tko_status whd_tko_status_t ;
80
85
/** @endcond */
81
86
/******************************************************
82
87
* Constants
@@ -119,7 +124,9 @@ typedef struct wl_af_params whd_af_params_t;
119
124
/**
120
125
* The maximum size in bytes of the data part of an Ethernet frame
121
126
*/
127
+ #ifndef WHD_PAYLOAD_MTU
122
128
#define WHD_PAYLOAD_MTU (1500)
129
+ #endif
123
130
124
131
/**
125
132
* The maximum size in bytes of a packet used within whd.
@@ -185,6 +192,9 @@ typedef enum
185
192
WHD_SECURITY_WPA2_MIXED_PSK = (WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA2 PSK Security with AES & TKIP */
186
193
WHD_SECURITY_WPA2_FBT_PSK = (WPA2_SECURITY | AES_ENABLED | FBT_ENABLED ), /**< WPA2 FBT PSK Security with AES & TKIP */
187
194
WHD_SECURITY_WPA3_SAE = (WPA3_SECURITY | AES_ENABLED ), /**< WPA3 Security with AES */
195
+ WHD_SECURITY_WPA2_WPA_AES_PSK = (WPA2_SECURITY | WPA_SECURITY | AES_ENABLED ), /**< WPA2 WPA PSK Security with AES */
196
+ WHD_SECURITY_WPA2_WPA_MIXED_PSK = (WPA2_SECURITY | WPA_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA2 WPA PSK Security with AES & TKIP */
197
+
188
198
WHD_SECURITY_WPA3_WPA2_PSK = (WPA3_SECURITY | WPA2_SECURITY | AES_ENABLED ), /**< WPA3 WPA2 PSK Security with AES */
189
199
190
200
WHD_SECURITY_WPA_TKIP_ENT = (ENTERPRISE_ENABLED | WPA_SECURITY | TKIP_ENABLED ), /**< WPA Enterprise Security with TKIP */
@@ -196,8 +206,7 @@ typedef enum
196
206
WHD_SECURITY_WPA2_FBT_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | FBT_ENABLED ), /**< WPA2 Enterprise Security with AES & FBT */
197
207
198
208
WHD_SECURITY_IBSS_OPEN = (IBSS_ENABLED ), /**< Open security on IBSS ad-hoc network */
199
- WHD_SECURITY_WPS_OPEN = (WPS_ENABLED ), /**< WPS with open security */
200
- WHD_SECURITY_WPS_SECURE = (WPS_ENABLED | AES_ENABLED ), /**< WPS with AES security */
209
+ WHD_SECURITY_WPS_SECURE = AES_ENABLED , /**< WPS with AES security */
201
210
202
211
WHD_SECURITY_UNKNOWN = -1 , /**< May be returned by scan function if security is unknown. Do not pass this to the join function! */
203
212
@@ -1011,6 +1020,33 @@ typedef struct whd_coex_config
1011
1020
whd_btc_lescan_params_t le_scan_params ; /**< LE Scan Parameters */
1012
1021
} whd_coex_config_t ;
1013
1022
1023
+ #define PORT_FILTER_LEN 26 /**< Port filter len */
1024
+ #define PACKET_FILTER_LIST_BUFFER_MAX_LEN 1000 /**< Packet filter buffer max len */
1025
+ /**
1026
+ * Enumeration of packet filter rules
1027
+ */
1028
+ typedef enum
1029
+ {
1030
+ WHD_PACKET_FILTER_RULE_POSITIVE_MATCHING = 0 , /**< Specifies that a filter should match a given pattern */
1031
+ WHD_PACKET_FILTER_RULE_NEGATIVE_MATCHING = 1 /**< Specifies that a filter should NOT match a given pattern */
1032
+ } whd_packet_filter_rule_t ;
1033
+
1034
+ /**
1035
+ * Structure describing a packet filter list item
1036
+ */
1037
+ typedef struct
1038
+ {
1039
+ uint32_t id ; /**< Unique identifier for a packet filter item */
1040
+ whd_packet_filter_rule_t rule ; /**< Filter matches are either POSITIVE or NEGATIVE matching */
1041
+ uint16_t offset ; /**< Offset in bytes to start filtering (referenced to the start of the ethernet packet) */
1042
+ uint16_t mask_size ; /**< Size of the mask in bytes */
1043
+ uint8_t * mask ; /**< Pattern mask bytes to be ANDed with the pattern eg. "\xff00" (must be in network byte order) */
1044
+ uint8_t * pattern ; /**< Pattern bytes used to filter eg. "\x0800" (must be in network byte order) */
1045
+ whd_bool_t enabled_status ; /**< When returned from wwd_wifi_get_packet_filters, indicates if the filter is enabled */
1046
+ } whd_packet_filter_t ;
1047
+
1048
+ #define TKO_DATA_OFFSET offsetof(wl_tko_t, data) /**< TKO data offset */
1049
+
1014
1050
#ifdef __cplusplus
1015
1051
} /* extern "C" */
1016
1052
#endif
0 commit comments