GMAC (Ethernet MAC) driver for SAM.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
Data Structures | |
union | gmac_rx_descriptor::gmac_rx_addr |
struct | gmac_rx_descriptor::gmac_rx_addr::gmac_rx_addr_bm |
struct | gmac_rx_descriptor |
Receive buffer descriptor struct. More... | |
union | gmac_rx_descriptor::gmac_rx_status |
struct | gmac_rx_descriptor::gmac_rx_status::gmac_rx_status_bm |
struct | gmac_tx_descriptor |
Transmit buffer descriptor struct. More... | |
union | gmac_tx_descriptor::gmac_tx_status |
struct | gmac_tx_descriptor::gmac_tx_status::gmac_tx_status_bm |
Macros | |
#define | GMAC_ADDR_LENGTH 6 |
GMAC address length. More... | |
#define | GMAC_DUPLEX_FULL 1 |
#define | GMAC_DUPLEX_HALF 0 |
#define | GMAC_FRAME_LENTGH_MAX 1536 |
The MAC can support frame lengths up to 1536 bytes. More... | |
#define | GMAC_MAN_CODE_VALUE 10 |
GMAC maintain code default value. More... | |
#define | GMAC_MAN_READ_ONLY 1 |
GMAC maintain read only. More... | |
#define | GMAC_MAN_RW_TYPE 2 |
GMAC maintain read/write. More... | |
#define | GMAC_MAN_SOF_VALUE 1 |
GMAC maintain start of frame default value. More... | |
#define | GMAC_MCK_SPEED_120MHZ (120*1000*1000) |
#define | GMAC_MCK_SPEED_160MHZ (160*1000*1000) |
#define | GMAC_MCK_SPEED_20MHZ (20*1000*1000) |
#define | GMAC_MCK_SPEED_240MHZ (240*1000*1000) |
GMAC clock speed. More... | |
#define | GMAC_MCK_SPEED_40MHZ (40*1000*1000) |
#define | GMAC_MCK_SPEED_80MHZ (80*1000*1000) |
#define | GMAC_RX_UNITSIZE 128 |
Fixed size for RX buffer. More... | |
#define | GMAC_RXD_ADDR (3ul << 25) |
Address match. More... | |
#define | GMAC_RXD_ADDR_FOUND (1ul << 27) |
Specific address match found. More... | |
#define | GMAC_RXD_ADDR_MASK 0xFFFFFFFC |
The buffer addresses written into the descriptors must be aligned, so the last few bits are zero. More... | |
#define | GMAC_RXD_BROADCAST (1ul << 31) |
Broadcast detected. More... | |
#define | GMAC_RXD_CFI (1ul << 16) |
Concatenation Format Indicator only if bit 21 is set. More... | |
#define | GMAC_RXD_EOF (1ul << 15) |
End of frame. More... | |
#define | GMAC_RXD_FCS (1ul << 13) |
Frame check sequence. More... | |
#define | GMAC_RXD_LEN_MASK (0xFFF) |
Length of frame including FCS (if selected) More... | |
#define | GMAC_RXD_LENJUMBO_MASK (0x3FFF) |
Jumbo frame length. More... | |
#define | GMAC_RXD_MULTIHASH (1ul << 30) |
Multicast hash match. More... | |
#define | GMAC_RXD_OFFSET_MASK |
Receive buffer offset. More... | |
#define | GMAC_RXD_OWNERSHIP (1ul << 0) |
Ownership bit. More... | |
#define | GMAC_RXD_PRIORITY (1ul << 20) |
Priority tag detected. More... | |
#define | GMAC_RXD_PRIORITY_MASK (3ul << 17) |
VLAN priority. More... | |
#define | GMAC_RXD_RXCOEN (1ul << 24) |
RXCOEN related function. More... | |
#define | GMAC_RXD_SOF (1ul << 14) |
Start of frame. More... | |
#define | GMAC_RXD_TYPE (3ul << 22) |
Type ID match. More... | |
#define | GMAC_RXD_UNIHASH (1ul << 29) |
Unicast hash match. More... | |
#define | GMAC_RXD_VLAN (1ul << 21) |
VLAN tag detected. More... | |
#define | GMAC_RXD_WRAP (1ul << 1) |
Wrap bit. More... | |
#define | GMAC_SPEED_100M 1 |
#define | GMAC_SPEED_10M 0 |
#define | GMAC_TX_UNITSIZE 1518 |
Size for ETH frame length. More... | |
#define | GMAC_TXD_CHECKSUM_ERROR (7ul << 20) |
Checksum error. More... | |
#define | GMAC_TXD_ERROR (1ul << 29) |
Retry limit exceeded, error. More... | |
#define | GMAC_TXD_EXHAUSTED (1ul << 27) |
Buffer exhausted. More... | |
#define | GMAC_TXD_LAST (1ul << 15) |
Last buffer in frame. More... | |
#define | GMAC_TXD_LATE (1ul << 26) |
Late collision,transmit error. More... | |
#define | GMAC_TXD_LEN_MASK (0x1FFF) |
Length of buffer. More... | |
#define | GMAC_TXD_NOCRC (1ul << 16) |
No CRC. More... | |
#define | GMAC_TXD_UNDERRUN (1ul << 28) |
Transmit underrun. More... | |
#define | GMAC_TXD_USED (1ul << 31) |
Frame is transmitted. More... | |
#define | GMAC_TXD_WRAP (1ul << 30) |
Last descriptor. More... | |
Typedefs | |
typedef struct gmac_rx_descriptor | gmac_rx_descriptor_t |
Receive buffer descriptor struct. More... | |
typedef struct gmac_tx_descriptor | gmac_tx_descriptor_t |
Transmit buffer descriptor struct. More... | |
Enumerations | |
enum | gmac_mii_mode_t { GMAC_PHY_MII = 0, GMAC_PHY_RMII = 1, GMAC_PHY_INVALID = 0xFF } |
Media Independent Interface (MII) type. More... | |
enum | gmac_quelist_t { GMAC_QUE_0 = 0, GMAC_QUE_1 = 1, GMAC_QUE_2 = 2, GMAC_QUE_3 = 3, GMAC_QUE_4 = 4, GMAC_QUE_5 = 5 } |
enum | gmac_status_t { GMAC_OK = 0, GMAC_TIMEOUT = 1, GMAC_TX_BUSY, GMAC_RX_ERROR, GMAC_RX_NO_DATA, GMAC_SIZE_TOO_SMALL, GMAC_PARAM, GMAC_INVALID = 0xFF } |
Return codes for GMAC APIs. More... | |
Functions | |
static void | gmac_clear_rx_status (Gmac *p_gmac, uint32_t ul_status) |
Clear receive status. More... | |
static void | gmac_clear_statistics (Gmac *p_gmac) |
Clear all statistics registers. More... | |
static void | gmac_clear_tx_status (Gmac *p_gmac, uint32_t ul_status) |
Clear transmit status. More... | |
static void | gmac_disable_broadcast (Gmac *p_gmac, uint8_t uc_enable) |
Disable/Enable broadcast receiving. More... | |
static void | gmac_disable_interrupt (Gmac *p_gmac, uint32_t ul_source) |
Disable interrupt(s). More... | |
static void | gmac_enable_back_pressure (Gmac *p_gmac, uint8_t uc_enable) |
In half-duplex mode, forces collisions on all received frames. More... | |
static void | gmac_enable_big_frame (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable big frames (over 1518, up to 1536). More... | |
static void | gmac_enable_copy_all (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable Copy(Receive) All Valid Frames. More... | |
static void | gmac_enable_discard_fcs (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable discarding FCS field of received frames. More... | |
static void | gmac_enable_efrhd (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable frames to be received in half-duplex mode while transmitting. More... | |
static void | gmac_enable_full_duplex (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable Full-Duplex mode. More... | |
static void | gmac_enable_ignore_rx_fcs (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable ignore RX FCS. More... | |
static void | gmac_enable_interrupt (Gmac *p_gmac, uint32_t ul_source) |
Enable interrupt(s). More... | |
static void | gmac_enable_jumbo_frames (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable jumbo frames (up to 10240 bytes). More... | |
static void | gmac_enable_management (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable GMAC management. More... | |
static void | gmac_enable_multicast_hash (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable multicast hash. More... | |
static void | gmac_enable_pause_frame (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable pause (when a valid pause frame is received). More... | |
static void | gmac_enable_pfc_pause_frame (Gmac *p_gmac, uint8_t uc_enable) |
Enable PFC priority-based pause reception. More... | |
static void | gmac_enable_receive (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable GMAC receive. More... | |
static void | gmac_enable_retry_test (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable retry test. More... | |
static void | gmac_enable_rx_length_check (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable receive length field checking. More... | |
static void | gmac_enable_statistics_write (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable statistics registers writing. More... | |
static void | gmac_enable_transmit (Gmac *p_gmac, uint8_t uc_enable) |
Enable/Disable GMAC transmit. More... | |
static void | gmac_flush_next_packet (Gmac *p_gmac) |
Flush next packet. More... | |
static uint32_t | gmac_get_config (Gmac *p_gmac) |
Get network configuration. More... | |
static uint32_t | gmac_get_interrupt_mask (Gmac *p_gmac) |
Return interrupt mask. More... | |
static uint32_t | gmac_get_interrupt_status (Gmac *p_gmac) |
Return interrupt status. More... | |
static uint8_t | gmac_get_MDIO (Gmac *p_gmac) |
Get MDIO IN pin status. More... | |
static uint32_t | gmac_get_network_control (Gmac *p_gmac) |
Get network control value. More... | |
static uint16_t | gmac_get_phy_data (Gmac *p_gmac) |
Get PHY maintenance data returned. More... | |
static uint32_t | gmac_get_rx_queue (Gmac *p_gmac) |
Get Rx Queue Address. More... | |
static uint32_t | gmac_get_rx_status (Gmac *p_gmac) |
Return receive status. More... | |
static uint32_t | gmac_get_status (Gmac *p_gmac) |
Get Network Status. More... | |
static uint32_t | gmac_get_tx_queue (Gmac *p_gmac) |
Get Tx Queue. More... | |
static uint32_t | gmac_get_tx_status (Gmac *p_gmac) |
Return transmit status. More... | |
static void | gmac_halt_transmission (Gmac *p_gmac) |
Halt transmission. More... | |
static void | gmac_increase_statistics (Gmac *p_gmac) |
Increase all statistics registers. More... | |
static uint8_t | gmac_is_phy_idle (Gmac *p_gmac) |
Check if PHY is idle. More... | |
static void | gmac_maintain_phy (Gmac *p_gmac, 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 | gmac_network_control (Gmac *p_gmac, uint32_t ul_ncr) |
Write network control value. More... | |
uint8_t | gmac_phy_read (Gmac *p_gmac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t *p_value) |
Read the PHY register. More... | |
uint8_t | gmac_phy_write (Gmac *p_gmac, uint8_t uc_phy_address, uint8_t uc_address, uint32_t ul_value) |
Write the PHY register. More... | |
static void | gmac_select_mii_mode (Gmac *p_gmac, gmac_mii_mode_t mode) |
Select media independent interface mode. More... | |
static void | gmac_set_address (Gmac *p_gmac, uint8_t uc_index, uint8_t *p_mac_addr) |
Set MAC Address. More... | |
static void | gmac_set_address32 (Gmac *p_gmac, uint8_t uc_index, uint32_t ul_mac_top, uint32_t ul_mac_bottom) |
Set MAC Address via 2 dword. More... | |
static void | gmac_set_address64 (Gmac *p_gmac, uint8_t uc_index, uint64_t ull_mac) |
Set MAC Address via int64. More... | |
static void | gmac_set_config (Gmac *p_gmac, uint32_t ul_cfg) |
Set up network configuration register. More... | |
static void | gmac_set_hash (Gmac *p_gmac, uint32_t ul_hash_top, uint32_t ul_hash_bottom) |
Set Hash. More... | |
static void | gmac_set_hash64 (Gmac *p_gmac, uint64_t ull_hash) |
Set 64 bits Hash. More... | |
static uint8_t | gmac_set_mdc_clock (Gmac *p_gmac, uint32_t ul_mck) |
Set MDC clock divider. More... | |
static void | gmac_set_rx_buffer_offset (Gmac *p_gmac, uint8_t uc_offset) |
Set receive buffer offset to 0 ~ 3. More... | |
static void | gmac_set_rx_bufsize (Gmac *p_gmac, uint32_t ul_code) |
Set Rx buffer size. More... | |
static void | gmac_set_rx_queue (Gmac *p_gmac, uint32_t ul_addr) |
Set Rx Queue. More... | |
static void | gmac_set_speed (Gmac *p_gmac, uint8_t uc_speed) |
Set speed. More... | |
static void | gmac_set_tx_queue (Gmac *p_gmac, uint32_t ul_addr) |
Set Tx Queue. More... | |
static void | gmac_start_transmission (Gmac *p_gmac) |
Start transmission. More... | |
static void | gmac_store_rx_time_stamp (Gmac *p_gmac, uint8_t uc_enable) |
Store receivetime stamp to memory. More... | |
static void | gmac_transmit_pfc_pause_frame (Gmac *p_gmac) |
Transmit PFC priority-based pause reception. More... | |
static void | gmac_tx_pause_frame (Gmac *p_gmac) |
Transmit pause frame. More... | |
static void | gmac_tx_pause_zero_quantum_frame (Gmac *p_gmac) |
Transmit zero quantum pause frame. More... | |
#define GMAC_ADDR_LENGTH 6 |
GMAC address length.
#define GMAC_DUPLEX_FULL 1 |
#define GMAC_DUPLEX_HALF 0 |
#define GMAC_FRAME_LENTGH_MAX 1536 |
The MAC can support frame lengths up to 1536 bytes.
#define GMAC_MAN_CODE_VALUE 10 |
GMAC maintain code default value.
Referenced by gmac_maintain_phy().
#define GMAC_MAN_READ_ONLY 1 |
GMAC maintain read only.
Referenced by gmac_maintain_phy().
#define GMAC_MAN_RW_TYPE 2 |
GMAC maintain read/write.
Referenced by gmac_maintain_phy().
#define GMAC_MAN_SOF_VALUE 1 |
GMAC maintain start of frame default value.
#define GMAC_MCK_SPEED_120MHZ (120*1000*1000) |
Referenced by gmac_set_mdc_clock().
#define GMAC_MCK_SPEED_160MHZ (160*1000*1000) |
Referenced by gmac_set_mdc_clock().
#define GMAC_MCK_SPEED_20MHZ (20*1000*1000) |
Referenced by gmac_set_mdc_clock().
#define GMAC_MCK_SPEED_240MHZ (240*1000*1000) |
GMAC clock speed.
Referenced by gmac_set_mdc_clock().
#define GMAC_MCK_SPEED_40MHZ (40*1000*1000) |
Referenced by gmac_set_mdc_clock().
#define GMAC_MCK_SPEED_80MHZ (80*1000*1000) |
Referenced by gmac_set_mdc_clock().
#define GMAC_RX_UNITSIZE 128 |
Fixed size for RX buffer.
Referenced by gmac_dev_read(), and gmac_reset_rx_mem().
#define GMAC_RXD_ADDR (3ul << 25) |
Address match.
#define GMAC_RXD_ADDR_FOUND (1ul << 27) |
Specific address match found.
#define GMAC_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 GMAC peripheral and cannot be used as part of the address.
Referenced by gmac_dev_read(), gmac_init_queue(), and gmac_reset_rx_mem().
#define GMAC_RXD_BROADCAST (1ul << 31) |
Broadcast detected.
#define GMAC_RXD_CFI (1ul << 16) |
Concatenation Format Indicator only if bit 21 is set.
#define GMAC_RXD_EOF (1ul << 15) |
End of frame.
Referenced by gmac_dev_read().
#define GMAC_RXD_FCS (1ul << 13) |
Frame check sequence.
#define GMAC_RXD_LEN_MASK (0xFFF) |
Length of frame including FCS (if selected)
Referenced by gmac_dev_read().
#define GMAC_RXD_LENJUMBO_MASK (0x3FFF) |
Jumbo frame length.
#define GMAC_RXD_MULTIHASH (1ul << 30) |
Multicast hash match.
#define GMAC_RXD_OFFSET_MASK |
Receive buffer offset.
#define GMAC_RXD_OWNERSHIP (1ul << 0) |
Ownership bit.
Referenced by gmac_dev_read(), and gmac_dev_rx_buf_used().
#define GMAC_RXD_PRIORITY (1ul << 20) |
Priority tag detected.
#define GMAC_RXD_PRIORITY_MASK (3ul << 17) |
VLAN priority.
#define GMAC_RXD_RXCOEN (1ul << 24) |
RXCOEN related function.
#define GMAC_RXD_SOF (1ul << 14) |
Start of frame.
Referenced by gmac_dev_read().
#define GMAC_RXD_TYPE (3ul << 22) |
Type ID match.
#define GMAC_RXD_UNIHASH (1ul << 29) |
Unicast hash match.
#define GMAC_RXD_VLAN (1ul << 21) |
VLAN tag detected.
#define GMAC_RXD_WRAP (1ul << 1) |
Wrap bit.
Referenced by gmac_init_queue(), and gmac_reset_rx_mem().
#define GMAC_SPEED_100M 1 |
#define GMAC_SPEED_10M 0 |
#define GMAC_TX_UNITSIZE 1518 |
Size for ETH frame length.
Referenced by gmac_dev_write(), gmac_dev_write_nocopy(), and gmac_reset_tx_mem().
#define GMAC_TXD_CHECKSUM_ERROR (7ul << 20) |
Checksum error.
#define GMAC_TXD_ERROR (1ul << 29) |
Retry limit exceeded, error.
#define GMAC_TXD_EXHAUSTED (1ul << 27) |
Buffer exhausted.
#define GMAC_TXD_LAST (1ul << 15) |
Last buffer in frame.
Referenced by gmac_dev_write(), and gmac_dev_write_nocopy().
#define GMAC_TXD_LATE (1ul << 26) |
Late collision,transmit error.
#define GMAC_TXD_LEN_MASK (0x1FFF) |
Length of buffer.
Referenced by gmac_dev_write(), and gmac_dev_write_nocopy().
#define GMAC_TXD_NOCRC (1ul << 16) |
No CRC.
#define GMAC_TXD_UNDERRUN (1ul << 28) |
Transmit underrun.
#define GMAC_TXD_USED (1ul << 31) |
Frame is transmitted.
Referenced by gmac_dev_get_tx_buffer(), gmac_dev_tx_buf_used(), gmac_dev_write(), gmac_handler(), gmac_init_queue(), and gmac_reset_tx_mem().
#define GMAC_TXD_WRAP (1ul << 30) |
Last descriptor.
Referenced by gmac_dev_write(), gmac_dev_write_nocopy(), gmac_init_queue(), and gmac_reset_tx_mem().
typedef struct gmac_rx_descriptor gmac_rx_descriptor_t |
Receive buffer descriptor struct.
typedef struct gmac_tx_descriptor gmac_tx_descriptor_t |
Transmit buffer descriptor struct.
enum gmac_mii_mode_t |
enum gmac_quelist_t |
enum gmac_status_t |
Return codes for GMAC APIs.
|
inlinestatic |
Clear receive status.
p_gmac | Pointer to the GMAC instance. |
ul_status | Receive status. |
Referenced by gmac_dev_init(), and gmac_handler().
|
inlinestatic |
Clear all statistics registers.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_dev_init().
|
inlinestatic |
Clear transmit status.
p_gmac | Pointer to the GMAC instance. |
ul_status | Transmit status. |
Referenced by gmac_dev_init(), and gmac_handler().
|
inlinestatic |
Disable/Enable broadcast receiving.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 1 to disable the broadcast, else to enable it. |
Referenced by gmac_dev_init().
|
inlinestatic |
Disable interrupt(s).
p_gmac | Pointer to the GMAC instance. |
ul_source | Interrupt source(s) to be disabled. |
Referenced by gmac_dev_init(), and gmac_dev_set_rx_callback().
|
inlinestatic |
In half-duplex mode, forces collisions on all received frames.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable the back pressure, else to enable it. |
|
inlinestatic |
Enable/Disable big frames (over 1518, up to 1536).
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable big frames else to enable it. |
|
inlinestatic |
Enable/Disable Copy(Receive) All Valid Frames.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable copying all valid frames, else to enable it. |
Referenced by gmac_dev_init().
|
inlinestatic |
Enable/Disable discarding FCS field of received frames.
p_gmac | Pointer to the GMAC 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_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable the received in half-duplex mode, else to enable it. |
|
inlinestatic |
Enable/Disable Full-Duplex mode.
p_gmac | Pointer to the GMAC 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_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable ignore RX FCS, else to enable it. |
|
inlinestatic |
Enable interrupt(s).
p_gmac | Pointer to the GMAC instance. |
ul_source | Interrupt source(s) to be enabled. |
Referenced by gmac_dev_set_rx_callback(), and gmac_init_queue().
|
inlinestatic |
Enable/Disable jumbo frames (up to 10240 bytes).
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable the jumbo frames, else to enable it. |
|
inlinestatic |
Enable/Disable GMAC management.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable GMAC 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_gmac | Pointer to the GMAC 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_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable pause frame, else to enable it. |
|
inlinestatic |
Enable PFC priority-based pause reception.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 1 to set the reception, 0 to disable. |
|
inlinestatic |
Enable/Disable GMAC receive.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable GMAC receiver, else to enable it. |
Referenced by ethernet_phy_auto_negotiate(), gmac_init_queue(), and gmac_reset_rx_mem().
|
inlinestatic |
Enable/Disable retry test.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable the GMAC receiver, else to enable it. |
|
inlinestatic |
Enable/Disable receive length field checking.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable receive length field checking, else to enable it. |
|
inlinestatic |
Enable/Disable statistics registers writing.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable the statistics registers writing, else to enable it. |
Referenced by gmac_init_queue().
|
inlinestatic |
Enable/Disable GMAC transmit.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to disable GMAC transmit, else to enable it. |
Referenced by ethernet_phy_auto_negotiate(), gmac_handler(), gmac_init_queue(), and gmac_reset_tx_mem().
|
inlinestatic |
Flush next packet.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Get network configuration.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_dev_init().
|
inlinestatic |
Return interrupt mask.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_handler().
|
inlinestatic |
Return interrupt status.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_handler(), and gmac_init_queue().
|
inlinestatic |
Get MDIO IN pin status.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Get network control value.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Get PHY maintenance data returned.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_phy_read().
|
inlinestatic |
Get Rx Queue Address.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
|
inlinestatic |
Get Network Status.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Get Tx Queue.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Return transmit status.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_handler().
|
inlinestatic |
Halt transmission.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Increase all statistics registers.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Check if PHY is idle.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_phy_wait().
|
inlinestatic |
Execute PHY maintenance command.
p_gmac | Pointer to the GMAC 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 GMAC_MAN_CODE_VALUE, GMAC_MAN_READ_ONLY, and GMAC_MAN_RW_TYPE.
Referenced by gmac_phy_read(), and gmac_phy_write().
|
inlinestatic |
Write network control value.
p_gmac | Pointer to the GMAC instance. |
ul_ncr | Network control value. |
Referenced by gmac_dev_init(), and gmac_dev_reset().
|
inlinestatic |
Select media independent interface mode.
p_gmac | Pointer to the GMAC instance. |
mode | Media independent interface mode. |
References GMAC_PHY_MII, and GMAC_PHY_RMII.
Referenced by ethernet_phy_auto_negotiate().
|
inlinestatic |
Set MAC Address.
p_gmac | Pointer to the GMAC instance. |
uc_index | GMAC specific address register index. |
p_mac_addr | GMAC address. |
Referenced by gmac_dev_init().
|
inlinestatic |
Set MAC Address via 2 dword.
p_gmac | Pointer to the GMAC instance. |
uc_index | GMAC specific address register index. |
ul_mac_top | GMAC top address. |
ul_mac_bottom | GMAC bottom address. |
|
inlinestatic |
Set MAC Address via int64.
p_gmac | Pointer to the GMAC instance. |
uc_index | GMAC specific address register index. |
ull_mac | 64-bit GMAC address. |
|
inlinestatic |
Set up network configuration register.
p_gmac | Pointer to the GMAC instance. |
ul_cfg | Network configuration value. |
Referenced by gmac_dev_init().
|
inlinestatic |
Set Hash.
p_gmac | Pointer to the GMAC instance. |
ul_hash_top | Hash top. |
ul_hash_bottom | Hash bottom. |
|
inlinestatic |
Set 64 bits Hash.
p_gmac | Pointer to the GMAC instance. |
ull_hash | 64 bits hash value. |
|
inlinestatic |
Set MDC clock divider.
p_gmac | Pointer to the GMAC instance. |
ul_mck | GMAC MCK. |
References GMAC_INVALID, GMAC_MCK_SPEED_120MHZ, GMAC_MCK_SPEED_160MHZ, GMAC_MCK_SPEED_20MHZ, GMAC_MCK_SPEED_240MHZ, GMAC_MCK_SPEED_40MHZ, GMAC_MCK_SPEED_80MHZ, and GMAC_OK.
Referenced by ethernet_phy_init().
|
inlinestatic |
Set receive buffer offset to 0 ~ 3.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Set Rx buffer size.
p_gmac | Pointer to the GMAC instance. |
ul_addr | Rx buffer. |
|
inlinestatic |
Set Rx Queue.
p_gmac | Pointer to the GMAC instance. |
ul_addr | Rx queue address. |
Referenced by gmac_reset_rx_mem().
|
inlinestatic |
Set speed.
p_gmac | Pointer to the GMAC 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_gmac | Pointer to the GMAC instance. |
ul_addr | Tx queue address. |
Referenced by gmac_reset_tx_mem().
|
inlinestatic |
Start transmission.
p_gmac | Pointer to the GMAC instance. |
Referenced by gmac_dev_write(), and gmac_dev_write_nocopy().
|
inlinestatic |
Store receivetime stamp to memory.
p_gmac | Pointer to the GMAC instance. |
uc_enable | 0 to normal operation, else to enable the store. |
|
inlinestatic |
Transmit PFC priority-based pause reception.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Transmit pause frame.
p_gmac | Pointer to the GMAC instance. |
|
inlinestatic |
Transmit zero quantum pause frame.
p_gmac | Pointer to the GMAC instance. |