Lines Matching defs:magic
113 * Read the magic value from @p io, and verify that it matches
114 * the @p layout's expected magic value.
116 * If @p layout does not defined a magic value, @p magic is set to 0x0
121 * @param[out] magic On success, the SPROM magic value.
129 const bhnd_sprom_layout *layout, uint16_t *magic)
133 /* Skip if layout does not define a magic value */
137 /* Read the magic value */
138 error = bhnd_nvram_io_read(io, layout->magic_offset, magic,
139 sizeof(*magic));
143 *magic = le16toh(*magic);
146 if (*magic != layout->magic_value)
186 uint16_t magic;
248 /* Check the magic value, skipping to the next layout on
250 error = bhnd_nvram_sprom_check_magic(io, layout, &magic);
256 magic, layout->magic_value);
266 /* If the magic check succeeded, then we may just have
723 * Write magic value, if any.
726 uint16_t magic;
728 magic = htole16(layout->magic_value);
729 error = bhnd_nvram_io_write(io, layout->magic_offset, &magic,
730 sizeof(magic));
732 BHND_NV_LOG("error writing magic value: %d\n", error);