diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-08-12 20:40:20 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-08-12 20:40:20 +0000 |
commit | 038533e30c93934d790f69ab83bff1fa60436fa5 (patch) | |
tree | dac9fda4aa533a678fe3133b9defc8cb4fdf49d4 | |
parent | 3cb1cadbb2a19c6c23ba921c3eb92b1df03f12bd (diff) |
cleaning: remove sc_flags and FBSDID junk
also: let safe_uniform() check all of the elements
-rw-r--r-- | sys/dev/pci/safe.c | 17 | ||||
-rw-r--r-- | sys/dev/pci/safevar.h | 5 |
2 files changed, 8 insertions, 14 deletions
diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index 06905572958..a01ff52af2f 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.1 2003/08/12 18:48:13 jason Exp $ */ +/* $OpenBSD: safe.c,v 1.2 2003/08/12 20:40:19 jason Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -25,12 +25,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD: /repoman/r/ncvs/src/sys/dev/safe/safe.c,v 1.1 2003/07/21 21:46:07 sam Exp $ */ #include <sys/cdefs.h> -#if 0 -__FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/dev/safe/safe.c,v 1.1 2003/07/21 21:46:07 sam Exp $"); -#endif /* * SafeNet SafeXcel-1141 hardware crypto accelerator @@ -271,17 +270,14 @@ safe_attach(struct device *parent, struct device *self, void *aux) printf(":"); devinfo = READ_REG(sc, SAFE_DEVINFO); - if (devinfo & SAFE_DEVINFO_RNG) { - sc->sc_flags |= SAFE_FLAGS_RNG; + if (devinfo & SAFE_DEVINFO_RNG) printf(" rng"); - } bzero(algs, sizeof(algs)); #if 0 /* Key ops not supported yet */ if (devinfo & SAFE_DEVINFO_PKEY) { printf(" key"); - sc->sc_flags |= SAFE_FLAGS_KEY; crypto_kregister(sc->sc_cid, CRK_MOD_EXP, 0, safe_kprocess, sc); crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0, @@ -314,7 +310,7 @@ safe_attach(struct device *parent, struct device *self, void *aux) safe_init_pciregs(sc); /* init pci settings */ safe_init_board(sc); /* init h/w */ - if (sc->sc_flags & SAFE_FLAGS_RNG) { + if (devinfo & SAFE_DEVINFO_RNG) { safe_rng_init(sc); timeout_set(&sc->sc_rngto, safe_rng, sc); @@ -1581,11 +1577,12 @@ safe_dmamap_uniform(const struct safe_operand *op) if (op->nsegs > 0) { int i; - for (i = 0; i < op->nsegs-1; i++) + for (i = 0; i < op->nsegs-1; i++) { if (op->segs[i].ds_len % SAFE_MAX_DSIZE) return (0); if (op->segs[i].ds_len != SAFE_MAX_DSIZE) result = 2; + } } return (result); } diff --git a/sys/dev/pci/safevar.h b/sys/dev/pci/safevar.h index 22f0713b0ab..e161301d7b7 100644 --- a/sys/dev/pci/safevar.h +++ b/sys/dev/pci/safevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: safevar.h,v 1.1 2003/08/12 18:48:13 jason Exp $ */ +/* $OpenBSD: safevar.h,v 1.2 2003/08/12 20:40:19 jason Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -152,9 +152,6 @@ struct safe_softc { struct resource *sc_sr; /* memory resource */ bus_dma_tag_t sc_dmat; u_int sc_chiprev; /* major/minor chip revision */ - int sc_flags; /* device specific flags */ -#define SAFE_FLAGS_KEY 0x01 /* has key accelerator */ -#define SAFE_FLAGS_RNG 0x02 /* hardware rng */ int sc_suspended; int sc_needwakeup; /* notify crypto layer */ int32_t sc_cid; /* crypto tag */ |