Home
last modified time | relevance | path

Searched refs:rng (Results 1 – 25 of 53) sorted by relevance

123

/linux-4.19.296/drivers/char/hw_random/
Dcore.c54 static int hwrng_init(struct hwrng *rng);
57 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
65 static void add_early_randomness(struct hwrng *rng) in add_early_randomness() argument
71 bytes_read = rng_get_data(rng, rng_buffer, size, 0); in add_early_randomness()
79 struct hwrng *rng = container_of(kref, struct hwrng, ref); in cleanup_rng() local
81 if (rng->cleanup) in cleanup_rng()
82 rng->cleanup(rng); in cleanup_rng()
84 complete(&rng->cleanup_done); in cleanup_rng()
87 static int set_current_rng(struct hwrng *rng) in set_current_rng() argument
93 err = hwrng_init(rng); in set_current_rng()
[all …]
DMakefile6 obj-$(CONFIG_HW_RANDOM) += rng-core.o
7 rng-core-y := core.o
8 obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o
9 obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o
10 obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o
11 obj-$(CONFIG_HW_RANDOM_ATMEL) += atmel-rng.o
12 obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o
13 obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o
14 n2-rng-y := n2-drv.o n2-asm.o
15 obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o
[all …]
Dhisi-rng.c26 #define to_hisi_rng(p) container_of(p, struct hisi_rng, rng)
34 struct hwrng rng; member
37 static int hisi_rng_init(struct hwrng *rng) in hisi_rng_init() argument
39 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_init()
60 static void hisi_rng_cleanup(struct hwrng *rng) in hisi_rng_cleanup() argument
62 struct hisi_rng *hrng = to_hisi_rng(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() argument
69 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_read()
78 struct hisi_rng *rng; in hisi_rng_probe() local
82 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in hisi_rng_probe()
[all …]
Dcavium-rng-vf.c24 static int cavium_rng_read(struct hwrng *rng, void *dat, size_t max, bool wait) in cavium_rng_read() argument
26 struct cavium_rng *p = container_of(rng, struct cavium_rng, ops); in cavium_rng_read()
46 struct cavium_rng *rng; in cavium_rng_probe_vf() local
49 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in cavium_rng_probe_vf()
50 if (!rng) in cavium_rng_probe_vf()
54 rng->result = pcim_iomap(pdev, 0, 0); in cavium_rng_probe_vf()
55 if (!rng->result) { in cavium_rng_probe_vf()
60 rng->ops.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, in cavium_rng_probe_vf()
62 if (!rng->ops.name) in cavium_rng_probe_vf()
65 rng->ops.read = cavium_rng_read; in cavium_rng_probe_vf()
[all …]
Docteon-rng.c28 static int octeon_rng_init(struct hwrng *rng) in octeon_rng_init() argument
31 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_init()
40 static void octeon_rng_cleanup(struct hwrng *rng) in octeon_rng_cleanup() argument
43 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_cleanup()
50 static int octeon_rng_data_read(struct hwrng *rng, u32 *data) in octeon_rng_data_read() argument
52 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_data_read()
62 struct octeon_rng *rng; in octeon_rng_probe() local
71 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in octeon_rng_probe()
72 if (!rng) in octeon_rng_probe()
84 rng->control_status = devm_ioremap_nocache(&pdev->dev, in octeon_rng_probe()
[all …]
Dmtk-rng.c42 #define to_mtk_rng(p) container_of(p, struct mtk_rng, rng)
47 struct hwrng rng; member
50 static int mtk_rng_init(struct hwrng *rng) in mtk_rng_init() argument
52 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_init()
67 static void mtk_rng_cleanup(struct hwrng *rng) in mtk_rng_cleanup() argument
69 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_cleanup()
79 static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) in mtk_rng_wait_ready() argument
81 struct mtk_rng *priv = to_mtk_rng(rng); 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() argument
94 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_read()
[all …]
Dcavium-rng.c29 struct cavium_rng_pf *rng; in cavium_rng_probe() local
32 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in cavium_rng_probe()
33 if (!rng) in cavium_rng_probe()
37 rng->control_status = pcim_iomap(pdev, 0, 0); in cavium_rng_probe()
38 if (!rng->control_status) { in cavium_rng_probe()
46 rng->control_status); in cavium_rng_probe()
48 pci_set_drvdata(pdev, rng); in cavium_rng_probe()
54 writeq(0, rng->control_status); in cavium_rng_probe()
67 struct cavium_rng_pf *rng; in cavium_rng_remove() local
69 rng = pci_get_drvdata(pdev); in cavium_rng_remove()
[all …]
Dstm32-rng.c40 struct hwrng rng; member
47 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in stm32_rng_read() argument
50 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_read()
54 pm_runtime_get_sync((struct device *) priv->rng.priv); in stm32_rng_read()
66 dev_err((struct device *)priv->rng.priv, in stm32_rng_read()
85 pm_runtime_mark_last_busy((struct device *) priv->rng.priv); in stm32_rng_read()
86 pm_runtime_put_sync_autosuspend((struct device *) priv->rng.priv); in stm32_rng_read()
91 static int stm32_rng_init(struct hwrng *rng) in stm32_rng_init() argument
94 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_init()
113 static void stm32_rng_cleanup(struct hwrng *rng) in stm32_rng_cleanup() argument
[all …]
Dmxc-rnga.c61 struct hwrng rng; member
66 static int mxc_rnga_data_present(struct hwrng *rng, int wait) in mxc_rnga_data_present() argument
69 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_present()
82 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) in mxc_rnga_data_read() argument
86 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_read()
105 static int mxc_rnga_init(struct hwrng *rng) in mxc_rnga_init() argument
108 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_init()
128 static void mxc_rnga_cleanup(struct hwrng *rng) in mxc_rnga_cleanup() argument
131 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_cleanup()
150 mxc_rng->rng.name = "mxc-rnga"; in mxc_rnga_probe()
[all …]
Dpic32-rng.c46 struct hwrng rng; member
57 static int pic32_rng_read(struct hwrng *rng, void *buf, size_t max, in pic32_rng_read() argument
60 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng); in pic32_rng_read()
106 priv->rng.name = pdev->name; in pic32_rng_probe()
107 priv->rng.read = pic32_rng_read; in pic32_rng_probe()
109 ret = hwrng_register(&priv->rng); in pic32_rng_probe()
124 struct pic32_rng *rng = platform_get_drvdata(pdev); in pic32_rng_remove() local
126 hwrng_unregister(&rng->rng); in pic32_rng_remove()
127 writel(0, rng->base + RNGCON); in pic32_rng_remove()
128 clk_disable_unprepare(rng->clk); in pic32_rng_remove()
Dbcm2835-rng.c34 struct hwrng rng; member
40 static inline struct bcm2835_rng_priv *to_rng_priv(struct hwrng *rng) in to_rng_priv() argument
42 return container_of(rng, struct bcm2835_rng_priv, rng); in to_rng_priv()
65 static int bcm2835_rng_read(struct hwrng *rng, void *buf, size_t max, in bcm2835_rng_read() argument
68 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_read()
88 static int bcm2835_rng_init(struct hwrng *rng) in bcm2835_rng_init() argument
90 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_init()
114 static void bcm2835_rng_cleanup(struct hwrng *rng) in bcm2835_rng_cleanup() argument
116 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_cleanup()
169 priv->rng.name = pdev->name; in bcm2835_rng_probe()
[all …]
Dtx4939-rng.c29 struct hwrng rng; member
65 static int tx4939_rng_data_present(struct hwrng *rng, int wait) in tx4939_rng_data_present() argument
67 struct tx4939_rng *rngdev = container_of(rng, struct tx4939_rng, rng); in tx4939_rng_data_present()
98 static int tx4939_rng_data_read(struct hwrng *rng, u32 *buffer) in tx4939_rng_data_read() argument
100 struct tx4939_rng *rngdev = container_of(rng, struct tx4939_rng, rng); in tx4939_rng_data_read()
121 rngdev->rng.name = dev_name(&dev->dev); in tx4939_rng_probe()
122 rngdev->rng.data_present = tx4939_rng_data_present; in tx4939_rng_probe()
123 rngdev->rng.data_read = tx4939_rng_data_read; in tx4939_rng_probe()
142 if (!tx4939_rng_data_present(&rngdev->rng, 1)) in tx4939_rng_probe()
147 return devm_hwrng_register(&dev->dev, &rngdev->rng); in tx4939_rng_probe()
Diproc-rng200.c51 struct hwrng rng; member
55 #define to_rng_priv(rng) container_of(rng, struct iproc_rng200_dev, rng) argument
94 static int iproc_rng200_read(struct hwrng *rng, void *buf, size_t max, in iproc_rng200_read() argument
97 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_read()
155 static int iproc_rng200_init(struct hwrng *rng) in iproc_rng200_init() argument
157 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_init()
169 static void iproc_rng200_cleanup(struct hwrng *rng) in iproc_rng200_cleanup() argument
171 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_cleanup()
205 priv->rng.name = "iproc-rng200", in iproc_rng200_probe()
206 priv->rng.read = iproc_rng200_read, in iproc_rng200_probe()
[all …]
Dexynos-trng.c52 struct hwrng rng; member
55 static int exynos_trng_do_read(struct hwrng *rng, void *data, size_t max, in exynos_trng_do_read() argument
63 trng = (struct exynos_trng_dev *)rng->priv; in exynos_trng_do_read()
76 static int exynos_trng_init(struct hwrng *rng) in exynos_trng_init() argument
78 struct exynos_trng_dev *trng = (struct exynos_trng_dev *)rng->priv; in exynos_trng_init()
119 trng->rng.name = devm_kstrdup(&pdev->dev, dev_name(&pdev->dev), in exynos_trng_probe()
121 if (!trng->rng.name) in exynos_trng_probe()
124 trng->rng.init = exynos_trng_init; in exynos_trng_probe()
125 trng->rng.read = exynos_trng_do_read; in exynos_trng_probe()
126 trng->rng.priv = (unsigned long) trng; in exynos_trng_probe()
[all …]
Dks-sa-rng.c92 struct hwrng rng; member
98 static int ks_sa_rng_init(struct hwrng *rng) in ks_sa_rng_init() argument
101 struct device *dev = (struct device *)rng->priv; in ks_sa_rng_init()
134 static void ks_sa_rng_cleanup(struct hwrng *rng) in ks_sa_rng_cleanup() argument
136 struct device *dev = (struct device *)rng->priv; in ks_sa_rng_cleanup()
145 static int ks_sa_rng_data_read(struct hwrng *rng, u32 *data) in ks_sa_rng_data_read() argument
147 struct device *dev = (struct device *)rng->priv; 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() argument
161 struct device *dev = (struct device *)rng->priv; in ks_sa_rng_data_present()
192 ks_sa_rng->rng = (struct hwrng) { in ks_sa_rng_probe()
[all …]
Dpasemi-rng.c46 static int pasemi_rng_data_present(struct hwrng *rng, int wait) in pasemi_rng_data_present() argument
48 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_data_present()
61 static int pasemi_rng_data_read(struct hwrng *rng, u32 *data) in pasemi_rng_data_read() argument
63 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_data_read()
68 static int pasemi_rng_init(struct hwrng *rng) in pasemi_rng_init() argument
70 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_init()
80 static void pasemi_rng_cleanup(struct hwrng *rng) in pasemi_rng_cleanup() argument
82 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_cleanup()
Dmeson-rng.c72 struct hwrng rng; member
76 static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in meson_rng_read() argument
79 container_of(rng, struct meson_rng_data, rng); in meson_rng_read()
123 data->rng.name = pdev->name; in meson_rng_probe()
124 data->rng.read = meson_rng_read; in meson_rng_probe()
128 return devm_hwrng_register(dev, &data->rng); in meson_rng_probe()
Datmel-rng.c28 struct hwrng rng; member
31 static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, in atmel_trng_read() argument
34 struct atmel_trng *trng = container_of(rng, struct atmel_trng, rng); in atmel_trng_read()
86 trng->rng.name = pdev->name; in atmel_trng_probe()
87 trng->rng.read = atmel_trng_read; in atmel_trng_probe()
89 ret = hwrng_register(&trng->rng); in atmel_trng_probe()
107 hwrng_unregister(&trng->rng); in atmel_trng_remove()
Dimx-rngc.c59 struct hwrng rng; member
122 static int imx_rngc_read(struct hwrng *rng, void *data, size_t max, bool wait) in imx_rngc_read() argument
124 struct imx_rngc *rngc = container_of(rng, struct imx_rngc, rng); in imx_rngc_read()
173 static int imx_rngc_init(struct hwrng *rng) in imx_rngc_init() argument
175 struct imx_rngc *rngc = container_of(rng, struct imx_rngc, rng); in imx_rngc_init()
243 rngc->rng.name = pdev->name; in imx_rngc_probe()
244 rngc->rng.init = imx_rngc_init; in imx_rngc_probe()
245 rngc->rng.read = imx_rngc_read; in imx_rngc_probe()
260 ret = hwrng_register(&rngc->rng); in imx_rngc_probe()
279 hwrng_unregister(&rngc->rng); in imx_rngc_remove()
Domap-rng.c158 struct hwrng rng; member
175 static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max, in omap_rng_do_read() argument
181 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_do_read()
205 static int omap_rng_init(struct hwrng *rng) in omap_rng_init() argument
209 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_init()
213 static void omap_rng_cleanup(struct hwrng *rng) in omap_rng_cleanup() argument
217 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_cleanup()
450 priv->rng.read = omap_rng_do_read; in omap_rng_probe()
451 priv->rng.init = omap_rng_init; in omap_rng_probe()
452 priv->rng.cleanup = omap_rng_cleanup; in omap_rng_probe()
[all …]
Damd-rng.c61 static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in amd_rng_read() argument
64 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_read()
94 static int amd_rng_init(struct hwrng *rng) in amd_rng_init() argument
96 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_init()
110 static void amd_rng_cleanup(struct hwrng *rng) in amd_rng_cleanup() argument
112 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_cleanup()
Dvia-rng.c87 static int via_rng_data_present(struct hwrng *rng, int wait) in via_rng_data_present() argument
116 rng->priv = *via_rng_datum; in via_rng_data_present()
120 static int via_rng_data_read(struct hwrng *rng, u32 *data) in via_rng_data_read() argument
122 u32 via_rng_datum = (u32)rng->priv; in via_rng_data_read()
129 static int via_rng_init(struct hwrng *rng) in via_rng_init() argument
/linux-4.19.296/crypto/
Djitterentropy-kcapi.c126 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_init() local
129 rng->entropy_collector = jent_entropy_collector_alloc(1, 0); in jent_kcapi_init()
130 if (!rng->entropy_collector) in jent_kcapi_init()
133 spin_lock_init(&rng->jent_lock); in jent_kcapi_init()
139 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_cleanup() local
141 spin_lock(&rng->jent_lock); in jent_kcapi_cleanup()
142 if (rng->entropy_collector) in jent_kcapi_cleanup()
143 jent_entropy_collector_free(rng->entropy_collector); in jent_kcapi_cleanup()
144 rng->entropy_collector = NULL; in jent_kcapi_cleanup()
145 spin_unlock(&rng->jent_lock); in jent_kcapi_cleanup()
[all …]
Drng.c124 struct crypto_rng *rng; in crypto_get_default_rng() local
129 rng = crypto_alloc_rng("stdrng", 0, 0); in crypto_get_default_rng()
130 err = PTR_ERR(rng); in crypto_get_default_rng()
131 if (IS_ERR(rng)) in crypto_get_default_rng()
134 err = crypto_rng_reset(rng, NULL, crypto_rng_seedsize(rng)); in crypto_get_default_rng()
136 crypto_free_rng(rng); in crypto_get_default_rng()
140 crypto_default_rng = rng; in crypto_get_default_rng()
/linux-4.19.296/include/linux/
Dhw_random.h40 int (*init)(struct hwrng *rng);
41 void (*cleanup)(struct hwrng *rng);
42 int (*data_present)(struct hwrng *rng, int wait);
43 int (*data_read)(struct hwrng *rng, u32 *data);
44 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait);
57 extern int hwrng_register(struct hwrng *rng);
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);

123