Go to the source code of this file.
Classes | |
struct | oa_tc6_frame_buffer |
Stores an Ethernet frame along with metadata needed for parsing. The MAC driver or the user application will receive and submit frames for transmission in this format. More... | |
struct | oa_tc6_desc |
Holds the frame buffers and the communication descriptor for the OA TC6 driver. More... | |
struct | oa_tc6_init_param |
Holds the initialization parameters for the OA TC6 driver. More... | |
Enumerations | |
enum | oa_tc6_user_buffer_state { OA_BUFF_FREE , OA_BUFF_RX_IN_PROGRESS , OA_BUFF_RX_COMPLETE , OA_BUFF_RX_USER_OWNED , OA_BUFF_TX_BUSY , OA_BUFF_TX_READY } |
State for data buffers containing Ethernet frames. More... | |
Functions | |
int | oa_tc6_reg_read (struct oa_tc6_desc *, uint32_t, uint32_t *) |
Read a register value. | |
int | oa_tc6_reg_write (struct oa_tc6_desc *, uint32_t, uint32_t) |
Write a register value. | |
int | oa_tc6_reg_update (struct oa_tc6_desc *, uint32_t, uint32_t, uint32_t) |
Update a field inside a register. | |
int | oa_tc6_get_rx_frame_match_vs (struct oa_tc6_desc *, struct oa_tc6_frame_buffer **, uint8_t, uint8_t) |
Get a frame buffer that is ready to be read by the user. The VS field in the chunk footer fields should match what is provided. | |
int | oa_tc6_get_rx_frame (struct oa_tc6_desc *, struct oa_tc6_frame_buffer **) |
Get a frame buffer that is ready to be read by the user. | |
int | oa_tc6_put_rx_frame (struct oa_tc6_desc *, struct oa_tc6_frame_buffer *) |
Mark a frame buffer as used and ready to be rewritten. | |
int | oa_tc6_get_tx_frame (struct oa_tc6_desc *, struct oa_tc6_frame_buffer **) |
Get a frame buffer that can be filled by user. | |
int | oa_tc6_put_tx_frame (struct oa_tc6_desc *, struct oa_tc6_frame_buffer *) |
Mark a frame buffer as ready to be transmitted. | |
int | oa_tc6_thread (struct oa_tc6_desc *) |
Transmit all the frames in the OA_BUFF_TX_READY state and receive the frames in the OA_BUFF_RX_COMPLETE state. | |
int | oa_tc6_init (struct oa_tc6_desc **, struct oa_tc6_init_param *) |
Allocate resources for the OA TC6 driver. | |
int | oa_tc6_remove (struct oa_tc6_desc *) |
Free a device descriptor. | |
#define CONFIG_OA_CHUNK_BUFFER_SIZE 1514 |
#define CONFIG_OA_RX_FRAME_BUFF_NUM 5 |
#define CONFIG_OA_TX_FRAME_BUFF_NUM 2 |
#define OA_CHUNK_SIZE 64 |
#define OA_CTRL_ADDR_MASK NO_OS_GENMASK(23, 8) |
#define OA_CTRL_ADDR_MMS_MASK NO_OS_GENMASK(27, 8) |
#define OA_CTRL_AID_MASK NO_OS_BIT(28) |
#define OA_CTRL_HDRB_MASK NO_OS_BIT(30) |
#define OA_CTRL_LEN_MASK NO_OS_GENMASK(7, 1) |
#define OA_CTRL_MMS_MASK NO_OS_GENMASK(27, 24) |
#define OA_CTRL_P_MASK NO_OS_BIT(0) |
#define OA_CTRL_WNR_MASK NO_OS_BIT(29) |
#define OA_DATA_FOOTER_DV_MASK NO_OS_BIT(21) |
#define OA_DATA_FOOTER_EBO_MASK NO_OS_GENMASK(13, 8) |
#define OA_DATA_FOOTER_EV_MASK NO_OS_BIT(14) |
#define OA_DATA_FOOTER_EXST_MASK NO_OS_BIT(31) |
#define OA_DATA_FOOTER_HDRB_MASK NO_OS_BIT(30) |
#define OA_DATA_FOOTER_P_MASK NO_OS_BIT(0) |
#define OA_DATA_FOOTER_RCA_MASK NO_OS_GENMASK(28, 24) |
#define OA_DATA_FOOTER_SV_MASK NO_OS_BIT(20) |
#define OA_DATA_FOOTER_SWO_MASK NO_OS_GENMASK(19, 16) |
#define OA_DATA_FOOTER_SYNC_MASK NO_OS_BIT(29) |
#define OA_DATA_FOOTER_TXC_MASK NO_OS_GENMASK(5, 1) |
#define OA_DATA_FOOTER_VS_MASK NO_OS_GENMASK(23, 22) |
#define OA_DATA_HEADER_DNC_MASK NO_OS_BIT(31) |
#define OA_DATA_HEADER_DV_MASK NO_OS_BIT(21) |
#define OA_DATA_HEADER_EBO_MASK NO_OS_GENMASK(13, 8) |
#define OA_DATA_HEADER_EV_MASK NO_OS_BIT(14) |
#define OA_DATA_HEADER_NORX_MASK NO_OS_BIT(29) |
#define OA_DATA_HEADER_P_MASK NO_OS_BIT(0) |
#define OA_DATA_HEADER_SEQ_MASK NO_OS_BIT(30) |
#define OA_DATA_HEADER_SV_MASK NO_OS_BIT(20) |
#define OA_DATA_HEADER_SWO_MASK NO_OS_GENMASK(19, 16) |
#define OA_DATA_HEADER_VS_MASK NO_OS_GENMASK(23, 22) |
#define OA_FOOTER_LEN 4 |
#define OA_HEADER_LEN 4 |
#define OA_MMS_REG | ( | m, | |
r ) |
#define OA_REG_LEN 4 |
#define OA_RX_FRAME_BUFF_NUM CONFIG_OA_RX_FRAME_BUFF_NUM |
#define OA_SPI_BUFF_LEN 1632 |
#define OA_TC6_BUFST_REG OA_MMS_REG(0x0, 0x000B) |
#define OA_TC6_BUFSTS_RCA_MASK NO_OS_GENMASK(7, 0) |
#define OA_TC6_BUFSTS_TXC_MASK NO_OS_GENMASK(15, 8) |
#define OA_TC6_CONFIG0_REG OA_MMS_REG(0x0, 0x0004) |
#define OA_TC6_CONFIG0_ZARFE_MASK NO_OS_BIT(12) |
#define OA_TC6_CONFIG1_REG OA_MMS_REG(0x0, 0x0005) |
#define OA_TC6_CONFIG2_REG OA_MMS_REG(0x0, 0x0006) |
#define OA_TC6_IDVER_REG OA_MMS_REG(0x0, 0x0000) |
#define OA_TC6_IMSK0_REG OA_MMS_REG(0x0, 0x000C) |
#define OA_TC6_IMSK1_REG OA_MMS_REG(0x0, 0x000D) |
#define OA_TC6_MDIOACC0_REG OA_MMS_REG(0x0, 0x0020) |
#define OA_TC6_MDIOACC1_REG OA_MMS_REG(0x0, 0x0021) |
#define OA_TC6_MDIOACC2_REG OA_MMS_REG(0x0, 0x0022) |
#define OA_TC6_MDIOACC3_REG OA_MMS_REG(0x0, 0x0023) |
#define OA_TC6_MDIOACC4_REG OA_MMS_REG(0x0, 0x0024) |
#define OA_TC6_MDIOACC5_REG OA_MMS_REG(0x0, 0x0025) |
#define OA_TC6_MDIOACC6_REG OA_MMS_REG(0x0, 0x0026) |
#define OA_TC6_MDIOACC7_REG OA_MMS_REG(0x0, 0x0027) |
#define OA_TC6_PHYID_REG OA_MMS_REG(0x0, 0x0001) |
#define OA_TC6_RESET_REG OA_MMS_REG(0x0, 0x0003) |
#define OA_TC6_STATUS0_REG OA_MMS_REG(0x0, 0x0008) |
#define OA_TC6_STATUS1_REG OA_MMS_REG(0x0, 0x0009) |
#define OA_TC6_STDCAP_REG OA_MMS_REG(0x0, 0x0002) |
#define OA_TC6_TTSCAH_REG OA_MMS_REG(0x0, 0x0010) |
#define OA_TC6_TTSCAL_REG OA_MMS_REG(0x0, 0x0011) |
#define OA_TC6_TTSCBH_REG OA_MMS_REG(0x0, 0x0012) |
#define OA_TC6_TTSCBL_REG OA_MMS_REG(0x0, 0x0013) |
#define OA_TC6_TTSCCH_REG OA_MMS_REG(0x0, 0x0014) |
#define OA_TC6_TTSCCL_REG OA_MMS_REG(0x0, 0x0015) |
#define OA_TX_FRAME_BUFF_NUM CONFIG_OA_TX_FRAME_BUFF_NUM |
int oa_tc6_get_rx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer ) |
Get a frame buffer that is ready to be read by the user.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame received. |
int oa_tc6_get_rx_frame_match_vs | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer, | ||
uint8_t | vs, | ||
uint8_t | mask ) |
Get a frame buffer that is ready to be read by the user. The VS field in the chunk footer fields should match what is provided.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame received. |
vs | - the value of the VS field to match. |
mask | - the mask to apply to the VS field. |
int oa_tc6_get_tx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer ) |
Get a frame buffer that can be filled by user.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame to be transmitted. |
int oa_tc6_init | ( | struct oa_tc6_desc ** | desc, |
struct oa_tc6_init_param * | param ) |
Allocate resources for the OA TC6 driver.
desc | - the device descriptor to be initialized |
param | - the device's parameter |
int oa_tc6_put_rx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer * | buffer ) |
Mark a frame buffer as used and ready to be rewritten.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame read by the user. |
int oa_tc6_put_tx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer * | buffer ) |
Mark a frame buffer as ready to be transmitted.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame to be transmitted. |
int oa_tc6_reg_read | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t * | val ) |
Read a register value.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Register value. |
int oa_tc6_reg_update | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t | val, | ||
uint32_t | mask ) |
Update a field inside a register.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Field value. |
mask | - Bit mask corresponding to the register field. |
int oa_tc6_reg_write | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t | val ) |
Write a register value.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Register value. |
int oa_tc6_remove | ( | struct oa_tc6_desc * | desc | ) |
Free a device descriptor.
desc | - the device descriptor to be removed. |
int oa_tc6_thread | ( | struct oa_tc6_desc * | desc | ) |
Transmit all the frames in the OA_BUFF_TX_READY state and receive the frames in the OA_BUFF_RX_COMPLETE state.
desc | - the OA TC6 descriptor |