Skip to contentSkip to conversation

random: Document add_hwgenerator_randomness() with other input functions

PATCH In review Mark Brown 2 participants 2 messages Jan 24, 2020 Random number driver

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 random: Document add_hwgenerator_randomness() with other input functions

The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it.

---
 drivers/char/random.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/char/random.c +8 -0
index c7f9584de2c8..16070c36add3 100644
@@ -228,6 +228,14 @@
  * particular randomness source.  They do this by keeping track of the
  * first and second order deltas of the event timings.
  *
+ * There is also an interface for true hardware RNGs:
+ *
+ *	void add_hwgenerator_randomness(const char *buffer, size_t count,
+ *				size_t entropy);
+ *
+ * This will credit entropy as specified by the caller, if the entropy
+ * pool is full it will block until more entropy is needed.
+ *
  * Ensuring unpredictability at system startup
  * ============================================
  *
Signature · 1 line
2.20.1
#1 lore raw
Quoted 14 lines · Mark Brown

The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it.

---
 drivers/char/random.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/char/random.c +0 -0
index c7f9584de2c8..16070c36add3 100644

drivers/char/random.c line 236

Quoted 9 lines
drivers/char/random.c +6 -0
@@ -228,6 +228,14 @@
  * particular randomness source.  They do this by keeping track of the
  * first and second order deltas of the event timings.
  *
+ * There is also an interface for true hardware RNGs:
+ *
+ *	void add_hwgenerator_randomness(const char *buffer, size_t count,
+ *				size_t entropy);
+ *
+ * This will credit entropy as specified by the caller, if the entropy

Not a comma there. Either a ';' or "caller. If ..."

drivers/char/random.c line 241

Quoted 6 lines
drivers/char/random.c +2 -0
+ * pool is full it will block until more entropy is needed.
+ *
  * Ensuring unpredictability at system startup
  * ============================================
  *

thanks.

Signature · 1 line
~Randy