mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
698770ddb5
Fixes sporadic blocking of the wifi thread in esp_wifi_recv_cb function under heavy network load conditions when frames are coming in faster than they can be processed. Since esp_wifi_recv_cb function is not executed in interrupt context, the msg_send function used for ISR event can block when the message queue is full. With this change esp_wifi can be flooded with icmpv6 packets of maximum size without any problems over hours.
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2019 Gunar Schorcht
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
* directory for more details.
|
|
*/
|
|
|
|
/**
|
|
* @ingroup cpu_esp8266_esp_wifi
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief Network device driver for the ESP8266 WiFi interface
|
|
*
|
|
* @author Gunar Schorcht <gunar@schorcht.net>
|
|
*/
|
|
|
|
#ifndef ESP_WIFI_NETDEV_H
|
|
#define ESP_WIFI_NETDEV_H
|
|
|
|
#include "net/netdev.h"
|
|
#include "lwip/udp.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Device descriptor for ESP infrastructure mode WIFI device
|
|
*/
|
|
typedef struct
|
|
{
|
|
netdev_t netdev; /**< netdev parent struct */
|
|
|
|
uint8_t mac[ETHERNET_ADDR_LEN]; /**< MAC address of the device */
|
|
ip_addr_t ip; /**< IPv4 address of the device */
|
|
|
|
uint8_t rx_buf[ETHERNET_DATA_LEN];/**< receive buffer */
|
|
uint16_t rx_len; /**< number of bytes received from lwIP */
|
|
|
|
bool connected; /**< indicates the connection state to the AP */
|
|
|
|
mutex_t dev_lock; /**< for exclusive access to buffer in receive functions */
|
|
|
|
} esp_wifi_netdev_t;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ESP_WIFI_NETDEV_H */
|
|
/** @} */
|