HPM SDK
HPMicro Software Development Kit
TSW driver APIs

TSW driver APIs. More...

Data Structures

struct  tx_hdr_desc_t
 
struct  tsw_frame_t
 
struct  tsw_dma_config_t
 
struct  tsw_shap_tas_listlen_t
 
struct  tsw_tas_controllist_entry_t
 
struct  tsw_tas_config_t
 
struct  tsw_cbs_config_t
 
struct  tsw_tsf_t
 
struct  tsw_fpe_mms_status_t
 
struct  tsw_fpe_config_t
 
struct  tsw_cb_stmid_lookup_mac_t
 
struct  tsw_cb_stmid_active_mac_t
 
struct  tsw_cb_stmid_entry_t
 
struct  tsw_cb_frer_xrfunc_config_t
 
struct  tsw_cb_frer_sid_func_config_t
 
struct  tsw_cb_frer_latent_error_dectecton_config_t
 
struct  tsw_cb_frer_recovery_func_config_t
 
struct  tsw_psfer_gate_control_list_entry_t
 
struct  tsw_psfer_gate_control_list_config_t
 
struct  tsw_cb_frer_frame_count_egress_t
 
struct  tsw_psfp_gate_static_mode_config_t
 
struct  tsw_psfp_gate_dynamic_mode_config_t
 
struct  tsw_psfp_flow_meter_xir_config_t
 
struct  tsw_psfp_flow_meter_config_t
 
struct  tsw_psfp_filter_config_t
 

Macros

#define MAC_LO(mac)   (uint32_t)(mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24))
 
#define MAC_HI(mac)   (uint32_t)(mac[4] | (mac[5] << 8))
 
#define MAC_MDIO_CTRL_OP_WR   (0x01)
 
#define MAC_MDIO_CTRL_OP_RD   (0x02)
 
#define TSW_SEND_DESC_COUNT   (16U)
 
#define TSW_RECV_DESC_COUNT   (16U)
 
#define TSW_SEND_BUFF_LEN   (1536U)
 
#define TSW_RECV_BUFF_LEN   (1536U)
 
#define TSW_NS_IN_ONE_SEC   (1000000000UL)
 
#define TSW_BUS_FREQ   (100000000UL)
 
#define TSW_FPE_MMS_MIN_VTIME_MIN   (1U) /* 1ms */
 
#define TSW_FPE_MMS_MAX_VTIME_MAX   (128U) /* 128ms */
 

Enumerations

enum  tsw_port_speed_t { tsw_port_speed_10mbps = 2 , tsw_port_speed_100mbps = 3 , tsw_port_speed_1000mbps = 0 }
 
enum  tsw_port_phy_itf_t { tsw_port_phy_itf_mii = 0 , tsw_port_phy_itf_rmii = 4 , tsw_port_phy_itf_rgmii = 1 }
 
enum  tsw_dst_t {
  tsw_dst_port_null = 0 , tsw_dst_port_cpu = 1 << 0 , tsw_dst_port_1 = 1 << 1 , tsw_dst_port_2 = 1 << 2 ,
  tsw_dst_port_3 = 1 << 3
}
 
enum  tsw_cpu_send_to_port_t {
  tsw_cpu_send_to_lookup = 0x00 , tsw_cpu_send_to_port_1 = 0x01 , tsw_cpu_send_to_port_2 = 0x02 , tsw_cpu_send_to_port_3 = 0x03 ,
  tsw_cpu_send_to_all_ports = 0x80
}
 
enum  tsw_mac_mode_t { tsw_mac_mode_mii = 0 , tsw_mac_mode_gmii }
 
enum  tsw_pps_ctrl_t {
  tsw_pps_ctrl_pps = 0 , tsw_pps_ctrl_bin_2hz_digital_1hz , tsw_pps_ctrl_bin_4hz_digital_2hz , tsw_pps_ctrl_bin_8hz_digital_4hz ,
  tsw_pps_ctrl_bin_16hz_digital_8hz , tsw_pps_ctrl_bin_32hz_digital_16hz , tsw_pps_ctrl_bin_64hz_digital_32hz , tsw_pps_ctrl_bin_128hz_digital_64hz ,
  tsw_pps_ctrl_bin_256hz_digital_128hz , tsw_pps_ctrl_bin_512hz_digital_256hz , tsw_pps_ctrl_bin_1024hz_digital_512hz , tsw_pps_ctrl_bin_2048hz_digital_1024hz ,
  tsw_pps_ctrl_bin_4096hz_digital_2048hz , tsw_pps_ctrl_bin_8192hz_digital_4096hz , tsw_pps_ctrl_bin_16384hz_digital_8192hz , tsw_pps_ctrl_bin_32768hz_digital_16384hz
}
 
enum  tsw_shap_tas_alist_op_t { tsw_shap_tas_aclist_op_set_gate_states = 0 , tsw_shap_tas_aclist_op_set_and_hold_mac , tsw_shap_tas_aclist_op_set_and_release_mac }
 
enum  tsw_shap_tas_aclist_state_open_queue_t {
  tsw_shap_tas_aclist_state_open_queueu_0 = 1 << 0 , tsw_shap_tas_aclist_state_open_queueu_1 = 1 << 1 , tsw_shap_tas_aclist_state_open_queueu_2 = 1 << 2 , tsw_shap_tas_aclist_state_open_queueu_3 = 1 << 3 ,
  tsw_shap_tas_aclist_state_open_queueu_4 = 1 << 4 , tsw_shap_tas_aclist_state_open_queueu_5 = 1 << 5 , tsw_shap_tas_aclist_state_open_queueu_6 = 1 << 6 , tsw_shap_tas_aclist_state_open_queueu_7 = 1 << 7 ,
  tsw_shap_tas_aclist_state_open_queueu_all = 0xff
}
 
enum  tsw_traffic_queue_t {
  tsw_traffic_queue_0 = 0 , tsw_traffic_queue_1 , tsw_traffic_queue_2 , tsw_traffic_queue_3 ,
  tsw_traffic_queue_4 , tsw_traffic_queue_5 , tsw_traffic_queue_6 , tsw_traffic_queue_7
}
 
enum  tsw_fpe_mms_statistics_counter_t {
  tsw_fpe_mms_frame_reassembly_error_counter = 0 , tsw_fpe_mms_frame_rejected_due_to_wrong_smd , tsw_fpe_mms_frame_assembly_ok_counter , tsw_fpe_mms_fragment_rx_counter ,
  tsw_fpe_mms_fragment_tx_counter , tsw_fpe_mms_hold_request_counter
}
 
enum  tsw_fpe_mms_fragment_size_t { tsw_fpe_mms_fragment_size_60_octets = 0 , tsw_fpe_mms_fragment_size_124_octets , tsw_fpe_mms_fragment_size_188_octets , tsw_fpe_mms_fragment_size_252_octets }
 
enum  tsw_stmid_lookup_mode_t { tsw_stmid_lookup_mode_priority = 1 , tsw_stmid_lookup_mode_tagged = 2 , tsw_stmid_lookup_mode_all }
 
enum  tsw_stmid_active_dest_mac_control_t { tsw_stmid_actctl_disabled = 0 , tsw_stmid_actctl_use_amac_with_removed_vlan_tag = 1 , tsw_stmid_actctl_use_amac_with_replaced_or_inserted_vlan_tag = 3 }
 
