summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-05-13 22:28:57 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-05-13 22:28:57 +0000
commit70a2764d3bd6d00053bb65e658f0605e78f3005c (patch)
treec84f7b7127fdbf9c4543c84ba8098cf6a83e9c71 /sys
parent7e0049914cd4c9eb6f5dcffefaac344b5ea5a2a9 (diff)
add and use three more flags:
RNG: chip has usable rng (5805/5820/5821) HWNORM: chip will automagically normalize bignums (5820/5821) BIGKEY: chip supports "large keys" (5820/5821)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/ubsec.c18
-rw-r--r--sys/dev/pci/ubsecvar.h5
2 files changed, 15 insertions, 8 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index b5af607ad56..82766cc9db6 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.98 2002/05/08 23:05:27 jason Exp $ */
+/* $OpenBSD: ubsec.c,v 1.99 2002/05/13 22:28:56 jason Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -171,16 +171,20 @@ ubsec_attach(parent, self, aux)
SIMPLEQ_INIT(&sc->sc_q2free);
sc->sc_statmask = BS_STAT_MCR1_DONE | BS_STAT_DMAERR;
- if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BLUESTEEL &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BLUESTEEL_5601) ||
- (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_5805))
+
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BLUESTEEL &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BLUESTEEL_5601)
sc->sc_flags |= UBS_FLAGS_KEY;
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_5805)
+ sc->sc_flags |= UBS_FLAGS_KEY | UBS_FLAGS_RNG;
+
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM &&
(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_5820 ||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_5821))
- sc->sc_flags |= UBS_FLAGS_KEY | UBS_FLAGS_LONGCTX;
+ sc->sc_flags |= UBS_FLAGS_KEY | UBS_FLAGS_RNG |
+ UBS_FLAGS_LONGCTX | UBS_FLAGS_HWNORM | UBS_FLAGS_BIGKEY;
cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
cmd |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE;
@@ -278,7 +282,7 @@ ubsec_attach(parent, self, aux)
printf(": %s", intrstr);
#ifndef UBSEC_NO_RNG
- if (sc->sc_flags & UBS_FLAGS_KEY) {
+ if (sc->sc_flags & UBS_FLAGS_RNG) {
sc->sc_statmask |= BS_STAT_MCR2_DONE;
if (ubsec_dma_malloc(sc, sizeof(struct ubsec_mcr),
diff --git a/sys/dev/pci/ubsecvar.h b/sys/dev/pci/ubsecvar.h
index e4607284ce9..818c7a55fb3 100644
--- a/sys/dev/pci/ubsecvar.h
+++ b/sys/dev/pci/ubsecvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsecvar.h,v 1.31 2002/05/06 20:53:05 jason Exp $ */
+/* $OpenBSD: ubsecvar.h,v 1.32 2002/05/13 22:28:56 jason Exp $ */
/*
* Copyright (c) 2000 Theo de Raadt
@@ -125,6 +125,9 @@ struct ubsec_dma {
#define UBS_FLAGS_KEY 0x01 /* has key accelerator */
#define UBS_FLAGS_LONGCTX 0x02 /* uses long ipsec ctx */
+#define UBS_FLAGS_BIGKEY 0x04 /* 2048bit keys */
+#define UBS_FLAGS_HWNORM 0x08 /* hardware normalization */
+#define UBS_FLAGS_RNG 0x10 /* hardware rng */
struct ubsec_q {
SIMPLEQ_ENTRY(ubsec_q) q_next;