18#ifndef __VSF_TEMPLATE_ETH_H__
19#define __VSF_TEMPLATE_ETH_H__
39#ifndef VSF_ETH_CFG_MULTI_CLASS
40# define VSF_ETH_CFG_MULTI_CLASS ENABLED
42#ifndef VSF_ETH_CFG_MULTI_PHY_CLASS
43# define VSF_ETH_CFG_MULTI_PHY_CLASS ENABLED
46#if defined(VSF_HW_ETH_COUNT) && !defined(VSF_HW_ETH_MASK)
54# define VSF_HW_ETH_MASK VSF_HAL_COUNT_TO_MASK(VSF_HW_ETH_COUNT)
57#if defined(VSF_HW_ETH_MASK) && !defined(VSF_HW_ETH_COUNT)
65# define VSF_HW_ETH_COUNT VSF_HAL_MASK_TO_COUNT(VSF_HW_ETH_MASK)
89#ifndef VSF_ETH_CFG_PREFIX
90# if (VSF_ETH_CFG_MULTI_CLASS == DISABLED) && defined(VSF_HW_ETH_COUNT) && (VSF_HW_ETH_COUNT != 0)
91# define VSF_ETH_CFG_PREFIX vsf_hw
93# define VSF_ETH_CFG_PREFIX vsf
107#ifndef VSF_ETH_CFG_FUNCTION_RENAME
108# define VSF_ETH_CFG_FUNCTION_RENAME ENABLED
120#ifndef VSF_ETH_CFG_REIMPLEMENT_TYPE_PHY_MODE
121# define VSF_ETH_CFG_REIMPLEMENT_TYPE_PHY_MODE DISABLED
133#ifndef VSF_ETH_CFG_REIMPLEMENT_TYPE_MODE
134# define VSF_ETH_CFG_REIMPLEMENT_TYPE_MODE DISABLED
149#if VSF_ETH_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
150# define VSF_ETH_CFG_REIMPLEMENT_TYPE_CFG DISABLED
161#ifndef VSF_ETH_CFG_REIMPLEMENT_TYPE_STATUS
162# define VSF_ETH_CFG_REIMPLEMENT_TYPE_STATUS DISABLED
177#if VSF_ETH_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
178# define VSF_ETH_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED
191#if VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_MODE == DISABLED
192# define VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_MODE DISABLED
195#if VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_DESC == DISABLED
196# define VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_DESC DISABLED
199#if VSF_ETH_CFG_REIMPLEMENT_TYPE_SEND_BUF_DESC == DISABLED
200# define VSF_ETH_CFG_REIMPLEMENT_TYPE_SEND_BUF_DESC DISABLED
203#if VSF_ETH_CFG_REIMPLEMENT_TYPE_RECV_BUF_DESC == DISABLED
204# define VSF_ETH_CFG_REIMPLEMENT_TYPE_RECV_BUF_DESC DISABLED
216#if VSF_ETH_CFG_REIMPLEMENT_TYPE_SG_BUF_DESC == DISABLED
217# define VSF_ETH_CFG_REIMPLEMENT_TYPE_SG_BUF_DESC DISABLED
230#if VSF_ETH_CFG_REIMPLEMENT_TYPE_IRQ_MASK == DISABLED
231# define VSF_ETH_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED
244#ifndef VSF_ETH_CFG_INHERIT_HAL_CAPABILITY
245# define VSF_ETH_CFG_INHERIT_HAL_CAPABILITY ENABLED
259#define VSF_ETH_APIS(__prefix_name) \
260 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, init, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_cfg_t *cfg_ptr) \
261 __VSF_HAL_TEMPLATE_API(__prefix_name, void, eth, fini, VSF_MCONNECT(__prefix_name, _t) *eth_ptr) \
262 __VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, eth, enable, VSF_MCONNECT(__prefix_name, _t) *eth_ptr) \
263 __VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, eth, disable, VSF_MCONNECT(__prefix_name, _t) *eth_ptr) \
264 __VSF_HAL_TEMPLATE_API(__prefix_name, void, eth, irq_enable, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_irq_mask_t irq_mask) \
265 __VSF_HAL_TEMPLATE_API(__prefix_name, void, eth, irq_disable, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_irq_mask_t irq_mask) \
266 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, send_request, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_send_buf_desc_t *buf_ptr) \
267 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, recv_request, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_recv_buf_desc_t *buf_ptr) \
268 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, send_sg_request, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_send_sg_buf_desc_t *buf_ptr, uint32_t sg_count) \
269 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, recv_sg_request, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_recv_sg_buf_desc_t *buf_ptr, uint32_t sg_count) \
270 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, ctrl, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_ctrl_t ctrl, void *param) \
271 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_eth_status_t, eth, status, VSF_MCONNECT(__prefix_name, _t) *eth_ptr) \
272 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_eth_capability_t, eth, capability, VSF_MCONNECT(__prefix_name, _t) *eth_ptr) \
273 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, phy_set_mode, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_phy_mode_t phy_mode) \
274 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, phy_get_link_status, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, vsf_eth_phy_mode_t *phy_mode_ptr) \
275 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, phy_read_reg, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, uint16_t reg_addr, uint32_t *value_ptr) \
276 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, eth, phy_write_reg, VSF_MCONNECT(__prefix_name, _t) *eth_ptr, uint16_t reg_addr, uint32_t value)
283#if VSF_ETH_CFG_REIMPLEMENT_TYPE_PHY_MODE == DISABLED
346#ifndef VSF_ETH_PHY_MODE_SPEED_MASK
350#ifndef VSF_ETH_PHY_MODE_DUPLEX_MASK
354#ifndef VSF_ETH_PHY_MODE_ALL_BITS_MASK
359#if VSF_ETH_CFG_REIMPLEMENT_TYPE_MODE == DISABLED
486#ifndef VSF_ETH_MODE_OFFLOAD_MASK
490#ifndef VSF_ETH_MODE_ALL_BITS_MASK
496#if VSF_ETH_CFG_REIMPLEMENT_TYPE_IRQ_MASK == DISABLED
511#ifndef VSF_ETH_IRQ_MASK_ALL
521#if VSF_ETH_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
572#if VSF_ETH_CFG_REIMPLEMENT_TYPE_STATUS == DISABLED
585#if VSF_ETH_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
597#if VSF_ETH_CFG_INHERIT_HAL_CAPABILITY == ENABLED
626#if VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_MODE == DISABLED
635#if VSF_ETH_CFG_REIMPLEMENT_TYPE_BUF_DESC == DISABLED
643#if VSF_ETH_CFG_REIMPLEMENT_TYPE_SEND_BUF_DESC == DISABLED
649#if VSF_ETH_CFG_REIMPLEMENT_TYPE_RECV_BUF_DESC == DISABLED
655#if VSF_ETH_CFG_REIMPLEMENT_TYPE_SG_SEND_BUF == DISABLED
661#if VSF_ETH_CFG_REIMPLEMENT_TYPE_SG_RECV_BUF == DISABLED
667#if VSF_ETH_CFG_REIMPLEMENT_TYPE_CTRL == DISABLED
698#undef __VSF_HAL_TEMPLATE_API
699#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP
706#if VSF_ETH_CFG_MULTI_CLASS == ENABLED
998#if VSF_ETH_CFG_FUNCTION_RENAME == ENABLED
999# define __vsf_eth_t VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_t)
1000# define vsf_eth_init(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_init)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1001# define vsf_eth_fini(__ETH) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_fini)((__vsf_eth_t *)(__ETH))
1002# define vsf_eth_enable(__ETH) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_enable)((__vsf_eth_t *)(__ETH))
1003# define vsf_eth_disable(__ETH) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_disable)((__vsf_eth_t *)(__ETH))
1004# define vsf_eth_status(__ETH) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_status)((__vsf_eth_t *)(__ETH))
1005# define vsf_eth_capability(__ETH) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_capability)((__vsf_eth_t *)(__ETH))
1006# define vsf_eth_send_request(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_send_request)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1007# define vsf_eth_send_sg_request(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_send_sg_request)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1008# define vsf_eth_recv_request(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_recv_request)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1009# define vsf_eth_recv_sg_request(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_recv_sg_request)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1010# define vsf_eth_ctrl(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_ctrl)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1011# define vsf_eth_phy_read_reg(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_phy_read_reg)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1012# define vsf_eth_phy_write_reg(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_phy_write_reg)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1013# define vsf_eth_phy_set_mode(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_phy_set_mode)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
1014# define vsf_eth_phy_get_link_status(__ETH, ...) VSF_MCONNECT(VSF_ETH_CFG_PREFIX, _eth_phy_get_link_status)((__vsf_eth_t *)(__ETH), ##__VA_ARGS__)
vsf_err_t
Definition __type.h:42
vsf_arch_prio_t
Definition cortex_a_generic.h:88
vsf_eth_irq_mask_t
Definition eth.h:151
vsf_eth_buf_mode_t
Definition eth.h:225
vsf_eth_mode_t
Definition eth.h:142
vsf_eth_phy_mode_t
Definition eth.h:129
void vsf_eth_isr_handler_t(void *target_ptr, vsf_eth_t *eth_ptr, vsf_eth_irq_mask_t irq_mask)
Definition eth.h:174
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned short uint16_t
Definition stdint.h:7
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_template_eth.h:636
void * payload
Definition vsf_template_eth.h:638
vsf_eth_buf_mode_t mode
Definition vsf_template_eth.h:637
size_t len
Definition vsf_template_eth.h:639
Predefined VSF ETH capability that can be reimplemented in specific hal drivers. The vsf_eth_capabili...
Definition vsf_template_eth.h:596
uint32_t is_send_buf_releasable_immediately
Definition vsf_template_eth.h:613
uint32_t is_sg_send_buf_releasable_immediately
Definition vsf_template_eth.h:620
inherit(vsf_peripheral_capability_t) vsf_eth_mode_t support_modes
Supported modes, refer to vsf_eth_mode_t.
vsf_eth_phy_mode_t support_phy_modes
Supported PHY modes, refer to vsf_eth_phy_mode_t.
Definition vsf_template_eth.h:602
uint32_t value
Definition vsf_template_eth.h:606
vsf_eth_irq_mask_t support_irq_mask
Supported IRQ masks, refer to vsf_eth_irq_mask_t.
Definition vsf_template_eth.h:603
ETH configuration structure.
Definition vsf_template_eth.h:556
uint8_t mac_address[6]
MAC address, 6 bytes.
Definition vsf_template_eth.h:559
vsf_eth_phy_mode_t phy_mode
PHY mode, refer to vsf_eth_phy_mode_t.
Definition vsf_template_eth.h:558
vsf_eth_isr_t isr
ETH interrupt configuration, refer to vsf_eth_isr_t.
Definition vsf_template_eth.h:560
vsf_eth_mode_t mode
ETH mode, refer to vsf_eth_mode_t.
Definition vsf_template_eth.h:557
ETH interrupt configuration structure.
Definition vsf_template_eth.h:543
vsf_eth_isr_handler_t * handler_fn
Interrupt handler function pointer.
Definition vsf_template_eth.h:544
void * target_ptr
User-defined target pointer.
Definition vsf_template_eth.h:545
vsf_arch_prio_t prio
Interrupt priority.
Definition vsf_template_eth.h:546
ETH operation function pointer type, used for ETH Multi Class support.
Definition vsf_template_eth.h:696
ETH status information structure Contains the current status of ETH operations and FIFO thresholds.
Definition vsf_template_eth.h:573
uint32_t is_tx_ready
TX is ready to accept data.
Definition vsf_template_eth.h:579
uint32_t is_rx_available
RX data is available.
Definition vsf_template_eth.h:578
ETH instance structure, used for ETH Multi Class support, not needed in non Multi Class mode.
Definition vsf_template_eth.h:711
const vsf_eth_op_t * op
Definition vsf_template_eth.h:712
Definition vsf_template_hal_driver.h:203
Definition vsf_template_hal_driver.h:196
vk_av_control_value_t value
Definition vsf_audio.h:171
fsm_rt_t
Definition vsf_fsm.h:315
vsf_err_t vsf_eth_init(vsf_eth_t *eth_ptr, vsf_eth_cfg_t *cfg_ptr)
Initialize a ETH instance.
Definition eth_common.c:38
vsf_err_t vsf_eth_recv_sg_request(vsf_eth_t *eth_ptr, vsf_eth_recv_sg_buf_desc_t *sg_ptr, uint32_t sg_count)
Receive data using scatter-gather buffers from ETH instance.
Definition eth_common.c:119
void vsf_eth_fini(vsf_eth_t *eth_ptr)
Finalize a ETH instance.
Definition eth_common.c:47
#define VSF_ETH_APIS(__prefix_name)
ETH API template, used to generate ETH type, specific prefix function declarations,...
Definition vsf_template_eth.h:259
@ VSF_ETH_IRQ_MASK_ALL
Definition vsf_template_eth.h:512
vsf_eth_buf_desc_t vsf_eth_recv_buf_desc_t
Definition vsf_template_eth.h:652
void vsf_eth_isr_disable(vsf_eth_t *eth_ptr, vsf_eth_irq_mask_t isr_mask)
Disable ETH instance interrupt.
vsf_eth_irq_mask_t
Definition vsf_template_eth.h:497
@ VSF_ETH_IRQ_MASK_ERROR
Error interrupt mask.
Definition vsf_template_eth.h:506
@ VSF_ETH_IRQ_MASK_RX_AVAILABLE
RX data available interrupt mask.
Definition vsf_template_eth.h:498
@ VSF_ETH_IRQ_MASK_PHY_LINK_CHANGE
PHY link change interrupt mask.
Definition vsf_template_eth.h:504
@ VSF_ETH_IRQ_MASK_SG_TX_COMPLETE
Scatter-gather TX complete interrupt mask.
Definition vsf_template_eth.h:502
@ VSF_ETH_IRQ_MASK_SG_RX_AVAILABLE
Scatter-gather RX available interrupt mask.
Definition vsf_template_eth.h:501
@ VSF_ETH_IRQ_MASK_TX_COMPLETE
TX complete interrupt mask.
Definition vsf_template_eth.h:499
struct vsf_eth_cfg_t vsf_eth_cfg_t
ETH configuration structure.
fsm_rt_t vsf_eth_enable(vsf_eth_t *eth_ptr)
Enable a ETH instance.
Definition eth_common.c:56
struct vsf_eth_status_t vsf_eth_status_t
ETH status information structure Contains the current status of ETH operations and FIFO thresholds.
@ VSF_ETH_MODE_OFFLOAD_MASK
Definition vsf_template_eth.h:487
@ VSF_ETH_MODE_ALL_BITS_MASK
Definition vsf_template_eth.h:491
vsf_err_t vsf_eth_send_request(vsf_eth_t *eth_ptr, vsf_eth_send_buf_desc_t *buf_ptr)
Send a buffer over ETH instance.
Definition eth_common.c:92
fsm_rt_t vsf_eth_disable(vsf_eth_t *eth_ptr)
Disable a ETH instance.
Definition eth_common.c:65
@ VSF_ETH_PHY_MODE_SPEED_MASK
Definition vsf_template_eth.h:347
@ VSF_ETH_PHY_MODE_ALL_BITS_MASK
Definition vsf_template_eth.h:355
@ VSF_ETH_PHY_MODE_DUPLEX_MASK
Definition vsf_template_eth.h:351
vsf_err_t vsf_eth_ctrl(vsf_eth_t *eth_ptr, vsf_eth_ctrl_t ctrl, void *param)
Control ETH instance.
Definition eth_common.c:128
vsf_eth_ctrl_t
Definition vsf_template_eth.h:668
@ VSF_ETH_CTRL_GET_MAC_ADDRESS
Get MAC address (uint8_t *)
Definition vsf_template_eth.h:669
vsf_eth_buf_mode_t
Definition vsf_template_eth.h:627
@ VSF_ETH_BUF_MODE_TX_CHECKSUM_OFFLOAD
TX checksum offload mode.
Definition vsf_template_eth.h:628
@ VSF_ETH_BUF_MODE_RX_CHECKSUM_OFFLOAD
RX checksum offload mode.
Definition vsf_template_eth.h:629
vsf_err_t vsf_eth_phy_write_reg(vsf_eth_t *eth_ptr, uint16_t reg_addr, uint32_t value)
Write a value to a PHY register.
struct vsf_eth_buf_desc_t vsf_eth_buf_desc_t
vsf_eth_capability_t vsf_eth_capability(vsf_eth_t *eth_ptr)
Get the capability of ETH instance.
Definition eth_common.c:146
vsf_err_t vsf_eth_recv_request(vsf_eth_t *eth_ptr, vsf_eth_recv_buf_desc_t *buf_ptr)
Receive a buffer from ETH instance.
Definition eth_common.c:101
vsf_eth_mode_t
Predefined VSF ETH modes that can be reimplemented in specific HAL drivers.The following modes must b...
Definition vsf_template_eth.h:378
@ VSF_ETH_MODE_TX_CHECKSUM_OFFLOAD
TX checksum offload mode.
Definition vsf_template_eth.h:379
@ VSF_ETH_MODE_RX_CHECKSUM_OFFLOAD
RX checksum offload mode.
Definition vsf_template_eth.h:380
vsf_eth_phy_mode_t
Predefined VSF ETH modes that can be reimplemented in specific HAL drivers.The following modes must b...
Definition vsf_template_eth.h:319
@ VSF_ETH_PHY_MODE_LINK_UP
Link up mode.
Definition vsf_template_eth.h:330
@ VSF_ETH_PHY_MODE_SPEED_1000M
1000M speed mode
Definition vsf_template_eth.h:325
@ VSF_ETH_PHY_MODE_SPEED_100M
100M speed mode
Definition vsf_template_eth.h:324
@ VSF_ETH_PHY_MODE_SPEED_10M
10M speed mode
Definition vsf_template_eth.h:323
@ VSF_ETH_PHY_MODE_DUPLEX_HALF
Half duplex mode.
Definition vsf_template_eth.h:327
@ VSF_ETH_PHY_MODE_DUPLEX_FULL
Full duplex mode.
Definition vsf_template_eth.h:328
vsf_err_t vsf_eth_send_sg_request(vsf_eth_t *eth_ptr, vsf_eth_send_sg_buf_desc_t *sg_ptr, uint32_t sg_count)
Send a scatter-gather buffer over ETH instance.
Definition eth_common.c:110
vsf_err_t vsf_eth_phy_set_mode(vsf_eth_t *eth_ptr, vsf_eth_phy_mode_t mode)
Configure the PHY operating mode.
vsf_eth_buf_desc_t vsf_eth_send_sg_buf_desc_t
Definition vsf_template_eth.h:658
vsf_eth_buf_desc_t vsf_eth_send_buf_desc_t
Definition vsf_template_eth.h:646
struct vsf_eth_capability_t vsf_eth_capability_t
Predefined VSF ETH capability that can be reimplemented in specific hal drivers. The vsf_eth_capabili...
vsf_err_t vsf_eth_phy_read_reg(vsf_eth_t *eth_ptr, uint16_t reg_addr, uint32_t *value_ptr)
Read a PHY register.
vsf_err_t vsf_eth_phy_get_link_status(vsf_eth_t *eth_ptr, vsf_eth_phy_mode_t *phy_mode_ptr)
Get the current link status of the PHY.
vsf_eth_buf_desc_t vsf_eth_recv_sg_buf_desc_t
Definition vsf_template_eth.h:664
void vsf_eth_isr_handler_t(void *target_ptr, vsf_eth_t *eth_ptr, vsf_eth_irq_mask_t irq_mask)
ETH interrupt handler type declaration.
Definition vsf_template_eth.h:536
void vsf_eth_isr_enable(vsf_eth_t *eth_ptr, vsf_eth_irq_mask_t isr_mask)
Enable ETH instance interrupt.
struct vsf_eth_isr_t vsf_eth_isr_t
ETH interrupt configuration structure.
vsf_eth_status_t vsf_eth_status(vsf_eth_t *eth_ptr)
Get the status of ETH instance.
Definition eth_common.c:137