• Home
  • Raw
  • Download

Lines Matching refs:NdefMap

53 static NFCSTATUS   phFriNfc_Felica_HRdAttrInfo(phFriNfc_NdefMap_t *NdefMap);
54 static NFCSTATUS phFriNfc_Felica_HUpdateAttrInfo(phFriNfc_NdefMap_t *NdefMap);
61 static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap,
65 static NFCSTATUS phFriNfc_Felica_HUpdateManufIdDetails(const phFriNfc_NdefMap_t *NdefMap);
68 static NFCSTATUS phFriNfc_Felica_HReadData(phFriNfc_NdefMap_t *NdefMap,uint8_t offset);
69 static uint16_t phFriNfc_Felica_HGetMaximumBlksToRead(const phFriNfc_NdefMap_t *NdefMap,uint8_t …
70 static void phFriNfc_Felica_HAfterRead_CopyDataToBuff(phFriNfc_NdefMap_t *NdefMap);
71 static NFCSTATUS phFriNfc_Felica_HSetTransceiveForRead(phFriNfc_NdefMap_t *NdefMap,uint16_t TrxLe…
72 static uint16_t phFriNfc_Felica_HSetTrxLen(phFriNfc_NdefMap_t *NdefMap,uint16_t Nbc);
73 static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap);
76 static NFCSTATUS phFriNfc_Felica_HChkAttrBlkForWrOp(phFriNfc_NdefMap_t *NdefMap);
77 static NFCSTATUS phFriNfc_Felica_HChkAttrBlkForRdOp(phFriNfc_NdefMap_t *NdefMap,
79 static NFCSTATUS phFriNfc_Felica_HUpdateAttrBlkForWrOp(phFriNfc_NdefMap_t *NdefMap,uint8_t isStart…
80 static NFCSTATUS phFriNfc_Felica_HUpdateData(phFriNfc_NdefMap_t *NdefMap);
81 static NFCSTATUS phFriNfc_Felica_HWriteDataBlk(phFriNfc_NdefMap_t *NdefMap);
84 static NFCSTATUS phFriNfc_Felica_HWrEmptyMsg(phFriNfc_NdefMap_t *NdefMap);
87 static NFCSTATUS phFriNfc_Felica_HCheckManufId(const phFriNfc_NdefMap_t *NdefMap);
88 static void phFriNfc_Felica_HCrHandler(phFriNfc_NdefMap_t *NdefMap,
102 static uint16_t phFriNfc_Felica_HGetMaximumBlksToRead(const phFriNfc_NdefMap_t *NdefMap, uint8_t… in phFriNfc_Felica_HGetMaximumBlksToRead() argument
109 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_HGetMaximumBlksToRead()
110 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_HGetMaximumBlksToRead()
111 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_HGetMaximumBlksToRead()
120 BlksToRead = NdefMap->FelicaAttrInfo.Nmaxb; in phFriNfc_Felica_HGetMaximumBlksToRead()
139 NFCSTATUS phFriNfc_Felica_RdNdef( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_RdNdef() argument
148 NdefMap->ApduBufferSize = *PacketDataLength; in phFriNfc_Felica_RdNdef()
150 NdefMap->ApduBuffer = PacketData; in phFriNfc_Felica_RdNdef()
152 NdefMap->NumOfBytesRead = PacketDataLength ; in phFriNfc_Felica_RdNdef()
153 *NdefMap->NumOfBytesRead = 0; in phFriNfc_Felica_RdNdef()
154 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_RdNdef()
156 NdefMap->PrevOperation = PH_FRINFC_NDEFMAP_READ_OPE; in phFriNfc_Felica_RdNdef()
157 NdefMap->Felica.Offset = Offset; in phFriNfc_Felica_RdNdef()
159 …if( ( Offset == PH_FRINFC_NDEFMAP_SEEK_BEGIN )||( NdefMap->PrevOperation == PH_FRINFC_NDEFMAP_WRIT… in phFriNfc_Felica_RdNdef()
161 NdefMap->Felica.CurBlockNo = 0; in phFriNfc_Felica_RdNdef()
162 NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_RD_ATTR_RD_OP; in phFriNfc_Felica_RdNdef()
163 NdefMap->Felica.IntermediateCpyFlag = FALSE; in phFriNfc_Felica_RdNdef()
164 NdefMap->Felica.IntermediateCpyLen = 0; in phFriNfc_Felica_RdNdef()
165 NdefMap->Felica.Rd_NoBytesToCopy = 0; in phFriNfc_Felica_RdNdef()
166 NdefMap->Felica.EofCardReachedFlag= FALSE ; in phFriNfc_Felica_RdNdef()
167 NdefMap->Felica.LastBlkReachedFlag = FALSE; in phFriNfc_Felica_RdNdef()
168 NdefMap->Felica.CurrBytesRead = 0; in phFriNfc_Felica_RdNdef()
170 phFriNfc_Felica_HInitInternalBuf(NdefMap->Felica.Rd_BytesToCopyBuff); in phFriNfc_Felica_RdNdef()
173 status = phFriNfc_Felica_HRdAttrInfo(NdefMap); in phFriNfc_Felica_RdNdef()
178 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_CHK_NDEF,status); in phFriNfc_Felica_RdNdef()
183 Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); in phFriNfc_Felica_RdNdef()
186 if(( ( Offset == PH_FRINFC_NDEFMAP_SEEK_CUR) && (NdefMap->Felica.CurBlockNo == Nbc)) && in phFriNfc_Felica_RdNdef()
187 (NdefMap->Felica.EofCardReachedFlag == FELICA_RD_WR_EOF_CARD_REACHED )) in phFriNfc_Felica_RdNdef()
194NdefMap->Felica.CurrBytesRead = ((NdefMap->Felica.CurBlockNo * 16)- NdefMap->Felica.Rd_NoBytesToCo… in phFriNfc_Felica_RdNdef()
195 status = phFriNfc_Felica_HReadData(NdefMap,NdefMap->Felica.Offset); in phFriNfc_Felica_RdNdef()
210 static NFCSTATUS phFriNfc_Felica_HReadData(phFriNfc_NdefMap_t *NdefMap,uint8_t offset) in phFriNfc_Felica_HReadData() argument
215 Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); in phFriNfc_Felica_HReadData()
216 …if( ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) > 0) && (NdefMap->Felica.CurBlockNo < Nbc… in phFriNfc_Felica_HReadData()
219 if (NdefMap->Felica.Rd_NoBytesToCopy > 0 ) in phFriNfc_Felica_HReadData()
222 phFriNfc_Felica_HAfterRead_CopyDataToBuff(NdefMap); in phFriNfc_Felica_HReadData()
224 status = phFriNfc_Felica_HChkApduBuff_Size(NdefMap); in phFriNfc_Felica_HReadData()
225 if ( (status != NFCSTATUS_SUCCESS) && (NdefMap->Felica.IntermediateRdFlag == TRUE )) in phFriNfc_Felica_HReadData()
228 TranscLen = phFriNfc_Felica_HSetTrxLen(NdefMap,Nbc); in phFriNfc_Felica_HReadData()
229 status= phFriNfc_Felica_HSetTransceiveForRead(NdefMap,TranscLen,offset); in phFriNfc_Felica_HReadData()
240 TranscLen = phFriNfc_Felica_HSetTrxLen(NdefMap,Nbc); in phFriNfc_Felica_HReadData()
241 status= phFriNfc_Felica_HSetTransceiveForRead(NdefMap,TranscLen,offset); in phFriNfc_Felica_HReadData()
247 status = phFriNfc_Felica_HChkApduBuff_Size(NdefMap); in phFriNfc_Felica_HReadData()
248 if ( (status != NFCSTATUS_SUCCESS) && (NdefMap->Felica.IntermediateRdFlag == TRUE )) in phFriNfc_Felica_HReadData()
250 TranscLen = phFriNfc_Felica_HSetTrxLen(NdefMap,Nbc); in phFriNfc_Felica_HReadData()
251 status= phFriNfc_Felica_HSetTransceiveForRead(NdefMap,TranscLen,offset); in phFriNfc_Felica_HReadData()
261 static uint16_t phFriNfc_Felica_HSetTrxLen(phFriNfc_NdefMap_t *NdefMap,uint16_t Nbc) in phFriNfc_Felica_HSetTrxLen() argument
265 if( ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)% 16) == 0) in phFriNfc_Felica_HSetTrxLen()
267 BlocksToRead = (uint16_t)( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)/16 ); in phFriNfc_Felica_HSetTrxLen()
271 BlocksToRead = (uint16_t)(((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)/16) +1); in phFriNfc_Felica_HSetTrxLen()
273 if ( (BlocksToRead > Nbc) ||( (BlocksToRead) > ( Nbc - NdefMap->Felica.CurBlockNo)) ) in phFriNfc_Felica_HSetTrxLen()
275 BlocksToRead = Nbc - NdefMap->Felica.CurBlockNo; in phFriNfc_Felica_HSetTrxLen()
279 if ( BlocksToRead >= NdefMap->FelicaAttrInfo.Nbr) in phFriNfc_Felica_HSetTrxLen()
281 if( NdefMap->FelicaAttrInfo.Nbr < Nbc ) in phFriNfc_Felica_HSetTrxLen()
283 TranscLen = NdefMap->FelicaAttrInfo.Nbr*16; in phFriNfc_Felica_HSetTrxLen()
288 NdefMap->Felica.LastBlkReachedFlag =1; in phFriNfc_Felica_HSetTrxLen()
295 if ( ( BlocksToRead * 16) == ((Nbc *16) - (NdefMap->Felica.CurBlockNo * 16))) in phFriNfc_Felica_HSetTrxLen()
297 NdefMap->Felica.LastBlkReachedFlag =1; in phFriNfc_Felica_HSetTrxLen()
310 NdefMap->Felica.TrxLen = TranscLen; in phFriNfc_Felica_HSetTrxLen()
319 static void phFriNfc_Felica_HAfterRead_CopyDataToBuff(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HAfterRead_CopyDataToBuff() argument
325 Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC ); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
327 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
328 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
329 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
332 if( NdefMap->Felica.Rd_NoBytesToCopy > 0 ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
334 if ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) < NdefMap->Felica.Rd_NoBytesToCopy ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
336NdefMap->Felica.Rd_NoBytesToCopy -= (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
338 if (NdefMap->Felica.IntermediateCpyFlag == TRUE ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
341 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
342 … (&(NdefMap->Felica.Rd_BytesToCopyBuff[NdefMap->Felica.IntermediateCpyLen])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
343 (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
348NdefMap->Felica.IntermediateCpyLen += (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
349 NdefMap->Felica.IntermediateCpyFlag = 1; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
352 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
353NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
354NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
357 if ( NdefMap->Felica.Rd_NoBytesToCopy == 0) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
359 NdefMap->Felica.EofCardReachedFlag =FELICA_RD_WR_EOF_CARD_REACHED; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
365 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
366 NdefMap->Felica.Rd_BytesToCopyBuff, in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
367 (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
369NdefMap->ApduBuffIndex += (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
372 … else if ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) == NdefMap->Felica.Rd_NoBytesToCopy ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
374 if ( NdefMap->Felica.IntermediateCpyFlag == TRUE ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
377 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
378 … (&(NdefMap->Felica.Rd_BytesToCopyBuff[NdefMap->Felica.IntermediateCpyLen])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
379 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
384 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
385 NdefMap->Felica.Rd_BytesToCopyBuff, in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
386 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
390 NdefMap->ApduBuffIndex += NdefMap->Felica.Rd_NoBytesToCopy; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
391 NdefMap->Felica.Rd_NoBytesToCopy -= (uint8_t)(NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
399 if ( NdefMap->Felica.IntermediateCpyFlag == TRUE ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
402 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
403 … (&(NdefMap->Felica.Rd_BytesToCopyBuff[NdefMap->Felica.IntermediateCpyLen])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
404 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
409 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
410 NdefMap->Felica.Rd_BytesToCopyBuff, in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
411 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
414 NdefMap->ApduBuffIndex += NdefMap->Felica.Rd_NoBytesToCopy; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
423 …if ( ((NdefMap->Felica.LastBlkReachedFlag == 1) && (( NdefMap->ApduBufferSize - NdefMap->ApduBuffI… in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
426 if (( NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) >= DataLen) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
428NdefMap->Felica.CurrBytesRead = (uint16_t)((DataLen) - (NdefMap->Felica.CurrBytesRead + in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
429 NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
431 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
432 (&(NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
433 NdefMap->Felica.CurrBytesRead); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
435 NdefMap->ApduBuffIndex += NdefMap->Felica.CurrBytesRead; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
436 if ( NdefMap->ApduBuffIndex == DataLen) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
444 … if( ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) <= NdefMap->Felica.TrxLen )|| in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
445 ((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) <= DataLen )) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
452 NdefMap->Felica.Rd_NoBytesToCopy = (uint8_t)(16-(( Nbc * 16) - (DataLen))); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
454 … if ( NdefMap->Felica.Rd_NoBytesToCopy > (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
457NdefMap->Felica.Rd_NoBytesToCopy -= (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
467NdefMap->Felica.CurrBytesRead = (uint16_t)((DataLen)- (NdefMap->Felica.CurrBytesRead + in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
468 NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
470 if(NdefMap->Felica.CurrBytesRead < in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
471 (uint16_t)(NdefMap->ApduBufferSize - in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
472 NdefMap->ApduBuffIndex)) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
474 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
475 (&(NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
476 NdefMap->Felica.CurrBytesRead); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
480 (void)memcpy( (&( NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
481 (&( NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
482 … (uint16_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
485 if ( NdefMap->Felica.LastBlkReachedFlag == 1 ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
487 NdefMap->Felica.Rd_NoBytesToCopy = in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
488 (uint8_t)((NdefMap->Felica.CurrBytesRead > in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
489 (uint16_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex))? in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
490 (NdefMap->Felica.CurrBytesRead - in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
491 (uint16_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)): in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
494 ResetFlag = ((NdefMap->Felica.Rd_NoBytesToCopy == 0)?TRUE:FALSE); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
499NdefMap->Felica.Rd_NoBytesToCopy = (uint8_t)( NdefMap->Felica.TrxLen - (NdefMap->ApduBufferSize - in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
503 (void)memcpy( NdefMap->Felica.Rd_BytesToCopyBuff, in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
504 …(&(NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_RESP_HEADER_LEN+(NdefMap->ApduBufferSize - NdefMap-… in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
505 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
509 NdefMap->Felica.IntermediateCpyFlag = TRUE; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
511 NdefMap->ApduBuffIndex += ((NdefMap->Felica.CurrBytesRead < in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
512 (uint16_t)(NdefMap->ApduBufferSize - in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
513 NdefMap->ApduBuffIndex))? in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
514 NdefMap->Felica.CurrBytesRead: in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
515 (uint16_t)(NdefMap->ApduBufferSize - in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
516 NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
521 (void)memcpy( (&( NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
522 (&( NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
523 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
525 NdefMap->ApduBuffIndex += NdefMap->Felica.Rd_NoBytesToCopy; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
534 if ((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) < NdefMap->Felica.TrxLen ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
537 if ( NdefMap->Felica.LastBlkReachedFlag == 1) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
539 NdefMap->Felica.Rd_NoBytesToCopy = (uint8_t)(16-(( Nbc * 16) - DataLen)); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
541 … if ( NdefMap->Felica.Rd_NoBytesToCopy > (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
544NdefMap->Felica.Rd_NoBytesToCopy -= (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
550NdefMap->Felica.Rd_NoBytesToCopy = (uint8_t)(NdefMap->Felica.TrxLen - (NdefMap->ApduBufferSize - N… in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
556 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
557 (&(NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
558 NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
561 (void)memcpy( NdefMap->Felica.Rd_BytesToCopyBuff, in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
562 … (&(NdefMap->SendRecvBuf[13+(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
563 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
565 NdefMap->Felica.IntermediateCpyFlag = TRUE; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
566NdefMap->ApduBuffIndex += (uint16_t)NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
571 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
572 (&(NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
573 NdefMap->Felica.Rd_NoBytesToCopy); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
575 NdefMap->ApduBuffIndex += NdefMap->Felica.Rd_NoBytesToCopy; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
579 if ( DataLen <= (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
581 NdefMap->Felica.EofCardReachedFlag =FELICA_RD_WR_EOF_CARD_REACHED; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
588 else if ((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) == NdefMap->Felica.TrxLen ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
592 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
593 (&(NdefMap->SendRecvBuf[13])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
594 (NdefMap->Felica.TrxLen )); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
596 NdefMap->ApduBuffIndex += NdefMap->Felica.TrxLen; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
600 if ((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) > NdefMap->Felica.TrxLen ) in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
603 (void)memcpy( (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
604 … (&(NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_RESP_HEADER_LEN])), in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
605 NdefMap->Felica.TrxLen); in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
607 NdefMap->ApduBuffIndex += (uint16_t)NdefMap->Felica.TrxLen; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
615 NdefMap->Felica.Rd_NoBytesToCopy =0; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
616 NdefMap->Felica.IntermediateCpyLen =0; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
617 NdefMap->Felica.IntermediateCpyFlag =FALSE; in phFriNfc_Felica_HAfterRead_CopyDataToBuff()
629 static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HChkApduBuff_Size() argument
636 Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); in phFriNfc_Felica_HChkApduBuff_Size()
639 if ( (( NdefMap->ApduBufferSize-NdefMap->ApduBuffIndex )== 0) && in phFriNfc_Felica_HChkApduBuff_Size()
640 (NdefMap->Felica.CurBlockNo < Nbc )) in phFriNfc_Felica_HChkApduBuff_Size()
645 *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; in phFriNfc_Felica_HChkApduBuff_Size()
646 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_HChkApduBuff_Size()
651 if (( ( NdefMap->ApduBufferSize-NdefMap->ApduBuffIndex )== 0) && in phFriNfc_Felica_HChkApduBuff_Size()
652 (NdefMap->Felica.CurBlockNo == Nbc )) in phFriNfc_Felica_HChkApduBuff_Size()
657 ResetFlag = ((NdefMap->Felica.Rd_NoBytesToCopy > 0 )? in phFriNfc_Felica_HChkApduBuff_Size()
662 *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; in phFriNfc_Felica_HChkApduBuff_Size()
664 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_HChkApduBuff_Size()
670 if ( NdefMap->ApduBuffIndex == (Nbc*16)) in phFriNfc_Felica_HChkApduBuff_Size()
678 if ((NdefMap->ApduBufferSize-NdefMap->ApduBuffIndex )> 0 ) in phFriNfc_Felica_HChkApduBuff_Size()
680 if ( NdefMap->Felica.CurBlockNo == Nbc ) in phFriNfc_Felica_HChkApduBuff_Size()
683 if ( NdefMap->Felica.Rd_NoBytesToCopy > 0) in phFriNfc_Felica_HChkApduBuff_Size()
685 if ( NdefMap->Felica.EofCardReachedFlag == TRUE ) in phFriNfc_Felica_HChkApduBuff_Size()
689 *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; in phFriNfc_Felica_HChkApduBuff_Size()
690 NdefMap->ApduBuffIndex=0; in phFriNfc_Felica_HChkApduBuff_Size()
694 phFriNfc_Felica_HAfterRead_CopyDataToBuff(NdefMap); in phFriNfc_Felica_HChkApduBuff_Size()
695 if( NdefMap->Felica.Rd_NoBytesToCopy > 0 ) in phFriNfc_Felica_HChkApduBuff_Size()
699 *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; in phFriNfc_Felica_HChkApduBuff_Size()
700 NdefMap->ApduBuffIndex=0; in phFriNfc_Felica_HChkApduBuff_Size()
725 NdefMap->Felica.IntermediateRdFlag = TRUE; in phFriNfc_Felica_HChkApduBuff_Size()
737 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_HChkApduBuff_Size()
738 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_HChkApduBuff_Size()
739 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_HChkApduBuff_Size()
741 if (NdefMap->ApduBuffIndex > DataLen) in phFriNfc_Felica_HChkApduBuff_Size()
743 *NdefMap->NumOfBytesRead = DataLen; in phFriNfc_Felica_HChkApduBuff_Size()
747 *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; in phFriNfc_Felica_HChkApduBuff_Size()
750 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_HChkApduBuff_Size()
751 NdefMap->Felica.Rd_NoBytesToCopy=0; in phFriNfc_Felica_HChkApduBuff_Size()
752 NdefMap->Felica.EofCardReachedFlag=FELICA_RD_WR_EOF_CARD_REACHED; in phFriNfc_Felica_HChkApduBuff_Size()
763 static NFCSTATUS phFriNfc_Felica_HSetTransceiveForRead(phFriNfc_NdefMap_t *NdefMap,uint16_t TrxLe… in phFriNfc_Felica_HSetTransceiveForRead() argument
770 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HSetTransceiveForRead()
772 NdefMap->Cmd.FelCmd = phHal_eFelicaCmdListFelicaCmd; in phFriNfc_Felica_HSetTransceiveForRead()
776 NdefMap->State = PH_NFCFRI_NDEFMAP_FELI_STATE_RD_BLOCK; in phFriNfc_Felica_HSetTransceiveForRead()
779 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_Felica_Process; in phFriNfc_Felica_HSetTransceiveForRead()
780 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HSetTransceiveForRead()
783 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HSetTransceiveForRead()
784 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HSetTransceiveForRead()
787 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HSetTransceiveForRead()
790 NdefMap->SendRecvBuf[BufIndex] = 0x06; in phFriNfc_Felica_HSetTransceiveForRead()
795 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HSetTransceiveForRead()
796 (void * )(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm)), in phFriNfc_Felica_HSetTransceiveForRead()
799 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HSetTransceiveForRead()
800 … (void * )(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t)), in phFriNfc_Felica_HSetTransceiveForRead()
807 NdefMap->SendRecvBuf[BufIndex] = 0x01; in phFriNfc_Felica_HSetTransceiveForRead()
811 NdefMap->SendRecvBuf[BufIndex] = 0x0B; in phFriNfc_Felica_HSetTransceiveForRead()
814 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HSetTransceiveForRead()
818 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(TrxLen/16); in phFriNfc_Felica_HSetTransceiveForRead()
826 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HSetTransceiveForRead()
830 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(i + 1); in phFriNfc_Felica_HSetTransceiveForRead()
839 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HSetTransceiveForRead()
843 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(NdefMap->Felica.CurBlockNo + i); in phFriNfc_Felica_HSetTransceiveForRead()
849 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = (uint8_t) BufIndex; in phFriNfc_Felica_HSetTransceiveForRead()
852 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HSetTransceiveForRead()
854 *NdefMap->SendRecvLength = NdefMap->TempReceiveLength; in phFriNfc_Felica_HSetTransceiveForRead()
856 TrxStatus = phFriNfc_OvrHal_Transceive(NdefMap->LowerDevice, in phFriNfc_Felica_HSetTransceiveForRead()
857 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HSetTransceiveForRead()
858 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HSetTransceiveForRead()
859 NdefMap->Cmd, in phFriNfc_Felica_HSetTransceiveForRead()
860 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HSetTransceiveForRead()
861 NdefMap->SendRecvBuf, in phFriNfc_Felica_HSetTransceiveForRead()
862 NdefMap->SendLength, in phFriNfc_Felica_HSetTransceiveForRead()
863 NdefMap->SendRecvBuf, in phFriNfc_Felica_HSetTransceiveForRead()
864 NdefMap->SendRecvLength); in phFriNfc_Felica_HSetTransceiveForRead()
877 NFCSTATUS phFriNfc_Felica_WrNdef( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_WrNdef() argument
885 NdefMap->ApduBufferSize = *PacketDataLength; in phFriNfc_Felica_WrNdef()
887 NdefMap->ApduBuffer = PacketData; in phFriNfc_Felica_WrNdef()
890 NdefMap->WrNdefPacketLength = PacketDataLength; in phFriNfc_Felica_WrNdef()
891 *NdefMap->WrNdefPacketLength = 0; in phFriNfc_Felica_WrNdef()
894 NdefMap->PrevOperation = PH_FRINFC_NDEFMAP_WRITE_OPE; in phFriNfc_Felica_WrNdef()
895 NdefMap->Felica.Offset = Offset; in phFriNfc_Felica_WrNdef()
897 NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_WR_ATTR_RD_OP; in phFriNfc_Felica_WrNdef()
898 status = phFriNfc_Felica_HRdAttrInfo(NdefMap); in phFriNfc_Felica_WrNdef()
903 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_CHK_NDEF,status); in phFriNfc_Felica_WrNdef()
917 NFCSTATUS phFriNfc_Felica_EraseNdef( phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_EraseNdef() argument
923 if ( NdefMap->CardState == PH_NDEFMAP_CARD_STATE_INVALID ) in phFriNfc_Felica_EraseNdef()
930 else if ( NdefMap->CardState == PH_NDEFMAP_CARD_STATE_READ_ONLY ) in phFriNfc_Felica_EraseNdef()
936 NdefMap->WrNdefPacketLength = &PktDtLength; in phFriNfc_Felica_EraseNdef()
937 *NdefMap->WrNdefPacketLength = 0; in phFriNfc_Felica_EraseNdef()
943 NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_WR_EMPTY_MSG_OP; in phFriNfc_Felica_EraseNdef()
945 status = phFriNfc_Felica_HRdAttrInfo(NdefMap); in phFriNfc_Felica_EraseNdef()
959 static NFCSTATUS phFriNfc_Felica_HUpdateAttrBlkForWrOp(phFriNfc_NdefMap_t *NdefMap,uint8_t isStart… in phFriNfc_Felica_HUpdateAttrBlkForWrOp() argument
969 NdefMap->State = in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
974 if( ( NdefMap->State == PH_NFCFRI_NDEFMAP_FELI_STATE_ATTR_BLK_WR_BEGIN)|| in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
975 ( NdefMap->State == PH_NFCFRI_NDEFMAP_FELI_STATE_ATTR_BLK_WR_END) ) in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
980 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
982 NdefMap->Cmd.FelCmd = phHal_eFelicaCmdListFelicaCmd; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
986 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
990 NdefMap->SendRecvBuf[BufIndex] = 0x08; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
995 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
996 (void*)(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm)), in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
999 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1000 … (void*)(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t)), in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1006 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Services (n=1 ==> 0x80)*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1009 NdefMap->SendRecvBuf[BufIndex] = 0x09; /* Service Code List*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1012 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* Service Code List*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1015 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Blocks to Write*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1018 NdefMap->SendRecvBuf[BufIndex] = 0x80; /* 1st Block Element : byte 1*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1021 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* 1st Block Element : byte 2, block 1*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1025 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Version; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1028 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Nbr; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1031 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1034 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)((NdefMap->FelicaAttrInfo.Nmaxb) >> 8); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1037 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)((NdefMap->FelicaAttrInfo.Nmaxb) & (0x00ff)); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1040 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1043 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1046 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1049 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1054 NdefMap->SendRecvBuf[BufIndex] = 0x0F; /* Write Flag Made On*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1057 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.RdWrFlag; /* Read write flag*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1061 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.LenBytes[0]; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1064 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.LenBytes[1]; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1067 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.LenBytes[2]; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1076 if ( (NdefMap->Felica.Wr_BytesRemained > 0) && (NdefMap->Felica.CurBlockNo == 0)) in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1085 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* Write Flag Made Off*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1088NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.RdWrFlag; /* Read write flag*/ in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1091 if ( NdefMap->Felica.Wr_BytesRemained > 0 ) in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1093 …TotNoWrittenBytes = ( (NdefMap->Felica.CurBlockNo *16)- (16 - (NdefMap->Felica.Wr_BytesRemained))); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1097 TotNoWrittenBytes = ( NdefMap->Felica.CurBlockNo *16); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1102NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(( TotNoWrittenBytes & 0x00ff0000) >> 16); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1105 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)((TotNoWrittenBytes & 0x0000ff00) >> 8); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1108 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(TotNoWrittenBytes & 0x000000ff); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1118 ChkSum += NdefMap->SendRecvBuf[index]; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1122 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(ChkSum >> 8); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1125 NdefMap->SendRecvBuf[BufIndex] = (uint8_t )(ChkSum & 0x00ff); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1129 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1131 *NdefMap->SendRecvLength = NdefMap->TempReceiveLength; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1134 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1137 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_NdefMap_Process; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1138 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1141 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1142 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1145 status = phFriNfc_OvrHal_Transceive( NdefMap->LowerDevice, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1146 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1147 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1148 NdefMap->Cmd, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1149 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1150 NdefMap->SendRecvBuf, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1151 NdefMap->SendLength, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1152 NdefMap->SendRecvBuf, in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1153 NdefMap->SendRecvLength); in phFriNfc_Felica_HUpdateAttrBlkForWrOp()
1165 static NFCSTATUS phFriNfc_Felica_HWrEmptyMsg(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HWrEmptyMsg() argument
1174 NdefMap->State = PH_NFCFRI_NDEFMAP_FELI_STATE_WR_EMPTY_MSG; in phFriNfc_Felica_HWrEmptyMsg()
1178 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HWrEmptyMsg()
1180 NdefMap->Cmd.FelCmd = phHal_eFelicaCmdListFelicaCmd; in phFriNfc_Felica_HWrEmptyMsg()
1184 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HWrEmptyMsg()
1188 NdefMap->SendRecvBuf[BufIndex] = 0x08; in phFriNfc_Felica_HWrEmptyMsg()
1193 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HWrEmptyMsg()
1194 (void*)(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm)), in phFriNfc_Felica_HWrEmptyMsg()
1197 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HWrEmptyMsg()
1198 … (void*)(&(NdefMap->psRemoteDevInfo->RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t)), in phFriNfc_Felica_HWrEmptyMsg()
1205 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Services (n=1 ==> 0x80)*/ in phFriNfc_Felica_HWrEmptyMsg()
1208 NdefMap->SendRecvBuf[BufIndex] = 0x09; /* Service Code List*/ in phFriNfc_Felica_HWrEmptyMsg()
1211 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* Service Code List*/ in phFriNfc_Felica_HWrEmptyMsg()
1214 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Blocks to Write*/ in phFriNfc_Felica_HWrEmptyMsg()
1217 NdefMap->SendRecvBuf[BufIndex] = 0x80; /* 1st Block Element : byte 1*/ in phFriNfc_Felica_HWrEmptyMsg()
1220 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* 1st Block Element : byte 2, block 1*/ in phFriNfc_Felica_HWrEmptyMsg()
1224 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Version; in phFriNfc_Felica_HWrEmptyMsg()
1227 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Nbr; in phFriNfc_Felica_HWrEmptyMsg()
1230 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HWrEmptyMsg()
1233 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)((NdefMap->FelicaAttrInfo.Nmaxb) >> 8); in phFriNfc_Felica_HWrEmptyMsg()
1236 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)((NdefMap->FelicaAttrInfo.Nmaxb) & (0x00ff)); in phFriNfc_Felica_HWrEmptyMsg()
1239 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HWrEmptyMsg()
1242 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HWrEmptyMsg()
1245 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HWrEmptyMsg()
1248 NdefMap->SendRecvBuf[BufIndex] = 0x00; /*RFU*/ in phFriNfc_Felica_HWrEmptyMsg()
1251 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.WriteFlag; in phFriNfc_Felica_HWrEmptyMsg()
1254 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.RdWrFlag; /* Read write flag*/ in phFriNfc_Felica_HWrEmptyMsg()
1258 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HWrEmptyMsg()
1261 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HWrEmptyMsg()
1264 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HWrEmptyMsg()
1270 ChkSum += NdefMap->SendRecvBuf[index]; in phFriNfc_Felica_HWrEmptyMsg()
1274 NdefMap->SendRecvBuf[BufIndex] = (uint8_t)(ChkSum >> 8); in phFriNfc_Felica_HWrEmptyMsg()
1277 NdefMap->SendRecvBuf[BufIndex] = (uint8_t )(ChkSum & 0x00ff); in phFriNfc_Felica_HWrEmptyMsg()
1281 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HWrEmptyMsg()
1283 *NdefMap->SendRecvLength = NdefMap->TempReceiveLength; in phFriNfc_Felica_HWrEmptyMsg()
1286 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HWrEmptyMsg()
1289 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_NdefMap_Process; in phFriNfc_Felica_HWrEmptyMsg()
1290 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HWrEmptyMsg()
1293 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HWrEmptyMsg()
1294 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HWrEmptyMsg()
1297 status = phFriNfc_OvrHal_Transceive( NdefMap->LowerDevice, in phFriNfc_Felica_HWrEmptyMsg()
1298 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HWrEmptyMsg()
1299 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HWrEmptyMsg()
1300 NdefMap->Cmd, in phFriNfc_Felica_HWrEmptyMsg()
1301 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HWrEmptyMsg()
1302 NdefMap->SendRecvBuf, in phFriNfc_Felica_HWrEmptyMsg()
1303 NdefMap->SendLength, in phFriNfc_Felica_HWrEmptyMsg()
1304 NdefMap->SendRecvBuf, in phFriNfc_Felica_HWrEmptyMsg()
1305 NdefMap->SendRecvLength); in phFriNfc_Felica_HWrEmptyMsg()
1323 static NFCSTATUS phFriNfc_Felica_HChkAttrBlkForWrOp(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HChkAttrBlkForWrOp() argument
1330 if ( NdefMap->FelicaAttrInfo.RdWrFlag == 0x00) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1338 if ( ( NdefMap->Felica.Offset == PH_FRINFC_NDEFMAP_SEEK_BEGIN) || in phFriNfc_Felica_HChkAttrBlkForWrOp()
1339 ( ( NdefMap->PrevOperation == PH_FRINFC_NDEFMAP_READ_OPE) && in phFriNfc_Felica_HChkAttrBlkForWrOp()
1340 (NdefMap->Felica.Offset != PH_FRINFC_NDEFMAP_SEEK_BEGIN ) )) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1343 if (NdefMap->ApduBufferSize > (uint32_t)(NdefMap->FelicaAttrInfo.Nmaxb *16)) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1345 NdefMap->Felica.EofCardReachedFlag = FELICA_EOF_REACHED_WR_WITH_BEGIN_OFFSET; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1349 NdefMap->Felica.EofCardReachedFlag = FALSE; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1354 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1355 NdefMap->Felica.CurBlockNo = 0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1356 NdefMap->Felica.NoBlocksWritten = 0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1357 phFriNfc_Felica_HInitInternalBuf(NdefMap->Felica.Wr_RemainedBytesBuff); in phFriNfc_Felica_HChkAttrBlkForWrOp()
1358 status= phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_STARTED); in phFriNfc_Felica_HChkAttrBlkForWrOp()
1363 if (NdefMap->Felica.Offset == PH_FRINFC_NDEFMAP_SEEK_CUR ) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1366 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_HChkAttrBlkForWrOp()
1367 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_HChkAttrBlkForWrOp()
1368 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_HChkAttrBlkForWrOp()
1371 if (( NdefMap->ApduBufferSize + (DataLen )) > in phFriNfc_Felica_HChkAttrBlkForWrOp()
1372 (uint32_t)( NdefMap->FelicaAttrInfo.Nmaxb *16)) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1374 if(( DataLen ) == (uint32_t)(NdefMap->FelicaAttrInfo.Nmaxb *16) ) in phFriNfc_Felica_HChkAttrBlkForWrOp()
1382 NdefMap->Felica.EofCardReachedFlag =FELICA_EOF_REACHED_WR_WITH_CURR_OFFSET; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1383 NdefMap->ApduBuffIndex =0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1384 NdefMap->Felica.NoBlocksWritten = 0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1385 status= phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_STARTED); in phFriNfc_Felica_HChkAttrBlkForWrOp()
1390 NdefMap->ApduBuffIndex =0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1391 NdefMap->Felica.NoBlocksWritten = 0; in phFriNfc_Felica_HChkAttrBlkForWrOp()
1392 status= phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_STARTED); in phFriNfc_Felica_HChkAttrBlkForWrOp()
1408 static NFCSTATUS phFriNfc_Felica_HChkAttrBlkForRdOp(phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_HChkAttrBlkForRdOp() argument
1415 if ( NdefMap->FelicaAttrInfo.WriteFlag == 0x0F ) in phFriNfc_Felica_HChkAttrBlkForRdOp()
1420 *NdefMap->NumOfBytesRead = 0; in phFriNfc_Felica_HChkAttrBlkForRdOp()
1424 status = phFriNfc_MapTool_SetCardState( NdefMap,NdefLen); in phFriNfc_Felica_HChkAttrBlkForRdOp()
1428 status = phFriNfc_Felica_HReadData(NdefMap,NdefMap->Felica.Offset); in phFriNfc_Felica_HChkAttrBlkForRdOp()
1441 static NFCSTATUS phFriNfc_Felica_HUpdateData(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HUpdateData() argument
1458 if( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) > 0 ) in phFriNfc_Felica_HUpdateData()
1462 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HUpdateData()
1466 NdefMap->SendRecvBuf[BufIndex] = 0x08; in phFriNfc_Felica_HUpdateData()
1471 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1472 (&(NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm)), in phFriNfc_Felica_HUpdateData()
1475 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1476 … (&(NdefMap->psRemoteDevInfo->RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t)), in phFriNfc_Felica_HUpdateData()
1482 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Services (n=1 ==> 0x80)*/ in phFriNfc_Felica_HUpdateData()
1485 NdefMap->SendRecvBuf[BufIndex] = 0x09; /* Service Code List*/ in phFriNfc_Felica_HUpdateData()
1488 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* Service Code List*/ in phFriNfc_Felica_HUpdateData()
1491 if ( NdefMap->Felica.EofCardReachedFlag == FELICA_EOF_REACHED_WR_WITH_BEGIN_OFFSET) in phFriNfc_Felica_HUpdateData()
1495 … BytesRemainedInCard= ( (NdefMap->FelicaAttrInfo.Nmaxb*16) - (NdefMap->Felica.CurBlockNo * 16)); in phFriNfc_Felica_HUpdateData()
1500 if ( NdefMap->Felica.EofCardReachedFlag == FELICA_EOF_REACHED_WR_WITH_CURR_OFFSET ) in phFriNfc_Felica_HUpdateData()
1503 (void)phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); in phFriNfc_Felica_HUpdateData()
1505 if ( NdefMap->Felica.Wr_BytesRemained ) in phFriNfc_Felica_HUpdateData()
1507 …TotNoWrittenBytes = ( (NdefMap->Felica.CurBlockNo *16)- (16 - (NdefMap->Felica.Wr_BytesRemained))); in phFriNfc_Felica_HUpdateData()
1511 TotNoWrittenBytes = ( NdefMap->Felica.CurBlockNo *16); in phFriNfc_Felica_HUpdateData()
1514 BytesRemainedInCard = (NdefMap->FelicaAttrInfo.Nmaxb*16 - (TotNoWrittenBytes)); in phFriNfc_Felica_HUpdateData()
1519 if(NdefMap->Felica.Wr_BytesRemained > 0) in phFriNfc_Felica_HUpdateData()
1523 NdefMap->SendRecvBuf[BufIndex] = 0; in phFriNfc_Felica_HUpdateData()
1533 if ( NdefMap->ApduBufferSize >(uint32_t) (16 - NdefMap->Felica.Wr_BytesRemained)) in phFriNfc_Felica_HUpdateData()
1536 if ( NdefMap->Felica.EofCardReachedFlag ) in phFriNfc_Felica_HUpdateData()
1543 … BytesRemained = (uint8_t)NdefMap->ApduBufferSize - (16 - NdefMap->Felica.Wr_BytesRemained); in phFriNfc_Felica_HUpdateData()
1549 if (!NdefMap->Felica.EofCardReachedFlag) in phFriNfc_Felica_HUpdateData()
1555 if ( BlkNo >= NdefMap->FelicaAttrInfo.Nbw ) in phFriNfc_Felica_HUpdateData()
1557 BlkNo = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HUpdateData()
1573 NdefMap->Felica.PadByteFlag = TRUE; in phFriNfc_Felica_HUpdateData()
1574 NdefMap->Felica.NoBlocksWritten = BlkNo; in phFriNfc_Felica_HUpdateData()
1585 NdefMap->Felica.NoBlocksWritten = TotNoBlks-1; in phFriNfc_Felica_HUpdateData()
1589 if ( !(BytesRemained - (16 -NdefMap->Felica.Wr_BytesRemained)== 0 )) in phFriNfc_Felica_HUpdateData()
1597 if ( NdefMap->Felica.PadByteFlag ) in phFriNfc_Felica_HUpdateData()
1599 NdefMap->Felica.NoBlocksWritten = TotNoBlks-1; in phFriNfc_Felica_HUpdateData()
1608 … BlkNo =(uint8_t)(( BytesRemained - ((16 -NdefMap->Felica.Wr_BytesRemained)) )/16); in phFriNfc_Felica_HUpdateData()
1611 if ( BlkNo >= NdefMap->FelicaAttrInfo.Nbw ) in phFriNfc_Felica_HUpdateData()
1613 BlkNo = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HUpdateData()
1628 … if(((!NbwCheck) &&( BytesRemained- (16 - NdefMap->Felica.Wr_BytesRemained))%16) != 0) in phFriNfc_Felica_HUpdateData()
1632 NdefMap->Felica.PadByteFlag = TRUE; in phFriNfc_Felica_HUpdateData()
1633 NdefMap->Felica.NoBlocksWritten = BlkNo; in phFriNfc_Felica_HUpdateData()
1644 NdefMap->Felica.NoBlocksWritten = TotNoBlks-1; in phFriNfc_Felica_HUpdateData()
1649 if ( !(BytesRemained - (16 -NdefMap->Felica.Wr_BytesRemained)== 0 )) in phFriNfc_Felica_HUpdateData()
1658 if ( NdefMap->Felica.PadByteFlag ) in phFriNfc_Felica_HUpdateData()
1660 NdefMap->Felica.NoBlocksWritten = TotNoBlks -1; in phFriNfc_Felica_HUpdateData()
1675 NdefMap->Felica.NoBlocksWritten = 0; in phFriNfc_Felica_HUpdateData()
1681 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HUpdateData()
1684 if ( NdefMap->Felica.PadByteFlag == TRUE ) in phFriNfc_Felica_HUpdateData()
1686 NdefMap->SendRecvBuf[BufIndex] = NdefMap->Felica.CurBlockNo + i; in phFriNfc_Felica_HUpdateData()
1691 CurBlk = NdefMap->Felica.CurBlockNo +1; in phFriNfc_Felica_HUpdateData()
1692 NdefMap->SendRecvBuf[BufIndex] = CurBlk + i; in phFriNfc_Felica_HUpdateData()
1697 …if((NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) >= (uint32_t)(16 - NdefMap->Felica.Wr_BytesR… in phFriNfc_Felica_HUpdateData()
1701 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1702 NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
1703 NdefMap->Felica.Wr_BytesRemained); in phFriNfc_Felica_HUpdateData()
1706 BufIndex += NdefMap->Felica.Wr_BytesRemained; in phFriNfc_Felica_HUpdateData()
1710 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1711 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
1712 (16 - NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1715 NdefMap->NumOfBytesWritten = 16 - NdefMap->Felica.Wr_BytesRemained; in phFriNfc_Felica_HUpdateData()
1718 BufIndex += 16 - NdefMap->Felica.Wr_BytesRemained; in phFriNfc_Felica_HUpdateData()
1722 if (!NdefMap->Felica.EofCardReachedFlag) in phFriNfc_Felica_HUpdateData()
1728 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1729 … (&(NdefMap->ApduBuffer[(16 - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1730 … (NdefMap->ApduBufferSize - (16 - NdefMap->Felica.Wr_BytesRemained))); in phFriNfc_Felica_HUpdateData()
1734NdefMap->NumOfBytesWritten += (uint16_t)(NdefMap->ApduBufferSize - (16 - NdefMap->Felica.Wr_BytesR… in phFriNfc_Felica_HUpdateData()
1736 … BufIndex += (uint8_t)(NdefMap->ApduBufferSize - (16 - NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1742 NdefMap->SendRecvBuf[BufIndex] =0x00; in phFriNfc_Felica_HUpdateData()
1746 NdefMap->Felica.Wr_BytesRemained = (uint8_t)(16 - PadBytes); in phFriNfc_Felica_HUpdateData()
1749 (void)memcpy( NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
1750 … (&( NdefMap->ApduBuffer[(NdefMap->ApduBufferSize - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1751 ( NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1756 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1764 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1765 … (&(NdefMap->ApduBuffer[(16 - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1766 (NdefMap->FelicaAttrInfo.Nbw - 1) * 16); in phFriNfc_Felica_HUpdateData()
1769 BufIndex += ((NdefMap->FelicaAttrInfo.Nbw - 1 )*16); in phFriNfc_Felica_HUpdateData()
1771 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1772 NdefMap->NumOfBytesWritten+= ((NdefMap->FelicaAttrInfo.Nbw -1)*16); in phFriNfc_Felica_HUpdateData()
1773 NdefMap->Felica.PadByteFlag =FALSE; in phFriNfc_Felica_HUpdateData()
1782 (void)memcpy( (&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1783 … (&(NdefMap->ApduBuffer[(16 - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1784 … ( BytesRemained - ((16 -NdefMap->Felica.Wr_BytesRemained) ))); in phFriNfc_Felica_HUpdateData()
1787NdefMap->NumOfBytesWritten += (uint16_t)( BytesRemained - (16 -NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1789 … BufIndex += (uint8_t)( BytesRemained - (16 -NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1795 NdefMap->SendRecvBuf[BufIndex] =0x00; in phFriNfc_Felica_HUpdateData()
1800 NdefMap->Felica.Wr_BytesRemained = (uint8_t)(16 - PadBytes); in phFriNfc_Felica_HUpdateData()
1803 (void)memcpy(NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
1804 … (&(NdefMap->ApduBuffer[(NdefMap->ApduBufferSize - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1805 (NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1810 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1817 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1818 … (&(NdefMap->ApduBuffer[(16 - NdefMap->Felica.Wr_BytesRemained)])), in phFriNfc_Felica_HUpdateData()
1819 (NdefMap->FelicaAttrInfo.Nbw - 1) * 16); in phFriNfc_Felica_HUpdateData()
1822 BufIndex += ((NdefMap->FelicaAttrInfo.Nbw - 1 )*16); in phFriNfc_Felica_HUpdateData()
1824 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1825 NdefMap->NumOfBytesWritten+= ((NdefMap->FelicaAttrInfo.Nbw -1)*16); in phFriNfc_Felica_HUpdateData()
1827 NdefMap->Felica.PadByteFlag =FALSE; in phFriNfc_Felica_HUpdateData()
1833 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1836 NdefMap->SendRecvBuf[NoOfBlks -1 ]=TotNoBlks; in phFriNfc_Felica_HUpdateData()
1841 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1842 NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
1843 (NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
1846 BufIndex+=NdefMap->Felica.Wr_BytesRemained; in phFriNfc_Felica_HUpdateData()
1849 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1850 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
1851 NdefMap->ApduBufferSize); in phFriNfc_Felica_HUpdateData()
1854 BufIndex+= (uint8_t)NdefMap->ApduBufferSize; in phFriNfc_Felica_HUpdateData()
1857 BytesRemained = NdefMap->Felica.Wr_BytesRemained + NdefMap->ApduBufferSize; in phFriNfc_Felica_HUpdateData()
1864 NdefMap->SendRecvBuf[BufIndex] =0x00; in phFriNfc_Felica_HUpdateData()
1869 NdefMap->NumOfBytesWritten = (uint16_t)NdefMap->ApduBufferSize; in phFriNfc_Felica_HUpdateData()
1873 NdefMap->Felica.IntermediateWrFlag = TRUE; in phFriNfc_Felica_HUpdateData()
1875 if ( NdefMap->Felica.PadByteFlag ) in phFriNfc_Felica_HUpdateData()
1877 NdefMap->Felica.NoBlocksWritten = 0; in phFriNfc_Felica_HUpdateData()
1881 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HUpdateData()
1882 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HUpdateData()
1884 NdefMap->SendRecvBuf[NoOfBlks -1 ]=TotNoBlks; in phFriNfc_Felica_HUpdateData()
1889 …if ( (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex) >= (uint32_t)(16* NdefMap->FelicaAttrInfo.… in phFriNfc_Felica_HUpdateData()
1892 … if ( NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlockNo >= NdefMap->FelicaAttrInfo.Nbw) in phFriNfc_Felica_HUpdateData()
1896 NdefMap->SendRecvBuf[BufIndex] = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HUpdateData()
1900 for ( i=1; i<= NdefMap->FelicaAttrInfo.Nbw; i++) in phFriNfc_Felica_HUpdateData()
1902 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HUpdateData()
1905 NdefMap->SendRecvBuf[BufIndex] = NdefMap->Felica.CurBlockNo + i; in phFriNfc_Felica_HUpdateData()
1910 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1911 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
1912 NdefMap->FelicaAttrInfo.Nbw * 16); in phFriNfc_Felica_HUpdateData()
1915 BufIndex += (NdefMap->FelicaAttrInfo.Nbw*16); in phFriNfc_Felica_HUpdateData()
1918 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HUpdateData()
1920 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1921 NdefMap->NumOfBytesWritten = (NdefMap->FelicaAttrInfo.Nbw*16); in phFriNfc_Felica_HUpdateData()
1922 NdefMap->Felica.NoBlocksWritten = NdefMap->FelicaAttrInfo.Nbw; in phFriNfc_Felica_HUpdateData()
1925 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HUpdateData()
1927 NdefMap->Felica.PadByteFlag = FALSE; in phFriNfc_Felica_HUpdateData()
1934NdefMap->SendRecvBuf[BufIndex] = (uint8_t)( NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlo… in phFriNfc_Felica_HUpdateData()
1938 … for ( i=1; i<= (NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlockNo); i++) in phFriNfc_Felica_HUpdateData()
1940 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HUpdateData()
1942 NdefMap->SendRecvBuf[BufIndex] = NdefMap->Felica.CurBlockNo + i; in phFriNfc_Felica_HUpdateData()
1947 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
1948 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
1949 (NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlockNo)*16); in phFriNfc_Felica_HUpdateData()
1952 … BufIndex += (uint8_t)((NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlockNo )*16); in phFriNfc_Felica_HUpdateData()
1955 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HUpdateData()
1957NdefMap->NumOfBytesWritten = ((NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlockNo)*16); in phFriNfc_Felica_HUpdateData()
1958NdefMap->Felica.NoBlocksWritten = (uint8_t)(NdefMap->FelicaAttrInfo.Nmaxb - NdefMap->Felica.CurBlo… in phFriNfc_Felica_HUpdateData()
1961 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HUpdateData()
1963 NdefMap->Felica.PadByteFlag =FALSE; in phFriNfc_Felica_HUpdateData()
1964 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
1970 if ( NdefMap->Felica.EofCardReachedFlag) in phFriNfc_Felica_HUpdateData()
1977 NdefMap->Felica.PadByteFlag = TRUE; in phFriNfc_Felica_HUpdateData()
1983 BlkNo =((uint8_t)( NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)/16); in phFriNfc_Felica_HUpdateData()
1984 if(((uint8_t)( NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)%16) != 0) in phFriNfc_Felica_HUpdateData()
1987 … PadBytes = (BlkNo * 16) - (uint8_t)( NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HUpdateData()
1988 NdefMap->Felica.PadByteFlag = TRUE; in phFriNfc_Felica_HUpdateData()
1997 NdefMap->SendRecvBuf[BufIndex] = BlkNo; in phFriNfc_Felica_HUpdateData()
2000 NdefMap->Felica.NoBlocksWritten = BlkNo; in phFriNfc_Felica_HUpdateData()
2005 NdefMap->SendRecvBuf[BufIndex] = 0x80; in phFriNfc_Felica_HUpdateData()
2008 CurBlk = NdefMap->Felica.CurBlockNo +1; in phFriNfc_Felica_HUpdateData()
2009 NdefMap->SendRecvBuf[BufIndex] = CurBlk + i; in phFriNfc_Felica_HUpdateData()
2013 if ( NdefMap->Felica.EofCardReachedFlag ) in phFriNfc_Felica_HUpdateData()
2016 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
2017 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
2022 NdefMap->NumOfBytesWritten = (uint16_t)BytesRemainedInCard ; in phFriNfc_Felica_HUpdateData()
2027 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HUpdateData()
2028 (&(NdefMap->ApduBuffer[NdefMap->ApduBuffIndex])), in phFriNfc_Felica_HUpdateData()
2029 (NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex)); in phFriNfc_Felica_HUpdateData()
2032 BufIndex += (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HUpdateData()
2033NdefMap->NumOfBytesWritten = (uint8_t)(NdefMap->ApduBufferSize - NdefMap->ApduBuffIndex); in phFriNfc_Felica_HUpdateData()
2039 NdefMap->SendRecvBuf[BufIndex] =0x00; in phFriNfc_Felica_HUpdateData()
2043 NdefMap->Felica.Wr_BytesRemained = (uint8_t)(16 - PadBytes); in phFriNfc_Felica_HUpdateData()
2045 if ( NdefMap->Felica.EofCardReachedFlag ) in phFriNfc_Felica_HUpdateData()
2048 (void)memcpy(NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
2049 … (&(NdefMap->ApduBuffer[((BytesRemainedInCard - (BytesRemainedInCard % 16)))])), in phFriNfc_Felica_HUpdateData()
2050 ( NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
2056 (void)memcpy( NdefMap->Felica.Wr_RemainedBytesBuff, in phFriNfc_Felica_HUpdateData()
2057 … (&(NdefMap->ApduBuffer[((NdefMap->ApduBufferSize - NdefMap->Felica.Wr_BytesRemained))])), in phFriNfc_Felica_HUpdateData()
2058 ( NdefMap->Felica.Wr_BytesRemained)); in phFriNfc_Felica_HUpdateData()
2064 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_HUpdateData()
2065 NdefMap->Felica.PadByteFlag = FALSE; in phFriNfc_Felica_HUpdateData()
2068 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HUpdateData()
2069 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HUpdateData()
2072 status = phFriNfc_Felica_HWriteDataBlk(NdefMap); in phFriNfc_Felica_HUpdateData()
2077 status = phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_ENDED); in phFriNfc_Felica_HUpdateData()
2088 static NFCSTATUS phFriNfc_Felica_HWriteDataBlk(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HWriteDataBlk() argument
2093 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HWriteDataBlk()
2094 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HWriteDataBlk()
2098 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HWriteDataBlk()
2100 NdefMap->Cmd.FelCmd = phHal_eFelicaCmdListFelicaCmd; in phFriNfc_Felica_HWriteDataBlk()
2104 NdefMap->State = PH_NFCFRI_NDEFMAP_FELI_STATE_WR_BLOCK; in phFriNfc_Felica_HWriteDataBlk()
2107 *NdefMap->SendRecvLength = NdefMap->TempReceiveLength; in phFriNfc_Felica_HWriteDataBlk()
2110 status = phFriNfc_OvrHal_Transceive( NdefMap->LowerDevice, in phFriNfc_Felica_HWriteDataBlk()
2111 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HWriteDataBlk()
2112 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HWriteDataBlk()
2113 NdefMap->Cmd, in phFriNfc_Felica_HWriteDataBlk()
2114 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HWriteDataBlk()
2115 NdefMap->SendRecvBuf, in phFriNfc_Felica_HWriteDataBlk()
2116 NdefMap->SendLength, in phFriNfc_Felica_HWriteDataBlk()
2117 NdefMap->SendRecvBuf, in phFriNfc_Felica_HWriteDataBlk()
2118 NdefMap->SendRecvLength); in phFriNfc_Felica_HWriteDataBlk()
2127 NFCSTATUS phFriNfc_Felica_ChkNdef( phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_ChkNdef() argument
2136 … status = phFriNfc_Felica_HPollCard( NdefMap,sysCode,PH_NFCFRI_NDEFMAP_FELI_STATE_SELECT_NDEF_APP); in phFriNfc_Felica_ChkNdef()
2146 static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_HPollCard() argument
2153 NdefMap->SendRecvBuf[0] = 0x06; in phFriNfc_Felica_HPollCard()
2154 NdefMap->SendRecvBuf[1] = 0x00; in phFriNfc_Felica_HPollCard()
2155 NdefMap->SendRecvBuf[2] = sysCode[0]; in phFriNfc_Felica_HPollCard()
2156 NdefMap->SendRecvBuf[3] = sysCode[1]; in phFriNfc_Felica_HPollCard()
2157 NdefMap->SendRecvBuf[4] = 0x01; in phFriNfc_Felica_HPollCard()
2158 NdefMap->SendRecvBuf[5] = 0x03; in phFriNfc_Felica_HPollCard()
2160 NdefMap->SendLength = 6; in phFriNfc_Felica_HPollCard()
2163 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_Felica_Process; in phFriNfc_Felica_HPollCard()
2164 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HPollCard()
2167 NdefMap->State = state; in phFriNfc_Felica_HPollCard()
2170 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HPollCard()
2173 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HPollCard()
2174 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HPollCard()
2176 status = phFriNfc_OvrHal_Transceive(NdefMap->LowerDevice, in phFriNfc_Felica_HPollCard()
2177 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HPollCard()
2178 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HPollCard()
2179 NdefMap->Cmd, in phFriNfc_Felica_HPollCard()
2180 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HPollCard()
2181 NdefMap->SendRecvBuf, in phFriNfc_Felica_HPollCard()
2182 NdefMap->SendLength, in phFriNfc_Felica_HPollCard()
2183 NdefMap->SendRecvBuf, in phFriNfc_Felica_HPollCard()
2184 NdefMap->SendRecvLength); in phFriNfc_Felica_HPollCard()
2191 static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_HPollCard() argument
2198 NdefMap->FelicaPollDetails.DevInputParam->FelicaPollPayload[0] = 0x00; in phFriNfc_Felica_HPollCard()
2199 NdefMap->FelicaPollDetails.DevInputParam->FelicaPollPayload[1] = sysCode[0]; in phFriNfc_Felica_HPollCard()
2200 NdefMap->FelicaPollDetails.DevInputParam->FelicaPollPayload[2] = sysCode[1]; in phFriNfc_Felica_HPollCard()
2201 NdefMap->FelicaPollDetails.DevInputParam->FelicaPollPayload[3] = 0x01; in phFriNfc_Felica_HPollCard()
2202 NdefMap->FelicaPollDetails.DevInputParam->FelicaPollPayload[4] = 0x03; in phFriNfc_Felica_HPollCard()
2205 NdefMap->FelicaPollDetails.DevInputParam->GeneralByteLength =0x00; in phFriNfc_Felica_HPollCard()
2207 NdefMap->NoOfDevices = PH_FRINFC_NDEFMAP_FELI_NUM_DEVICE_TO_DETECT; in phFriNfc_Felica_HPollCard()
2210 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_Felica_Process; in phFriNfc_Felica_HPollCard()
2211 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HPollCard()
2214 NdefMap->State = state; in phFriNfc_Felica_HPollCard()
2222 (void) memcpy( &NdefMap->FelicaPollDetails.psTempRemoteDevInfo, in phFriNfc_Felica_HPollCard()
2223 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HPollCard()
2227 NdefMap->FelicaPollDetails.psTempRemoteDevInfo.SessionOpened = 0x00; in phFriNfc_Felica_HPollCard()
2230 status = phFriNfc_OvrHal_Poll( NdefMap->LowerDevice, in phFriNfc_Felica_HPollCard()
2231 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HPollCard()
2232 NdefMap->OpModeType, in phFriNfc_Felica_HPollCard()
2233 &NdefMap->FelicaPollDetails.psTempRemoteDevInfo, in phFriNfc_Felica_HPollCard()
2234 &NdefMap->NoOfDevices, in phFriNfc_Felica_HPollCard()
2235 NdefMap->FelicaPollDetails.DevInputParam); in phFriNfc_Felica_HPollCard()
2244 static NFCSTATUS phFriNfc_Felica_HUpdateManufIdDetails(const phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HUpdateManufIdDetails() argument
2249 if (NdefMap->SendRecvLength >= 20) in phFriNfc_Felica_HUpdateManufIdDetails()
2251 (void)memcpy( (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm, in phFriNfc_Felica_HUpdateManufIdDetails()
2252 (uint8_t *)&NdefMap->SendRecvBuf[2], 8); in phFriNfc_Felica_HUpdateManufIdDetails()
2253 (void)memcpy( (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.PMm, in phFriNfc_Felica_HUpdateManufIdDetails()
2254 (uint8_t *)&NdefMap->SendRecvBuf[10], 8); in phFriNfc_Felica_HUpdateManufIdDetails()
2255NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[1] = NdefMap->SendRecvBuf[18]; in phFriNfc_Felica_HUpdateManufIdDetails()
2256NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[0] = NdefMap->SendRecvBuf[19]; in phFriNfc_Felica_HUpdateManufIdDetails()
2257 NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDmLength = 8; in phFriNfc_Felica_HUpdateManufIdDetails()
2260 (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufID), in phFriNfc_Felica_HUpdateManufIdDetails()
2261 (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm, in phFriNfc_Felica_HUpdateManufIdDetails()
2263 (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufParameter), in phFriNfc_Felica_HUpdateManufIdDetails()
2264 (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.PMm, in phFriNfc_Felica_HUpdateManufIdDetails()
2266 if((NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[1] == 0x12) in phFriNfc_Felica_HUpdateManufIdDetails()
2267 && (NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[0] == 0xFC)) in phFriNfc_Felica_HUpdateManufIdDetails()
2305 phFriNfc_NdefMap_t *NdefMap = (phFriNfc_NdefMap_t *)Context; in phFriNfc_Felica_Process() local
2309 switch (NdefMap->State) in phFriNfc_Felica_Process()
2314 Status = phFriNfc_Felica_HUpdateManufIdDetails(NdefMap); in phFriNfc_Felica_Process()
2320 NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_CHK_NDEF_OP; in phFriNfc_Felica_Process()
2321 Status = phFriNfc_Felica_HRdAttrInfo(NdefMap); in phFriNfc_Felica_Process()
2335 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_CHK_NDEF,Status); in phFriNfc_Felica_Process()
2342 if ( NdefMap->SendRecvBuf[10] == 0x00) in phFriNfc_Felica_Process()
2345 Status = phFriNfc_Felica_HCheckManufId(NdefMap); in phFriNfc_Felica_Process()
2349 Status = phFriNfc_Felica_HUpdateAttrInfo(NdefMap); in phFriNfc_Felica_Process()
2352 … PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_Process()
2353 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_Process()
2354 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_Process()
2357 if ( NdefMap->Felica.OpFlag == PH_FRINFC_NDEFMAP_FELI_WR_ATTR_RD_OP ) in phFriNfc_Felica_Process()
2360 Status = phFriNfc_Felica_HChkAttrBlkForWrOp(NdefMap); in phFriNfc_Felica_Process()
2365 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2368 … else if( NdefMap->Felica.OpFlag == PH_FRINFC_NDEFMAP_FELI_RD_ATTR_RD_OP ) in phFriNfc_Felica_Process()
2371 Status = phFriNfc_Felica_HChkAttrBlkForRdOp(NdefMap,NDEFLen); in phFriNfc_Felica_Process()
2375 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_RD_NDEF,Status); in phFriNfc_Felica_Process()
2378 else if( NdefMap->Felica.OpFlag == PH_FRINFC_NDEFMAP_FELI_CHK_NDEF_OP ) in phFriNfc_Felica_Process()
2381 Status = phFriNfc_MapTool_SetCardState( NdefMap, in phFriNfc_Felica_Process()
2384 NdefMap->CardType = PH_FRINFC_NDEFMAP_FELICA_SMART_CARD; in phFriNfc_Felica_Process()
2386 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_Process()
2388 NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_OP_NONE; in phFriNfc_Felica_Process()
2390 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_CHK_NDEF,Status); in phFriNfc_Felica_Process()
2392 … else if ( NdefMap->Felica.OpFlag == PH_FRINFC_NDEFMAP_FELI_WR_EMPTY_MSG_OP ) in phFriNfc_Felica_Process()
2395 Status = phFriNfc_Felica_HWrEmptyMsg(NdefMap); in phFriNfc_Felica_Process()
2400 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_ERASE_NDEF,Status); in phFriNfc_Felica_Process()
2432 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_RD_NDEF,Status); in phFriNfc_Felica_Process()
2438 if ( NdefMap->SendRecvBuf[10] == 0x00 ) in phFriNfc_Felica_Process()
2441 Status =phFriNfc_Felica_HUpdateData(NdefMap); in phFriNfc_Felica_Process()
2445 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2453 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2460 if ( NdefMap->SendRecvBuf[10] == 0x00) in phFriNfc_Felica_Process()
2472 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2478 if ( NdefMap->SendRecvBuf[10] == 0x00) in phFriNfc_Felica_Process()
2490 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2494 if(NdefMap->SendRecvBuf[1] == PH_NFCFRI_NDEFMAP_FELI_WR_RESP_BYTE ) in phFriNfc_Felica_Process()
2497 if ( NdefMap->SendRecvBuf[10] == 0x00 ) in phFriNfc_Felica_Process()
2500 if ( NdefMap->Felica.IntermediateWrFlag == TRUE ) in phFriNfc_Felica_Process()
2504 … (void)memcpy( (&(NdefMap->Felica.Wr_RemainedBytesBuff[NdefMap->Felica.Wr_BytesRemained])), in phFriNfc_Felica_Process()
2505 NdefMap->ApduBuffer, in phFriNfc_Felica_Process()
2506 NdefMap->NumOfBytesWritten); in phFriNfc_Felica_Process()
2508 NdefMap->Felica.Wr_BytesRemained += in phFriNfc_Felica_Process()
2509 (uint8_t)( NdefMap->NumOfBytesWritten); in phFriNfc_Felica_Process()
2512 NdefMap->ApduBuffIndex += in phFriNfc_Felica_Process()
2513 NdefMap->NumOfBytesWritten; in phFriNfc_Felica_Process()
2515 *NdefMap->WrNdefPacketLength = NdefMap->ApduBuffIndex; in phFriNfc_Felica_Process()
2516 NdefMap->Felica.IntermediateWrFlag = FALSE; in phFriNfc_Felica_Process()
2518 Status = phFriNfc_Felica_HUpdateData(NdefMap); in phFriNfc_Felica_Process()
2523 NdefMap->ApduBuffIndex += NdefMap->NumOfBytesWritten; in phFriNfc_Felica_Process()
2524 *NdefMap->WrNdefPacketLength = NdefMap->ApduBuffIndex; in phFriNfc_Felica_Process()
2525 if ( NdefMap->Felica.EofCardReachedFlag ) in phFriNfc_Felica_Process()
2527 if ( NdefMap->Felica.CurBlockNo < NdefMap->FelicaAttrInfo.Nmaxb) in phFriNfc_Felica_Process()
2529 NdefMap->Felica.CurBlockNo += NdefMap->Felica.NoBlocksWritten; in phFriNfc_Felica_Process()
2531 … if (( NdefMap->Felica.CurBlockNo == NdefMap->FelicaAttrInfo.Nmaxb) && in phFriNfc_Felica_Process()
2532 ( NdefMap->ApduBuffIndex == (NdefMap->FelicaAttrInfo.Nmaxb*16))) in phFriNfc_Felica_Process()
2534NdefMap->Felica.EofCardReachedFlag = FELICA_RD_WR_EOF_CARD_REACHED ; in phFriNfc_Felica_Process()
2536 … Status = phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_ENDED); in phFriNfc_Felica_Process()
2540 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2545 … PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], in phFriNfc_Felica_Process()
2546 NdefMap->FelicaAttrInfo.LenBytes[1], in phFriNfc_Felica_Process()
2547 NdefMap->FelicaAttrInfo.LenBytes[2], in phFriNfc_Felica_Process()
2549 … if ( ( NdefMap->Felica.CurBlockNo == NdefMap->FelicaAttrInfo.Nmaxb) && in phFriNfc_Felica_Process()
2550 … ((TotNoWrittenBytes + NdefMap->ApduBuffIndex) == (uint32_t)(NdefMap->FelicaAttrInfo.Nmaxb*16))) in phFriNfc_Felica_Process()
2552NdefMap->Felica.EofCardReachedFlag =FELICA_RD_WR_EOF_CARD_REACHED; in phFriNfc_Felica_Process()
2554 … Status = phFriNfc_Felica_HUpdateAttrBlkForWrOp(NdefMap,FELICA_WRITE_ENDED); in phFriNfc_Felica_Process()
2558 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2564 Status = phFriNfc_Felica_HUpdateData(NdefMap); in phFriNfc_Felica_Process()
2568 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2575 NdefMap->Felica.CurBlockNo += NdefMap->Felica.NoBlocksWritten; in phFriNfc_Felica_Process()
2577 Status = phFriNfc_Felica_HUpdateData(NdefMap); in phFriNfc_Felica_Process()
2581 … phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2606 NdefMap->ApduBuffIndex=0; in phFriNfc_Felica_Process()
2607 NdefMap->Felica.Wr_BytesRemained = 0; in phFriNfc_Felica_Process()
2608 NdefMap->ApduBufferSize = 0; in phFriNfc_Felica_Process()
2609 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_WR_NDEF,Status); in phFriNfc_Felica_Process()
2617 Status = phFriNfc_Felica_HCheckManufId(NdefMap); in phFriNfc_Felica_Process()
2620 if(NdefMap->SendRecvBuf[1] == PH_NFCFRI_NDEFMAP_FELI_RD_RESP_BYTE ) in phFriNfc_Felica_Process()
2623 Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); in phFriNfc_Felica_Process()
2625 RecvTxLen= phFriNfc_Felica_HSetTrxLen(NdefMap,Nbc); in phFriNfc_Felica_Process()
2626 BytesToRecv = NdefMap->SendRecvBuf[12]*16; in phFriNfc_Felica_Process()
2629 if ( NdefMap->SendRecvBuf[10] == 0x00) in phFriNfc_Felica_Process()
2633 NdefMap->Felica.CurBlockNo += (uint8_t)(RecvTxLen/16); in phFriNfc_Felica_Process()
2634 phFriNfc_Felica_HAfterRead_CopyDataToBuff(NdefMap); in phFriNfc_Felica_Process()
2635 Status = phFriNfc_Felica_HReadData(NdefMap,PH_FRINFC_NDEFMAP_SEEK_CUR); in phFriNfc_Felica_Process()
2648 NdefMap->ApduBuffIndex = 0; in phFriNfc_Felica_Process()
2649 NdefMap->Felica.Rd_NoBytesToCopy = 0; in phFriNfc_Felica_Process()
2654 NdefMap->ApduBuffIndex=0; in phFriNfc_Felica_Process()
2664 NdefMap->ApduBuffIndex=0; in phFriNfc_Felica_Process()
2677 phFriNfc_Felica_HCrHandler(NdefMap,PH_FRINFC_NDEFMAP_CR_RD_NDEF,Status); in phFriNfc_Felica_Process()
2684 phFriNfc_Felica_HCrHandler(NdefMap, PH_FRINFC_NDEFMAP_CR_INVALID_OPE, Status); in phFriNfc_Felica_Process()
2693 switch ( NdefMap->State) in phFriNfc_Felica_Process()
2699 phFriNfc_Felica_HCrHandler(NdefMap, PH_FRINFC_NDEFMAP_CR_CHK_NDEF, in phFriNfc_Felica_Process()
2705 phFriNfc_Felica_HCrHandler(NdefMap, PH_FRINFC_NDEFMAP_CR_WR_NDEF, in phFriNfc_Felica_Process()
2709 phFriNfc_Felica_HCrHandler(NdefMap, PH_FRINFC_NDEFMAP_CR_RD_NDEF, in phFriNfc_Felica_Process()
2715 phFriNfc_Felica_HCrHandler(NdefMap, PH_FRINFC_NDEFMAP_CR_INVALID_OPE, Status); in phFriNfc_Felica_Process()
2725 static NFCSTATUS phFriNfc_Felica_HRdAttrInfo(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HRdAttrInfo() argument
2733 NdefMap->Cmd.FelCmd = phHal_eFelica_Raw; in phFriNfc_Felica_HRdAttrInfo()
2735 NdefMap->Cmd.FelCmd = phHal_eFelicaCmdListFelicaCmd; in phFriNfc_Felica_HRdAttrInfo()
2739 NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0; in phFriNfc_Felica_HRdAttrInfo()
2740 NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0; in phFriNfc_Felica_HRdAttrInfo()
2743 NdefMap->SendRecvBuf[BufIndex] = 0x00; in phFriNfc_Felica_HRdAttrInfo()
2747 NdefMap->SendRecvBuf[BufIndex] = 0x06; in phFriNfc_Felica_HRdAttrInfo()
2752 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HRdAttrInfo()
2753 (void * )&NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm, in phFriNfc_Felica_HRdAttrInfo()
2756 (void)memcpy((&(NdefMap->SendRecvBuf[BufIndex])), in phFriNfc_Felica_HRdAttrInfo()
2757 … (void * )&NdefMap->psRemoteDevInfo->RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t, in phFriNfc_Felica_HRdAttrInfo()
2764 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Services (n=1 ==> 0x80)*/ in phFriNfc_Felica_HRdAttrInfo()
2767 NdefMap->SendRecvBuf[BufIndex] = 0x0B; /* Service Code List*/ in phFriNfc_Felica_HRdAttrInfo()
2770 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* Service Code List*/ in phFriNfc_Felica_HRdAttrInfo()
2773 NdefMap->SendRecvBuf[BufIndex] = 0x01; /* Number of Blocks to read)*/ in phFriNfc_Felica_HRdAttrInfo()
2776 NdefMap->SendRecvBuf[BufIndex] = 0x80; /* 1st Block Element : byte 1*/ in phFriNfc_Felica_HRdAttrInfo()
2779 NdefMap->SendRecvBuf[BufIndex] = 0x00; /* 1st Block Element : byte 2, block 1*/ in phFriNfc_Felica_HRdAttrInfo()
2782 NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_PKT_LEN_INDEX] = BufIndex; in phFriNfc_Felica_HRdAttrInfo()
2784 *NdefMap->SendRecvLength = NdefMap->TempReceiveLength; in phFriNfc_Felica_HRdAttrInfo()
2787 NdefMap->SendLength = BufIndex; in phFriNfc_Felica_HRdAttrInfo()
2790 NdefMap->State = PH_NFCFRI_NDEFMAP_FELI_STATE_RD_ATTR; in phFriNfc_Felica_HRdAttrInfo()
2793 NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_NdefMap_Process; in phFriNfc_Felica_HRdAttrInfo()
2794 NdefMap->MapCompletionInfo.Context = NdefMap; in phFriNfc_Felica_HRdAttrInfo()
2797 status = phFriNfc_OvrHal_Transceive( NdefMap->LowerDevice, in phFriNfc_Felica_HRdAttrInfo()
2798 &NdefMap->MapCompletionInfo, in phFriNfc_Felica_HRdAttrInfo()
2799 NdefMap->psRemoteDevInfo, in phFriNfc_Felica_HRdAttrInfo()
2800 NdefMap->Cmd, in phFriNfc_Felica_HRdAttrInfo()
2801 &NdefMap->psDepAdditionalInfo, in phFriNfc_Felica_HRdAttrInfo()
2802 NdefMap->SendRecvBuf, in phFriNfc_Felica_HRdAttrInfo()
2803 NdefMap->SendLength, in phFriNfc_Felica_HRdAttrInfo()
2804 NdefMap->SendRecvBuf, in phFriNfc_Felica_HRdAttrInfo()
2805 NdefMap->SendRecvLength); in phFriNfc_Felica_HRdAttrInfo()
2814 static NFCSTATUS phFriNfc_Felica_HCheckManufId(const phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HCheckManufId() argument
2821 result = (uint8_t)(phFriNfc_Felica_MemCompare( (void *)(&(NdefMap->SendRecvBuf[2])), in phFriNfc_Felica_HCheckManufId()
2822 (void *)NdefMap->FelicaManufDetails.ManufID, in phFriNfc_Felica_HCheckManufId()
2873 static NFCSTATUS phFriNfc_Felica_HUpdateAttrInfo(phFriNfc_NdefMap_t *NdefMap) in phFriNfc_Felica_HUpdateAttrInfo() argument
2887 status = phFriNfc_MapTool_ChkSpcVer(NdefMap, in phFriNfc_Felica_HUpdateAttrInfo()
2896 Nmaxb1 = NdefMap->SendRecvBuf[16]; in phFriNfc_Felica_HUpdateAttrInfo()
2897 Nmaxb2 = NdefMap->SendRecvBuf[17]; in phFriNfc_Felica_HUpdateAttrInfo()
2904 if ( NdefMap->SendRecvBuf[14] > Nmaxblk ) in phFriNfc_Felica_HUpdateAttrInfo()
2913 if ( (NdefMap->SendRecvBuf[15] > Nmaxblk) || in phFriNfc_Felica_HUpdateAttrInfo()
2914 ((NdefMap->SendRecvBuf[22] != 0x00) && (NdefMap->SendRecvBuf[22] !=0x0f ))|| in phFriNfc_Felica_HUpdateAttrInfo()
2915 ( (NdefMap->SendRecvBuf[23] != 0x00) && (NdefMap->SendRecvBuf[23] !=0x01 ))|| in phFriNfc_Felica_HUpdateAttrInfo()
2916 ( NdefMap->SendRecvBuf[18] != 0x00) || in phFriNfc_Felica_HUpdateAttrInfo()
2917 ( NdefMap->SendRecvBuf[19] != 0x00) || in phFriNfc_Felica_HUpdateAttrInfo()
2918 ( NdefMap->SendRecvBuf[20] != 0x00) || in phFriNfc_Felica_HUpdateAttrInfo()
2919 ( NdefMap->SendRecvBuf[21] != 0x00)) in phFriNfc_Felica_HUpdateAttrInfo()
2927 PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES( NdefMap->SendRecvBuf[24], in phFriNfc_Felica_HUpdateAttrInfo()
2928 NdefMap->SendRecvBuf[25], in phFriNfc_Felica_HUpdateAttrInfo()
2929 NdefMap->SendRecvBuf[26], in phFriNfc_Felica_HUpdateAttrInfo()
2944NdefMap->FelicaAttrInfo.Version = NdefMap->SendRecvBuf[PH_NFCFRI_NDEFMAP_FELI_VERSION_INDEX]; in phFriNfc_Felica_HUpdateAttrInfo()
2945 NdefMap->FelicaAttrInfo.Nbr = NdefMap->SendRecvBuf[14]; in phFriNfc_Felica_HUpdateAttrInfo()
2946 NdefMap->FelicaAttrInfo.Nbw = NdefMap->SendRecvBuf[15]; in phFriNfc_Felica_HUpdateAttrInfo()
2948 NdefMap->FelicaAttrInfo.Nmaxb = Nmaxblk; in phFriNfc_Felica_HUpdateAttrInfo()
2950 NdefMap->FelicaAttrInfo.WriteFlag = NdefMap->SendRecvBuf[22]; in phFriNfc_Felica_HUpdateAttrInfo()
2951 NdefMap->FelicaAttrInfo.RdWrFlag = NdefMap->SendRecvBuf[23]; in phFriNfc_Felica_HUpdateAttrInfo()
2954 ChkSum1 = NdefMap->SendRecvBuf[27]; in phFriNfc_Felica_HUpdateAttrInfo()
2955 ChkSum2 = NdefMap->SendRecvBuf[28]; in phFriNfc_Felica_HUpdateAttrInfo()
2960 status = phFriNfc_Felica_HCalCheckSum(NdefMap->SendRecvBuf, in phFriNfc_Felica_HUpdateAttrInfo()
2972 if ( NdefMap->FelicaAttrInfo.RdWrFlag == 0x00 ) in phFriNfc_Felica_HUpdateAttrInfo()
2974 NdefMap->CardState = PH_NDEFMAP_CARD_STATE_READ_ONLY; in phFriNfc_Felica_HUpdateAttrInfo()
2976 … else if ( NdefMap->FelicaAttrInfo.RdWrFlag == 0x01 ) // additional check for R/W access in phFriNfc_Felica_HUpdateAttrInfo()
2978 NdefMap->CardState = PH_NDEFMAP_CARD_STATE_READ_WRITE; in phFriNfc_Felica_HUpdateAttrInfo()
2982 NdefMap->CardState = PH_NDEFMAP_CARD_STATE_INVALID; in phFriNfc_Felica_HUpdateAttrInfo()
2985 NdefMap->FelicaAttrInfo.LenBytes[0] = NdefMap->SendRecvBuf[24]; in phFriNfc_Felica_HUpdateAttrInfo()
2986 NdefMap->FelicaAttrInfo.LenBytes[1] = NdefMap->SendRecvBuf[25]; in phFriNfc_Felica_HUpdateAttrInfo()
2987 NdefMap->FelicaAttrInfo.LenBytes[2] = NdefMap->SendRecvBuf[26]; in phFriNfc_Felica_HUpdateAttrInfo()
3001 NdefMap->CardState = PH_NDEFMAP_CARD_STATE_INVALID; in phFriNfc_Felica_HUpdateAttrInfo()
3016 static void phFriNfc_Felica_HCrHandler(phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Felica_HCrHandler() argument
3021 NdefMap->State = PH_FRINFC_NDEFMAP_STATE_RESET_INIT; in phFriNfc_Felica_HCrHandler()
3024 NdefMap->CompletionRoutine[CrIndex]. in phFriNfc_Felica_HCrHandler()
3025 CompletionRoutine(NdefMap->CompletionRoutine->Context, Status); in phFriNfc_Felica_HCrHandler()