11/*
2- * Copyright 2019 Cypress Semiconductor Corporation
2+ * Copyright 2020 Cypress Semiconductor Corporation
33 * SPDX-License-Identifier: Apache-2.0
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
2323#include <stdint.h>
2424#include "cy_result.h"
2525#include "cyhal_hw_types.h"
26- #include "gpio_api.h"
2726
2827#ifndef INCLUDED_WHD_TYPES_H_
2928#define INCLUDED_WHD_TYPES_H_
@@ -45,6 +44,7 @@ extern "C"
4544#define WPA_SECURITY 0x00200000 /**< Flag to enable WPA Security */
4645#define WPA2_SECURITY 0x00400000 /**< Flag to enable WPA2 Security */
4746#define WPA3_SECURITY 0x01000000 /**< Flag to enable WPA3 PSK Security */
47+ #define SECURITY_MASK (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED) /**< Flag to Security mask */
4848
4949#define ENTERPRISE_ENABLED 0x02000000 /**< Flag to enable Enterprise Security */
5050#define WPS_ENABLED 0x10000000 /**< Flag to enable WPS Security */
@@ -77,6 +77,11 @@ typedef void *whd_buffer_t;
7777typedef struct wl_bss_info_struct whd_bss_info_t ;
7878typedef struct edcf_acparam whd_edcf_ac_param_t ;
7979typedef 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 ;
8085/** @endcond */
8186/******************************************************
8287* Constants
@@ -119,7 +124,9 @@ typedef struct wl_af_params whd_af_params_t;
119124/**
120125 * The maximum size in bytes of the data part of an Ethernet frame
121126 */
127+ #ifndef WHD_PAYLOAD_MTU
122128#define WHD_PAYLOAD_MTU (1500)
129+ #endif
123130
124131/**
125132 * The maximum size in bytes of a packet used within whd.
@@ -185,6 +192,9 @@ typedef enum
185192 WHD_SECURITY_WPA2_MIXED_PSK = (WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA2 PSK Security with AES & TKIP */
186193 WHD_SECURITY_WPA2_FBT_PSK = (WPA2_SECURITY | AES_ENABLED | FBT_ENABLED ), /**< WPA2 FBT PSK Security with AES & TKIP */
187194 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+
188198 WHD_SECURITY_WPA3_WPA2_PSK = (WPA3_SECURITY | WPA2_SECURITY | AES_ENABLED ), /**< WPA3 WPA2 PSK Security with AES */
189199
190200 WHD_SECURITY_WPA_TKIP_ENT = (ENTERPRISE_ENABLED | WPA_SECURITY | TKIP_ENABLED ), /**< WPA Enterprise Security with TKIP */
@@ -196,8 +206,7 @@ typedef enum
196206 WHD_SECURITY_WPA2_FBT_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | FBT_ENABLED ), /**< WPA2 Enterprise Security with AES & FBT */
197207
198208 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 */
201210
202211 WHD_SECURITY_UNKNOWN = -1 , /**< May be returned by scan function if security is unknown. Do not pass this to the join function! */
203212
@@ -1011,6 +1020,33 @@ typedef struct whd_coex_config
10111020 whd_btc_lescan_params_t le_scan_params ; /**< LE Scan Parameters */
10121021} whd_coex_config_t ;
10131022
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+
10141050#ifdef __cplusplus
10151051} /* extern "C" */
10161052#endif
0 commit comments