summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-01-29 04:01:45 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-01-29 04:01:45 +0000
commit1f90ce194a5519ab3bd5c8b96b700e3bc80efd9e (patch)
tree8e9b72f6a44517e29dc65c4324d48272f77bbbe2 /sys
parentce4bd0a82dae2c504f34ed1cd89a9877c98ccba1 (diff)
grab rng stuff more often (now 6400bytes/sec)
document the other mcr2 operations and fix a printf (luckily it's never been called =)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/ubsec.c16
-rw-r--r--sys/dev/pci/ubsecreg.h17
2 files changed, 27 insertions, 6 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index 5bee0a61135..2d29a7f0e94 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.37 2001/01/29 00:39:20 jason Exp $ */
+/* $OpenBSD: ubsec.c,v 1.38 2001/01/29 04:01:44 jason Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -200,7 +200,7 @@ ubsec_attach(parent, self, aux)
if (sc->sc_5601) {
timeout_set(&sc->sc_rngto, ubsec_rng, sc);
- timeout_add(&sc->sc_rngto, hz);
+ timeout_add(&sc->sc_rngto, 1);
}
printf(": %s\n", intrstr);
@@ -1070,6 +1070,7 @@ void
ubsec_callback2(q)
struct ubsec_q2 *q;
{
+ struct ubsec_softc *sc = q->q_sc;
struct ubsec_keyctx *ctx = q->q_ctx;
switch (ctx->ctx_op) {
@@ -1083,10 +1084,12 @@ ubsec_callback2(q)
add_true_randomness(*dat);
free(rng, M_DEVBUF);
free(q, M_DEVBUF);
+ timeout_add(&sc->sc_rngto, 1);
break;
}
default:
- printf("%s: unknown ctx op: %x\n", ctx->ctx_op);
+ printf("%s: unknown ctx op: %x\n", sc->sc_dv.dv_xname,
+ ctx->ctx_op);
break;
}
}
@@ -1139,6 +1142,11 @@ ubsec_rng(vsc)
ubsec_feed2(sc);
splx(s);
+ return;
+
out:
- timeout_add(&sc->sc_rngto, hz);
+ /*
+ * Something weird happened, generate our own call back.
+ */
+ timeout_add(&sc->sc_rngto, 1);
}
diff --git a/sys/dev/pci/ubsecreg.h b/sys/dev/pci/ubsecreg.h
index 59b90e9a4d1..ceb510230bc 100644
--- a/sys/dev/pci/ubsecreg.h
+++ b/sys/dev/pci/ubsecreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsecreg.h,v 1.8 2001/01/29 00:39:20 jason Exp $ */
+/* $OpenBSD: ubsecreg.h,v 1.9 2001/01/29 04:01:44 jason Exp $ */
/*
* Copyright (c) 2000 Theo de Raadt
@@ -126,7 +126,20 @@ struct ubsec_keyctx {
volatile u_int16_t ctx_op; /* operation code */
volatile u_int8_t ctx_pad[60]; /* padding */
};
-#define UBS_CTXOP_RNGBYPASS 0x41
+#define UBS_CTXOP_DHPKGEN 0x01 /* dh public key generation */
+#define UBS_CTXOP_DHSSGEN 0x02 /* dh shared secret gen. */
+#define UBS_CTXOP_RSAPUB 0x03 /* rsa public key op */
+#define UBS_CTXOP_RSAPRIV 0x04 /* rsa private key op */
+#define UBS_CTXOP_DSASIGN 0x05 /* dsa signing op */
+#define UBS_CTXOP_DSAVRFY 0x06 /* dsa verification */
+#define UBS_CTXOP_RNGBYPASS 0x41 /* rng direct test mode */
+#define UBS_CTXOP_RNGSHA1 0x42 /* rng sha1 test mode */
+#define UBS_CTXOP_MODADD 0x43 /* modular addition */
+#define UBS_CTXOP_MODSUB 0x44 /* modular subtraction */
+#define UBS_CTXOP_MODMUL 0x45 /* modular multiplication */
+#define UBS_CTXOP_MODRED 0x46 /* modular reduction */
+#define UBS_CTXOP_MODEXP 0x47 /* modular exponentiation */
+#define UBS_CTXOP_MODINV 0x48 /* modular inverse */
struct ubsec_rngbypass_ctx {
volatile u_int16_t rbp_len; /* command length, 64 */