ThirdParty/sw_services/openamp/src/open-amp/lib/rpmsg/rpmsg_virtio.c
static int rpmsg_virtio_enqueue_buffer(struct rpmsg_virtio_device *rvdev,
				       void *buffer, uint32_t len,
				       uint16_t idx)
{
	unsigned int role = rpmsg_virtio_get_role(rvdev);
#ifndef VIRTIO_SLAVE_ONLY
	if (role == RPMSG_MASTER) {
		struct virtqueue_buf vqbuf;
		(void)idx;

		/* Initialize buffer node */
		vqbuf.buf = buffer;
		vqbuf.len = len;
		return virtqueue_add_buffer(rvdev->svq, &vqbuf, 1, 0, buffer);
	}
#endif /*!VIRTIO_SLAVE_ONLY*/

#ifndef VIRTIO_MASTER_ONLY
	if (role == RPMSG_REMOTE) {
		(void)buffer;
		return virtqueue_add_consumed_buffer(rvdev->svq, idx, len);
	}
#endif /*!VIRTIO_MASTER_ONLY*/
	return 0;
}
/**
 * rpmsg_virtio_enqueue_buffer
 *
 * Places buffer on the virtqueue for consumption by the other side.
 *
 * @param rvdev  - pointer to rpmsg virtio
 * @param buffer - buffer pointer
 * @param len    - buffer length
 * @param idx    - buffer index
 *
 * @return - status of function execution
 */
rpmsg_virtio_enqueue_buffer
Places buffer on the virtqueue for consumption by the other side.

@param rvdev  - pointer to rpmsg virtio
@param buffer - buffer pointer
@param len    - buffer length
@param idx    - buffer index

@return - status of function execution
rpmsg_virtio_enqueue_buffer Places buffer on the virtqueue for consumption by the other side . @param rvdev - pointer to rpmsg virtio @param buffer - buffer pointer @param len - buffer length @param idx - buffer index @return - status of function execution
static int rpmsg_virtio_enqueue_buffer(struct rpmsg_virtio_device *rvdev,
				       void *buffer, uint32_t len,
				       uint16_t idx)
{
	unsigned int role = rpmsg_virtio_get_role(rvdev);
#ifndef VIRTIO_SLAVE_ONLY
	if (role == RPMSG_MASTER) {
		struct virtqueue_buf vqbuf;
		(void)idx;
		vqbuf.buf = buffer;
		vqbuf.len = len;
		return virtqueue_add_buffer(rvdev->svq, &vqbuf, 1, 0, buffer);
	}
#endif 
#ifndef VIRTIO_MASTER_ONLY
	if (role == RPMSG_REMOTE) {
		(void)buffer;
		return virtqueue_add_consumed_buffer(rvdev->svq, idx, len);
	}
#endif 
	return 0;
}
static int rpmsg_virtio_enqueue_buffer ( struct rpmsg_virtio_device * rvdev , void * buffer , uint32_t len , uint16_t idx ) { unsigned int role = rpmsg_virtio_get_role ( rvdev ) ; #ifndef VIRTIO_SLAVE_ONLY if ( role == RPMSG_MASTER ) { struct virtqueue_buf vqbuf ; ( void ) idx ; vqbuf . buf = buffer ; vqbuf . len = len ; return virtqueue_add_buffer ( rvdev -> svq , & vqbuf , 1 , 0 , buffer ) ; } #endif #ifndef VIRTIO_MASTER_ONLY if ( role == RPMSG_REMOTE ) { ( void ) buffer ; return virtqueue_add_consumed_buffer ( rvdev -> svq , idx , len ) ; } #endif return 0 ; }
rpmsg_virtio_enqueue_buffer
 Places buffer on the virtqueue for consumption by the other side.
rpmsg_virtio_enqueue_buffer Places buffer on the virtqueue for consumption by the other side .
/* Initialize buffer node */ /*!VIRTIO_SLAVE_ONLY*/ /*!VIRTIO_MASTER_ONLY*/