Current File : //usr/share/man/man9f/pciv_send.9f
'\" te
.\" Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
.TH pciv_send 9F "19 May 2011" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
pciv_send \- enable communication between PCI SR-IOV PF and VF drivers
.SH SYNOPSIS
.LP
.nf
#include <sys/sunddi.h>

int pciv_send(dev_info_t *\fIdip\fR, pciv_pvp_req_t *\fIreq\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIdip\fR\fR
.ad
.RS 7n
.rt  
Pointer to the \fBdev_info\fR structure.
.RE

.sp
.ne 2
.mk
.na
\fB\fIreq\fR\fR
.ad
.RS 7n
.rt  
Pointer to \fBpciv_pvp_req\fR structure.
.sp
.in +2
.nf
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
.fi
.in -2

.sp
.ne 2
.mk
.na
\fB\fIpvp_dstfunc\fR\fR
.ad
.RS 15n
.rt  
VF index ranges from 1 to num_vf if called by PF driver. PCIV_PF if the caller is a VF driver.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpvp_buf\fR\fR
.ad
.RS 15n
.rt  
Buffer address of caller's buffer to be sent.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpvp_nbyte\fR\fR
.ad
.RS 15n
.rt  
Number of bytes to be transmitted, which must be less than 8k.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpvp_cb\fR\fR
.ad
.RS 15n
.rt  
Call back function pointer if the \fIpvp_flag\fR is set as \fBPCIV_NOWAIT\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpvp_cb_arg\fR\fR
.ad
.RS 15n
.rt  
Call back input argument for \fIpvp_cb\fR if the \fIpvp_flag\fR is set as \fBPCIV_NOWAIT\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpvp_flag\fR\fR
.ad
.RS 15n
.rt  
Must be one of the following:
.sp
.ne 2
.mk
.na
\fB\fBPCIV_NOWAIT\fR\fR
.ad
.RS 15n
.rt  
Do not wait for receiver's acknowledgment response.
.RE

.sp
.ne 2
.mk
.na
\fB\fBPCIV_WAIT\fR\fR
.ad
.RS 15n
.rt  
Wait until receiver acknowledges the transmission (default).
.RE

.RE

.RE

.SH DESCRIPTION
.sp
.LP
The \fBpciv_send()\fR function is used by SR-IOV (Single-Root IO Virtualization)-capable PF (Physical Function) and VF (Virtual Function) drivers to communicate with each other. A PF driver can communicate with any of its VF drivers while a VF driver can only communicate with its PF driver. If \fIpvp_flag\fR is set to \fBPCIV_NOWAIT\fR, the call returns immediately and the callback routine in \fIpvp_cb\fR is called when data in \fIpvp_buf\fR has been transmitted to the destination. The caller is then allowed to free the buffer in its callback routine.
.sp
.in +2
.nf
typedef void (*buf_cb_t)(int \fIrc\fR, caddr_t \fIbuf\fR, size_t \fIsize\fR, caddr_t \fIcb_arg\fR);
.fi
.in -2

.sp
.ne 2
.mk
.na
\fB\fIrc\fR\fR
.ad
.RS 10n
.rt  
DDI return code for the transmission.
.RE

.sp
.ne 2
.mk
.na
\fB\fIbuf\fR\fR
.ad
.RS 10n
.rt  
Buffer address of caller's buffer to be sent.
.RE

.sp
.ne 2
.mk
.na
\fB\fIsize\fR\fR
.ad
.RS 10n
.rt  
Number of bytes to be transmitted.
.RE

.sp
.ne 2
.mk
.na
\fB\fIcb_arg\fR\fR
.ad
.RS 10n
.rt  
Input argument the caller set when calling \fBpciv_send()\fR.
.RE

.SH RETURN VALUES
.sp
.LP
The \fBpciv_send()\fR function returns:
.sp
.ne 2
.mk
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 18n
.rt  
The buffer has been sent successfully.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDDI_ENOTSUP\fR\fR
.ad
.RS 18n
.rt  
The device/driver does not support this operation. The caller may use other mechanisms, such as hardware mailbox.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDDI_EINVAL\fR\fR
.ad
.RS 18n
.rt  
The \fIpvp_nbyte\fR or \fIpvp_dstfunc\fR argument is invalid.
.RE

.sp
.ne 2
.mk
.na
\fB\fBENOMEM\fR\fR
.ad
.RS 18n
.rt  
The operation failed due to lack of resources.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDDI_ETRANSPORT\fR\fR
.ad
.RS 18n
.rt  
The remote end did not register a call back to handle incoming transmission.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDDI_FAILURE\fR\fR
.ad
.RS 18n
.rt  
The call failed due unspecified reasons.
.RE

.SH CONTEXT
.sp
.LP
The \fBpciv_send()\fR function can be called from kernel non-interrupt context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityUncommitted
_
MT-LevelUnsafe
.TE

.SH SEE ALSO
.sp
.LP
\fBattributes\fR(5), \fBddi_cb_register\fR(9F)