1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

33 Commits

Author SHA1 Message Date
Gunar Schorcht
4469dadb7f cpu/esp32: _esp_wifi_dev exposed for lwIP
To be able to access the single esp_wifi network device from lwIP adaptation layer, static keyword was removed from esp_wifi_dev variable.
2019-09-12 18:39:46 +02:00
Gunar Schorcht
6d77529c83 cpu/esp32: cleaning up left overs in esp_wifi 2019-09-05 12:49:43 +02:00
Gunar Schorcht
3d5ef14650 cpu/esp32: local buffer in send of esp_wifi
Instead of having a send buffer as member `esp_wifi` netdev, a local variable is used now as send buffer. This avoids the need for a locking mechanism and reduces the risk of deadlocks.
2019-09-05 12:49:43 +02:00
Gunar Schorcht
74cbc410b7 cpu/esp32: ringbuffer introduced in esp_wifi
Receive call back function `_esp_wifi_rx_cb` is called from WiFi hardware driver with a pointer to a frame buffer that is allocated in the WiFi hardware driver. This frame buffer was freed immediately after copying its content to a single local receive buffer of the `esp_wifi` netdev. The local receive buffer remained occupied until the protocol stack had processed it. Further incoming packets were dropped.  However, very often a number of subsequent WiFi frames are received at the same time before the first one is processed completely. Having the single local receive buffer to hold only one received frame, led to a number of lost packets, even at low network load. Therefore, a ringbuffer of rx_buf elements was introduced which doesn't store the frames directly but only references to the frame buffers allocated in WiFi hardware driver. Since there is enough memory to hold several frames, the frames buffers allocated in WiFi hardware driver aren't freed immediatly any longer but are kept until the frame is processed by the protocol stack. This results in a much less loss rate of packets.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
0e4ab63735 cpu/esp32: uniform debug output in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
1ed09492a4 cpu/esp32: param checks replaced by asserts in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
28ce17e64c cpu/esp32: event handling changed in esp_wifi
Events of different type can be pending at the same time. Therefore it is not possible to use ascending identifiers for the presence of a pending event. Rather, each event type has to be represented by one bit. Thes bits ORed identify all types of pending events. In the esp_wifi_isr function all pending events are then handled in one call. Otherwise, some events might be lost.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
5cc990fb7c cpu/esp32: cleanup of includes in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
73552b2c11 cpu/esp32: _esp_wifi_dev exposed for lwIP
To be able to access the single esp_wifi network device from lwIP adaptation layer, static keyword was removed from esp_wifi_dev variable.
2019-08-06 19:12:29 +02:00
Gunar Schorcht
33a6f42fa5 cpu/esp32: lwIP Ethernet address option length
The option value length of Ethernet addresses can be more than 6 byte in lwIP. Therefore, the max_len parameter is check to be greater than or equal to ETHERNET_ADDR_LEN.
2019-08-06 19:12:29 +02:00
Gunar Schorcht
b571757bcd cpu/esp32: fix of the return code in esp_wifi_send 2019-08-05 17:38:03 +02:00
Gunar Schorcht
97bb33788b cpu/esp*: changes to use esp_wifi and esp_now 2019-07-31 13:53:48 +02:00
Gunar Schorcht
96a9949bf9 cpu/esp32: set WiFi config storage type 2019-07-31 13:53:48 +02:00
Gunar Schorcht
9981d2b05c cpu/esp32: cleanup comments/messages in esp_wifi 2019-07-31 13:53:48 +02:00
Gunar Schorcht
f34a1a3eef cpu/esp*: shorter netdev task names 2019-07-31 13:53:48 +02:00
Gunar Schorcht
ad57337c4e cpu/esp32: esp_wifi doesn't call memcpy if iol_len is 0 2019-03-14 16:11:24 +01:00
smlng
6183d5f5c5 netdev: remove layer2 netstats from netdev drivers
Removing usage of netdev->stats in all net drivers, as it is
handled by gnrc_netif.
2019-02-01 11:25:27 +02:00
Gunar Schorcht
5020c30970 cpu/esp32: fix of maximum frame length in esp_wifi
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for buffer sizes and length checks.
2019-01-21 15:26:18 +01:00
Gunar Schorcht
f788928b27 cpu/esp32: fix esp_wifi stability issues
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.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
6caead7bbc cpu/esp32: esp-wifi related doc changes 2019-01-17 17:10:43 +01:00
Gunar Schorcht
1cf415a8a9 cpu/esp32: doc improvements in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
e83a8679b4 cpu/esp32: cleanup esp_wifi config parameters 2019-01-17 17:10:43 +01:00
Gunar Schorcht
c0d4706bf8 cpu/esp32: fix of event types in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
c9684af5c2 cpu/esp32: automatic reconnect after disconnect
If WiFi is disconnected, e.g., because of timeout for beacon frame, it is tried to reconnect automatically.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
90e9c95c30 cpu/esp32: registration of RX callback in esp_wifi
RX callback function should be register when WiFi has been connected to AP successfully and should be unregistered when WiFi disconnects from AP. Therefore, esp_wifi_internal_reg_rxcb is called now in event handler on event SYSTEM_EVENT_STA_CONNECTED. It is reset now on event SYSTEM_EVENT_STA_DISCONNECTED.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
f4cacc1e24 cpu/esp32: improved debug message in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
2c3ac91cf3 cpu/esp32: move wifi_connect to event handler
Before function wifi_connect is executed, starting the WiFi driver should have been finished. This is indicated by the WiFi driver by sending event SYSTEM_EVENT_STA_START. Function wifi_connect is moved therefore to the event handler for SYSTEM_EVENT_STA_START.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
8a1da21b1a cpu/esp32: fixes serious memory leak in esp_wifi
The buffer given by the WiFi driver as parameter eb has to be freed explicitly. Otherwise the esp_wifi_netdev stops working after some seconds.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
3ef35e1b78 cpu/esp32: use static WiFi config in esp_wifi
The WiFi configuration has to be static to avoid memory access problems when WiFi AP is reconnected.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
d24d73dadf cpu/esp32: fixes NETOPT_LINK_CONNECTED in esp_wifi
esp_wifi was simply returning the connection state instead of filling the referenced value.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
2c97377585 cpu/esp32: fixes NETOPT_IS_WIRED in esp_wifi
esp_wifi returns false now.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
078c47d79c cpu/esp32: fixes frame size handling in esp_wifi
The size of received and transmitted frames was stored in an uint8_t, which did not allow to process frames larger than 255 octets. However, WiFi has an MTU of 1500 octets.
2019-01-17 17:10:43 +01:00
Schorcht
3ac99877ac cpu: add esp32 2018-10-08 12:20:49 +02:00