1 /* SPDX-License-Identifier: BSD-3-Clause */ 2 /* Copyright(c) 2007-2022 Intel Corporation */ 3 /* $FreeBSD$ */ 4 /** 5 *************************************************************************** 6 * @file sal_hw_gen.h 7 * 8 * @ingroup SalHwGen 9 * 10 * @description 11 * Functions which return a value corresponding to qat device generation 12 * 13 ***************************************************************************/ 14 15 #ifndef SAL_HW_GEN_H 16 #define SAL_HW_GEN_H 17 18 #include "cpa.h" 19 #include "sal_types_compression.h" 20 #include "lac_sal_types_crypto.h" 21 22 /** 23 *************************************************************************** 24 * @ingroup SalHwGen 25 * 26 * @description This function returns whether qat device is gen 4 or not 27 * 28 * @param[in] pService pointer to compression service 29 * 30 ***************************************************************************/ 31 32 static inline CpaBoolean 33 isDcGen4x(const sal_compression_service_t *pService) 34 { 35 return (pService->generic_service_info.gen == GEN4); 36 } 37 38 /** 39 *************************************************************************** 40 * @ingroup SalHwGen 41 * 42 * @description This function returns whether qat device is gen 2/3 or not 43 * 44 * @param[in] pService pointer to compression service 45 * 46 ***************************************************************************/ 47 48 static inline CpaBoolean 49 isDcGen2x(const sal_compression_service_t *pService) 50 { 51 return ((pService->generic_service_info.gen == GEN2) || 52 (pService->generic_service_info.gen == GEN3)); 53 } 54 55 /** 56 *************************************************************************** 57 * @ingroup SalHwGen 58 * 59 * @description This function returns whether qat device is gen 4 or not 60 * 61 * @param[in] pService pointer to crypto service 62 * 63 ***************************************************************************/ 64 65 static inline CpaBoolean 66 isCyGen4x(const sal_crypto_service_t *pService) 67 { 68 return (pService->generic_service_info.gen == GEN4); 69 } 70 71 /** 72 *************************************************************************** 73 * @ingroup SalHwGen 74 * 75 * @description This function returns whether qat device is gen 2/3 or not 76 * 77 * @param[in] pService pointer to crypto service 78 * 79 ***************************************************************************/ 80 81 static inline CpaBoolean 82 isCyGen2x(const sal_crypto_service_t *pService) 83 { 84 return ((pService->generic_service_info.gen == GEN2) || 85 (pService->generic_service_info.gen == GEN3)); 86 } 87 88 #endif /* SAL_HW_GEN_H */ 89