Writing Device Drivers for Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

pciv_send() Interface

The pciv_send(9F) interface is used by SR-IOV capable PF and VF drivers to communicate with each other. A PF driver can communicate with any of its VF drivers although a VF driver can only communicate with its PF driver.

int pciv_send(dev_info_t *dip, pciv_pvp_req_t *req

where:

dip

A pointer to the dev_info structure.

req

A pointer to the pciv_pvp_req_t structure.

The structure of the pciv_pvp_req_t is :

typedef struct pciv_pvp_req {
int pvp_dstfunc;
caddr_t pvp_buf;
size_t pvp_nbyte;
buf_cb_t pvp_cb;
caddr_t pvp_cb_arg;
uint_t pvp_flag;
} pciv_pvp_req_t;

where:

pvp_dstfunc

VF index ranges from 1 to num_vf if called by PF driver. If the caller is a VF driver it should always be PCIV_PF.

pvp_buf

Buffer address of caller's buffer to be sent.

pvp_nbyte

Number of bytes to be transmitted, which must be less than 8k.

pvp_cb

Call back function pointer if the pvp_flag is set as PCIV_NOWAIT.

If pvp_flag is set to PCIV_NOWAIT the call returns immediately and the callback routine in pvp_cb is called before data in pvp_buf has been transmitted to the destination. The caller is then allowed to free the buffer in its callback routine.

typedef void (*buf_cb_t)(int rc, caddr_t buf, size_t size, caddr_t cb_arg);

where:

rc

DDI return code for the transmission.

buf

Buffer address of caller's buffer to be sent.

size

Number of bytes to be transmitted.

cb_arg

Input argument the caller has set when calling the routine.

pvp_cb_arg

Call back input argument for pvp_cb if the pvp_flag is set as PCIV_NOWAIT.

pvp_flag
  • PCIV_NOWAIT – Do not wait for receiver's response.

  • PCIV_WAIT – This is the default state. Wait until receiver acknowledges the transmission.

The pciv_send() interface returns one of the following return values:

DDI_SUCCESS

Buffer has been sent successfully.

DDI_ENOTSUP

Device driver does not support this operation. Caller may use other mechanisms, such as hardware mailbox.

DDI_EINVAL

The pvp_nbyte or pvp_dstfunc is invalid.

DDI_ENOMEM

Operation failed due to lack of resources.

DDI_ETRANSPORT

The remote end did not register a call back to handle incoming transmission.

DDI_FAILURE

Failed due to unspecified reasons.