Lines Matching refs:NdefMap
260 phFriNfc_NdefMap_t *NdefMap,
563 NFCSTATUS phFriNfc_TopazDynamicMap_ChkNdef( phFriNfc_NdefMap_t *NdefMap) in phFriNfc_TopazDynamicMap_ChkNdef() argument
567 if ( NdefMap != NULL) in phFriNfc_TopazDynamicMap_ChkNdef()
570 NdefMap->PrevOperation = PH_FRINFC_NDEFMAP_CHECK_OPE; in phFriNfc_TopazDynamicMap_ChkNdef()
573 NdefMap->TopazContainer.CRIndex = PH_FRINFC_NDEFMAP_CR_CHK_NDEF; in phFriNfc_TopazDynamicMap_ChkNdef()
574 NdefMap->TopazContainer.Cur_RW_Index = PH_FRINFC_TOPAZ_VAL0; in phFriNfc_TopazDynamicMap_ChkNdef()
575 NdefMap->TopazContainer.CurrentSeg = 0; in phFriNfc_TopazDynamicMap_ChkNdef()
576 NdefMap->TopazContainer.NdefTLVByteAddress = 0; in phFriNfc_TopazDynamicMap_ChkNdef()
577 NdefMap->CardState = PH_NDEFMAP_CARD_STATE_INVALID; in phFriNfc_TopazDynamicMap_ChkNdef()
579 NdefMap->TopazContainer.CurrentBlock = 0; in phFriNfc_TopazDynamicMap_ChkNdef()
580 NdefMap->TopazContainer.WriteSeq = 0; in phFriNfc_TopazDynamicMap_ChkNdef()
581 NdefMap->TopazContainer.ExpectedSeq = 0; in phFriNfc_TopazDynamicMap_ChkNdef()
583 (void)memset ((void *)&(NdefMap->LockTlv), 0, in phFriNfc_TopazDynamicMap_ChkNdef()
586 (void)memset ((void *)&(NdefMap->MemTlv), 0, in phFriNfc_TopazDynamicMap_ChkNdef()
590 NdefMap->CardType = PH_FRINFC_NDEFMAP_TOPAZ_DYNAMIC_CARD; in phFriNfc_TopazDynamicMap_ChkNdef()
593 NdefMap->State = PH_FRINFC_TOPAZ_STATE_READ; in phFriNfc_TopazDynamicMap_ChkNdef()
595 NdefMap->TopazContainer.InternalState = PH_FRINFC_TOPAZ_DYNAMIC_INIT_CHK_NDEF; in phFriNfc_TopazDynamicMap_ChkNdef()
598 *NdefMap->SendRecvBuf = PH_FRINFC_TOPAZ_CMD_RSEG; in phFriNfc_TopazDynamicMap_ChkNdef()
603 NdefMap->Cmd.JewelCmd = phHal_eJewel_ReadSeg; in phFriNfc_TopazDynamicMap_ChkNdef()
605 NdefMap->Cmd.JewelCmd = phHal_eJewelCmdListJewelRead; in phFriNfc_TopazDynamicMap_ChkNdef()
610 Result = phFriNfc_Tpz_H_NxpRead(NdefMap); in phFriNfc_TopazDynamicMap_ChkNdef()
626 NFCSTATUS phFriNfc_TopazDynamicMap_RdNdef( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_TopazDynamicMap_RdNdef() argument
634 NdefMap->ApduBuffer = PacketData; in phFriNfc_TopazDynamicMap_RdNdef()
636 NdefMap->ApduBufferSize = *PacketDataLength; in phFriNfc_TopazDynamicMap_RdNdef()
638 NdefMap->NumOfBytesRead = PacketDataLength; in phFriNfc_TopazDynamicMap_RdNdef()
642 *NdefMap->NumOfBytesRead = 0; in phFriNfc_TopazDynamicMap_RdNdef()
644 NdefMap->ApduBuffIndex = PH_FRINFC_TOPAZ_VAL0; in phFriNfc_TopazDynamicMap_RdNdef()
646 NdefMap->Offset = Offset; in phFriNfc_TopazDynamicMap_RdNdef()
649 NdefMap->TopazContainer.CRIndex = PH_FRINFC_NDEFMAP_CR_RD_NDEF; in phFriNfc_TopazDynamicMap_RdNdef()
650 NdefMap->TopazContainer.SkipLockBlkFlag = 0; in phFriNfc_TopazDynamicMap_RdNdef()
652 NdefMap->PrevOperation = PH_FRINFC_NDEFMAP_READ_OPE; in phFriNfc_TopazDynamicMap_RdNdef()
654 (TRUE == NdefMap->TopazContainer.ReadWriteCompleteFlag)) in phFriNfc_TopazDynamicMap_RdNdef()
660 NdefMap->CardState) || in phFriNfc_TopazDynamicMap_RdNdef()
661 (0 == NdefMap->TopazContainer.ActualNDEFMsgSize)) in phFriNfc_TopazDynamicMap_RdNdef()
668 (PH_FRINFC_NDEFMAP_READ_OPE != NdefMap->PrevOperation)) in phFriNfc_TopazDynamicMap_RdNdef()
672 NdefMap->Offset = PH_FRINFC_NDEFMAP_SEEK_BEGIN; in phFriNfc_TopazDynamicMap_RdNdef()
674 NdefMap->TopazContainer.Cur_RW_Index = PH_FRINFC_TOPAZ_VAL0; in phFriNfc_TopazDynamicMap_RdNdef()
676 NdefMap->TopazContainer.RemainingReadSize = 0; in phFriNfc_TopazDynamicMap_RdNdef()
677 NdefMap->TopazContainer.ReadBufferSize = 0; in phFriNfc_TopazDynamicMap_RdNdef()
678 NdefMap->TopazContainer.ReadWriteCompleteFlag = FALSE; in phFriNfc_TopazDynamicMap_RdNdef()
679 NdefMap->TopazContainer.CurrentBlock = 0; in phFriNfc_TopazDynamicMap_RdNdef()
680 NdefMap->TopazContainer.WriteSeq = 0; in phFriNfc_TopazDynamicMap_RdNdef()
682 NdefMap->TopazContainer.CurrentSeg = (uint8_t)TOPAZ_SEG_FROM_BYTE_ADR ( in phFriNfc_TopazDynamicMap_RdNdef()
683 phFriNfc_Tpz_H_GetNDEFValueFieldAddrForRead (NdefMap)); in phFriNfc_TopazDynamicMap_RdNdef()
686 NdefMap->State = PH_FRINFC_TOPAZ_STATE_READID; in phFriNfc_TopazDynamicMap_RdNdef()
688 NdefMap->TopazContainer.ReadWriteCompleteFlag = 0; in phFriNfc_TopazDynamicMap_RdNdef()
691 NdefMap->SendRecvBuf[0] = PH_FRINFC_TOPAZ_CMD_READID; in phFriNfc_TopazDynamicMap_RdNdef()
696 NdefMap->Cmd.JewelCmd = phHal_eJewel_RID; in phFriNfc_TopazDynamicMap_RdNdef()
698 NdefMap->Cmd.JewelCmd = phHal_eJewelCmdListJewelRid; in phFriNfc_TopazDynamicMap_RdNdef()
702 Result = phFriNfc_Tpz_H_NxpRead(NdefMap); in phFriNfc_TopazDynamicMap_RdNdef()
708 NdefMap->State = PH_FRINFC_TOPAZ_STATE_READ; in phFriNfc_TopazDynamicMap_RdNdef()
709 Result = phFriNfc_Tpz_H_RemainingReadDataCopy (NdefMap); in phFriNfc_TopazDynamicMap_RdNdef()
762 NFCSTATUS phFriNfc_TopazDynamicMap_WrNdef( phFriNfc_NdefMap_t *NdefMap, in phFriNfc_TopazDynamicMap_WrNdef() argument
770 NdefMap->ApduBuffer = PacketData; in phFriNfc_TopazDynamicMap_WrNdef()
772 NdefMap->ApduBufferSize = *PacketDataLength; in phFriNfc_TopazDynamicMap_WrNdef()
774 NdefMap->ApduBuffIndex = 0; in phFriNfc_TopazDynamicMap_WrNdef()
776 NdefMap->WrNdefPacketLength = PacketDataLength; in phFriNfc_TopazDynamicMap_WrNdef()
780 *NdefMap->WrNdefPacketLength = 0; in phFriNfc_TopazDynamicMap_WrNdef()
783 NdefMap->TopazContainer.CRIndex = PH_FRINFC_NDEFMAP_CR_WR_NDEF; in phFriNfc_TopazDynamicMap_WrNdef()
785 NdefMap->Offset = Offset; in phFriNfc_TopazDynamicMap_WrNdef()
788 NdefMap->PrevOperation = PH_FRINFC_NDEFMAP_WRITE_OPE; in phFriNfc_TopazDynamicMap_WrNdef()
790 if (PH_NDEFMAP_CARD_STATE_READ_ONLY == NdefMap->CardState) in phFriNfc_TopazDynamicMap_WrNdef()
796 (TRUE == NdefMap->TopazContainer.ReadWriteCompleteFlag)) in phFriNfc_TopazDynamicMap_WrNdef()
802 else if (0 == NdefMap->TopazContainer.NdefTLVByteAddress) in phFriNfc_TopazDynamicMap_WrNdef()
809 (PH_FRINFC_NDEFMAP_WRITE_OPE != NdefMap->PrevOperation)) in phFriNfc_TopazDynamicMap_WrNdef()
811 NdefMap->Offset = PH_FRINFC_NDEFMAP_SEEK_BEGIN; in phFriNfc_TopazDynamicMap_WrNdef()
813 NdefMap->TopazContainer.Cur_RW_Index = PH_FRINFC_TOPAZ_VAL0; in phFriNfc_TopazDynamicMap_WrNdef()
815 NdefMap->State = PH_FRINFC_TOPAZ_STATE_READ; in phFriNfc_TopazDynamicMap_WrNdef()
816 NdefMap->TopazContainer.ReadWriteCompleteFlag = FALSE; in phFriNfc_TopazDynamicMap_WrNdef()
818 NdefMap->TopazContainer.CurrentSeg = 0; in phFriNfc_TopazDynamicMap_WrNdef()
819 NdefMap->TopazContainer.CurrentBlock = 1; in phFriNfc_TopazDynamicMap_WrNdef()
820 NdefMap->TopazContainer.WriteSeq = 0; in phFriNfc_TopazDynamicMap_WrNdef()
824 *NdefMap->SendRecvBuf = PH_FRINFC_TOPAZ_CMD_READ8; in phFriNfc_TopazDynamicMap_WrNdef()
830 NdefMap->Cmd.JewelCmd = phHal_eJewel_Read; in phFriNfc_TopazDynamicMap_WrNdef()
832 NdefMap->Cmd.JewelCmd = phHal_eJewelCmdListJewelRead; in phFriNfc_TopazDynamicMap_WrNdef()
835 NdefMap->Cmd.JewelCmd = phHal_eJewel_Read8; in phFriNfc_TopazDynamicMap_WrNdef()
839 Result = phFriNfc_Tpz_H_NxpRead (NdefMap); in phFriNfc_TopazDynamicMap_WrNdef()
846 Result = phFriNfc_Tpz_H_NxpWrite(NdefMap); in phFriNfc_TopazDynamicMap_WrNdef()
866 phFriNfc_NdefMap_t *NdefMap; in phFriNfc_TopazDynamicMap_Process() local
868 NdefMap = (phFriNfc_NdefMap_t *)Context; in phFriNfc_TopazDynamicMap_Process()
873 switch(NdefMap->State) in phFriNfc_TopazDynamicMap_Process()
877 Status = phFriNfc_Tpz_H_ProReadResp (NdefMap); in phFriNfc_TopazDynamicMap_Process()
883 Status = phFriNfc_Tpz_H_ProWrResp (NdefMap); in phFriNfc_TopazDynamicMap_Process()
889 Status = phFriNfc_Tpz_H_ProRdForWrResp (NdefMap); in phFriNfc_TopazDynamicMap_Process()
895 Status = phFriNfc_Tpz_H_ChkReadID(NdefMap); in phFriNfc_TopazDynamicMap_Process()
902 Status = phFriNfc_Tpz_H_ProcessReadOnly (NdefMap); in phFriNfc_TopazDynamicMap_Process()
919 phFriNfc_Tpz_H_Complete(NdefMap, Status); in phFriNfc_TopazDynamicMap_Process()
2202 static void phFriNfc_Tpz_H_Complete(phFriNfc_NdefMap_t *NdefMap, in phFriNfc_Tpz_H_Complete() argument
2206 NdefMap->State = PH_FRINFC_NDEFMAP_STATE_RESET_INIT; in phFriNfc_Tpz_H_Complete()
2209 NdefMap->CompletionRoutine[NdefMap->TopazContainer.CRIndex]. in phFriNfc_Tpz_H_Complete()
2210 CompletionRoutine(NdefMap->CompletionRoutine->Context, Status); in phFriNfc_Tpz_H_Complete()