namespace xlnx

enum xlnx::qdma_bar_type

Overview

qdma_bar_type - QDMA PCIe BAR Types

// enum values

CONFIG_BAR
USER_BAR
BYPASS_BAR

Enum values

ValueDescription
CONFIG_BAR

QDMA Configuration BAR (Contains all QDMA configuration Registers)

USER_BAR

QDMA AXI Master Lite BAR (Contains User Logic Registers)

BYPASS_BAR

QDMA AXI Bridge Master BAR (Contains Bypass Registers to bypass QDMA)

enum xlnx::qdma_desc_sz

// enum values

QDMA_DESC_SZ_8B = 0
QDMA_DESC_SZ_16B
QDMA_DESC_SZ_32B
QDMA_DESC_SZ_64B
QDMA_DESC_SZ_MAX

enum xlnx::qdma_desc_type

// enum values

RING_DESCRIPTOR = 0
CMPT_DESCRIPTOR

enum xlnx::qdma_q_type

Overview

enum qdma_q_type: Q type

// enum values

QDMA_Q_TYPE_H2C
QDMA_Q_TYPE_C2H
QDMA_Q_TYPE_CMPT
QDMA_Q_TYPE_MAX

Enum values

ValueDescription
QDMA_Q_TYPE_H2C

: H2C Q

QDMA_Q_TYPE_C2H

: C2H Q

QDMA_Q_TYPE_CMPT

: CMPT Q

QDMA_Q_TYPE_MAX

: Total Q types

enum xlnx::qdma_queue_dir

Overview

qdma_queue_dir - QDMA Queue Direction

// enum values

QDMA_QUEUE_DIR_H2C = 0
QDMA_QUEUE_DIR_C2H

Enum values

ValueDescription
QDMA_QUEUE_DIR_H2C

Queue H2C Direction

QDMA_QUEUE_DIR_C2H

Queue C2H Direction

enum xlnx::qdma_trig_mode

// enum values

QDMA_TRIG_MODE_DISABLE = 0
QDMA_TRIG_MODE_EVERY
QDMA_TRIG_MODE_USER_COUNT
QDMA_TRIG_MODE_USER
QDMA_TRIG_MODE_USER_TIMER
QDMA_TRIG_MODE_USER_TIMER_COUNT
QDMA_TRIG_MODE_MAX

enum xlnx::queue_op_mode

Overview

queue_op_mode - QDMA Operation Mode

// enum values

POLL_MODE = 0
INTR_MODE
INTR_COAL_MODE

Enum values

ValueDescription
POLL_MODE

Poll Mode

INTR_MODE

Direct Interrupt Mode

INTR_COAL_MODE

Indirect Interrupt Mode(Aggregation)

enum xlnx::queue_state

Overview

queue_state - State of the QDMA queue

// enum values

QUEUE_AVAILABLE
QUEUE_ADDED
QUEUE_STARTED
QUEUE_BUSY
QUEUE_INVALID_STATE

Enum values

ValueDescription
QUEUE_AVAILABLE

Queue is available to configure

QUEUE_ADDED

Queue is added with resources

QUEUE_STARTED

Queue is programmed and started

QUEUE_BUSY

Queue critical operation is in progress

QUEUE_INVALID_STATE

Invalid Queue State

enum xlnx::st_c2h_pkt_type

Overview

Streaming card to host packet type

// enum values

ST_C2H_DATA_PKT
ST_C2H_UDD_ONLY_PKT

Enum values

ValueDescription
ST_C2H_DATA_PKT

C2H DATA Packet MACRO

ST_C2H_UDD_ONLY_PKT

C2H USER DEFINED DATA Packet MACRO

struct xlnx::qdma_cmpt_info

#include "qdma_exports.h"

Overview

qdma_cmpt_info - Structure contains required members to retrieve completion ring information

The QDMA MM completion ring data will be copied into *pbuffer* for the requested *qid*

Caller must allocate memory for *pbuffer* and the size must be specified in *buf_len*

The driver specifies the actual length of data copied into *pbuffer* in *ret_len* field along with completion descriptor size in *cmpt_desc_sz* .

Fields

UINT16 qid

QID

size_t buffer_len

Data Buffer available size

size_t ret_len

Returned Data size

size_t cmpt_desc_sz

Completion Descriptor size

UINT8* pbuffer

Buffer to hold Completion Descriptors

struct xlnx::qdma_ctx_info

#include "qdma_exports.h"

Overview

qdma_ctx_info - Structure contains required members to retrieve QDMA queue context information

