Lines Matching full:rng
23 /* Read data from the RNG unit */
24 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()
42 /* Map Cavium RNG to an HWRNG object */
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()
53 /* Map the RNG result */ 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()
61 "cavium-rng-%s", dev_name(&pdev->dev)); 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()
66 rng->ops.quality = 1000; in cavium_rng_probe_vf()
68 pci_set_drvdata(pdev, rng); in cavium_rng_probe_vf()
70 ret = devm_hwrng_register(&pdev->dev, &rng->ops); in cavium_rng_probe_vf()