Lines Matching refs:NdefSmtCrdFmt
112 static NFCSTATUS phFriNfc_MfUL_H_Transceive(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
118 static NFCSTATUS phFriNfc_MfUL_H_WrRd(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
124 static void phFriNfc_MfUL_H_fillSendBuf(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt,
131 static NFCSTATUS phFriNfc_MfUL_H_ProRd16Bytes(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
137 static NFCSTATUS phFriNfc_MfUL_H_ProWrOTPBytes(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
146 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt,
153 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
158 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
163 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt,
170 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
175 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
180 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt);
208 void phFriNfc_MfUL_Reset(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_Reset() argument
212 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = PH_FRINFC_MFUL_FMT_VAL_0; in phFriNfc_MfUL_Reset()
213 (void)memcpy(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_Reset()
215 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes)); in phFriNfc_MfUL_Reset()
217 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[0] = 0; in phFriNfc_MfUL_Reset()
218 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[1] = 0; in phFriNfc_MfUL_Reset()
219 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[2] = 0; in phFriNfc_MfUL_Reset()
220 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[3] = 0; in phFriNfc_MfUL_Reset()
224 NFCSTATUS phFriNfc_MfUL_Format(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_Format() argument
229 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = PH_FRINFC_MFUL_FMT_VAL_0; in phFriNfc_MfUL_Format()
230 (void)memcpy(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_Format()
232 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes)); in phFriNfc_MfUL_Format()
235 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RD_16BYTES; in phFriNfc_MfUL_Format()
237 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = PH_FRINFC_MFUL_FMT_VAL_2; in phFriNfc_MfUL_Format()
240 Result = phFriNfc_MfUL_H_WrRd(NdefSmtCrdFmt); in phFriNfc_MfUL_Format()
248 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_ConvertToReadOnly() argument
252 NdefSmtCrdFmt->AddInfo.Type2Info.DefaultLockBytesFlag = TRUE; in phFriNfc_MfUL_ConvertToReadOnly()
253 NdefSmtCrdFmt->AddInfo.Type2Info.ReadDataIndex = 0; in phFriNfc_MfUL_ConvertToReadOnly()
255 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_RD_16BYTES; in phFriNfc_MfUL_ConvertToReadOnly()
257 result = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_ConvertToReadOnly()
267 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt = (phFriNfc_sNdefSmtCrdFmt_t *)Context; in phFriNfc_MfUL_Process() local
271 switch(NdefSmtCrdFmt->State) in phFriNfc_MfUL_Process()
274 Status = phFriNfc_MfUL_H_ProRd16Bytes(NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
278 Status = phFriNfc_MfUL_H_ProWrOTPBytes(NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
283 if (NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD) in phFriNfc_MfUL_Process()
286 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_Process()
289 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_WR_TLV1; in phFriNfc_MfUL_Process()
291 Status = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
301 if (MIFARE_UL_READ_MAX_SIZE == *NdefSmtCrdFmt->SendRecvLength) in phFriNfc_MfUL_Process()
306 otp_lock_page_size = sizeof (NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes); in phFriNfc_MfUL_Process()
307 (void)memcpy ((void *)NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes, in phFriNfc_MfUL_Process()
308 (void *)NdefSmtCrdFmt->SendRecvBuf, in phFriNfc_MfUL_Process()
309 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes)); in phFriNfc_MfUL_Process()
311 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[2] = (uint8_t) in phFriNfc_MfUL_Process()
312 (NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[2] in phFriNfc_MfUL_Process()
314 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes[3] = MIFARE_UL_LOCK_BYTE2_VALUE; in phFriNfc_MfUL_Process()
317 …otp_lock_page_size = sizeof (NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes); … in phFriNfc_MfUL_Process()
319 (void)memcpy ((void *)NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_Process()
320 (void *)(NdefSmtCrdFmt->SendRecvBuf + i), in phFriNfc_MfUL_Process()
321 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes)); in phFriNfc_MfUL_Process()
323 NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes[(otp_lock_page_size - 1)] = in phFriNfc_MfUL_Process()
326 switch (NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes[TYPE_2_MEM_SIZE_POSITION]) in phFriNfc_MfUL_Process()
330 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_WR_OTP_BYTES; in phFriNfc_MfUL_Process()
331 Status = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
338 NdefSmtCrdFmt->State = in phFriNfc_MfUL_Process()
342 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = 4; in phFriNfc_MfUL_Process()
343 Status = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
366 switch (NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes[TYPE_2_MEM_SIZE_POSITION]) in phFriNfc_MfUL_Process()
373 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_WR_LOCK_BYTES; in phFriNfc_MfUL_Process()
374 Status = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
392 if (MIFARE_UL_READ_MAX_SIZE == *NdefSmtCrdFmt->SendRecvLength) in phFriNfc_MfUL_Process()
394 Status = phFriNfc_MfUL_ParseTLVs (NdefSmtCrdFmt, in phFriNfc_MfUL_Process()
395 NdefSmtCrdFmt->SendRecvBuf, in phFriNfc_MfUL_Process()
396 (uint8_t)*NdefSmtCrdFmt->SendRecvLength); in phFriNfc_MfUL_Process()
400 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_Process()
401 NdefSmtCrdFmt->AddInfo.Type2Info.LockBlockNumber; in phFriNfc_MfUL_Process()
402 Status = phFriNfc_MfUL_ReadWriteLockBytes (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
415 if (MIFARE_UL_READ_MAX_SIZE == *NdefSmtCrdFmt->SendRecvLength) in phFriNfc_MfUL_Process()
417 (void)memcpy ((void *)NdefSmtCrdFmt->AddInfo.Type2Info.ReadData, in phFriNfc_MfUL_Process()
418 (void *)NdefSmtCrdFmt->SendRecvBuf, in phFriNfc_MfUL_Process()
419 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.ReadData)); in phFriNfc_MfUL_Process()
421 NdefSmtCrdFmt->AddInfo.Type2Info.ReadDataIndex = 0; in phFriNfc_MfUL_Process()
423 Status = phFriNfc_MfUL_UpdateAndWriteLockBits (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
436 NdefSmtCrdFmt->AddInfo.Type2Info.ReadDataIndex = (uint8_t) in phFriNfc_MfUL_Process()
437 (NdefSmtCrdFmt->AddInfo.Type2Info.ReadDataIndex + in phFriNfc_MfUL_Process()
440 if (!phFriNfc_MfUL_CalcRemainingLockBits (NdefSmtCrdFmt)) in phFriNfc_MfUL_Process()
443 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_WR_OTP_BYTES; in phFriNfc_MfUL_Process()
444 Status = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
446 else if ((NdefSmtCrdFmt->AddInfo.Type2Info.ReadDataIndex < in phFriNfc_MfUL_Process()
448 && (phFriNfc_MfUL_CalcRemainingLockBits (NdefSmtCrdFmt))) in phFriNfc_MfUL_Process()
451 Status = phFriNfc_MfUL_UpdateAndWriteLockBits (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
457 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = (uint8_t) in phFriNfc_MfUL_Process()
458 (NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock + 4); in phFriNfc_MfUL_Process()
459 Status = phFriNfc_MfUL_ReadWriteLockBytes (NdefSmtCrdFmt); in phFriNfc_MfUL_Process()
489 phFriNfc_SmtCrdFmt_HCrHandler(NdefSmtCrdFmt, Status); in phFriNfc_MfUL_Process()
500 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt, in phFriNfc_MfUL_GetSkipSize() argument
506 &NdefSmtCrdFmt->AddInfo.Type2Info; in phFriNfc_MfUL_GetSkipSize()
527 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_GetLockBytesInfo() argument
531 &(NdefSmtCrdFmt->AddInfo.Type2Info); in phFriNfc_MfUL_GetLockBytesInfo()
596 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_CalcRemainingLockBits() argument
600 &(NdefSmtCrdFmt->AddInfo.Type2Info); in phFriNfc_MfUL_CalcRemainingLockBits()
611 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_UpdateAndWriteLockBits() argument
615 &(NdefSmtCrdFmt->AddInfo.Type2Info); in phFriNfc_MfUL_UpdateAndWriteLockBits()
629 remaining_lock_bits = phFriNfc_MfUL_CalcRemainingLockBits (NdefSmtCrdFmt); in phFriNfc_MfUL_UpdateAndWriteLockBits()
725 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_WR_DYN_LOCK_BYTES; in phFriNfc_MfUL_UpdateAndWriteLockBits()
726 result = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_UpdateAndWriteLockBits()
734 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_ReadWriteLockBytes() argument
738 &(NdefSmtCrdFmt->AddInfo.Type2Info); in phFriNfc_MfUL_ReadWriteLockBytes()
746 && (phFriNfc_MfUL_CalcRemainingLockBits (NdefSmtCrdFmt) in phFriNfc_MfUL_ReadWriteLockBytes()
761 (phFriNfc_MfUL_CalcRemainingLockBits (NdefSmtCrdFmt) in phFriNfc_MfUL_ReadWriteLockBytes()
776 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_WR_DYN_LOCK_BYTES; in phFriNfc_MfUL_ReadWriteLockBytes()
777 result = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_ReadWriteLockBytes()
781 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_RD_DYN_LOCK_BYTES; in phFriNfc_MfUL_ReadWriteLockBytes()
782 result = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_ReadWriteLockBytes()
791 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_GetDefaultLockBytesInfo() argument
795 &(NdefSmtCrdFmt->AddInfo.Type2Info); in phFriNfc_MfUL_GetDefaultLockBytesInfo()
818 phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt, in phFriNfc_MfUL_ParseTLVs() argument
834 (NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes[TYPE_2_MEM_SIZE_POSITION] * 8); in phFriNfc_MfUL_ParseTLVs()
845 skip_lock_mem_size = phFriNfc_MfUL_GetSkipSize (NdefSmtCrdFmt, in phFriNfc_MfUL_ParseTLVs()
846 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock, in phFriNfc_MfUL_ParseTLVs()
894 NdefSmtCrdFmt->AddInfo.Type2Info.DefaultLockBytesFlag = in phFriNfc_MfUL_ParseTLVs()
896 result = phFriNfc_MfUL_GetDefaultLockBytesInfo (NdefSmtCrdFmt); in phFriNfc_MfUL_ParseTLVs()
934 NdefSmtCrdFmt->AddInfo.Type2Info.DefaultLockBytesFlag = in phFriNfc_MfUL_ParseTLVs()
936 NdefSmtCrdFmt->AddInfo.Type2Info.DynLockBytes[lock_mem_ndef_index] = in phFriNfc_MfUL_ParseTLVs()
944 NdefSmtCrdFmt->AddInfo.Type2Info.DynLockBytes[lock_mem_ndef_index] = in phFriNfc_MfUL_ParseTLVs()
948 result = phFriNfc_MfUL_GetLockBytesInfo (NdefSmtCrdFmt); in phFriNfc_MfUL_ParseTLVs()
1067 if ((NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes[TYPE_2_MEM_SIZE_POSITION] in phFriNfc_MfUL_ParseTLVs()
1094 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_RO_NDEF_PARSE_RD_BYTES; in phFriNfc_MfUL_ParseTLVs()
1095 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_ParseTLVs()
1096 (NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock + 4); in phFriNfc_MfUL_ParseTLVs()
1098 result = phFriNfc_MfUL_H_WrRd (NdefSmtCrdFmt); in phFriNfc_MfUL_ParseTLVs()
1114 static NFCSTATUS phFriNfc_MfUL_H_WrRd( phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt ) in phFriNfc_MfUL_H_WrRd() argument
1119 phFriNfc_MfUL_H_fillSendBuf(NdefSmtCrdFmt, in phFriNfc_MfUL_H_WrRd()
1120 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock); in phFriNfc_MfUL_H_WrRd()
1123 Result = phFriNfc_MfUL_H_Transceive (NdefSmtCrdFmt); in phFriNfc_MfUL_H_WrRd()
1128 static NFCSTATUS phFriNfc_MfUL_H_Transceive(phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt) in phFriNfc_MfUL_H_Transceive() argument
1133 NdefSmtCrdFmt->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_MfUL_H_Transceive()
1134 NdefSmtCrdFmt->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_MfUL_H_Transceive()
1135 NdefSmtCrdFmt->psDepAdditionalInfo.NAD = 0; in phFriNfc_MfUL_H_Transceive()
1138 NdefSmtCrdFmt->SmtCrdFmtCompletionInfo.CompletionRoutine = phFriNfc_NdefSmtCrd_Process; in phFriNfc_MfUL_H_Transceive()
1139 NdefSmtCrdFmt->SmtCrdFmtCompletionInfo.Context = NdefSmtCrdFmt; in phFriNfc_MfUL_H_Transceive()
1141 *NdefSmtCrdFmt->SendRecvLength = PH_FRINFC_SMTCRDFMT_MAX_SEND_RECV_BUF_SIZE; in phFriNfc_MfUL_H_Transceive()
1144 Result = phFriNfc_OvrHal_Transceive( NdefSmtCrdFmt->LowerDevice, in phFriNfc_MfUL_H_Transceive()
1145 &NdefSmtCrdFmt->SmtCrdFmtCompletionInfo, in phFriNfc_MfUL_H_Transceive()
1146 NdefSmtCrdFmt->psRemoteDevInfo, in phFriNfc_MfUL_H_Transceive()
1147 NdefSmtCrdFmt->Cmd, in phFriNfc_MfUL_H_Transceive()
1148 &NdefSmtCrdFmt->psDepAdditionalInfo, in phFriNfc_MfUL_H_Transceive()
1149 NdefSmtCrdFmt->SendRecvBuf, in phFriNfc_MfUL_H_Transceive()
1150 NdefSmtCrdFmt->SendLength, in phFriNfc_MfUL_H_Transceive()
1151 NdefSmtCrdFmt->SendRecvBuf, in phFriNfc_MfUL_H_Transceive()
1152 NdefSmtCrdFmt->SendRecvLength); in phFriNfc_MfUL_H_Transceive()
1156 static void phFriNfc_MfUL_H_fillSendBuf( phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt, in phFriNfc_MfUL_H_fillSendBuf() argument
1169 NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_0] = (uint8_t)BlockNo; in phFriNfc_MfUL_H_fillSendBuf()
1170 switch(NdefSmtCrdFmt->State) in phFriNfc_MfUL_H_fillSendBuf()
1177 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1180 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1182 *NdefSmtCrdFmt->SendRecvBuf = RD_LOCK_OTP_BLOCK_NUMBER; in phFriNfc_MfUL_H_fillSendBuf()
1184 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_1; in phFriNfc_MfUL_H_fillSendBuf()
1193 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1196 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1198 *NdefSmtCrdFmt->SendRecvBuf = in phFriNfc_MfUL_H_fillSendBuf()
1199 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock; in phFriNfc_MfUL_H_fillSendBuf()
1201 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_1; in phFriNfc_MfUL_H_fillSendBuf()
1208 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1211 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1213 *NdefSmtCrdFmt->SendRecvBuf = NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock; in phFriNfc_MfUL_H_fillSendBuf()
1215 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_1; in phFriNfc_MfUL_H_fillSendBuf()
1222 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1225 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1229 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1230 *NdefSmtCrdFmt->SendRecvBuf = NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock; in phFriNfc_MfUL_H_fillSendBuf()
1231 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1232 NdefSmtCrdFmt->AddInfo.Type2Info.DynLockBytes, in phFriNfc_MfUL_H_fillSendBuf()
1242 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1245 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1249 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1250 *NdefSmtCrdFmt->SendRecvBuf = RD_LOCK_OTP_BLOCK_NUMBER; in phFriNfc_MfUL_H_fillSendBuf()
1251 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1252 NdefSmtCrdFmt->AddInfo.Type2Info.LockBytes, in phFriNfc_MfUL_H_fillSendBuf()
1260 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1263 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1267 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1268 *NdefSmtCrdFmt->SendRecvBuf = OTP_BLOCK_NUMBER; in phFriNfc_MfUL_H_fillSendBuf()
1269 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1270 NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_H_fillSendBuf()
1279 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1282 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareRead; in phFriNfc_MfUL_H_fillSendBuf()
1285 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_1; in phFriNfc_MfUL_H_fillSendBuf()
1290 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1293 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1295 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1298 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1299 NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_H_fillSendBuf()
1308 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1311 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1313 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareCmdListMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1318 if (NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD) in phFriNfc_MfUL_H_fillSendBuf()
1320 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1324 else if (NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_UL_CARD) in phFriNfc_MfUL_H_fillSendBuf()
1326 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1334 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1344 if (NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD) in phFriNfc_MfUL_H_fillSendBuf()
1347 NdefSmtCrdFmt->SendLength = PH_FRINFC_MFUL_FMT_VAL_5; in phFriNfc_MfUL_H_fillSendBuf()
1349 NdefSmtCrdFmt->Cmd.MfCmd = phHal_eMifareWrite4; in phFriNfc_MfUL_H_fillSendBuf()
1350 (void)memcpy(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_1], in phFriNfc_MfUL_H_fillSendBuf()
1363 static NFCSTATUS phFriNfc_MfUL_H_ProRd16Bytes( phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt ) in phFriNfc_MfUL_H_ProRd16Bytes() argument
1376 if ((NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_2] == in phFriNfc_MfUL_H_ProRd16Bytes()
1378 (NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_3] == in phFriNfc_MfUL_H_ProRd16Bytes()
1384 if (NdefSmtCrdFmt->SendRecvBuf[8] == 0x02 && in phFriNfc_MfUL_H_ProRd16Bytes()
1385 NdefSmtCrdFmt->SendRecvBuf[9] == 0x00) in phFriNfc_MfUL_H_ProRd16Bytes()
1387 NdefSmtCrdFmt->CardType = PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD; in phFriNfc_MfUL_H_ProRd16Bytes()
1389 (void)memcpy(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_H_ProRd16Bytes()
1391 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes)); in phFriNfc_MfUL_H_ProRd16Bytes()
1393 else if (NdefSmtCrdFmt->SendRecvBuf[8] == 0xFF && in phFriNfc_MfUL_H_ProRd16Bytes()
1394 NdefSmtCrdFmt->SendRecvBuf[9] == 0xFF) in phFriNfc_MfUL_H_ProRd16Bytes()
1396 NdefSmtCrdFmt->CardType = PH_FRINFC_NDEFMAP_MIFARE_UL_CARD; in phFriNfc_MfUL_H_ProRd16Bytes()
1398 (void)memcpy(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_H_ProRd16Bytes()
1400 sizeof(NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes)); in phFriNfc_MfUL_H_ProRd16Bytes()
1404 NdefSmtCrdFmt->CardType = PH_FRINFC_NDEFMAP_MIFARE_UL_CARD; in phFriNfc_MfUL_H_ProRd16Bytes()
1410 MemCompare1(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_4], in phFriNfc_MfUL_H_ProRd16Bytes()
1411 NdefSmtCrdFmt->AddInfo.Type2Info.OTPBytes, in phFriNfc_MfUL_H_ProRd16Bytes()
1417 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_H_ProRd16Bytes()
1420 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_WR_TLV; in phFriNfc_MfUL_H_ProRd16Bytes()
1425 … memcompare = (uint32_t)MemCompare1(&NdefSmtCrdFmt->SendRecvBuf[PH_FRINFC_MFUL_FMT_VAL_4], in phFriNfc_MfUL_H_ProRd16Bytes()
1432 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_H_ProRd16Bytes()
1435 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_WR_OTPBYTES; in phFriNfc_MfUL_H_ProRd16Bytes()
1444 ((NdefSmtCrdFmt->State == PH_FRINFC_MFUL_FMT_WR_TLV) || in phFriNfc_MfUL_H_ProRd16Bytes()
1445 (NdefSmtCrdFmt->State == PH_FRINFC_MFUL_FMT_WR_OTPBYTES)) && in phFriNfc_MfUL_H_ProRd16Bytes()
1446 ((NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD) || in phFriNfc_MfUL_H_ProRd16Bytes()
1447 (NdefSmtCrdFmt->CardType == PH_FRINFC_NDEFMAP_MIFARE_UL_CARD)) in phFriNfc_MfUL_H_ProRd16Bytes()
1450 if((NdefSmtCrdFmt->State == PH_FRINFC_MFUL_FMT_WR_TLV) || in phFriNfc_MfUL_H_ProRd16Bytes()
1451 (NdefSmtCrdFmt->State == PH_FRINFC_MFUL_FMT_WR_OTPBYTES)) in phFriNfc_MfUL_H_ProRd16Bytes()
1454 Result = phFriNfc_MfUL_H_WrRd(NdefSmtCrdFmt); in phFriNfc_MfUL_H_ProRd16Bytes()
1459 static NFCSTATUS phFriNfc_MfUL_H_ProWrOTPBytes( phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt ) in phFriNfc_MfUL_H_ProWrOTPBytes() argument
1463 NdefSmtCrdFmt->State = PH_FRINFC_MFUL_FMT_WR_TLV; in phFriNfc_MfUL_H_ProWrOTPBytes()
1466 NdefSmtCrdFmt->AddInfo.Type2Info.CurrentBlock = in phFriNfc_MfUL_H_ProWrOTPBytes()
1469 Result = phFriNfc_MfUL_H_WrRd(NdefSmtCrdFmt); in phFriNfc_MfUL_H_ProWrOTPBytes()