From: Ilan Elias <ilane@xxxxxx> Check if NCI data flow control is used in nci_tx_work. Signed-off-by: Ilan Elias <ilane@xxxxxx> --- include/net/nfc/nci.h | 3 +++ net/nfc/nci/core.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index 0b34fde..cdbe671 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h @@ -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 diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 803f6d1..fe5ca89 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -723,7 +723,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), -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html