The queue context information will be copied into *pbuffer* for the requested *qid* in the requested *dir*

Caller must allocate memory for *pbuffer* and the size must be specified in *buff_sz*

The driver specifies the actual length of data copied into *pbuffer* in *ret_sz* field.

Fields

UINT16 qid

QID

enum qdma_q_type ring_type

Ring Type (H2C, C2H, CMPT)

size_t buffer_sz

Data Buffer available size

size_t ret_sz

Returned Data size

char* pbuffer

Buffer to hold context information

struct xlnx::qdma_desc_info

#include "qdma_exports.h"

Overview

qdma_desc_info - Structure contains required members to retrieve descriptor information

The QDMA queue descriptor information will be copied into *pbuffer* for the requested *qid* , *dir* , *desc_type* from *desc_start* to *desc_end* into *pbuffer* .

Fields

UINT16 qid

QID

qdma_queue_dir dir

Q Direction (H2C, C2H)

qdma_desc_type desc_type

Descriptor Type (Ring Descriptor, Completion Descriptor)

UINT32 desc_start

Descriptor Start Index

UINT32 desc_end

Descriptor End Index

size_t buffer_sz

Data Buffer available size

UINT8* pbuffer

Data Buffer

size_t desc_sz

Size of the descriptor

size_t data_sz

Size of the data returned

struct xlnx::qdma_device_attributes_info

#include "qdma_exports.h"

Overview

qdma_device_attributes_info - Device Attributes/Features

Fields

UINT8 num_pfs

No of Physical functions supported

UINT16 num_qs

No of queues supported

bool flr_present

Function Level Reset Status

bool st_en

Streaming Feature enabled

bool mm_en

Memory Mapped Feature enabled

bool mm_cmpl_en

MM Completion Feature enabled

bool mailbox_en

Mailbox Feature enabled

bool debug_mode

Debug mode is enabled/disabled for IP

UINT8 desc_eng_mode

Descriptor Engine mode: Internal only/Bypass only/Internal & Bypass

UINT16 num_mm_channels

Number of MM channels supported

struct xlnx::qdma_drv_config

#include "qdma_exports.h"

dev_config - qdma device configuration needed to initialize the device

struct xlnx::qdma_glbl_csr_conf

#include "qdma_exports.h"

Overview

qdma_glbl_csr_conf - Provides the available CSR connfiguration registers

Fields

UINT32 ring_sz [QDMA_GLBL_CSR_REG_CNT]

Ring Size CSR Registers

UINT32 c2h_timer_cnt [QDMA_GLBL_CSR_REG_CNT]

C2H Timer Count CSR Registers

UINT32 c2h_th_cnt [QDMA_GLBL_CSR_REG_CNT]

C2H Threshold CSR Registers

UINT32 c2h_buff_sz [QDMA_GLBL_CSR_REG_CNT]

C2H Buffer size CSR Registers

UINT32 wb_interval

Writeback interval timeout register

struct xlnx::qdma_intr_ring_info

#include "qdma_exports.h"

Overview

qdma_intr_ring_info - Structure contains required members to retrieve Interrupt ring information.

Fields

UINT32 vec_id

Interrupt Vector ID

UINT32 start_idx

Interrupt ring start index

UINT32 end_idx

Interrupt ring end index

size_t buffer_len

Data Buffer available size

size_t ret_len

Returned Data size

size_t ring_entry_sz

Size of the interrupt ring entry

unsigned char* pbuffer

Buffer to hold interrupt ring information

struct xlnx::qdma_qstat_info

#include "qdma_exports.h"

Overview

qdma_queue_stats - Structure contains required members to retrieve queue stats information

All the queue statistics for this function is copied.

Fields

UINT32 qbase

Queue base for this device

UINT32 qmax

Maximum allocated queues for this device

UINT32 active_h2c_queues

Active host to card queues for this device

UINT32 active_c2h_queues

Active card to host queues for this device

UINT32 active_cmpt_queues

Active completion queues for this device

struct xlnx::qdma_reg_dump_info

#include "qdma_exports.h"

Overview

qdma_reg_dump_info - Structure contains required members to retrieve register dump information

All the QDMA registers and its contents will be copied into *pbuffer*

Caller must allocate memory for *pbuffer* and the size must be specified in *buf_len*

The driver specifies the actual length of data copied into *pbuffer* in *ret_len* field.

Fields

size_t buffer_len

Data Buffer available size

size_t ret_len

Returned Data size

char* pbuffer

Buffer to hold regsiter dump information

struct xlnx::qdma_reg_info

#include "qdma_exports.h"

