aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorJulien Lefrique <lefrique@marvell.com>2014-10-21 10:52:49 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-11-28 08:07:51 -0500
commit122c195872e963c83f3a61dcab0937247b56786e (patch)
tree8e467ac9d976ea274e6e6ea2f1c6ec5a77667258 /net/nfc
parent485f442fd5e3ba16b47df0e111165eabcf7ce96d (diff)
NFC: NCI: Forward data received in Target mode to nfc core
Signed-off-by: Julien Lefrique <lefrique@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/data.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 427ef2c7ab68..91f5d55bd04c 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -3,6 +3,7 @@
3 * NFC Controller (NFCC) and a Device Host (DH). 3 * NFC Controller (NFCC) and a Device Host (DH).
4 * 4 *
5 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2011 Texas Instruments, Inc.
6 * Copyright (C) 2014 Marvell International Ltd.
6 * 7 *
7 * Written by Ilan Elias <ilane@ti.com> 8 * Written by Ilan Elias <ilane@ti.com>
8 * 9 *
@@ -223,7 +224,17 @@ static void nci_add_rx_data_frag(struct nci_dev *ndev,
223 } 224 }
224 225
225exit: 226exit:
226 nci_data_exchange_complete(ndev, skb, err); 227 if (ndev->nfc_dev->rf_mode == NFC_RF_INITIATOR) {
228 nci_data_exchange_complete(ndev, skb, err);
229 } else if (ndev->nfc_dev->rf_mode == NFC_RF_TARGET) {
230 /* Data received in Target mode, forward to nfc core */
231 err = nfc_tm_data_received(ndev->nfc_dev, skb);
232 if (err)
233 pr_err("unable to handle received data\n");
234 } else {
235 pr_err("rf mode unknown\n");
236 kfree_skb(skb);
237 }
227} 238}
228 239
229/* Rx Data packet */ 240/* Rx Data packet */