fix(esp_wifi): Separate public and native wifi interface types

This commit is contained in:
David Cermak 2023-10-06 12:56:00 +02:00
parent 07d60b1c04
commit 9088655030
12 changed files with 791 additions and 771 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,8 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _ESP_WIFI_TYPES_PRIVATE_H
#define _ESP_WIFI_TYPES_PRIVATE_H
@ -19,7 +11,6 @@
#include <stdbool.h>
#include "sys/queue.h"
#include "esp_err.h"
#include "esp_interface.h"
#include "esp_event_base.h"
#endif

View File

@ -26,7 +26,7 @@ extern "C" {
#define OSI_QUEUE_SEND_BACK 1
#define OSI_QUEUE_SEND_OVERWRITE 2
typedef struct {
typedef struct wifi_osi_funcs_t {
int32_t _version;
bool (* _env_is_chip)(void);
void (*_set_intr)(int32_t cpu_no, uint32_t intr_source, uint32_t intr_num, int32_t intr_prio);

View File

@ -1,19 +1,13 @@
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _WIFI_TYPES_H
#define _WIFI_TYPES_H
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
@ -47,6 +41,26 @@ typedef struct {
} data; /**< Configuration of ioctl command */
} wifi_ioctl_config_t;
/**
* @brief WiFi beacon monitor parameter configuration
*
*/
typedef struct {
bool enable; /**< Enable or disable beacon monitor */
uint8_t loss_timeout; /**< Beacon lost timeout */
uint8_t loss_threshold; /**< Maximum number of consecutive lost beacons allowed */
uint8_t delta_intr_early; /**< Delta early time for RF PHY on */
uint8_t delta_loss_timeout; /**< Delta timeout time for RF PHY off */
#if MAC_SUPPORT_PMU_MODEM_STATE
uint8_t beacon_abort: 1, /**< Enable or disable beacon abort */
broadcast_wakeup: 1, /**< Enable or disable TIM element multicast wakeup */
reserved: 6; /**< Reserved */
uint8_t tsf_time_sync_deviation; /**< Deviation range to sync with AP TSF timestamp */
uint16_t modem_state_consecutive; /**< PMU MODEM state consecutive count limit */
uint16_t rf_ctrl_wait_cycle; /**< RF on wait time (unit: Modem APB clock cycle) */
#endif
} wifi_beacon_monitor_config_t;
#ifdef __cplusplus
}
#endif

View File

@ -54,7 +54,7 @@
#include "esp_err.h"
#include "esp_wifi_types.h"
#include "esp_event.h"
#include "esp_private/esp_wifi_private.h"
#include "esp_wifi_crypto_types.h"
#include "esp_wifi_default.h"
#ifdef __cplusplus
@ -90,6 +90,8 @@ extern "C" {
#define ESP_ERR_WIFI_DISCARD (ESP_ERR_WIFI_BASE + 27) /*!< Discard frame */
#define ESP_ERR_WIFI_ROC_IN_PROGRESS (ESP_ERR_WIFI_BASE + 28) /*!< ROC op is in progress */
typedef struct wifi_osi_funcs_t wifi_osi_funcs_t;
/**
* @brief WiFi stack configuration parameters passed to esp_wifi_init call.
*/
@ -898,6 +900,12 @@ esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf);
*/
esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf);
/**
* @brief Forward declare wifi_sta_list_t. The definition depends on the target device
* that implements esp_wifi
*/
typedef struct wifi_sta_list_t wifi_sta_list_t;
/**
* @brief Get STAs associated with soft-AP
*

View File

@ -393,7 +393,7 @@ typedef uint32_t (*esp_crc32_le_t)(uint32_t crc, uint8_t const *buf, uint32_t le
* The structure can be set as software crypto or the crypto optimized by device's
* hardware.
*/
typedef struct {
typedef struct wpa_crypto_funcs_t {
uint32_t size; /**< The crypto callback function structure size */
uint32_t version; /**< The crypto callback function structure version */
esp_aes_wrap_t aes_wrap; /**< The AES wrap callback function used by esp_wifi */

View File

@ -40,7 +40,7 @@ enum {
/**
* @brief Channel state information(CSI) configuration type
*/
typedef struct {
typedef struct wifi_csi_config_t {
uint32_t enable : 1; /**< enable to acquire CSI */
uint32_t acquire_csi_legacy : 1; /**< enable to acquire L-LTF when receiving a 11g PPDU */
uint32_t acquire_csi_ht20 : 1; /**< enable to acquire HT-LTF when receiving an HT20 PPDU */
@ -56,7 +56,7 @@ typedef struct {
uint32_t val_scale_cfg : 2; /**< value 0-3 */
uint32_t dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */
uint32_t reserved : 19; /**< reserved */
} wifi_csi_acquire_config_t;
} wifi_csi_config_t;
/**
* @brief HE variant HT Control field including UPH(UL power headroom) and OM(Operation mode)
@ -139,7 +139,7 @@ typedef enum {
/**
* @brief RxControl Info
*/
typedef struct {
typedef struct wifi_pkt_rx_ctrl_t {
signed rssi : 8; /**< the RSSI of the reception frame */
unsigned rate : 5; /**< if cur_bb_format is RX_BB_FORMAT_11B, it's the transmission rate. otherwise it's Rate field of L-SIG */
unsigned : 1; /**< reserved */
@ -201,7 +201,7 @@ typedef struct {
unsigned : 2; /**< reserved */
unsigned rx_state : 8; /**< reception state, 0: successful, others: failure */
unsigned : 24; /**< reserved */
} __attribute__((packed)) esp_wifi_rxctrl_t;
} __attribute__((packed)) wifi_pkt_rx_ctrl_t;
/** Argument structure for WIFI_EVENT_TWT_SET_UP event */
typedef struct {

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -8,10 +8,8 @@
#ifndef __ESP_WIFI_TYPES_H__
#define __ESP_WIFI_TYPES_H__
#include "esp_private/esp_wifi_types_private.h"
#if CONFIG_SOC_WIFI_HE_SUPPORT
#include "esp_wifi_he_types.h"
#endif
#include "esp_event.h"
#include "esp_interface.h"
#ifdef __cplusplus
extern "C" {
@ -29,7 +27,7 @@ typedef enum {
typedef enum {
WIFI_IF_STA = ESP_IF_WIFI_STA,
WIFI_IF_AP = ESP_IF_WIFI_AP,
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2)
#if CONFIG_SOC_WIFI_NAN_SUPPORT || !CONFIG_SOC_WIFI_ENABLED
WIFI_IF_NAN = ESP_IF_WIFI_NAN,
#endif
WIFI_IF_MAX
@ -376,20 +374,6 @@ typedef struct {
uint32_t reserved:26; /**< bit: 6..31 reserved */
} wifi_sta_info_t;
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */
#else
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
#endif
/** @brief List of stations associated with the Soft-AP */
typedef struct {
wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */
int num; /**< number of stations in the list (other entries are invalid) */
} wifi_sta_list_t;
typedef enum {
WIFI_STORAGE_FLASH, /**< all configuration will store in both memory and flash */
WIFI_STORAGE_RAM, /**< all configuration will only store in the memory */
@ -446,68 +430,7 @@ typedef struct {
uint8_t payload[0]; /**< Payload. Length is equal to value in 'length' field, minus 4. */
} vendor_ie_data_t;
#if CONFIG_SOC_WIFI_HE_SUPPORT
typedef esp_wifi_rxctrl_t wifi_pkt_rx_ctrl_t;
#else
/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */
typedef struct {
signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */
unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */
unsigned :1; /**< reserved */
unsigned sig_mode:2; /**< Protocol of the reveived packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */
unsigned :16; /**< reserved */
unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */
unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */
unsigned :16; /**< reserved */
unsigned smoothing:1; /**< Set to 1 indicates that channel estimate smoothing is recommended.
Set to 0 indicates that only per-carrierindependent (unsmoothed) channel estimate is recommended. */
unsigned not_sounding:1; /**< Set to 0 indicates that PPDU is a sounding PPDU. Set to 1indicates that the PPDU is not a sounding PPDU.
sounding PPDU is used for channel estimation by the request receiver */
unsigned :1; /**< reserved */
unsigned aggregation:1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */
unsigned stbc:2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */
unsigned fec_coding:1; /**< Forward Error Correction(FEC). Flag is set for 11n packets which are LDPC */
unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */
#if CONFIG_IDF_TARGET_ESP32
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
unsigned :8; /**< reserved */
#endif
unsigned ampdu_cnt:8; /**< the number of subframes aggregated in AMPDU */
unsigned channel:4; /**< primary channel on which this packet is received */
unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */
unsigned :8; /**< reserved */
unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */
unsigned :32; /**< reserved */
#if CONFIG_IDF_TARGET_ESP32S2
unsigned :32; /**< reserved */
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
unsigned :24; /**< reserved */
unsigned :32; /**< reserved */
#endif
unsigned :31; /**< reserved */
unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */
#if CONFIG_IDF_TARGET_ESP32S2
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
unsigned :24; /**< reserved */
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
unsigned :32; /**< reserved */
unsigned :32; /**< reserved */
unsigned :32; /**< reserved */
#endif
unsigned sig_len:12; /**< length of packet including Frame Check Sequence(FCS) */
unsigned :12; /**< reserved */
unsigned rx_state:8; /**< state of the packet. 0: no error; others: error numbers which are not public */
} wifi_pkt_rx_ctrl_t;
#endif
/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback.
*/
typedef struct {
wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */
uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */
} wifi_promiscuous_pkt_t;
typedef struct wifi_pkt_rx_ctrl_t wifi_pkt_rx_ctrl_t;
/**
* @brief Promiscuous frame type
@ -556,36 +479,13 @@ typedef struct {
* @brief Channel state information(CSI) configuration type
*
*/
#if CONFIG_SOC_WIFI_HE_SUPPORT
typedef wifi_csi_acquire_config_t wifi_csi_config_t;
#else
typedef struct {
bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */
bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */
bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */
bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */
bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */
bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */
uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */
bool dump_ack_en; /**< enable to dump 802.11 ACK frame, default disabled */
} wifi_csi_config_t;
#endif
typedef struct wifi_csi_config_t wifi_csi_config_t;
/**
* @brief CSI data type
*
*/
typedef struct {
wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
uint8_t mac[6]; /**< source MAC address of the CSI data */
uint8_t dmac[6]; /**< destination MAC address of the CSI data */
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limition */
int8_t *buf; /**< valid buffer of CSI data */
uint16_t len; /**< valid length of CSI data */
uint8_t *hdr; /**< header of the wifi packet */
uint8_t *payload; /**< payload of the wifi packet */
uint16_t payload_len; /**< payload len of the wifi packet */
} wifi_csi_info_t;
typedef struct wifi_csi_info_t wifi_csi_info_t;
/**
* @brief WiFi GPIO configuration for antenna selection
@ -638,7 +538,6 @@ typedef struct {
*/
typedef int (* wifi_action_rx_cb_t)(uint8_t *hdr, uint8_t *payload,
size_t len, uint8_t channel);
/**
* @brief Action Frame Tx Request
*
@ -664,26 +563,6 @@ typedef struct {
uint16_t burst_period; /**< Requested time period between consecutive FTM bursts in 100's of milliseconds (0 - No pref) */
} wifi_ftm_initiator_cfg_t;
/**
* @brief WiFi beacon monitor parameter configuration
*
*/
typedef struct {
bool enable; /**< Enable or disable beacon monitor */
uint8_t loss_timeout; /**< Beacon lost timeout */
uint8_t loss_threshold; /**< Maximum number of consecutive lost beacons allowed */
uint8_t delta_intr_early; /**< Delta early time for RF PHY on */
uint8_t delta_loss_timeout; /**< Delta timeout time for RF PHY off */
#if MAC_SUPPORT_PMU_MODEM_STATE
uint8_t beacon_abort: 1, /**< Enable or disable beacon abort */
broadcast_wakeup: 1, /**< Enable or disable TIM element multicast wakeup */
reserved: 6; /**< Reserved */
uint8_t tsf_time_sync_deviation; /**< Deviation range to sync with AP TSF timestamp */
uint16_t modem_state_consecutive; /**< PMU MODEM state consecutive count limit */
uint16_t rf_ctrl_wait_cycle; /**< RF on wait time (unit: Modem APB clock cycle) */
#endif
} wifi_beacon_monitor_config_t;
#define ESP_WIFI_NAN_MAX_SVC_SUPPORTED 2
#define ESP_WIFI_NAN_DATAPATH_MAX_PEERS 2
@ -816,7 +695,7 @@ typedef enum {
WIFI_PHY_RATE_MCS5_LGI = 0x15, /**< MCS5 with long GI */
WIFI_PHY_RATE_MCS6_LGI = 0x16, /**< MCS6 with long GI */
WIFI_PHY_RATE_MCS7_LGI = 0x17, /**< MCS7 with long GI */
#if CONFIG_SOC_WIFI_HE_SUPPORT
#if CONFIG_SOC_WIFI_HE_SUPPORT || !CONFIG_SOC_WIFI_SUPPORT
WIFI_PHY_RATE_MCS8_LGI, /**< MCS8 with long GI */
WIFI_PHY_RATE_MCS9_LGI, /**< MCS9 with long GI */
#endif
@ -843,7 +722,7 @@ typedef enum {
WIFI_PHY_RATE_MCS5_SGI, /**< MCS5 with short GI */
WIFI_PHY_RATE_MCS6_SGI, /**< MCS6 with short GI */
WIFI_PHY_RATE_MCS7_SGI, /**< MCS7 with short GI */
#if CONFIG_SOC_WIFI_HE_SUPPORT
#if CONFIG_SOC_WIFI_HE_SUPPORT || !CONFIG_SOC_WIFI_SUPPORT
WIFI_PHY_RATE_MCS8_SGI, /**< MCS8 with short GI */
WIFI_PHY_RATE_MCS9_SGI, /**< MCS9 with short GI */
#endif

View File

@ -0,0 +1,121 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "sdkconfig.h"
#if CONFIG_SOC_WIFI_HE_SUPPORT
#include "esp_wifi_he_types.h"
#endif
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */
#else
#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */
#endif
/** @brief List of stations associated with the Soft-AP */
typedef struct wifi_sta_list_t {
wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */
int num; /**< number of stations in the list (other entries are invalid) */
} wifi_sta_list_t;
#if !CONFIG_SOC_WIFI_HE_SUPPORT
/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */
typedef struct wifi_pkt_rx_ctrl_t{
signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */
unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */
unsigned :1; /**< reserved */
unsigned sig_mode:2; /**< Protocol of the reveived packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */
unsigned :16; /**< reserved */
unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */
unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */
unsigned :16; /**< reserved */
unsigned smoothing:1; /**< Set to 1 indicates that channel estimate smoothing is recommended.
Set to 0 indicates that only per-carrierindependent (unsmoothed) channel estimate is recommended. */
unsigned not_sounding:1; /**< Set to 0 indicates that PPDU is a sounding PPDU. Set to 1indicates that the PPDU is not a sounding PPDU.
sounding PPDU is used for channel estimation by the request receiver */
unsigned :1; /**< reserved */
unsigned aggregation:1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */
unsigned stbc:2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */
unsigned fec_coding:1; /**< Forward Error Correction(FEC). Flag is set for 11n packets which are LDPC */
unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */
#if CONFIG_IDF_TARGET_ESP32
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
unsigned :8; /**< reserved */
#endif
unsigned ampdu_cnt:8; /**< the number of subframes aggregated in AMPDU */
unsigned channel:4; /**< primary channel on which this packet is received */
unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */
unsigned :8; /**< reserved */
unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */
unsigned :32; /**< reserved */
#if CONFIG_IDF_TARGET_ESP32S2
unsigned :32; /**< reserved */
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
unsigned :24; /**< reserved */
unsigned :32; /**< reserved */
#endif
unsigned :31; /**< reserved */
unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */
#if CONFIG_IDF_TARGET_ESP32S2
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/
unsigned :24; /**< reserved */
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2
unsigned :32; /**< reserved */
unsigned :32; /**< reserved */
unsigned :32; /**< reserved */
#endif
unsigned sig_len:12; /**< length of packet including Frame Check Sequence(FCS) */
unsigned :12; /**< reserved */
unsigned rx_state:8; /**< state of the packet. 0: no error; others: error numbers which are not public */
} wifi_pkt_rx_ctrl_t;
#endif
/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback.
*/
typedef struct {
wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */
uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */
} wifi_promiscuous_pkt_t;
/**
* @brief Channel state information(CSI) configuration type
*
*/
#if !CONFIG_SOC_WIFI_HE_SUPPORT
typedef struct wifi_csi_config_t{
bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */
bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */
bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */
bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */
bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */
bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */
uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */
bool dump_ack_en; /**< enable to dump 802.11 ACK frame, default disabled */
} wifi_csi_config_t;
#endif
/**
* @brief CSI data type
*
*/
typedef struct wifi_csi_info_t {
wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
uint8_t mac[6]; /**< source MAC address of the CSI data */
uint8_t dmac[6]; /**< destination MAC address of the CSI data */
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limition */
int8_t *buf; /**< valid buffer of CSI data */
uint16_t len; /**< valid length of CSI data */
uint8_t *hdr; /**< header of the wifi packet */
uint8_t *payload; /**< payload of the wifi packet */
uint16_t payload_len; /**< payload len of the wifi packet */
} wifi_csi_info_t;

View File

@ -21,6 +21,7 @@
#include <stdlib.h>
#include "esp_err.h"
#include "supplicant_opt.h"
#include "esp_private/esp_wifi_private.h"
#include "esp_wifi.h"
typedef time_t os_time_t;

View File

@ -20,6 +20,7 @@
#define INCLUDES_H
#include "supplicant_opt.h"
#include "esp_private/esp_wifi_private.h"
#define AES_SMALL_TABLES
#define CONFIG_NO_RANDOM_POOL

View File

@ -483,8 +483,6 @@ components/esp_rom/linux/esp_rom_crc.c
components/esp_rom/linux/esp_rom_md5.c
components/esp_rom/patches/esp_rom_crc.c
components/esp_system/ubsan.c
components/esp_wifi/include/esp_private/esp_wifi_types_private.h
components/esp_wifi/include/esp_private/wifi_types.h
components/esp_wifi/src/mesh_event.c
components/fatfs/diskio/diskio.c
components/fatfs/diskio/diskio_impl.h