if (!wait && !completion_done(&mcu->trng_entropy_ready)) return 0;
do { if (wait_for_completion_interruptible(&mcu->trng_entropy_ready)) return -ERESTARTSYS;
err = omnia_cmd_read(mcu->client,
OMNIA_CMD_TRNG_COLLECT_ENTROPY,
reply, sizeof(reply)); if (err) return err;
bytes = min3(reply[0], max, OMNIA_CMD_TRNG_MAX_ENTROPY_LEN);
} while (wait && !bytes);
memcpy(data, &reply[1], bytes);
return bytes;
}
int omnia_mcu_register_trng(struct omnia_mcu *mcu)
{ struct device *dev = &mcu->client->dev;
u8 dummy; int err;
if (!(mcu->features & OMNIA_FEAT_TRNG)) return 0;
/* * If someone else cleared the TRNG interrupt but did not read the * entropy, a new interrupt won't be generated, and entropy collection * will be stuck. Ensure an interrupt will be generated by executing * the collect entropy command (and discarding the result).
*/
err = omnia_cmd_read(mcu->client, OMNIA_CMD_TRNG_COLLECT_ENTROPY,
&dummy, 1); if (err) return err;
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.