summaryrefslogtreecommitdiff
path: root/include/net/nfc/digital.h
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-09-23 16:38:08 -0700
committerSamuel Ortiz <sameo@linux.intel.com>2014-11-28 12:38:59 +0100
commitb08147cbc4d1b63d65f6c7c522fed9ef3212bc52 (patch)
tree4e58372b062ffba93328d78a4f84e7cc8c2abd52 /include/net/nfc/digital.h
parent485fdc9bb6f81d68aa30b399b9bc33cf27d65ba4 (diff)
downloadlwn-b08147cbc4d1b63d65f6c7c522fed9ef3212bc52.tar.gz
lwn-b08147cbc4d1b63d65f6c7c522fed9ef3212bc52.zip
NFC: digital: Implement NFC-DEP max payload lengths
The maximum payload for NFC-DEP exchanges (i.e., the number of bytes between SoD and EoD) is negotiated using the ATR_REQ, ATR_RES, and PSL_REQ commands. The valid maximum lengths are 64, 128, 192, and 254 bytes. Currently, NFC-DEP code assumes that both sides are always using 254 byte maximums and ignores attempts by the peer to change it. Instead, implement the negotiation code, enforce the local maximum when receiving data from the peer, and don't send payloads that exceed the remote's maximum. The default local maximum is 254 bytes. 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/digital.h')
-rw-r--r--include/net/nfc/digital.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 80c6183989f3..42dbc6e6ee21 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -227,6 +227,9 @@ struct nfc_digital_dev {
u8 curr_nfc_dep_pni;
u8 did;
+ u8 local_payload_max;
+ u8 remote_payload_max;
+
u16 target_fsc;
int (*skb_check_crc)(struct sk_buff *skb);