src/sys/opencrypto/cryptodev.c
/*
 * Check a crypto identifier to see if it requested
 * a software device/driver.  This can be done either
 * by device name/class or through search constraints.
 */
Check a crypto identifier to see if it requested
a software device/driver.  This can be done either
by device name/class or through search constraints.
Check a crypto identifier to see if it requested a software device / driver . This can be done either by device name / class or through search constraints .
static int
checkforsoftware(int *cridp)
{
	int crid;
	crid = *cridp;
	if (!crypto_devallowsoft) {
		if (crid & CRYPTOCAP_F_SOFTWARE) {
			if (crid & CRYPTOCAP_F_HARDWARE) {
				*cridp = CRYPTOCAP_F_HARDWARE;
				return 0;
			}
			return EINVAL;
		}
		if ((crid & CRYPTOCAP_F_HARDWARE) == 0 &&
		    (crypto_getcaps(crid) & CRYPTOCAP_F_HARDWARE) == 0)
			return EINVAL;
	}
	return 0;
}
static int checkforsoftware ( int * cridp ) { int crid ; crid = * cridp ; if ( ! crypto_devallowsoft ) { if ( crid & CRYPTOCAP_F_SOFTWARE ) { if ( crid & CRYPTOCAP_F_HARDWARE ) { * cridp = CRYPTOCAP_F_HARDWARE ; return 0 ; } return EINVAL ; } if ( ( crid & CRYPTOCAP_F_HARDWARE ) == 0 && ( crypto_getcaps ( crid ) & CRYPTOCAP_F_HARDWARE ) == 0 ) return EINVAL ; } return 0 ; }
Check a crypto identifier to see if it requested
 a software device/driver.
Check a crypto identifier to see if it requested a software device / driver .