Home
last modified time | relevance | path

Searched refs:hwrng (Results 1 – 25 of 73) sorted by relevance

123

/Linux-v4.19/include/linux/
Dhw_random.h38 struct hwrng { struct
40 int (*init)(struct hwrng *rng); argument
41 void (*cleanup)(struct hwrng *rng); argument
42 int (*data_present)(struct hwrng *rng, int wait); argument
43 int (*data_read)(struct hwrng *rng, u32 *data); argument
44 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait); argument
57 extern int hwrng_register(struct hwrng *rng); argument
58 extern int devm_hwrng_register(struct device *dev, struct hwrng *rng);
60 extern void hwrng_unregister(struct hwrng *rng);
61 extern void devm_hwrng_unregister(struct device *dve, struct hwrng *rng);
/Linux-v4.19/drivers/char/hw_random/
Dcore.c30 static struct hwrng *current_rng;
53 static int hwrng_init(struct hwrng *rng);
56 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
64 static void add_early_randomness(struct hwrng *rng) in add_early_randomness()
78 struct hwrng *rng = container_of(kref, struct hwrng, ref); in cleanup_rng()
86 static int set_current_rng(struct hwrng *rng) in set_current_rng()
114 static struct hwrng *get_current_rng(void) in get_current_rng()
116 struct hwrng *rng; in get_current_rng()
129 static void put_rng(struct hwrng *rng) in put_rng()
141 static int hwrng_init(struct hwrng *rng) in hwrng_init()
[all …]
Dvirtio-rng.c31 struct hwrng hwrng; member
66 static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) in virtio_read()
92 static void virtio_cleanup(struct hwrng *rng) in virtio_cleanup()
117 vi->hwrng = (struct hwrng) { in probe_common()
152 hwrng_unregister(&vi->hwrng); in remove_common()
173 err = hwrng_register(&vi->hwrng); in virtrng_scan()
199 err = hwrng_register(&vi->hwrng); in virtrng_restore()
Docteon-rng.c23 struct hwrng ops;
28 static int octeon_rng_init(struct hwrng *rng) in octeon_rng_init()
40 static void octeon_rng_cleanup(struct hwrng *rng) in octeon_rng_cleanup()
50 static int octeon_rng_data_read(struct hwrng *rng, u32 *data) in octeon_rng_data_read()
64 struct hwrng ops = { in octeon_rng_probe()
Dpasemi-rng.c46 static int pasemi_rng_data_present(struct hwrng *rng, int wait) in pasemi_rng_data_present()
61 static int pasemi_rng_data_read(struct hwrng *rng, u32 *data) in pasemi_rng_data_read()
68 static int pasemi_rng_init(struct hwrng *rng) in pasemi_rng_init()
80 static void pasemi_rng_cleanup(struct hwrng *rng) in pasemi_rng_cleanup()
90 static struct hwrng pasemi_rng = {
Dks-sa-rng.c92 struct hwrng rng;
98 static int ks_sa_rng_init(struct hwrng *rng) in ks_sa_rng_init()
134 static void ks_sa_rng_cleanup(struct hwrng *rng) in ks_sa_rng_cleanup()
145 static int ks_sa_rng_data_read(struct hwrng *rng, u32 *data) in ks_sa_rng_data_read()
159 static int ks_sa_rng_data_present(struct hwrng *rng, int wait) in ks_sa_rng_data_present()
192 ks_sa_rng->rng = (struct hwrng) { in ks_sa_rng_probe()
Dhisi-rng.c34 struct hwrng rng;
37 static int hisi_rng_init(struct hwrng *rng) in hisi_rng_init()
60 static void hisi_rng_cleanup(struct hwrng *rng) in hisi_rng_cleanup()
67 static int hisi_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in hisi_rng_read()
Dmxc-rnga.c61 struct hwrng rng;
66 static int mxc_rnga_data_present(struct hwrng *rng, int wait) in mxc_rnga_data_present()
82 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) in mxc_rnga_data_read()
105 static int mxc_rnga_init(struct hwrng *rng) in mxc_rnga_init()
128 static void mxc_rnga_cleanup(struct hwrng *rng) in mxc_rnga_cleanup()
Dbcm2835-rng.c34 struct hwrng rng;
40 static inline struct bcm2835_rng_priv *to_rng_priv(struct hwrng *rng) in to_rng_priv()
65 static int bcm2835_rng_read(struct hwrng *rng, void *buf, size_t max, in bcm2835_rng_read()
88 static int bcm2835_rng_init(struct hwrng *rng) in bcm2835_rng_init()
114 static void bcm2835_rng_cleanup(struct hwrng *rng) in bcm2835_rng_cleanup()
Dvia-rng.c87 static int via_rng_data_present(struct hwrng *rng, int wait) in via_rng_data_present()
120 static int via_rng_data_read(struct hwrng *rng, u32 *data) in via_rng_data_read()
129 static int via_rng_init(struct hwrng *rng) in via_rng_init()
187 static struct hwrng via_rng = {
Dmtk-rng.c47 struct hwrng rng;
50 static int mtk_rng_init(struct hwrng *rng) in mtk_rng_init()
67 static void mtk_rng_cleanup(struct hwrng *rng) in mtk_rng_cleanup()
79 static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) in mtk_rng_wait_ready()
92 static int mtk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in mtk_rng_read()
Dgeode-rng.c55 static int geode_rng_data_read(struct hwrng *rng, u32 *data) in geode_rng_data_read()
64 static int geode_rng_data_present(struct hwrng *rng, int wait) in geode_rng_data_present()
79 static struct hwrng geode_rng = {
Damd-rng.c61 static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in amd_rng_read()
94 static int amd_rng_init(struct hwrng *rng) in amd_rng_init()
110 static void amd_rng_cleanup(struct hwrng *rng) in amd_rng_cleanup()
120 static struct hwrng amd_rng = {
Dtimeriomem-rng.c44 struct hwrng rng_ops;
47 static int timeriomem_rng_read(struct hwrng *hwrng, void *data, in timeriomem_rng_read() argument
51 container_of(hwrng, struct timeriomem_rng_private, rng_ops); in timeriomem_rng_read()
Dintel-rng.c167 static int intel_rng_data_present(struct hwrng *rng, int wait) in intel_rng_data_present()
182 static int intel_rng_data_read(struct hwrng *rng, u32 *data) in intel_rng_data_read()
191 static int intel_rng_init(struct hwrng *rng) in intel_rng_init()
210 static void intel_rng_cleanup(struct hwrng *rng) in intel_rng_cleanup()
223 static struct hwrng intel_rng = {
Diproc-rng200.c51 struct hwrng rng;
94 static int iproc_rng200_read(struct hwrng *rng, void *buf, size_t max, in iproc_rng200_read()
155 static int iproc_rng200_init(struct hwrng *rng) in iproc_rng200_init()
169 static void iproc_rng200_cleanup(struct hwrng *rng) in iproc_rng200_cleanup()
Dstm32-rng.c40 struct hwrng rng;
47 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in stm32_rng_read()
91 static int stm32_rng_init(struct hwrng *rng) in stm32_rng_init()
113 static void stm32_rng_cleanup(struct hwrng *rng) in stm32_rng_cleanup()
Dixp4xx-rng.c29 static int ixp4xx_rng_data_read(struct hwrng *rng, u32 *buffer) in ixp4xx_rng_data_read()
38 static struct hwrng ixp4xx_rng_ops = {
Dtx4939-rng.c29 struct hwrng rng;
65 static int tx4939_rng_data_present(struct hwrng *rng, int wait) in tx4939_rng_data_present()
98 static int tx4939_rng_data_read(struct hwrng *rng, u32 *buffer) in tx4939_rng_data_read()
Dpowernv-rng.c19 static int powernv_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in powernv_rng_read()
35 static struct hwrng powernv_hwrng = {
Dpseries-rng.c28 static int pseries_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in pseries_rng_read()
58 static struct hwrng pseries_rng = {
/Linux-v4.19/drivers/usb/misc/
Dchaoskey.c27 static int chaoskey_rng_read(struct hwrng *rng, void *data,
87 struct hwrng hwrng; /* Embedded struct for hwrng */ member
200 dev->hwrng.name = dev->name ? dev->name : chaoskey_driver.name; in chaoskey_probe()
201 dev->hwrng.read = chaoskey_rng_read; in chaoskey_probe()
202 dev->hwrng.quality = 1024; in chaoskey_probe()
204 dev->hwrng_registered = (hwrng_register(&dev->hwrng) == 0); in chaoskey_probe()
231 hwrng_unregister(&dev->hwrng); in chaoskey_disconnect()
474 static int chaoskey_rng_read(struct hwrng *rng, void *data, in chaoskey_rng_read()
477 struct chaoskey *dev = container_of(rng, struct chaoskey, hwrng); in chaoskey_rng_read()
/Linux-v4.19/drivers/char/tpm/
Dtpm-chip.c420 static int tpm_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait) in tpm_hwrng_read()
422 struct tpm_chip *chip = container_of(rng, struct tpm_chip, hwrng); in tpm_hwrng_read()
434 chip->hwrng.name = chip->hwrng_name; in tpm_add_hwrng()
435 chip->hwrng.read = tpm_hwrng_read; in tpm_add_hwrng()
436 return hwrng_register(&chip->hwrng); in tpm_add_hwrng()
489 hwrng_unregister(&chip->hwrng); in tpm_chip_register()
514 hwrng_unregister(&chip->hwrng); in tpm_chip_unregister()
/Linux-v4.19/drivers/crypto/amcc/
Dcrypto4xx_trng.c31 static int ppc4xx_trng_data_present(struct hwrng *rng, int wait) in ppc4xx_trng_data_present()
48 static int ppc4xx_trng_data_read(struct hwrng *rng, u32 *data) in ppc4xx_trng_data_read()
78 struct hwrng *rng = NULL; in ppc4xx_trng_probe()
/Linux-v4.19/drivers/crypto/ccp/
Dccp-dev.c170 ccp->hwrng.name = ccp->rngname; in ccp_register_rng()
171 ccp->hwrng.read = ccp_trng_read; in ccp_register_rng()
172 ret = hwrng_register(&ccp->hwrng); in ccp_register_rng()
181 if (ccp->hwrng.name) in ccp_unregister_rng()
182 hwrng_unregister(&ccp->hwrng); in ccp_unregister_rng()
488 int ccp_trng_read(struct hwrng *rng, void *data, size_t max, bool wait) in ccp_trng_read()
490 struct ccp_device *ccp = container_of(rng, struct ccp_device, hwrng); in ccp_trng_read()

123