* Add an asymetric crypto request to a queue, * to be processed by the kernel thread. */
| 1476 | * to be processed by the kernel thread. |
| 1477 | */ |
| 1478 | int |
| 1479 | crypto_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. |
no test coverage detected