qed_init_ops.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_INIT_OPS_H
  9. #define _QED_INIT_OPS_H
  10. #include <linux/types.h>
  11. #include <linux/slab.h>
  12. #include "qed.h"
  13. /**
  14. * @brief qed_init_iro_array - init iro_arr.
  15. *
  16. *
  17. * @param cdev
  18. */
  19. void qed_init_iro_array(struct qed_dev *cdev);
  20. /**
  21. * @brief qed_init_run - Run the init-sequence.
  22. *
  23. *
  24. * @param p_hwfn
  25. * @param p_ptt
  26. * @param phase
  27. * @param phase_id
  28. * @param modes
  29. * @return _qed_status_t
  30. */
  31. int qed_init_run(struct qed_hwfn *p_hwfn,
  32. struct qed_ptt *p_ptt,
  33. int phase,
  34. int phase_id,
  35. int modes);
  36. /**
  37. * @brief qed_init_hwfn_allocate - Allocate RT array, Store 'values' ptrs.
  38. *
  39. *
  40. * @param p_hwfn
  41. *
  42. * @return _qed_status_t
  43. */
  44. int qed_init_alloc(struct qed_hwfn *p_hwfn);
  45. /**
  46. * @brief qed_init_hwfn_deallocate
  47. *
  48. *
  49. * @param p_hwfn
  50. */
  51. void qed_init_free(struct qed_hwfn *p_hwfn);
  52. /**
  53. * @brief qed_init_clear_rt_data - Clears the runtime init array.
  54. *
  55. *
  56. * @param p_hwfn
  57. */
  58. void qed_init_clear_rt_data(struct qed_hwfn *p_hwfn);
  59. /**
  60. * @brief qed_init_store_rt_reg - Store a configuration value in the RT array.
  61. *
  62. *
  63. * @param p_hwfn
  64. * @param rt_offset
  65. * @param val
  66. */
  67. void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn,
  68. u32 rt_offset,
  69. u32 val);
  70. #define STORE_RT_REG(hwfn, offset, val) \
  71. qed_init_store_rt_reg(hwfn, offset, val)
  72. #define OVERWRITE_RT_REG(hwfn, offset, val) \
  73. qed_init_store_rt_reg(hwfn, offset, val)
  74. /**
  75. * @brief
  76. *
  77. *
  78. * @param p_hwfn
  79. * @param rt_offset
  80. * @param val
  81. * @param size
  82. */
  83. void qed_init_store_rt_agg(struct qed_hwfn *p_hwfn,
  84. u32 rt_offset,
  85. u32 *val,
  86. size_t size);
  87. #define STORE_RT_REG_AGG(hwfn, offset, val) \
  88. qed_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
  89. /**
  90. * @brief
  91. * Initialize GTT global windows and set admin window
  92. * related params of GTT/PTT to default values.
  93. *
  94. * @param p_hwfn
  95. */
  96. void qed_gtt_init(struct qed_hwfn *p_hwfn);
  97. #endif