diff options
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r-- | firmware/2lib/include/2api.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 6a1fc171..8d14f376 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1345,6 +1345,8 @@ enum vb2_screen { VB2_SCREEN_DIAGNOSTICS = 0x400, /* Storage diagnostic screen */ VB2_SCREEN_DIAGNOSTICS_STORAGE_HEALTH = 0x410, + VB2_SCREEN_DIAGNOSTICS_STORAGE_TEST_SHORT = 0x411, + VB2_SCREEN_DIAGNOSTICS_STORAGE_TEST_EXTENDED = 0x412, /* Memory diagnostic screens */ VB2_SCREEN_DIAGNOSTICS_MEMORY_QUICK = 0x420, VB2_SCREEN_DIAGNOSTICS_MEMORY_FULL = 0x421, @@ -1526,6 +1528,21 @@ uint32_t vb2ex_prepare_log_screen(enum vb2_screen screen, uint32_t locale_id, vb2_error_t vb2ex_diag_get_storage_health(const char **out); /** + * Get the storage self-test log. + * + * @param out For returning a read-only pointer of full log string which is + * guaranteed to be null-terminated. The function will manage + * memory internally, so the returned pointer will only be valid + * until next call. + * @return The status of storage test. VB2_SUCCESS means the test is finished, + * regardless of passing or failing. VB2_ERROR_EX_DIAG_TEST_RUNNING means + * the test is still running. VB2_ERROR_EX_UNIMPLEMENTED means the storage + * self-test is not supported on this device. Other non-zero codes for internal + * errors. + */ +vb2_error_t vb2ex_diag_get_storage_test_log(const char **out); + +/** * Get the memory diagnostic status. When it is called, it will take over the * control for a short period of time running memory test, and then return the * result of current status. If `reset` is not zero, it will reset the memory @@ -1547,6 +1564,17 @@ vb2_error_t vb2ex_diag_memory_quick_test(int reset, const char **out); vb2_error_t vb2ex_diag_memory_full_test(int reset, const char **out); /*****************************************************************************/ +/* Functions for diagnostics control. */ + +enum vb2_diag_storage_test { + VB2_DIAG_STORAGE_TEST_STOP = 0, + VB2_DIAG_STORAGE_TEST_SHORT, + VB2_DIAG_STORAGE_TEST_EXTENDED, +}; + +vb2_error_t vb2ex_diag_storage_test_control(enum vb2_diag_storage_test ops); + +/*****************************************************************************/ /* Timer. */ /** |