path: root/drivers/rpmsg/qcom_glink_smem.c
diff options
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-08-24 12:51:36 +0530
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-08-29 20:34:13 -0700
commitb88eee975a26b1542c9da91571f79c110c108dd1 (patch)
tree024182d504531d4628e2e3665558738c53a2b9ee /drivers/rpmsg/qcom_glink_smem.c
parent64f95f87920da673d84396ff1253be2098751e38 (diff)
rpmsg: glink: Make RX FIFO peak accessor to take an offset
To fully read the received rx data from FIFO both the command and data has to be read. Currently we read command, data separately and process them. By adding an offset parameter to RX FIFO peak accessor, command and data can be read together, simplifying things. So introduce this. Acked-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/qcom_glink_smem.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 9d73ced075e7..5cdaa5f8fb61 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -87,13 +87,16 @@ static size_t glink_smem_rx_avail(struct qcom_glink_pipe *np)
static void glink_smem_rx_peak(struct qcom_glink_pipe *np,
- void *data, size_t count)
+ void *data, unsigned int offset, size_t count)
struct glink_smem_pipe *pipe = to_smem_pipe(np);
size_t len;
u32 tail;
tail = le32_to_cpu(*pipe->tail);
+ tail += offset;
+ if (tail >= pipe->native.length)
+ tail -= pipe->native.length;
len = min_t(size_t, count, pipe->native.length - tail);
if (len) {