1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* Copyright(c) 2022 Intel Corporation */ 3 #ifndef _QAT_COMPRESSION_H_ 4 #define _QAT_COMPRESSION_H_ 5 6 #include <linux/list.h> 7 #include <linux/types.h> 8 #include "adf_accel_devices.h" 9 #include "qat_algs_send.h" 10 11 #define QAT_COMP_MAX_SKID 4096 12 13 struct qat_compression_instance { 14 struct adf_etr_ring_data *dc_tx; 15 struct adf_etr_ring_data *dc_rx; 16 struct adf_accel_dev *accel_dev; 17 struct list_head list; 18 unsigned long state; 19 int id; 20 atomic_t refctr; 21 struct qat_instance_backlog backlog; 22 struct adf_dc_data *dc_data; 23 }; 24 25 static inline bool adf_hw_dev_has_compression(struct adf_accel_dev *accel_dev) 26 { 27 struct adf_hw_device_data *hw_device = accel_dev->hw_device; 28 u32 mask = ~hw_device->accel_capabilities_mask; 29 30 if (mask & ADF_ACCEL_CAPABILITIES_COMPRESSION) 31 return false; 32 33 return true; 34 } 35 36 #endif 37