enum  tsw_stmid_control_lookup_mode_t { tsw_stmid_control_lookup_by_dest_mac = 0 , tsw_stmid_control_lookup_by_src_mac }
 
enum  tsw_cb_frer_algo_t { tsw_cb_frer_algo_vector_recovery = 0 , tsw_cb_frer_algo_match_recovery }
 
enum  tsw_cb_frer_xfunc_recovery_t { tsw_cb_frer_xfunc_recovery_sequence = 0 , tsw_cb_frer_xfunc_recovery_individual }
 
enum  tsw_cb_frer_frame_ount_egress_t {
  presented_frames = 0 , discarded_frames , tagless_frames , rougue_frames ,
  out_of_oder_frames , lost_frames , recover_func_resets , latent_err_dectection_resets
}
 
enum  tsw_psfp_gate_mode_t { tsw_psfp_gate_mode_static = 0 , tsw_psfp_gate_mode_dynamic , tsw_psfp_gate_mode_unknown }
 
enum  tsw_psfp_gate_t { tsw_psfp_gate_closed = 0 , tsw_psfp_gate_open }
 

Functions

void tsw_get_default_dma_config (tsw_dma_config_t *config)
 Get default DMA configuration. More...
 
void tsw_init_send (TSW_Type *ptr, tsw_dma_config_t *config)
 Initialize TSW send DMA. More...
 
void tsw_init_recv (TSW_Type *ptr, tsw_dma_config_t *config)
 Initialize TSW receive DMA. More...
 
hpm_stat_t tsw_send_frame (TSW_Type *ptr, uint8_t *buffer, uint16_t length, uint8_t id)
 Send a frame to CPU port. More...
 
hpm_stat_t tsw_commit_recv_desc (TSW_Type *ptr, uint8_t *buffer, uint16_t length, uint8_t id)
 Commit a receive DMA descriptor. More...
 
hpm_stat_t tsw_recv_frame (TSW_Type *ptr, tsw_frame_t *frame)
 Receive a frame from CPU port. More...
 
void tsw_mac_lookup_bypass (TSW_Type *ptr, uint8_t dst_port)
 Lookup Bypass Setting. More...
 
void tsw_set_cam_vlan_port (TSW_Type *ptr)
 CAM VLAN Setting. More...
 
hpm_stat_t tsw_ep_set_mdio_config (TSW_Type *ptr, uint8_t port, uint8_t clk_div)
 MDIO Interface Config. More...
 
hpm_stat_t tsw_ep_mdio_read (TSW_Type *ptr, uint8_t port, uint32_t phy_addr, uint32_t reg_addr, uint16_t *data)
 MDIO Read. More...
 
hpm_stat_t tsw_ep_mdio_write (TSW_Type *ptr, uint8_t port, uint32_t phy_addr, uint32_t reg_addr, uint16_t data)
 MDIO Write. More...
 
hpm_stat_t tsw_ep_enable_mac_ctrl (TSW_Type *ptr, uint8_t port, uint8_t mac_type)
 Enable MAC Controller. More...
 
hpm_stat_t tsw_ep_disable_mac_ctrl (TSW_Type *ptr, uint8_t port, uint8_t mac_type)
 Disable MAC Controller. More...
 
hpm_stat_t tsw_ep_enable_all_mac_ctrl (TSW_Type *ptr, uint8_t mac_type)
 Enable All MAC Controllers. More...
 
hpm_stat_t tsw_ep_disable_all_mac_ctrl (TSW_Type *ptr, uint8_t mac_type)
 Disable All MAC Controllers. More...
 
hpm_stat_t tsw_ep_set_mac_addr (TSW_Type *ptr, uint8_t port, uint8_t *mac_addr, bool promisc)
 Set MAC Address. More...
 
hpm_stat_t tsw_ep_set_mac_mode (TSW_Type *ptr, uint8_t port, uint8_t gmii)
 Set MAC Mode. More...
 
void tsw_port_gpr (TSW_Type *ptr, uint8_t port, uint8_t speed, uint8_t itf, uint8_t tx_dly, uint8_t rx_dly)
 Set Port GPR. More...
 
void tsw_set_port_speed (TSW_Type *ptr, uint8_t port, uint8_t speed)
 Set TSW port speed. More...
 
void tsw_set_port_interface (TSW_Type *ptr, uint8_t port, uint8_t itf)
 Set TSW port interface type. More...
 
void tsw_set_port_clock_delay (TSW_Type *ptr, uint8_t port, uint8_t tx_dly, uint8_t rx_dly)
 Set TSW port clock delay. More...
 
void tsw_set_internal_frame_action (TSW_Type *ptr, uint8_t dest_port)
 Set Internal Frame Action. More...
 
void tsw_set_broadcast_frame_action (TSW_Type *ptr, uint8_t dest_port)
 Set Broadcast Frame Action. More...
 
void tsw_set_unknown_frame_action (TSW_Type *ptr, uint8_t dest_port)
 Set Unknow Frame Action. More...
 
void tsw_set_lookup_table (TSW_Type *ptr, uint16_t entry_num, uint8_t dest_port, uint64_t dest_mac)
 Set Lookup Table. More...
 
void tsw_clear_cam (TSW_Type *ptr)
 Clear CAM. More...
 
void tsw_enable_store_forward_mode (TSW_Type *ptr, uint8_t port)
 Enable RXFIFO to store and forward mode. More...
 
void tsw_disable_store_forward_mode (TSW_Type *ptr, uint8_t port)
 Disable RXFIFO to store and forward mode. More...
 
hpm_stat_t tsw_get_rtc_time_increment (TSW_Type *ptr, uint32_t *increment)
 Get RTC timer increment value. More...
 
hpm_stat_t tsw_set_rtc_time_increment (TSW_Type *ptr, uint32_t increment)
 Set RTC timer increment value. More...
 
hpm_stat_t tsw_get_rtc_current_time (TSW_Type *ptr, uint32_t *sec, uint32_t *nsec)
 Get RTC current time. More...
 
hpm_stat_t tsw_get_rtc_offset (TSW_Type *ptr, int64_t *sec, uint32_t *nsec)
 Get RTC offset. More...
 
hpm_stat_t tsw_set_rtc_offset (TSW_Type *ptr, int64_t sec, uint32_t nsec)
 Set RTC offset. More...
 
hpm_stat_t tsw_set_rtc_offset_change (TSW_Type *ptr, uint32_t change)
 Set RTC offset change. More...
 
hpm_stat_t tsw_set_tsync_timer_hclkdiv (TSW_Type *ptr, uint8_t port, uint32_t host_clkdiv)
 Set TSYNC timer host clock divider. More...
 
hpm_stat_t tsw_tsync_timer_control (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t period, uint32_t enable)
 TSYNC timer control. More...
 
hpm_stat_t tsw_tsync_timer_interrupt_enable (TSW_Type *ptr, uint8_t port)
 TSYNC timer interrupt enable. More...
 
hpm_stat_t tsw_tsync_update_data (TSW_Type *ptr, uint8_t port, uint32_t bin, uint32_t binofs, uint32_t srcaddr, uint8_t lenbytes)
 TSYNC update data. More...
 
hpm_stat_t tsw_tsync_update_len (TSW_Type *ptr, uint8_t port, uint32_t bin, uint8_t lenbytes, uint8_t tqueue)
 TSYNC update length. More...
 
hpm_stat_t tsw_tsync_trigger_tx (TSW_Type *ptr, uint8_t port, uint32_t bin)
 TSYNC trigger TX. More...
 
