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

NFC: digital: Add digital framing calls when in target mode

Add new "NFC_DIGITAL_FRAMING_*" calls to the digital
layer so the driver can make the necessary adjustments
when performing anticollision while in target mode.

The driver must ensure that the effect of these calls
happens after the following response has been sent but
before reception of the next request begins.

Acked-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>

authored by

Mark A. Greer and committed by
Samuel Ortiz
55537c7e 0529a7ad

+23
+2
include/net/nfc/digital.h
··· 49 49 NFC_DIGITAL_FRAMING_NFCA_SHORT = 0, 50 50 NFC_DIGITAL_FRAMING_NFCA_STANDARD, 51 51 NFC_DIGITAL_FRAMING_NFCA_STANDARD_WITH_CRC_A, 52 + NFC_DIGITAL_FRAMING_NFCA_ANTICOL_COMPLETE, 52 53 53 54 NFC_DIGITAL_FRAMING_NFCA_T1T, 54 55 NFC_DIGITAL_FRAMING_NFCA_T2T, ··· 66 65 67 66 NFC_DIGITAL_FRAMING_NFCB, 68 67 NFC_DIGITAL_FRAMING_NFCB_T4T, 68 + 69 69 70 70 NFC_DIGITAL_FRAMING_LAST, 71 71 };
+21
net/nfc/digital_technology.c
··· 944 944 if (!DIGITAL_DRV_CAPS_TG_CRC(ddev)) 945 945 digital_skb_add_crc_a(skb); 946 946 947 + rc = digital_tg_configure_hw(ddev, NFC_DIGITAL_CONFIG_FRAMING, 948 + NFC_DIGITAL_FRAMING_NFCA_ANTICOL_COMPLETE); 949 + if (rc) { 950 + kfree_skb(skb); 951 + return rc; 952 + } 953 + 947 954 rc = digital_tg_send_cmd(ddev, skb, 300, digital_tg_recv_atr_req, 948 955 NULL); 949 956 if (rc) ··· 1009 1002 for (i = 0; i < 4; i++) 1010 1003 sdd_res->bcc ^= sdd_res->nfcid1[i]; 1011 1004 1005 + rc = digital_tg_configure_hw(ddev, NFC_DIGITAL_CONFIG_FRAMING, 1006 + NFC_DIGITAL_FRAMING_NFCA_STANDARD_WITH_CRC_A); 1007 + if (rc) { 1008 + kfree_skb(skb); 1009 + return rc; 1010 + } 1011 + 1012 1012 rc = digital_tg_send_cmd(ddev, skb, 300, digital_tg_recv_sel_req, 1013 1013 NULL); 1014 1014 if (rc) ··· 1067 1053 1068 1054 sens_res[0] = (DIGITAL_SENS_RES_NFC_DEP >> 8) & 0xFF; 1069 1055 sens_res[1] = DIGITAL_SENS_RES_NFC_DEP & 0xFF; 1056 + 1057 + rc = digital_tg_configure_hw(ddev, NFC_DIGITAL_CONFIG_FRAMING, 1058 + NFC_DIGITAL_FRAMING_NFCA_STANDARD); 1059 + if (rc) { 1060 + kfree_skb(skb); 1061 + return rc; 1062 + } 1070 1063 1071 1064 rc = digital_tg_send_cmd(ddev, skb, 300, digital_tg_recv_sdd_req, 1072 1065 NULL);