summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorEvan Benn <evanbenn@chromium.org>2022-04-28 12:36:53 +1000
committerAnastasia Klimchuk <aklm@chromium.org>2022-05-06 01:00:37 +0000
commit1866deb06d775b9d006c1ef21c99f439677f0f76 (patch)
tree0c7cd17f7cb8eafa5eac97213554cd231a94eee0 /flashrom.c
parent4557c503e7020d2f72772bebc00d5f7ef9ff8133 (diff)
downloadflashrom-1866deb06d775b9d006c1ef21c99f439677f0f76.tar.gz
flashrom-1866deb06d775b9d006c1ef21c99f439677f0f76.tar.bz2
flashrom-1866deb06d775b9d006c1ef21c99f439677f0f76.zip
libflashrom: Move documentation to header
The doxygen documentation was in the libflashrom.c file. Move the documentation to the libflashrom.h file. This allows foreign function interface binding generators (eg rust bindgen) that operate on the .h file to generate documentation for the target language. Some doxygen errors were also corrected, mostly undocumented or wrongly labeled parameters. To test, I have diffed and inspected the doxygen documentation before and after the change. All functions are documented the same, and the structs and enums are now also included in the docs. Change-Id: I856b74d5bfea13722539be15496755a95e701eea Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63903 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/flashrom.c b/flashrom.c
index 173638165..9b136a03f 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1901,20 +1901,6 @@ void finalize_flash_access(struct flashctx *const flash)
unmap_flash(flash);
}
-/**
- * @addtogroup flashrom-flash
- * @{
- */
-
-/**
- * @brief Erase the specified ROM chip.
- *
- * If a layout is set in the given flash context, only included regions
- * will be erased.
- *
- * @param flashctx The context of the flash chip to erase.
- * @return 0 on success.
- */
int flashrom_flash_erase(struct flashctx *const flashctx)
{
if (prepare_flash_access(flashctx, false, false, true, false))
@@ -1927,26 +1913,6 @@ int flashrom_flash_erase(struct flashctx *const flashctx)
return ret;
}
-/** @} */ /* end flashrom-flash */
-
-/**
- * @defgroup flashrom-ops Operations
- * @{
- */
-
-/**
- * @brief Read the current image from the specified ROM chip.
- *
- * If a layout is set in the specified flash context, only included regions
- * will be read.
- *
- * @param flashctx The context of the flash chip.
- * @param buffer Target buffer to write image to.
- * @param buffer_len Size of target buffer in bytes.
- * @return 0 on success,
- * 2 if buffer_len is too short for the flash chip's contents,
- * or 1 on any other failure.
- */
int flashrom_image_read(struct flashctx *const flashctx, void *const buffer, const size_t buffer_len)
{
const size_t flash_size = flashctx->chip->total_size * 1024;
@@ -1996,22 +1962,6 @@ static void combine_image_by_layout(const struct flashctx *const flashctx,
memcpy(newcontents + start, oldcontents + start, copy_len);
}
-/**
- * @brief Write the specified image to the ROM chip.
- *
- * If a layout is set in the specified flash context, only erase blocks
- * containing included regions will be touched.
- *
- * @param flashctx The context of the flash chip.
- * @param buffer Source buffer to read image from (may be altered for full verification).
- * @param buffer_len Size of source buffer in bytes.
- * @param refbuffer If given, assume flash chip contains same data as `refbuffer`.
- * @return 0 on success,
- * 4 if buffer_len doesn't match the size of the flash chip,
- * 3 if write was tried but nothing has changed,
- * 2 if write failed and flash contents changed,
- * or 1 on any other failure.
- */
int flashrom_image_write(struct flashctx *const flashctx, void *const buffer, const size_t buffer_len,
const void *const refbuffer)
{
@@ -2135,20 +2085,6 @@ _free_ret:
return ret;
}
-/**
- * @brief Verify the ROM chip's contents with the specified image.
- *
- * If a layout is set in the specified flash context, only included regions
- * will be verified.
- *
- * @param flashctx The context of the flash chip.
- * @param buffer Source buffer to verify with.
- * @param buffer_len Size of source buffer in bytes.
- * @return 0 on success,
- * 3 if the chip's contents don't match,
- * 2 if buffer_len doesn't match the size of the flash chip,
- * or 1 on any other failure.
- */
int flashrom_image_verify(struct flashctx *const flashctx, const void *const buffer, const size_t buffer_len)
{
const struct flashrom_layout *const layout = get_layout(flashctx);
@@ -2179,5 +2115,3 @@ _free_ret:
free(curcontents);
return ret;
}
-
-/** @} */ /* end flashrom-ops */