hpm_stat_t tsw_tsync_get_txtimestamp (TSW_Type *ptr, uint8_t port, uint32_t bin, uint32_t *timestamplo, uint32_t *timestamphi)
 TSYNC get TX timestamp. More...
 
hpm_stat_t tsw_tsync_get_rxtimestamp (TSW_Type *ptr, uint8_t port, uint32_t *timestamplo, uint32_t *timestamphi)
 TSYNC get RX timestamp. More...
 
hpm_stat_t tsw_tsync_disable_current_events (TSW_Type *ptr, uint8_t port, uint32_t *disabled)
 TSYNC disable current events. More...
 
hpm_stat_t tsw_tsync_get_rxstatus (TSW_Type *ptr, uint8_t port, uint8_t *ov, uint8_t *avnxt, uint8_t *rxsel)
 TSYNC get RX status. More...
 
hpm_stat_t tsw_tsync_next_rxbuffer (TSW_Type *ptr, uint8_t port)
 TSYNC next RX buffer. More...
 
hpm_stat_t tsw_tsync_clear_overflow (TSW_Type *ptr, uint8_t port)
 TSYNC clear overflow status. More...
 
hpm_stat_t tsw_tsync_get_txdone (TSW_Type *ptr, uint8_t port, uint32_t *done)
 TSYNC get tx done status. More...
 
hpm_stat_t tsw_tsync_clear_txdone (TSW_Type *ptr, uint8_t port, uint32_t done)
 TSYNC clear tx done status. More...
 
hpm_stat_t tsw_tsync_get_tmrdone (TSW_Type *ptr, uint8_t port, uint32_t *done)
 TSYNC get tmr done status. More...
 
hpm_stat_t tsw_shap_get_tas_listlen (TSW_Type *ptr, uint8_t port, tsw_shap_tas_listlen_t *listlen)
 TSW get shap tas listlen. More...
 
hpm_stat_t tsw_shap_set_tas_cycletime (TSW_Type *ptr, uint8_t port, uint32_t cycle_time)
 SHAP set tas cycle. More...
 
hpm_stat_t tsw_shap_set_tas_controllist (TSW_Type *ptr, uint8_t port, uint32_t index, tsw_tas_controllist_entry_t *entry)
 SHAP set tas controllist. More...
 
hpm_stat_t tsw_shap_get_tas_controllist (TSW_Type *ptr, uint8_t port, uint32_t index, tsw_tas_controllist_entry_t *entry)
 SHAP get tas controllist. More...
 
hpm_stat_t tsw_shap_set_tas_max_sdu_ticks (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t ticks)
 Set tas maximum SDU ticks. More...
 
hpm_stat_t tsw_shap_get_tas_max_sdu_ticks (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t *ticks)
 Get tas maximum SDU ticks. More...
 
hpm_stat_t tsw_set_pps_tod_output (TSW_Type *ptr)
 Set pps tod output. More...
 
hpm_stat_t tsw_shap_enable_tas (TSW_Type *ptr, uint8_t port)
 Enable TAS. More...
 
hpm_stat_t tsw_shap_disable_tas (TSW_Type *ptr, uint8_t port)
 Disable TAS. More...
 
hpm_stat_t tsw_shap_set_tas_listlen (TSW_Type *ptr, uint8_t port, uint32_t listlen)
 Set TAS list length. More...
 
hpm_stat_t tsw_shap_set_tas_basetime (TSW_Type *ptr, uint8_t port, uint32_t basetime_sec, uint32_t basetime_ns)
 Set TAS base time. More...
 
hpm_stat_t tsw_shap_tas_change_config (TSW_Type *ptr, uint8_t port)
 Trigger to change TAS config. More...
 
hpm_stat_t tsw_shap_get_tas_crsr (TSW_Type *ptr, uint8_t port, uint32_t *crsr)
 Get TAS cycle time. More...
 
hpm_stat_t tsw_shap_set_tas (TSW_Type *ptr, uint8_t port, tsw_tas_config_t *config)
 Set TAS config. More...
 
hpm_stat_t tsw_shap_set_cbs (TSW_Type *ptr, uint8_t port, uint8_t index, tsw_cbs_config_t *config)
 Set CBS config. More...
 
hpm_stat_t tsw_get_txtimestampfifo_used (TSW_Type *ptr, uint8_t port, uint32_t *count)
 Get used countsed count from the TX-Timestamp FIFO. More...
 
hpm_stat_t tsw_get_txtimestampfifo_entry (TSW_Type *ptr, uint8_t port, tsw_tsf_t *entry)
 Get TX-Timestamp FIFO entry. More...
 
hpm_stat_t tsw_fpe_get_default_mms_ctrl_config (TSW_Type *ptr, uint8_t port, tsw_fpe_config_t *config)
 Get default MMS config. More...
 
hpm_stat_t tsw_fpe_enable_mms (TSW_Type *ptr, uint8_t port)
 Enable MMS. More...
 
hpm_stat_t tsw_fpe_disable_mms (TSW_Type *ptr, uint8_t port)
 Disable MMS. More...
 
hpm_stat_t tsw_fpe_set_mms_ctrl (TSW_Type *ptr, uint8_t port, tsw_fpe_config_t *config)
 Set MMS config. More...
 
hpm_stat_t tsw_fpe_reset_mms_statistics_counter (TSW_Type *ptr, uint8_t port, tsw_fpe_mms_statistics_counter_t counter)
 Reset MMS statistics counter. More...
 
hpm_stat_t tsw_fpe_get_mms_statistics_counter (TSW_Type *ptr, uint8_t port, tsw_fpe_mms_statistics_counter_t counter, uint32_t *value)
 Get MMS statistics counter. More...
 
hpm_stat_t tsw_cb_stmid_ingress_set_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry)
 Set STMID entry for ingress. More...
 
hpm_stat_t tsw_cb_stmid_ingress_get_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry)
 Get STMID entry for ingress. More...
 
hpm_stat_t tsw_cb_stmid_egress_set_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry)
 Set STMID entry for egress. More...
 
hpm_stat_t tsw_cb_frer_ingress_enable_rtag (TSW_Type *ptr)
 Enable RTAG with CB frer for ingress. More...
 
hpm_stat_t tsw_cb_frer_egress_set_sid_func (TSW_Type *ptr, tsw_cb_frer_sid_func_config_t *config)
 specify recovery functions for stream for egress More...
 
hpm_stat_t tsw_cb_frer_egress_set_recovery_func (TSW_Type *ptr, tsw_cb_frer_recovery_func_config_t *config)
 Set up recovery functions for stream with CB frer for egress. More...
 
hpm_stat_t tsw_cb_frer_egress_clear_latten_error_flag (TSW_Type *ptr)
 Clear latten error flag. More...
 
hpm_stat_t tsw_cb_frer_egress_get_count (TSW_Type *ptr, tsw_cb_frer_frame_count_egress_t *count)
 Get count of latten error. More...
 
hpm_stat_t tsw_psfp_set_filter (TSW_Type *ptr, tsw_psfp_filter_config_t *config)
 Set PSFP filter. More...
 
hpm_stat_t tsw_psfp_set_gate_static_mode (TSW_Type *ptr, tsw_psfp_gate_static_mode_config_t *config)
 Set PSFP gate with static mode. More...
 
