icp_qat_fw_init_admin.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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_INIT_ADMIN_H_
  42. #define _ICP_QAT_FW_INIT_ADMIN_H_
  43. #include "icp_qat_fw.h"
  44. enum icp_qat_fw_init_admin_cmd_id {
  45. ICP_QAT_FW_INIT_ME = 0,
  46. ICP_QAT_FW_TRNG_ENABLE = 1,
  47. ICP_QAT_FW_TRNG_DISABLE = 2,
  48. ICP_QAT_FW_CONSTANTS_CFG = 3,
  49. ICP_QAT_FW_STATUS_GET = 4,
  50. ICP_QAT_FW_COUNTERS_GET = 5,
  51. ICP_QAT_FW_LOOPBACK = 6,
  52. ICP_QAT_FW_HEARTBEAT_SYNC = 7,
  53. ICP_QAT_FW_HEARTBEAT_GET = 8
  54. };
  55. enum icp_qat_fw_init_admin_resp_status {
  56. ICP_QAT_FW_INIT_RESP_STATUS_SUCCESS = 0,
  57. ICP_QAT_FW_INIT_RESP_STATUS_FAIL
  58. };
  59. struct icp_qat_fw_init_admin_req {
  60. uint16_t init_cfg_sz;
  61. uint8_t resrvd1;
  62. uint8_t init_admin_cmd_id;
  63. uint32_t resrvd2;
  64. uint64_t opaque_data;
  65. uint64_t init_cfg_ptr;
  66. uint64_t resrvd3;
  67. };
  68. struct icp_qat_fw_init_admin_resp_hdr {
  69. uint8_t flags;
  70. uint8_t resrvd1;
  71. uint8_t status;
  72. uint8_t init_admin_cmd_id;
  73. };
  74. struct icp_qat_fw_init_admin_resp_pars {
  75. union {
  76. uint32_t resrvd1[ICP_QAT_FW_NUM_LONGWORDS_4];
  77. struct {
  78. uint32_t version_patch_num;
  79. uint8_t context_id;
  80. uint8_t ae_id;
  81. uint16_t resrvd1;
  82. uint64_t resrvd2;
  83. } s1;
  84. struct {
  85. uint64_t req_rec_count;
  86. uint64_t resp_sent_count;
  87. } s2;
  88. } u;
  89. };
  90. struct icp_qat_fw_init_admin_resp {
  91. struct icp_qat_fw_init_admin_resp_hdr init_resp_hdr;
  92. union {
  93. uint32_t resrvd2;
  94. struct {
  95. uint16_t version_minor_num;
  96. uint16_t version_major_num;
  97. } s;
  98. } u;
  99. uint64_t opaque_data;
  100. struct icp_qat_fw_init_admin_resp_pars init_resp_pars;
  101. };
  102. #define ICP_QAT_FW_COMN_HEARTBEAT_OK 0
  103. #define ICP_QAT_FW_COMN_HEARTBEAT_BLOCKED 1
  104. #define ICP_QAT_FW_COMN_HEARTBEAT_FLAG_BITPOS 0
  105. #define ICP_QAT_FW_COMN_HEARTBEAT_FLAG_MASK 0x1
  106. #define ICP_QAT_FW_COMN_STATUS_RESRVD_FLD_MASK 0xFE
  107. #define ICP_QAT_FW_COMN_HEARTBEAT_HDR_FLAG_GET(hdr_t) \
  108. ICP_QAT_FW_COMN_HEARTBEAT_FLAG_GET(hdr_t.flags)
  109. #define ICP_QAT_FW_COMN_HEARTBEAT_HDR_FLAG_SET(hdr_t, val) \
  110. ICP_QAT_FW_COMN_HEARTBEAT_FLAG_SET(hdr_t, val)
  111. #define ICP_QAT_FW_COMN_HEARTBEAT_FLAG_GET(flags) \
  112. QAT_FIELD_GET(flags, \
  113. ICP_QAT_FW_COMN_HEARTBEAT_FLAG_BITPOS, \
  114. ICP_QAT_FW_COMN_HEARTBEAT_FLAG_MASK)
  115. #endif