summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvenkatasubramanian pattu <venkatasubramanianx.pattu@intel.com>2015-07-06 19:48:58 +0800
committerSaul Wold <sgw@linux.intel.com>2015-07-06 07:29:47 -0700
commit5b9412a51a3daba0c6df7d0b67cb0e7ae08f3c75 (patch)
treee0bd79903258c315f2c3b539f8541482b4061442
parent6784740994252ffeb074d46c31904f7909c3fbb7 (diff)
downloadmeta-intel-5b9412a51a3daba0c6df7d0b67cb0e7ae08f3c75.tar.gz
meta-crystalforest: Alternate cleanfile for QAT v1.6 source repository
This patch has dos2unix cleaned file dc_session.h, which is the replacement for the stained file in QAT v1.6 source repository. Signed-off-by: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rwxr-xr-xmeta-crystalforest/recipes-extended/qat/qat16/dc_session.h277
1 files changed, 277 insertions, 0 deletions
diff --git a/meta-crystalforest/recipes-extended/qat/qat16/dc_session.h b/meta-crystalforest/recipes-extended/qat/qat16/dc_session.h
new file mode 100755
index 00000000..b7dc943b
--- /dev/null
+++ b/meta-crystalforest/recipes-extended/qat/qat16/dc_session.h
@@ -0,0 +1,277 @@
1/****************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2007-2013 Intel Corporation. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
22 * The full GNU General Public License is included in this distribution
23 * in the file called LICENSE.GPL.
24 *
25 * Contact Information:
26 * Intel Corporation
27 *
28 * BSD LICENSE
29 *
30 * Copyright(c) 2007-2013 Intel Corporation. All rights reserved.
31 * All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 *
37 * * Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * * Redistributions in binary form must reproduce the above copyright
40 * notice, this list of conditions and the following disclaimer in
41 * the documentation and/or other materials provided with the
42 * distribution.
43 * * Neither the name of Intel Corporation nor the names of its
44 * contributors may be used to endorse or promote products derived
45 * from this software without specific prior written permission.
46 *
47 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
48 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
49 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
50 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
51 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
52 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
53 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
54 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
55 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 *
59 *
60 * version: QAT1.6.L.2.2.0-30
61 *
62 ***************************************************************************/
63
64/**
65 *****************************************************************************
66 * @file dc_session.h
67 *
68 * @ingroup Dc_DataCompression
69 *
70 * @description
71 * Definition of the Data Compression session parameters.
72 *
73 *****************************************************************************/
74#ifndef DC_SESSION_H
75#define DC_SESSION_H
76
77#include "cpa_dc_dp.h"
78#include "icp_adf_transport.h"
79#include "icp_qat_fw_comp.h"
80#include "sal_qat_cmn_msg.h"
81
82/* Defeature Dynamic Compression */
83#define ICP_DC_DYN_NOT_SUPPORTED (1)
84
85/* Maximum number of intermediate buffers SGLs */
86#define DC_MAX_NUM_INTERMEDIATE_BUFFERS (12)
87
88/* Maximum size of the state registers 64 bytes */
89#define DC_QAT_STATE_REGISTERS_MAX_SIZE (64)
90
91/* Size of the history window.
92 * Base 2 logarithm of maximum window size minus 8 */
93#define DC_8K_WINDOW_SIZE (5)
94#define DC_32K_WINDOW_SIZE (7)
95
96/* Context size */
97#define DC_DEFLATE_MAX_CONTEXT_SIZE (49152)
98#define DC_DEFLATE_MEDIUM_CONTEXT_SIZE (40960)
99#define DC_DEFLATE_MIN_CONTEXT_SIZE (32768)
100#define DC_INFLATE_CONTEXT_SIZE (36864)
101
102/* Retrieve the session descriptor pointer from the session context structure
103 * that the user allocates. The pointer to the internally realigned address
104 * is stored at the start of the session context that the user allocates */
105#define DC_SESSION_DESC_FROM_CTX_GET(pSession) \
106 (dc_session_desc_t *) (*(LAC_ARCH_UINT *)pSession)
107
108/* Maximum size for the compression part of the content descriptor */
109#define DC_QAT_COMP_CONTENT_DESC_SIZE \
110 sizeof(icp_qat_fw_comp_cd_hdr_t)
111
112/* Maximum size for the translator part of the content descriptor */
113#define DC_QAT_TRANS_CONTENT_DESC_SIZE \
114 (sizeof(icp_qat_fw_xlt_cd_hdr_t) + DC_QAT_MAX_TRANS_SETUP_BLK_SZ)
115
116/* Maximum size of the decompression content descriptor */
117#define DC_QAT_CONTENT_DESC_DECOMP_MAX_SIZE LAC_ALIGN_POW2_ROUNDUP( \
118 DC_QAT_COMP_CONTENT_DESC_SIZE, \
119 (1 << LAC_64BYTE_ALIGNMENT_SHIFT))
120
121/* Maximum size of the compression content descriptor */
122#define DC_QAT_CONTENT_DESC_COMP_MAX_SIZE LAC_ALIGN_POW2_ROUNDUP( \
123 DC_QAT_COMP_CONTENT_DESC_SIZE + \
124 DC_QAT_TRANS_CONTENT_DESC_SIZE, \
125 (1 << LAC_64BYTE_ALIGNMENT_SHIFT))
126
127/* Direction of the request */
128typedef enum dc_request_dir_e
129{
130 DC_COMPRESSION_REQUEST = 1,
131 DC_DECOMPRESSION_REQUEST
132} dc_request_dir_t;
133
134/* Type of the compression request */
135typedef enum dc_request_type_e
136{
137 DC_REQUEST_FIRST = 1,
138 DC_REQUEST_SUBSEQUENT
139} dc_request_type_t;
140
141/* Session descriptor structure for compression */
142typedef struct dc_session_desc_s
143{
144 Cpa8U stateRegistersComp[DC_QAT_STATE_REGISTERS_MAX_SIZE];
145 /**< State registers for compression */
146 Cpa8U stateRegistersDecomp[DC_QAT_STATE_REGISTERS_MAX_SIZE];
147 /**< State registers for decompression */
148 icp_qat_fw_comp_req_t reqCacheComp;
149 /**< Cache as much as possible of the compression request in a pre-built
150 * request */
151 icp_qat_fw_comp_req_t reqCacheDecomp;
152 /**< Cache as much as possible of the decompression request in a pre-built
153 * request */
154 dc_request_type_t requestType;
155 /**< Type of the compression request. As stateful mode do not support more
156 * than one in-flight request there is no need to use spinlocks */
157 dc_request_type_t previousRequestType;
158 /**< Type of the previous compression request. Used in cases where there the
159 * stateful operation needs to be resubmitted */
160 CpaDcHuffType huffType;
161 /**< Huffman tree type */
162 CpaDcCompType compType;
163 /**< Compression type */
164 CpaDcChecksum checksumType;
165 /**< Type of checksum */
166 CpaDcAutoSelectBest autoSelectBestHuffmanTree;
167 /**< Indicates if the implementation selects the best Huffman encoding */
168 CpaDcSessionDir sessDirection;
169 /**< Session direction */
170 CpaDcSessionState sessState;
171 /**< Session state */
172 Cpa32U deflateWindowSize;
173 /**< Window size */
174 CpaDcCompLvl compLevel;
175 /**< Compression level */
176 CpaDcCallbackFn pCompressionCb;
177 /**< Callback function defined for the traditional compression session */
178 OsalAtomic pendingStatelessCbCount;
179 /**< Keeps track of number of pending requests on stateless session */
180 OsalAtomic pendingStatefulCbCount;
181 /**< Keeps track of number of pending requests on stateful session */
182 Cpa64U pendingDpStatelessCbCount;
183 /**< Keeps track of number of data plane pending requests on stateless
184 * session */
185 lac_lock_t sessionLock;
186 /**< Lock used to provide exclusive access for number of stateful in-flight
187 * requests update */
188 CpaBoolean isDcDp;
189 /**< Indicates if the data plane API is used */
190 Cpa32U minContextSize;
191 /**< Indicates the minimum size required to allocate the context buffer */
192 CpaBufferList *pContextBuffer;
193 /**< Context buffer */
194 Cpa32U historyBuffSize;
195 /**< Size of the history buffer */
196 Cpa64U cumulativeConsumedBytes;
197 /**< Cumulative amount of consumed bytes. Used to build the footer in the
198 * stateful case */
199 Cpa32U previousChecksum;
200 /**< Save the previous value of the checksum. Used to process zero byte
201 * stateful compression or decompression requests */
202 CpaBoolean isSopForCompressionProcessed;
203 /**< Indicates whether a Compression Request is received in this session */
204 CpaBoolean isSopForDecompressionProcessed;
205 /**< Indicates whether a Decompression Request is received in this session */
206#ifdef ICP_LOG_COMP_DATA
207 Cpa32U requestCount;
208 Cpa32U sessionCount;
209 CpaBoolean errorWasFound;
210#endif
211} dc_session_desc_t;
212
213/**
214 *****************************************************************************
215 * @ingroup Dc_DataCompression
216 * Initialise a compression session
217 *
218 * @description
219 * This function will initialise a compression session
220 *
221 * @param[in] dcInstance Instance handle derived from discovery
222 * functions
223 * @param[in,out] pSessionHandle Pointer to a session handle
224 * @param[in,out] pSessionData Pointer to a user instantiated structure
225 * containing session data
226 * @param[in] pContextBuffer Pointer to context buffer
227 *
228 * @param[in] callbackFn For synchronous operation this callback
229 * shall be a null pointer
230 *
231 * @retval CPA_STATUS_SUCCESS Function executed successfully
232 * @retval CPA_STATUS_FAIL Function failed
233 * @retval CPA_STATUS_INVALID_PARAM Invalid parameter passed in
234 * @retval CPA_STATUS_RESOURCE Error related to system resources
235 *****************************************************************************/
236CpaStatus
237dcInitSession(CpaInstanceHandle dcInstance,
238 CpaDcSessionHandle pSessionHandle,
239 CpaDcSessionSetupData* pSessionData,
240 CpaBufferList *pContextBuffer,
241 CpaDcCallbackFn callbackFn);
242
243/**
244 *****************************************************************************
245 * @ingroup Dc_DataCompression
246 * Get the size of the memory required to hold the session information
247 *
248 * @description
249 * This function will get the size of the memory required to hold the
250 * session information
251 *
252 * @param[in] dcInstance Instance handle derived from discovery
253 * functions
254 * @param[in] pSessionData Pointer to a user instantiated structure
255 * containing session data
256 * @param[out] pSessionSize On return, this parameter will be the size
257 * of the memory that will be
258 * required by cpaDcInitSession() for session
259 * data.
260 * @param[out] pContextSize On return, this parameter will be the size
261 * of the memory that will be required
262 * for context data. Context data is
263 * save/restore data including history and
264 * any implementation specific data that is
265 * required for a save/restore operation.
266 *
267 * @retval CPA_STATUS_SUCCESS Function executed successfully
268 * @retval CPA_STATUS_FAIL Function failed
269 * @retval CPA_STATUS_INVALID_PARAM Invalid parameter passed in
270 *****************************************************************************/
271CpaStatus
272dcGetSessionSize(CpaInstanceHandle dcInstance,
273 CpaDcSessionSetupData* pSessionData,
274 Cpa32U* pSessionSize,
275 Cpa32U* pContextSize);
276
277#endif /* DC_SESSION_H */