forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/crypto/qat/qat_common/icp_qat_fw_la.h
....@@ -1,49 +1,5 @@
1
-/*
2
- This file is provided under a dual BSD/GPLv2 license. When using or
3
- redistributing this file, you may do so under either license.
4
-
5
- GPL LICENSE SUMMARY
6
- Copyright(c) 2014 Intel Corporation.
7
- This program is free software; you can redistribute it and/or modify
8
- it under the terms of version 2 of the GNU General Public License as
9
- published by the Free Software Foundation.
10
-
11
- This program is distributed in the hope that it will be useful, but
12
- WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- General Public License for more details.
15
-
16
- Contact Information:
17
- qat-linux@intel.com
18
-
19
- BSD LICENSE
20
- Copyright(c) 2014 Intel Corporation.
21
- Redistribution and use in source and binary forms, with or without
22
- modification, are permitted provided that the following conditions
23
- are met:
24
-
25
- * Redistributions of source code must retain the above copyright
26
- notice, this list of conditions and the following disclaimer.
27
- * Redistributions in binary form must reproduce the above copyright
28
- notice, this list of conditions and the following disclaimer in
29
- the documentation and/or other materials provided with the
30
- distribution.
31
- * Neither the name of Intel Corporation nor the names of its
32
- contributors may be used to endorse or promote products derived
33
- from this software without specific prior written permission.
34
-
35
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46
-*/
1
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
2
+/* Copyright(c) 2014 - 2020 Intel Corporation */
473 #ifndef _ICP_QAT_FW_LA_H_
484 #define _ICP_QAT_FW_LA_H_
495 #include "icp_qat_fw.h"
....@@ -226,14 +182,14 @@
226182 struct icp_qat_fw_cipher_req_hdr_cd_pars {
227183 union {
228184 struct {
229
- uint64_t content_desc_addr;
230
- uint16_t content_desc_resrvd1;
231
- uint8_t content_desc_params_sz;
232
- uint8_t content_desc_hdr_resrvd2;
233
- uint32_t content_desc_resrvd3;
185
+ __u64 content_desc_addr;
186
+ __u16 content_desc_resrvd1;
187
+ __u8 content_desc_params_sz;
188
+ __u8 content_desc_hdr_resrvd2;
189
+ __u32 content_desc_resrvd3;
234190 } s;
235191 struct {
236
- uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
192
+ __u32 cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
237193 } s1;
238194 } u;
239195 };
....@@ -241,70 +197,70 @@
241197 struct icp_qat_fw_cipher_auth_req_hdr_cd_pars {
242198 union {
243199 struct {
244
- uint64_t content_desc_addr;
245
- uint16_t content_desc_resrvd1;
246
- uint8_t content_desc_params_sz;
247
- uint8_t content_desc_hdr_resrvd2;
248
- uint32_t content_desc_resrvd3;
200
+ __u64 content_desc_addr;
201
+ __u16 content_desc_resrvd1;
202
+ __u8 content_desc_params_sz;
203
+ __u8 content_desc_hdr_resrvd2;
204
+ __u32 content_desc_resrvd3;
249205 } s;
250206 struct {
251
- uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
207
+ __u32 cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
252208 } sl;
253209 } u;
254210 };
255211
256212 struct icp_qat_fw_cipher_cd_ctrl_hdr {
257
- uint8_t cipher_state_sz;
258
- uint8_t cipher_key_sz;
259
- uint8_t cipher_cfg_offset;
260
- uint8_t next_curr_id;
261
- uint8_t cipher_padding_sz;
262
- uint8_t resrvd1;
263
- uint16_t resrvd2;
264
- uint32_t resrvd3[ICP_QAT_FW_NUM_LONGWORDS_3];
213
+ __u8 cipher_state_sz;
214
+ __u8 cipher_key_sz;
215
+ __u8 cipher_cfg_offset;
216
+ __u8 next_curr_id;
217
+ __u8 cipher_padding_sz;
218
+ __u8 resrvd1;
219
+ __u16 resrvd2;
220
+ __u32 resrvd3[ICP_QAT_FW_NUM_LONGWORDS_3];
265221 };
266222
267223 struct icp_qat_fw_auth_cd_ctrl_hdr {
268
- uint32_t resrvd1;
269
- uint8_t resrvd2;
270
- uint8_t hash_flags;
271
- uint8_t hash_cfg_offset;
272
- uint8_t next_curr_id;
273
- uint8_t resrvd3;
274
- uint8_t outer_prefix_sz;
275
- uint8_t final_sz;
276
- uint8_t inner_res_sz;
277
- uint8_t resrvd4;
278
- uint8_t inner_state1_sz;
279
- uint8_t inner_state2_offset;
280
- uint8_t inner_state2_sz;
281
- uint8_t outer_config_offset;
282
- uint8_t outer_state1_sz;
283
- uint8_t outer_res_sz;
284
- uint8_t outer_prefix_offset;
224
+ __u32 resrvd1;
225
+ __u8 resrvd2;
226
+ __u8 hash_flags;
227
+ __u8 hash_cfg_offset;
228
+ __u8 next_curr_id;
229
+ __u8 resrvd3;
230
+ __u8 outer_prefix_sz;
231
+ __u8 final_sz;
232
+ __u8 inner_res_sz;
233
+ __u8 resrvd4;
234
+ __u8 inner_state1_sz;
235
+ __u8 inner_state2_offset;
236
+ __u8 inner_state2_sz;
237
+ __u8 outer_config_offset;
238
+ __u8 outer_state1_sz;
239
+ __u8 outer_res_sz;
240
+ __u8 outer_prefix_offset;
285241 };
286242
287243 struct icp_qat_fw_cipher_auth_cd_ctrl_hdr {
288
- uint8_t cipher_state_sz;
289
- uint8_t cipher_key_sz;
290
- uint8_t cipher_cfg_offset;
291
- uint8_t next_curr_id_cipher;
292
- uint8_t cipher_padding_sz;
293
- uint8_t hash_flags;
294
- uint8_t hash_cfg_offset;
295
- uint8_t next_curr_id_auth;
296
- uint8_t resrvd1;
297
- uint8_t outer_prefix_sz;
298
- uint8_t final_sz;
299
- uint8_t inner_res_sz;
300
- uint8_t resrvd2;
301
- uint8_t inner_state1_sz;
302
- uint8_t inner_state2_offset;
303
- uint8_t inner_state2_sz;
304
- uint8_t outer_config_offset;
305
- uint8_t outer_state1_sz;
306
- uint8_t outer_res_sz;
307
- uint8_t outer_prefix_offset;
244
+ __u8 cipher_state_sz;
245
+ __u8 cipher_key_sz;
246
+ __u8 cipher_cfg_offset;
247
+ __u8 next_curr_id_cipher;
248
+ __u8 cipher_padding_sz;
249
+ __u8 hash_flags;
250
+ __u8 hash_cfg_offset;
251
+ __u8 next_curr_id_auth;
252
+ __u8 resrvd1;
253
+ __u8 outer_prefix_sz;
254
+ __u8 final_sz;
255
+ __u8 inner_res_sz;
256
+ __u8 resrvd2;
257
+ __u8 inner_state1_sz;
258
+ __u8 inner_state2_offset;
259
+ __u8 inner_state2_sz;
260
+ __u8 outer_config_offset;
261
+ __u8 outer_state1_sz;
262
+ __u8 outer_res_sz;
263
+ __u8 outer_prefix_offset;
308264 };
309265
310266 #define ICP_QAT_FW_AUTH_HDR_FLAG_DO_NESTED 1
....@@ -315,48 +271,48 @@
315271 #define ICP_QAT_FW_CIPHER_REQUEST_PARAMETERS_OFFSET (0)
316272
317273 struct icp_qat_fw_la_cipher_req_params {
318
- uint32_t cipher_offset;
319
- uint32_t cipher_length;
274
+ __u32 cipher_offset;
275
+ __u32 cipher_length;
320276 union {
321
- uint32_t cipher_IV_array[ICP_QAT_FW_NUM_LONGWORDS_4];
277
+ __u32 cipher_IV_array[ICP_QAT_FW_NUM_LONGWORDS_4];
322278 struct {
323
- uint64_t cipher_IV_ptr;
324
- uint64_t resrvd1;
279
+ __u64 cipher_IV_ptr;
280
+ __u64 resrvd1;
325281 } s;
326282 } u;
327283 };
328284
329285 struct icp_qat_fw_la_auth_req_params {
330
- uint32_t auth_off;
331
- uint32_t auth_len;
286
+ __u32 auth_off;
287
+ __u32 auth_len;
332288 union {
333
- uint64_t auth_partial_st_prefix;
334
- uint64_t aad_adr;
289
+ __u64 auth_partial_st_prefix;
290
+ __u64 aad_adr;
335291 } u1;
336
- uint64_t auth_res_addr;
292
+ __u64 auth_res_addr;
337293 union {
338
- uint8_t inner_prefix_sz;
339
- uint8_t aad_sz;
294
+ __u8 inner_prefix_sz;
295
+ __u8 aad_sz;
340296 } u2;
341
- uint8_t resrvd1;
342
- uint8_t hash_state_sz;
343
- uint8_t auth_res_sz;
297
+ __u8 resrvd1;
298
+ __u8 hash_state_sz;
299
+ __u8 auth_res_sz;
344300 } __packed;
345301
346302 struct icp_qat_fw_la_auth_req_params_resrvd_flds {
347
- uint32_t resrvd[ICP_QAT_FW_NUM_LONGWORDS_6];
303
+ __u32 resrvd[ICP_QAT_FW_NUM_LONGWORDS_6];
348304 union {
349
- uint8_t inner_prefix_sz;
350
- uint8_t aad_sz;
305
+ __u8 inner_prefix_sz;
306
+ __u8 aad_sz;
351307 } u2;
352
- uint8_t resrvd1;
353
- uint16_t resrvd2;
308
+ __u8 resrvd1;
309
+ __u16 resrvd2;
354310 };
355311
356312 struct icp_qat_fw_la_resp {
357313 struct icp_qat_fw_comn_resp_hdr comn_resp;
358
- uint64_t opaque_data;
359
- uint32_t resrvd[ICP_QAT_FW_NUM_LONGWORDS_4];
314
+ __u64 opaque_data;
315
+ __u32 resrvd[ICP_QAT_FW_NUM_LONGWORDS_4];
360316 };
361317
362318 #define ICP_QAT_FW_CIPHER_NEXT_ID_GET(cd_ctrl_hdr_t) \