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