From: Julien Lefrique Date: Tue, 21 Oct 2014 14:52:49 +0000 (+0200) Subject: NFC: NCI: Forward data received in Target mode to nfc core X-Git-Tag: v3.19-rc1~118^2~28^2~16^2~29 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=122c195872e963c83f3a61dcab0937247b56786e;p=karo-tx-linux.git NFC: NCI: Forward data received in Target mode to nfc core Signed-off-by: Julien Lefrique Signed-off-by: Samuel Ortiz --- 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 @@ * NFC Controller (NFCC) and a Device Host (DH). * * Copyright (C) 2011 Texas Instruments, Inc. + * Copyright (C) 2014 Marvell International Ltd. * * Written by Ilan Elias * @@ -223,7 +224,17 @@ static void nci_add_rx_data_frag(struct nci_dev *ndev, } exit: - nci_data_exchange_complete(ndev, skb, err); + if (ndev->nfc_dev->rf_mode == NFC_RF_INITIATOR) { + nci_data_exchange_complete(ndev, skb, err); + } else if (ndev->nfc_dev->rf_mode == NFC_RF_TARGET) { + /* Data received in Target mode, forward to nfc core */ + err = nfc_tm_data_received(ndev->nfc_dev, skb); + if (err) + pr_err("unable to handle received data\n"); + } else { + pr_err("rf mode unknown\n"); + kfree_skb(skb); + } } /* Rx Data packet */