diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-02-18 18:16:22 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-02-18 18:16:22 +0000 |
commit | 808fe626921f5e188895322e328c3ea90cd896c5 (patch) | |
tree | 6bc1967cb172ccde1c0afef179cea254e084dfdc /sys | |
parent | 3c9bb8249b2022eaf90e6f71206a7ce32f8b3661 (diff) |
convert to new registration scheme
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/ises.c | 25 | ||||
-rw-r--r-- | sys/dev/pci/noct.c | 16 |
2 files changed, 21 insertions, 20 deletions
diff --git a/sys/dev/pci/ises.c b/sys/dev/pci/ises.c index 1591e5e3ae1..25bff0051c6 100644 --- a/sys/dev/pci/ises.c +++ b/sys/dev/pci/ises.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ises.c,v 1.22 2002/07/05 21:21:17 jason Exp $ */ +/* $OpenBSD: ises.c,v 1.23 2003/02/18 18:16:21 jason Exp $ */ /* * Copyright (c) 2000, 2001 Håkan Olsson (ho@crt.se) @@ -291,7 +291,7 @@ ises_initstate(void *v) struct ises_softc *sc = v; char *dv = sc->sc_dv.dv_xname; u_int32_t stat; - int p, ticks; + int p, ticks, algs[CRYPTO_ALGORITHM_MAX + 1]; static int retry_count = 0; /* XXX Should be in softc */ ticks = hz * 3 / 2; /* 1.5s */ @@ -499,19 +499,16 @@ ises_initstate(void *v) printf("\n"); /* Register ourselves with crypto framework. */ - p = crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0, - ises_newsession, ises_freesession, ises_process); - p |= crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0, - NULL, NULL, NULL); - p |= crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0, - NULL, NULL, NULL); - p |= crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0, - NULL, NULL, NULL); - p |= crypto_register(sc->sc_cid, CRYPTO_RIPEMD160_HMAC, 0, 0, - NULL, NULL, NULL); - if (p) - printf("%s: could not register all algorithms\n", dv); + bzero(algs, sizeof(algs)); + + algs[CRYPTO_3DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_MD5_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_SHA1_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_RIPEMD160_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; + crypto_register(sc->sc_cid, algs, + ises_newsession, ises_freesession, ises_process); return; default: diff --git a/sys/dev/pci/noct.c b/sys/dev/pci/noct.c index 2ea4cc509a9..14216df4897 100644 --- a/sys/dev/pci/noct.c +++ b/sys/dev/pci/noct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: noct.c,v 1.11 2002/07/21 05:09:17 jason Exp $ */ +/* $OpenBSD: noct.c,v 1.12 2003/02/18 18:16:21 jason Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -813,7 +813,7 @@ noct_ea_init(sc) struct noct_softc *sc; { bus_dma_segment_t seg; - int rseg; + int rseg, algs[CRYPTO_ALGORITHM_MAX + 1]; if (bus_dmamem_alloc(sc->sc_dmat, NOCT_EA_BUFSIZE, PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) { @@ -843,11 +843,15 @@ noct_ea_init(sc) SIMPLEQ_INIT(&sc->sc_chipq); SIMPLEQ_INIT(&sc->sc_outq); - crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0, + bzero(algs, sizeof(algs)); + + algs[CRYPTO_MD5] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_SHA1] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; + algs[CRYPTO_3DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; + + crypto_register(sc->sc_cid, algs, noct_newsession, noct_freesession, noct_process); - crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0, NULL, NULL, NULL); - crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0, NULL, NULL, NULL); - crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0, NULL, NULL, NULL); kthread_create_deferred(noct_ea_create_thread, sc); |