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

Function crypto_kdone

freebsd/opencrypto/crypto.c:1873–1901  ·  view source on GitHub ↗

* Invoke the callback on behalf of the driver. */

Source from the content-addressed store, hash-verified

1871 * Invoke the callback on behalf of the driver.
1872 */
1873void
1874crypto_kdone(struct cryptkop *krp)
1875{
1876 struct crypto_ret_worker *ret_worker;
1877 struct cryptocap *cap;
1878
1879 if (krp->krp_status != 0)
1880 CRYPTOSTAT_INC(cs_kerrs);
1881 cap = krp->krp_cap;
1882 if (cap != NULL) {
1883 CRYPTO_DRIVER_LOCK();
1884 KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0"));
1885 cap->cc_koperations--;
1886 if (cap->cc_koperations == 0 &&
1887 cap->cc_flags & CRYPTOCAP_F_CLEANUP)
1888 wakeup(cap);
1889 CRYPTO_DRIVER_UNLOCK();
1890 krp->krp_cap = NULL;
1891 cap_rele(cap);
1892 }
1893
1894 ret_worker = CRYPTO_RETW(0);
1895
1896 CRYPTO_RETW_LOCK(ret_worker);
1897 if (CRYPTO_RETW_EMPTY(ret_worker))
1898 wakeup_one(&ret_worker->crp_ret_q); /* shared wait channel */
1899 TAILQ_INSERT_TAIL(&ret_worker->crp_ret_kq, krp, krp_next);
1900 CRYPTO_RETW_UNLOCK(ret_worker);
1901}
1902
1903int
1904crypto_getfeat(int *featp)

Callers 3

xlp_rsa_kprocessFunction · 0.85
crypto_kinvokeFunction · 0.85

Calls 3

cap_releFunction · 0.85
wakeupFunction · 0.50
wakeup_oneFunction · 0.50

Tested by

no test coverage detected