Open
Description
This routine ultimately returns the number of bytes transmitted to a calling API.
The following fail cases do not propagate a failure back up the call stack and therefore the caller will think the data has been transmitted:
status = metal_io_block_write(io, metal_io_virt_to_offset(io, hdr),
&rp_hdr, sizeof(rp_hdr));
RPMSG_ASSERT(status == sizeof(rp_hdr), "failed to write header\r\n");
. . .
/* Enqueue buffer on virtqueue. */
status = rpmsg_virtio_enqueue_buffer(rvdev, hdr, buff_len, idx);
RPMSG_ASSERT(status == VQUEUE_SUCCESS, "failed to enqueue buffer\r\n");
We could either propagate the error code back up the call stack, return a generic error indicating tx failure or return 0 indicating no data was transmitted.