summaryrefslogtreecommitdiff
path: root/include/env.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-10-30 14:17:23 -0400
committerTom Rini <trini@konsulko.com>2020-10-30 14:17:23 -0400
commit7820052fdeb17f159037879fc1b51b0fd704c180 (patch)
tree67d7bdff892fae5f81ead9fa0487e406b2ca55e9 /include/env.h
parent8d7f3fcb4a20bade1a940cea3e3b6983587d0fc9 (diff)
parent8ba0f89abe6f60802da7ff5f630f16a9fbc27df2 (diff)
Merge branch '2020-10-30-misc-changes'
- Additional log improvements - SPI flash environment improvements
Diffstat (limited to 'include/env.h')
-rw-r--r--include/env.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/env.h b/include/env.h
index af405955b0f..c15339a93f1 100644
--- a/include/env.h
+++ b/include/env.h
@@ -319,6 +319,24 @@ int env_import(const char *buf, int check, int flags);
int env_export(struct environment_s *env_out);
/**
+ * env_check_redund() - check the two redundant environments
+ * and find out, which is the valid one.
+ *
+ * @buf1: First environment (struct environemnt_s *)
+ * @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid
+ * @buf2: Second environment (struct environemnt_s *)
+ * @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid
+ * @return 0 if OK,
+ * -EIO if no environment is valid,
+ * -EINVAL if read of second entry is good
+ * -ENOENT if read of first entry is good
+ * -ENOMSG if the CRC was bad
+ */
+
+int env_check_redund(const char *buf1, int buf1_read_fail,
+ const char *buf2, int buf2_read_fail);
+
+/**
* env_import_redund() - Select and import one of two redundant environments
*
* @buf1: First environment (struct environemnt_s *)