Searched refs:rng (Results 1 - 25 of 168) sorted by relevance

1234567

/linux-master/arch/powerpc/platforms/microwatt/
H A DMakefile1 obj-y += setup.o rng.o
/linux-master/include/linux/
H A Dhw_random.h41 int (*init)(struct hwrng *rng);
42 void (*cleanup)(struct hwrng *rng);
43 int (*data_present)(struct hwrng *rng, int wait);
44 int (*data_read)(struct hwrng *rng, u32 *data);
45 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait);
59 extern int hwrng_register(struct hwrng *rng);
60 extern int devm_hwrng_register(struct device *dev, struct hwrng *rng);
62 extern void hwrng_unregister(struct hwrng *rng);
63 extern void devm_hwrng_unregister(struct device *dve, struct hwrng *rng);
65 extern long hwrng_msleep(struct hwrng *rng, unsigne
[all...]
/linux-master/drivers/crypto/
H A Dexynos-rng.c3 * exynos-rng.c - Random Number Generator driver for the Exynos
7 * Loosely based on old driver from drivers/char/hw_random/exynos-rng.c:
21 #include <crypto/internal/rng.h>
66 struct exynos_rng_dev *rng; member in struct:exynos_rng_ctx
87 static u32 exynos_rng_readl(struct exynos_rng_dev *rng, u32 offset) argument
89 return readl_relaxed(rng->mem + offset);
92 static void exynos_rng_writel(struct exynos_rng_dev *rng, u32 val, u32 offset) argument
94 writel_relaxed(val, rng->mem + offset);
97 static int exynos_rng_set_seed(struct exynos_rng_dev *rng, argument
117 exynos_rng_writel(rng, va
140 exynos_rng_get_random(struct exynos_rng_dev *rng, u8 *dst, unsigned int dlen, unsigned int *read) argument
172 exynos_rng_reseed(struct exynos_rng_dev *rng) argument
199 struct exynos_rng_dev *rng = ctx->rng; local
229 struct exynos_rng_dev *rng = ctx->rng; local
270 struct exynos_rng_dev *rng; local
318 struct exynos_rng_dev *rng = dev_get_drvdata(dev); local
348 struct exynos_rng_dev *rng = dev_get_drvdata(dev); local
[all...]
H A Dqcom-rng.c4 // Based on msm-rng.c and downstream driver
6 #include <crypto/internal/rng.h>
43 struct qcom_rng *rng; member in struct:qcom_rng_ctx
53 static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max) argument
61 ret = readl_poll_timeout(rng->base + PRNG_STATUS, val,
67 val = readl_relaxed(rng->base + PRNG_DATA_OUT);
90 struct qcom_rng *rng = ctx->rng; local
93 ret = clk_prepare_enable(rng->clk);
97 mutex_lock(&rng
123 qcom_rng_enable(struct qcom_rng *rng) argument
181 struct qcom_rng *rng; local
[all...]
/linux-master/drivers/char/hw_random/
H A 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_BA431) += ba431-rng.o
13 obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o
14 obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o
15 n2-rng
[all...]
H A Dhisi-rng.c23 #define to_hisi_rng(p) container_of(p, struct hisi_rng, rng)
31 struct hwrng rng; member in struct:hisi_rng
34 static int hisi_rng_init(struct hwrng *rng) argument
36 struct hisi_rng *hrng = to_hisi_rng(rng);
57 static void hisi_rng_cleanup(struct hwrng *rng) argument
59 struct hisi_rng *hrng = to_hisi_rng(rng);
64 static int hisi_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
66 struct hisi_rng *hrng = to_hisi_rng(rng);
75 struct hisi_rng *rng; local
78 rng
[all...]
H A Dcavium-rng.c26 struct cavium_rng_pf *rng; local
29 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL);
30 if (!rng)
34 rng->control_status = pcim_iomap(pdev, 0, 0);
35 if (!rng->control_status) {
43 rng->control_status);
45 pci_set_drvdata(pdev, rng);
51 writeq(0, rng->control_status);
64 struct cavium_rng_pf *rng; local
[all...]
H A Dcore.c34 /* the current rng has been explicitly chosen by user via sysfs */
41 /* Protects rng read functions, data_avail, rng_buffer and rng_fillbuf */
56 static int hwrng_init(struct hwrng *rng);
59 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
67 static void add_early_randomness(struct hwrng *rng) argument
72 bytes_read = rng_get_data(rng, rng_fillbuf, 32, 0);
75 size_t entropy = bytes_read * 8 * rng->quality / 1024;
82 struct hwrng *rng = container_of(kref, struct hwrng, ref); local
84 if (rng->cleanup)
85 rng
90 set_current_rng(struct hwrng *rng) argument
137 struct hwrng *rng; local
148 put_rng(struct hwrng *rng) argument
160 hwrng_init(struct hwrng *rng) argument
193 rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, int wait) argument
219 struct hwrng *rng; local
313 struct hwrng *rng, *new_rng = NULL; local
343 struct hwrng *rng, *old_rng, *new_rng; local
379 struct hwrng *rng; local
396 struct hwrng *rng; local
424 struct hwrng *rng; local
507 struct hwrng *rng; local
543 hwrng_register(struct hwrng *rng) argument
603 hwrng_unregister(struct hwrng *rng) argument
654 devm_hwrng_register(struct device *dev, struct hwrng *rng) argument
675 devm_hwrng_unregister(struct device *dev, struct hwrng *rng) argument
681 hwrng_msleep(struct hwrng *rng, unsigned int msecs) argument
689 hwrng_yield(struct hwrng *rng) argument
[all...]
H A Dcavium-rng-vf.c82 static int check_rng_health(struct cavium_rng *rng) argument
90 if (!rng->pf_regbase)
93 status = readq(rng->pf_regbase + HEALTH_STATUS_REG);
95 dev_err(&rng->pdev->dev, "HWRNG: Startup health test failed\n");
110 cur_err = (cycles * 1000000000) / rng->clock_rate; /* In nanosec */
116 rng->prev_error = 0;
117 rng->prev_time = 0;
121 if (rng->prev_error) {
125 time_elapsed = (cur_time - rng->prev_time) * 10;
126 time_elapsed += rng
146 cavium_rng_read(struct hwrng *rng, void *dat, size_t max, bool wait) argument
169 cavium_map_pf_regs(struct cavium_rng *rng) argument
206 struct cavium_rng *rng; local
248 struct cavium_rng *rng; local
[all...]
H A Docteon-rng.c28 static int octeon_rng_init(struct hwrng *rng) argument
31 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops);
40 static void octeon_rng_cleanup(struct hwrng *rng) argument
43 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops);
50 static int octeon_rng_data_read(struct hwrng *rng, u32 *data) argument
52 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops);
62 struct octeon_rng *rng; local
71 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL);
72 if (!rng)
[all...]
H A Dcn10k-rng.c69 static unsigned long reset_rng_health_state(struct cn10k_rng *rng) argument
78 static int check_rng_health(struct cn10k_rng *rng) argument
84 if (!rng->reg_base)
87 status = readq(rng->reg_base + RNM_PF_EBG_HEALTH);
89 err = reset_rng_health_state(rng);
91 dev_err(&rng->pdev->dev, "HWRNG: Health test failed (status=%llx)\n",
93 dev_err(&rng->pdev->dev, "HWRNG: error during reset (error=%lx)\n",
102 static bool cn10k_read_trng(struct cn10k_rng *rng, u64 *value) argument
108 if (rng->extended_trng_regs) {
110 *value = readq(rng
140 struct cn10k_rng *rng = (struct cn10k_rng *)hwrng->priv; local
179 struct cn10k_rng *rng; local
[all...]
H A Dingenic-rng.c36 struct hwrng rng; member in struct:ingenic_rng
39 static int ingenic_rng_init(struct hwrng *rng) argument
41 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng);
48 static void ingenic_rng_cleanup(struct hwrng *rng) argument
50 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng);
55 static int ingenic_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
57 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng);
[all...]
H A Dpic32-rng.c30 struct hwrng rng; member in struct:pic32_rng
40 static int pic32_rng_init(struct hwrng *rng) argument
42 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng);
49 static int pic32_rng_read(struct hwrng *rng, void *buf, size_t max, argument
52 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng);
70 static void pic32_rng_cleanup(struct hwrng *rng) argument
72 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng);
[all...]
H A Dingenic-trng.c32 struct hwrng rng; member in struct:ingenic_trng
35 static int ingenic_trng_init(struct hwrng *rng) argument
37 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng);
47 static void ingenic_trng_cleanup(struct hwrng *rng) argument
49 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng);
57 static int ingenic_trng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
59 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng);
[all...]
H A Dnpcm-rng.c30 #define to_npcm_rng(p) container_of(p, struct npcm_rng, rng)
34 struct hwrng rng; member in struct:npcm_rng
38 static int npcm_rng_init(struct hwrng *rng) argument
40 struct npcm_rng *priv = to_npcm_rng(rng);
47 static void npcm_rng_cleanup(struct hwrng *rng) argument
49 struct npcm_rng *priv = to_npcm_rng(rng);
54 static int npcm_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
56 struct npcm_rng *priv = to_npcm_rng(rng);
60 pm_runtime_get_sync((struct device *)priv->rng.priv);
82 pm_runtime_mark_last_busy((struct device *)priv->rng
[all...]
H A Dmtk-rng.c33 #define to_mtk_rng(p) container_of(p, struct mtk_rng, rng)
38 struct hwrng rng; member in struct:mtk_rng
41 static int mtk_rng_init(struct hwrng *rng) argument
43 struct mtk_rng *priv = to_mtk_rng(rng);
58 static void mtk_rng_cleanup(struct hwrng *rng) argument
60 struct mtk_rng *priv = to_mtk_rng(rng);
70 static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) argument
72 struct mtk_rng *priv = to_mtk_rng(rng);
83 static int mtk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
85 struct mtk_rng *priv = to_mtk_rng(rng);
[all...]
H A Dmpfs-rng.c24 struct hwrng rng; member in struct:mpfs_rng
27 static int mpfs_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) argument
29 struct mpfs_rng *rng_priv = container_of(rng, struct mpfs_rng, rng);
79 rng_priv->rng.read = mpfs_rng_read;
80 rng_priv->rng.name = pdev->name;
82 ret = devm_hwrng_register(&pdev->dev, &rng_priv->rng);
93 .name = "mpfs-rng",
H A Dmxc-rnga.c56 struct hwrng rng; member in struct:mxc_rng
61 static int mxc_rnga_data_present(struct hwrng *rng, int wait) argument
64 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng);
77 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) argument
81 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng);
100 static int mxc_rnga_init(struct hwrng *rng) argument
103 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng);
123 mxc_rnga_cleanup(struct hwrng *rng) argument
[all...]
H A Dpasemi-rng.c7 * Driver for the PWRficient onchip rng
33 static int pasemi_rng_data_present(struct hwrng *rng, int wait) argument
35 void __iomem *rng_regs = (void __iomem *)rng->priv;
48 static int pasemi_rng_data_read(struct hwrng *rng, u32 *data) argument
50 void __iomem *rng_regs = (void __iomem *)rng->priv;
55 static int pasemi_rng_init(struct hwrng *rng) argument
57 void __iomem *rng_regs = (void __iomem *)rng->priv;
67 static void pasemi_rng_cleanup(struct hwrng *rng) argument
69 void __iomem *rng_regs = (void __iomem *)rng->priv;
100 { .compatible = "1682m-rng", },
[all...]
/linux-master/arch/powerpc/platforms/powernv/
H A Drng.c6 #define pr_fmt(fmt) "powernv-rng: " fmt
32 static unsigned long rng_whiten(struct pnv_rng *rng, unsigned long val) argument
44 val ^= rng->mask;
47 rng->mask = (rng->mask << 1) | (parity & 1);
86 struct pnv_rng *rng; local
89 rng = get_cpu_var(pnv_rng);
90 *v = rng_whiten(rng, in_be64(rng->regs));
91 put_cpu_var(rng);
100 rng_init_per_cpu(struct pnv_rng *rng, struct device_node *dn) argument
119 struct pnv_rng *rng; local
[all...]
/linux-master/drivers/crypto/amcc/
H A Dcrypto4xx_trng.c28 static int ppc4xx_trng_data_present(struct hwrng *rng, int wait) argument
30 struct crypto4xx_device *dev = (void *)rng->priv;
45 static int ppc4xx_trng_data_read(struct hwrng *rng, u32 *data) argument
47 struct crypto4xx_device *dev = (void *)rng->priv;
65 { .compatible = "ppc4xx-rng", },
66 { .compatible = "amcc,ppc460ex-rng", },
67 { .compatible = "amcc,ppc440epx-rng", },
75 struct hwrng *rng = NULL; local
90 rng = kzalloc(sizeof(*rng), GFP_KERNE
[all...]
/linux-master/drivers/crypto/caam/
H A Dcaamrng.c36 /* rng per-device context */
38 struct hwrng rng; member in struct:caam_rng_ctx
78 print_hex_dump_debug("rng job desc@: ", DUMP_PREFIX_ADDRESS,
147 static int caam_read(struct hwrng *rng, void *dst, size_t max, bool wait) argument
149 struct caam_rng_ctx *ctx = to_caam_rng_ctx(rng);
166 static void caam_cleanup(struct hwrng *rng) argument
168 struct caam_rng_ctx *ctx = to_caam_rng_ctx(rng);
176 static inline void test_len(struct hwrng *rng, size_t len, bool wait) argument
180 struct caam_rng_ctx *ctx = to_caam_rng_ctx(rng);
186 read_len = rng
205 test_mode_once(struct hwrng *rng, bool wait) argument
212 self_test(struct hwrng *rng) argument
219 caam_init(struct hwrng *rng) argument
[all...]
/linux-master/crypto/
H A Djitterentropy-kcapi.c47 #include <crypto/internal/rng.h>
203 struct jitterentropy *rng = crypto_tfm_ctx(tfm); local
205 spin_lock(&rng->jent_lock);
207 if (rng->sdesc) {
208 shash_desc_zero(rng->sdesc);
209 kfree(rng->sdesc);
211 rng->sdesc = NULL;
213 if (rng->tfm)
214 crypto_free_shash(rng->tfm);
215 rng
225 struct jitterentropy *rng = crypto_tfm_ctx(tfm); local
279 struct jitterentropy *rng = crypto_rng_ctx(tfm); local
[all...]
/linux-master/drivers/crypto/gemini/
H A DMakefile2 sl3516-ce-y += sl3516-ce-core.o sl3516-ce-cipher.o sl3516-ce-rng.o
/linux-master/drivers/firmware/efi/libstub/
H A Drandom.c43 efi_rng_protocol_t *rng = NULL; local
45 status = efi_bs_call(locate_protocol, &rng_proto, NULL, (void **)&rng);
49 return efi_call_proto(rng, get_rng, NULL, size, out);
73 efi_rng_protocol_t *rng = NULL; local
76 status = efi_bs_call(locate_protocol, &rng_proto, NULL, (void **)&rng);
113 if (rng) {
114 status = efi_call_proto(rng, get_rng, &rng_algo_raw,
122 status = efi_call_proto(rng, get_rng, NULL,

Completed in 296 milliseconds

1234567