From 2226b173a9085faf3da513181c7e177cc7c66db1 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Wed, 21 Dec 2011 11:43:06 +0530 Subject: caif-shmcore: in tx check for buffer full condition There are 6 buffers and each buffer can be filled with 10 messages. The size of each buffer is 8k. In shm tx work function, 10 messages are written to the buffer, if the buffer gets filled during writing these 10 messages stop writing to buffer and use the next buffer. ST-Ericsson Linux next: NA ST-Ericsson ID: 375088 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I146d41e4e415c8ff96c605b4c20546ff7501442a Signed-off-by: Arun Murthy Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43350 Reviewed-by: Durga Prasada Rao BATHINA Reviewed-by: QABUILD Reviewed-by: Sjur BRENDELAND --- drivers/net/caif/caif_shmcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index 2cdae3fc158..fc55bf65f1c 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c @@ -522,7 +522,8 @@ static void shm_tx_work_func(struct work_struct *tx_work) pbuf->frames++; pbuf->frm_ofs += frmlen + (frmlen % 32); - } while (pbuf->frames < SHM_MAX_FRMS_PER_BUF); + } while (pbuf->frames < SHM_MAX_FRMS_PER_BUF && + pbuf->frm_ofs < pbuf->len); /* Assign buffer as full. */ list_add_tail(&pbuf->list, &pshm_drv->tx_full_list); -- cgit v1.2.3