aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlan Elias <ilane@ti.com>2011-11-09 05:09:16 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-11 12:32:50 -0500
commitdb98c829b70e0a313e627d1c63cf5a7087290e5c (patch)
treeddf1c3982c0a07ece89355675efd4464475cac57
parentee4c64fb984e652c0d49d41d19d1b8e4576c3203 (diff)
NFC: Check if NCI data flow control is used
Check if NCI data flow control is used in nci_tx_work. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/nfc/nci.h3
-rw-r--r--net/nfc/nci/core.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 0b34fde9b13..cdbe6713934 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -108,6 +108,9 @@
108/* NCI Static RF connection ID */ 108/* NCI Static RF connection ID */
109#define NCI_STATIC_RF_CONN_ID 0x00 109#define NCI_STATIC_RF_CONN_ID 0x00
110 110
111/* NCI Data Flow Control */
112#define NCI_DATA_FLOW_CONTROL_NOT_USED 0xff
113
111/* NCI RF_DISCOVER_MAP_CMD modes */ 114/* NCI RF_DISCOVER_MAP_CMD modes */
112#define NCI_DISC_MAP_MODE_POLL 0x01 115#define NCI_DISC_MAP_MODE_POLL 0x01
113#define NCI_DISC_MAP_MODE_LISTEN 0x02 116#define NCI_DISC_MAP_MODE_LISTEN 0x02
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 9d0b5305c36..3dffcb3221c 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -722,7 +722,10 @@ static void nci_tx_work(struct work_struct *work)
722 if (!skb) 722 if (!skb)
723 return; 723 return;
724 724
725 atomic_dec(&ndev->credits_cnt); 725 /* Check if data flow control is used */
726 if (atomic_read(&ndev->credits_cnt) !=
727 NCI_DATA_FLOW_CONTROL_NOT_USED)
728 atomic_dec(&ndev->credits_cnt);
726 729
727 nfc_dbg("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d", 730 nfc_dbg("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d",
728 nci_pbf(skb->data), 731 nci_pbf(skb->data),