Lines Matching refs:pDlContext
78 static NFCSTATUS phDnldNfc_BuildFramePkt(pphDnldNfc_DlContext_t pDlContext);
79 static NFCSTATUS phDnldNfc_CreateFramePld(pphDnldNfc_DlContext_t pDlContext);
80 static NFCSTATUS phDnldNfc_SetupResendTimer(pphDnldNfc_DlContext_t pDlContext);
81 static NFCSTATUS phDnldNfc_UpdateRsp(pphDnldNfc_DlContext_t pDlContext, phTmlNfc_TransactInfo_t …
588 static NFCSTATUS phDnldNfc_BuildFramePkt(pphDnldNfc_DlContext_t pDlContext) in phDnldNfc_BuildFramePkt() argument
595 if(NULL == pDlContext) in phDnldNfc_BuildFramePkt()
602 if(phDnldNfc_FTWrite == (pDlContext->FrameInp.Type)) in phDnldNfc_BuildFramePkt()
604 if((0 == (pDlContext->tUserData.wLen)) || (NULL == (pDlContext->tUserData.pBuff))) in phDnldNfc_BuildFramePkt()
611 if(TRUE == (pDlContext->tRWInfo.bFirstWrReq)) in phDnldNfc_BuildFramePkt()
613 (pDlContext->tRWInfo.wRemBytes) = (pDlContext->tUserData.wLen); in phDnldNfc_BuildFramePkt()
614 (pDlContext->tRWInfo.wOffset) = 0; in phDnldNfc_BuildFramePkt()
618 else if(phDnldNfc_FTRead == (pDlContext->FrameInp.Type)) in phDnldNfc_BuildFramePkt()
620 if((0 == (pDlContext->tRspBuffInfo.wLen)) || (NULL == (pDlContext->tRspBuffInfo.pBuff))) in phDnldNfc_BuildFramePkt()
627 if(FALSE == (pDlContext->tRWInfo.bFramesSegmented)) in phDnldNfc_BuildFramePkt()
630 wFrameLen = (pDlContext->tRspBuffInfo.wLen) + PHDNLDNFC_MIN_PLD_LEN; in phDnldNfc_BuildFramePkt()
632 … (pDlContext->tRWInfo.wRWPldSize) = (PHDNLDNFC_CMDRESP_MAX_PLD_SIZE - PHDNLDNFC_MIN_PLD_LEN); in phDnldNfc_BuildFramePkt()
633 (pDlContext->tRWInfo.wRemBytes) = (pDlContext->tRspBuffInfo.wLen); in phDnldNfc_BuildFramePkt()
634 (pDlContext->tRWInfo.dwAddr) = (pDlContext->FrameInp.dwAddr); in phDnldNfc_BuildFramePkt()
635 (pDlContext->tRWInfo.wOffset) = 0; in phDnldNfc_BuildFramePkt()
636 (pDlContext->tRWInfo.wBytesRead) = 0; in phDnldNfc_BuildFramePkt()
640 (pDlContext->tRWInfo.bFramesSegmented) = TRUE; in phDnldNfc_BuildFramePkt()
645 else if(phDnldNfc_FTLog == (pDlContext->FrameInp.Type)) in phDnldNfc_BuildFramePkt()
647 if((0 == (pDlContext->tUserData.wLen)) || (NULL == (pDlContext->tUserData.pBuff))) in phDnldNfc_BuildFramePkt()
659 wStatus = phDnldNfc_CreateFramePld(pDlContext); in phDnldNfc_BuildFramePkt()
665 wFrameLen = (pDlContext->tCmdRspFrameInfo.dwSendlength); in phDnldNfc_BuildFramePkt()
667 if(phDnldNfc_FTRaw != (pDlContext->FrameInp.Type)) in phDnldNfc_BuildFramePkt()
669 if(phDnldNfc_FTWrite != (pDlContext->FrameInp.Type)) in phDnldNfc_BuildFramePkt()
673 … pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_HDR_OFFSET] = pFrameByte[1]; in phDnldNfc_BuildFramePkt()
674 … pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_HDR_OFFSET + 1] = pFrameByte[0]; in phDnldNfc_BuildFramePkt()
677 pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAMEID_OFFSET] = in phDnldNfc_BuildFramePkt()
678 (pDlContext->tCmdId); in phDnldNfc_BuildFramePkt()
684 if(0 != (pDlContext->tRWInfo.wRWPldSize)) in phDnldNfc_BuildFramePkt()
686 if(TRUE == (pDlContext->tRWInfo.bFramesSegmented)) in phDnldNfc_BuildFramePkt()
694 … pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_HDR_OFFSET] = pFrameByte[1]; in phDnldNfc_BuildFramePkt()
695 … pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_HDR_OFFSET + 1] = pFrameByte[0]; in phDnldNfc_BuildFramePkt()
705 wCrcVal = phDnldNfc_CalcCrc16((pDlContext->tCmdRspFrameInfo.aFrameBuff),wFrameLen); in phDnldNfc_BuildFramePkt()
710 pDlContext->tCmdRspFrameInfo.aFrameBuff[wFrameLen] = pFrameByte[1]; in phDnldNfc_BuildFramePkt()
711 pDlContext->tCmdRspFrameInfo.aFrameBuff[wFrameLen+ 1] = pFrameByte[0]; in phDnldNfc_BuildFramePkt()
716 (pDlContext->tCmdRspFrameInfo.dwSendlength) = wFrameLen; in phDnldNfc_BuildFramePkt()
740 static NFCSTATUS phDnldNfc_CreateFramePld(pphDnldNfc_DlContext_t pDlContext) in phDnldNfc_CreateFramePld() argument
747 if(NULL == pDlContext) in phDnldNfc_CreateFramePld()
754 memset((pDlContext->tCmdRspFrameInfo.aFrameBuff),0,PHDNLDNFC_CMDRESP_MAX_BUFF_SIZE); in phDnldNfc_CreateFramePld()
755 (pDlContext->tCmdRspFrameInfo.dwSendlength) = 0; in phDnldNfc_CreateFramePld()
757 if(phDnldNfc_FTNone == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
759 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_MIN_PLD_LEN; in phDnldNfc_CreateFramePld()
761 else if(phDnldNfc_ChkIntg == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
763 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_MIN_PLD_LEN; in phDnldNfc_CreateFramePld()
766 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_RDDATA_OFFSET]), in phDnldNfc_CreateFramePld()
770 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAME_RDDATA_OFFSET + in phDnldNfc_CreateFramePld()
773 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_USERDATA_EEPROM_LENSIZE; in phDnldNfc_CreateFramePld()
774 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_USERDATA_EEPROM_OFFSIZE; in phDnldNfc_CreateFramePld()
776 else if(phDnldNfc_FTWrite == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
778 wBuffIdx = (pDlContext->tRWInfo.wOffset); in phDnldNfc_CreateFramePld()
780 if(FALSE == (pDlContext->tRWInfo.bFramesSegmented)) in phDnldNfc_CreateFramePld()
782 wFrameLen = (pDlContext->tUserData.pBuff[wBuffIdx]); in phDnldNfc_CreateFramePld()
784 wFrameLen |= (pDlContext->tUserData.pBuff[wBuffIdx + 1]); in phDnldNfc_CreateFramePld()
786 (pDlContext->tRWInfo.wRWPldSize) = wFrameLen; in phDnldNfc_CreateFramePld()
789 if((pDlContext->tRWInfo.wRWPldSize) > PHDNLDNFC_CMDRESP_MAX_PLD_SIZE) in phDnldNfc_CreateFramePld()
791 if(FALSE == (pDlContext->tRWInfo.bFirstChunkResp)) in phDnldNfc_CreateFramePld()
793 (pDlContext->tRWInfo.wRemChunkBytes) = wFrameLen; in phDnldNfc_CreateFramePld()
794 (pDlContext->tRWInfo.wOffset) += PHDNLDNFC_FRAME_HDR_LEN; in phDnldNfc_CreateFramePld()
795 wBuffIdx = (pDlContext->tRWInfo.wOffset); in phDnldNfc_CreateFramePld()
798 if(PHDNLDNFC_CMDRESP_MAX_PLD_SIZE < (pDlContext->tRWInfo.wRemChunkBytes)) in phDnldNfc_CreateFramePld()
800 (pDlContext->tRWInfo.wBytesToSendRecv) = PHDNLDNFC_CMDRESP_MAX_PLD_SIZE; in phDnldNfc_CreateFramePld()
801 (pDlContext->tRWInfo.bFramesSegmented) = TRUE; in phDnldNfc_CreateFramePld()
805 (pDlContext->tRWInfo.wBytesToSendRecv) = (pDlContext->tRWInfo.wRemChunkBytes); in phDnldNfc_CreateFramePld()
806 (pDlContext->tRWInfo.bFramesSegmented) = FALSE; in phDnldNfc_CreateFramePld()
809 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[PHDNLDNFC_FRAMEID_OFFSET]), in phDnldNfc_CreateFramePld()
810 … &(pDlContext->tUserData.pBuff[wBuffIdx]),(pDlContext->tRWInfo.wBytesToSendRecv)); in phDnldNfc_CreateFramePld()
814 (pDlContext->tRWInfo.wRWPldSize) = 0; in phDnldNfc_CreateFramePld()
815 (pDlContext->tRWInfo.wBytesToSendRecv) = (wFrameLen + PHDNLDNFC_FRAME_HDR_LEN); in phDnldNfc_CreateFramePld()
817 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[0]), in phDnldNfc_CreateFramePld()
818 … &(pDlContext->tUserData.pBuff[wBuffIdx]),(pDlContext->tRWInfo.wBytesToSendRecv)); in phDnldNfc_CreateFramePld()
820 (pDlContext->tCmdRspFrameInfo.dwSendlength) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_CreateFramePld()
822 else if(phDnldNfc_FTRead == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
824 (pDlContext->tRWInfo.wBytesToSendRecv) = ((pDlContext->tRWInfo.wRemBytes) > in phDnldNfc_CreateFramePld()
825 (pDlContext->tRWInfo.wRWPldSize)) ? (pDlContext->tRWInfo.wRWPldSize) : in phDnldNfc_CreateFramePld()
826 (pDlContext->tRWInfo.wRemBytes); in phDnldNfc_CreateFramePld()
828 wBuffIdx = (PHDNLDNFC_PLD_OFFSET + ((sizeof(pDlContext->tRWInfo.wBytesToSendRecv)) in phDnldNfc_CreateFramePld()
831 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[wBuffIdx]), in phDnldNfc_CreateFramePld()
832 … &(pDlContext->tRWInfo.wBytesToSendRecv),(sizeof(pDlContext->tRWInfo.wBytesToSendRecv))); in phDnldNfc_CreateFramePld()
834 wBuffIdx += sizeof(pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_CreateFramePld()
836 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[wBuffIdx]), in phDnldNfc_CreateFramePld()
837 &(pDlContext->tRWInfo.dwAddr),sizeof(pDlContext->tRWInfo.dwAddr)); in phDnldNfc_CreateFramePld()
839 (pDlContext->tCmdRspFrameInfo.dwSendlength) += (PHDNLDNFC_MIN_PLD_LEN + in phDnldNfc_CreateFramePld()
840 (sizeof(pDlContext->tRWInfo.dwAddr))); in phDnldNfc_CreateFramePld()
842 else if(phDnldNfc_FTLog == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
844 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_MIN_PLD_LEN; in phDnldNfc_CreateFramePld()
848 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[wBuffIdx]), in phDnldNfc_CreateFramePld()
849 (pDlContext->tUserData.pBuff),(pDlContext->tUserData.wLen)); in phDnldNfc_CreateFramePld()
851 (pDlContext->tCmdRspFrameInfo.dwSendlength) += (pDlContext->tUserData.wLen); in phDnldNfc_CreateFramePld()
853 else if(phDnldNfc_FTForce == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
855 (pDlContext->tCmdRspFrameInfo.dwSendlength) += PHDNLDNFC_MIN_PLD_LEN; in phDnldNfc_CreateFramePld()
859 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[wBuffIdx]), in phDnldNfc_CreateFramePld()
860 (pDlContext->tUserData.pBuff),(pDlContext->tUserData.wLen)); in phDnldNfc_CreateFramePld()
862 else if(phDnldNfc_FTRaw == (pDlContext->FrameInp.Type)) in phDnldNfc_CreateFramePld()
864 if((0 == (pDlContext->tUserData.wLen)) || (NULL == (pDlContext->tUserData.pBuff))) in phDnldNfc_CreateFramePld()
871 memcpy(&(pDlContext->tCmdRspFrameInfo.aFrameBuff[wBuffIdx]), in phDnldNfc_CreateFramePld()
872 (pDlContext->tUserData.pBuff),(pDlContext->tUserData.wLen)); in phDnldNfc_CreateFramePld()
874 (pDlContext->tCmdRspFrameInfo.dwSendlength) += (pDlContext->tUserData.wLen); in phDnldNfc_CreateFramePld()
1032 static NFCSTATUS phDnldNfc_SetupResendTimer(pphDnldNfc_DlContext_t pDlContext) in phDnldNfc_SetupResendTimer() argument
1036 wStatus = phOsalNfc_Timer_Start((pDlContext->TimerInfo.dwRspTimerId), in phDnldNfc_SetupResendTimer()
1039 pDlContext); in phDnldNfc_SetupResendTimer()
1044 (pDlContext->TimerInfo.TimerStatus) = 1; in phDnldNfc_SetupResendTimer()
1045 pDlContext->tCurrState = phDnldNfc_StateTimer; in phDnldNfc_SetupResendTimer()
1050 (pDlContext->TimerInfo.TimerStatus) = 0;/*timer stopped*/ in phDnldNfc_SetupResendTimer()
1051 pDlContext->tCurrState = phDnldNfc_StateResponse; in phDnldNfc_SetupResendTimer()
1169 static NFCSTATUS phDnldNfc_UpdateRsp(pphDnldNfc_DlContext_t pDlContext, phTmlNfc_TransactInfo_t … in phDnldNfc_UpdateRsp() argument
1174 if((NULL == pDlContext) || (NULL == pInfo)) in phDnldNfc_UpdateRsp()
1181 if(PH_DL_CMD_WRITE == (pDlContext->tCmdId)) in phDnldNfc_UpdateRsp()
1186 if(TRUE == (pDlContext->tRWInfo.bFirstWrReq)) in phDnldNfc_UpdateRsp()
1189 (pDlContext->tRWInfo.bFirstWrReq) = FALSE; in phDnldNfc_UpdateRsp()
1192 if(TRUE == (pDlContext->tRWInfo.bFirstChunkResp)) in phDnldNfc_UpdateRsp()
1194 if(FALSE == (pDlContext->tRWInfo.bFramesSegmented)) in phDnldNfc_UpdateRsp()
1197 … (pDlContext->tRWInfo.wRemChunkBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1198 (pDlContext->tRWInfo.bFirstChunkResp) = FALSE; in phDnldNfc_UpdateRsp()
1209 (pDlContext->tRWInfo.wRemBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1210 (pDlContext->tRWInfo.wOffset) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1213 else if((FALSE == (pDlContext->tRWInfo.bFirstChunkResp)) && in phDnldNfc_UpdateRsp()
1214 (TRUE == (pDlContext->tRWInfo.bFramesSegmented)) && in phDnldNfc_UpdateRsp()
1217 (pDlContext->tRWInfo.bFirstChunkResp) = TRUE; in phDnldNfc_UpdateRsp()
1218 (pDlContext->tRWInfo.wRemChunkBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1219 …(pDlContext->tRWInfo.wRemBytes) -= ((pDlContext->tRWInfo.wBytesToSendRecv) + PHDNLDNFC_FRAME_HDR_L… in phDnldNfc_UpdateRsp()
1220 (pDlContext->tRWInfo.wOffset) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1223 if(TRUE == (pDlContext->tRWInfo.bFirstWrReq)) in phDnldNfc_UpdateRsp()
1226 (pDlContext->tRWInfo.bFirstWrReq) = FALSE; in phDnldNfc_UpdateRsp()
1229 else if((TRUE == (pDlContext->tRWInfo.bFirstChunkResp)) && in phDnldNfc_UpdateRsp()
1230 (TRUE == (pDlContext->tRWInfo.bFramesSegmented)) && in phDnldNfc_UpdateRsp()
1233 (pDlContext->tRWInfo.wRemChunkBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1234 (pDlContext->tRWInfo.wRemBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1235 (pDlContext->tRWInfo.wOffset) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1240 (pDlContext->tRWInfo.bFirstWrReq) = FALSE; in phDnldNfc_UpdateRsp()
1242 (pDlContext->tRWInfo.wRemBytes) = 0; in phDnldNfc_UpdateRsp()
1243 (pDlContext->tRWInfo.wOffset) = 0; in phDnldNfc_UpdateRsp()
1249 (pDlContext->tLastStatus) = PH_DL_STATUS_PLL_ERROR; in phDnldNfc_UpdateRsp()
1256 (pDlContext->tLastStatus) = PH_DL_STATUS_SIGNATURE_ERROR; in phDnldNfc_UpdateRsp()
1262 (pDlContext->tLastStatus) = PH_DL_STATUS_MEM_BSY; in phDnldNfc_UpdateRsp()
1271 else if(PH_DL_CMD_READ == (pDlContext->tCmdId)) in phDnldNfc_UpdateRsp()
1278 if(wReadLen != (pDlContext->tRWInfo.wBytesToSendRecv)) in phDnldNfc_UpdateRsp()
1285 memcpy(&(pDlContext->tRspBuffInfo.pBuff[(pDlContext->tRWInfo.wOffset)]), in phDnldNfc_UpdateRsp()
1289 (pDlContext->tRWInfo.wBytesRead) += wReadLen; in phDnldNfc_UpdateRsp()
1291 (pDlContext->tRspBuffInfo.wLen) = (pDlContext->tRWInfo.wBytesRead); in phDnldNfc_UpdateRsp()
1293 (pDlContext->tRWInfo.wRemBytes) -= (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1294 (pDlContext->tRWInfo.dwAddr) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1295 (pDlContext->tRWInfo.wOffset) += (pDlContext->tRWInfo.wBytesToSendRecv); in phDnldNfc_UpdateRsp()
1308 if((0 != (pDlContext->tRspBuffInfo.wLen)) && in phDnldNfc_UpdateRsp()
1309 (NULL != (pDlContext->tRspBuffInfo.pBuff))) in phDnldNfc_UpdateRsp()
1311 … memcpy((pDlContext->tRspBuffInfo.pBuff),&(pInfo->pBuff[PHDNLDNFC_FRAMESTATUS_OFFSET + 1]), in phDnldNfc_UpdateRsp()
1314 (pDlContext->tRspBuffInfo.wLen) = wPldLen; in phDnldNfc_UpdateRsp()