Ethernet MAC
UG0331 User Guide Revision 15.0
391
The following table lists the APIs available in TSEMAC firmware drivers for initialization and
configuration.
The following table lists the APIs available in TSEMAC firmware drivers for Ethernet PHY management.
The following table lists the APIs available in TSEMAC firmware drivers for transmit and receive
operations
Table 327 •
TSEMAC Firmware Drivers for Initialization and Configuration
API
Description
MSS_MAC_cfg_struct_def_init
The MSS_MAC_cfg_struct_def_init() function initializes a mss_mac_cfg_t
configuration data structure to default values. The default configuration uses the
MII interface connected to a PHY at address 0x00 which is set to auto-negotiate
at all available speeds up to 1000Mbps. This default configuration can then be
used as parameter to MSS_MAC_init(). Typically the default configuration would
be modified to suit the application before being passed to MSS_MAC_init()
MSS_MAC_init
The MSS_MAC_init() function initializes the Ethernet MAC hardware and driver
internal data structures. The MSS_MAC_init() function takes a pointer to a
configuration data structure of type mss_mac_cfg_t as parameter. This
configuration data structure contains all the information required to configure the
Ethernet MAC. The MSS_MAC_init() function initializes the descriptor rings and
their pointers to initial values. The MSS_MAC_init() function enables DMA Rx
packet received and Tx packet sent interrupts.
The configuration passed to the MSS_MAC_init() function specifies the type of
interface used to connect the Ethernet MAC and Ethernet PHY as well as the
PHY MII management interface address. It also specifies the allowed link speed
and duplex mode. It is at this point that the application chooses if the link speed
and duplex mode will be auto-negotiate with the link partner or forced to a
specific speed and duplex mode.
Table 328 •
TSEMAC Firmware Drivers for Ethernet PHY Management
API
Description
MSS_MAC_read_phy_reg
The MSS_MAC_read_phy_reg() function reads the Ethernet PHY register
specified as parameter. It uses the MII management interface to communicate
with the Ethernet PHY. This function is used part of the Ethernet PHY drivers
provided alongside the Ethernet MAC driver. You only need to use this function if
writing your own Ethernet PHY driver.
MSS_MAC_write_phy_reg
The MSS_MAC_write_phy_reg() function writes a 16-bit value to the specified
Ethernet PHY register. . It uses the MII management interface to communicate
with the Ethernet PHY. This function is used part of the Ethernet PHY drivers
provided alongside the Ethernet MAC driver. You only need to use this function if
writing your own Ethernet PHY driver.
Table 329 •
TSEMAC Firmware Drivers for Transmit and Receive Operations
API
Description
MSS_MAC_send_pkt
The MSS_MAC_send_pkt()function initiates the transmission of a packet. It
places the buffer containing the packet to send into one of the Ethernet MAC’s
transmit descriptors. This function is non-blocking. It will return immediately
without waiting for the packet to be sent. The Ethernet MAC driver indicates that
the packet is sent by calling the transmit completion handler registered by a call
to MSS_MAC_set_tx_callback().