aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/nfc
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-09-23 16:38:11 -0700
committerSamuel Ortiz <sameo@linux.intel.com>2014-11-28 12:39:33 +0100
commita80509c76bf2b10dae76f3caea343ac4b85c72b4 (patch)
tree924f14ca602ddecd0bb5b81e7201628882b07375 /include/net/nfc
parentNFC: digital: Add NFC-DEP Receive Chaining Support (diff)
downloadlinux-dev-a80509c76bf2b10dae76f3caea343ac4b85c72b4.tar.xz
linux-dev-a80509c76bf2b10dae76f3caea343ac4b85c72b4.zip
NFC: digital: Add NFC-DEP Initiator-side NACK Support
When an NFC-DEP Initiator receives a frame with an incorrect CRC or with a parity error, and the frame is at least 4 bytes long, its supposed to send a NACK to the Target. The Initiator can send up to 'N(retry,nack)' consecutive NACKs where 2 <= 'N(retry,nack)' <= 5. When the limit is exceeded, a PROTOCOL EXCEPTION is raised. Any other type of transmission error is to be ignored and the Initiator should continue waiting for a new frame. This is described in section 14.12.5.4 of the NFC Digital Protocol Spec. The digital layer's NFC-DEP code doesn't implement any of this so add it. This support diverges from the spec in two significant ways: a) NACKs will be sent for ANY error reported by the driver except a timeout. This is done because there is currently no way for the digital layer to distinguish a CRC or parity error from any other type of error reported by the driver. b) All other errors will cause a PROTOCOL EXCEPTION even frames with CRC errors that are less than 4 bytes. The value chosen for 'N(retry,nack)' is 2. Targets do not send NACK PDUs. Reviewed-by: Thierry Escande <thierry.escande@linux.intel.com> Tested-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/net/nfc')
-rw-r--r--include/net/nfc/digital.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 2fdff00e06cd..2fd498cdb818 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -233,6 +233,8 @@ struct nfc_digital_dev {
struct sk_buff *chaining_skb;
struct digital_data_exch *data_exch;
+ int nack_count;
+
u16 target_fsc;
int (*skb_check_crc)(struct sk_buff *skb);