rpmsg: Introduce "poll" to endpoint ops

This allows rpmsg backends to implement polling of the outgoing buffer,
which provides poll support to user space when using the rpmsg character
device.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2017-01-11 06:35:10 -08:00
parent 5e53c42c33
commit 84d58132d2
3 changed files with 36 additions and 0 deletions

View File

@@ -239,6 +239,26 @@ int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
}
EXPORT_SYMBOL(rpmsg_trysendto);
/**
* rpmsg_poll() - poll the endpoint's send buffers
* @ept: the rpmsg endpoint
* @filp: file for poll_wait()
* @wait: poll_table for poll_wait()
*
* Returns mask representing the current state of the endpoint's send buffers
*/
unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
poll_table *wait)
{
if (WARN_ON(!ept))
return 0;
if (!ept->ops->poll)
return 0;
return ept->ops->poll(ept, filp, wait);
}
EXPORT_SYMBOL(rpmsg_poll);
/**
* rpmsg_send_offchannel() - send a message using explicit src/dst addresses
* @ept: the rpmsg endpoint