#include <stdint.h>
#include <stdbool.h>
#include "sdrv_ckgen.h"
#include "sdrv_rstgen.h"
#include "netdev.h"
#include "../source/eth/sdrv_mac_lld.h"
#include "../source/eth/phy/phy.h"
Go to the source code of this file.
- Copyright
- Copyright (c) 2021 Semidrive Semiconductor. All rights reserved.
Revision History:
◆ ARCH_DMA_MINALIGN
◆ CONFIG_ETH_RX_DESCRIPTOR_NUM
| #define CONFIG_ETH_RX_DESCRIPTOR_NUM 32 |
◆ CONFIG_ETH_TX_DESCRIPTOR_NUM
| #define CONFIG_ETH_TX_DESCRIPTOR_NUM 32 |
◆ EQOS_BUFFER_ALIGN
◆ EQOS_DESC3_BUF1V
| #define EQOS_DESC3_BUF1V BIT(24) |
◆ EQOS_DESC3_FD
| #define EQOS_DESC3_FD BIT(29) |
◆ EQOS_DESC3_IOC
| #define EQOS_DESC3_IOC BIT(30) |
◆ EQOS_DESC3_LD
| #define EQOS_DESC3_LD BIT(28) |
◆ EQOS_DESC3_OWN
| #define EQOS_DESC3_OWN BIT(31) |
◆ EQOS_DESCRIPTOR_ALIGN
◆ EQOS_DESCRIPTORS_NUM
◆ EQOS_DESCRIPTORS_RX
◆ EQOS_DESCRIPTORS_TX
◆ EQOS_MAX_PACKET_SIZE
◆ EQOS_RX_BUFFER_SIZE
◆ EQOS_RX_LOCK
| #define EQOS_RX_LOCK |
( |
|
eqos | ) |
|
◆ EQOS_RX_UNLOCK
| #define EQOS_RX_UNLOCK |
( |
|
eqos | ) |
|
◆ EQOS_TX_BUFFER_SIZE
◆ EQOS_TX_LOCK
| #define EQOS_TX_LOCK |
( |
|
eqos | ) |
|
◆ EQOS_TX_UNLOCK
| #define EQOS_TX_UNLOCK |
( |
|
eqos | ) |
|
◆ dma_rx_int_cb_t
| typedef void(* dma_rx_int_cb_t) (struct net_driver_s *dev) |
◆ dwc_eth_dev_t
◆ eth_filter_action_type
| Enumerator |
|---|
| ETH_ADD_TO_FILTER | |
| ETH_REMOVE_FROM_FILTER | |
◆ eth_idx_type
| Enumerator |
|---|
| ETHERNET1_IDX | |
| ETHERNET2_IDX | |
◆ eth_mac_layer_speed_type
| Enumerator |
|---|
| ETH_MAC_LAYER_SPEED_100M | |
| ETH_MAC_LAYER_SPEED_10G | |
| ETH_MAC_LAYER_SPEED_10M | |
| ETH_MAC_LAYER_SPEED_1G | |
◆ eth_mac_layer_sub_type
| Enumerator |
|---|
| LIGHT | |
| REDUCED | |
| REVERSED | |
| SERIAL | |
| STANDARD | |
| UNIVERSAL_SERIAL | |
◆ eth_mac_layer_type
| Enumerator |
|---|
| ETH_MAC_LAYER_TYPE_XGMII | |
| ETH_MAC_LAYER_TYPE_XMII | |
| ETH_MAC_LAYER_TYPE_XXGMII | |
◆ eth_mode_type
| Enumerator |
|---|
| ETH_MODE_DOWN | |
| ETH_MODE_ACTIVE | |
◆ eth_phy_intf_mode_type
| Enumerator |
|---|
| ETH_PHY_INTF_SEL_GMII | |
| ETH_PHY_INTF_SEL_RGMII | |
| ETH_PHY_INTF_SEL_SGMII | |
| ETH_PHY_INTF_SEL_TBI | |
| ETH_PHY_INTF_SEL_RMII | |
| ETH_PHY_INTF_SEL_RTBI | |
| ETH_PHY_INTF_SEL_SMII | |
| ETH_PHY_INTF_SEL_REVMII | |
| ETH_PHY_INTF_SEL_MII | |
◆ dwc_eth_enable_dma_rx_int()
| void dwc_eth_enable_dma_rx_int |
( |
struct net_driver_s * |
dev, |
|
|
dma_rx_int_cb_t |
callback |
|
) |
| |
Enable rx interrupt.
When receive is completed, callback will be executed.
- Parameters
-
| [in] | dev | eth device. |
| [in] | callback | receive complete callback. |
◆ dwc_eth_probe()
Initializes net driver.
- Parameters
-
| [in] | dev | eth device. |
| [in] | cfg | Configuration of ethernet. |
- Returns
- int return ERR_OK if initialization can be completed.
◆ dwc_eth_rx()
| int dwc_eth_rx |
( |
struct net_driver_s * |
dev, |
|
|
bool |
pool |
|
) |
| |
try to read rx packet and send the packet to lwip stack. Should be called in thread context. If enable DMA rx interrupt, i.e. poll is false, this function should be called after DMA rx interrupt triggered. DMA rx interrupt will be disabled in ISR, and re-enabled in this function after reading out all rx packets, this is helpful to avoid too much rx interrupt.
- Parameters
-
| [in] | dev | eth device |
| [in] | poll | true for polling read, false for interrupt read |
- Returns
- int total length of rx packets or -1 if rx nothing