qed_cxt.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* QLogic qed NIC Driver
  2. * Copyright (c) 2015 QLogic Corporation
  3. *
  4. * This software is available under the terms of the GNU General Public License
  5. * (GPL) Version 2, available from the file COPYING in the main directory of
  6. * this source tree.
  7. */
  8. #ifndef _QED_CXT_H
  9. #define _QED_CXT_H
  10. #include <linux/types.h>
  11. #include <linux/slab.h>
  12. #include <linux/qed/qed_if.h>
  13. #include "qed_hsi.h"
  14. #include "qed.h"
  15. struct qed_cxt_info {
  16. void *p_cxt;
  17. u32 iid;
  18. enum protocol_type type;
  19. };
  20. /**
  21. * @brief qed_cxt_acquire - Acquire a new cid of a specific protocol type
  22. *
  23. * @param p_hwfn
  24. * @param type
  25. * @param p_cid
  26. *
  27. * @return int
  28. */
  29. int qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
  30. enum protocol_type type,
  31. u32 *p_cid);
  32. /**
  33. * @brief qedo_cid_get_cxt_info - Returns the context info for a specific cid
  34. *
  35. *
  36. * @param p_hwfn
  37. * @param p_info in/out
  38. *
  39. * @return int
  40. */
  41. int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn,
  42. struct qed_cxt_info *p_info);
  43. enum qed_cxt_elem_type {
  44. QED_ELEM_CXT,
  45. QED_ELEM_TASK
  46. };
  47. /**
  48. * @brief qed_cxt_set_pf_params - Set the PF params for cxt init
  49. *
  50. * @param p_hwfn
  51. *
  52. * @return int
  53. */
  54. int qed_cxt_set_pf_params(struct qed_hwfn *p_hwfn);
  55. /**
  56. * @brief qed_cxt_cfg_ilt_compute - compute ILT init parameters
  57. *
  58. * @param p_hwfn
  59. *
  60. * @return int
  61. */
  62. int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn);
  63. /**
  64. * @brief qed_cxt_mngr_alloc - Allocate and init the context manager struct
  65. *
  66. * @param p_hwfn
  67. *
  68. * @return int
  69. */
  70. int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn);
  71. /**
  72. * @brief qed_cxt_mngr_free
  73. *
  74. * @param p_hwfn
  75. */
  76. void qed_cxt_mngr_free(struct qed_hwfn *p_hwfn);
  77. /**
  78. * @brief qed_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired map
  79. *
  80. * @param p_hwfn
  81. *
  82. * @return int
  83. */
  84. int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn);
  85. /**
  86. * @brief qed_cxt_mngr_setup - Reset the acquired CIDs
  87. *
  88. * @param p_hwfn
  89. */
  90. void qed_cxt_mngr_setup(struct qed_hwfn *p_hwfn);
  91. /**
  92. * @brief qed_cxt_hw_init_common - Initailze ILT and DQ, common phase, per path.
  93. *
  94. *
  95. *
  96. * @param p_hwfn
  97. */
  98. void qed_cxt_hw_init_common(struct qed_hwfn *p_hwfn);
  99. /**
  100. * @brief qed_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
  101. *
  102. *
  103. *
  104. * @param p_hwfn
  105. */
  106. void qed_cxt_hw_init_pf(struct qed_hwfn *p_hwfn);
  107. /**
  108. * @brief qed_qm_init_pf - Initailze the QM PF phase, per path
  109. *
  110. * @param p_hwfn
  111. */
  112. void qed_qm_init_pf(struct qed_hwfn *p_hwfn);
  113. /**
  114. * @brief qed_cxt_release - Release a cid
  115. *
  116. * @param p_hwfn
  117. * @param cid
  118. */
  119. void qed_cxt_release_cid(struct qed_hwfn *p_hwfn,
  120. u32 cid);
  121. #endif