esp_eth_netdev.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef ESP_ETH_NETDEV_H
20 #define ESP_ETH_NETDEV_H
21 
22 #include <stdbool.h>
23 
24 #include "mutex.h"
25 #include "net/ethernet.h"
26 #include "net/netdev.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 extern const netdev_driver_t esp_eth_driver;
36 
40 typedef struct
41 {
44  uint16_t rx_len;
45  uint16_t tx_len;
47  uint8_t rx_buf[ETHERNET_MAX_LEN];
48  uint8_t tx_buf[ETHERNET_MAX_LEN];
50  uint32_t event;
51  bool link_up;
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* ESP_ETH_NETDEV_H */
62 
netdev_driver
Structure to hold driver interface -> function mapping.
Definition: netdev.h:344
ETHERNET_MAX_LEN
#define ETHERNET_MAX_LEN
maximum number of bytes in an ethernet frame (with FCF)
Definition: ethernet.h:48
esp_eth_netdev_t
Device descriptor for ESP-ETH devices.
Definition: esp_eth_netdev.h:40
ethernet.h
Definitions for Ethernet.
esp_eth_netdev_t::tx_len
uint16_t tx_len
number of bytes in transmit buffer
Definition: esp_eth_netdev.h:45
esp_eth_netdev_t::dev_lock
mutex_t dev_lock
device is already in use
Definition: esp_eth_netdev.h:53
netdev.h
Definitions low-level network driver interface.
esp_eth_netdev_t::rx_len
uint16_t rx_len
number of bytes received
Definition: esp_eth_netdev.h:44
esp_eth_netdev_t::netdev
netdev_t netdev
netdev parent struct
Definition: esp_eth_netdev.h:42
esp_eth_netdev_t::event
uint32_t event
received event
Definition: esp_eth_netdev.h:50
netdev
Structure to hold driver state.
Definition: netdev.h:302
esp_eth_netdev_t::link_up
bool link_up
indicates whether link is up
Definition: esp_eth_netdev.h:51
mutex.h
Mutex for thread synchronization.
esp_eth_driver
const netdev_driver_t esp_eth_driver
Reference to the netdev device driver struct.
mutex_t
Mutex structure.
Definition: mutex.h:120