From 8939e47fc953cce6ef53e79e9ff9b53319d1a72d Mon Sep 17 00:00:00 2001 From: Ilan Elias Date: Wed, 18 Jan 2012 13:16:12 +0200 Subject: NFC: Clearly separate NCI states from flags Make a clear separation between NCI states and flags. This is required in order to support more NCI states (e.g. for multiple targets support). Signed-off-by: Ilan Elias Signed-off-by: John W. Linville --- include/net/nfc/nci_core.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/net') diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 9154663b606b..b9c3f8de13dd 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h @@ -34,16 +34,21 @@ #include #include -/* NCI device state */ -enum { +/* NCI device flags */ +enum nci_flag { NCI_INIT, NCI_UP, - NCI_DISCOVERY, - NCI_POLL_ACTIVE, NCI_DATA_EXCHANGE, NCI_DATA_EXCHANGE_TO, }; +/* NCI device states */ +enum nci_state { + NCI_IDLE, + NCI_DISCOVERY, + NCI_POLL_ACTIVE, +}; + /* NCI timeouts */ #define NCI_RESET_TIMEOUT 5000 #define NCI_INIT_TIMEOUT 5000 @@ -70,6 +75,7 @@ struct nci_dev { int tx_headroom; int tx_tailroom; + atomic_t state; unsigned long flags; atomic_t cmd_cnt; -- cgit v1.2.3