text stringlengths 1 9.98k | __index_level_0__ int64 0 4.17k |
|---|---|
/*
*/
#pragma once
#include
#include "esp_err.h"
#include "soc/soc_caps.h"
#include "nvs_flash.h"
#include "esp_partition.h"
#if SOC_HMAC_SUPPORTED
#include "esp_hmac.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_ERR_NVS_SEC_BASE 0xF000 /*!< Starting... | 2,799 |
< Protect NVS encryption keys using Flash Encryption */
NVS_SEC_SCHEME_HMAC, /*!< Protect NVS encryption keys using HMAC peripheral */
NVS_SEC_SCHEME_MAX
} nvs_sec_scheme_id_t;
/**
*/
typedef struct {
const esp_partition_t *nvs_keys_part; /*!< Partition of subtype `nvs_keys` holding the NVS en... | 2,799 |
hmac_key_id = (hmac_key_id_t)(CONFIG_NVS_SEC_HMAC_EFUSE_KEY_ID), \
}
#endif /* SOC_HMAC_SUPPORTED */
/**
*/
esp_err_t nvs_sec_provider_register_flash_enc(const nvs_sec_config_flash_enc_t *sec_scheme_cfg, nvs_sec_scheme_t **sec_scheme_handle_out);
#if SOC_HMAC_SUPPORTED
/**
*/
esp_err_t nvs_sec_provider_reg... | 2,799 |
/*
*/
#pragma once
#include
#include "esp_log.h"
#include "esp_heap_caps.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "sd_protocol_defs.h"
#include "sd_protocol_types.h"
#include "sdmmc_cmd.h"
#include "sys/param.h"
#include "soc/soc_memory_layout.h"
#include "esp_dma_utils.h"
#define SDMMC... | 2,800 |
This flag is mandory
// when the buffer is behind the cache in byte mode.
esp_err_t sdmmc_io_rw_extended(sdmmc_card_t* card, int function, uint32_t reg, int arg, void *data, size_t size);
/* MMC specific */
esp_err_t sdmmc_mmc_send_ext_csd_data(sdmmc_card_t* card, void *out_data, size_t datalen, size_t buffer_len);
e... | 2,800 |
flags & SDMMC_HOST_FLAG_SPI) != 0;
}
static inline uint32_t get_host_ocr(float voltage)
{
// TODO: report exact voltage to the card
// For now tell that the host has 2.8-3.6V voltage range
(void) voltage;
return SD_OCR_VOL_MASK;
}
void sdmmc_flip_byte_order(uint32_t* response, size_t size);
esp_err_t... | 2,800 |
/*
*/
#pragma once
#include
#include "esp_err.h"
#include "sd_protocol_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
esp_err_t sdmmc_card_init(const sdmmc_host_t* host,
sdmmc_card_t* out_card);
/**
*/
void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card);
/**
*/
esp_err_t sdmmc_... | 2,801 |
/*
*/
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#include "freertos/FreeRTOS.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef struct {
int csd_ver; /*!< CSD structure format */
int mmc_ver; /*!< MMC version (for CID format) */
int capacity; ... | 2,802 |
< SD Physical layer specification version, reported by card */
uint32_t erase_mem_state: 1; /*!< data state on card after erase whether 0 or 1 (card vendor dependent) */
uint32_t bus_width: 4; /*!< bus widths supported by card: BIT(0) — 1-bit bus, BIT(2) — 4-bit bus */
uint32_t reserved: 23; ... | 2,802 |
< Constant timeout offset (in seconds) for any erase operation */
uint32_t reserved: 20; /*!< reserved for future expansion */
} sdmmc_ssr_t;
/**
*/
typedef struct {
uint8_t rev; /*!< Extended CSD Revision */
uint8_t power_class; /*!< Power class used by the card */
uint... | 2,802 |
< length of data in the buffer */
size_t buflen; /*!< length of the buffer */
size_t blklen; /*!< block length */
int flags; /*!< see below */
/** @cond */
#define SCF_ITSDONE 0x0001 /*!< command is complete */
#define SCF_CMD(flags) ((flags) & 0x00f... | 2,802 |
< Wait for completion of card busy signal before returning */
/** @endcond */
esp_err_t error; /*!< error returned from transfer */
uint32_t timeout_ms; /*!< response timeout, in milliseconds */
} sdmmc_command_t;
/**
*/
typedef enum {
SDMMC_DELAY_PHASE_0, /*!< Delay phase... | 2,802 |
< host supports DDR mode for SD/MMC */
#define SDMMC_HOST_FLAG_DEINIT_ARG BIT(5) /*!< host `deinit` function called with the slot argument */
#define SDMMC_HOST_FLAG_ALLOC_ALIGNED_BUF \
BIT(6) /*!< Allocate internal buffer of 512 bytes that meets DMA's requirements.
... | 2,802 |
< SD/MMC probing speed */
#define SDMMC_FREQ_52M 52000 /*!< MMC 52MHz speed */
#define SDMMC_FREQ_26M 26000 /*!< MMC 26MHz speed */
float io_voltage; /*!< I/O voltage used by the controller (voltage switching is not supported) */
esp_err_t (*init)(void); /*!< Host func... | 2,802 |
< host function to deinitialize the driver */
esp_err_t (*deinit_p)(int slot); /*!< host function to deinitialize the driver, called with the `slot` */
};
esp_err_t (*io_int_enable)(int slot); /*!< Host function to enable SDIO interrupt line */
esp_err_t (*io_int_wait)(int slot, TickType_t timeout_... | 2,802 |
< Leave it NULL. Reserved for cache aligned buffers for SDIO mode */
} sdmmc_host_t;
/**
*/
typedef struct {
sdmmc_host_t host; /*!< Host with which the card is associated */
uint32_t ocr; /*!< OCR (Operation Conditions Register) value */
union {
sdmmc_cid_t cid; ... | 2,802 |
< Maximum frequency, in kHz, supported by the card */
int real_freq_khz; /*!< Real working frequency, in kHz, configured on the host controller */
uint32_t is_mem : 1; /*!< Bit indicates if the card is a memory card */
uint32_t is_sdio : 1; /*!< Bit indicates if the card is an IO card ... | 2,802 |
/*
*/
/*
*/
#pragma once
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
/* MMC commands */ /* response type */
#define MMC_GO_IDLE_STATE 0 /* R0 */
#define MMC_SEND_OP_COND 1 /* R3 */
#define MMC_ALL_SEND_CID 2 ... | 2,803 |
6 (for MMC v4.5, v4.51) */
#define EXT_CSD_CMD_SET_NORMAL (1U result=0x00000007
*/
static inline uint32_t MMC_RSP_BITS(uint32_t *src, int start, int len)
{
uint32_t mask = (len % 32 == 0) ? UINT_MAX : UINT_MAX >> (32 - (len % 32));
size_t word = start / 32;
size_t shift = start % 32;
uint32_... | 2,803 |
/*
*/
#pragma once
#define ETH_ADDR_LEN (6) /* MAC Address length */
#define ETH_HEADER_LEN (14) /* Ethernet frame header size: Dest addr(6 Bytes) + Src addr(6 Bytes) + length/type(2 Bytes) */
#define ETH_VLAN_TAG_LEN (4) /* Optional 802.1q VLAN Tag length */
#define ETH_CRC_LEN (4) /* Ethe... | 2,804 |
1ad Service VLAN (double vlan tag) */
| 2,804 |
/*
*/
#pragma once
#include "esp_eth_driver.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
typedef struct esp_eth_netif_glue_t* esp_eth_netif_glue_handle_t;
/**
*/
esp_eth_netif_glue_handle_t esp_eth_new_netif_glue(esp_eth_handle_t eth_hdl);
/**
*/
esp_err_t esp_eth_del_netif_glue(esp_eth_netif_glue_handle_t eth... | 2,805 |
/*
*/
#pragma once
#include
#include "esp_eth.h"
#include "sdkconfig.h"
#include "eth_phy_802_3_regs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
typedef struct {
esp_eth_phy_t parent; /*!< Parent Ethernet PHY instance */
esp_eth_mediator_t *eth; /*!< Mediator of Ethernet driver */
in... | 2,806 |
/*
*/
#pragma once
#include "esp_eth_com.h"
#include "esp_eth_mac.h"
#include "esp_eth_phy.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
typedef void *esp_eth_handle_t;
/**
typedef struct {
/**
esp_eth_mac_t *mac;
/**
esp_eth_phy_t *phy;
/**
uint32_t check_link_period_ms;
/**
esp... | 2,807 |
*/
esp_err_t esp_eth_ioctl(esp_eth_handle_t hdl, esp_eth_io_cmd_t cmd, void *data);
/**
*/
esp_err_t esp_eth_increase_reference(esp_eth_handle_t hdl);
/**
*/
esp_err_t esp_eth_decrease_reference(esp_eth_handle_t hdl);
#ifdef __cplusplus
}
#endif
| 2,807 |
/*
*/
#pragma once
#include
#include "soc/soc_caps.h"
#include "esp_eth_com.h"
#include "sdkconfig.h"
#if CONFIG_ETH_USE_SPI_ETHERNET
#include "driver/spi_master.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
typedef struct esp_eth_mac_s esp_eth_mac_t;
/**
struct esp_eth_mac_s {
/**
esp_err_t (*set_... | 2,808 |
..
// Reserved for GPIO number, clock source, etc. in MII mode
} mii; /*!< EMAC MII Clock Configuration */
struct {
emac_rmii_clock_mode_t clock_mode; /*!< RMII Clock Mode Configuration */
emac_rmii_clock_gpio_t clock_gpio; /*!< RMII Clock GPIO Configuration */
} rmii; /*!< EMAC RMII... | 2,808 |
< Software reset timeout value (Unit: ms) */
uint32_t rx_task_stack_size; /*!< Stack size of the receive task */
uint32_t rx_task_prio; /*!< Priority of the receive task */
uint32_t flags; /*!< Flags that specify extra capability for mac driver */
} eth_mac_config_... | 2,808 |
< SMI MDC GPIO number, set to -1 could bypass the SMI GPIO configuration */
int smi_mdio_gpio_num; /*!< SMI MDIO GPIO number, set to -1 could bypass the SMI GPIO configuration */
eth_data_interface_t interface; /*!< EMAC Data interface to PHY (MII/RMII) */
eth_mac_cl... | 2,808 |
smi_mdc_gpio_num = 23, \
.smi_mdio_gpio_num = 18, \
.interface = EMAC_DATA_INTERFACE_RMII, \
.clock_config = \
{ \
.rmii = ... | 2,808 |
rmii = \
{ \
.clock_mode = EMAC_CLK_EXT_IN, \
.clock_gpio = 50 \
} \
}, ... | 2,808 |
tx_en_num = 49, \
.txd0_num = 34, \
.txd1_num = 35, \
.crs_dv_num = 28, \
.rxd0_num = 29, \
.rxd1_num = 30 \
... | 2,808 |
config = NULL, \
.init = NULL, \
.deinit = NULL, \
.read = NULL, \
.write = NULL \
}
#endif // CONFIG_ETH_USE_SPI_ETHERNET
#if CONFIG_ETH_SPI_ETHERNET_DM9051
/**
typedef struct {
int int_gpio_num; /*!< Interrupt GPIO number, set -1 to... | 2,808 |
int_gpio_num = 4, \
.poll_period_ms = 0, \
.spi_host_id = spi_host, \
.spi_devcfg = spi_devcfg_p, \
.custom_spi_driver = ETH_DEFAULT_SPI, \
}
/**
*/
esp_eth_mac_t *esp_eth_mac_new_dm9051(const eth_dm9051_config_t *... | 2,808 |
< Custom SPI driver definitions */
} eth_w5500_config_t;
/**
#define ETH_W5500_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
{ \
.int_gpio_num = 4, \
.poll_period_ms = 0, \
.spi_host_id = spi_host, \... | 2,808 |
< SPI device configuration (this field is invalid when custom SPI driver is defined) */
eth_spi_custom_driver_config_t custom_spi_driver; /*!< Custom SPI driver definitions */
} eth_ksz8851snl_config_t;
/**
#define ETH_KSZ8851SNL_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
{ ... | 2,808 |
/*
*/
#pragma once
#include
#include "esp_eth_com.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_ETH_PHY_ADDR_AUTO (-1)
/**
typedef enum {
ESP_ETH_PHY_AUTONEGO_RESTART,
ESP_ETH_PHY_AUTONEGO_EN,
ESP_ETH_PHY_AUTONEGO_DIS,
ESP_ETH_PHY_AUTONEGO_G_STAT,
} eth_phy_autoneg_c... | 2,809 |
< PHY address, set -1 to enable PHY address detection at initialization stage */
uint32_t reset_timeout_ms; /*!< Reset timeout value (Unit: ms) */
uint32_t autonego_timeout_ms; /*!< Auto-negotiation timeout value (Unit: ms) */
int reset_gpio_num; /*!< Reset GPIO number, -1 means no hardware res... | 2,809 |
/*
*/
#pragma once
#include
#ifdef __cplusplus
extern "C" {
#endif
/**
/**
typedef union {
struct {
uint32_t reserved : 7; /*!< Reserved */
uint32_t collision_test : 1; /*!< Collision test */
uint32_t duplex_mode : 1; /*!< Duplex mode:Full Duplex(1) and Half Duplex(0)... | 2,810 |
< Extended register capability */
uint32_t jabber_detect : 1; /*!< Jabber condition detected */
uint32_t link_status : 1; /*!< Link status */
uint32_t auto_nego_ability : 1; /*!< Auto negotiation ability */
uint32_t remote_fault : 1; /*!< Remote fault detected ... | 2,810 |
< 100Base-Tx Half Duplex capability */
uint32_t base100_tx_fdx : 1; /*!< 100Base-Tx Full Duplex capability */
uint32_t based100_t4 : 1; /*!< 100Base-T4 capability */
};
uint32_t val;
} bmsr_reg_t;
#define ETH_PHY_BMSR_REG_ADDR (0x01)
/**
typedef union {
struct {
uint3... | 2,810 |
< 10Base-T support */
uint32_t base10_t_fd : 1; /*!< 10Base-T full duplex support */
uint32_t base100_tx : 1; /*!< 100Base-TX support */
uint32_t base100_tx_fd : 1; /*!< 100Base-TX full duplex support */
uint32_t base100_t4 : 1; /*!< 100Base-T4 support */
uint... | 2,810 |
< 10Base-T support */
uint32_t base10_t_fd : 1; /*!< 10Base-T full duplex support */
uint32_t base100_tx : 1; /*!< 100Base-TX support */
uint32_t base100_tx_fd : 1; /*!< 100Base-TX full duplex support */
uint32_t base100_t4 : 1; /*!< 100Base-T4 support */
uint... | 2,810 |
< Link code word page has received */
uint32_t next_page_able : 1; /*!< Next page ablility */
uint32_t link_partner_next_page_able : 1; /*!< Link partner next page ability */
uint32_t parallel_detection_fault : 1; /*!< Parallel detection fault */
uint32_t reserved : 11; ... | 2,810 |
/*
*/
#pragma once
/**
*/
#include "esp_eth_driver.h"
#include "esp_eth_netif_glue.h"
| 2,811 |
/*
*/
#pragma once
#include "esp_err.h"
#include "esp_event_base.h"
#include "hal/eth_types.h"
#include "esp_eth_spec.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
typedef enum {
ETH_STATE_LLINIT, /*!< Lowlevel init done */
ETH_STATE_DEINIT, /*!< Deinit done */
ETH_STATE_LINK, /*!< Link status changed... | 2,812 |
< Ethernet driver start */
ETHERNET_EVENT_STOP, /*!< Ethernet driver stop */
ETHERNET_EVENT_CONNECTED, /*!< Ethernet got a valid link */
ETHERNET_EVENT_DISCONNECTED, /*!< Ethernet lost a valid link */
} eth_event_t;
/**
ESP_EVENT_DECLARE_BASE(ETH_EVENT);
#ifdef __cplusplus
}
#endif
| 2,812 |
/*
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
/**
#define EMAC_HAL_BUF_SIZE_AUTO 0
typedef struct emac_esp_dma_t *emac_esp_dma_handle_t;
typedef void *emac_esp_dma_config_t;
void emac_esp_dma_reset_desc_chain(emac_esp_dma_handle_t emac_esp_dma);
uint32_t emac_esp_dma_transmit_fra... | 2,813 |
/*
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
#include "esp_eth_mac.h"
/**
*/
typedef struct {
int mdc_num;
int mdio_num;
} emac_esp_smi_gpio_config_t;
/**
*/
typedef struct {
uint8_t tx_clk_num;
uint8_t tx_en_num;
uint8_t txd0_num;
uint8_t txd1_num;
u... | 2,814 |
/*
*/
#pragma once
#include "unity.h"
#include "test_utils.h"
#include "esp_event.h"
#include "esp_netif.h"
#include "esp_eth.h"
#define ETH_START_BIT BIT(0)
#define ETH_STOP_BIT BIT(1)
#define ETH_CONNECT_BIT BIT(2)
#define ETH_GOT_IP_BIT BIT(3)
#define ETH_START_TIMEOUT_MS (10000)
#define ETH_CONNECT_TIMEOUT_MS (... | 2,815 |
/*
*/
#pragma once
#include "sdkconfig.h"
#include "soc/interrupts.h"
#if CONFIG_IDF_TARGET_ESP32C3
/**
*/
#define ETS_ETH_MAC_INTR_SOURCE ETS_WIFI_MAC_INTR_SOURCE
/**
*/
#define DR_REG_EMAC_BASE 0x600CD000
#endif // CONFIG_IDF_TARGET_ESP32C3
| 2,816 |
// Copyright (c) 2021 Vladimir Chistyakov
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, pu... | 2,817 |
4m
P1CR_LED_OFF = 0x8000U, ///< RW Turn off all of the port 1 LEDs
P1CR_TXIDS = 0x4000U, ///< RW Disable the port’s transmitter.
P1CR_RESTART_AN = 0x2000U, ///< RW Restart AN
P1CR_DISABLE_AUTO_MDI_MDIX ... | 2,817 |
/*
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/**
#define DM9051_NCR (0x00) // Network Control Register
#define DM9051_NSR (0x01) // Network Status Register
#define DM9051_TCR (0x02) // Tx Control Register
#define DM9051_TSR1 (0x03) // Tx Status Register I
#define DM9051_TSR2 (0x04) //... | 2,818 |
3az Enter Counter Register
#define DM9051_EEE_OUT (0x3F) // IEEE 802.3az Leave Counter Register
#define DM9051_ALNCR (0x4A) // SPI Byte Align Error Counter Register
#define DM9051_RLENCR (0x52) // Rx Packet Length Control Register
#define DM9051_BCASTCR (0x53) // RX Broadcast Control Register
#define DM9051_INTCKCR ... | 2,818 |
Auto-Clear after Sending Completely
#define RCR_WTDIS (1 << 6) // Watchdog Timer Disable
#define RCR_DIS_LONG (1 << 5) // Discard Long Packet
#define RCR_DIS_CRC (1 << 4) // Discard CRC Error Packet
#define RCR_ALL_MCAST (1 << 3) // Receive All Multicast
#define RCR_RUNT (1 << 2) // Receive Runt Packet
#d... | 2,818 |
/*
*/
#define W5500_ADDR_OFFSET (16) // Address length
#define W5500_BSB_OFFSET (3) // Block Select Bits offset
#define W5500_RWB_OFFSET (2) // Read Write Bits offset
#define W5500_CHIP_VERSION (0x4) // Chip version that VERSIONR returns
#define W5500_BSB_COM_REG (0x00) // Common Register
#define W550... | 2,819 |
/*
*/
#pragma once
#include
#include
#include
#include "sdkconfig.h"
#include "soc/soc.h"
#include "esp_openeth.h"
#include "esp_assert.h"
#ifdef __cplusplus
extern "C" {
#endif
// These are the register definitions for the OpenCores Ethernet MAC.
// See comments in esp_eth_mac_openeth.c for more details about t... | 2,820 |
// The field names are same as in the OpenCores ethmac documentation.
typedef struct {
uint16_t cs: 1; //!< Carrier sense lost (flag set by HW)
uint16_t df: 1; //!< Defer indication (flag set by HW)
uint16_t lc: 1; //!< Late collision occured (flag set by HW)
uint16_t rl: 1; //!< TX fai... | 2,820 |
< Number of bytes to be transmitted
void* txpnt; //!< Pointer to the data to transmit
} openeth_tx_desc_t;
ESP_STATIC_ASSERT(sizeof(openeth_tx_desc_t) == 8, "incorrect size of openeth_tx_desc_t");
typedef struct {
uint16_t lc: 1; //!< Late collision flag
uint16_t crc: 1; //!< RX CRC error fl... | 2,820 |
0: descriptor owned by SW, 1: descriptor owned by HW.
uint16_t len; //!< Number of bytes received (filled by HW)
void* rxpnt; //!< Pointer to the receive buffer
} openeth_rx_desc_t;
ESP_STATIC_ASSERT(sizeof(openeth_rx_desc_t) == 8, "incorrect size of openeth_rx_desc_t");
static inline openeth_... | 2,820 |
rd = 0,
.txpnt = buf
};
}
static inline void openeth_init_rx_desc(openeth_rx_desc_t* desc, void* buf)
{
*desc = (openeth_rx_desc_t) {
.e = 1,
.irq = 1,
.rxpnt = buf
};
}
static inline void openeth_set_tx_desc_cnt(int tx_desc_cnt)
{
assert(tx_desc_cnt <= OPENETH_DESC_CNT... | 2,820 |
/*
*/
#ifndef WPABUF_H
#define WPABUF_H
/* wpabuf::buf is a pointer to external data */
#define WPABUF_FLAG_EXT_DATA BIT(0)
/*
*/
struct wpabuf {
size_t size; /* total size of the allocated buffer */
size_t used; /* length of data in the buffer */
u8 *buf; /* pointer to the head of the buffer */
unsigned int f... | 2,821 |
/*
*/
#ifndef WPA_DEBUG_H
#define WPA_DEBUG_H
#include "wpabuf.h"
#include "esp_log.h"
#include "supplicant_opt.h"
#ifdef ESPRESSIF_USE
#define TAG "wpa"
#define MSG_ERROR ESP_LOG_ERROR
#define MSG_WARNING ESP_LOG_WARN
#define MSG_INFO ESP_LOG_INFO
#define MSG_DEBUG ESP_LOG_DEBUG
#define MSG_MSGDUMP ESP_LOG_VERBO... | 2,822 |
..) do {} while(0)
#define wpa_hexdump(...) do {} while(0)
#define wpa_dump_mem(...) do {} while(0)
#define wpa_hexdump_buf(...) do {} while(0)
#define wpa_hexdump_key(...) do {} while(0)
#define wpa_hexdump_buf_key(...) do {} while(0)
#define wpa_hexdump_ascii(...) do {} while(0)
#define wpa_hexdump_ascii_key(...) do ... | 2,822 |
/*
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
void set_leak_threshold(int threshold);
#ifdef __cplusplus
}
#endif
| 2,823 |
/*-
*/
#ifndef _ENDIAN_H_
#define _ENDIAN_H_
#include
#include
#include "byteswap.h"
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BYTE_ORDER
#ifdef __IEEE_LITTLE_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
#else
#define BYTE_ORDER BIG_ENDIAN
#endif... | 2,824 |
= _LITTLE_ENDIAN */
#define htobe16(x) ((uint16_t)(x))
#define htobe32(x) ((uint32_t)(x))
#define htobe64(x) ((uint64_t)(x))
#define htole16(x) bswap16((x))
#define htole32(x) bswap32((x))
#define htole64(x) bswap64((x))
#define be16toh(x) ((uint16_t)(x))
#define be32toh(x) ((uint32_t)(x))
#define be64toh(x) ((uint64_... | 2,824 |
/*
*/
#ifndef OS_H
#define OS_H
#include
#include "esp_types.h"
#include
#include
#include
#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;
/**
*/
void os_sleep(os_time_t sec, os_time_t usec);
struct os_time {
os_time_t... | 2,825 |
/*
*/
#ifndef BYTESWAP_H
#define BYTESWAP_H
#include
/* Swap bytes in 16 bit value. */
#ifndef __bswap_16
#ifdef __GNUC__
# define __bswap_16(x) \
(__extension__ \
({ unsigned short int __bsx = (x); \
((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) > 8) & 0xff) | (((__bsx) & 0x... | 2,826 |
__ll = __bswap_constant_64 (x); \
else \
{ \
__w.__ll = (x); \
__r.__l[0] = __bswap_32 (__w.__l[1]); \
__r.__l[1] = __bswap_32 (__w.__l[0]); \
} \
__r.__ll; }))
#endif
#endif // __bswap_64
#endif /* BYTESWAP_H */
| 2,826 |
/*
*/
#ifndef _SUPPLICANT_OPT_H
#define _SUPPLICANT_OPT_H
#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_DEBUG_PRINT
#define DEBUG_PRINT
#if defined(CONFIG_LOG_DEFAULT_LEVEL_DEBUG) || defined(CONFIG_LOG_DEFAULT_LEVEL_VERBOSE)
#define ELOOP_DEBUG
#endif
#endif
#if CONFIG_ESP_WIFI_SCAN_CACHE
#define SCAN_CACHE_SUPPORTED... | 2,827 |
/*
*/
#ifndef _ESP_MBO_H
#define _ESP_MBO_H
#include
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
enum non_pref_chan_reason {
NON_PREF_CHAN_REASON_UNSPECIFIED = 0, /**< Unspecified reason for non-preference */
NON_PREF_CHAN_REASON_RSSI = 1, /**< Non-preferred due to low RSSI (Received Si... | 2,828 |
/*
*/
#ifndef _ESP_WPA2_H
#define _ESP_WPA2_H
#pragma message("esp_wpa2.h is deprecated. Use esp_eap_client.h instead.")
#include "esp_eap_client.h"
/**
*/
__attribute__((deprecated("Use 'esp_wifi_sta_enterprise_enable' instead")))
esp_err_t esp_wifi_sta_wpa2_ent_enable(void);
/**
*/
__attribute__((deprecated... | 2,829 |
/*
*/
#pragma once
#include
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef enum {
ESP_EAP_TTLS_PHASE2_EAP, /**= 128).
*/
esp_err_t esp_eap_client_set_identity(const unsigned char *identity, int len);
/**
*/
void esp_eap_client_clear_identity(void);
/**
*/
esp_err_t esp... | 2,830 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
esp_err_t esp_supplicant_str_to_mac(const char *str, uint8_t dest[6]);
#ifdef __cplusplus
}
#endif
| 2,831 |
/*
*/
#ifndef __ESP_WPS_H__
#define __ESP_WPS_H__
#include
#include
#include "esp_err.h"
#include "esp_wifi_crypto_types.h"
#include "esp_compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \defgroup WiFi_APIs WiFi Related APIs
*/
/** @addtogroup WiFi_APIs
*/
/** @addtogroup WPS_APIs
*/
#define ESP_E... | 2,832 |
< Manufacturer of the device. If empty, the default manufacturer is used. */
char model_number[WPS_MAX_MODEL_NUMBER_LEN]; /*!< Model number of the device. If empty, the default model number is used. */
char model_name[WPS_MAX_MODEL_NAME_LEN]; /*!< Model name of the device. If empty, the default model name i... | 2,832 |
wps_type = type, \
.factory_info = { \
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(manufacturer, "ESPRESSIF") \
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(model_number, CONFIG_IDF_TARGET) \
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(model_name, "ESPRESSIF IOT") \
E... | 2,832 |
/*
*/
#ifndef __ESP_WPA_H__
#define __ESP_WPA_H__
#include
#include
#include "esp_err.h"
#include "esp_wifi_crypto_types.h"
#include "esp_wifi_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \defgroup WiFi_APIs WiFi Related APIs
*/
/** @addtogroup WiFi_APIs
*/
/** \defgroup WPA_APIs WPS APIs
/** @add... | 2,833 |
/*
*/
#ifndef _ESP_RRM_H
#define _ESP_RRM_H
#include
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef void (*neighbor_rep_request_cb)(void *ctx, const uint8_t *report, size_t report_len);
/**
*/
int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,
void *cb_ctx);
/**
*/
bool esp_... | 2,834 |
/*
*/
#ifndef _ESP_WNM_H
#define _ESP_WNM_H
#include
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
enum btm_query_reason {
REASON_UNSPECIFIED = 0,
REASON_FRAME_LOSS = 1,
REASON_DELAY = 2,
REASON_BANDWIDTH = 3,
REASON_LOAD_BALANCE = 4,
REASON_RSSI = 5,
REASON_RETRANSMISSIONS = 6,
REASON_INTERFERENCE = 7,
... | 2,835 |
/*
*/
#ifndef ESP_DPP_H
#define ESP_DPP_H
#include
#include "esp_err.h"
#include "esp_wifi_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_DPP_AUTH_TIMEOUT_SECS 1
#define ESP_ERR_DPP_FAILURE (ESP_ERR_WIFI_BASE + 151) /*!< Generic failure during DPP Operation */
#define ESP_ERR_DPP_TX_FAILU... | 2,836 |
/*
*/
#ifndef ESP_COMMON_I_H
#define ESP_COMMON_I_H
#include "utils/includes.h"
struct wpa_funcs;
extern struct wpa_supplicant g_wpa_supp;
#ifdef CONFIG_IEEE80211KV
struct ieee_mgmt_frame {
u8 sender[ETH_ALEN];
u8 channel;
int8_t rssi;
size_t len;
u8 payload[0];
};
int esp_supplicant_post_evt(uint32_t evt_id... | 2,837 |
/*
*/
#ifndef ESP_DPP_I_H
#define ESP_DPP_I_H
#include "esp_err.h"
#include "utils/includes.h"
#include "utils/common.h"
#include "common/dpp.h"
#include "esp_dpp.h"
#include "esp_wifi_driver.h"
#define DPP_TASK_STACK_SIZE (6144 + TASK_STACK_SIZE_ADD)
#define ESP_DPP_PMK_CACHE_DEFAULT_TIMEOUT 86400 * 7 /*!< 7 ... | 2,838 |
/*
*/
#ifndef ESP_HOSTAP_H
#define ESP_HOSTAP_H
#ifdef __cplusplus
extern "C" {
#endif
#include "sdkconfig.h"
#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT
void *hostap_init(void);
bool hostap_deinit(void *data);
u16 esp_send_assoc_resp(struct hostapd_data *data, struct sta_info *sta,
const u8 *addr, u1... | 2,839 |
/*
*/
#ifndef ESP_SCAN_I_H
#define ESP_SCAN_I_H
void esp_scan_init(struct wpa_supplicant *wpa_s);
void esp_scan_deinit(struct wpa_supplicant *wpa_s);
int esp_handle_beacon_probe(u8 type, u8 *frame, size_t len, u8 *sender,
int8_t rssi, u8 channel, u64 current_tsf);
void esp_supplicant_handle_scan_done_evt(void... | 2,840 |
/*
*/
#ifndef _ESP_WIFI_DRIVER_H_
#define _ESP_WIFI_DRIVER_H_
#include "esp_err.h"
#include "esp_wifi.h"
#if CONFIG_NEWLIB_NANO_FORMAT
#define TASK_STACK_SIZE_ADD 0
#else
#define TASK_STACK_SIZE_ADD 512
#endif
#define WPA2_TASK_STACK_SIZE (6144 + TASK_STACK_SIZE_ADD)
#define WPS_TASK_STACK_SIZE (12288 + TASK_STA... | 2,841 |
(((type)WPS_TYPE_DISABLE)?(((type)<WPS_TYPE_MAX)?true:false):false)
typedef enum wps_status {
WPS_STATUS_DISABLE = 0,
WPS_STATUS_SCANNING,
WPS_STATUS_PENDING,
WPS_STATUS_SUCCESS,
WPS_STATUS_MAX,
} WPS_STATUS_t;
typedef void(*wifi_tx_cb_t)(void *);
typedef void(* eapol_txcb_t)(uint8_t *, size_t, bo... | 2,841 |
/*
*/
#include "esp_wifi_driver.h"
#include "esp_wps.h"
/* WPS message flag */
enum wps_msg_flag {
WPS_MSG_FLAG_MORE = 0x01,
WPS_MSG_FLAG_LEN = 0x02
};
#ifdef USE_WPS_TASK
enum wps_sig_type {
SIG_WPS_ENABLE = 1, //1
SIG_WPS_DISABLE, //2
SIG_WPS_START, //3
SIG_... | 2,842 |
s_wps_api_lock) {\
s_wps_api_lock = os_recursive_mutex_create();\
if (!s_wps_api_lock) {\
wpa_printf(MSG_ERROR, "wps api lock create failed");\
return ESP_ERR_NO_MEM;\
}\
}\
os_mutex_lock(s_wps_api_lock);\
} while(0)
#define API_MUTEX_GIVE() os_mutex_unlock(s_wps... | 2,842 |
/*
*/
#ifndef ESP_OWE_H
#define ESP_OWE_H
#ifdef CONFIG_OWE_STA
#include "esp_wifi_driver.h"
#define OWE_PMK_LEN 32
#define OWE_PMKID_LEN 16
#define OWE_DH_GRP19 19
#define OWE_PRIME_LEN 32
void owe_deinit(void);
void esp_wifi_register_owe_cb(struct wpa_funcs *wpa_cb);
#endif /* CONFIG_OWE_STA */
#endif /... | 2,843 |
// 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 applic... | 2,844 |
/*
*/
#pragma once
#include "esp_wifi_driver.h"
wpa2_ent_eap_state_t eap_client_get_eap_state(void);
| 2,845 |
/*
*/
#ifndef WPAS_GLUE_H
#define WPAS_GLUE_H
u8 *wpa_sm_alloc_eapol(struct wpa_sm *sm, u8 type,
const void *data, u16 data_len,
size_t *msg_len, void **data_pos);
int wpa_sm_mlme_setprotection(struct wpa_sm *sm, const u8 *addr,
int protect... | 2,846 |
/*
*/
#ifndef ESP_WPA3_H
#define ESP_WPA3_H
#include "esp_wifi_driver.h"
#ifdef CONFIG_WPA3_SAE
void esp_wifi_register_wpa3_cb(struct wpa_funcs *wpa_cb);
void esp_wpa3_free_sae_data(void);
#else /* CONFIG_WPA3_SAE */
static inline void esp_wifi_register_wpa3_cb(struct wpa_funcs *wpa_cb)
{
wpa_cb->wpa3_build_s... | 2,847 |
/*
*/
/*
*/
#ifndef FASTPBKDF2_H
#define FASTPBKDF2_H
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
/** Calculates PBKDF2-HMAC-SHA1.
*/
void fastpbkdf2_hmac_sha1(const uint8_t *pw, size_t npw,
const uint8_t *salt, size_t nsalt,
uint32_t iterations... | 2,848 |
/*
*/
#ifndef AES_WRAP_H
#define AES_WRAP_H
int __must_check aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain,
u8 *cipher);
int __must_check aes_unwrap(const u8 *kek, size_t kek_len, int n,
const u8 *cipher, u8 *plain);
int __must_check omac1_aes_vector(const u8 *key, size_t key_len,
... | 2,849 |
/*
*/
#ifndef SHA384_I_H
#define SHA384_I_H
#include "sha512_i.h"
#define SHA384_BLOCK_SIZE SHA512_BLOCK_SIZE
#define sha384_state sha512_state
void sha384_init(struct sha384_state *md);
int sha384_process(struct sha384_state *md, const unsigned char *in,
unsigned long inlen);
int sha384_done(struct sha384_s... | 2,850 |
/*
*/
#ifndef TLS_H
#define TLS_H
struct tls_connection;
struct tls_random {
const u8 *client_random;
size_t client_random_len;
const u8 *server_random;
size_t server_random_len;
};
enum tls_event {
TLS_CERT_CHAIN_SUCCESS,
TLS_CERT_CHAIN_FAILURE,
TLS_PEER_CERTIFICATE,
TLS_ALERT
};
/*
*/
enum tls_fail_rea... | 2,851 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.