summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-12-21 11:43:06 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 09:02:57 +0100
commitcf0ff8d9a449df521ed91bc0bae334da413459d9 (patch)
tree41f05c59bfbbbb98a97720879b29e08c2a6448c6
parent5ba1253c44e3d5b055f0e4b6f6f5ce9563dcef5d (diff)
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 <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43350 Reviewed-by: Durga Prasada Rao BATHINA <durgaprasadarao.b@stericsson.com> Reviewed-by: QABUILD Reviewed-by: Sjur BRENDELAND <sjur.brandeland@stericsson.com>
-rw-r--r--drivers/net/caif/caif_shmcore.c3
1 files changed, 2 insertions, 1 deletions
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);