summaryrefslogtreecommitdiffstats
path: root/include/linux/hw_random.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hw_random.h')
-rw-r--r--include/linux/hw_random.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 116afd9721..ff6d3bb582 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -14,6 +14,7 @@
#define LINUX_HWRANDOM_H_
#include <linux/list.h>
+#include <driver.h>
/**
* struct hwrng - Hardware Random Number Generator driver
@@ -30,20 +31,30 @@ struct hwrng {
struct list_head list;
struct cdev cdev;
- struct device_d *dev;
+ struct device *dev;
void *buf;
+ unsigned long priv;
};
/* Register a new Hardware Random Number Generator driver. */
-int hwrng_register(struct device_d *dev, struct hwrng *rng);
-int hwrng_get_data(struct hwrng *rng, void *buffer, size_t size, int wait);
+int hwrng_register(struct device *dev, struct hwrng *rng);
#ifdef CONFIG_HWRNG
struct hwrng *hwrng_get_first(void);
+int hwrng_get_data(struct hwrng *rng, void *buffer, size_t size, int wait);
#else
static inline struct hwrng *hwrng_get_first(void) { return ERR_PTR(-ENODEV); };
+static inline int hwrng_get_data(struct hwrng *rng, void *buffer, size_t size, int wait)
+{
+ return -ENODEV;
+}
#endif
void hwrng_unregister(struct hwrng *rng);
+static inline long hwrng_yield(struct hwrng *rng)
+{
+ return 0;
+}
+
#endif /* LINUX_HWRANDOM_H_ */