diff options
author | Jonghwa Lee <jonghwa3.lee@samsung.com> | 2014-03-20 16:19:31 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:47:21 +0900 |
commit | 642003c3585585e8894485c678130104abd4e512 (patch) | |
tree | 76bed1c97618c5827a30f7b21d8371f285be05b1 | |
parent | ecc33ad4f496db1ba2e08a13e8f1d7585f5cfc39 (diff) | |
download | linux-3.10-642003c3585585e8894485c678130104abd4e512.tar.gz linux-3.10-642003c3585585e8894485c678130104abd4e512.tar.bz2 linux-3.10-642003c3585585e8894485c678130104abd4e512.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.c | 26 |
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) |