Changeset View
Changeset View
Standalone View
Standalone View
head/sys/crypto/blake2/blake2_cryptodev.c
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct blake2_softc *sc; | struct blake2_softc *sc; | ||||
int i; | int i; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->dying = false; | sc->dying = false; | ||||
sc->cid = crypto_get_driverid(dev, sizeof(struct blake2_session), | sc->cid = crypto_get_driverid(dev, sizeof(struct blake2_session), | ||||
CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC); | CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC | | ||||
CRYPTOCAP_F_ACCEL_SOFTWARE); | |||||
if (sc->cid < 0) { | if (sc->cid < 0) { | ||||
device_printf(dev, "Could not get crypto driver id.\n"); | device_printf(dev, "Could not get crypto driver id.\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
ctx_mtx = malloc(sizeof(*ctx_mtx) * (mp_maxid + 1), M_BLAKE2, | ctx_mtx = malloc(sizeof(*ctx_mtx) * (mp_maxid + 1), M_BLAKE2, | ||||
M_WAITOK | M_ZERO); | M_WAITOK | M_ZERO); | ||||
ctx_fpu = malloc(sizeof(*ctx_fpu) * (mp_maxid + 1), M_BLAKE2, | ctx_fpu = malloc(sizeof(*ctx_fpu) * (mp_maxid + 1), M_BLAKE2, | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |