Lines Matching +full:hdr +full:- +full:engine

1 /* SPDX-License-Identifier: BSD-2-Clause AND BSD-3-Clause */
31 * Copyright(c) 2007-2013 Intel Corporation. All rights reserved.
102 msg->flags = ARCH_IF_FLAGS_VALID_FLAG | in qat_msg_req_type_populate()
104 msg->req_type = type; in qat_msg_req_type_populate()
105 msg->resp_pipe_id = rxring; in qat_msg_req_type_populate()
112 struct fw_comn_req_hdr *hdr = &msg->comn_hdr; in qat_msg_cmn_hdr_populate() local
114 hdr->comn_req_flags = comn_req_flags; in qat_msg_cmn_hdr_populate()
115 hdr->content_desc_params_sz = hwblksz; in qat_msg_cmn_hdr_populate()
116 hdr->content_desc_hdr_sz = hdrsz; in qat_msg_cmn_hdr_populate()
117 hdr->content_desc_addr = desc_paddr; in qat_msg_cmn_hdr_populate()
118 msg->flow_id = flow_id; in qat_msg_cmn_hdr_populate()
125 msg->comn_la_req.la_cmd_id = cmdid; in qat_msg_service_cmd_populate()
126 msg->comn_la_req.u.la_flags = cmd_flags; in qat_msg_service_cmd_populate()
134 msg->opaque_data = (uint64_t)(uintptr_t)cookie; in qat_msg_cmn_mid_populate()
135 msg->src_data_addr = src; in qat_msg_cmn_mid_populate()
137 msg->dest_data_addr = src; in qat_msg_cmn_mid_populate()
139 msg->dest_data_addr = dst; in qat_msg_cmn_mid_populate()
146 msg->req_params_addr = req_params_paddr; in qat_msg_req_params_populate()
147 msg->comn_la_req.u1.req_params_blk_sz = req_params_sz / 8; in qat_msg_req_params_populate()
153 msg->next_request_addr = next_addr; in qat_msg_cmn_footer_populate()
161 qat_msg_cmn_hdr_populate(msg, desc->qcd_desc_paddr, in qat_msg_params_populate()
162 desc->qcd_hdr_sz, desc->qcd_hw_blk_sz, comn_req_flags, 0); in qat_msg_params_populate()
163 qat_msg_service_cmd_populate(msg, desc->qcd_cmd_id, service_cmd_flags); in qat_msg_params_populate()
164 qat_msg_cmn_mid_populate(&msg->comn_mid, NULL, 0, 0); in qat_msg_params_populate()
166 qat_msg_cmn_footer_populate(&msg->comn_ftr, 0); in qat_msg_params_populate()
172 struct qat_admin_rings *qadr = &sc->sc_admin_rings; in qat_adm_ring_init_ring_table()
174 if (sc->sc_ae_num == 1) { in qat_adm_ring_init_ring_table()
175 qadr->qadr_cya_ring_tbl = in qat_adm_ring_init_ring_table()
176 &qadr->qadr_master_ring_tbl[0]; in qat_adm_ring_init_ring_table()
177 qadr->qadr_srv_mask[0] = QAT_SERVICE_CRYPTO_A; in qat_adm_ring_init_ring_table()
178 } else if (sc->sc_ae_num == 2 || sc->sc_ae_num == 4) { in qat_adm_ring_init_ring_table()
179 qadr->qadr_cya_ring_tbl = in qat_adm_ring_init_ring_table()
180 &qadr->qadr_master_ring_tbl[0]; in qat_adm_ring_init_ring_table()
181 qadr->qadr_srv_mask[0] = QAT_SERVICE_CRYPTO_A; in qat_adm_ring_init_ring_table()
182 qadr->qadr_cyb_ring_tbl = in qat_adm_ring_init_ring_table()
183 &qadr->qadr_master_ring_tbl[1]; in qat_adm_ring_init_ring_table()
184 qadr->qadr_srv_mask[1] = QAT_SERVICE_CRYPTO_B; in qat_adm_ring_init_ring_table()
193 struct qat_admin_rings *qadr = &sc->sc_admin_rings; in qat_adm_ring_init()
196 error = qat_alloc_dmamem(sc, &qadr->qadr_dma, 1, PAGE_SIZE, PAGE_SIZE); in qat_adm_ring_init()
200 qadr->qadr_master_ring_tbl = qadr->qadr_dma.qdm_dma_vaddr; in qat_adm_ring_init()
202 MPASS(sc->sc_ae_num * in qat_adm_ring_init()
206 for (i = 0; i < sc->sc_ae_num; i++) { in qat_adm_ring_init()
208 &qadr->qadr_master_ring_tbl[i]; in qat_adm_ring_init()
212 &firt->firt_bulk_rings[j]; in qat_adm_ring_init()
214 firp->firp_reserved = 0; in qat_adm_ring_init()
215 firp->firp_curr_weight = QAT_DEFAULT_RING_WEIGHT; in qat_adm_ring_init()
216 firp->firp_init_weight = QAT_DEFAULT_RING_WEIGHT; in qat_adm_ring_init()
217 firp->firp_ring_pvl = QAT_DEFAULT_PVL; in qat_adm_ring_init()
219 memset(firt->firt_ring_mask, 0, sizeof(firt->firt_ring_mask)); in qat_adm_ring_init()
223 ADMIN_RING_SIZE, sc->sc_hw.qhw_fw_req_size, in qat_adm_ring_init()
224 NULL, NULL, "admin_tx", &qadr->qadr_admin_tx); in qat_adm_ring_init()
229 ADMIN_RING_SIZE, sc->sc_hw.qhw_fw_resp_size, in qat_adm_ring_init()
230 qat_adm_ring_intr, qadr, "admin_rx", &qadr->qadr_admin_rx); in qat_adm_ring_init()
247 for (i = 0; i < sc->sc_ae_num; i++) { in qat_adm_ring_init()
248 if (qadr->qadr_srv_mask[i]) in qat_adm_ring_init()
249 qadr->qadr_active_aes_per_accel++; in qat_adm_ring_init()
300 struct qat_admin_rings *qadr = &sc->sc_admin_rings; in qat_adm_ring_build_ring_table()
303 uint8_t srv_mask = sc->sc_admin_rings.qadr_srv_mask[ae]; in qat_adm_ring_build_ring_table()
306 tbl = qadr->qadr_cya_ring_tbl; in qat_adm_ring_build_ring_table()
308 tbl = qadr->qadr_cyb_ring_tbl; in qat_adm_ring_build_ring_table()
310 device_printf(sc->sc_dev, in qat_adm_ring_build_ring_table()
311 "Invalid execution engine %d\n", ae); in qat_adm_ring_build_ring_table()
315 param = &tbl->firt_bulk_rings[sc->sc_hw.qhw_ring_sym_tx]; in qat_adm_ring_build_ring_table()
316 param->firp_curr_weight = QAT_HI_PRIO_RING_WEIGHT; in qat_adm_ring_build_ring_table()
317 param->firp_init_weight = QAT_HI_PRIO_RING_WEIGHT; in qat_adm_ring_build_ring_table()
318 FW_INIT_RING_MASK_SET(tbl, sc->sc_hw.qhw_ring_sym_tx); in qat_adm_ring_build_ring_table()
335 srv_mask = sc->sc_admin_rings.qadr_srv_mask[ in qat_adm_ring_build_init_msg()
336 ae % sc->sc_ae_num]; in qat_adm_ring_build_init_msg()
340 qat_msg_req_type_populate(&initmsg->comn_hdr.arch_if, in qat_adm_ring_build_init_msg()
342 sc->sc_admin_rings.qadr_admin_rx->qr_ring_id); in qat_adm_ring_build_init_msg()
344 qat_msg_cmn_mid_populate(&initmsg->comn_mid, cb, 0, 0); in qat_adm_ring_build_init_msg()
348 if (ae % sc->sc_ae_num == 0) in qat_adm_ring_build_init_msg()
350 if (ae >= sc->sc_ae_num) { in qat_adm_ring_build_init_msg()
355 if (sc->sc_ae_mask) in qat_adm_ring_build_init_msg()
360 aehdr = &initmsg->u.set_ae_info; in qat_adm_ring_build_init_msg()
361 aeinfo = &initmsg->u1.set_ae_info; in qat_adm_ring_build_init_msg()
363 aehdr->init_cmd_id = cmd; in qat_adm_ring_build_init_msg()
365 aehdr->init_trgt_id = ae; in qat_adm_ring_build_init_msg()
366 aehdr->init_ring_cluster_id = cluster_id; in qat_adm_ring_build_init_msg()
367 aehdr->init_qat_id = tgt_id; in qat_adm_ring_build_init_msg()
369 qat_adm_ring_build_slice_mask(&aehdr->init_slice_mask, srv_mask, in qat_adm_ring_build_init_msg()
372 qat_adm_ring_build_shram_mask(&aeinfo->init_shram_mask, in qat_adm_ring_build_init_msg()
373 sc->sc_admin_rings.qadr_active_aes_per_accel, in qat_adm_ring_build_init_msg()
374 ae % sc->sc_ae_num); in qat_adm_ring_build_init_msg()
378 ringhdr = &initmsg->u.set_ring_info; in qat_adm_ring_build_init_msg()
379 ringinfo = &initmsg->u1.set_ring_info; in qat_adm_ring_build_init_msg()
381 ringhdr->init_cmd_id = cmd; in qat_adm_ring_build_init_msg()
383 ringhdr->init_trgt_id = ae; in qat_adm_ring_build_init_msg()
387 ae % sc->sc_ae_num); in qat_adm_ring_build_init_msg()
389 ringhdr->init_ring_tbl_sz = sizeof(struct fw_init_ring_table); in qat_adm_ring_build_init_msg()
391 ringinfo->init_ring_table_ptr = in qat_adm_ring_build_init_msg()
392 sc->sc_admin_rings.qadr_dma.qdm_dma_seg.ds_addr + in qat_adm_ring_build_init_msg()
393 ((ae % sc->sc_ae_num) * in qat_adm_ring_build_init_msg()
416 error = qat_etr_put_msg(sc, sc->sc_admin_rings.qadr_admin_tx, in qat_adm_ring_send_init_msg_sync()
423 device_printf(sc->sc_dev, in qat_adm_ring_send_init_msg_sync()
428 device_printf(sc->sc_dev, "Failed to initialize firmware\n"); in qat_adm_ring_send_init_msg_sync()
439 struct qat_admin_rings *qadr = &sc->sc_admin_rings; in qat_adm_ring_send_init_msg()
442 for (ae = 0; ae < sc->sc_ae_num; ae++) { in qat_adm_ring_send_init_msg()
443 uint8_t srv_mask = qadr->qadr_srv_mask[ae]; in qat_adm_ring_send_init_msg()
493 switch (resp->resp_type) { in qat_adm_ring_intr()
497 (uintptr_t)init_resp->comn_resp.opaque_data; in qat_adm_ring_intr()
498 init_cb->qaic_status = in qat_adm_ring_intr()
499 __SHIFTOUT(init_resp->comn_resp.comn_status, in qat_adm_ring_intr()
504 device_printf(sc->sc_dev, in qat_adm_ring_intr()
505 "unknown resp type %d\n", resp->resp_type); in qat_adm_ring_intr()
531 desc->qcd_cipher_blk_sz = HW_AES_BLK_SZ; in qat_hw15_crypto_setup_cipher_desc()
533 cipher_hdr->state_padding_sz = 0; in qat_hw15_crypto_setup_cipher_desc()
534 cipher_hdr->key_sz = qs->qs_cipher_klen / 8; in qat_hw15_crypto_setup_cipher_desc()
536 cipher_hdr->state_sz = desc->qcd_cipher_blk_sz / 8; in qat_hw15_crypto_setup_cipher_desc()
538 cipher_hdr->next_id = next_slice; in qat_hw15_crypto_setup_cipher_desc()
539 cipher_hdr->curr_id = FW_SLICE_CIPHER; in qat_hw15_crypto_setup_cipher_desc()
540 cipher_hdr->offset = hw_blk_offset / 8; in qat_hw15_crypto_setup_cipher_desc()
541 cipher_hdr->resrvd = 0; in qat_hw15_crypto_setup_cipher_desc()
543 return sizeof(struct hw_cipher_config) + qs->qs_cipher_klen; in qat_hw15_crypto_setup_cipher_desc()
554 cipher_config->val = qat_crypto_load_cipher_session(desc, qs); in qat_hw15_crypto_setup_cipher_config()
555 cipher_config->reserved = 0; in qat_hw15_crypto_setup_cipher_config()
558 if (crp != NULL && crp->crp_cipher_key != NULL) in qat_hw15_crypto_setup_cipher_config()
559 key = crp->crp_cipher_key; in qat_hw15_crypto_setup_cipher_config()
561 key = qs->qs_cipher_key; in qat_hw15_crypto_setup_cipher_config()
562 memcpy(cipher_key, key, qs->qs_cipher_klen); in qat_hw15_crypto_setup_cipher_config()
575 auth_hdr->next_id = next_slice; in qat_hw15_crypto_setup_auth_desc()
576 auth_hdr->curr_id = FW_SLICE_AUTH; in qat_hw15_crypto_setup_auth_desc()
577 auth_hdr->offset = hw_blk_offset / 8; in qat_hw15_crypto_setup_auth_desc()
578 auth_hdr->resrvd = 0; in qat_hw15_crypto_setup_auth_desc()
580 auth_hdr->hash_flags = FW_AUTH_HDR_FLAG_NO_NESTED; in qat_hw15_crypto_setup_auth_desc()
581 auth_hdr->u.inner_prefix_sz = 0; in qat_hw15_crypto_setup_auth_desc()
582 auth_hdr->outer_prefix_sz = 0; in qat_hw15_crypto_setup_auth_desc()
583 auth_hdr->final_sz = hash_def->qshd_alg->qshai_digest_len; in qat_hw15_crypto_setup_auth_desc()
584 auth_hdr->inner_state1_sz = in qat_hw15_crypto_setup_auth_desc()
585 roundup(hash_def->qshd_qat->qshqi_state1_len, 8); in qat_hw15_crypto_setup_auth_desc()
586 auth_hdr->inner_res_sz = hash_def->qshd_alg->qshai_digest_len; in qat_hw15_crypto_setup_auth_desc()
587 auth_hdr->inner_state2_sz = in qat_hw15_crypto_setup_auth_desc()
588 roundup(hash_def->qshd_qat->qshqi_state2_len, 8); in qat_hw15_crypto_setup_auth_desc()
589 auth_hdr->inner_state2_off = auth_hdr->offset + in qat_hw15_crypto_setup_auth_desc()
590 ((sizeof(struct hw_auth_setup) + auth_hdr->inner_state1_sz) / 8); in qat_hw15_crypto_setup_auth_desc()
592 auth_hdr->outer_config_off = 0; in qat_hw15_crypto_setup_auth_desc()
593 auth_hdr->outer_state1_sz = 0; in qat_hw15_crypto_setup_auth_desc()
594 auth_hdr->outer_res_sz = 0; in qat_hw15_crypto_setup_auth_desc()
595 auth_hdr->outer_prefix_off = 0; in qat_hw15_crypto_setup_auth_desc()
597 desc->qcd_auth_sz = hash_def->qshd_alg->qshai_sah->hashsize; in qat_hw15_crypto_setup_auth_desc()
598 desc->qcd_state_storage_sz = (sizeof(struct hw_auth_counter) + in qat_hw15_crypto_setup_auth_desc()
599 roundup(hash_def->qshd_alg->qshai_state_size, 8)) / 8; in qat_hw15_crypto_setup_auth_desc()
600 desc->qcd_gcm_aad_sz_offset1 = desc->qcd_auth_offset + in qat_hw15_crypto_setup_auth_desc()
601 sizeof(struct hw_auth_setup) + auth_hdr->inner_state1_sz + in qat_hw15_crypto_setup_auth_desc()
603 desc->qcd_gcm_aad_sz_offset2 = ctrl_blk_offset + in qat_hw15_crypto_setup_auth_desc()
606 return sizeof(struct hw_auth_setup) + auth_hdr->inner_state1_sz + in qat_hw15_crypto_setup_auth_desc()
607 auth_hdr->inner_state2_sz; in qat_hw15_crypto_setup_auth_desc()
620 auth_setup->auth_config.config = qat_crypto_load_auth_session(desc, qs, in qat_hw15_crypto_setup_auth_setup()
622 auth_setup->auth_config.reserved = 0; in qat_hw15_crypto_setup_auth_setup()
624 auth_setup->auth_counter.counter = in qat_hw15_crypto_setup_auth_setup()
625 htobe32(hash_def->qshd_qat->qshqi_auth_counter); in qat_hw15_crypto_setup_auth_setup()
626 auth_setup->auth_counter.reserved = 0; in qat_hw15_crypto_setup_auth_setup()
629 state2 = state1 + roundup(hash_def->qshd_qat->qshqi_state1_len, 8); in qat_hw15_crypto_setup_auth_setup()
630 switch (qs->qs_auth_algo) { in qat_hw15_crypto_setup_auth_setup()
632 qat_crypto_gmac_precompute(desc, qs->qs_cipher_key, in qat_hw15_crypto_setup_auth_setup()
633 qs->qs_cipher_klen, hash_def, state2); in qat_hw15_crypto_setup_auth_setup()
636 state_sz = hash_def->qshd_alg->qshai_state_size; in qat_hw15_crypto_setup_auth_setup()
637 state1_sz = roundup(hash_def->qshd_qat->qshqi_state1_len, 8); in qat_hw15_crypto_setup_auth_setup()
638 state2_sz = roundup(hash_def->qshd_qat->qshqi_state2_len, 8); in qat_hw15_crypto_setup_auth_setup()
639 if (qs->qs_auth_mode == HW_AUTH_MODE1) { in qat_hw15_crypto_setup_auth_setup()
640 state1_pad_len = state1_sz - state_sz; in qat_hw15_crypto_setup_auth_setup()
641 state2_pad_len = state2_sz - state_sz; in qat_hw15_crypto_setup_auth_setup()
651 switch (qs->qs_auth_mode) { in qat_hw15_crypto_setup_auth_setup()
653 memcpy(state1, hash_def->qshd_alg->qshai_init_state, in qat_hw15_crypto_setup_auth_setup()
656 auth_setup->auth_counter.counter = 0; in qat_hw15_crypto_setup_auth_setup()
659 if (crp != NULL && crp->crp_auth_key != NULL) in qat_hw15_crypto_setup_auth_setup()
660 key = crp->crp_auth_key; in qat_hw15_crypto_setup_auth_setup()
662 key = qs->qs_auth_key; in qat_hw15_crypto_setup_auth_setup()
665 qs->qs_auth_klen, hash_def, state1, state2); in qat_hw15_crypto_setup_auth_setup()
670 qs->qs_auth_mode); in qat_hw15_crypto_setup_auth_setup()
675 qs->qs_auth_algo); in qat_hw15_crypto_setup_auth_setup()
695 if (qs->qs_cipher_algo != HW_CIPHER_ALGO_NULL) in qat_hw15_crypto_setup_desc()
697 if (qs->qs_auth_algo != HW_AUTH_ALGO_NULL) in qat_hw15_crypto_setup_desc()
700 ctrl_blk_ptr = desc->qcd_content_desc; in qat_hw15_crypto_setup_desc()
708 switch (desc->qcd_slices[i]) { in qat_hw15_crypto_setup_desc()
714 desc->qcd_cipher_offset = ctrl_blk_sz + hw_blk_offset; in qat_hw15_crypto_setup_desc()
717 desc->qcd_slices[i + 1]); in qat_hw15_crypto_setup_desc()
728 desc->qcd_auth_offset = ctrl_blk_sz + hw_blk_offset; in qat_hw15_crypto_setup_desc()
731 desc->qcd_slices[i + 1]); in qat_hw15_crypto_setup_desc()
748 desc->qcd_hdr_sz = ctrl_blk_offset / 8; in qat_hw15_crypto_setup_desc()
749 desc->qcd_hw_blk_sz = hw_blk_offset / 8; in qat_hw15_crypto_setup_desc()
751 req_cache = (struct fw_la_bulk_req *)desc->qcd_req_cache; in qat_hw15_crypto_setup_desc()
753 &req_cache->comn_hdr.arch_if, in qat_hw15_crypto_setup_desc()
756 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) in qat_hw15_crypto_setup_desc()
764 bus_dmamap_sync(qs->qs_desc_mem.qdm_dma_tag, in qat_hw15_crypto_setup_desc()
765 qs->qs_desc_mem.qdm_dma_map, BUS_DMASYNC_PREWRITE); in qat_hw15_crypto_setup_desc()
778 cdesc = qsc->qsc_content_desc; in qat_hw15_crypto_req_setkey()
779 memcpy(cdesc, desc->qcd_content_desc, CONTENT_DESC_MAX_SIZE); in qat_hw15_crypto_req_setkey()
781 switch (desc->qcd_slices[i]) { in qat_hw15_crypto_req_setkey()
784 (cdesc + desc->qcd_cipher_offset); in qat_hw15_crypto_req_setkey()
790 (cdesc + desc->qcd_auth_offset); in qat_hw15_crypto_req_setkey()
802 bulk_req->comn_hdr.content_desc_addr = qsc->qsc_content_desc_paddr; in qat_hw15_crypto_req_setkey()
817 enum fw_la_cmd_id cmd_id = desc->qcd_cmd_id; in qat_hw15_crypto_setup_req_params()
820 qsbc = &qsc->qsc_bulk_cookie; in qat_hw15_crypto_setup_req_params()
822 bulk_req = (struct fw_la_bulk_req *)qsbc->qsbc_msg; in qat_hw15_crypto_setup_req_params()
823 memcpy(bulk_req, &desc->qcd_req_cache, QAT_HW15_SESSION_REQ_CACHE_SIZE); in qat_hw15_crypto_setup_req_params()
824 bulk_req->comn_hdr.arch_if.resp_pipe_id = qcb->qcb_sym_rx->qr_ring_id; in qat_hw15_crypto_setup_req_params()
825 bulk_req->comn_hdr.comn_req_flags = in qat_hw15_crypto_setup_req_params()
826 qat_hw15_get_comn_req_flags(qcb->qcb_bank % 2); in qat_hw15_crypto_setup_req_params()
827 bulk_req->comn_mid.src_data_addr = qsc->qsc_buffer_list_desc_paddr; in qat_hw15_crypto_setup_req_params()
829 bulk_req->comn_mid.dest_data_addr = in qat_hw15_crypto_setup_req_params()
830 qsc->qsc_obuffer_list_desc_paddr; in qat_hw15_crypto_setup_req_params()
832 bulk_req->comn_mid.dest_data_addr = in qat_hw15_crypto_setup_req_params()
833 qsc->qsc_buffer_list_desc_paddr; in qat_hw15_crypto_setup_req_params()
835 bulk_req->req_params_addr = qsc->qsc_bulk_req_params_buf_paddr; in qat_hw15_crypto_setup_req_params()
836 bulk_req->comn_ftr.next_request_addr = 0; in qat_hw15_crypto_setup_req_params()
837 bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; in qat_hw15_crypto_setup_req_params()
838 if (__predict_false(crp->crp_cipher_key != NULL || in qat_hw15_crypto_setup_req_params()
839 crp->crp_auth_key != NULL)) { in qat_hw15_crypto_setup_req_params()
844 if (desc->qcd_auth_sz != 0) in qat_hw15_crypto_setup_req_params()
845 digest_paddr = qsc->qsc_auth_res_paddr; in qat_hw15_crypto_setup_req_params()
847 req_params_ptr = qsbc->qsbc_req_params_buf; in qat_hw15_crypto_setup_req_params()
848 memset(req_params_ptr, 0, sizeof(qsbc->qsbc_req_params_buf)); in qat_hw15_crypto_setup_req_params()
854 if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) { in qat_hw15_crypto_setup_req_params()
859 cipher_req->cipher_state_sz = desc->qcd_cipher_blk_sz / 8; in qat_hw15_crypto_setup_req_params()
860 cipher_req->curr_id = FW_SLICE_CIPHER; in qat_hw15_crypto_setup_req_params()
862 cipher_req->next_id = FW_SLICE_DRAM_WR; in qat_hw15_crypto_setup_req_params()
864 cipher_req->next_id = FW_SLICE_AUTH; in qat_hw15_crypto_setup_req_params()
865 cipher_req->state_address = qsc->qsc_iv_buf_paddr; in qat_hw15_crypto_setup_req_params()
872 cipher_req->cipher_off = 0; in qat_hw15_crypto_setup_req_params()
873 cipher_req->cipher_len = crp->crp_payload_length; in qat_hw15_crypto_setup_req_params()
875 auth_req->curr_id = FW_SLICE_AUTH; in qat_hw15_crypto_setup_req_params()
877 auth_req->next_id = FW_SLICE_CIPHER; in qat_hw15_crypto_setup_req_params()
879 auth_req->next_id = FW_SLICE_DRAM_WR; in qat_hw15_crypto_setup_req_params()
881 auth_req->auth_res_address = digest_paddr; in qat_hw15_crypto_setup_req_params()
882 auth_req->auth_res_sz = desc->qcd_auth_sz; in qat_hw15_crypto_setup_req_params()
884 auth_req->auth_off = 0; in qat_hw15_crypto_setup_req_params()
885 auth_req->auth_len = crp->crp_payload_length; in qat_hw15_crypto_setup_req_params()
887 auth_req->hash_state_sz = in qat_hw15_crypto_setup_req_params()
888 roundup2(crp->crp_aad_length, QAT_AES_GCM_AAD_ALIGN) >> 3; in qat_hw15_crypto_setup_req_params()
889 auth_req->u1.aad_addr = crp->crp_aad_length > 0 ? in qat_hw15_crypto_setup_req_params()
890 qsc->qsc_gcm_aad_paddr : 0; in qat_hw15_crypto_setup_req_params()
897 aad_sz = htobe32(crp->crp_aad_length); in qat_hw15_crypto_setup_req_params()
899 __DECONST(uint8_t *, desc->qcd_content_desc) + in qat_hw15_crypto_setup_req_params()
900 desc->qcd_gcm_aad_sz_offset1); in qat_hw15_crypto_setup_req_params()
901 aad_szp2 = __DECONST(uint8_t *, desc->qcd_content_desc) + in qat_hw15_crypto_setup_req_params()
902 desc->qcd_gcm_aad_sz_offset2; in qat_hw15_crypto_setup_req_params()
905 *aad_szp2 = (uint8_t)roundup2(crp->crp_aad_length, in qat_hw15_crypto_setup_req_params()
907 bus_dmamap_sync(qs->qs_desc_mem.qdm_dma_tag, in qat_hw15_crypto_setup_req_params()
908 qs->qs_desc_mem.qdm_dma_map, in qat_hw15_crypto_setup_req_params()
920 cipher_req->cipher_state_sz = in qat_hw15_crypto_setup_req_params()
921 desc->qcd_cipher_blk_sz / 8; in qat_hw15_crypto_setup_req_params()
923 cipher_req->curr_id = FW_SLICE_CIPHER; in qat_hw15_crypto_setup_req_params()
924 cipher_req->next_id = next_slice; in qat_hw15_crypto_setup_req_params()
926 if (crp->crp_aad_length == 0) { in qat_hw15_crypto_setup_req_params()
927 cipher_req->cipher_off = 0; in qat_hw15_crypto_setup_req_params()
928 } else if (crp->crp_aad == NULL) { in qat_hw15_crypto_setup_req_params()
929 cipher_req->cipher_off = in qat_hw15_crypto_setup_req_params()
930 crp->crp_payload_start - crp->crp_aad_start; in qat_hw15_crypto_setup_req_params()
932 cipher_req->cipher_off = crp->crp_aad_length; in qat_hw15_crypto_setup_req_params()
934 cipher_req->cipher_len = crp->crp_payload_length; in qat_hw15_crypto_setup_req_params()
935 cipher_req->state_address = qsc->qsc_iv_buf_paddr; in qat_hw15_crypto_setup_req_params()
949 auth_req->curr_id = FW_SLICE_AUTH; in qat_hw15_crypto_setup_req_params()
950 auth_req->next_id = next_slice; in qat_hw15_crypto_setup_req_params()
952 auth_req->auth_res_address = digest_paddr; in qat_hw15_crypto_setup_req_params()
953 auth_req->auth_res_sz = desc->qcd_auth_sz; in qat_hw15_crypto_setup_req_params()
955 auth_req->auth_len = in qat_hw15_crypto_setup_req_params()
956 crp->crp_payload_length + crp->crp_aad_length; in qat_hw15_crypto_setup_req_params()
957 auth_req->auth_off = 0; in qat_hw15_crypto_setup_req_params()
959 auth_req->hash_state_sz = 0; in qat_hw15_crypto_setup_req_params()
960 auth_req->u1.prefix_addr = desc->qcd_hash_state_paddr + in qat_hw15_crypto_setup_req_params()
961 desc->qcd_state_storage_sz; in qat_hw15_crypto_setup_req_params()