summaryrefslogtreecommitdiff
path: root/net/nfc/nci/data.c
diff options
context:
space:
mode:
authorIlan Elias <ilane@ti.com>2012-01-17 14:03:50 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-01-24 23:21:55 +0400
commitc4bf98b220cba7a8618405261d69ee53a265110e (patch)
tree2710efffaefc519f0d08f116ba669b1648aaab4a /net/nfc/nci/data.c
parent889cbb911a195b832745f77240f547cb2a2885bc (diff)
downloadlinux-c4bf98b220cba7a8618405261d69ee53a265110e.tar.xz
NFC: Add NCI data exchange timer
Add NCI data exchange timer to catch timeouts, and call the data exchange callback with an error. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/nci/data.c')
-rw-r--r--net/nfc/nci/data.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index e5756b30e602..7880ae924d5e 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -44,6 +44,10 @@ void nci_data_exchange_complete(struct nci_dev *ndev,
pr_debug("len %d, err %d\n", skb ? skb->len : 0, err);
+ /* data exchange is complete, stop the data timer */
+ del_timer_sync(&ndev->data_timer);
+ clear_bit(NCI_DATA_EXCHANGE_TO, &ndev->flags);
+
if (cb) {
ndev->data_exchange_cb = NULL;
ndev->data_exchange_cb_context = 0;