![]() |
RZ Flexible Software Package Documentation
Release v4.2.0
|
|
Functions | |
| fsp_err_t | R_RMAC_Open (ether_ctrl_t *const p_ctrl, ether_cfg_t const *const p_cfg) |
| After RMAC, Switch and PHY-LSI are reset in software, an auto negotiation of PHY-LSI is begun. Afterwards, the link signal change interrupt is permitted. Implements ether_api_t::open. More... | |
| fsp_err_t | R_RMAC_Close (ether_ctrl_t *const p_ctrl) |
| Disables interrupts. Removes power and releases hardware lock. Implements ether_api_t::close. More... | |
| fsp_err_t | R_RMAC_BufferRelease (ether_ctrl_t *const p_ctrl) |
| Move to the next buffer in the receive buffer list. Implements ether_api_t::bufferRelease. More... | |
| fsp_err_t | R_RMAC_RxBufferUpdate (ether_ctrl_t *const p_ctrl, void *const p_buffer) |
| Change the buffer pointer of the current rx buffer descriptor. Implements ether_api_t::rxBufferUpdate. More... | |
| fsp_err_t | R_RMAC_LinkProcess (ether_ctrl_t *const p_ctrl) |
| The Link up processing, the Link down processing, and the magic packet detection processing are executed. Implements ether_api_t::linkProcess. More... | |
| fsp_err_t | R_RMAC_WakeOnLANEnable (ether_ctrl_t *const p_ctrl) |
| The setting of RMAC is changed from normal sending and receiving mode to magic packet detection mode. Implements ether_api_t::wakeOnLANEnable. More... | |
| fsp_err_t | R_RMAC_Read (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t *const length_bytes) |
| Receive Ethernet frame. Receives data to the location specified by the pointer to the receive buffer. In zero copy mode, the address of the receive buffer is returned. In non zero copy mode, the received data in the internal buffer is copied to the pointer passed by the argument. Implements ether_api_t::read. More... | |
| fsp_err_t | R_RMAC_Write (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t const frame_length) |
| Transmit Ethernet frame. Transmits data from the location specified by the pointer to the transmit buffer, with the data size equal to the specified frame length. In the non zero copy mode, transmits data after being copied to the internal buffer. Implements ether_api_t::write. More... | |
| fsp_err_t | R_RMAC_TxStatusGet (ether_ctrl_t *const p_ctrl, void *const p_buffer_address) |
| fsp_err_t | R_RMAC_CallbackSet (ether_ctrl_t *const p_ctrl, void(*p_callback)(ether_callback_args_t *), void *const p_context, ether_callback_args_t *const p_callback_memory) |
| fsp_err_t | R_RMAC_SetWriteConfig (ether_ctrl_t *const p_ctrl, rmac_write_cfg_t *const p_write_cfg) |
| Set configuration for tx frame. This API must call before ether_api_t::write. More... | |
| fsp_err_t | R_RMAC_GetTxTimestamp (ether_ctrl_t *const p_ctrl, rmac_timestamp_t *const p_timestamp) |
| Get timestamp of transmitted frame. This API must call after ether_api_t::write. More... | |
| fsp_err_t | R_RMAC_GetRxTimestamp (ether_ctrl_t *const p_ctrl, rmac_timestamp_t *const p_timestamp) |
| Get timestamp of received frame. This API must call before ether_api_t::read. More... | |
Driver for the Ethernet peripheral on RZ microprocessor. This module implements the Ethernet Interface.
With the Ethernet MAC function, this LSI enables to transport the Ethernet Data on PORT.
| Configuration | Options | Default | Description |
|---|---|---|---|
| Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
| Read Buffer Size Checking |
| Disabled | If selected code for buffer size checking is included in the build. |
| Nested Interrupt (Multiplex Interrupt) |
| Disabled | Enable nested interrupt for a single driver. |
| Configuration | Options | Default | Description |
|---|---|---|---|
| General > Name | Name must be a valid C symbol | g_rmac0 | Module name. |
| General > Channel | Must be an integer greater than or equal to 0. | 0 | Write the ether channel number. |
| General > Zero-copy Mode |
| Disable | Enable or disable zero-copy mode. |
| General > Flow control functionality |
| Disable | Enable or disable flow control. |
| General > MAC address | Must be a valid MAC address | 00:11:22:33:44:55 | MAC address of this channel. |
| Filters > Multicast Mode |
| Enable | Enable or disable multicast frame reception. |
| Filters > Promiscuous Mode |
| Disable | Enable this option to receive packets addressed to other NICs. |
| Filters > Broadcast filter | Must be a valid non-negative integer with maximum configurable value of 65535. | 0 | Limit of the number of broadcast frames received continuously |
| Buffers > Padding size | Disable | Disable | The padding size that is automatically inserted into the received packets |
| Buffers > Padding offset | Must be less than 64 bytes. | 0 | The offset into a receive buffer to insert padding bytes. |
| Buffers > TX queue length | Value must be an integer | 3 | Number of buffers per TX queue. |
| Buffers > RX queue length | Value must be an integer | 3 | Number of buffers per RX queue. |
| Buffers > TX queue num | Value must be an integer | 2 | TX queue num |
| Buffers > RX queue num | Value must be an integer | 2 | RX queue num |
| Buffers > Number of TX buffer | Value must be an integer | 12 | Number of transmit buffers |
| Buffers > Number of RX buffer | Value must be an integer | 12 | Number of receive buffers |
| Buffers > Buffer size | Must be at least 1514 which is the maximum Ethernet frame size. | 1514 | Size of Ethernet buffer |
| Buffers > Allocate RX buffer |
| Enable | Allocates the RX buffer when generating the configuration structure |
| Buffers > Number of node num | Value must be an integer | 24 | Number of receive buffers |
| Interrupts > ETHA status interrupt priority | MCU Specific Options | Select the ETHA status interrupt priority. | |
| Interrupts > Callback | Name must be a valid C symbol | NULL | Callback provided when an ISR occurs |
| Timestamp > TS queue length | Value must be an integer | 8 | Timestamp queue length. |
| Frame Preemption > Frame preemption feature |
| Disable | Select whether to enable or disable frame preemption feature. |
| Frame Preemption > Verify frame interval | Value must be a non-negative integer less than 128 | 10 | Interval for sending verify frame [ms]. |
| Forwarding > Transmission descriptor format |
| Transmission direct descriptor | The transmission direct descriptor could be used, for example, for non-routable protocol forwarding (network control) or for CPU-CPU communication and the transmission ethernet descriptor could be used for all normal ethernet transmissions. |
| Forwarding > Port based forwarding for reception |
| Disabled | Port based forwarding function forwards all frames from a port to other ones when receiving. |
Then use this modules, set the MUX to port, then start transportation.
None
This is a basic example of minimal use of the RMAC in an application.
This is a example of getting transmission and reception timestamps.
Classes | |
| struct | st_rmac_queue_info |
| struct | st_rmac_write_cfg |
| struct | st_rmac_timestamp |
| struct | st_rmac_buffer_node |
| struct | st_rmac_buffer_queue |
| struct | st_rmac_instance_ctrl |
Typedefs | |
| typedef struct st_rmac_queue_info | rmac_queue_info_t |
| typedef struct st_rmac_write_cfg | rmac_write_cfg_t |
| typedef struct st_rmac_timestamp | rmac_timestamp_t |
| typedef struct st_rmac_buffer_node | rmac_buffer_node_t |
| typedef struct st_rmac_buffer_queue | rmac_buffer_queue_t |
| typedef struct st_rmac_extended_cfg | rmac_extended_cfg_t |
| typedef struct st_rmac_instance_ctrl | rmac_instance_ctrl_t |
Enumerations | |
| enum | ether_previous_link_status_t |
| enum | ether_link_change_t |
| enum | ether_link_establish_status_t |
| enum | rmac_transmission_discriptor_format_t |
| struct RZT::st_rmac_queue_info |
Information of a descriptor queue.
| Class Members | ||
|---|---|---|
| layer3_switch_descriptor_queue_cfg_t | queue_cfg | Queue configuration. |
| uint32_t | index | Queue index. |
| struct RZT::st_rmac_write_cfg |
| struct RZT::st_rmac_timestamp |
| struct RZT::st_rmac_buffer_node |
Node to manage buffer.
| Class Members | ||
|---|---|---|
| void * | p_buffer | Pointer to the buffer. |
| uint32_t | size | Buffer size. |
| struct st_rmac_buffer_node * | p_next | Pointer to the next node. |
| struct RZT::st_rmac_buffer_queue |
Queue of internal buffers.
| Class Members | ||
|---|---|---|
| rmac_buffer_node_t * | p_head | Pointer to the head of the queue. |
| rmac_buffer_node_t * | p_tail | Pointer to the tail of the queue. |
| struct RZT::st_rmac_instance_ctrl |
Instance control block. DO NOT INITIALIZE. Initialization occurs when ether_api_t::open is called
Public Attributes | |
| uint32_t | read_queue_index |
| RX queue that used for next BufferRelease API. | |
| uint32_t | rx_running_queue_index |
| Whether a RX queue is running or not. | |
| rmac_buffer_queue_t | rx_completed_buffer_queue |
| RX buffers that have completed reception. | |
| rmac_buffer_queue_t | rx_unreleased_buffer_queue |
| RX buffers that have been read but not yet released. | |
| rmac_buffer_queue_t | rx_empty_buffer_queue |
| RX Buffers that have no data. | |
| uint32_t | rx_initialized_buffer_num |
| RX buffer num of initialized. This is used in RxBufferUpdate API. | |
| uint32_t | write_queue_index |
| TX queue that used for next Write API. | |
| uint32_t | tx_running_queue_index |
| Index of the queue that is running now. | |
| void * | p_last_sent_buffer |
| Pointer to the last sent TX buffer. | |
| rmac_buffer_queue_t | tx_pending_buffer_queue |
| Delayed TX buffers. | |
| rmac_buffer_queue_t | tx_empty_buffer_queue |
| TX Buffers that have no data. | |
| uint32_t | write_descriptor_count |
| Count of descriptor that already write in active queue. | |
| rmac_buffer_queue_t | buffer_node_pool |
| Buffer nodes pool. | |
| rmac_timestamp_t * | p_rx_timestamp |
| RX timestamp pointer. | |
| rmac_timestamp_t | tx_timestamp |
| TX timestamp. | |
| uint32_t | tx_timestamp_seq_num |
| Sequence number of TX timestamp. | |
| rmac_write_cfg_t | write_cfg |
| Configuration of transmission. | |
| bool | frame_preemption_available |
| Status of the frame preemption verification. | |
| ether_previous_link_status_t | previous_link_status |
| Previous link status. | |
| ether_link_change_t | link_change |
| Status of link change. | |
| ether_link_establish_status_t | link_establish_status |
| Current Link status. | |
| ether_wake_on_lan_t | wake_on_lan |
| Wake on LAN mode. | |
| typedef struct st_rmac_queue_info rmac_queue_info_t |
Information of a descriptor queue. Please refer to the struct st_rmac_queue_info.
| typedef struct st_rmac_write_cfg rmac_write_cfg_t |
Write configuration. Please refer to the struct st_rmac_write_cfg.
| typedef struct st_rmac_timestamp rmac_timestamp_t |
Timestamp. Please refer to the struct st_rmac_timestamp.
| typedef struct st_rmac_buffer_node rmac_buffer_node_t |
Node to manage buffer. Please refer to the struct st_rmac_buffer_node.
| typedef struct st_rmac_buffer_queue rmac_buffer_queue_t |
Queue of internal buffers. Please refer to the struct st_rmac_buffer_queue.
| typedef struct st_rmac_extended_cfg rmac_extended_cfg_t |
Extended configuration. Please refer to the struct st_rmac_extended_cfg.
| typedef struct st_rmac_instance_ctrl rmac_instance_ctrl_t |
Instance control block. DO NOT INITIALIZE. Initialization occurs when open is called Please refer to the struct st_rmac_instance_ctrl.
| enum ether_link_change_t |
| fsp_err_t R_RMAC_Open | ( | ether_ctrl_t *const | p_ctrl, |
| ether_cfg_t const *const | p_cfg | ||
| ) |
After RMAC, Switch and PHY-LSI are reset in software, an auto negotiation of PHY-LSI is begun. Afterwards, the link signal change interrupt is permitted. Implements ether_api_t::open.
Initializes the ether module and applies configurations. Implements ether_api_t::open.
| FSP_SUCCESS | Channel opened successfully. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block or configuration structure is NULL. |
| FSP_ERR_ALREADY_OPEN | Control block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure. |
| FSP_ERR_ETHER_ERROR_PHY_COMMUNICATION | Initialization of PHY-LSI failed. |
| FSP_ERR_INVALID_CHANNEL | Invalid channel number is given. |
| FSP_ERR_INVALID_POINTER | Pointer to extend config structure or MAC address is NULL. |
| FSP_ERR_INVALID_ARGUMENT | Interrupt is not enabled. |
| FSP_ERR_ETHER_PHY_ERROR_LINK | Initialization of PHY-LSI failed. |
| fsp_err_t R_RMAC_Close | ( | ether_ctrl_t *const | p_ctrl | ) |
Disables interrupts. Removes power and releases hardware lock. Implements ether_api_t::close.
| FSP_SUCCESS | Channel successfully closed. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened |
| fsp_err_t R_RMAC_BufferRelease | ( | ether_ctrl_t *const | p_ctrl | ) |
Move to the next buffer in the receive buffer list. Implements ether_api_t::bufferRelease.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block or internal buffers is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened |
| FSP_ERR_ETHER_ERROR_LINK | Auto-negotiation is not completed, and reception is not enabled. |
| FSP_ERR_BUFFER_EMPTY | There is no available internal RX buffer. |
| fsp_err_t R_RMAC_RxBufferUpdate | ( | ether_ctrl_t *const | p_ctrl, |
| void *const | p_buffer | ||
| ) |
Change the buffer pointer of the current rx buffer descriptor. Implements ether_api_t::rxBufferUpdate.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | A pointer argument is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_INVALID_POINTER | The pointer of buffer is NULL or not aligned on a 32-bit boundary. |
| FSP_ERR_INVALID_MODE | Driver is configured to non zero copy mode. |
| FSP_ERR_BUFFER_EMPTY | There is no available internal RX buffer. |
| fsp_err_t R_RMAC_LinkProcess | ( | ether_ctrl_t *const | p_ctrl | ) |
The Link up processing, the Link down processing, and the magic packet detection processing are executed. Implements ether_api_t::linkProcess.
| FSP_SUCCESS | Link is up. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_ETHER_ERROR_LINK | Link is down. |
| FSP_ERR_ETHER_ERROR_PHY_COMMUNICATION | When reopening the PHY interface initialization of the PHY-LSI failed. |
| FSP_ERR_ALREADY_OPEN | When reopening the PHY interface it was already opened. |
| FSP_ERR_INVALID_CHANNEL | When reopening the PHY interface an invalid channel was passed. |
| FSP_ERR_INVALID_POINTER | When reopening the PHY interface the MAC address pointer was NULL. |
| FSP_ERR_INVALID_ARGUMENT | When reopening the PHY interface the interrupt was not enabled. |
| FSP_ERR_ETHER_PHY_ERROR_LINK | Initialization of the PHY-LSI failed. |
| fsp_err_t R_RMAC_WakeOnLANEnable | ( | ether_ctrl_t *const | p_ctrl | ) |
The setting of RMAC is changed from normal sending and receiving mode to magic packet detection mode. Implements ether_api_t::wakeOnLANEnable.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_ETHER_ERROR_LINK | Auto-negotiation is not completed, and reception is not enabled. |
| FSP_ERR_ETHER_PHY_ERROR_LINK | Initialization of PHY-LSI failed. |
| fsp_err_t R_RMAC_Read | ( | ether_ctrl_t *const | p_ctrl, |
| void *const | p_buffer, | ||
| uint32_t *const | length_bytes | ||
| ) |
Receive Ethernet frame. Receives data to the location specified by the pointer to the receive buffer. In zero copy mode, the address of the receive buffer is returned. In non zero copy mode, the received data in the internal buffer is copied to the pointer passed by the argument. Implements ether_api_t::read.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_ETHER_ERROR_NO_DATA | There is no data in receive buffer. |
| FSP_ERR_ETHER_ERROR_LINK | Auto-negotiation is not completed, and reception is not enabled. |
| FSP_ERR_ETHER_ERROR_FILTERING | Multicast Frame filter is enable, and Multicast Address Frame is received. |
| FSP_ERR_INVALID_POINTER | Value of the pointer is NULL. |
| FSP_ERR_BUFFER_EMPTY | There is no available internal RX buffer. |
| FSP_ERR_INVALID_SIZE | The buffer size is smaller than ether_cfg_t::ether_buffer_size. |
| fsp_err_t R_RMAC_Write | ( | ether_ctrl_t *const | p_ctrl, |
| void *const | p_buffer, | ||
| uint32_t const | frame_length | ||
| ) |
Transmit Ethernet frame. Transmits data from the location specified by the pointer to the transmit buffer, with the data size equal to the specified frame length. In the non zero copy mode, transmits data after being copied to the internal buffer. Implements ether_api_t::write.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_ETHER_ERROR_LINK | Auto-negotiation is not completed, and reception is not enabled. |
| FSP_ERR_ETHER_ERROR_TRANSMIT_BUFFER_FULL | Transmit buffer is not empty. |
| FSP_ERR_INVALID_POINTER | Value of the pointer is NULL. |
| FSP_ERR_INVALID_ARGUMENT | Value of the send frame size is out of range. |
| FSP_ERR_BUFFER_EMPTY | There is no available internal TX buffer. |
| fsp_err_t R_RMAC_TxStatusGet | ( | ether_ctrl_t *const | p_ctrl, |
| void *const | p_buffer_address | ||
| ) |
Provides status of Ethernet driver in the user provided pointer. Implements ether_api_t::txStatusGet.
| FSP_SUCCESS | Transmit buffer address is stored in provided p_buffer_address. |
| FSP_ERR_ASSERTION | Pointer to ETHER control block is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_INVALID_POINTER | p_status is NULL. |
| FSP_ERR_NOT_FOUND | Transmit buffer address has been overwritten in transmit descriptor. |
| fsp_err_t R_RMAC_CallbackSet | ( | ether_ctrl_t *const | p_ctrl, |
| void(*)(ether_callback_args_t *) | p_callback, | ||
| void *const | p_context, | ||
| ether_callback_args_t *const | p_callback_memory | ||
| ) |
Updates the user callback with the option to provide memory for the callback argument structure. Implements ether_api_t::callbackSet.
| FSP_SUCCESS | Callback updated successfully. |
| FSP_ERR_ASSERTION | A required pointer is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| FSP_ERR_NO_CALLBACK_MEMORY | p_callback is non-secure and p_callback_memory is either secure or NULL. |
| fsp_err_t R_RMAC_SetWriteConfig | ( | ether_ctrl_t *const | p_ctrl, |
| rmac_write_cfg_t *const | p_write_cfg | ||
| ) |
Set configuration for tx frame. This API must call before ether_api_t::write.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | A pointer argument is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| fsp_err_t R_RMAC_GetTxTimestamp | ( | ether_ctrl_t *const | p_ctrl, |
| rmac_timestamp_t *const | p_timestamp | ||
| ) |
Get timestamp of transmitted frame. This API must call after ether_api_t::write.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | A pointer argument is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |
| fsp_err_t R_RMAC_GetRxTimestamp | ( | ether_ctrl_t *const | p_ctrl, |
| rmac_timestamp_t *const | p_timestamp | ||
| ) |
Get timestamp of received frame. This API must call before ether_api_t::read.
| FSP_SUCCESS | Processing completed successfully. |
| FSP_ERR_ASSERTION | A pointer argument is NULL. |
| FSP_ERR_NOT_OPEN | The control block has not been opened. |