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:
A pointer to the dev_info structure.
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:
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.
Buffer address of caller's buffer to be sent.
Number of bytes to be transmitted, which must be less than 8k.
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:
DDI return code for the transmission.
Buffer address of caller's buffer to be sent.
Number of bytes to be transmitted.
Input argument the caller has set when calling the routine.
Call back input argument for pvp_cb if the pvp_flag is set as PCIV_NOWAIT.
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:
Buffer has been sent successfully.
Device driver does not support this operation. Caller may use other mechanisms, such as hardware mailbox.
The pvp_nbyte or pvp_dstfunc is invalid.
Operation failed due to lack of resources.
The remote end did not register a call back to handle incoming transmission.
Failed due to unspecified reasons.