/* * Broadcom BCM963xx SoC board nvram data structure. * * The nvram structure varies in size depending on the SoC board version. Use * the appropriate minimum BCM963XX_NVRAM_*_SIZE define for the information * you need instead of sizeof(struct bcm963xx_nvram) as this may change.
*/
/* * bcm963xx_nvram_checksum - Verify nvram checksum * * @nvram: pointer to full size nvram data structure * @expected_out: optional pointer to store expected checksum value * @actual_out: optional pointer to store actual checksum value * * Return: 0 if the checksum is valid, otherwise -EINVAL
*/ staticint __maybe_unused bcm963xx_nvram_checksum( conststruct bcm963xx_nvram *nvram,
u32 *expected_out, u32 *actual_out)
{ const u32 zero = 0;
u32 expected, actual;
size_t len;
if (nvram->version <= 4) {
expected = nvram->checksum_v4;
len = BCM963XX_NVRAM_V4_SIZE;
} else {
expected = nvram->checksum_v5;
len = BCM963XX_NVRAM_V5_SIZE;
}
/* Calculate the CRC32 of the nvram with the checksum field set to 0. */
actual = crc32_le(~0, nvram, len - sizeof(u32));
actual = crc32_le(actual, &zero, sizeof(u32));
if (expected_out)
*expected_out = expected;
if (actual_out)
*actual_out = actual;
return expected == actual ? 0 : -EINVAL;
};
#endif/* __LINUX_BCM963XX_NVRAM_H__ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.