Lines Matching defs:qs

1240     const struct qat_session *qs)
1249 mode = qs->qs_cipher_mode;
1253 algo = qs->qs_cipher_algo;
1265 algo = qs->qs_cipher_algo;
1278 const struct qat_session *qs, const struct qat_sym_hash_def **hash_def)
1282 switch (qs->qs_auth_algo) {
1299 panic("unhandled auth algorithm %d", qs->qs_auth_algo);
1304 return HW_AUTH_CONFIG_BUILD(qs->qs_auth_mode,
1310 struct qat_session *qs;
1373 struct qat_session *qs;
1384 qs = arg->qs;
1387 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
1411 struct qat_session *qs;
1422 qs = arg->qs;
1431 if (qs->qs_auth_algo != HW_AUTH_ALGO_GALOIS_128 &&
1455 qat_crypto_load(struct qat_session *qs, struct qat_sym_cookie *qsc,
1464 arg.qs = qs;
1469 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128 &&
1765 struct qat_session *qs;
1777 qs = qsbc->qsbc_session;
1790 if ((auth_sz = qs->qs_auth_mlen) != 0) {
1807 mtx_lock(&qs->qs_session_mtx);
1808 MPASS(qs->qs_status & QAT_SESSION_STATUS_ACTIVE);
1809 qs->qs_inflight--;
1810 if (__predict_false(qs->qs_need_wakeup && qs->qs_inflight == 0)) {
1812 qs->qs_need_wakeup = false;
1814 mtx_unlock(&qs->qs_session_mtx);
1920 struct qat_session *qs;
1926 qs = crypto_get_driver_session(cses);
1929 qdm = &qs->qs_desc_mem;
1935 mtx_init(&qs->qs_session_mtx, "qs session", NULL, MTX_DEF);
1936 qs->qs_aad_length = -1;
1938 qs->qs_dec_desc = ddesc = qdm->qdm_dma_vaddr;
1939 qs->qs_enc_desc = edesc = ddesc + 1;
1949 qs->qs_status = QAT_SESSION_STATUS_ACTIVE;
1950 qs->qs_inflight = 0;
1952 qs->qs_cipher_key = csp->csp_cipher_key;
1953 qs->qs_cipher_klen = csp->csp_cipher_klen;
1954 qs->qs_auth_key = csp->csp_auth_key;
1955 qs->qs_auth_klen = csp->csp_auth_klen;
1959 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
1960 qs->qs_cipher_mode = HW_CIPHER_CBC_MODE;
1963 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
1964 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
1967 qs->qs_cipher_algo =
1969 qs->qs_cipher_mode = HW_CIPHER_XTS_MODE;
1972 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen);
1973 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
1974 qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128;
1975 qs->qs_auth_mode = HW_AUTH_MODE1;
1986 qs->qs_auth_algo = HW_AUTH_ALGO_SHA1;
1987 qs->qs_auth_mode = HW_AUTH_MODE1;
1990 qs->qs_auth_algo = HW_AUTH_ALGO_SHA1;
1991 qs->qs_auth_mode = HW_AUTH_MODE0;
1994 qs->qs_auth_algo = HW_AUTH_ALGO_SHA256;
1995 qs->qs_auth_mode = HW_AUTH_MODE1;
1998 qs->qs_auth_algo = HW_AUTH_ALGO_SHA256;
1999 qs->qs_auth_mode = HW_AUTH_MODE0;
2002 qs->qs_auth_algo = HW_AUTH_ALGO_SHA384;
2003 qs->qs_auth_mode = HW_AUTH_MODE1;
2006 qs->qs_auth_algo = HW_AUTH_ALGO_SHA384;
2007 qs->qs_auth_mode = HW_AUTH_MODE0;
2010 qs->qs_auth_algo = HW_AUTH_ALGO_SHA512;
2011 qs->qs_auth_mode = HW_AUTH_MODE1;
2014 qs->qs_auth_algo = HW_AUTH_ALGO_SHA512;
2015 qs->qs_auth_mode = HW_AUTH_MODE0;
2018 qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_auth_klen);
2019 qs->qs_cipher_mode = HW_CIPHER_CTR_MODE;
2020 qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128;
2021 qs->qs_auth_mode = HW_AUTH_MODE1;
2023 qs->qs_cipher_key = qs->qs_auth_key;
2024 qs->qs_cipher_klen = qs->qs_auth_klen;
2061 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
2088 qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, ddesc);
2089 qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, edesc);
2092 qs->qs_auth_mlen = csp->csp_auth_mlen;
2094 qs->qs_auth_mlen = edesc->qcd_auth_sz;
2115 struct qat_session *qs;
2117 qs = crypto_get_driver_session(cses);
2118 KASSERT(qs->qs_inflight == 0,
2119 ("%s: session %p has requests in flight", __func__, qs));
2121 qat_crypto_clear_desc(qs->qs_enc_desc);
2122 qat_crypto_clear_desc(qs->qs_dec_desc);
2123 qat_free_dmamem(device_get_softc(dev), &qs->qs_desc_mem);
2124 mtx_destroy(&qs->qs_session_mtx);
2133 struct qat_session *qs;
2141 qs = crypto_get_driver_session(crp->crp_session);
2149 mtx_lock(&qs->qs_session_mtx);
2150 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) {
2153 mtx_unlock(&qs->qs_session_mtx);
2166 if (__predict_false(crp->crp_aad_length != qs->qs_aad_length)) {
2167 if (qs->qs_inflight == 0) {
2168 if (qs->qs_aad_length != -1) {
2172 qs->qs_aad_length = crp->crp_aad_length;
2174 qs->qs_need_wakeup = true;
2175 mtx_unlock(&qs->qs_session_mtx);
2182 qs->qs_inflight++;
2183 mtx_unlock(&qs->qs_session_mtx);
2195 desc = qs->qs_enc_desc;
2197 desc = qs->qs_dec_desc;
2199 error = qat_crypto_load(qs, qsc, desc, crp);
2205 qsbc->qsbc_session = qs;
2208 sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, crp);
2236 mtx_lock(&qs->qs_session_mtx);
2237 qs->qs_inflight--;
2238 mtx_unlock(&qs->qs_session_mtx);