Rate This Document
Findability
Accuracy
Completeness
Readability

WD User-Mode Driver Layer Interfaces: WD Southbound Interfaces

The user-mode vendor driver is connected to the WD interfaces.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
struct wd_drv_dio_if {
char *hw_type;/* vendor tag which is used to select right vendor driver */
int (*open)(struct wd_queue *q); /* user space WD queue initiation */
void (*close)(struct wd_queue *q); /* user space WD queue uninitiation */
int (*send)(struct wd_queue *q, void *req); /* Send WCRYPTO message to WD queue */
int (*recv)(struct wd_queue *q, void **resp); /* Receive WCRYPTO msg from WD queue */
};

/* The regions of warpdrve queue, which are from the definition of UACCE(the kernel part of Warpdrive) */
enum uacce_qfrt {
UACCE_QFRT_MMIO = 0,/* device mmio region */
UACCE_QFRT_DKO,/* device kernel-only */
UACCE_QFRT_DUS,/* device user share */
UACCE_QFRT_SS,/* static share memory */
UACCE_QFRT_MAX,
};

Prototype

void *wd_drv_mmap_qfr(struct wd_queue *q, enum uacce_qfrt qfrt,

enum uacce_qfrt qfrt_next, size_t size);

Function

Map the specified area of the WD queue and attempt to obtain the start address.

Input Description

q: WD queue

qfrt: specified area to be mapped

qfrt_next: next area of the specified area

size: size of the specified area

Output Description

None

Return Value Description

The VA of the denoted region

Usage Instruction

Southbound API

Precautions

Obtain the virtual address area of each region during driver and queue initialization.

Prototype

void wd_drv_unmmap_qfr(struct wd_queue *q, void *addr,

enum uacce_qfrt qfrt, enum uacce_qfrt qfrt_next, size_t size);

Function

Cancel the mapping of the specified area of the WD queue.

Input Description

q: WD queue

addr: start VA of the specified area in the queue

qfrt: specified area to be mapped

qfrt_next: next area of the specified area

size: size of the specified area

Output Description

None

Return Value Description

N/A

Usage Instruction

Southbound API

Precautions

Perform unmap operation on the driver when a queue is released.

Prototype

void *drv_iova_map(struct wd_queue *q, void *va, size_t sz);

Function

Obtain the IOVA of the virtual device through mapping before the message is sent to the hardware.

Input Description

q: WD queue

va: start VA of the specified area

sz: size of the VA area

Output Description

None

Return Value Description

IOVA of corresponding VA is returned.

Usage Instruction

Southbound API

Precautions

  

Prototype

void drv_iova_unmap(struct wd_queue *q, void *va, void *iova, size_t sz);

Function

Cancel the mapping between iova and va.

Input Description

q: WD queue

va: start VA of the specified area

iova: start IOVA of the specified area

sz: size of the area

Output Description

None

Return Value Description

N/A

Usage Instruction

Southbound API

Precautions

  

Other southbound interfaces are distributed in each algorithm at the algorithm layer and are marked.