diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-03-31 02:02:23 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-04-05 18:21:10 -0400 |
commit | 9dbe776338e7f97483452cc00adf0d527d6900dd (patch) | |
tree | 02ff8fc21e50a819411c10f7170c83024d98c29c /drivers/nfc | |
parent | 1dab57f0ed753ddef07a8aa987d490c74884ff18 (diff) |
nfc: st21nfca: Add additional comments about EVT_TRANSACTION
Add comments about HCI EVT_TRANSACTION in order to make the code
understandable by other readers.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r-- | drivers/nfc/st21nfca/st21nfca_se.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/nfc/st21nfca/st21nfca_se.c b/drivers/nfc/st21nfca/st21nfca_se.c index bd13cac9c66a..3197e9bb66f7 100644 --- a/drivers/nfc/st21nfca/st21nfca_se.c +++ b/drivers/nfc/st21nfca/st21nfca_se.c | |||
@@ -310,6 +310,13 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, | |||
310 | case ST21NFCA_EVT_CONNECTIVITY: | 310 | case ST21NFCA_EVT_CONNECTIVITY: |
311 | break; | 311 | break; |
312 | case ST21NFCA_EVT_TRANSACTION: | 312 | case ST21NFCA_EVT_TRANSACTION: |
313 | /* | ||
314 | * According to specification etsi 102 622 | ||
315 | * 11.2.2.4 EVT_TRANSACTION Table 52 | ||
316 | * Description Tag Length | ||
317 | * AID 81 5 to 16 | ||
318 | * PARAMETERS 82 0 to 255 | ||
319 | */ | ||
313 | if (skb->len < NFC_MIN_AID_LENGTH + 2 && | 320 | if (skb->len < NFC_MIN_AID_LENGTH + 2 && |
314 | skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) | 321 | skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) |
315 | return -EPROTO; | 322 | return -EPROTO; |
@@ -318,8 +325,10 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, | |||
318 | skb->len - 2, GFP_KERNEL); | 325 | skb->len - 2, GFP_KERNEL); |
319 | 326 | ||
320 | transaction->aid_len = skb->data[1]; | 327 | transaction->aid_len = skb->data[1]; |
321 | memcpy(transaction->aid, &skb->data[2], skb->data[1]); | 328 | memcpy(transaction->aid, &skb->data[2], |
329 | transaction->aid_len); | ||
322 | 330 | ||
331 | /* Check next byte is PARAMETERS tag (82) */ | ||
323 | if (skb->data[transaction->aid_len + 2] != | 332 | if (skb->data[transaction->aid_len + 2] != |
324 | NFC_EVT_TRANSACTION_PARAMS_TAG) | 333 | NFC_EVT_TRANSACTION_PARAMS_TAG) |
325 | return -EPROTO; | 334 | return -EPROTO; |