icp_qat_fw_la.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. GPL LICENSE SUMMARY
  5. Copyright(c) 2014 Intel Corporation.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License as
  8. published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. General Public License for more details.
  13. Contact Information:
  14. qat-linux@intel.com
  15. BSD LICENSE
  16. Copyright(c) 2014 Intel Corporation.
  17. Redistribution and use in source and binary forms, with or without
  18. modification, are permitted provided that the following conditions
  19. are met:
  20. * Redistributions of source code must retain the above copyright
  21. notice, this list of conditions and the following disclaimer.
  22. * Redistributions in binary form must reproduce the above copyright
  23. notice, this list of conditions and the following disclaimer in
  24. the documentation and/or other materials provided with the
  25. distribution.
  26. * Neither the name of Intel Corporation nor the names of its
  27. contributors may be used to endorse or promote products derived
  28. from this software without specific prior written permission.
  29. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. */
  41. #ifndef _ICP_QAT_FW_LA_H_
  42. #define _ICP_QAT_FW_LA_H_
  43. #include "icp_qat_fw.h"
  44. enum icp_qat_fw_la_cmd_id {
  45. ICP_QAT_FW_LA_CMD_CIPHER = 0,
  46. ICP_QAT_FW_LA_CMD_AUTH = 1,
  47. ICP_QAT_FW_LA_CMD_CIPHER_HASH = 2,
  48. ICP_QAT_FW_LA_CMD_HASH_CIPHER = 3,
  49. ICP_QAT_FW_LA_CMD_TRNG_GET_RANDOM = 4,
  50. ICP_QAT_FW_LA_CMD_TRNG_TEST = 5,
  51. ICP_QAT_FW_LA_CMD_SSL3_KEY_DERIVE = 6,
  52. ICP_QAT_FW_LA_CMD_TLS_V1_1_KEY_DERIVE = 7,
  53. ICP_QAT_FW_LA_CMD_TLS_V1_2_KEY_DERIVE = 8,
  54. ICP_QAT_FW_LA_CMD_MGF1 = 9,
  55. ICP_QAT_FW_LA_CMD_AUTH_PRE_COMP = 10,
  56. ICP_QAT_FW_LA_CMD_CIPHER_PRE_COMP = 11,
  57. ICP_QAT_FW_LA_CMD_DELIMITER = 12
  58. };
  59. #define ICP_QAT_FW_LA_ICV_VER_STATUS_PASS ICP_QAT_FW_COMN_STATUS_FLAG_OK
  60. #define ICP_QAT_FW_LA_ICV_VER_STATUS_FAIL ICP_QAT_FW_COMN_STATUS_FLAG_ERROR
  61. #define ICP_QAT_FW_LA_TRNG_STATUS_PASS ICP_QAT_FW_COMN_STATUS_FLAG_OK
  62. #define ICP_QAT_FW_LA_TRNG_STATUS_FAIL ICP_QAT_FW_COMN_STATUS_FLAG_ERROR
  63. struct icp_qat_fw_la_bulk_req {
  64. struct icp_qat_fw_comn_req_hdr comn_hdr;
  65. struct icp_qat_fw_comn_req_hdr_cd_pars cd_pars;
  66. struct icp_qat_fw_comn_req_mid comn_mid;
  67. struct icp_qat_fw_comn_req_rqpars serv_specif_rqpars;
  68. struct icp_qat_fw_comn_req_cd_ctrl cd_ctrl;
  69. };
  70. #define ICP_QAT_FW_LA_GCM_IV_LEN_12_OCTETS 1
  71. #define ICP_QAT_FW_LA_GCM_IV_LEN_NOT_12_OCTETS 0
  72. #define QAT_FW_LA_ZUC_3G_PROTO_FLAG_BITPOS 12
  73. #define ICP_QAT_FW_LA_ZUC_3G_PROTO 1
  74. #define QAT_FW_LA_ZUC_3G_PROTO_FLAG_MASK 0x1
  75. #define QAT_LA_GCM_IV_LEN_FLAG_BITPOS 11
  76. #define QAT_LA_GCM_IV_LEN_FLAG_MASK 0x1
  77. #define ICP_QAT_FW_LA_DIGEST_IN_BUFFER 1
  78. #define ICP_QAT_FW_LA_NO_DIGEST_IN_BUFFER 0
  79. #define QAT_LA_DIGEST_IN_BUFFER_BITPOS 10
  80. #define QAT_LA_DIGEST_IN_BUFFER_MASK 0x1
  81. #define ICP_QAT_FW_LA_SNOW_3G_PROTO 4
  82. #define ICP_QAT_FW_LA_GCM_PROTO 2
  83. #define ICP_QAT_FW_LA_CCM_PROTO 1
  84. #define ICP_QAT_FW_LA_NO_PROTO 0
  85. #define QAT_LA_PROTO_BITPOS 7
  86. #define QAT_LA_PROTO_MASK 0x7
  87. #define ICP_QAT_FW_LA_CMP_AUTH_RES 1
  88. #define ICP_QAT_FW_LA_NO_CMP_AUTH_RES 0
  89. #define QAT_LA_CMP_AUTH_RES_BITPOS 6
  90. #define QAT_LA_CMP_AUTH_RES_MASK 0x1
  91. #define ICP_QAT_FW_LA_RET_AUTH_RES 1
  92. #define ICP_QAT_FW_LA_NO_RET_AUTH_RES 0
  93. #define QAT_LA_RET_AUTH_RES_BITPOS 5
  94. #define QAT_LA_RET_AUTH_RES_MASK 0x1
  95. #define ICP_QAT_FW_LA_UPDATE_STATE 1
  96. #define ICP_QAT_FW_LA_NO_UPDATE_STATE 0
  97. #define QAT_LA_UPDATE_STATE_BITPOS 4
  98. #define QAT_LA_UPDATE_STATE_MASK 0x1
  99. #define ICP_QAT_FW_CIPH_AUTH_CFG_OFFSET_IN_CD_SETUP 0
  100. #define ICP_QAT_FW_CIPH_AUTH_CFG_OFFSET_IN_SHRAM_CP 1
  101. #define QAT_LA_CIPH_AUTH_CFG_OFFSET_BITPOS 3
  102. #define QAT_LA_CIPH_AUTH_CFG_OFFSET_MASK 0x1
  103. #define ICP_QAT_FW_CIPH_IV_64BIT_PTR 0
  104. #define ICP_QAT_FW_CIPH_IV_16BYTE_DATA 1
  105. #define QAT_LA_CIPH_IV_FLD_BITPOS 2
  106. #define QAT_LA_CIPH_IV_FLD_MASK 0x1
  107. #define ICP_QAT_FW_LA_PARTIAL_NONE 0
  108. #define ICP_QAT_FW_LA_PARTIAL_START 1
  109. #define ICP_QAT_FW_LA_PARTIAL_MID 3
  110. #define ICP_QAT_FW_LA_PARTIAL_END 2
  111. #define QAT_LA_PARTIAL_BITPOS 0
  112. #define QAT_LA_PARTIAL_MASK 0x3
  113. #define ICP_QAT_FW_LA_FLAGS_BUILD(zuc_proto, gcm_iv_len, auth_rslt, proto, \
  114. cmp_auth, ret_auth, update_state, \
  115. ciph_iv, ciphcfg, partial) \
  116. (((zuc_proto & QAT_FW_LA_ZUC_3G_PROTO_FLAG_MASK) << \
  117. QAT_FW_LA_ZUC_3G_PROTO_FLAG_BITPOS) | \
  118. ((gcm_iv_len & QAT_LA_GCM_IV_LEN_FLAG_MASK) << \
  119. QAT_LA_GCM_IV_LEN_FLAG_BITPOS) | \
  120. ((auth_rslt & QAT_LA_DIGEST_IN_BUFFER_MASK) << \
  121. QAT_LA_DIGEST_IN_BUFFER_BITPOS) | \
  122. ((proto & QAT_LA_PROTO_MASK) << \
  123. QAT_LA_PROTO_BITPOS) | \
  124. ((cmp_auth & QAT_LA_CMP_AUTH_RES_MASK) << \
  125. QAT_LA_CMP_AUTH_RES_BITPOS) | \
  126. ((ret_auth & QAT_LA_RET_AUTH_RES_MASK) << \
  127. QAT_LA_RET_AUTH_RES_BITPOS) | \
  128. ((update_state & QAT_LA_UPDATE_STATE_MASK) << \
  129. QAT_LA_UPDATE_STATE_BITPOS) | \
  130. ((ciph_iv & QAT_LA_CIPH_IV_FLD_MASK) << \
  131. QAT_LA_CIPH_IV_FLD_BITPOS) | \
  132. ((ciphcfg & QAT_LA_CIPH_AUTH_CFG_OFFSET_MASK) << \
  133. QAT_LA_CIPH_AUTH_CFG_OFFSET_BITPOS) | \
  134. ((partial & QAT_LA_PARTIAL_MASK) << \
  135. QAT_LA_PARTIAL_BITPOS))
  136. #define ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_GET(flags) \
  137. QAT_FIELD_GET(flags, QAT_LA_CIPH_IV_FLD_BITPOS, \
  138. QAT_LA_CIPH_IV_FLD_MASK)
  139. #define ICP_QAT_FW_LA_CIPH_AUTH_CFG_OFFSET_FLAG_GET(flags) \
  140. QAT_FIELD_GET(flags, QAT_LA_CIPH_AUTH_CFG_OFFSET_BITPOS, \
  141. QAT_LA_CIPH_AUTH_CFG_OFFSET_MASK)
  142. #define ICP_QAT_FW_LA_ZUC_3G_PROTO_FLAG_GET(flags) \
  143. QAT_FIELD_GET(flags, QAT_FW_LA_ZUC_3G_PROTO_FLAG_BITPOS, \
  144. QAT_FW_LA_ZUC_3G_PROTO_FLAG_MASK)
  145. #define ICP_QAT_FW_LA_GCM_IV_LEN_FLAG_GET(flags) \
  146. QAT_FIELD_GET(flags, QAT_LA_GCM_IV_LEN_FLAG_BITPOS, \
  147. QAT_LA_GCM_IV_LEN_FLAG_MASK)
  148. #define ICP_QAT_FW_LA_PROTO_GET(flags) \
  149. QAT_FIELD_GET(flags, QAT_LA_PROTO_BITPOS, QAT_LA_PROTO_MASK)
  150. #define ICP_QAT_FW_LA_CMP_AUTH_GET(flags) \
  151. QAT_FIELD_GET(flags, QAT_LA_CMP_AUTH_RES_BITPOS, \
  152. QAT_LA_CMP_AUTH_RES_MASK)
  153. #define ICP_QAT_FW_LA_RET_AUTH_GET(flags) \
  154. QAT_FIELD_GET(flags, QAT_LA_RET_AUTH_RES_BITPOS, \
  155. QAT_LA_RET_AUTH_RES_MASK)
  156. #define ICP_QAT_FW_LA_DIGEST_IN_BUFFER_GET(flags) \
  157. QAT_FIELD_GET(flags, QAT_LA_DIGEST_IN_BUFFER_BITPOS, \
  158. QAT_LA_DIGEST_IN_BUFFER_MASK)
  159. #define ICP_QAT_FW_LA_UPDATE_STATE_GET(flags) \
  160. QAT_FIELD_GET(flags, QAT_LA_UPDATE_STATE_BITPOS, \
  161. QAT_LA_UPDATE_STATE_MASK)
  162. #define ICP_QAT_FW_LA_PARTIAL_GET(flags) \
  163. QAT_FIELD_GET(flags, QAT_LA_PARTIAL_BITPOS, \
  164. QAT_LA_PARTIAL_MASK)
  165. #define ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(flags, val) \
  166. QAT_FIELD_SET(flags, val, QAT_LA_CIPH_IV_FLD_BITPOS, \
  167. QAT_LA_CIPH_IV_FLD_MASK)
  168. #define ICP_QAT_FW_LA_CIPH_AUTH_CFG_OFFSET_FLAG_SET(flags, val) \
  169. QAT_FIELD_SET(flags, val, QAT_LA_CIPH_AUTH_CFG_OFFSET_BITPOS, \
  170. QAT_LA_CIPH_AUTH_CFG_OFFSET_MASK)
  171. #define ICP_QAT_FW_LA_ZUC_3G_PROTO_FLAG_SET(flags, val) \
  172. QAT_FIELD_SET(flags, val, QAT_FW_LA_ZUC_3G_PROTO_FLAG_BITPOS, \
  173. QAT_FW_LA_ZUC_3G_PROTO_FLAG_MASK)
  174. #define ICP_QAT_FW_LA_GCM_IV_LEN_FLAG_SET(flags, val) \
  175. QAT_FIELD_SET(flags, val, QAT_LA_GCM_IV_LEN_FLAG_BITPOS, \
  176. QAT_LA_GCM_IV_LEN_FLAG_MASK)
  177. #define ICP_QAT_FW_LA_PROTO_SET(flags, val) \
  178. QAT_FIELD_SET(flags, val, QAT_LA_PROTO_BITPOS, \
  179. QAT_LA_PROTO_MASK)
  180. #define ICP_QAT_FW_LA_CMP_AUTH_SET(flags, val) \
  181. QAT_FIELD_SET(flags, val, QAT_LA_CMP_AUTH_RES_BITPOS, \
  182. QAT_LA_CMP_AUTH_RES_MASK)
  183. #define ICP_QAT_FW_LA_RET_AUTH_SET(flags, val) \
  184. QAT_FIELD_SET(flags, val, QAT_LA_RET_AUTH_RES_BITPOS, \
  185. QAT_LA_RET_AUTH_RES_MASK)
  186. #define ICP_QAT_FW_LA_DIGEST_IN_BUFFER_SET(flags, val) \
  187. QAT_FIELD_SET(flags, val, QAT_LA_DIGEST_IN_BUFFER_BITPOS, \
  188. QAT_LA_DIGEST_IN_BUFFER_MASK)
  189. #define ICP_QAT_FW_LA_UPDATE_STATE_SET(flags, val) \
  190. QAT_FIELD_SET(flags, val, QAT_LA_UPDATE_STATE_BITPOS, \
  191. QAT_LA_UPDATE_STATE_MASK)
  192. #define ICP_QAT_FW_LA_PARTIAL_SET(flags, val) \
  193. QAT_FIELD_SET(flags, val, QAT_LA_PARTIAL_BITPOS, \
  194. QAT_LA_PARTIAL_MASK)
  195. struct icp_qat_fw_cipher_req_hdr_cd_pars {
  196. union {
  197. struct {
  198. uint64_t content_desc_addr;
  199. uint16_t content_desc_resrvd1;
  200. uint8_t content_desc_params_sz;
  201. uint8_t content_desc_hdr_resrvd2;
  202. uint32_t content_desc_resrvd3;
  203. } s;
  204. struct {
  205. uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
  206. } s1;
  207. } u;
  208. };
  209. struct icp_qat_fw_cipher_auth_req_hdr_cd_pars {
  210. union {
  211. struct {
  212. uint64_t content_desc_addr;
  213. uint16_t content_desc_resrvd1;
  214. uint8_t content_desc_params_sz;
  215. uint8_t content_desc_hdr_resrvd2;
  216. uint32_t content_desc_resrvd3;
  217. } s;
  218. struct {
  219. uint32_t cipher_key_array[ICP_QAT_FW_NUM_LONGWORDS_4];
  220. } sl;
  221. } u;
  222. };
  223. struct icp_qat_fw_cipher_cd_ctrl_hdr {
  224. uint8_t cipher_state_sz;
  225. uint8_t cipher_key_sz;
  226. uint8_t cipher_cfg_offset;
  227. uint8_t next_curr_id;
  228. uint8_t cipher_padding_sz;
  229. uint8_t resrvd1;
  230. uint16_t resrvd2;
  231. uint32_t resrvd3[ICP_QAT_FW_NUM_LONGWORDS_3];
  232. };
  233. struct icp_qat_fw_auth_cd_ctrl_hdr {
  234. uint32_t resrvd1;
  235. uint8_t resrvd2;
  236. uint8_t hash_flags;
  237. uint8_t hash_cfg_offset;
  238. uint8_t next_curr_id;
  239. uint8_t resrvd3;
  240. uint8_t outer_prefix_sz;
  241. uint8_t final_sz;
  242. uint8_t inner_res_sz;
  243. uint8_t resrvd4;
  244. uint8_t inner_state1_sz;
  245. uint8_t inner_state2_offset;
  246. uint8_t inner_state2_sz;
  247. uint8_t outer_config_offset;
  248. uint8_t outer_state1_sz;
  249. uint8_t outer_res_sz;
  250. uint8_t outer_prefix_offset;
  251. };
  252. struct icp_qat_fw_cipher_auth_cd_ctrl_hdr {
  253. uint8_t cipher_state_sz;
  254. uint8_t cipher_key_sz;
  255. uint8_t cipher_cfg_offset;
  256. uint8_t next_curr_id_cipher;
  257. uint8_t cipher_padding_sz;
  258. uint8_t hash_flags;
  259. uint8_t hash_cfg_offset;
  260. uint8_t next_curr_id_auth;
  261. uint8_t resrvd1;
  262. uint8_t outer_prefix_sz;
  263. uint8_t final_sz;
  264. uint8_t inner_res_sz;
  265. uint8_t resrvd2;
  266. uint8_t inner_state1_sz;
  267. uint8_t inner_state2_offset;
  268. uint8_t inner_state2_sz;
  269. uint8_t outer_config_offset;
  270. uint8_t outer_state1_sz;
  271. uint8_t outer_res_sz;
  272. uint8_t outer_prefix_offset;
  273. };
  274. #define ICP_QAT_FW_AUTH_HDR_FLAG_DO_NESTED 1
  275. #define ICP_QAT_FW_AUTH_HDR_FLAG_NO_NESTED 0
  276. #define ICP_QAT_FW_CCM_GCM_AAD_SZ_MAX 240
  277. #define ICP_QAT_FW_HASH_REQUEST_PARAMETERS_OFFSET \
  278. (sizeof(struct icp_qat_fw_la_cipher_req_params_t))
  279. #define ICP_QAT_FW_CIPHER_REQUEST_PARAMETERS_OFFSET (0)
  280. struct icp_qat_fw_la_cipher_req_params {
  281. uint32_t cipher_offset;
  282. uint32_t cipher_length;
  283. union {
  284. uint32_t cipher_IV_array[ICP_QAT_FW_NUM_LONGWORDS_4];
  285. struct {
  286. uint64_t cipher_IV_ptr;
  287. uint64_t resrvd1;
  288. } s;
  289. } u;
  290. };
  291. struct icp_qat_fw_la_auth_req_params {
  292. uint32_t auth_off;
  293. uint32_t auth_len;
  294. union {
  295. uint64_t auth_partial_st_prefix;
  296. uint64_t aad_adr;
  297. } u1;
  298. uint64_t auth_res_addr;
  299. union {
  300. uint8_t inner_prefix_sz;
  301. uint8_t aad_sz;
  302. } u2;
  303. uint8_t resrvd1;
  304. uint8_t hash_state_sz;
  305. uint8_t auth_res_sz;
  306. } __packed;
  307. struct icp_qat_fw_la_auth_req_params_resrvd_flds {
  308. uint32_t resrvd[ICP_QAT_FW_NUM_LONGWORDS_6];
  309. union {
  310. uint8_t inner_prefix_sz;
  311. uint8_t aad_sz;
  312. } u2;
  313. uint8_t resrvd1;
  314. uint16_t resrvd2;
  315. };
  316. struct icp_qat_fw_la_resp {
  317. struct icp_qat_fw_comn_resp_hdr comn_resp;
  318. uint64_t opaque_data;
  319. uint32_t resrvd[ICP_QAT_FW_NUM_LONGWORDS_4];
  320. };
  321. #define ICP_QAT_FW_CIPHER_NEXT_ID_GET(cd_ctrl_hdr_t) \
  322. ((((cd_ctrl_hdr_t)->next_curr_id_cipher) & \
  323. ICP_QAT_FW_COMN_NEXT_ID_MASK) >> (ICP_QAT_FW_COMN_NEXT_ID_BITPOS))
  324. #define ICP_QAT_FW_CIPHER_NEXT_ID_SET(cd_ctrl_hdr_t, val) \
  325. { (cd_ctrl_hdr_t)->next_curr_id_cipher = \
  326. ((((cd_ctrl_hdr_t)->next_curr_id_cipher) \
  327. & ICP_QAT_FW_COMN_CURR_ID_MASK) | \
  328. ((val << ICP_QAT_FW_COMN_NEXT_ID_BITPOS) \
  329. & ICP_QAT_FW_COMN_NEXT_ID_MASK)) }
  330. #define ICP_QAT_FW_CIPHER_CURR_ID_GET(cd_ctrl_hdr_t) \
  331. (((cd_ctrl_hdr_t)->next_curr_id_cipher) \
  332. & ICP_QAT_FW_COMN_CURR_ID_MASK)
  333. #define ICP_QAT_FW_CIPHER_CURR_ID_SET(cd_ctrl_hdr_t, val) \
  334. { (cd_ctrl_hdr_t)->next_curr_id_cipher = \
  335. ((((cd_ctrl_hdr_t)->next_curr_id_cipher) \
  336. & ICP_QAT_FW_COMN_NEXT_ID_MASK) | \
  337. ((val) & ICP_QAT_FW_COMN_CURR_ID_MASK)) }
  338. #define ICP_QAT_FW_AUTH_NEXT_ID_GET(cd_ctrl_hdr_t) \
  339. ((((cd_ctrl_hdr_t)->next_curr_id_auth) & ICP_QAT_FW_COMN_NEXT_ID_MASK) \
  340. >> (ICP_QAT_FW_COMN_NEXT_ID_BITPOS))
  341. #define ICP_QAT_FW_AUTH_NEXT_ID_SET(cd_ctrl_hdr_t, val) \
  342. { (cd_ctrl_hdr_t)->next_curr_id_auth = \
  343. ((((cd_ctrl_hdr_t)->next_curr_id_auth) \
  344. & ICP_QAT_FW_COMN_CURR_ID_MASK) | \
  345. ((val << ICP_QAT_FW_COMN_NEXT_ID_BITPOS) \
  346. & ICP_QAT_FW_COMN_NEXT_ID_MASK)) }
  347. #define ICP_QAT_FW_AUTH_CURR_ID_GET(cd_ctrl_hdr_t) \
  348. (((cd_ctrl_hdr_t)->next_curr_id_auth) \
  349. & ICP_QAT_FW_COMN_CURR_ID_MASK)
  350. #define ICP_QAT_FW_AUTH_CURR_ID_SET(cd_ctrl_hdr_t, val) \
  351. { (cd_ctrl_hdr_t)->next_curr_id_auth = \
  352. ((((cd_ctrl_hdr_t)->next_curr_id_auth) \
  353. & ICP_QAT_FW_COMN_NEXT_ID_MASK) | \
  354. ((val) & ICP_QAT_FW_COMN_CURR_ID_MASK)) }
  355. #endif