diff options
Diffstat (limited to 'libflashrom.h')
-rw-r--r-- | libflashrom.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libflashrom.h b/libflashrom.h index 1c9498ec..6d02d50f 100644 --- a/libflashrom.h +++ b/libflashrom.h @@ -1,6 +1,7 @@ /* * This file is part of the flashrom project. * + * Copyright (C) 2010 Google Inc. * Copyright (C) 2012 secunet Security Networks AG * (Written by Nico Huber <nico.huber@secunet.com> for secunet) * @@ -119,4 +120,32 @@ int flashrom_layout_get_region_range(struct flashrom_layout *, const char *name, void flashrom_layout_release(struct flashrom_layout *); void flashrom_layout_set(struct flashrom_flashctx *, const struct flashrom_layout *); +/** @ingroup flashrom-wp */ +enum flashrom_wp_result { + FLASHROM_WP_OK = 0, + FLASHROM_WP_ERR_CHIP_UNSUPPORTED = 1, + FLASHROM_WP_ERR_OTHER = 2, + FLASHROM_WP_ERR_READ_FAILED = 3, + FLASHROM_WP_ERR_WRITE_FAILED = 4, + FLASHROM_WP_ERR_VERIFY_FAILED = 5 +}; + +enum flashrom_wp_mode { + FLASHROM_WP_MODE_DISABLED, + FLASHROM_WP_MODE_HARDWARE, + FLASHROM_WP_MODE_POWER_CYCLE, + FLASHROM_WP_MODE_PERMANENT +}; +struct flashrom_wp_cfg; + +enum flashrom_wp_result flashrom_wp_cfg_new(struct flashrom_wp_cfg **); +void flashrom_wp_cfg_release(struct flashrom_wp_cfg *); +void flashrom_wp_set_mode(struct flashrom_wp_cfg *, enum flashrom_wp_mode); +enum flashrom_wp_mode flashrom_wp_get_mode(const struct flashrom_wp_cfg *); +void flashrom_wp_set_range(struct flashrom_wp_cfg *, size_t start, size_t len); +void flashrom_wp_get_range(size_t *start, size_t *len, const struct flashrom_wp_cfg *); + +enum flashrom_wp_result flashrom_wp_read_cfg(struct flashrom_wp_cfg *, struct flashrom_flashctx *); +enum flashrom_wp_result flashrom_wp_write_cfg(struct flashrom_flashctx *, const struct flashrom_wp_cfg *); + #endif /* !__LIBFLASHROM_H__ */ |