hpm_stat_t tsw_psfp_set_gate_dynamic_mode (TSW_Type *ptr, tsw_psfp_gate_dynamic_mode_config_t *config)
 Set PSFP gate with dynamic mode. More...
 
hpm_stat_t tsw_psfp_set_flow_meter (TSW_Type *ptr, tsw_psfp_flow_meter_config_t *config)
 Set PSFP flow meter. More...
 

Detailed Description

TSW driver APIs.

Macro Definition Documentation

◆ MAC_HI

#define MAC_HI (   mac)    (uint32_t)(mac[4] | (mac[5] << 8))

◆ MAC_LO

#define MAC_LO (   mac)    (uint32_t)(mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24))

◆ MAC_MDIO_CTRL_OP_RD

#define MAC_MDIO_CTRL_OP_RD   (0x02)

◆ MAC_MDIO_CTRL_OP_WR

#define MAC_MDIO_CTRL_OP_WR   (0x01)

◆ TSW_BUS_FREQ

#define TSW_BUS_FREQ   (100000000UL)

◆ TSW_FPE_MMS_MAX_VTIME_MAX

#define TSW_FPE_MMS_MAX_VTIME_MAX   (128U) /* 128ms */

◆ TSW_FPE_MMS_MIN_VTIME_MIN

#define TSW_FPE_MMS_MIN_VTIME_MIN   (1U) /* 1ms */

◆ TSW_NS_IN_ONE_SEC

#define TSW_NS_IN_ONE_SEC   (1000000000UL)

◆ TSW_RECV_BUFF_LEN

#define TSW_RECV_BUFF_LEN   (1536U)

◆ TSW_RECV_DESC_COUNT

#define TSW_RECV_DESC_COUNT   (16U)

◆ TSW_SEND_BUFF_LEN

#define TSW_SEND_BUFF_LEN   (1536U)

◆ TSW_SEND_DESC_COUNT

#define TSW_SEND_DESC_COUNT   (16U)

Enumeration Type Documentation

◆ tsw_cb_frer_algo_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_cb_frer_algo_vector_recovery 
tsw_cb_frer_algo_match_recovery 

◆ tsw_cb_frer_frame_ount_egress_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
presented_frames 
discarded_frames 
tagless_frames 
rougue_frames 
out_of_oder_frames 
lost_frames 
recover_func_resets 
latent_err_dectection_resets 

◆ tsw_cb_frer_xfunc_recovery_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_cb_frer_xfunc_recovery_sequence 
tsw_cb_frer_xfunc_recovery_individual 

◆ tsw_cpu_send_to_port_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_cpu_send_to_lookup 
tsw_cpu_send_to_port_1 
tsw_cpu_send_to_port_2 
tsw_cpu_send_to_port_3 
tsw_cpu_send_to_all_ports 

◆ tsw_dst_t

enum tsw_dst_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_dst_port_null 
tsw_dst_port_cpu 
tsw_dst_port_1 
tsw_dst_port_2 
tsw_dst_port_3 

◆ tsw_fpe_mms_fragment_size_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_fpe_mms_fragment_size_60_octets 
tsw_fpe_mms_fragment_size_124_octets 
tsw_fpe_mms_fragment_size_188_octets 
tsw_fpe_mms_fragment_size_252_octets 

◆ tsw_fpe_mms_statistics_counter_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_fpe_mms_frame_reassembly_error_counter 
tsw_fpe_mms_frame_rejected_due_to_wrong_smd 
tsw_fpe_mms_frame_assembly_ok_counter 
tsw_fpe_mms_fragment_rx_counter 
tsw_fpe_mms_fragment_tx_counter 
tsw_fpe_mms_hold_request_counter 

◆ tsw_mac_mode_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_mac_mode_mii 
tsw_mac_mode_gmii 

◆ tsw_port_phy_itf_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_port_phy_itf_mii 
tsw_port_phy_itf_rmii 
tsw_port_phy_itf_rgmii 

◆ tsw_port_speed_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_port_speed_10mbps 
tsw_port_speed_100mbps 
tsw_port_speed_1000mbps 

◆ tsw_pps_ctrl_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_pps_ctrl_pps 
tsw_pps_ctrl_bin_2hz_digital_1hz 
tsw_pps_ctrl_bin_4hz_digital_2hz 
tsw_pps_ctrl_bin_8hz_digital_4hz 
tsw_pps_ctrl_bin_16hz_digital_8hz 
tsw_pps_ctrl_bin_32hz_digital_16hz 
tsw_pps_ctrl_bin_64hz_digital_32hz 
tsw_pps_ctrl_bin_128hz_digital_64hz 
tsw_pps_ctrl_bin_256hz_digital_128hz 
tsw_pps_ctrl_bin_512hz_digital_256hz 
tsw_pps_ctrl_bin_1024hz_digital_512hz 
tsw_pps_ctrl_bin_2048hz_digital_1024hz 
tsw_pps_ctrl_bin_4096hz_digital_2048hz 
tsw_pps_ctrl_bin_8192hz_digital_4096hz 
tsw_pps_ctrl_bin_16384hz_digital_8192hz 
tsw_pps_ctrl_bin_32768hz_digital_16384hz 

◆ tsw_psfp_gate_mode_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_psfp_gate_mode_static 
tsw_psfp_gate_mode_dynamic 
tsw_psfp_gate_mode_unknown 

◆ tsw_psfp_gate_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_psfp_gate_closed 
tsw_psfp_gate_open 

◆ tsw_shap_tas_aclist_state_open_queue_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_shap_tas_aclist_state_open_queueu_0 
tsw_shap_tas_aclist_state_open_queueu_1 
tsw_shap_tas_aclist_state_open_queueu_2 
tsw_shap_tas_aclist_state_open_queueu_3 
tsw_shap_tas_aclist_state_open_queueu_4 
tsw_shap_tas_aclist_state_open_queueu_5 
tsw_shap_tas_aclist_state_open_queueu_6 
tsw_shap_tas_aclist_state_open_queueu_7 
tsw_shap_tas_aclist_state_open_queueu_all 

◆ tsw_shap_tas_alist_op_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_shap_tas_aclist_op_set_gate_states 
tsw_shap_tas_aclist_op_set_and_hold_mac 
tsw_shap_tas_aclist_op_set_and_release_mac 

◆ tsw_stmid_active_dest_mac_control_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_stmid_actctl_disabled 
tsw_stmid_actctl_use_amac_with_removed_vlan_tag 
tsw_stmid_actctl_use_amac_with_replaced_or_inserted_vlan_tag 

◆ tsw_stmid_control_lookup_mode_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_stmid_control_lookup_by_dest_mac 
tsw_stmid_control_lookup_by_src_mac 

◆ tsw_stmid_lookup_mode_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_stmid_lookup_mode_priority 
tsw_stmid_lookup_mode_tagged 
tsw_stmid_lookup_mode_all 

◆ tsw_traffic_queue_t

#include <drivers/inc/hpm_tsw_drv.h>

Enumerator
tsw_traffic_queue_0 
tsw_traffic_queue_1 
tsw_traffic_queue_2 
tsw_traffic_queue_3 
tsw_traffic_queue_4 
tsw_traffic_queue_5 
tsw_traffic_queue_6 
tsw_traffic_queue_7 

Function Documentation

◆ tsw_cb_frer_egress_clear_latten_error_flag()

hpm_stat_t tsw_cb_frer_egress_clear_latten_error_flag ( TSW_Type ptr)

#include <drivers/inc/hpm_tsw_drv.h>

