i40iw_virtchnl.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*******************************************************************************
  2. *
  3. * Copyright (c) 2015-2016 Intel Corporation. All rights reserved.
  4. *
  5. * This software is available to you under a choice of one of two
  6. * licenses. You may choose to be licensed under the terms of the GNU
  7. * General Public License (GPL) Version 2, available from the file
  8. * COPYING in the main directory of this source tree, or the
  9. * OpenFabrics.org BSD license below:
  10. *
  11. * Redistribution and use in source and binary forms, with or
  12. * without modification, are permitted provided that the following
  13. * conditions are met:
  14. *
  15. * - Redistributions of source code must retain the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer.
  18. *
  19. * - Redistributions in binary form must reproduce the above
  20. * copyright notice, this list of conditions and the following
  21. * disclaimer in the documentation and/or other materials
  22. * provided with the distribution.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  28. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  29. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  30. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  31. * SOFTWARE.
  32. *
  33. *******************************************************************************/
  34. #ifndef I40IW_VIRTCHNL_H
  35. #define I40IW_VIRTCHNL_H
  36. #include "i40iw_hmc.h"
  37. #pragma pack(push, 1)
  38. struct i40iw_virtchnl_op_buf {
  39. u16 iw_op_code;
  40. u16 iw_op_ver;
  41. u16 iw_chnl_buf_len;
  42. u16 rsvd;
  43. u64 iw_chnl_op_ctx;
  44. /* Member alignment MUST be maintained above this location */
  45. u8 iw_chnl_buf[1];
  46. };
  47. struct i40iw_virtchnl_resp_buf {
  48. u64 iw_chnl_op_ctx;
  49. u16 iw_chnl_buf_len;
  50. s16 iw_op_ret_code;
  51. /* Member alignment MUST be maintained above this location */
  52. u16 rsvd[2];
  53. u8 iw_chnl_buf[1];
  54. };
  55. enum i40iw_virtchnl_ops {
  56. I40IW_VCHNL_OP_GET_VER = 0,
  57. I40IW_VCHNL_OP_GET_HMC_FCN,
  58. I40IW_VCHNL_OP_ADD_HMC_OBJ_RANGE,
  59. I40IW_VCHNL_OP_DEL_HMC_OBJ_RANGE,
  60. I40IW_VCHNL_OP_GET_STATS
  61. };
  62. #define I40IW_VCHNL_OP_GET_VER_V0 0
  63. #define I40IW_VCHNL_OP_GET_HMC_FCN_V0 0
  64. #define I40IW_VCHNL_OP_ADD_HMC_OBJ_RANGE_V0 0
  65. #define I40IW_VCHNL_OP_DEL_HMC_OBJ_RANGE_V0 0
  66. #define I40IW_VCHNL_OP_GET_STATS_V0 0
  67. #define I40IW_VCHNL_CHNL_VER_V0 0
  68. struct i40iw_dev_hw_stats;
  69. struct i40iw_virtchnl_hmc_obj_range {
  70. u16 obj_type;
  71. u16 rsvd;
  72. u32 start_index;
  73. u32 obj_count;
  74. };
  75. enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev,
  76. u32 vf_id,
  77. u8 *msg,
  78. u16 len);
  79. enum i40iw_status_code i40iw_vchnl_recv_vf(struct i40iw_sc_dev *dev,
  80. u32 vf_id,
  81. u8 *msg,
  82. u16 len);
  83. struct i40iw_virtchnl_req {
  84. struct i40iw_sc_dev *dev;
  85. struct i40iw_virtchnl_op_buf *vchnl_msg;
  86. void *parm;
  87. u32 vf_id;
  88. u16 parm_len;
  89. s16 ret_code;
  90. };
  91. #pragma pack(pop)
  92. enum i40iw_status_code i40iw_vchnl_vf_get_ver(struct i40iw_sc_dev *dev,
  93. u32 *vchnl_ver);
  94. enum i40iw_status_code i40iw_vchnl_vf_get_hmc_fcn(struct i40iw_sc_dev *dev,
  95. u16 *hmc_fcn);
  96. enum i40iw_status_code i40iw_vchnl_vf_add_hmc_objs(struct i40iw_sc_dev *dev,
  97. enum i40iw_hmc_rsrc_type rsrc_type,
  98. u32 start_index,
  99. u32 rsrc_count);
  100. enum i40iw_status_code i40iw_vchnl_vf_del_hmc_obj(struct i40iw_sc_dev *dev,
  101. enum i40iw_hmc_rsrc_type rsrc_type,
  102. u32 start_index,
  103. u32 rsrc_count);
  104. enum i40iw_status_code i40iw_vchnl_vf_get_pe_stats(struct i40iw_sc_dev *dev,
  105. struct i40iw_dev_hw_stats *hw_stats);
  106. #endif