Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe Ricard and committed by
Samuel Ortiz
9dbe7763 1dab57f0

+10 -1
+10 -1
drivers/nfc/st21nfca/st21nfca_se.c
··· 310 310 case ST21NFCA_EVT_CONNECTIVITY: 311 311 break; 312 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 320 if (skb->len < NFC_MIN_AID_LENGTH + 2 && 314 321 skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) 315 322 return -EPROTO; ··· 325 318 skb->len - 2, GFP_KERNEL); 326 319 327 320 transaction->aid_len = skb->data[1]; 328 - memcpy(transaction->aid, &skb->data[2], skb->data[1]); 321 + memcpy(transaction->aid, &skb->data[2], 322 + transaction->aid_len); 329 323 324 + /* Check next byte is PARAMETERS tag (82) */ 330 325 if (skb->data[transaction->aid_len + 2] != 331 326 NFC_EVT_TRANSACTION_PARAMS_TAG) 332 327 return -EPROTO;