EMAC (Ethernet MAC) driver for SAM.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | emac_device |
EMAC driver structure. More... | |
struct | emac_options |
Input parameters when initializing the emac module mode. More... | |
union | emac_rx_descriptor::emac_rx_addr |
struct | emac_rx_descriptor::emac_rx_addr::emac_rx_addr_bm |
struct | emac_rx_descriptor |
Receive buffer descriptor struct. More... | |
union | emac_rx_descriptor::emac_rx_status |
struct | emac_rx_descriptor::emac_rx_status::emac_rx_status_bm |
struct | emac_tx_descriptor |
Transmit buffer descriptor struct. More... | |
union | emac_tx_descriptor::emac_tx_status |
struct | emac_tx_descriptor::emac_tx_status::emac_tx_status_bm |
Macros | |
#define | EMAC_ADDR_LENGTH (6) |
EMAC address length. More... | |
#define | EMAC_CLOCK_SPEED_160MHZ (160*1000*1000) |
EMAC clock speed. More... | |
#define | EMAC_CLOCK_SPEED_20MHZ (20*1000*1000) |
#define | EMAC_CLOCK_SPEED_40MHZ (40*1000*1000) |
#define | EMAC_CLOCK_SPEED_80MHZ (80*1000*1000) |
#define | EMAC_FRAME_LENTGH_MAX 1536 |
The MAC can support frame lengths up to 1536 bytes. More... | |
#define | EMAC_MAN_CODE_VALUE (10) |
EMAC maintain code default value. More... | |
#define | EMAC_MAN_READ_ONLY (1) |
EMAC maintain read only. More... | |
#define | EMAC_MAN_RW_TYPE (2) |
EMAC maintain read/write. More... | |
#define | EMAC_MAN_SOF_VALUE (1) |
EMAC maintain start of frame default value. More... | |
#define | EMAC_RX_UNITSIZE 128 |
Fixed size for RX buffer. More... | |
#define | EMAC_RXD_ADDR1 (1ul << 26) |
Address 1 match. More... | |
#define | EMAC_RXD_ADDR2 (1ul << 25) |
Address 2 match. More... | |
#define | EMAC_RXD_ADDR3 (1ul << 24) |
Address 3 match. More... | |
#define | EMAC_RXD_ADDR4 (1ul << 23) |
Address 4 match. More... | |
#define | EMAC_RXD_ADDR_MASK 0xFFFFFFFC |
The buffer addresses written into the descriptors must be aligned, so the last few bits are zero. More... | |
#define | EMAC_RXD_BROADCAST (1ul << 31) |
Broadcast detected. More... | |
#define | EMAC_RXD_CFI (1ul << 16) |
Concatenation Format Indicator only if bit 21 is set. More... | |
#define | EMAC_RXD_EOF (1ul << 15) |
End of frame. More... | |
#define | EMAC_RXD_EXTADDR (1ul << 28) |
External address match. More... | |
#define | EMAC_RXD_LEN_MASK (0xFFF) |
Length of frame including FCS (if selected) More... | |
#define | EMAC_RXD_LENJUMBO_MASK (0x3FFF) |
Jumbo frame length. More... | |
#define | EMAC_RXD_MULTIHASH (1ul << 30) |
Multicast hash match. More... | |
#define | EMAC_RXD_OFFSET_MASK |
Receive buffer offset. More... | |
#define | EMAC_RXD_OWNERSHIP (1ul << 0) |
Ownership bit. More... | |
#define | EMAC_RXD_PRIORITY (1ul << 20) |
Priority tag detected. More... | |
#define | EMAC_RXD_PRIORITY_MASK (3ul << 17) |
VLAN priority. More... | |
#define | EMAC_RXD_SOF (1ul << 14) |
Start of frame. More... | |
#define | EMAC_RXD_TYPE (1ul << 22) |
Type ID match. More... | |
#define | EMAC_RXD_UNIHASH (1ul << 29) |
Unicast hash match. More... | |
#define | EMAC_RXD_VLAN (1ul << 21) |
VLAN tag detected. More... | |
#define | EMAC_RXD_WRAP (1ul << 1) |
Wrap bit. More... | |
#define | EMAC_TX_UNITSIZE 1518 |
Size for ETH frame length. More... | |
#define | EMAC_TXD_ERROR (1ul << 29) |
Retry limit exceeded, error. More... | |
#define | EMAC_TXD_EXHAUSTED (1ul << 27) |
Buffer exhausted. More... | |
#define | EMAC_TXD_LAST (1ul << 15) |
Last buffer in frame. More... | |
#define | EMAC_TXD_LEN_MASK (0x7FF) |
Length of buffer. More... | |
#define | EMAC_TXD_NOCRC (1ul << 16) |
No CRC. More... | |
#define | EMAC_TXD_UNDERRUN (1ul << 28) |
Transmit underrun. More... | |
#define | EMAC_TXD_USED (1ul << 31) |
Frame is transmitted. More... | |
#define | EMAC_TXD_WRAP (1ul << 30) |
Last descriptor. More... | |
Typedefs | |
typedef void(* | emac_dev_tx_cb_t )(uint32_t ul_status) |
RX callback. More... | |
typedef void(* | emac_dev_wakeup_cb_t )(void) |
Wakeup callback. More... | |
typedef struct emac_device | emac_device_t |
EMAC driver structure. More... | |
typedef struct emac_options | emac_options_t |
Input parameters when initializing the emac module mode. More... | |
typedef struct emac_rx_descriptor | emac_rx_descriptor_t |
Receive buffer descriptor struct. More... | |
typedef struct emac_tx_descriptor | emac_tx_descriptor_t |
Transmit buffer descriptor struct. More... | |
Enumerations | |
enum | emac_status_t { EMAC_OK = 0, EMAC_TIMEOUT = 1, EMAC_TX_BUSY, EMAC_RX_NULL, EMAC_SIZE_TOO_SMALL, EMAC_PARAM, EMAC_INVALID = 0xFF } |
Return codes for EMAC APIs. More... | |
Functions | |
static void | emac_clear_rx_status (Emac *p_emac, uint32_t ul_status) |
Clear receive status. More... | |
static void | emac_clear_statistics (Emac *p_emac) |
Clear all statistics registers. More... | |
static void | emac_clear_tx_status (Emac *p_emac, uint32_t ul_status) |
Clear transmit status. More... | |
uint32_t | emac_dev_get_tx_load (emac_device_t *p_emac_dev) |
Get current load of transmit. More... | |
void | emac_dev_init (Emac *p_emac, emac_device_t *p_emac_dev, emac_options_t *p_opt) |
Initialize the EMAC driver. More... | |
uint32_t | emac_dev_read (emac_device_t *p_emac_dev, uint8_t *p_frame, uint32_t ul_frame_size, uint32_t *p_rcv_size) |
Frames can be read from the EMAC in multiple sections. More... | |
void | emac_dev_reset (emac_device_t *p_emac_dev) |
Reset TX & RX queue & statistics. More... | |
void | emac_dev_set_rx_callback (emac_device_t *p_emac_dev, emac_dev_tx_cb_t func_rx_cb) |
Register/Clear RX callback. More... | |
uint8_t | emac_dev_set_tx_wakeup_callback (emac_device_t *p_emac_dev, emac_dev_wakeup_cb_t func_wakeup, uint8_t uc_threshold) |
Register/Clear TX wakeup callback. More... | |
uint32_t | emac_dev_write (emac_device_t *p_emac_dev, void *p_buffer, uint32_t ul_size, emac_dev_tx_cb_t func_tx_cb) |
Send ulLength bytes from pcFrom. More... | |
static void | emac_disable_broadcast (Emac *p_emac, uint8_t uc_enable) |
Disable/Enable broadcast receiving. More... | |
static void | emac_disable_interrupt (Emac *p_emac, uint32_t ul_source) |
Disable interrupt(s). More... | |
static void | emac_enable_back_pressure (Emac *p_emac, uint8_t uc_enable) |
In half-duplex mode, forces collisions on all received frames. More... | |
static void | emac_enable_big_frame (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable big frames (over 1518, up to 1536). More... | |
static void | emac_enable_copy_all (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable Copy(Receive) All Valid Frames. More... | |
static void | emac_enable_discard_fcs (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable discarding FCS field of received frames. More... | |
static void | emac_enable_efrhd (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable frames to be received in half-duplex mode while transmitting. More... | |
static void | emac_enable_full_duplex (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable Full-Duplex mode. More... | |
static void | emac_enable_ignore_rx_fcs (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable ignore RX FCS. More... | |
static void | emac_enable_interrupt (Emac *p_emac, uint32_t ul_source) |
Enable interrupt(s). More... | |
static void | emac_enable_jumbo_frames (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable jumbo frames (up to 10240 bytes). More... | |
static void | emac_enable_management (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable EMAC management. More... | |
static void | emac_enable_multicast_hash (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable multicast hash. More... | |
static void | emac_enable_pause_frame (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable pause (when a valid pause frame is received). More... | |
static void | emac_enable_receive (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable EMAC receive. More... | |
static void | emac_enable_retry_test (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable retry test. More... | |
static void | emac_enable_rmii (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable RMII. More... | |
static void | emac_enable_rx_length_check (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable receive length field checking. More... | |
static void | emac_enable_statistics_write (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable statistics registers writing. More... | |
static void | emac_enable_transceiver_clock (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable transceiver input clock. More... | |
static void | emac_enable_transmit (Emac *p_emac, uint8_t uc_enable) |
Enable/Disable EMAC transmit. More... | |
static uint32_t | emac_get_configure (Emac *p_emac) |
Get network configuration. More... | |
static uint32_t | emac_get_interrupt_mask (Emac *p_emac) |
Return interrupt mask. More... | |
static uint32_t | emac_get_interrupt_status (Emac *p_emac) |
Return interrupt status. More... | |
static uint8_t | emac_get_MDIO (Emac *p_emac) |
Get MDIO IN pin status. More... | |
static uint32_t | emac_get_network_control (Emac *p_emac) |
Get network control value. More... | |
static uint16_t | emac_get_phy_data (Emac *p_emac) |
Get PHY maintenance data returned. More... | |
static uint32_t | emac_get_rx_queue (Emac *p_emac) |
Get Rx Queue Address. More... | |
static uint32_t | emac_get_rx_status (Emac *p_emac) |
Return receive status. More... | |
static uint32_t | emac_get_status (Emac *p_emac) |
Get Network Status. More... | |
static uint32_t | emac_get_tx_queue (Emac *p_emac) |
Get Tx Queue. More... | |
static uint32_t | emac_get_tx_status (Emac *p_emac) |
Return transmit status. More... | |
static uint16_t | emac_get_type_id (Emac *p_emac) |
Get type ID. More... | |
static void | emac_halt_transmission (Emac *p_emac) |
Halt transmission. More... | |
void | emac_handler (emac_device_t *p_emac_dev) |
EMAC Interrupt handler. More... | |
static void | emac_increase_statistics (Emac *p_emac) |
Increase all statistics registers. More... | |
static uint8_t | emac_is_phy_idle (Emac *p_emac) |
Check if PHY is idle. More... | |
static void | emac_maintain_phy (Emac *p_emac, uint8_t uc_phy_addr, uint8_t uc_reg_addr, uint8_t uc_rw, uint16_t us_data) |
Execute PHY maintenance command. More... | |
static void | emac_network_control (Emac *p_emac, uint32_t ul_ncr) |
Write network control value. More... | |
uint8_t | emac_phy_read (Emac *p_emac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t *p_value) |
Read the PHY register. More... | |
uint8_t | emac_phy_write (Emac *p_emac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t ul_value) |
Write the PHY register. More... | |
static void | emac_set_address (Emac *p_emac, uint8_t uc_index, uint8_t *p_mac_addr) |
Set MAC Address. More... | |
static void | emac_set_address32 (Emac *p_emac, uint8_t uc_index, uint32_t ul_mac_top, uint32_t ul_mac_bottom) |
Set MAC Address via 2 dword. More... | |
static void | emac_set_address64 (Emac *p_emac, uint8_t uc_index, uint64_t ull_mac) |
Set MAC Address via int64. More... | |
static uint8_t | emac_set_clock (Emac *p_emac, uint32_t ul_mck) |
Set MDC clock divider. More... | |
static void | emac_set_configure (Emac *p_emac, uint32_t ul_cfg) |
Set up network configuration register. More... | |
static void | emac_set_hash (Emac *p_emac, uint32_t ul_hash_top, uint32_t ul_hash_bottom) |
Set Hash. More... | |
static void | emac_set_hash64 (Emac *p_emac, uint64_t ull_hash) |
Set 64 bits Hash. More... | |
static void | emac_set_pause_time (Emac *p_emac, uint16_t us_pause_time) |
Set pause time. More... | |
static void | emac_set_rx_buffer_offset (Emac *p_emac, uint8_t uc_offset) |
Set receive buffer offset to 0 ~ 3. More... | |
static void | emac_set_rx_queue (Emac *p_emac, uint32_t ul_addr) |
Set Rx Queue. More... | |
static void | emac_set_speed (Emac *p_emac, uint8_t uc_speed) |
Set speed. More... | |
static void | emac_set_tx_queue (Emac *p_emac, uint32_t ul_addr) |
Set Tx Queue. More... | |
static void | emac_set_type_id (Emac *p_emac, uint16_t us_type_id) |
Set type ID. More... | |
static void | emac_start_transmission (Emac *p_emac) |
Start transmission. More... | |
#define EMAC_ADDR_LENGTH (6) |
EMAC address length.
#define EMAC_CLOCK_SPEED_160MHZ (160*1000*1000) |
EMAC clock speed.
Referenced by emac_set_clock().
#define EMAC_CLOCK_SPEED_20MHZ (20*1000*1000) |
Referenced by emac_set_clock().
#define EMAC_CLOCK_SPEED_40MHZ (40*1000*1000) |
Referenced by emac_set_clock().
#define EMAC_CLOCK_SPEED_80MHZ (80*1000*1000) |
Referenced by emac_set_clock().
#define EMAC_FRAME_LENTGH_MAX 1536 |
The MAC can support frame lengths up to 1536 bytes.
#define EMAC_MAN_CODE_VALUE (10) |
EMAC maintain code default value.
Referenced by emac_maintain_phy().
#define EMAC_MAN_READ_ONLY (1) |
EMAC maintain read only.
Referenced by emac_maintain_phy().
#define EMAC_MAN_RW_TYPE (2) |
EMAC maintain read/write.
Referenced by emac_maintain_phy().
#define EMAC_MAN_SOF_VALUE (1) |
EMAC maintain start of frame default value.
Referenced by emac_maintain_phy().
#define EMAC_RX_UNITSIZE 128 |
Fixed size for RX buffer.
Referenced by emac_dev_read(), and emac_reset_rx_mem().
#define EMAC_RXD_ADDR1 (1ul << 26) |
Address 1 match.
#define EMAC_RXD_ADDR2 (1ul << 25) |
Address 2 match.
#define EMAC_RXD_ADDR3 (1ul << 24) |
Address 3 match.
#define EMAC_RXD_ADDR4 (1ul << 23) |
Address 4 match.
#define EMAC_RXD_ADDR_MASK 0xFFFFFFFC |
The buffer addresses written into the descriptors must be aligned, so the last few bits are zero.
These bits have special meaning for the EMAC peripheral and cannot be used as part of the address.
Referenced by emac_dev_read(), and emac_reset_rx_mem().
#define EMAC_RXD_BROADCAST (1ul << 31) |
Broadcast detected.
#define EMAC_RXD_CFI (1ul << 16) |
Concatenation Format Indicator only if bit 21 is set.
#define EMAC_RXD_EOF (1ul << 15) |
End of frame.
Referenced by emac_dev_read().
#define EMAC_RXD_EXTADDR (1ul << 28) |
External address match.
#define EMAC_RXD_LEN_MASK (0xFFF) |
Length of frame including FCS (if selected)
Referenced by emac_dev_read().
#define EMAC_RXD_LENJUMBO_MASK (0x3FFF) |
Jumbo frame length.
#define EMAC_RXD_MULTIHASH (1ul << 30) |
Multicast hash match.
#define EMAC_RXD_OFFSET_MASK |
Receive buffer offset.
#define EMAC_RXD_OWNERSHIP (1ul << 0) |
Ownership bit.
Referenced by emac_dev_read().
#define EMAC_RXD_PRIORITY (1ul << 20) |
Priority tag detected.
#define EMAC_RXD_PRIORITY_MASK (3ul << 17) |
VLAN priority.
#define EMAC_RXD_SOF (1ul << 14) |
Start of frame.
Referenced by emac_dev_read().
#define EMAC_RXD_TYPE (1ul << 22) |
Type ID match.
#define EMAC_RXD_UNIHASH (1ul << 29) |
Unicast hash match.
#define EMAC_RXD_VLAN (1ul << 21) |
VLAN tag detected.
#define EMAC_RXD_WRAP (1ul << 1) |
Wrap bit.
Referenced by emac_reset_rx_mem().
#define EMAC_TX_UNITSIZE 1518 |
Size for ETH frame length.
Referenced by emac_dev_write(), and emac_reset_tx_mem().
#define EMAC_TXD_ERROR (1ul << 29) |
Retry limit exceeded, error.
#define EMAC_TXD_EXHAUSTED (1ul << 27) |
Buffer exhausted.
#define EMAC_TXD_LAST (1ul << 15) |
Last buffer in frame.
Referenced by emac_dev_write().
#define EMAC_TXD_LEN_MASK (0x7FF) |
Length of buffer.
Referenced by emac_dev_write().
#define EMAC_TXD_NOCRC (1ul << 16) |
No CRC.
#define EMAC_TXD_UNDERRUN (1ul << 28) |
Transmit underrun.
#define EMAC_TXD_USED (1ul << 31) |
Frame is transmitted.
Referenced by emac_handler(), and emac_reset_tx_mem().
#define EMAC_TXD_WRAP (1ul << 30) |
Last descriptor.
Referenced by emac_dev_write(), and emac_reset_tx_mem().
typedef void(* emac_dev_tx_cb_t)(uint32_t ul_status) |
RX callback.
typedef void(* emac_dev_wakeup_cb_t)(void) |
Wakeup callback.
typedef struct emac_device emac_device_t |
EMAC driver structure.
typedef struct emac_options emac_options_t |
Input parameters when initializing the emac module mode.
typedef struct emac_rx_descriptor emac_rx_descriptor_t |
Receive buffer descriptor struct.
typedef struct emac_tx_descriptor emac_tx_descriptor_t |
Transmit buffer descriptor struct.
enum emac_status_t |
|
inlinestatic |
Clear receive status.
p_emac | Pointer to the EMAC instance. |
ul_status | Receive status. |
Referenced by emac_dev_init(), and emac_handler().
|
inlinestatic |
Clear all statistics registers.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_dev_init().
|
inlinestatic |
Clear transmit status.
p_emac | Pointer to the EMAC instance. |
ul_status | Transmit status. |
Referenced by emac_dev_init(), and emac_handler().
|
inlinestatic |
Disable/Enable broadcast receiving.
p_emac | Pointer to the EMAC instance. |
uc_enable | 1 to disable the broadcast, else to enable it. |
Referenced by emac_dev_init().
|
inlinestatic |
Disable interrupt(s).
p_emac | Pointer to the EMAC instance. |
ul_source | Interrupt source(s) to be disabled. |
Referenced by emac_dev_init(), and emac_dev_set_rx_callback().
|
inlinestatic |
In half-duplex mode, forces collisions on all received frames.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the back pressure, else to enable it. |
|
inlinestatic |
Enable/Disable big frames (over 1518, up to 1536).
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable big frames else to enable it. |
|
inlinestatic |
Enable/Disable Copy(Receive) All Valid Frames.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable copying all valid frames, else to enable it. |
Referenced by emac_dev_init().
|
inlinestatic |
Enable/Disable discarding FCS field of received frames.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable discarding FCS field of received frames, else to enable it. |
|
inlinestatic |
Enable/Disable frames to be received in half-duplex mode while transmitting.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the received in half-duplex mode, else to enable it. |
|
inlinestatic |
Enable/Disable Full-Duplex mode.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the Full-Duplex mode, else to enable it. |
Referenced by ethernet_phy_auto_negotiate(), and ethernet_phy_set_link().
|
inlinestatic |
Enable/Disable ignore RX FCS.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable ignore RX FCS, else to enable it. |
|
inlinestatic |
Enable interrupt(s).
p_emac | Pointer to the EMAC instance. |
ul_source | Interrupt source(s) to be enabled. |
Referenced by emac_dev_set_rx_callback(), and emac_init_mem().
|
inlinestatic |
Enable/Disable jumbo frames (up to 10240 bytes).
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the jumbo frames, else to enable it. |
|
inlinestatic |
Enable/Disable EMAC management.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable EMAC management, else to enable it. |
Referenced by ethernet_phy_auto_negotiate(), ethernet_phy_find_valid(), ethernet_phy_reset(), and ethernet_phy_set_link().
|
inlinestatic |
Enable/Disable multicast hash.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the multicast hash, else to enable it. |
|
inlinestatic |
Enable/Disable pause (when a valid pause frame is received).
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable pause frame, else to enable it. |
|
inlinestatic |
Enable/Disable EMAC receive.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable EMAC receiver, else to enable it. |
Referenced by emac_init_mem(), and emac_reset_rx_mem().
|
inlinestatic |
Enable/Disable retry test.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the EMAC receiver, else to enable it. |
|
inlinestatic |
Enable/Disable RMII.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the RMII mode, else to enable it. |
Referenced by ethernet_phy_auto_negotiate().
|
inlinestatic |
Enable/Disable receive length field checking.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable receive length field checking, else to enable it. |
|
inlinestatic |
Enable/Disable statistics registers writing.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable the statistics registers writing, else to enable it. |
Referenced by emac_init_mem().
|
inlinestatic |
Enable/Disable transceiver input clock.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable transceiver input clock, else to enable it. |
Referenced by ethernet_phy_auto_negotiate().
|
inlinestatic |
Enable/Disable EMAC transmit.
p_emac | Pointer to the EMAC instance. |
uc_enable | 0 to disable EMAC transmit, else to enable it. |
Referenced by emac_handler(), emac_init_mem(), and emac_reset_tx_mem().
|
inlinestatic |
Get network configuration.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_dev_init().
|
inlinestatic |
Return interrupt mask.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_handler().
|
inlinestatic |
Return interrupt status.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_dev_init(), and emac_handler().
|
inlinestatic |
Get MDIO IN pin status.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Get network control value.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Get PHY maintenance data returned.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_phy_read().
|
inlinestatic |
Get Rx Queue Address.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
|
inlinestatic |
Get Network Status.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Get Tx Queue.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Return transmit status.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_handler().
|
inlinestatic |
Get type ID.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Halt transmission.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Increase all statistics registers.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Check if PHY is idle.
p_emac | Pointer to the EMAC instance. |
Referenced by emac_wait_phy().
|
inlinestatic |
Execute PHY maintenance command.
p_emac | Pointer to the EMAC instance. |
uc_phy_addr | PHY address. |
uc_reg_addr | Register address. |
uc_rw | 1 to Read, 0 to write. |
us_data | Data to be performed, write only. |
References EMAC_MAN_CODE_VALUE, EMAC_MAN_READ_ONLY, EMAC_MAN_RW_TYPE, and EMAC_MAN_SOF_VALUE.
Referenced by emac_phy_read(), and emac_phy_write().
|
inlinestatic |
Write network control value.
p_emac | Pointer to the EMAC instance. |
ul_ncr | Network control value. |
Referenced by emac_dev_init(), and emac_dev_reset().
|
inlinestatic |
Set MAC Address.
p_emac | Pointer to the EMAC instance. |
uc_index | EMAC specific address register index. |
p_mac_addr | EMAC address. |
Referenced by emac_dev_init().
|
inlinestatic |
Set MAC Address via 2 dword.
p_emac | Pointer to the EMAC instance. |
uc_index | EMAC specific address register index. |
ul_mac_top | EMAC top address. |
ul_mac_bottom | EMAC bottom address. |
|
inlinestatic |
Set MAC Address via int64.
p_emac | Pointer to the EMAC instance. |
uc_index | EMAC specific address register index. |
ull_mac | 64-bit EMAC address. |
|
inlinestatic |
Set MDC clock divider.
p_emac | Pointer to the EMAC instance. |
ul_mck | EMAC MCK. |
References EMAC_CLOCK_SPEED_160MHZ, EMAC_CLOCK_SPEED_20MHZ, EMAC_CLOCK_SPEED_40MHZ, EMAC_CLOCK_SPEED_80MHZ, EMAC_INVALID, and EMAC_OK.
Referenced by ethernet_phy_init().
|
inlinestatic |
Set up network configuration register.
p_emac | Pointer to the EMAC instance. |
ul_cfg | Network configuration value. |
Referenced by emac_dev_init().
|
inlinestatic |
Set Hash.
p_emac | Pointer to the EMAC instance. |
ul_hash_top | Hash top. |
ul_hash_bottom | Hash bottom. |
|
inlinestatic |
Set 64 bits Hash.
p_emac | Pointer to the EMAC instance. |
ull_hash | 64 bits hash value. |
|
inlinestatic |
Set pause time.
p_emac | Pointer to the EMAC instance. |
us_pause_time | Pause time. |
|
inlinestatic |
Set receive buffer offset to 0 ~ 3.
p_emac | Pointer to the EMAC instance. |
|
inlinestatic |
Set Rx Queue.
p_emac | Pointer to the EMAC instance. |
ul_addr | Rx queue address. |
Referenced by emac_reset_rx_mem().
|
inlinestatic |
Set speed.
p_emac | Pointer to the EMAC instance. |
uc_speed | 1 to indicate 100Mbps, 0 to 10Mbps. |
Referenced by ethernet_phy_auto_negotiate(), and ethernet_phy_set_link().
|
inlinestatic |
Set Tx Queue.
p_emac | Pointer to the EMAC instance. |
ul_addr | Tx queue address. |
Referenced by emac_reset_tx_mem().
|
inlinestatic |
Set type ID.
p_emac | Pointer to the EMAC instance. |
us_type_id | Type to be set. |
|
inlinestatic |