Lines Matching refs:sc
24 static int ath9k_rng_data_read(struct ath_softc *sc, u32 *buf, u32 buf_size)
27 u32 v1, v2, rng_last = sc->rng_last;
28 struct ath_hw *ah = sc->sc_ah;
30 ath9k_ps_wakeup(sc);
48 ath9k_ps_restore(sc);
50 sc->rng_last = rng_last;
71 struct ath_softc *sc = container_of(rng, struct ath_softc, rng_ops);
77 bytes_read = ath9k_rng_data_read(sc, buf, max >> 2);
78 if ((max & 3UL) && ath9k_rng_data_read(sc, &word, 1)) {
95 void ath9k_rng_start(struct ath_softc *sc)
98 struct ath_hw *ah = sc->sc_ah;
100 if (sc->rng_ops.read)
106 snprintf(sc->rng_name, sizeof(sc->rng_name), "ath9k_%u",
108 sc->rng_ops.name = sc->rng_name;
109 sc->rng_ops.read = ath9k_rng_read;
110 sc->rng_ops.quality = 320;
112 if (devm_hwrng_register(sc->dev, &sc->rng_ops))
113 sc->rng_ops.read = NULL;
116 void ath9k_rng_stop(struct ath_softc *sc)
118 if (sc->rng_ops.read) {
119 devm_hwrng_unregister(sc->dev, &sc->rng_ops);
120 sc->rng_ops.read = NULL;