Clear latten error flag.

Parameters
ptr[in]TSW peripheral base address
Returns
hpm_stat_t Result of clearing latten error flag hpm_stat_t

◆ tsw_cb_frer_egress_get_count()

hpm_stat_t tsw_cb_frer_egress_get_count ( TSW_Type ptr,
tsw_cb_frer_frame_count_egress_t count 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get count of latten error.

Parameters
ptr[in]TSW peripheral base address
count[out]Pointer to value of frer egress counters
Returns
hpm_stat_t Result of getting count of latten error hpm_stat_t

◆ tsw_cb_frer_egress_set_recovery_func()

hpm_stat_t tsw_cb_frer_egress_set_recovery_func ( TSW_Type ptr,
tsw_cb_frer_recovery_func_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set up recovery functions for stream with CB frer for egress.

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to recovery functions config tsw_cb_frer_recovery_func_config_t
Returns
hpm_stat_t Result of setting up recovery functions for stream with CB frer for egress hpm_stat_t

◆ tsw_cb_frer_egress_set_sid_func()

hpm_stat_t tsw_cb_frer_egress_set_sid_func ( TSW_Type ptr,
tsw_cb_frer_sid_func_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

specify recovery functions for stream for egress

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to recovery functions config tsw_cb_frer_sid_func_config_t
Returns
hpm_stat_t Result of setting up recovery functions for stream with CB frer for egress hpm_stat_t

◆ tsw_cb_frer_ingress_enable_rtag()

hpm_stat_t tsw_cb_frer_ingress_enable_rtag ( TSW_Type ptr)

#include <drivers/inc/hpm_tsw_drv.h>

Enable RTAG with CB frer for ingress.

Parameters
ptr[in]TSW peripheral base address
Returns
hpm_stat_t Result of enabling RTAG with frer for ingress hpm_stat_t

◆ tsw_cb_stmid_egress_set_entry()

hpm_stat_t tsw_cb_stmid_egress_set_entry ( TSW_Type ptr,
tsw_cb_stmid_entry_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set STMID entry for egress.

Parameters
ptr[in]TSW peripheral base address
entry[in]Pointer to STMID entry tsw_cb_stmid_entry_t
Returns
hpm_stat_t Result of setting STMID entry for egress hpm_stat_t

◆ tsw_cb_stmid_ingress_get_entry()

hpm_stat_t tsw_cb_stmid_ingress_get_entry ( TSW_Type ptr,
tsw_cb_stmid_entry_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get STMID entry for ingress.

Parameters
ptr[in]TSW peripheral base address
entry[out]Pointer to STMID entry tsw_cb_stmid_entry_t
Returns
hpm_stat_t Result of getting STMID entry for ingress hpm_stat_t

◆ tsw_cb_stmid_ingress_set_entry()

hpm_stat_t tsw_cb_stmid_ingress_set_entry ( TSW_Type ptr,
tsw_cb_stmid_entry_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set STMID entry for ingress.

Parameters
ptr[in]TSW peripheral base address
entry[in]Pointer to STMID entry tsw_cb_stmid_entry_t
Returns
hpm_stat_t Result of setting STMID entry for ingress hpm_stat_t

◆ tsw_clear_cam()

void tsw_clear_cam ( TSW_Type ptr)

#include <drivers/inc/hpm_tsw_drv.h>

Clear CAM.

Parameters
[in]ptrTSW peripheral base address

◆ tsw_commit_recv_desc()

hpm_stat_t tsw_commit_recv_desc ( TSW_Type ptr,
uint8_t *  buffer,
uint16_t  length,
uint8_t  id 
)

#include <drivers/inc/hpm_tsw_drv.h>

Commit a receive DMA descriptor.

Parameters
[in]ptrTSW peripheral base address
[in]bufferPointer to a buffer of the frame to be received
[in]lengthBuffer length
[in]idFrame index
Returns
Result of the received frame

◆ tsw_disable_store_forward_mode()

void tsw_disable_store_forward_mode ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Disable RXFIFO to store and forward mode.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number

◆ tsw_enable_store_forward_mode()

void tsw_enable_store_forward_mode ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Enable RXFIFO to store and forward mode.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number

◆ tsw_ep_disable_all_mac_ctrl()

hpm_stat_t tsw_ep_disable_all_mac_ctrl ( TSW_Type ptr,
uint8_t  mac_type 
)

#include <drivers/inc/hpm_tsw_drv.h>

Disable All MAC Controllers.

Parameters
[in]ptrTSW peripheral base address
[in]mac_typeMAC type 0:EMAC/1:PMAC
Returns
Result of disabling all MAC controllers

◆ tsw_ep_disable_mac_ctrl()

hpm_stat_t tsw_ep_disable_mac_ctrl ( TSW_Type ptr,
uint8_t  port,
uint8_t  mac_type 
)

#include <drivers/inc/hpm_tsw_drv.h>

Disable MAC Controller.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]mac_typeMAC type 0:EMAC/1:PMAC
Returns
Result of disabling MAC controller

◆ tsw_ep_enable_all_mac_ctrl()

hpm_stat_t tsw_ep_enable_all_mac_ctrl ( TSW_Type ptr,
uint8_t  mac_type 
)

#include <drivers/inc/hpm_tsw_drv.h>

Enable All MAC Controllers.

Parameters
[in]ptrTSW peripheral base address
[in]mac_typeMAC type 0:EMAC/1:PMAC
Returns
Result of enabling all MAC controllers

◆ tsw_ep_enable_mac_ctrl()

hpm_stat_t tsw_ep_enable_mac_ctrl ( TSW_Type ptr,
uint8_t  port,
uint8_t  mac_type 
)

#include <drivers/inc/hpm_tsw_drv.h>

Enable MAC Controller.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]mac_typeMAC type 0:EMAC/1:PMAC
Returns
Result of enabling MAC controller

◆ tsw_ep_mdio_read()

hpm_stat_t tsw_ep_mdio_read ( TSW_Type ptr,
uint8_t  port,
uint32_t  phy_addr,
uint32_t  reg_addr,
uint16_t *  data 
)

#include <drivers/inc/hpm_tsw_drv.h>

MDIO Read.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]phy_addrTSW clock division
[in]reg_addrPHY register address
[out]dataPointer to data memory
Returns
Result of MDIO read

◆ tsw_ep_mdio_write()

hpm_stat_t tsw_ep_mdio_write ( TSW_Type ptr,
uint8_t  port,
uint32_t  phy_addr,
uint32_t  reg_addr,
uint16_t  data 
)

#include <drivers/inc/hpm_tsw_drv.h>

MDIO Write.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]phy_addrTSW clock division
[in]reg_addrPHY register address
[in]dataData value
Returns
Result of MDIO write

◆ tsw_ep_set_mac_addr()

hpm_stat_t tsw_ep_set_mac_addr ( TSW_Type ptr,
uint8_t  port,
uint8_t *  mac_addr,
bool  promisc 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set MAC Address.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]mac_addrPointer to MAC address
[in]promiscPromiscuous Mode: Set true to enable; set false to disable
Returns
Result of setting MAC address

◆ tsw_ep_set_mac_mode()

hpm_stat_t tsw_ep_set_mac_mode ( TSW_Type ptr,
uint8_t  port,
uint8_t  gmii 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set MAC Mode.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]mac_addrPointer to MAC address
[in]promiscPromiscuous Mode: Set true to enable; set false to disable
Returns
Result of setting MAC address

◆ tsw_ep_set_mdio_config()

hpm_stat_t tsw_ep_set_mdio_config ( TSW_Type ptr,
uint8_t  port,
uint8_t  clk_div 
)

#include <drivers/inc/hpm_tsw_drv.h>

MDIO Interface Config.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]clk_divTSW clock division
Returns
Result of MDIO interface config

◆ tsw_fpe_disable_mms()

hpm_stat_t tsw_fpe_disable_mms ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Disable MMS.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
Returns
hpm_stat_t Result of disabling MMS hpm_stat_t

◆ tsw_fpe_enable_mms()

hpm_stat_t tsw_fpe_enable_mms ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Enable MMS.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
Returns
hpm_stat_t Result of enabling MMS hpm_stat_t

◆ tsw_fpe_get_default_mms_ctrl_config()

hpm_stat_t tsw_fpe_get_default_mms_ctrl_config ( TSW_Type ptr,
uint8_t  port,
tsw_fpe_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get default MMS config.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
config[out]Pointer to MMS config tsw_fpe_config_t
Returns
* hpm_stat_t Result of getting default MMS config hpm_stat_t

◆ tsw_fpe_get_mms_statistics_counter()

hpm_stat_t tsw_fpe_get_mms_statistics_counter ( TSW_Type ptr,
uint8_t  port,
tsw_fpe_mms_statistics_counter_t  counter,
uint32_t *  value 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get MMS statistics counter.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
counter[in]MMS statistics counter
value[out]Pointer to MMS statistics counter value
Returns
hpm_stat_t Result of getting MMS statistics counter hpm_stat_t

◆ tsw_fpe_reset_mms_statistics_counter()

hpm_stat_t tsw_fpe_reset_mms_statistics_counter ( TSW_Type ptr,
uint8_t  port,
tsw_fpe_mms_statistics_counter_t  counter 
)

#include <drivers/inc/hpm_tsw_drv.h>

Reset MMS statistics counter.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
counter[in]MMS statistics counter
Returns
hpm_stat_t Result of resetting MMS statistics counter hpm_stat_t

◆ tsw_fpe_set_mms_ctrl()

hpm_stat_t tsw_fpe_set_mms_ctrl ( TSW_Type ptr,
uint8_t  port,
tsw_fpe_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set MMS config.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
config[in]Pointer to MMS config tsw_fpe_config_t
Returns
hpm_stat_t Result of setting MMS config hpm_stat_t

◆ tsw_get_default_dma_config()

void tsw_get_default_dma_config ( tsw_dma_config_t config)

#include <drivers/inc/hpm_tsw_drv.h>

Get default DMA configuration.

Parameters
[out]configDMA configuration struct tsw_dma_config_t

◆ tsw_get_rtc_current_time()

hpm_stat_t tsw_get_rtc_current_time ( TSW_Type ptr,
uint32_t *  sec,
uint32_t *  nsec 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get RTC current time.

Parameters
[in]ptrTSW peripheral base address
[out]secseconds
[out]nsecnanoseconds
Returns
Result of getting RTC current time hpm_stat_t

◆ tsw_get_rtc_offset()

hpm_stat_t tsw_get_rtc_offset ( TSW_Type ptr,
int64_t *  sec,
uint32_t *  nsec 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get RTC offset.

Parameters
[in]ptrTSW peripheral base address
[out]secseconds
[out]nsecnanoseconds
Returns
Result of getting RTC offset hpm_stat_t

◆ tsw_get_rtc_time_increment()

hpm_stat_t tsw_get_rtc_time_increment ( TSW_Type ptr,
uint32_t *  increment 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get RTC timer increment value.

Parameters
[in]ptrTSW peripheral base address
[in]incrementlocal time increment
Returns
Result of getting RTC timer increment value hpm_stat_t

◆ tsw_get_txtimestampfifo_entry()

hpm_stat_t tsw_get_txtimestampfifo_entry ( TSW_Type ptr,
uint8_t  port,
tsw_tsf_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get TX-Timestamp FIFO entry.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
entry[out]Pointer to TX-Timestamp FIFO entry tsw_tsf_t
Returns
hpm_stat_t Result of getting TX-Timestamp FIFO entry hpm_stat_t

◆ tsw_get_txtimestampfifo_used()

hpm_stat_t tsw_get_txtimestampfifo_used ( TSW_Type ptr,
uint8_t  port,
uint32_t *  count 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get used countsed count from the TX-Timestamp FIFO.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
count[out]Pointer to used count in TX-Timestamp FIFO
Returns
hpm_stat_t Result of getting used count from TX-Timestamp FIFO hpm_stat_t

◆ tsw_init_recv()

void tsw_init_recv ( TSW_Type ptr,
tsw_dma_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Initialize TSW receive DMA.

Parameters
ptrTSW peripheral base address
configDMA configuration struct tsw_dma_config_t

◆ tsw_init_send()

void tsw_init_send ( TSW_Type ptr,
tsw_dma_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Initialize TSW send DMA.

Parameters
ptrTSW peripheral base address
configDMA configuration struct tsw_dma_config_t

◆ tsw_mac_lookup_bypass()

void tsw_mac_lookup_bypass ( TSW_Type ptr,
uint8_t  dst_port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Lookup Bypass Setting.

Parameters
[in]ptrTSW peripheral base address
[in]dst_portDestination port number

◆ tsw_port_gpr()

void tsw_port_gpr ( TSW_Type ptr,
uint8_t  port,
uint8_t  speed,
uint8_t  itf,
uint8_t  tx_dly,
uint8_t  rx_dly 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set Port GPR.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]speedPointer to MAC address
[in]itfPromiscuous Mode: Set true to enable; set false to disable
[in]tx_dlyTx delay
[in]rx_dlayRx delay

speed: 00 1000mbps, 11 100mbps, 10 10mpbs itf: 000 MII; 001 RGMII; 100 RMII

◆ tsw_psfp_set_filter()

hpm_stat_t tsw_psfp_set_filter ( TSW_Type ptr,
tsw_psfp_filter_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set PSFP filter.

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to PSFP filter config tsw_psfp_filter_config_t
Returns
hpm_stat_t Result of setting PSFP filter hpm_stat_t

◆ tsw_psfp_set_flow_meter()

hpm_stat_t tsw_psfp_set_flow_meter ( TSW_Type ptr,
tsw_psfp_flow_meter_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set PSFP flow meter.

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to PSFP flow meter config tsw_psfp_flow_meter_config_t
Returns
hpm_stat_t Result of setting PSFP flow meter hpm_stat_t

◆ tsw_psfp_set_gate_dynamic_mode()

hpm_stat_t tsw_psfp_set_gate_dynamic_mode ( TSW_Type ptr,
tsw_psfp_gate_dynamic_mode_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set PSFP gate with dynamic mode.

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to PSFP gate config tsw_psfp_gate_dynamic_mode_config_t
Returns
hpm_stat_t Result of setting PSFP gate with dynamic mode hpm_stat_t

◆ tsw_psfp_set_gate_static_mode()

hpm_stat_t tsw_psfp_set_gate_static_mode ( TSW_Type ptr,
tsw_psfp_gate_static_mode_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set PSFP gate with static mode.

Parameters
ptr[in]TSW peripheral base address
config[in]Pointer to PSFP gate config tsw_psfp_gate_static_mode_config_t
Returns
hpm_stat_t Result of setting PSFP gate with static mode hpm_stat_t

◆ tsw_recv_frame()

hpm_stat_t tsw_recv_frame ( TSW_Type ptr,
tsw_frame_t frame 
)

#include <drivers/inc/hpm_tsw_drv.h>

Receive a frame from CPU port.

Parameters
[in]ptrTSW peripheral base address
[in]framea struct pointer to a tsw frame struct tsw_frame_t
Returns
Result of the received frame

◆ tsw_send_frame()

hpm_stat_t tsw_send_frame ( TSW_Type ptr,
uint8_t *  buffer,
uint16_t  length,
uint8_t  id 
)

#include <drivers/inc/hpm_tsw_drv.h>

Send a frame to CPU port.

Parameters
[in]ptrTSW peripheral base address
[in]lengthFrame length
[in]idFrame index
Returns
Result of the transmission

◆ tsw_set_broadcast_frame_action()

void tsw_set_broadcast_frame_action ( TSW_Type ptr,
uint8_t  dest_port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set Broadcast Frame Action.

Parameters
[in]ptrTSW peripheral base address
[in]dest_portDestination port number

◆ tsw_set_cam_vlan_port()

void tsw_set_cam_vlan_port ( TSW_Type ptr)

#include <drivers/inc/hpm_tsw_drv.h>

CAM VLAN Setting.

Parameters
[in]ptrTSW peripheral base address
[in]dst_portDestination port number

◆ tsw_set_internal_frame_action()

void tsw_set_internal_frame_action ( TSW_Type ptr,
uint8_t  dest_port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set Internal Frame Action.

Parameters
[in]ptrTSW peripheral base address
[in]dest_portDestination port number

◆ tsw_set_lookup_table()

void tsw_set_lookup_table ( TSW_Type ptr,
uint16_t  entry_num,
uint8_t  dest_port,
uint64_t  dest_mac 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set Lookup Table.

Parameters
[in]ptrTSW peripheral base address
[in]entry_numEntry number
[in]dest_portDestination port number
[in]dest_macDestination MAC address

◆ tsw_set_port_clock_delay()

void tsw_set_port_clock_delay ( TSW_Type ptr,
uint8_t  port,
uint8_t  tx_dly,
uint8_t  rx_dly 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TSW port clock delay.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]tx_dlyTSW port TX clock delay
[in]rx_dlyTSW port RX clock delay

◆ tsw_set_port_interface()

void tsw_set_port_interface ( TSW_Type ptr,
uint8_t  port,
uint8_t  itf 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TSW port interface type.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]itfTSW port speed tsw_port_phy_itf_t

◆ tsw_set_port_speed()

void tsw_set_port_speed ( TSW_Type ptr,
uint8_t  port,
uint8_t  speed 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TSW port speed.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port number
[in]speedTSW port speed tsw_port_speed_t

◆ tsw_set_pps_tod_output()

hpm_stat_t tsw_set_pps_tod_output ( TSW_Type ptr)

#include <drivers/inc/hpm_tsw_drv.h>

Set pps tod output.

Parameters
[in]ptrTSW peripheral base address
Returns
Result of setting pps tod output hpm_stat_t

◆ tsw_set_rtc_offset()

hpm_stat_t tsw_set_rtc_offset ( TSW_Type ptr,
int64_t  sec,
uint32_t  nsec 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set RTC offset.

Parameters
[in]ptrTSW peripheral base address
[in]secseconds
[in]nsecnanoseconds
Returns
Result of setting RTC offset hpm_stat_t

◆ tsw_set_rtc_offset_change()

hpm_stat_t tsw_set_rtc_offset_change ( TSW_Type ptr,
uint32_t  change 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set RTC offset change.

Parameters
[in]ptrTSW peripheral base address
[in]changeoffset change
Returns
Result of setting RTC offset change hpm_stat_t

◆ tsw_set_rtc_time_increment()

hpm_stat_t tsw_set_rtc_time_increment ( TSW_Type ptr,
uint32_t  increment 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set RTC timer increment value.

Parameters
[in]ptrTSW peripheral base address
[in]incrementlocal time increment
Returns
Result of setting RTC timer increment value hpm_stat_t

◆ tsw_set_tsync_timer_hclkdiv()

hpm_stat_t tsw_set_tsync_timer_hclkdiv ( TSW_Type ptr,
uint8_t  port,
uint32_t  host_clkdiv 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TSYNC timer host clock divider.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]host_clkdivTSYNC timer host clock divider
Returns
Result of setting TSYNC timer host clock divider hpm_stat_t

◆ tsw_set_unknown_frame_action()

void tsw_set_unknown_frame_action ( TSW_Type ptr,
uint8_t  dest_port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set Unknow Frame Action.

Parameters
[in]ptrTSW peripheral base address
[in]dest_portDestination port number

◆ tsw_shap_disable_tas()

hpm_stat_t tsw_shap_disable_tas ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Disable TAS.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
Returns
hpm_stat_t Result of disabling tas hpm_stat_t

◆ tsw_shap_enable_tas()

hpm_stat_t tsw_shap_enable_tas ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Enable TAS.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
Returns
hpm_stat_t Result of enabling tas hpm_stat_t

◆ tsw_shap_get_tas_controllist()

hpm_stat_t tsw_shap_get_tas_controllist ( TSW_Type ptr,
uint8_t  port,
uint32_t  index,
tsw_tas_controllist_entry_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

SHAP get tas controllist.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]indexIndex of the traffic queue
[out]entryPointer to a structure of tsw_shap_tas_controllist_config_t tsw_shap_tas_controllist_config_t
Returns
Result of getting tas controllist hpm_stat_t

◆ tsw_shap_get_tas_crsr()

hpm_stat_t tsw_shap_get_tas_crsr ( TSW_Type ptr,
uint8_t  port,
uint32_t *  crsr 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get TAS cycle time.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
crsr[out]TAS Status
Returns
hpm_stat_t Result of getting tas status hpm_stat_t

◆ tsw_shap_get_tas_listlen()

hpm_stat_t tsw_shap_get_tas_listlen ( TSW_Type ptr,
uint8_t  port,
tsw_shap_tas_listlen_t listlen 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSW get shap tas listlen.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[out]listlenTAS listlen
Returns
Result of getting shap tas listlen hpm_stat_t

◆ tsw_shap_get_tas_max_sdu_ticks()

hpm_stat_t tsw_shap_get_tas_max_sdu_ticks ( TSW_Type ptr,
uint8_t  port,
uint8_t  index,
uint32_t *  ticks 
)

#include <drivers/inc/hpm_tsw_drv.h>

Get tas maximum SDU ticks.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]indexIndex of the traffic queue
[out]ticksMaximum SDU ticks
Returns
Result of getting tas maximum SDU ticks hpm_stat_t

◆ tsw_shap_set_cbs()

hpm_stat_t tsw_shap_set_cbs ( TSW_Type ptr,
uint8_t  port,
uint8_t  index,
tsw_cbs_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set CBS config.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
index[in]Traffic queue index
config[in]Pointer to CBS config tsw_cbs_config_t
Returns
hpm_stat_t Result of setting CBS config hpm_stat_t

◆ tsw_shap_set_tas()

hpm_stat_t tsw_shap_set_tas ( TSW_Type ptr,
uint8_t  port,
tsw_tas_config_t config 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TAS config.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
config[in]Pointer to TAS config tsw_tas_config_t
Returns
hpm_stat_t Result of setting TAS config hpm_stat_t

◆ tsw_shap_set_tas_basetime()

hpm_stat_t tsw_shap_set_tas_basetime ( TSW_Type ptr,
uint8_t  port,
uint32_t  basetime_sec,
uint32_t  basetime_ns 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TAS base time.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
basetime_sec[in]second part of base time
basetime_ns[in]nanosecond part of base time
Returns
hpm_stat_t Result of setting tas base time hpm_stat_t

◆ tsw_shap_set_tas_controllist()

hpm_stat_t tsw_shap_set_tas_controllist ( TSW_Type ptr,
uint8_t  port,
uint32_t  index,
tsw_tas_controllist_entry_t entry 
)

#include <drivers/inc/hpm_tsw_drv.h>

SHAP set tas controllist.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]indexIndex of the controllist
[in]entryPointer to a structure of tsw_shap_tas_listlen_t tsw_shap_tas_listlen_t
Returns
Result of setting tas controllist hpm_stat_t

◆ tsw_shap_set_tas_cycletime()

hpm_stat_t tsw_shap_set_tas_cycletime ( TSW_Type ptr,
uint8_t  port,
uint32_t  cycle_time 
)

#include <drivers/inc/hpm_tsw_drv.h>

SHAP set tas cycle.

Set TAS cycle time.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]cycle_timeTAS cycle time
Returns
Result of setting tas cycle hpm_stat_t
Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
cycle_time[in]cycle time
Returns
hpm_stat_t Result of setting tas cycle time hpm_stat_t

◆ tsw_shap_set_tas_listlen()

hpm_stat_t tsw_shap_set_tas_listlen ( TSW_Type ptr,
uint8_t  port,
uint32_t  listlen 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set TAS list length.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
listlen[in]list length
Returns
hpm_stat_t Result of setting tas list length hpm_stat_t

◆ tsw_shap_set_tas_max_sdu_ticks()

hpm_stat_t tsw_shap_set_tas_max_sdu_ticks ( TSW_Type ptr,
uint8_t  port,
uint8_t  index,
uint32_t  ticks 
)

#include <drivers/inc/hpm_tsw_drv.h>

Set tas maximum SDU ticks.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]indexIndex of the traffic queue
[in]ticksMaximum SDU ticks
Returns
Result of setting tas maximum SDU ticks hpm_stat_t

◆ tsw_shap_tas_change_config()

hpm_stat_t tsw_shap_tas_change_config ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

Trigger to change TAS config.

Parameters
ptr[in]TSW peripheral base address
port[in]TSW port
Returns
hpm_stat_t Result of triggering to change tas config hpm_stat_t

◆ tsw_tsync_clear_overflow()

hpm_stat_t tsw_tsync_clear_overflow ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC clear overflow status.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
Returns
Result of clearing overflow status hpm_stat_t

◆ tsw_tsync_clear_txdone()

hpm_stat_t tsw_tsync_clear_txdone ( TSW_Type ptr,
uint8_t  port,
uint32_t  done 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC clear tx done status.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]doneTx done status
Returns
Result of clearing tx done status hpm_stat_t

◆ tsw_tsync_disable_current_events()

hpm_stat_t tsw_tsync_disable_current_events ( TSW_Type ptr,
uint8_t  port,
uint32_t *  disabled 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC disable current events.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[out]disaDisable current events
Returns
Result of disabling current events hpm_stat_t

◆ tsw_tsync_get_rxstatus()

hpm_stat_t tsw_tsync_get_rxstatus ( TSW_Type ptr,
uint8_t  port,
uint8_t *  ov,
uint8_t *  avnxt,
uint8_t *  rxsel 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC get RX status.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[out]ovOverflow status
[out]rxstatusRX status
Returns
Result of getting RX status hpm_stat_t

◆ tsw_tsync_get_rxtimestamp()

hpm_stat_t tsw_tsync_get_rxtimestamp ( TSW_Type ptr,
uint8_t  port,
uint32_t *  timestamplo,
uint32_t *  timestamphi 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC get RX timestamp.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[out]timestamploTSYNC RX timestamp low
[out]timestamphiTSYNC RX timestamp high
Returns
Result of getting TSYNC RX timestamp hpm_stat_t

◆ tsw_tsync_get_tmrdone()

hpm_stat_t tsw_tsync_get_tmrdone ( TSW_Type ptr,
uint8_t  port,
uint32_t *  done 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC get tmr done status.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]doneTmr done status
Returns
Result of getting tmr done status hpm_stat_t

◆ tsw_tsync_get_txdone()

hpm_stat_t tsw_tsync_get_txdone ( TSW_Type ptr,
uint8_t  port,
uint32_t *  done 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC get tx done status.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[out]doneTx done status
Returns
Result of getting tx done status hpm_stat_t

◆ tsw_tsync_get_txtimestamp()

hpm_stat_t tsw_tsync_get_txtimestamp ( TSW_Type ptr,
uint8_t  port,
uint32_t  bin,
uint32_t *  timestamplo,
uint32_t *  timestamphi 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC get TX timestamp.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]binTSYNC bin
[out]timestamploTSYNC TX timestamp low
[out]timestamphiTSYNC TX timestamp high
Returns
Result of getting TSYNC TX timestamp hpm_stat_t

◆ tsw_tsync_next_rxbuffer()

hpm_stat_t tsw_tsync_next_rxbuffer ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC next RX buffer.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
Returns
Result of next RX buffer hpm_stat_t

◆ tsw_tsync_timer_control()

hpm_stat_t tsw_tsync_timer_control ( TSW_Type ptr,
uint8_t  port,
uint8_t  index,
uint32_t  period,
uint32_t  enable 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC timer control.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]indexTSYNC timer index
[in]periodTSYNC timer period
[in]enableTSYNC timer enable
Returns
Result of setting TSYNC timer control hpm_stat_t

◆ tsw_tsync_timer_interrupt_enable()

hpm_stat_t tsw_tsync_timer_interrupt_enable ( TSW_Type ptr,
uint8_t  port 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC timer interrupt enable.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
Returns
Result of enabling TSYNC timer interrupt hpm_stat_t

◆ tsw_tsync_trigger_tx()

hpm_stat_t tsw_tsync_trigger_tx ( TSW_Type ptr,
uint8_t  port,
uint32_t  bin 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC trigger TX.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]binTSYNC bin
Returns
Result of triggering TSYNC TX hpm_stat_t

◆ tsw_tsync_update_data()

hpm_stat_t tsw_tsync_update_data ( TSW_Type ptr,
uint8_t  port,
uint32_t  bin,
uint32_t  binofs,
uint32_t  srcaddr,
uint8_t  lenbytes 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC update data.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]binTSYNC bin
[in]binofsTSYNC bin offset
[in]srcaddrSource address of data to be updated
[in]lenbytesLength in bytes
Returns
Result of updating TSYNC length hpm_stat_t

◆ tsw_tsync_update_len()

hpm_stat_t tsw_tsync_update_len ( TSW_Type ptr,
uint8_t  port,
uint32_t  bin,
uint8_t  lenbytes,
uint8_t  tqueue 
)

#include <drivers/inc/hpm_tsw_drv.h>

TSYNC update length.

Parameters
[in]ptrTSW peripheral base address
[in]portTSW port
[in]binTSYNC bin
[in]lenbytesLength in bytes
Returns
Result of updating TSYNC length hpm_stat_t