summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2014-03-20 16:19:31 +0900
committerChanho Park <cometzero@review.tizen.org>2014-03-20 02:06:20 -0700
commit54213fb4039c97566143dda6a6ff3a45a96b1dbd (patch)
tree75ebe9880da168a4f73c0f3346405a91130d8e83
parent69796f36ca8acd09c730dfafeb3a787777a7c8f2 (diff)
downloadlinux-3.10-54213fb4039c97566143dda6a6ff3a45a96b1dbd.tar.gz
linux-3.10-54213fb4039c97566143dda6a6ff3a45a96b1dbd.tar.bz2
linux-3.10-54213fb4039c97566143dda6a6ff3a45a96b1dbd.zip
modem: sipc4: Chagne the manner of recieving data for FMT,RFS type device
When packet arrives, link device call iodev's helper function to recieve packets. The way of recieving data of IPC_FMT and IPC_RFS type iodevs differs from IPC_RAW and IPC_MULTI_RAW. This patch adds specified method of recieving data for FMT, RFS typed. This modification references TIZEN 2.2 kernel. Change-Id: I01efa7678bbabfbd1011ceba42571fc221313c4d Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
-rw-r--r--drivers/misc/modem_if/sipc4_io_device.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/misc/modem_if/sipc4_io_device.c b/drivers/misc/modem_if/sipc4_io_device.c
index 56b9afd4cee..aa8e4e99d9d 100644
--- a/drivers/misc/modem_if/sipc4_io_device.c
+++ b/drivers/misc/modem_if/sipc4_io_device.c
@@ -897,8 +897,32 @@ static int io_dev_recv_data_from_link_dev(struct io_device *iod,
err = rx_rfs_packet(iod, ld, data, len);
return err;
#endif
-
case IPC_FMT:
+ /* alloc 3.5K a page.. in case of BYPASS,RFS */
+ /* should be smaller than user alloc size */
+ if (len >= MAX_RXDATA_SIZE)
+ mif_info("(%d)more than 3.5K, alloc 3.5K pages\n", len);
+ rest_len = len;
+ cur = (char *)data;
+ while (rest_len) {
+ alloc_size = min_t(unsigned int, MAX_RXDATA_SIZE,
+ rest_len);
+ skb = rx_alloc_skb(alloc_size, iod, ld);
+ if (!skb) {
+ mif_err("fail alloc skb (%d)\n", __LINE__);
+ return -ENOMEM;
+ }
+ mif_debug("bypass/rfs len : %d\n", alloc_size);
+
+ memcpy(skb_put(skb, alloc_size), cur, alloc_size);
+ skb_queue_tail(&iod->sk_rx_q, skb);
+ mif_debug("skb len : %d\n", skb->len);
+
+ rest_len -= alloc_size;
+ cur += alloc_size;
+ }
+ wake_up(&iod->wq);
+ return len;
case IPC_RAW:
case IPC_MULTI_RAW:
if (iod->waketime)