iwl-dbg-tlv.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  2. /*
  3. * Copyright (C) 2018-2023 Intel Corporation
  4. */
  5. #ifndef __iwl_dbg_tlv_h__
  6. #define __iwl_dbg_tlv_h__
  7. #include <linux/device.h>
  8. #include <linux/types.h>
  9. #include <fw/file.h>
  10. #include <fw/api/dbg-tlv.h>
  11. #define IWL_DBG_TLV_MAX_PRESET 15
  12. #define ENABLE_INI (IWL_DBG_TLV_MAX_PRESET + 1)
  13. /**
  14. * struct iwl_dbg_tlv_node - debug TLV node
  15. * @list: list of &struct iwl_dbg_tlv_node
  16. * @tlv: debug TLV
  17. */
  18. struct iwl_dbg_tlv_node {
  19. struct list_head list;
  20. struct iwl_ucode_tlv tlv;
  21. };
  22. /**
  23. * union iwl_dbg_tlv_tp_data - data that is given in a time point
  24. * @fw_pkt: a packet received from the FW
  25. */
  26. union iwl_dbg_tlv_tp_data {
  27. struct iwl_rx_packet *fw_pkt;
  28. };
  29. /**
  30. * struct iwl_dbg_tlv_time_point_data
  31. * @trig_list: list of triggers
  32. * @active_trig_list: list of active triggers
  33. * @hcmd_list: list of host commands
  34. * @config_list: list of configuration
  35. */
  36. struct iwl_dbg_tlv_time_point_data {
  37. struct list_head trig_list;
  38. struct list_head active_trig_list;
  39. struct list_head hcmd_list;
  40. struct list_head config_list;
  41. };
  42. struct iwl_trans;
  43. struct iwl_fw_runtime;
  44. void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans);
  45. void iwl_dbg_tlv_free(struct iwl_trans *trans);
  46. void iwl_dbg_tlv_alloc(struct iwl_trans *trans, const struct iwl_ucode_tlv *tlv,
  47. bool ext);
  48. void iwl_dbg_tlv_init(struct iwl_trans *trans);
  49. void _iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt,
  50. enum iwl_fw_ini_time_point tp_id,
  51. union iwl_dbg_tlv_tp_data *tp_data,
  52. bool sync);
  53. static inline void iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt,
  54. enum iwl_fw_ini_time_point tp_id,
  55. union iwl_dbg_tlv_tp_data *tp_data)
  56. {
  57. _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, false);
  58. }
  59. static inline void iwl_dbg_tlv_time_point_sync(struct iwl_fw_runtime *fwrt,
  60. enum iwl_fw_ini_time_point tp_id,
  61. union iwl_dbg_tlv_tp_data *tp_data)
  62. {
  63. _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, true);
  64. }
  65. void iwl_dbg_tlv_del_timers(struct iwl_trans *trans);
  66. #endif /* __iwl_dbg_tlv_h__*/