MCPcopy Create free account
hub / github.com/F-Stack/f-stack / crypto_kdispatch

Function crypto_kdispatch

freebsd/opencrypto/crypto.c:1478–1496  ·  view source on GitHub ↗

* Add an asymetric crypto request to a queue, * to be processed by the kernel thread. */

Source from the content-addressed store, hash-verified

1476 * to be processed by the kernel thread.
1477 */
1478int
1479crypto_kdispatch(struct cryptkop *krp)
1480{
1481 int error;
1482
1483 CRYPTOSTAT_INC(cs_kops);
1484
1485 krp->krp_cap = NULL;
1486 error = crypto_kinvoke(krp);
1487 if (error == ERESTART) {
1488 CRYPTO_Q_LOCK();
1489 TAILQ_INSERT_TAIL(&crp_kq, krp, krp_next);
1490 if (crp_sleep)
1491 wakeup_one(&crp_q);
1492 CRYPTO_Q_UNLOCK();
1493 error = 0;
1494 }
1495 return error;
1496}
1497
1498/*
1499 * Verify a driver is suitable for the specified operation.

Callers 1

cryptodev_keyFunction · 0.85

Calls 2

crypto_kinvokeFunction · 0.85
wakeup_oneFunction · 0.50

Tested by

no test coverage detected