Lines Matching refs:nPartitionID

563 static TEEC_Result partitionDestroy(uint32_t nPartitionID)  in partitionDestroy()  argument
567 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionDestroy()
576 if (unlink(g_pPartitionNames[nPartitionID]) != 0) in partitionDestroy()
579 if (_unlink(g_pPartitionNames[nPartitionID]) != 0) in partitionDestroy()
595 static TEEC_Result partitionCreate(uint32_t nPartitionID) in partitionCreate() argument
599 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionCreate()
607 LogInfo("Create storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionCreate()
608 g_pPartitionFiles[nPartitionID] = fopen(g_pPartitionNames[nPartitionID], "w+b"); in partitionCreate()
610 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionCreate()
612 LogError("Cannot create storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionCreate()
628 static TEEC_Result partitionOpen(uint32_t nPartitionID, uint32_t* pnPartitionSize) in partitionOpen() argument
632 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionOpen()
640 g_pPartitionFiles[nPartitionID] = fopen(g_pPartitionNames[nPartitionID], "r+b"); in partitionOpen()
641 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionOpen()
646 LogError("Storage file \"%s\" does not exist", g_pPartitionNames[nPartitionID]); in partitionOpen()
652 LogError("cannot open storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionOpen()
658 fseek(g_pPartitionFiles[nPartitionID], 0L, SEEK_END); in partitionOpen()
659 *pnPartitionSize = ftell(g_pPartitionFiles[nPartitionID]) / g_nSectorSize; in partitionOpen()
662 g_pPartitionNames[nPartitionID], in partitionOpen()
676 static TEEC_Result partitionClose(uint32_t nPartitionID) in partitionClose() argument
678 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionClose()
683 fclose(g_pPartitionFiles[nPartitionID]); in partitionClose()
684 g_pPartitionFiles[nPartitionID] = NULL; in partitionClose()
695 static TEEC_Result partitionRead(uint32_t nPartitionID, uint32_t nSectorIndex, uint32_t nWorkspaceO… in partitionRead() argument
700 nPartitionID, nSectorIndex, nWorkspaceOffset); in partitionRead()
702 pFile = g_pPartitionFiles[nPartitionID]; in partitionRead()
779 static TEEC_Result partitionWrite(uint32_t nPartitionID, uint32_t nSectorIndex, uint32_t nWorkspace… in partitionWrite() argument
784 nPartitionID, nSectorIndex, nWorkspaceOffset); in partitionWrite()
786 pFile = g_pPartitionFiles[nPartitionID]; in partitionWrite()
852 static TEEC_Result partitionSetSize(uint32_t nPartitionID, uint32_t nNewSectorCount) in partitionSetSize() argument
857 pFile = g_pPartitionFiles[nPartitionID]; in partitionSetSize()
917 static TEEC_Result partitionSync(uint32_t nPartitionID) in partitionSync() argument
922 FILE* pFile = g_pPartitionFiles[nPartitionID]; in partitionSync()
1120 uint32_t nPartitionID = (nInstructionID & 0xF0) >> 4; in runSession() local
1121 … if (g_pExchangeBuffer->sAdministrativeData.nPartitionErrorStates[nPartitionID] == S_SUCCESS) in runSession()
1128 nError = partitionCreate(nPartitionID); in runSession()
1130 if (nPartitionID == RPMB_PARTITION_ID) in runSession()
1136 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1141 nError = partitionOpen(nPartitionID, &nPartitionSize); in runSession()
1142 …NSTRUCTION: ID=0x%x pid=%d pSize=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nPartitionSize… in runSession()
1145 … g_pExchangeBuffer->sAdministrativeData.nPartitionOpenSizes[nPartitionID] = nPartitionSize; in runSession()
1148 if (nPartitionID == RPMB_PARTITION_ID) in runSession()
1158 if (nPartitionID == RPMB_PARTITION_ID) in runSession()
1169 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1188 nError = partitionRead(nPartitionID, nSectorID, nWorkspaceOffset); in runSession()
1189 …TION: ID=0x%x pid=%d sid=%d woff=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nSectorID, nWo… in runSession()
1194 if (nPartitionID == RPMB_PARTITION_ID) in runSession()
1205 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1224 nError = partitionWrite(nPartitionID, nSectorID, nWorkspaceOffset); in runSession()
1225 …TION: ID=0x%x pid=%d sid=%d woff=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nSectorID, nWo… in runSession()
1229 nError = partitionSync(nPartitionID); in runSession()
1230 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1248 nError = partitionSetSize(nPartitionID, nNewSize); in runSession()
1249 …RUCTION: ID=0x%x pid=%d nNewSize=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nNewSize, nErr… in runSession()
1253 nError = partitionClose(nPartitionID); in runSession()
1254 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1257 nError = partitionDestroy(nPartitionID); in runSession()
1258 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1261 g_pExchangeBuffer->sAdministrativeData.nPartitionErrorStates[nPartitionID] = nError; in runSession()