Skip to content

Commit

Permalink
NFC: Check if NCI data flow control is used
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilan Elias authored and John W. Linville committed Nov 11, 2011
1 parent ee4c64f commit db98c82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/net/nfc/nci.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
/* NCI Static RF connection ID */
#define NCI_STATIC_RF_CONN_ID 0x00

/* NCI Data Flow Control */
#define NCI_DATA_FLOW_CONTROL_NOT_USED 0xff

/* NCI RF_DISCOVER_MAP_CMD modes */
#define NCI_DISC_MAP_MODE_POLL 0x01
#define NCI_DISC_MAP_MODE_LISTEN 0x02
Expand Down
5 changes: 4 additions & 1 deletion net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,10 @@ static void nci_tx_work(struct work_struct *work)
if (!skb)
return;

atomic_dec(&ndev->credits_cnt);
/* Check if data flow control is used */
if (atomic_read(&ndev->credits_cnt) !=
NCI_DATA_FLOW_CONTROL_NOT_USED)
atomic_dec(&ndev->credits_cnt);

nfc_dbg("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d",
nci_pbf(skb->data),
Expand Down

0 comments on commit db98c82

Please sign in to comment.