Lines Matching defs:p_FmPcd

54 static t_Error CheckFmPcdParameters(t_FmPcd *p_FmPcd)
56 if(!p_FmPcd->h_Fm)
59 if(p_FmPcd->guestId == NCSW_MASTER_ID)
61 if(p_FmPcd->p_FmPcdKg && !p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs)
64 if(p_FmPcd->p_FmPcdPlcr && !p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs)
67 if(!p_FmPcd->f_Exception)
70 if((!p_FmPcd->f_FmPcdIndexedException) && (p_FmPcd->p_FmPcdPlcr || p_FmPcd->p_FmPcdKg))
73 if(p_FmPcd->p_FmPcdDriverParam->prsMaxParseCycleLimit > PRS_MAX_CYCLE_LIMIT)
97 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
102 SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE);
123 if(p_FmPcd->enabled)
124 p_FmPcd->numOfEnabledGuestPartitionsPcds++;
125 *(uint8_t*)(p_IpcReply->replyBody) = (uint8_t)p_FmPcd->enabled;
130 if(p_FmPcd->numOfEnabledGuestPartitionsPcds)
132 p_FmPcd->numOfEnabledGuestPartitionsPcds--;
341 void FmPcdSetClsPlanGrpId(t_FmPcd *p_FmPcd, uint8_t netEnvId, uint8_t clsPlanGrpId)
343 p_FmPcd->netEnvs[netEnvId].clsPlanGrpId = clsPlanGrpId;
346 t_Error PcdGetClsPlanGrpParams(t_FmPcd *p_FmPcd, t_FmPcdKgInterModuleClsPlanGrpParams *p_GrpParams)
351 if(p_FmPcd->netEnvs[netEnvId].clsPlanGrpId != ILLEGAL_CLS_PLAN)
354 p_GrpParams->clsPlanGrpId = p_FmPcd->netEnvs[netEnvId].clsPlanGrpId;
359 (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE)); i++)
362 (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE)); k++)
365 if(p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].opt)
370 if(p_GrpParams->options[j] == p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].opt)
373 p_GrpParams->optVectors[j] |= p_FmPcd->netEnvs[netEnvId].unitsVectors[i];
376 p_GrpParams->options[p_GrpParams->numOfOptions] = p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].opt;
385 if(p_FmPcd->p_FmPcdKg->emptyClsPlanGrpId != ILLEGAL_CLS_PLAN)
388 p_GrpParams->clsPlanGrpId = p_FmPcd->p_FmPcdKg->emptyClsPlanGrpId;
396 t_Error PcdGetVectorForOpt(t_FmPcd *p_FmPcd, uint8_t netEnvId, protocolOpt_t opt, uint32_t *p_Vector)
403 (p_FmPcd->netEnvs[netEnvId].units[j].hdrs[0].hdr != HEADER_TYPE_NONE)); j++)
406 (p_FmPcd->netEnvs[netEnvId].units[j].hdrs[k].hdr != HEADER_TYPE_NONE)); k++)
408 if (p_FmPcd->netEnvs[netEnvId].units[j].hdrs[k].opt == opt)
409 *p_Vector |= p_FmPcd->netEnvs[netEnvId].unitsVectors[j];
419 t_Error PcdGetUnitsVector(t_FmPcd *p_FmPcd, t_NetEnvParams *p_Params)
426 if(p_FmPcd->netEnvs[p_Params->netEnvId].units[p_Params->unitIds[i]].hdrs[0].hdr == HEADER_TYPE_NONE)
428 ASSERT_COND(p_FmPcd->netEnvs[p_Params->netEnvId].unitsVectors[p_Params->unitIds[i]]);
429 p_Params->vector |= p_FmPcd->netEnvs[p_Params->netEnvId].unitsVectors[p_Params->unitIds[i]];
435 bool PcdNetEnvIsUnitWithoutOpts(t_FmPcd *p_FmPcd, uint8_t netEnvId, uint32_t unitVector)
440 while (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE)
442 if (p_FmPcd->netEnvs[netEnvId].unitsVectors[i] == unitVector)
446 (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE));
449 if((protocolOpt_t)p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].opt)
456 ASSERT_COND(p_FmPcd->netEnvs[netEnvId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE);
462 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
465 ASSERT_COND(p_FmPcd);
468 (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE)); i++)
471 (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE)); k++)
472 if (p_FmPcd->netEnvs[netEnvId].units[i].hdrs[k].hdr == hdr)
476 (p_FmPcd->netEnvs[netEnvId].aliasHdrs[i].hdr != HEADER_TYPE_NONE)); i++)
478 if (p_FmPcd->netEnvs[netEnvId].aliasHdrs[i].hdr == hdr)
485 e_NetHeaderType FmPcdGetAliasHdr(t_FmPcd *p_FmPcd, uint8_t netEnvId, e_NetHeaderType hdr)
489 ASSERT_COND(p_FmPcd);
492 && (p_FmPcd->netEnvs[netEnvId].aliasHdrs[i].hdr != HEADER_TYPE_NONE); i++)
494 if (p_FmPcd->netEnvs[netEnvId].aliasHdrs[i].hdr == hdr)
495 return p_FmPcd->netEnvs[netEnvId].aliasHdrs[i].aliasHdr;
503 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
508 p_FmPcd->p_FmPcdPlcr->portsMapping[swPortIndex].h_FmPort = h_FmPort;
513 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
515 return p_FmPcd->netEnvs[netEnvId].lcvs[hdrNum];
520 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
522 return p_FmPcd->netEnvs[netEnvId].macsecVector;
559 t_FmPcd *p_FmPcd = NULL;
565 p_FmPcd = (t_FmPcd *) XX_Malloc(sizeof(t_FmPcd));
566 if (!p_FmPcd)
571 memset(p_FmPcd, 0, sizeof(t_FmPcd));
573 p_FmPcd->p_FmPcdDriverParam = (t_FmPcdDriverParam *) XX_Malloc(sizeof(t_FmPcdDriverParam));
574 if (!p_FmPcd->p_FmPcdDriverParam)
576 XX_Free(p_FmPcd);
580 memset(p_FmPcd->p_FmPcdDriverParam, 0, sizeof(t_FmPcdDriverParam));
582 p_FmPcd->h_Fm = p_FmPcdParams->h_Fm;
583 p_FmPcd->guestId = FmGetGuestId(p_FmPcd->h_Fm);
584 p_FmPcd->h_FmMuram = FmGetMuramHandle(p_FmPcd->h_Fm);
586 p_FmPcd->physicalMuramBase = (uint64_t)((uint64_t)(&physicalMuramBase)->low | ((uint64_t)(&physicalMuramBase)->high << 32));
589 p_FmPcd->netEnvs[i].clsPlanGrpId = ILLEGAL_CLS_PLAN;
596 hcParams.h_Fm = p_FmPcd->h_Fm;
597 hcParams.h_FmPcd = (t_Handle)p_FmPcd;
599 p_FmPcd->h_Hc = FmHcConfigAndInit(&hcParams);
600 if (!p_FmPcd->h_Hc)
603 FM_PCD_Free(p_FmPcd);
607 else if(p_FmPcd->guestId != NCSW_MASTER_ID)
612 p_FmPcd->p_FmPcdKg = (t_FmPcdKg *)KgConfig(p_FmPcd, p_FmPcdParams);
613 if(!p_FmPcd->p_FmPcdKg)
616 FM_PCD_Free(p_FmPcd);
623 p_FmPcd->p_FmPcdPlcr = (t_FmPcdPlcr *)PlcrConfig(p_FmPcd, p_FmPcdParams);
624 if(!p_FmPcd->p_FmPcdPlcr)
627 FM_PCD_Free(p_FmPcd);
634 p_FmPcd->p_FmPcdPrs = (t_FmPcdPrs *)PrsConfig(p_FmPcd, p_FmPcdParams);
635 if(!p_FmPcd->p_FmPcdPrs)
638 FM_PCD_Free(p_FmPcd);
643 p_FmPcd->h_Spinlock = XX_InitSpinlock();
644 if (!p_FmPcd->h_Spinlock)
647 FM_PCD_Free(p_FmPcd);
651 p_FmPcd->numOfEnabledGuestPartitionsPcds = 0;
653 p_FmPcd->f_Exception = p_FmPcdParams->f_Exception;
654 p_FmPcd->f_FmPcdIndexedException = p_FmPcdParams->f_ExceptionId;
655 p_FmPcd->h_App = p_FmPcdParams->h_App;
657 return p_FmPcd;
662 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
666 SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE);
667 SANITY_CHECK_RETURN_ERROR(p_FmPcd->p_FmPcdDriverParam, E_INVALID_HANDLE);
669 if(p_FmPcd->guestId != NCSW_MASTER_ID)
675 memset(p_FmPcd->fmPcdIpcHandlerModuleName, 0, (sizeof(char)) * MODULE_NAME_SIZE);
676 if(Sprint (p_FmPcd->fmPcdIpcHandlerModuleName, "FM_PCD_%d_%d", FmGetId(p_FmPcd->h_Fm), NCSW_MASTER_ID) != 10)
678 memset(p_FmPcd->fmPcdModuleName, 0, (sizeof(char)) * MODULE_NAME_SIZE);
679 if(Sprint (p_FmPcd->fmPcdModuleName, "FM_PCD_%d_%d",FmGetId(p_FmPcd->h_Fm), p_FmPcd->guestId) != (p_FmPcd->guestId<10 ? 10:11))
682 p_FmPcd->h_IpcSession = XX_IpcInitSession(p_FmPcd->fmPcdIpcHandlerModuleName, p_FmPcd->fmPcdModuleName);
683 if (p_FmPcd->h_IpcSession == NULL)
684 RETURN_ERROR(MAJOR, E_NOT_AVAILABLE, ("FM PCD Guest %d IPC session", p_FmPcd->guestId));
689 msg.msgBody[0] = p_FmPcd->guestId;
695 if ((err = XX_IpcSendMessage(p_FmPcd->h_IpcSession,
697 sizeof(msg.msgId)+sizeof(p_FmPcd->guestId),
710 CHECK_INIT_PARAMETERS(p_FmPcd, CheckFmPcdParameters);
712 if(p_FmPcd->p_FmPcdKg)
714 err = KgInit(p_FmPcd);
719 if(p_FmPcd->p_FmPcdPlcr)
721 err = PlcrInit(p_FmPcd);
726 if(p_FmPcd->p_FmPcdPrs)
728 err = PrsInit(p_FmPcd);
733 if(p_FmPcd->guestId == NCSW_MASTER_ID)
736 memset(p_FmPcd->fmPcdModuleName, 0, (sizeof(char)) * MODULE_NAME_SIZE);
737 if(Sprint (p_FmPcd->fmPcdModuleName, "FM_PCD_%d_%d",FmGetId(p_FmPcd->h_Fm),NCSW_MASTER_ID) != 10)
739 err = XX_IpcRegisterMsgHandler(p_FmPcd->fmPcdModuleName, FmPcdHandleIpcMsgCB, p_FmPcd, FM_PCD_MAX_REPLY_SIZE);
744 XX_Free(p_FmPcd->p_FmPcdDriverParam);
745 p_FmPcd->p_FmPcdDriverParam = NULL;
747 FmRegisterPcd(p_FmPcd->h_Fm, p_FmPcd);
754 t_FmPcd *p_FmPcd =(t_FmPcd *)h_FmPcd;
757 if(p_FmPcd->enabled)
758 FM_PCD_Disable(p_FmPcd);
760 if (p_FmPcd->h_Spinlock)
761 XX_FreeSpinlock(p_FmPcd->h_Spinlock);
763 if(p_FmPcd->p_FmPcdDriverParam)
765 XX_Free(p_FmPcd->p_FmPcdDriverParam);
766 p_FmPcd->p_FmPcdDriverParam = NULL;
768 if(p_FmPcd->p_FmPcdKg)
770 if((err = KgFree(p_FmPcd)) != E_OK)
772 XX_Free(p_FmPcd->p_FmPcdKg);
773 p_FmPcd->p_FmPcdKg = NULL;
776 if(p_FmPcd->p_FmPcdPlcr)
778 if((err = PlcrFree(p_FmPcd)) != E_OK)
780 XX_Free(p_FmPcd->p_FmPcdPlcr);
781 p_FmPcd->p_FmPcdPlcr = NULL;
784 if(p_FmPcd->p_FmPcdPrs)
786 if(p_FmPcd->guestId == NCSW_MASTER_ID)
787 PrsFree(p_FmPcd);
788 XX_Free(p_FmPcd->p_FmPcdPrs);
789 p_FmPcd->p_FmPcdPrs = NULL;
792 if (p_FmPcd->h_Hc)
794 FmHcFree(p_FmPcd->h_Hc);
795 p_FmPcd->h_Hc = NULL;
798 XX_IpcUnregisterMsgHandler(p_FmPcd->fmPcdModuleName);
800 FmUnregisterPcd(p_FmPcd->h_Fm);
802 XX_Free(p_FmPcd);
808 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
813 if(p_FmPcd->guestId == NCSW_MASTER_ID)
815 if(p_FmPcd->p_FmPcdKg)
816 KgEnable(p_FmPcd);
818 if(p_FmPcd->p_FmPcdPlcr)
819 PlcrEnable(p_FmPcd);
821 if(p_FmPcd->p_FmPcdPrs)
822 PrsEnable(p_FmPcd);
824 p_FmPcd->enabled = TRUE;
837 if ((err = XX_IpcSendMessage(p_FmPcd->h_IpcSession,
847 p_FmPcd->enabled = (bool)!!(*(uint8_t*)(reply.replyBody));
848 if (!p_FmPcd->enabled)
857 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
865 if(p_FmPcd->guestId == NCSW_MASTER_ID)
867 if(p_FmPcd->numOfEnabledGuestPartitionsPcds != 0)
870 if(p_FmPcd->p_FmPcdKg)
871 KgDisable(p_FmPcd);
873 if(p_FmPcd->p_FmPcdPlcr)
874 PlcrDisable(p_FmPcd);
876 if(p_FmPcd->p_FmPcdPrs)
877 PrsDisable(p_FmPcd);
879 p_FmPcd->enabled = FALSE;
888 if ((err = XX_IpcSendMessage(p_FmPcd->h_IpcSession,
904 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
914 SANITY_CHECK_RETURN_VALUE(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE, NULL);
916 intFlags = FmPcdLock(p_FmPcd);
920 if(!p_FmPcd->netEnvs[i].used)
926 FmPcdUnlock(p_FmPcd, intFlags);
930 p_FmPcd->netEnvs[i].used = TRUE;
932 if (!TRY_LOCK(NULL, &p_FmPcd->netEnvs[i].lock))
934 FmPcdUnlock(p_FmPcd, intFlags);
937 FmPcdUnlock(p_FmPcd, intFlags);
942 memset(&p_FmPcd->netEnvs[netEnvCurrId].units, 0, FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS * sizeof(t_FmPcdIntDistinctionUnit));
943 memset(&p_FmPcd->netEnvs[netEnvCurrId].aliasHdrs, 0, FM_PCD_MAX_NUM_OF_PRIVATE_HDRS * sizeof(t_FmPcdNetEnvAliases));
944 memcpy(&p_FmPcd->netEnvs[netEnvCurrId].units, p_NetEnvParams->units, p_NetEnvParams->numOfDistinctionUnits*sizeof(t_FmPcdIntDistinctionUnit));
945 p_FmPcd->netEnvs[netEnvCurrId].clsPlanGrpId = ILLEGAL_CLS_PLAN;
949 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE); i++)
952 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE); k++)
956 if(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].opt)
959 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[j].hdr != HEADER_TYPE_NONE); j++)
960 if((p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[j].hdr == p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr) &&
961 !p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[j].opt)
964 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
974 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE); i++)
977 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE); k++)
981 if(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr == HEADER_TYPE_IPSEC_AH)
986 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
995 if(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr == HEADER_TYPE_IPSEC_ESP)
1000 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
1009 if(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr == HEADER_TYPE_UDP_ENCAP_ESP)
1012 p_FmPcd->netEnvs[netEnvCurrId].aliasHdrs[specialUnits].hdr = HEADER_TYPE_UDP_ENCAP_ESP;
1013 p_FmPcd->netEnvs[netEnvCurrId].aliasHdrs[specialUnits++].aliasHdr = HEADER_TYPE_USER_DEFINED_SHIM1;
1014 p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr = HEADER_TYPE_USER_DEFINED_SHIM1;
1015 p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].opt = 0;
1022 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE); i++)
1024 if(IS_PRIVATE_HEADER(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr))
1025 if(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[1].hdr != HEADER_TYPE_NONE)
1028 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
1035 if (IS_PRIVATE_HEADER(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr))
1036 switch(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr)
1042 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
1046 p_FmPcd->netEnvs[netEnvCurrId].unitsVectors[i] = 0x00000001;
1049 p_FmPcd->netEnvs[netEnvCurrId].unitsVectors[i] = 0x00000002;
1056 p_FmPcd->netEnvs[netEnvCurrId].unitsVectors[i] = (uint32_t)(0x80000000 >> bitId++);
1058 if(IS_SPECIAL_HEADER(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr))
1059 p_FmPcd->netEnvs[netEnvCurrId].macsecVector = p_FmPcd->netEnvs[netEnvCurrId].unitsVectors[i];
1067 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr != HEADER_TYPE_NONE); i++)
1070 if (!IS_PRIVATE_HEADER(p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[0].hdr))
1073 && (p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr != HEADER_TYPE_NONE); k++)
1075 GET_PRS_HDR_NUM(hdrNum, p_FmPcd->netEnvs[netEnvCurrId].units[i].hdrs[k].hdr);
1079 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
1082 p_FmPcd->netEnvs[netEnvCurrId].lcvs[hdrNum] |= p_FmPcd->netEnvs[netEnvCurrId].unitsVectors[i];
1087 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvCurrId].lock);
1094 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1098 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1100 if (!TRY_LOCK(p_FmPcd->h_Spinlock, &p_FmPcd->netEnvs[netEnvId].lock))
1103 if(p_FmPcd->netEnvs[netEnvId].owners)
1105 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvId].lock);
1108 p_FmPcd->netEnvs[netEnvId].used= FALSE;
1109 p_FmPcd->netEnvs[netEnvId].clsPlanGrpId = ILLEGAL_CLS_PLAN;
1111 memset(p_FmPcd->netEnvs[netEnvId].units, 0, sizeof(t_FmPcdIntDistinctionUnit)*FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS);
1112 memset(p_FmPcd->netEnvs[netEnvId].unitsVectors, 0, sizeof(uint32_t)*FM_PCD_MAX_NUM_OF_DISTINCTION_UNITS);
1113 memset(p_FmPcd->netEnvs[netEnvId].lcvs, 0, sizeof(uint32_t)*FM_PCD_PRS_NUM_OF_HDRS);
1115 RELEASE_LOCK(p_FmPcd->netEnvs[netEnvId].lock);
1122 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1126 FmHcTxConf(p_FmPcd->h_Hc, p_Fd);
1131 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1138 SANITY_CHECK_RETURN_VALUE(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE, 0);
1140 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1147 if ((err = XX_IpcSendMessage(p_FmPcd->h_IpcSession,
1165 if(!p_FmPcd->p_FmPcdKg)
1177 if(!p_FmPcd->p_FmPcdPlcr)
1183 if(!(GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_gcr) & FM_PCD_PLCR_GCR_STEN))
1206 if(!p_FmPcd->p_FmPcdPrs)
1219 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->pds);
1221 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l2rrs);
1223 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l3rrs);
1225 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l4rrs);
1227 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->srrs);
1229 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l2rres);
1231 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l3rres);
1233 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l4rres);
1235 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->srres);
1237 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->spcs);
1239 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->spscs);
1241 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->hxscs);
1243 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mrcs);
1245 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mrscs);
1247 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mwcs);
1249 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mwscs);
1251 return GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->fcscs);
1253 return GET_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgtpc);
1257 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ypcnt);
1259 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rpcnt);
1261 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rrpcnt);
1263 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rypcnt);
1265 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_tpcnt);
1267 return GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_flmcnt);
1278 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1284 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1286 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1290 return XX_IpcSendMessage(p_FmPcd->h_IpcSession,
1298 if (p_FmPcd->p_FmPcdKg)
1300 if (p_FmPcd->p_FmPcdPlcr)
1302 if (p_FmPcd->p_FmPcdPrs)
1309 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1314 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1315 SANITY_CHECK_RETURN_ERROR(p_FmPcd->h_Hc, E_INVALID_STATE);
1317 return FmHcDumpRegs(p_FmPcd->h_Hc);
1324 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1327 SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE);
1329 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1336 p_FmPcd->exceptions |= bitMask;
1338 p_FmPcd->exceptions &= ~bitMask;
1348 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1351 SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE);
1352 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1354 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1362 p_FmPcd->exceptions |= bitMask;
1364 p_FmPcd->exceptions &= ~bitMask;
1370 if(!p_FmPcd->p_FmPcdKg)
1377 if(!p_FmPcd->p_FmPcdPlcr)
1382 if(!p_FmPcd->p_FmPcdPrs)
1393 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgeeer);
1398 WRITE_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgeeer, tmpReg);
1401 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgeeer);
1406 WRITE_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgeeer, tmpReg);
1409 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->perer);
1414 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->perer, tmpReg);
1417 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->pever);
1422 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->pever, tmpReg);
1425 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eier);
1430 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eier, tmpReg);
1433 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eier);
1438 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eier, tmpReg);
1441 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ier);
1446 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ier, tmpReg);
1449 tmpReg = GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ier);
1454 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ier, tmpReg);
1465 FmEnableRamsEcc(p_FmPcd->h_Fm);
1470 FmDisableRamsEcc(p_FmPcd->h_Fm);
1480 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1483 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1485 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1492 if(!p_FmPcd->p_FmPcdKg)
1499 if(!p_FmPcd->p_FmPcdPlcr)
1504 if(!p_FmPcd->p_FmPcdPrs)
1514 if (!(p_FmPcd->exceptions & FM_PCD_EX_PRS_DOUBLE_ECC))
1516 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->perfr, FM_PCD_PRS_DOUBLE_ECC);
1519 if (!(p_FmPcd->exceptions & FM_PCD_EX_PRS_SINGLE_ECC))
1521 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->pevfr, FM_PCD_PRS_SINGLE_ECC);
1524 if (!(p_FmPcd->exceptions & FM_PCD_EX_KG_DOUBLE_ECC))
1526 WRITE_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgfeer, FM_PCD_KG_DOUBLE_ECC);
1529 if (!(p_FmPcd->exceptions & FM_PCD_EX_KG_KEYSIZE_OVERFLOW))
1531 WRITE_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgfeer, FM_PCD_KG_KEYSIZE_OVERFLOW);
1534 if (!(p_FmPcd->exceptions & FM_PCD_EX_PLCR_DOUBLE_ECC))
1536 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eifr, FM_PCD_PLCR_DOUBLE_ECC);
1539 if (!(p_FmPcd->exceptions & FM_PCD_EX_PLCR_INIT_ENTRY_ERROR))
1541 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_eifr, FM_PCD_PLCR_INIT_ENTRY_ERROR);
1544 if (!(p_FmPcd->exceptions & FM_PCD_EX_PLCR_PRAM_SELF_INIT_COMPLETE))
1546 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ifr, FM_PCD_PLCR_PRAM_SELF_INIT_COMPLETE);
1549 if (!(p_FmPcd->exceptions & FM_PCD_EX_PLCR_ATOMIC_ACTION_COMPLETE))
1551 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ifr, FM_PCD_PLCR_ATOMIC_ACTION_COMPLETE);
1563 t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
1566 SANITY_CHECK_RETURN_ERROR(!p_FmPcd->p_FmPcdDriverParam, E_INVALID_STATE);
1568 if(p_FmPcd->guestId != NCSW_MASTER_ID)
1574 if(!p_FmPcd->p_FmPcdKg)
1583 if(!p_FmPcd->p_FmPcdPlcr)
1585 if(!(GET_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_gcr) & FM_PCD_PLCR_GCR_STEN))
1605 if(!p_FmPcd->p_FmPcdPrs)
1614 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->pds, value);
1617 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l2rrs, value);
1620 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l3rrs, value);
1623 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l4rrs, value);
1626 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->srrs, value);
1629 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l2rres, value);
1632 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l3rres, value);
1635 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->l4rres, value);
1638 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->srres, value);
1641 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->spcs, value);
1644 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->spscs, value);
1647 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->hxscs, value);
1650 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mrcs, value);
1653 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mrscs, value);
1656 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mwcs, value);
1659 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->mwscs, value);
1662 WRITE_UINT32(p_FmPcd->p_FmPcdPrs->p_FmPcdPrsRegs->fcscs, value);
1665 WRITE_UINT32(p_FmPcd->p_FmPcdKg->p_FmPcdKgRegs->kgtpc,value);
1670 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_ypcnt, value);
1673 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rpcnt, value);
1676 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rrpcnt, value);
1679 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_rypcnt, value);
1682 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_tpcnt, value);
1685 WRITE_UINT32(p_FmPcd->p_FmPcdPlcr->p_FmPcdPlcrRegs->fmpl_flmcnt, value);