/* SPDX-License-Identifier: GPL-2.0-only */ /* Altera Triple-Speed Ethernet MAC driver * Copyright (C) 2008-2014 Altera Corporation. All rights reserved * * Contributors: * Dalon Westergreen * Thomas Chou * Ian Abbott * Yuriy Kozlov * Tobias Klauser * Andriy Smolskyy * Roman Bulgakov * Dmytro Mytarchuk * Matthew Gerlach * * Original driver contributed by SLS. * Major updates contributed by GlobalLogic
*/
/* MAC register Space. Note that some of these registers may or may not be * present depending upon options chosen by the user when the core was * configured and built. Please consult the Altera Triple Speed Ethernet User * Guide for details.
*/ struct altera_tse_mac { /* Bits 15:0: MegaCore function revision (0x0800). Bit 31:16: Customer * specific revision
*/
u32 megacore_revision; /* Provides a memory location for user applications to test the device * memory operation.
*/
u32 scratch_pad; /* The host processor uses this register to control and configure the * MAC block
*/
u32 command_config; /* 32-bit primary MAC address word 0 bits 0 to 31 of the primary * MAC address
*/
u32 mac_addr_0; /* 32-bit primary MAC address word 1 bits 32 to 47 of the primary * MAC address
*/
u32 mac_addr_1; /* 14-bit maximum frame length. The MAC receive logic */
u32 frm_length; /* The pause quanta is used in each pause frame sent to a remote * Ethernet device, in increments of 512 Ethernet bit times
*/
u32 pause_quanta; /* 12-bit receive FIFO section-empty threshold */
u32 rx_section_empty; /* 12-bit receive FIFO section-full threshold */
u32 rx_section_full; /* 12-bit transmit FIFO section-empty threshold */
u32 tx_section_empty; /* 12-bit transmit FIFO section-full threshold */
u32 tx_section_full; /* 12-bit receive FIFO almost-empty threshold */
u32 rx_almost_empty; /* 12-bit receive FIFO almost-full threshold */
u32 rx_almost_full; /* 12-bit transmit FIFO almost-empty threshold */
u32 tx_almost_empty; /* 12-bit transmit FIFO almost-full threshold */
u32 tx_almost_full; /* MDIO address of PHY Device 0. Bits 0 to 4 hold a 5-bit PHY address */
u32 mdio_phy0_addr; /* MDIO address of PHY Device 1. Bits 0 to 4 hold a 5-bit PHY address */
u32 mdio_phy1_addr;
/* only if 100/1000 BaseX PCS, reserved otherwise */
u32 reserved1[5];
/* Minimum IPG between consecutive transmit frame in terms of bytes */
u32 tx_ipg_length;
/* IEEE 802.3 oEntity Managed Object Support */
/* The MAC addresses */
u32 mac_id_1;
u32 mac_id_2;
/* Number of frames transmitted without error including pause frames */
u32 frames_transmitted_ok; /* Number of frames received without error including pause frames */
u32 frames_received_ok; /* Number of frames received with a CRC error */
u32 frames_check_sequence_errors; /* Frame received with an alignment error */
u32 alignment_errors; /* Sum of payload and padding octets of frames transmitted without * error
*/
u32 octets_transmitted_ok; /* Sum of payload and padding octets of frames received without error */
u32 octets_received_ok;
/* IEEE 802.3 oPausedEntity Managed Object Support */
/* Number of transmitted pause frames */
u32 tx_pause_mac_ctrl_frames; /* Number of Received pause frames */
u32 rx_pause_mac_ctrl_frames;
/* IETF MIB (MIB-II) Object Support */
/* Number of frames received with error */
u32 if_in_errors; /* Number of frames transmitted with error */
u32 if_out_errors; /* Number of valid received unicast frames */
u32 if_in_ucast_pkts; /* Number of valid received multicasts frames (without pause) */
u32 if_in_multicast_pkts; /* Number of valid received broadcast frames */
u32 if_in_broadcast_pkts;
u32 if_out_discards; /* The number of valid unicast frames transmitted */
u32 if_out_ucast_pkts; /* The number of valid multicast frames transmitted, * excluding pause frames
*/
u32 if_out_multicast_pkts;
u32 if_out_broadcast_pkts;
/* IETF RMON MIB Object Support */
/* Counts the number of dropped packets due to internal errors * of the MAC client.
*/
u32 ether_stats_drop_events; /* Total number of bytes received. Good and bad frames. */
u32 ether_stats_octets; /* Total number of packets received. Counts good and bad packets. */
u32 ether_stats_pkts; /* Number of packets received with less than 64 bytes. */
u32 ether_stats_undersize_pkts; /* The number of frames received that are longer than the * value configured in the frm_length register
*/
u32 ether_stats_oversize_pkts; /* Number of received packet with 64 bytes */
u32 ether_stats_pkts_64_octets; /* Frames (good and bad) with 65 to 127 bytes */
u32 ether_stats_pkts_65to127_octets; /* Frames (good and bad) with 128 to 255 bytes */
u32 ether_stats_pkts_128to255_octets; /* Frames (good and bad) with 256 to 511 bytes */
u32 ether_stats_pkts_256to511_octets; /* Frames (good and bad) with 512 to 1023 bytes */
u32 ether_stats_pkts_512to1023_octets; /* Frames (good and bad) with 1024 to 1518 bytes */
u32 ether_stats_pkts_1024to1518_octets;
/* Any frame length from 1519 to the maximum length configured in the * frm_length register, if it is greater than 1518
*/
u32 ether_stats_pkts_1519tox_octets; /* Too long frames with CRC error */
u32 ether_stats_jabbers; /* Too short frames with CRC error */
u32 ether_stats_fragments;
u32 reserved2;
/* FIFO control register */
u32 tx_cmd_stat;
u32 rx_cmd_stat;
/* Transmit and Receive Command Registers Bit Definitions
*/ #define ALTERA_TSE_TX_CMD_STAT_OMIT_CRC BIT(17) #define ALTERA_TSE_TX_CMD_STAT_TX_SHIFT16 BIT(18) #define ALTERA_TSE_RX_CMD_STAT_RX_SHIFT16 BIT(25)
/* Wrapper around a pointer to a socket buffer, * so a DMA handle can be stored along with the buffer
*/ struct tse_buffer { struct list_head lh; struct sk_buff *skb;
dma_addr_t dma_addr;
u32 len; int mapped_as_page;
};
/* PHY */ int phy_addr; /* PHY's MDIO address, -1 for autodetection */
phy_interface_t phy_iface; struct mii_bus *mdio; int oldspeed; int oldduplex; int oldlink;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.