Basically the same diff as yesterday's ubsec(4) conversion.
The code caps the interval at 10ms, so rename "sc_rnghz" to "sc_rngms"
and set it to 10ms, then replace timeout_add(9) with timeout_add_msec(9).
ok?
Index: pci/hifn7751.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/hifn7751.c,v
retrieving revision 1.178
diff -u -p -r1.178 hifn7751.c
--- pci/hifn7751.c 28 Apr 2018 15:44:59 -0000 1.178
+++ pci/hifn7751.c 10 Jan 2020 23:13:14 -0000
@@ -375,12 +375,9 @@ hifn_init_pubrng(struct hifn_softc *sc)
HIFN_RNGCFG_ENA);
sc->sc_rngfirst = 1;
- if (hz >= 100)
- sc->sc_rnghz = hz / 100;
- else
- sc->sc_rnghz = 1;
+ sc->sc_rngms = 10;
timeout_set(&sc->sc_rngto, hifn_rng, sc);
- timeout_add(&sc->sc_rngto, sc->sc_rnghz);
+ timeout_add_msec(&sc->sc_rngto, sc->sc_rngms);
}
/* Enable public key engine, if available */
@@ -433,7 +430,7 @@ hifn_rng(void *vsc)
enqueue_randomness(num1);
}
- timeout_add(&sc->sc_rngto, sc->sc_rnghz);
+ timeout_add_msec(&sc->sc_rngto, sc->sc_rngms);
}
void
Index: pci/hifn7751var.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/hifn7751var.h,v
retrieving revision 1.53
diff -u -p -r1.53 hifn7751var.h
--- pci/hifn7751var.h 15 Dec 2010 23:34:23 -0000 1.53
+++ pci/hifn7751var.h 10 Jan 2020 23:13:14 -0000
@@ -156,7 +156,7 @@ struct hifn_softc {
#define HIFN_IS_7956 0x40 /* Hifn 7955/7956 part */
struct timeout sc_rngto, sc_tickto;
int sc_rngfirst;
- int sc_rnghz;
+ int sc_rngms; /* timeout interval (milliseconds) */
int sc_c_busy, sc_s_busy, sc_d_busy, sc_r_busy, sc_active;
struct hifn_session *sc_sessions;
pci_chipset_tag_t sc_pci_pc;