Lines Matching defs:qs

1276     const struct qat_session *qs)
1285 mode = qs->qs_cipher_mode;
1289 algo = qs->qs_cipher_algo;
1301 algo = qs->qs_cipher_algo;
1314 const struct qat_session *qs, const struct qat_sym_hash_def **hash_def)
1318 switch (qs->qs_auth_algo) {
1335 panic("unhandled auth algorithm %d", qs->qs_auth_algo);
1340 return HW_AUTH_CONFIG_BUILD(qs->qs_auth_mode,
1346 struct qat_session *qs;
1409 struct qat_session *qs;
1420 qs = arg->qs;
1423 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
1447 struct qat_session *qs;
1458 qs = arg->qs;
1467 if (qs->qs_auth_algo != HW_AUTH_ALGO_GALOIS_128 &&
1491 qat_crypto_load(struct qat_session *qs, struct qat_sym_cookie *qsc,
1500 arg.qs = qs;
1505 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128 &&
1801 struct qat_session *qs;
1813 qs = qsbc->qsbc_session;
1826 if ((auth_sz = qs->qs_auth_mlen) != 0) {
1843 mtx_lock(&qs->qs_session_mtx);
1844 MPASS(qs->qs_status & QAT_SESSION_STATUS_ACTIVE);
1845 qs->qs_inflight--;
1846 if (__predict_false(qs->qs_need_wakeup && qs->qs_inflight == 0)) {
1848 qs->qs_need_wakeup = false;
1850 mtx_unlock(&qs->qs_session_mtx);
1958 struct qat_session *qs;
1964 qs = crypto_get_driver_session(cses);
1967 qdm = &qs->qs_desc_mem;
1973 mtx_init(&qs->qs_session_mtx, "qs session", NULL, MTX_DEF);
1974 qs->qs_aad_length = -1;
1976 qs->qs_dec_desc = ddesc = qdm->qdm_dma_vaddr;
1977 qs->qs_enc_desc = edesc = ddesc + 1;
1987 qs->qs_status = QAT_SESSION_STATUS_ACTIVE;
1988 qs->qs_inflight = 0;
1990 qs->qs_cipher_key = csp->csp_cipher_key;
1991 qs->qs_cipher_klen = csp->csp_cipher_klen;
1992 qs->qs_auth_key = csp->csp_auth_key;
1993 qs->qs_auth_klen = csp->csp_auth_klen;
1997 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
1998 qs->qs_cipher_mode = HW_CIPHER_CBC_MODE;
2001 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
2002 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
2005 qs->qs_cipher_algo =
2007 qs->qs_cipher_mode = HW_CIPHER_XTS_MODE;
2010 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
2011 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
2012 qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128;
2013 qs->qs_auth_mode = HW_AUTH_MODE1;
2024 qs->qs_auth_algo = HW_AUTH_ALGO_SHA1;
2025 qs->qs_auth_mode = HW_AUTH_MODE1;
2028 qs->qs_auth_algo = HW_AUTH_ALGO_SHA1;
2029 qs->qs_auth_mode = HW_AUTH_MODE0;
2032 qs->qs_auth_algo = HW_AUTH_ALGO_SHA256;
2033 qs->qs_auth_mode = HW_AUTH_MODE1;
2036 qs->qs_auth_algo = HW_AUTH_ALGO_SHA256;
2037 qs->qs_auth_mode = HW_AUTH_MODE0;
2040 qs->qs_auth_algo = HW_AUTH_ALGO_SHA384;
2041 qs->qs_auth_mode = HW_AUTH_MODE1;
2044 qs->qs_auth_algo = HW_AUTH_ALGO_SHA384;
2045 qs->qs_auth_mode = HW_AUTH_MODE0;
2048 qs->qs_auth_algo = HW_AUTH_ALGO_SHA512;
2049 qs->qs_auth_mode = HW_AUTH_MODE1;
2052 qs->qs_auth_algo = HW_AUTH_ALGO_SHA512;
2053 qs->qs_auth_mode = HW_AUTH_MODE0;
2056 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_auth_klen);
2057 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
2058 qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128;
2059 qs->qs_auth_mode = HW_AUTH_MODE1;
2061 qs->qs_cipher_key = qs->qs_auth_key;
2062 qs->qs_cipher_klen = qs->qs_auth_klen;
2099 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
2126 qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, ddesc);
2127 qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, edesc);
2130 qs->qs_auth_mlen = csp->csp_auth_mlen;
2132 qs->qs_auth_mlen = edesc->qcd_auth_sz;
2153 struct qat_session *qs;
2155 qs = crypto_get_driver_session(cses);
2156 KASSERT(qs->qs_inflight == 0,
2157 ("%s: session %p has requests in flight", __func__, qs));
2159 qat_crypto_clear_desc(qs->qs_enc_desc);
2160 qat_crypto_clear_desc(qs->qs_dec_desc);
2161 qat_free_dmamem(device_get_softc(dev), &qs->qs_desc_mem);
2162 mtx_destroy(&qs->qs_session_mtx);
2171 struct qat_session *qs;
2179 qs = crypto_get_driver_session(crp->crp_session);
2187 mtx_lock(&qs->qs_session_mtx);
2188 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
2191 mtx_unlock(&qs->qs_session_mtx);
2204 if (__predict_false(crp->crp_aad_length != qs->qs_aad_length)) {
2205 if (qs->qs_inflight == 0) {
2206 if (qs->qs_aad_length != -1) {
2210 qs->qs_aad_length = crp->crp_aad_length;
2212 qs->qs_need_wakeup = true;
2213 mtx_unlock(&qs->qs_session_mtx);
2220 qs->qs_inflight++;
2221 mtx_unlock(&qs->qs_session_mtx);
2233 desc = qs->qs_enc_desc;
2235 desc = qs->qs_dec_desc;
2237 error = qat_crypto_load(qs, qsc, desc, crp);
2243 qsbc->qsbc_session = qs;
2246 sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, crp);
2274 mtx_lock(&qs->qs_session_mtx);
2275 qs->qs_inflight--;
2276 mtx_unlock(&qs->qs_session_mtx);