Overview

qdma_reg_info - Structure contains required members to retrieve requested qdma registers information

Fields

UINT32 bar_no

PCIe bar number

UINT32 address

Register address offset

UINT32 reg_cnt

number of registers to retrieve

size_t buf_len

Length of the buffer pointed by pbuffer

size_t ret_len

Length of the data present in pbuffer

char* pbuffer

output buffer to copy the register info

struct xlnx::qdma_version_info

#include "qdma_exports.h"

Overview

qdma_version_info - QDMA HW and SW version information

Fields

char qdma_rtl_version_str [DEVICE_VERSION_INFO_STR_LENGTH]

Version string

char qdma_vivado_release_id_str [DEVICE_VERSION_INFO_STR_LENGTH]

Release string

char qdma_device_type_str [DEVICE_VERSION_INFO_STR_LENGTH]

Qdma device type string

char qdma_versal_ip_type_str [DEVICE_VERSION_INFO_STR_LENGTH]

Versal IP state string

char qdma_sw_version_str [DEVICE_VERSION_INFO_STR_LENGTH]

QDMA SW Version string

struct xlnx::queue_config

#include "qdma_exports.h"

Overview

queue_config - qdma queue configuration needed to add a queue

Fields

bool is_st

queue is ST or MM

UINT8 h2c_ring_sz_index

H2C ring size index

UINT8 c2h_ring_sz_index

C2H ring size index

UINT8 c2h_buff_sz_index

C2H buffer size index

UINT8 c2h_th_cnt_index

C2H threshold index

UINT8 c2h_timer_cnt_index

C2H timer count index

qdma_desc_sz cmpt_sz

completion ring size

qdma_trig_mode trig_mode

trigger mode (valid for ST C2H)

UINT8 sw_desc_sz

Software descriptor size

bool desc_bypass_en

descriptor bypass enabled or not

bool pfch_en

prefetch enabled or not

bool pfch_bypass_en

prefetch bypass enabled or not

bool cmpl_ovf_dis

Completion overflow disabled or not

bool en_mm_cmpl

MM completion enabled or not

proc_st_udd_only_cb proc_st_udd_cb

ST UDD data only call back function

struct xlnx::st_c2h_pkt_fragment

#include "qdma_exports.h"

Overview

st_c2h_pkt_fragment - C2H Packet Details

Fields

void* data

C2H Data Fragment Address

void* udd_data

User Defined Data Address

size_t length

Length of the C2H data Fragment

UINT32 sop : 1

Indicates Start of packet

UINT32 eop : 1

Indicates End of packet

st_c2h_pkt_type pkt_type : 1

Indicates Packet Type (ST_C2H_DATA_PKT or ST_C2H_UDD_ONLY_PKT)

UINT32 reserved : 29

Reserved Field

Typedefs

typedef void (*) (void*priv, NTSTATUS status) dma_completion_cb

dma_completion_cb() - DMA Request completion callback function type

Parameters:

priv

Driver provided private member

status

DMA Request completion status

Returns:

void

typedef void (*) (const st_c2h_pkt_fragment*rx_frags, size_t num_pkts, void*priv, NTSTATUS status) st_rx_completion_cb

st_rx_completion_cb() - Streaming C2H DMA Request completion callback function type

Parameters:

rx_frags

List of packet fragments

num_pkts

entries in rx_frags

priv

Driver provided private member

status

DMA Request completion status

Returns:

void

typedef void (*) (UINT16 qid, void*udd_addr, void*priv) proc_st_udd_only_cb

proc_st_udd_only_cb() - User defined data received callback function type

Parameters:

qid

Queue number

udd_addr

UDD pointer

priv

Driver provided private member

Returns:

void

typedef void (*) (ULONG event_id, void*user_data) fp_user_isr_handler

fp_user_isr_handler() - User defined user ISR handler

Parameters:

event_id

Event identifier

user_data

Driver provided user data

Returns:

void

typedef void (*) (ULONG event_id, void*user_data) fp_user_interrupt_enable_handler

fp_user_interrupt_enable_handler() - User defined user ISR handler

Parameters:

event_id

Event identifier

user_data

Driver provided user data

Returns:

void

typedef void (*) (ULONG event_id, void*user_data) fp_user_interrupt_disable_handler

fp_user_interrupt_disable_handler() - User defined user ISR handler

Parameters:

event_id

Event identifier

user_data

Driver provided user data

Returns:

void

Global Variables

static constexpr size_t QDMA_GLBL_CSR_REG_CNT

Specifies No of CSR Global Registers avalable