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

esp-wifi: avoid explicit cast to netdev

This commit is contained in:
Jose Alamos 2021-06-22 10:55:14 +02:00
parent 88dc962c3e
commit 4340047781
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9
2 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ void auto_init_esp_wifi (void)
ESP_WIFI_PRIO,
#endif
"netif-esp-wifi",
(netdev_t *)&_esp_wifi_dev);
&_esp_wifi_dev.netdev);
}
#else /* defined(MODULE_ESP_WIFI) && defined(MODULE_GNRC_NETIF_ETHERNET) */

View File

@ -562,7 +562,7 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist)
}
_esp_wifi_send_is_in = true;
esp_wifi_netdev_t* dev = (esp_wifi_netdev_t*)netdev;
esp_wifi_netdev_t* dev = container_of(netdev, esp_wifi_netdev_t, netdev);
#ifdef MODULE_ESP_WIFI_AP
if (_esp_wifi_dev.sta_connected == 0) {
@ -629,7 +629,7 @@ static int _esp_wifi_recv(netdev_t *netdev, void *buf, size_t len, void *info)
assert(netdev != NULL);
esp_wifi_netdev_t* dev = (esp_wifi_netdev_t*)netdev;
esp_wifi_netdev_t* dev = container_of(netdev, esp_wifi_netdev_t, netdev);
uint16_t size;
critical_enter();
@ -688,7 +688,7 @@ static int _esp_wifi_get(netdev_t *netdev, netopt_t opt, void *val, size_t max_l
assert(val != NULL);
#ifndef MODULE_ESP_WIFI_AP
esp_wifi_netdev_t* dev = (esp_wifi_netdev_t*)netdev;
esp_wifi_netdev_t* dev = container_of(netdev, esp_wifi_netdev_t, netdev);
#endif /* MODULE_ESP_WIFI_AP */
switch (opt) {
@ -748,7 +748,7 @@ static void _esp_wifi_isr(netdev_t *netdev)
assert(netdev != NULL);
esp_wifi_netdev_t *dev = (esp_wifi_netdev_t *) netdev;
esp_wifi_netdev_t* dev = container_of(netdev, esp_wifi_netdev_t, netdev);
while (dev->event_recv) {
dev->event_recv--;