18846a756SAnoob Joseph /* SPDX-License-Identifier: BSD-3-Clause 28846a756SAnoob Joseph * Copyright(c) 2018 Cavium, Inc 38846a756SAnoob Joseph */ 48846a756SAnoob Joseph 58846a756SAnoob Joseph #ifndef _CPT_PMD_OPS_HELPER_H_ 68846a756SAnoob Joseph #define _CPT_PMD_OPS_HELPER_H_ 78846a756SAnoob Joseph 8*1094dd94SDavid Marchand #include <rte_compat.h> 9*1094dd94SDavid Marchand 108846a756SAnoob Joseph /* 118846a756SAnoob Joseph * This file defines the agreement between the common layer and the individual 128846a756SAnoob Joseph * crypto drivers for OCTEON TX series. Control path in otx* directory can 138846a756SAnoob Joseph * directly call functions declared here. 148846a756SAnoob Joseph */ 158846a756SAnoob Joseph 168846a756SAnoob Joseph /* 178846a756SAnoob Joseph * Get meta length required when operating in direct mode (single buffer 188846a756SAnoob Joseph * in-place) 198846a756SAnoob Joseph * 208846a756SAnoob Joseph * @return 218846a756SAnoob Joseph * - length 228846a756SAnoob Joseph */ 236f2dc9c0SDavid Marchand __rte_internal 248846a756SAnoob Joseph int32_t 258846a756SAnoob Joseph cpt_pmd_ops_helper_get_mlen_direct_mode(void); 268846a756SAnoob Joseph 278846a756SAnoob Joseph /* 288846a756SAnoob Joseph * Get size of contiguous meta buffer to be allocated when working in scatter 298846a756SAnoob Joseph * gather mode. 308846a756SAnoob Joseph * 318846a756SAnoob Joseph * @return 328846a756SAnoob Joseph * - length 338846a756SAnoob Joseph */ 346f2dc9c0SDavid Marchand __rte_internal 358846a756SAnoob Joseph int 368846a756SAnoob Joseph cpt_pmd_ops_helper_get_mlen_sg_mode(void); 37fadc1ea1SKanaka Durga Kotamarthy 38fadc1ea1SKanaka Durga Kotamarthy /* 39fadc1ea1SKanaka Durga Kotamarthy * Get size of meta buffer to be allocated for asymmetric crypto operations 40fadc1ea1SKanaka Durga Kotamarthy * 41fadc1ea1SKanaka Durga Kotamarthy * @return 42fadc1ea1SKanaka Durga Kotamarthy * - length 43fadc1ea1SKanaka Durga Kotamarthy */ 446f2dc9c0SDavid Marchand __rte_internal 45fadc1ea1SKanaka Durga Kotamarthy int 46fadc1ea1SKanaka Durga Kotamarthy cpt_pmd_ops_helper_asym_get_mlen(void); 47aa2cbd32SSunila Sahu 48aa2cbd32SSunila Sahu /* 49aa2cbd32SSunila Sahu * Initialize ECC FMUL precomputed table 50aa2cbd32SSunila Sahu * 51aa2cbd32SSunila Sahu * @param 52aa2cbd32SSunila Sahu * - pointer to fpm_table iova address 53aa2cbd32SSunila Sahu * 54aa2cbd32SSunila Sahu * @return 55aa2cbd32SSunila Sahu * - 0 on success, negative on error 56aa2cbd32SSunila Sahu */ 576f2dc9c0SDavid Marchand __rte_internal 58aa2cbd32SSunila Sahu int cpt_fpm_init(uint64_t *fpm_table_iova); 59aa2cbd32SSunila Sahu 60aa2cbd32SSunila Sahu /* 61aa2cbd32SSunila Sahu * Clear ECC FMUL precomputed table 62aa2cbd32SSunila Sahu */ 636f2dc9c0SDavid Marchand __rte_internal 64aa2cbd32SSunila Sahu void cpt_fpm_clear(void); 65aa2cbd32SSunila Sahu 668846a756SAnoob Joseph #endif /* _CPT_PMD_OPS_HELPER_H_ */ 67