Home | History | Annotate | Download | only in opencrypto

Lines Matching defs:crp

505 static	int crypto_invoke(struct cryptop *crp, int hint);
1277 crypto_dispatch(struct cryptop *crp)
1284 KASSERT(crp != NULL);
1285 KASSERT(crp->crp_callback != NULL);
1286 KASSERT(crp->crp_desc != NULL);
1287 KASSERT(crp->crp_buf != NULL);
1290 DPRINTF("crp %p, alg %d\n", crp, crp->crp_desc->crd_alg);
1296 nanouptime(&crp->crp_tstamp);
1299 if ((crp->crp_flags & CRYPTO_F_BATCH) != 0) {
1312 TAILQ_INSERT_TAIL(crp_q, crp, crp_next);
1325 cap = crypto_checkdriver_lock(CRYPTO_SESID2HID(crp->crp_sid));
1336 TAILQ_INSERT_TAIL(crp_q, crp, crp_next);
1346 TAILQ_INSERT_TAIL(crp_q, crp, crp_next);
1356 result = crypto_invoke(crp, 0);
1367 TAILQ_INSERT_HEAD(crp_q, crp, crp_next);
1522 crypto_invoke(struct cryptop *crp, int hint)
1527 KASSERT(crp != NULL);
1528 KASSERT(crp->crp_callback != NULL);
1529 KASSERT(crp->crp_desc != NULL);
1534 crypto_tstat(&cryptostats.cs_invoke, &crp->crp_tstamp);
1537 cap = crypto_checkdriver_lock(CRYPTO_SESID2HID(crp->crp_sid));
1544 crp->reqcpu = curcpu();
1549 DPRINTF("calling process for %p\n", crp);
1551 error = (*process)(arg, crp, hint);
1558 crypto_freesession(crp->crp_sid);
1560 crp->crp_etype = ENODEV;
1561 crypto_done(crp);
1570 crypto_freereq(struct cryptop *crp)
1574 if (crp == NULL)
1576 DPRINTF("lid[%u]: crp %p\n", CRYPTO_SESID2LID(crp->crp_sid), crp);
1579 if (crp->crp_flags & CRYPTO_F_ONRETQ) {
1580 panic("crypto_freereq() freeing crp on RETQ\n");
1583 while ((crd = crp->crp_desc) != NULL) {
1584 crp->crp_desc = crd->crd_next;
1587 pool_cache_put(cryptop_cache, crp);
1597 struct cryptop *crp;
1615 crp = pool_cache_get(cryptop_cache, PR_NOWAIT);
1616 if (crp == NULL) {
1619 memset(crp, 0, sizeof(struct cryptop));
1624 crypto_freereq(crp);
1629 crd->crd_next = crp->crp_desc;
1630 crp->crp_desc = crd;
1633 return crp;
1695 crypto_done(struct cryptop *crp)
1701 KASSERT(crp != NULL);
1703 if (crp->crp_etype != 0)
1707 crypto_tstat(&cryptostats.cs_done, &crp->crp_tstamp);
1709 DPRINTF("lid[%u]: crp %p\n", CRYPTO_SESID2LID(crp->crp_sid), crp);
1711 qs = crypto_get_crp_ret_qs(crp->reqcpu);
1714 DPRINTF("lid[%u]: queueing %p\n", CRYPTO_SESID2LID(crp->crp_sid), crp);
1715 crp->crp_flags |= CRYPTO_F_ONRETQ;
1716 TAILQ_INSERT_TAIL(crp_ret_q, crp, crp_next);
1719 DPRINTF("lid[%u]: waking cryptoret, crp %p hit empty queue\n.",
1720 CRYPTO_SESID2LID(crp->crp_sid), crp);
1721 softint_schedule_cpu(crypto_ret_si, crp->reqcpu);
1723 crypto_put_crp_ret_qs(crp->reqcpu);
1799 struct cryptop *crp, *submit, *cnext;
1819 TAILQ_FOREACH_SAFE(crp, crp_q, crp_next, cnext) {
1820 u_int32_t hid = CRYPTO_SESID2HID(crp->crp_sid);
1826 submit = crp;
1831 * skip blocked crp regardless of CRYPTO_F_BATCH
1840 * skip batch crp until the end of crp_q
1842 if ((crp->crp_flags & CRYPTO_F_BATCH) != 0) {
1844 submit = crp;
1855 * found first crp which is neither blocked nor batch.
1857 submit = crp;
1859 * batch crp can be processed much later, so clear hint.
1957 struct cryptop *crp;
1960 crp = TAILQ_FIRST(crp_ret_q);
1961 if (crp != NULL) {
1962 crp, crp_next);
1964 crp->crp_flags &= ~CRYPTO_F_ONRETQ;
1974 if (crp == NULL && krp == NULL)
1978 if (crp != NULL) {
1986 struct timespec t = crp->crp_tstamp;
1988 crp->crp_callback(crp);
1993 crp->crp_callback(crp);