From 642003c3585585e8894485c678130104abd4e512 Mon Sep 17 00:00:00 2001 From: Jonghwa Lee Date: Thu, 20 Mar 2014 16:19:31 +0900 Subject: 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 --- drivers/misc/modem_if/sipc4_io_device.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'drivers/misc') 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) -- cgit v1.2.3