icp_qat_fw_pke.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. [email protected]
  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_PKE_
  42. #define _ICP_QAT_FW_PKE_
  43. #include "icp_qat_fw.h"
  44. struct icp_qat_fw_req_hdr_pke_cd_pars {
  45. u64 content_desc_addr;
  46. u32 content_desc_resrvd;
  47. u32 func_id;
  48. };
  49. struct icp_qat_fw_req_pke_mid {
  50. u64 opaque;
  51. u64 src_data_addr;
  52. u64 dest_data_addr;
  53. };
  54. struct icp_qat_fw_req_pke_hdr {
  55. u8 resrvd1;
  56. u8 resrvd2;
  57. u8 service_type;
  58. u8 hdr_flags;
  59. u16 comn_req_flags;
  60. u16 resrvd4;
  61. struct icp_qat_fw_req_hdr_pke_cd_pars cd_pars;
  62. };
  63. struct icp_qat_fw_pke_request {
  64. struct icp_qat_fw_req_pke_hdr pke_hdr;
  65. struct icp_qat_fw_req_pke_mid pke_mid;
  66. u8 output_param_count;
  67. u8 input_param_count;
  68. u16 resrvd1;
  69. u32 resrvd2;
  70. u64 next_req_adr;
  71. };
  72. struct icp_qat_fw_resp_pke_hdr {
  73. u8 resrvd1;
  74. u8 resrvd2;
  75. u8 response_type;
  76. u8 hdr_flags;
  77. u16 comn_resp_flags;
  78. u16 resrvd4;
  79. };
  80. struct icp_qat_fw_pke_resp {
  81. struct icp_qat_fw_resp_pke_hdr pke_resp_hdr;
  82. u64 opaque;
  83. u64 src_data_addr;
  84. u64 dest_data_addr;
  85. };
  86. #define ICP_QAT_FW_PKE_HDR_VALID_FLAG_BITPOS 7
  87. #define ICP_QAT_FW_PKE_HDR_VALID_FLAG_MASK 0x1
  88. #define ICP_QAT_FW_PKE_RESP_PKE_STAT_GET(status_word) \
  89. QAT_FIELD_GET(((status_word >> ICP_QAT_FW_COMN_ONE_BYTE_SHIFT) & \
  90. ICP_QAT_FW_COMN_SINGLE_BYTE_MASK), \
  91. QAT_COMN_RESP_PKE_STATUS_BITPOS, \
  92. QAT_COMN_RESP_PKE_STATUS_MASK)
  93. #define ICP_QAT_FW_PKE_HDR_VALID_FLAG_SET(hdr_t, val) \
  94. QAT_FIELD_SET((hdr_t.hdr_flags), (val), \
  95. ICP_QAT_FW_PKE_HDR_VALID_FLAG_BITPOS, \
  96. ICP_QAT_FW_PKE_HDR_VALID_FLAG_MASK)
  97. #endif