1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2019, Linaro Limited
12 * dm_rng_read() - read a random number seed from the rng device
14 * The function blocks until the requested number of bytes is read.
16 * @dev: random number generator device
17 * @buffer: input buffer to put the read random seed into
18 * @size: number of random bytes to read
19 * Return: 0 if OK, -ve on error
21 int dm_rng_read(struct udevice *dev, void *buffer, size_t size);
24 * struct dm_rng_ops - operations for the hwrng uclass
26 * This structures contains the function implemented by a hardware random
27 * number generation device.
31 * @read: read a random bytes
33 * The function blocks until the requested number of bytes is read.
35 * @read.dev: random number generator device
36 * @read.data: input buffer to read the random seed into
37 * @read.max: number of random bytes to read
38 * @read.Return: 0 if OK, -ve on error
40 int (*read)(struct udevice *dev, void *data, size_t max);