Lines Matching refs:rsf
26 uint32_t ReadSpaceFirmware(RollbackSpaceFirmware *rsf);
27 uint32_t WriteSpaceFirmware(RollbackSpaceFirmware *rsf);
84 uint32_t ReadSpaceFirmware(RollbackSpaceFirmware *rsf) in ReadSpaceFirmware() argument
90 r = TlclRead(FIRMWARE_NV_INDEX, rsf, in ReadSpaceFirmware()
102 if (rsf->struct_version < 2) { in ReadSpaceFirmware()
104 rsf->struct_version = 2; in ReadSpaceFirmware()
113 if (rsf->crc8 == Crc8(rsf, in ReadSpaceFirmware()
124 uint32_t WriteSpaceFirmware(RollbackSpaceFirmware *rsf) in WriteSpaceFirmware() argument
131 if (rsf->struct_version < 2) in WriteSpaceFirmware()
132 rsf->struct_version = 2; in WriteSpaceFirmware()
133 rsf->crc8 = Crc8(rsf, offsetof(RollbackSpaceFirmware, crc8)); in WriteSpaceFirmware()
136 r = SafeWrite(FIRMWARE_NV_INDEX, rsf, in WriteSpaceFirmware()
157 RollbackSpaceFirmware rsf; in SetVirtualDevMode() local
160 if (TPM_SUCCESS != ReadSpaceFirmware(&rsf)) in SetVirtualDevMode()
163 VBDEBUG(("TPM: flags were 0x%02x\n", rsf.flags)); in SetVirtualDevMode()
165 rsf.flags |= FLAG_VIRTUAL_DEV_MODE_ON; in SetVirtualDevMode()
167 rsf.flags &= ~FLAG_VIRTUAL_DEV_MODE_ON; in SetVirtualDevMode()
172 VBDEBUG(("TPM: flags are now 0x%02x\n", rsf.flags)); in SetVirtualDevMode()
174 if (TPM_SUCCESS != WriteSpaceFirmware(&rsf)) in SetVirtualDevMode()
250 uint32_t OneTimeInitializeTPM(RollbackSpaceFirmware *rsf, in OneTimeInitializeTPM() argument
308 Memcpy(rsf, &rsf_init, sizeof(RollbackSpaceFirmware)); in OneTimeInitializeTPM()
325 RETURN_ON_FAILURE(WriteSpaceFirmware(rsf)); in OneTimeInitializeTPM()
352 int clear_tpm_owner_request, RollbackSpaceFirmware* rsf) in SetupTPM() argument
421 result = ReadSpaceFirmware(rsf); in SetupTPM()
430 RETURN_ON_FAILURE(OneTimeInitializeTPM(rsf, &rsk)); in SetupTPM()
435 Memcpy(&versions, &rsf->fw_versions, sizeof(versions)); in SetupTPM()
437 rsf->struct_version, rsf->flags, versions)); in SetupTPM()
438 in_flags = rsf->flags; in SetupTPM()
442 rsf->flags &= ~FLAG_VIRTUAL_DEV_MODE_ON; in SetupTPM()
443 VBDEBUG(("TPM: Clearing virt dev-switch: f%x\n", rsf->flags)); in SetupTPM()
452 if (rsf->flags & FLAG_VIRTUAL_DEV_MODE_ON) in SetupTPM()
469 rsf->flags |= FLAG_LAST_BOOT_DEVELOPER; in SetupTPM()
471 rsf->flags &= ~FLAG_LAST_BOOT_DEVELOPER; in SetupTPM()
475 if (rsf->flags != in_flags) { in SetupTPM()
477 RETURN_ON_FAILURE(WriteSpaceFirmware(rsf)); in SetupTPM()
578 RollbackSpaceFirmware rsf; in RollbackFirmwareSetup() local
584 clear_tpm_owner_request, &rsf)); in RollbackFirmwareSetup()
585 Memcpy(version, &rsf.fw_versions, sizeof(*version)); in RollbackFirmwareSetup()
586 *is_virt_dev = (rsf.flags & FLAG_VIRTUAL_DEV_MODE_ON) ? 1 : 0; in RollbackFirmwareSetup()
593 RollbackSpaceFirmware rsf; in RollbackFirmwareWrite() local
596 RETURN_ON_FAILURE(ReadSpaceFirmware(&rsf)); in RollbackFirmwareWrite()
597 Memcpy(&old_version, &rsf.fw_versions, sizeof(old_version)); in RollbackFirmwareWrite()
600 Memcpy(&rsf.fw_versions, &version, sizeof(version)); in RollbackFirmwareWrite()
601 return WriteSpaceFirmware(&rsf); in RollbackFirmwareWrite()