| .. | .. |
|---|
| 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 */ |
|---|
| 47 | 3 | #ifndef _ICP_QAT_FW_LA_H_ |
|---|
| 48 | 4 | #define _ICP_QAT_FW_LA_H_ |
|---|
| 49 | 5 | #include "icp_qat_fw.h" |
|---|
| .. | .. |
|---|
| 226 | 182 | struct icp_qat_fw_cipher_req_hdr_cd_pars { |
|---|
| 227 | 183 | union { |
|---|
| 228 | 184 | 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; |
|---|
| 234 | 190 | } s; |
|---|
| 235 | 191 | struct { |
|---|
| 236 | | - uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 192 | + __u32 cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 237 | 193 | } s1; |
|---|
| 238 | 194 | } u; |
|---|
| 239 | 195 | }; |
|---|
| .. | .. |
|---|
| 241 | 197 | struct icp_qat_fw_cipher_auth_req_hdr_cd_pars { |
|---|
| 242 | 198 | union { |
|---|
| 243 | 199 | 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; |
|---|
| 249 | 205 | } s; |
|---|
| 250 | 206 | struct { |
|---|
| 251 | | - uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 207 | + __u32 cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 252 | 208 | } sl; |
|---|
| 253 | 209 | } u; |
|---|
| 254 | 210 | }; |
|---|
| 255 | 211 | |
|---|
| 256 | 212 | 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]; |
|---|
| 265 | 221 | }; |
|---|
| 266 | 222 | |
|---|
| 267 | 223 | 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; |
|---|
| 285 | 241 | }; |
|---|
| 286 | 242 | |
|---|
| 287 | 243 | 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; |
|---|
| 308 | 264 | }; |
|---|
| 309 | 265 | |
|---|
| 310 | 266 | #define ICP_QAT_FW_AUTH_HDR_FLAG_DO_NESTED 1 |
|---|
| .. | .. |
|---|
| 315 | 271 | #define ICP_QAT_FW_CIPHER_REQUEST_PARAMETERS_OFFSET (0) |
|---|
| 316 | 272 | |
|---|
| 317 | 273 | 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; |
|---|
| 320 | 276 | union { |
|---|
| 321 | | - uint32_t cipher_IV_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 277 | + __u32 cipher_IV_array[ICP_QAT_FW_NUM_LONGWORDS_4]; |
|---|
| 322 | 278 | struct { |
|---|
| 323 | | - uint64_t cipher_IV_ptr; |
|---|
| 324 | | - uint64_t resrvd1; |
|---|
| 279 | + __u64 cipher_IV_ptr; |
|---|
| 280 | + __u64 resrvd1; |
|---|
| 325 | 281 | } s; |
|---|
| 326 | 282 | } u; |
|---|
| 327 | 283 | }; |
|---|
| 328 | 284 | |
|---|
| 329 | 285 | 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; |
|---|
| 332 | 288 | union { |
|---|
| 333 | | - uint64_t auth_partial_st_prefix; |
|---|
| 334 | | - uint64_t aad_adr; |
|---|
| 289 | + __u64 auth_partial_st_prefix; |
|---|
| 290 | + __u64 aad_adr; |
|---|
| 335 | 291 | } u1; |
|---|
| 336 | | - uint64_t auth_res_addr; |
|---|
| 292 | + __u64 auth_res_addr; |
|---|
| 337 | 293 | union { |
|---|
| 338 | | - uint8_t inner_prefix_sz; |
|---|
| 339 | | - uint8_t aad_sz; |
|---|
| 294 | + __u8 inner_prefix_sz; |
|---|
| 295 | + __u8 aad_sz; |
|---|
| 340 | 296 | } 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; |
|---|
| 344 | 300 | } __packed; |
|---|
| 345 | 301 | |
|---|
| 346 | 302 | 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]; |
|---|
| 348 | 304 | union { |
|---|
| 349 | | - uint8_t inner_prefix_sz; |
|---|
| 350 | | - uint8_t aad_sz; |
|---|
| 305 | + __u8 inner_prefix_sz; |
|---|
| 306 | + __u8 aad_sz; |
|---|
| 351 | 307 | } u2; |
|---|
| 352 | | - uint8_t resrvd1; |
|---|
| 353 | | - uint16_t resrvd2; |
|---|
| 308 | + __u8 resrvd1; |
|---|
| 309 | + __u16 resrvd2; |
|---|
| 354 | 310 | }; |
|---|
| 355 | 311 | |
|---|
| 356 | 312 | struct icp_qat_fw_la_resp { |
|---|
| 357 | 313 | 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]; |
|---|
| 360 | 316 | }; |
|---|
| 361 | 317 | |
|---|
| 362 | 318 | #define ICP_QAT_FW_CIPHER_NEXT_ID_GET(cd_ctrl_hdr_t) \ |
|---|