Home
last modified time | relevance | path

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

1234

/drivers/char/hw_random/
Dcore.c74 static int hwrng_init(struct hwrng *rng);
77 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
85 static void add_early_randomness(struct hwrng *rng) in add_early_randomness() argument
91 bytes_read = rng_get_data(rng, rng_buffer, size, 0); in add_early_randomness()
99 struct hwrng *rng = container_of(kref, struct hwrng, ref); in cleanup_rng() local
101 if (rng->cleanup) in cleanup_rng()
102 rng->cleanup(rng); in cleanup_rng()
104 complete(&rng->cleanup_done); in cleanup_rng()
107 static int set_current_rng(struct hwrng *rng) in set_current_rng() argument
113 err = hwrng_init(rng); in set_current_rng()
[all …]
DMakefile5 obj-$(CONFIG_HW_RANDOM) += rng-core.o
6 rng-core-y := core.o
7 obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o
8 obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o
9 obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o
10 obj-$(CONFIG_HW_RANDOM_ATMEL) += atmel-rng.o
11 obj-$(CONFIG_HW_RANDOM_BCM63XX) += bcm63xx-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
[all …]
Dmsm-rng.c48 struct msm_rng *rng = to_msm_rng(hwrng); in msm_rng_enable() local
52 ret = clk_prepare_enable(rng->clk); in msm_rng_enable()
58 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
62 val = readl_relaxed(rng->base + PRNG_LFSR_CFG); in msm_rng_enable()
65 writel(val, rng->base + PRNG_LFSR_CFG); in msm_rng_enable()
67 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
69 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable()
71 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
73 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable()
77 clk_disable_unprepare(rng->clk); in msm_rng_enable()
[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 …]
Dbcm63xx-rng.c27 struct hwrng rng; member
32 #define to_rng_priv(rng) container_of(rng, struct bcm63xx_rng_priv, rng) argument
34 static int bcm63xx_rng_init(struct hwrng *rng) in bcm63xx_rng_init() argument
36 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_init()
51 static void bcm63xx_rng_cleanup(struct hwrng *rng) in bcm63xx_rng_cleanup() argument
53 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_cleanup()
63 static int bcm63xx_rng_data_present(struct hwrng *rng, int wait) in bcm63xx_rng_data_present() argument
65 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_data_present()
70 static int bcm63xx_rng_data_read(struct hwrng *rng, u32 *data) in bcm63xx_rng_data_read() argument
72 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_data_read()
[all …]
Dstm32-rng.c47 struct hwrng rng; member
53 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in stm32_rng_read() argument
56 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_read()
60 pm_runtime_get_sync((struct device *) priv->rng.priv); in stm32_rng_read()
88 pm_runtime_mark_last_busy((struct device *) priv->rng.priv); in stm32_rng_read()
89 pm_runtime_put_sync_autosuspend((struct device *) priv->rng.priv); in stm32_rng_read()
94 static int stm32_rng_init(struct hwrng *rng) in stm32_rng_init() argument
97 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_init()
112 static void stm32_rng_cleanup(struct hwrng *rng) in stm32_rng_cleanup() argument
115 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_cleanup()
[all …]
Dmxc-rnga.c64 struct hwrng rng; member
69 static int mxc_rnga_data_present(struct hwrng *rng, int wait) in mxc_rnga_data_present() argument
72 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_present()
85 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) in mxc_rnga_data_read() argument
89 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_read()
108 static int mxc_rnga_init(struct hwrng *rng) in mxc_rnga_init() argument
111 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_init()
131 static void mxc_rnga_cleanup(struct hwrng *rng) in mxc_rnga_cleanup() argument
134 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_cleanup()
153 mxc_rng->rng.name = "mxc-rnga"; in mxc_rnga_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 hwrng_register(&rngdev->rng); in tx4939_rng_probe()
[all …]
Dexynos-rng.c41 struct hwrng rng; member
46 static u32 exynos_rng_readl(struct exynos_rng *rng, u32 offset) in exynos_rng_readl() argument
48 return __raw_readl(rng->mem + offset); in exynos_rng_readl()
51 static void exynos_rng_writel(struct exynos_rng *rng, u32 val, u32 offset) in exynos_rng_writel() argument
53 __raw_writel(val, rng->mem + offset); in exynos_rng_writel()
72 static int exynos_init(struct hwrng *rng) in exynos_init() argument
74 struct exynos_rng *exynos_rng = container_of(rng, in exynos_init()
75 struct exynos_rng, rng); in exynos_init()
85 static int exynos_read(struct hwrng *rng, void *buf, in exynos_read() argument
88 struct exynos_rng *exynos_rng = container_of(rng, in exynos_read()
[all …]
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 …]
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()
Datmel-rng.c27 struct hwrng rng; member
30 static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, in atmel_trng_read() argument
33 struct atmel_trng *trng = container_of(rng, struct atmel_trng, rng); in atmel_trng_read()
75 trng->rng.name = pdev->name; in atmel_trng_probe()
76 trng->rng.read = atmel_trng_read; in atmel_trng_probe()
78 ret = hwrng_register(&trng->rng); in atmel_trng_probe()
95 hwrng_unregister(&trng->rng); in atmel_trng_remove()
DKconfig12 module will be called rng-core. This provides a device
35 module will be called timeriomem-rng.
48 module will be called intel-rng.
61 module will be called amd-rng.
74 module will be called atmel-rng.
87 module will be called bcm63xx-rng
100 module will be called bcm2835-rng
126 module will be called geode-rng.
139 module will be called n2-rng.
152 module will be called via-rng.
[all …]
Damd-rng.c56 static int amd_rng_data_present(struct hwrng *rng, int wait) in amd_rng_data_present() argument
58 u32 pmbase = (u32)rng->priv; in amd_rng_data_present()
70 static int amd_rng_data_read(struct hwrng *rng, u32 *data) in amd_rng_data_read() argument
72 u32 pmbase = (u32)rng->priv; in amd_rng_data_read()
79 static int amd_rng_init(struct hwrng *rng) in amd_rng_init() argument
94 static void amd_rng_cleanup(struct hwrng *rng) in amd_rng_cleanup() argument
Dtimeriomem-rng.c48 #define to_rng_priv(rng) \ argument
49 ((struct timeriomem_rng_private_data *)rng->priv)
54 static int timeriomem_rng_data_present(struct hwrng *rng, int wait) in timeriomem_rng_data_present() argument
56 struct timeriomem_rng_private_data *priv = to_rng_priv(rng); in timeriomem_rng_data_present()
66 static int timeriomem_rng_data_read(struct hwrng *rng, u32 *data) in timeriomem_rng_data_read() argument
68 struct timeriomem_rng_private_data *priv = to_rng_priv(rng); in timeriomem_rng_data_read()
Dintel-rng.c167 static int intel_rng_data_present(struct hwrng *rng, int wait) in intel_rng_data_present() argument
169 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_present()
182 static int intel_rng_data_read(struct hwrng *rng, u32 *data) in intel_rng_data_read() argument
184 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_read()
191 static int intel_rng_init(struct hwrng *rng) in intel_rng_init() argument
193 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_init()
210 static void intel_rng_cleanup(struct hwrng *rng) in intel_rng_cleanup() argument
212 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_cleanup()
Dvia-rng.c91 static int via_rng_data_present(struct hwrng *rng, int wait) in via_rng_data_present() argument
120 rng->priv = *via_rng_datum; in via_rng_data_present()
124 static int via_rng_data_read(struct hwrng *rng, u32 *data) in via_rng_data_read() argument
126 u32 via_rng_datum = (u32)rng->priv; in via_rng_data_read()
133 static int via_rng_init(struct hwrng *rng) in via_rng_init() argument
Dgeode-rng.c55 static int geode_rng_data_read(struct hwrng *rng, u32 *data) in geode_rng_data_read() argument
57 void __iomem *mem = (void __iomem *)rng->priv; in geode_rng_data_read()
64 static int geode_rng_data_present(struct hwrng *rng, int wait) in geode_rng_data_present() argument
66 void __iomem *mem = (void __iomem *)rng->priv; in geode_rng_data_present()
Dppc4xx-rng.c31 static int ppc4xx_rng_data_present(struct hwrng *rng, int wait) in ppc4xx_rng_data_present() argument
33 void __iomem *rng_regs = (void __iomem *) rng->priv; in ppc4xx_rng_data_present()
47 static int ppc4xx_rng_data_read(struct hwrng *rng, u32 *data) in ppc4xx_rng_data_read() argument
49 void __iomem *rng_regs = (void __iomem *) rng->priv; in ppc4xx_rng_data_read()
Domap-rng.c143 static int omap_rng_data_present(struct hwrng *rng, int wait) in omap_rng_data_present() argument
148 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_data_present()
164 static int omap_rng_data_read(struct hwrng *rng, u32 *data) in omap_rng_data_read() argument
169 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_data_read()
180 static int omap_rng_init(struct hwrng *rng) in omap_rng_init() argument
184 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_init()
188 static void omap_rng_cleanup(struct hwrng *rng) in omap_rng_cleanup() argument
192 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_cleanup()
Dvirtio-rng.c66 static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) in virtio_read() argument
69 struct virtrng_info *vi = (struct virtrng_info *)rng->priv; in virtio_read()
92 static void virtio_cleanup(struct hwrng *rng) in virtio_cleanup() argument
94 struct virtrng_info *vi = (struct virtrng_info *)rng->priv; in virtio_cleanup()
Dxgene-rng.c226 static int xgene_rng_data_present(struct hwrng *rng, int wait) in xgene_rng_data_present() argument
228 struct xgene_rng_dev *ctx = (struct xgene_rng_dev *) rng->priv; in xgene_rng_data_present()
241 static int xgene_rng_data_read(struct hwrng *rng, u32 *data) in xgene_rng_data_read() argument
243 struct xgene_rng_dev *ctx = (struct xgene_rng_dev *) rng->priv; in xgene_rng_data_read()
290 static int xgene_rng_init(struct hwrng *rng) in xgene_rng_init() argument
292 struct xgene_rng_dev *ctx = (struct xgene_rng_dev *) rng->priv; in xgene_rng_init()
Dixp4xx-rng.c29 static int ixp4xx_rng_data_read(struct hwrng *rng, u32 *buffer) in ixp4xx_rng_data_read() argument
31 void __iomem * rng_base = (void __iomem *)rng->priv; in ixp4xx_rng_data_read()
/drivers/firmware/efi/libstub/
Drandom.c27 struct efi_rng_protocol *rng; in efi_get_random_bytes() local
30 (void **)&rng); in efi_get_random_bytes()
34 return rng->get_rng(rng, NULL, size, out); in efi_get_random_bytes()
/drivers/net/wireless/ath/carl9170/
Dmain.c1550 if (!IS_ACCEPTING_CMD(ar) || !ar->rng.initialized) in carl9170_rng_get()
1553 count = ARRAY_SIZE(ar->rng.cache); in carl9170_rng_get()
1563 ar->rng.cache[off + i] = buf[i]; in carl9170_rng_get()
1569 ar->rng.cache_idx = 0; in carl9170_rng_get()
1576 static int carl9170_rng_read(struct hwrng *rng, u32 *data) in carl9170_rng_read() argument
1578 struct ar9170 *ar = (struct ar9170 *)rng->priv; in carl9170_rng_read()
1582 if (ar->rng.cache_idx >= ARRAY_SIZE(ar->rng.cache)) { in carl9170_rng_read()
1590 *data = ar->rng.cache[ar->rng.cache_idx++]; in carl9170_rng_read()
1598 if (ar->rng.initialized) { in carl9170_unregister_hwrng()
1599 hwrng_unregister(&ar->rng.rng); in carl9170_unregister_hwrng()
[all …]

1234