linux/drivers/net/ethernet/qlogic/qed/qed_dbg_hsi.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/* QLogic qed NIC Driver
 * Copyright (c) 2019-2021 Marvell International Ltd.
 */
#ifndef _QED_DBG_HSI_H
#define _QED_DBG_HSI_H

#include <linux/types.h>
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/slab.h>

/****************************************/
/* Debug Tools HSI constants and macros */
/****************************************/

enum block_id {};

/* binary debug buffer types */
enum bin_dbg_buffer_type {};

/* Attention bit mapping */
struct dbg_attn_bit_mapping {};

/* Attention block per-type data */
struct dbg_attn_block_type_data {};

/* Block attentions */
struct dbg_attn_block {};

/* Attention register result */
struct dbg_attn_reg_result {};

/* Attention block result */
struct dbg_attn_block_result {};

/* Mode header */
struct dbg_mode_hdr {};

/* Attention register */
struct dbg_attn_reg {};

/* Attention types */
enum dbg_attn_type {};

/* Block debug data */
struct dbg_block {};

/* Chip-specific block debug data */
struct dbg_block_chip {};

/* Chip-specific block user debug data */
struct dbg_block_chip_user {};

/* Block user debug data */
struct dbg_block_user {};

/* Block Debug line data */
struct dbg_bus_line {};

/* Condition header for registers dump */
struct dbg_dump_cond_hdr {};

/* Memory data for registers dump */
struct dbg_dump_mem {};

/* Register data for registers dump */
struct dbg_dump_reg {};

/* Split header for registers dump */
struct dbg_dump_split_hdr {};

/* Condition header for idle check */
struct dbg_idle_chk_cond_hdr {};

/* Idle Check condition register */
struct dbg_idle_chk_cond_reg {};

/* Idle Check info register */
struct dbg_idle_chk_info_reg {};

/* Idle Check register */
dbg_idle_chk_reg;

/* Idle Check result header */
struct dbg_idle_chk_result_hdr {};

/* Idle Check result register header */
struct dbg_idle_chk_result_reg_hdr {};

/* Idle Check rule */
struct dbg_idle_chk_rule {};

/* Idle Check rule parsing data */
struct dbg_idle_chk_rule_parsing_data {};

/* Idle check severity types */
enum dbg_idle_chk_severity_types {};

/* Reset register */
struct dbg_reset_reg {};

/* Debug Bus block data */
struct dbg_bus_block_data {};

enum dbg_bus_clients {};

/* Debug Bus constraint operation types */
enum dbg_bus_constraint_ops {};

/* Debug Bus trigger state data */
struct dbg_bus_trigger_state_data {};

/* Debug Bus memory address */
struct dbg_bus_mem_addr {};

/* Debug Bus PCI buffer data */
struct dbg_bus_pci_buf_data {};

/* Debug Bus Storm EID range filter params */
struct dbg_bus_storm_eid_range_params {};

/* Debug Bus Storm EID mask filter params */
struct dbg_bus_storm_eid_mask_params {};

/* Debug Bus Storm EID filter params */
dbg_bus_storm_eid_params;

/* Debug Bus Storm data */
struct dbg_bus_storm_data {};

/* Debug Bus data */
struct dbg_bus_data {};

/* Debug bus states */
enum dbg_bus_states {};

/* Debug Bus Storm modes */
enum dbg_bus_storm_modes {};

/* Debug bus target IDs */
enum dbg_bus_targets {};

/* GRC Dump data */
struct dbg_grc_data {};

/* Debug GRC params */
enum dbg_grc_params {};

/* Debug status codes */
enum dbg_status {};

/* Debug Storms IDs */
enum dbg_storms {};

/* Idle Check data */
struct idle_chk_data {};

struct pretend_params {};

/* Debug Tools data (per HW function)
 */
struct dbg_tools_data {};

/* ILT Clients */
enum ilt_clients {};

/***************************** Public Functions *******************************/

/**
 * qed_dbg_set_bin_ptr(): Sets a pointer to the binary data with debug
 *                        arrays.
 *
 * @p_hwfn: HW device data.
 * @bin_ptr: A pointer to the binary data with debug arrays.
 *
 * Return: enum dbg status.
 */
enum dbg_status qed_dbg_set_bin_ptr(struct qed_hwfn *p_hwfn,
				    const u8 * const bin_ptr);

/**
 * qed_read_regs(): Reads registers into a buffer (using GRC).
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf: Destination buffer.
 * @addr: Source GRC address in dwords.
 * @len: Number of registers to read.
 *
 * Return: Void.
 */
void qed_read_regs(struct qed_hwfn *p_hwfn,
		   struct qed_ptt *p_ptt, u32 *buf, u32 addr, u32 len);

/**
 * qed_read_fw_info(): Reads FW info from the chip.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @fw_info: (Out) a pointer to write the FW info into.
 *
 * Return: True if the FW info was read successfully from one of the Storms,
 * or false if all Storms are in reset.
 *
 * The FW info contains FW-related information, such as the FW version,
 * FW image (main/L2B/kuku), FW timestamp, etc.
 * The FW info is read from the internal RAM of the first Storm that is not in
 * reset.
 */
bool qed_read_fw_info(struct qed_hwfn *p_hwfn,
		      struct qed_ptt *p_ptt, struct fw_info *fw_info);
/**
 * qed_dbg_grc_config(): Sets the value of a GRC parameter.
 *
 * @p_hwfn: HW device data.
 * @grc_param: GRC parameter.
 * @val: Value to set.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *         - Grc_param is invalid.
 *         - Val is outside the allowed boundaries.
 */
enum dbg_status qed_dbg_grc_config(struct qed_hwfn *p_hwfn,
				   enum dbg_grc_params grc_param, u32 val);

/**
 * qed_dbg_grc_set_params_default(): Reverts all GRC parameters to their
 *                                   default value.
 *
 * @p_hwfn: HW device data.
 *
 * Return: Void.
 */
void qed_dbg_grc_set_params_default(struct qed_hwfn *p_hwfn);
/**
 * qed_dbg_grc_get_dump_buf_size(): Returns the required buffer size for
 *                                  GRC Dump.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) required buffer size (in dwords) for the GRC Dump
 *             data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_grc_get_dump_buf_size(struct qed_hwfn *p_hwfn,
					      struct qed_ptt *p_ptt,
					      u32 *buf_size);

/**
 * qed_dbg_grc_dump(): Dumps GRC data into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the collected GRC data into.
 * @buf_size_in_dwords:Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *        - The version wasn't set.
 *        - The specified dump buffer is too small.
 *          Otherwise, returns ok.
 */
enum dbg_status qed_dbg_grc_dump(struct qed_hwfn *p_hwfn,
				 struct qed_ptt *p_ptt,
				 u32 *dump_buf,
				 u32 buf_size_in_dwords,
				 u32 *num_dumped_dwords);

/**
 * qed_dbg_idle_chk_get_dump_buf_size(): Returns the required buffer size
 *                                       for idle check results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) required buffer size (in dwords) for the idle check
 *             data.
 *
 * return: Error if one of the following holds:
 *        - The version wasn't set.
 *          Otherwise, returns ok.
 */
enum dbg_status qed_dbg_idle_chk_get_dump_buf_size(struct qed_hwfn *p_hwfn,
						   struct qed_ptt *p_ptt,
						   u32 *buf_size);

/**
 * qed_dbg_idle_chk_dump: Performs idle check and writes the results
 *                        into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the idle check data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *         - The specified buffer is too small.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_idle_chk_dump(struct qed_hwfn *p_hwfn,
				      struct qed_ptt *p_ptt,
				      u32 *dump_buf,
				      u32 buf_size_in_dwords,
				      u32 *num_dumped_dwords);

/**
 * qed_dbg_mcp_trace_get_dump_buf_size(): Returns the required buffer size
 *                                        for mcp trace results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) Required buffer size (in dwords) for mcp trace data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *         - The trace data in MCP scratchpad contain an invalid signature.
 *         - The bundle ID in NVRAM is invalid.
 *         - The trace meta data cannot be found (in NVRAM or image file).
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_mcp_trace_get_dump_buf_size(struct qed_hwfn *p_hwfn,
						    struct qed_ptt *p_ptt,
						    u32 *buf_size);

/**
 * qed_dbg_mcp_trace_dump(): Performs mcp trace and writes the results
 *                           into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the mcp trace data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *        - The version wasn't set.
 *        - The specified buffer is too small.
 *        - The trace data in MCP scratchpad contain an invalid signature.
 *        - The bundle ID in NVRAM is invalid.
 *        - The trace meta data cannot be found (in NVRAM or image file).
 *        - The trace meta data cannot be read (from NVRAM or image file).
 *          Otherwise, returns ok.
 */
enum dbg_status qed_dbg_mcp_trace_dump(struct qed_hwfn *p_hwfn,
				       struct qed_ptt *p_ptt,
				       u32 *dump_buf,
				       u32 buf_size_in_dwords,
				       u32 *num_dumped_dwords);

/**
 * qed_dbg_reg_fifo_get_dump_buf_size(): Returns the required buffer size
 *                                       for grc trace fifo results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) Required buffer size (in dwords) for reg fifo data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_reg_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
						   struct qed_ptt *p_ptt,
						   u32 *buf_size);

/**
 * qed_dbg_reg_fifo_dump(): Reads the reg fifo and writes the results into
 *                          the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the reg fifo data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *        - The version wasn't set.
 *        - The specified buffer is too small.
 *        - DMAE transaction failed.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_reg_fifo_dump(struct qed_hwfn *p_hwfn,
				      struct qed_ptt *p_ptt,
				      u32 *dump_buf,
				      u32 buf_size_in_dwords,
				      u32 *num_dumped_dwords);

/**
 * qed_dbg_igu_fifo_get_dump_buf_size(): Returns the required buffer size
 *                                       for the IGU fifo results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) Required buffer size (in dwords) for the IGU fifo
 *            data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_igu_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
						   struct qed_ptt *p_ptt,
						   u32 *buf_size);

/**
 * qed_dbg_igu_fifo_dump(): Reads the IGU fifo and writes the results into
 *                          the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the IGU fifo data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set
 *         - The specified buffer is too small
 *         - DMAE transaction failed
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_igu_fifo_dump(struct qed_hwfn *p_hwfn,
				      struct qed_ptt *p_ptt,
				      u32 *dump_buf,
				      u32 buf_size_in_dwords,
				      u32 *num_dumped_dwords);

/**
 * qed_dbg_protection_override_get_dump_buf_size(): Returns the required
 *        buffer size for protection override window results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) Required buffer size (in dwords) for protection
 *             override data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set
 *           Otherwise, returns ok.
 */
enum dbg_status
qed_dbg_protection_override_get_dump_buf_size(struct qed_hwfn *p_hwfn,
					      struct qed_ptt *p_ptt,
					      u32 *buf_size);
/**
 * qed_dbg_protection_override_dump(): Reads protection override window
 *       entries and writes the results into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the protection override data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * @return: Error if one of the following holds:
 *          - The version wasn't set.
 *          - The specified buffer is too small.
 *          - DMAE transaction failed.
 *             Otherwise, returns ok.
 */
enum dbg_status qed_dbg_protection_override_dump(struct qed_hwfn *p_hwfn,
						 struct qed_ptt *p_ptt,
						 u32 *dump_buf,
						 u32 buf_size_in_dwords,
						 u32 *num_dumped_dwords);
/**
 * qed_dbg_fw_asserts_get_dump_buf_size(): Returns the required buffer
 *                                         size for FW Asserts results.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @buf_size: (OUT) Required buffer size (in dwords) for FW Asserts data.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_fw_asserts_get_dump_buf_size(struct qed_hwfn *p_hwfn,
						     struct qed_ptt *p_ptt,
						     u32 *buf_size);
/**
 * qed_dbg_fw_asserts_dump(): Reads the FW Asserts and writes the results
 *                            into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @dump_buf: Pointer to write the FW Asserts data into.
 * @buf_size_in_dwords: Size of the specified buffer in dwords.
 * @num_dumped_dwords: (OUT) number of dumped dwords.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *         - The specified buffer is too small.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_fw_asserts_dump(struct qed_hwfn *p_hwfn,
					struct qed_ptt *p_ptt,
					u32 *dump_buf,
					u32 buf_size_in_dwords,
					u32 *num_dumped_dwords);

/**
 * qed_dbg_read_attn(): Reads the attention registers of the specified
 * block and type, and writes the results into the specified buffer.
 *
 * @p_hwfn: HW device data.
 * @p_ptt: Ptt window used for writing the registers.
 * @block: Block ID.
 * @attn_type: Attention type.
 * @clear_status: Indicates if the attention status should be cleared.
 * @results:  (OUT) Pointer to write the read results into.
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set
 *          Otherwise, returns ok.
 */
enum dbg_status qed_dbg_read_attn(struct qed_hwfn *p_hwfn,
				  struct qed_ptt *p_ptt,
				  enum block_id block,
				  enum dbg_attn_type attn_type,
				  bool clear_status,
				  struct dbg_attn_block_result *results);

/**
 * qed_dbg_print_attn(): Prints attention registers values in the
 *                       specified results struct.
 *
 * @p_hwfn: HW device data.
 * @results: Pointer to the attention read results
 *
 * Return: Error if one of the following holds:
 *        - The version wasn't set
 *          Otherwise, returns ok.
 */
enum dbg_status qed_dbg_print_attn(struct qed_hwfn *p_hwfn,
				   struct dbg_attn_block_result *results);

/******************************* Data Types **********************************/

struct mcp_trace_format {};

/* MCP Trace Meta data structure */
struct mcp_trace_meta {};

/* Debug Tools user data */
struct dbg_tools_user_data {};

/******************************** Constants **********************************/

#define MAX_NAME_LEN

/***************************** Public Functions *******************************/

/**
 * qed_dbg_user_set_bin_ptr(): Sets a pointer to the binary data with
 *                             debug arrays.
 *
 * @p_hwfn: HW device data.
 * @bin_ptr: a pointer to the binary data with debug arrays.
 *
 * Return: dbg_status.
 */
enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn,
					 const u8 * const bin_ptr);

/**
 * qed_dbg_alloc_user_data(): Allocates user debug data.
 *
 * @p_hwfn: HW device data.
 * @user_data_ptr: (OUT) a pointer to the allocated memory.
 *
 * Return: dbg_status.
 */
enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn,
					void **user_data_ptr);

/**
 * qed_dbg_get_status_str(): Returns a string for the specified status.
 *
 * @status: A debug status code.
 *
 * Return: A string for the specified status.
 */
const char *qed_dbg_get_status_str(enum dbg_status status);

/**
 * qed_get_idle_chk_results_buf_size(): Returns the required buffer size
 *                                      for idle check results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: idle check dump buffer.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                    results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_get_idle_chk_results_buf_size(struct qed_hwfn *p_hwfn,
						  u32 *dump_buf,
						  u32  num_dumped_dwords,
						  u32 *results_buf_size);
/**
 * qed_print_idle_chk_results(): Prints idle check results
 *
 * @p_hwfn: HW device data.
 * @dump_buf: idle check dump buffer.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf: buffer for printing the idle check results.
 * @num_errors: (OUT) number of errors found in idle check.
 * @num_warnings: (OUT) number of warnings found in idle check.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_idle_chk_results(struct qed_hwfn *p_hwfn,
					   u32 *dump_buf,
					   u32 num_dumped_dwords,
					   char *results_buf,
					   u32 *num_errors,
					   u32 *num_warnings);

/**
 * qed_dbg_mcp_trace_set_meta_data(): Sets the MCP Trace meta data.
 *
 * @p_hwfn: HW device data.
 * @meta_buf: Meta buffer.
 *
 * Return: Void.
 *
 * Needed in case the MCP Trace dump doesn't contain the meta data (e.g. due to
 * no NVRAM access).
 */
void qed_dbg_mcp_trace_set_meta_data(struct qed_hwfn *p_hwfn,
				     const u32 *meta_buf);

/**
 * qed_get_mcp_trace_results_buf_size(): Returns the required buffer size
 *                                       for MCP Trace results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: MCP Trace dump buffer.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                    results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_get_mcp_trace_results_buf_size(struct qed_hwfn *p_hwfn,
						   u32 *dump_buf,
						   u32 num_dumped_dwords,
						   u32 *results_buf_size);

/**
 * qed_print_mcp_trace_results(): Prints MCP Trace results
 *
 * @p_hwfn: HW device data.
 * @dump_buf: MCP trace dump buffer, starting from the header.
 * @num_dumped_dwords: Member of dwords that were dumped.
 * @results_buf: Buffer for printing the mcp trace results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_mcp_trace_results(struct qed_hwfn *p_hwfn,
					    u32 *dump_buf,
					    u32 num_dumped_dwords,
					    char *results_buf);

/**
 * qed_print_mcp_trace_results_cont(): Prints MCP Trace results, and
 * keeps the MCP trace meta data allocated, to support continuous MCP Trace
 * parsing. After the continuous parsing ends, mcp_trace_free_meta_data should
 * be called to free the meta data.
 *
 * @p_hwfn: HW device data.
 * @dump_buf: MVP trace dump buffer, starting from the header.
 * @results_buf: Buffer for printing the mcp trace results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_mcp_trace_results_cont(struct qed_hwfn *p_hwfn,
						 u32 *dump_buf,
						 char *results_buf);

/**
 * qed_print_mcp_trace_line(): Prints MCP Trace results for a single line
 *
 * @p_hwfn: HW device data.
 * @dump_buf: MCP trace dump buffer, starting from the header.
 * @num_dumped_bytes: Number of bytes that were dumped.
 * @results_buf: Buffer for printing the mcp trace results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_mcp_trace_line(struct qed_hwfn *p_hwfn,
					 u8 *dump_buf,
					 u32 num_dumped_bytes,
					 char *results_buf);

/**
 * qed_mcp_trace_free_meta_data(): Frees the MCP Trace meta data.
 * Should be called after continuous MCP Trace parsing.
 *
 * @p_hwfn: HW device data.
 *
 * Return: Void.
 */
void qed_mcp_trace_free_meta_data(struct qed_hwfn *p_hwfn);

/**
 * qed_get_reg_fifo_results_buf_size(): Returns the required buffer size
 *                                      for reg_fifo results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: Reg fifo dump buffer.
 * @num_dumped_dwords: Number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                     results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_get_reg_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
						  u32 *dump_buf,
						  u32 num_dumped_dwords,
						  u32 *results_buf_size);

/**
 * qed_print_reg_fifo_results(): Prints reg fifo results.
 *
 * @p_hwfn: HW device data.
 * @dump_buf: Reg fifo dump buffer, starting from the header.
 * @num_dumped_dwords: Number of dwords that were dumped.
 * @results_buf: Buffer for printing the reg fifo results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_reg_fifo_results(struct qed_hwfn *p_hwfn,
					   u32 *dump_buf,
					   u32 num_dumped_dwords,
					   char *results_buf);

/**
 * qed_get_igu_fifo_results_buf_size(): Returns the required buffer size
 *                                      for igu_fifo results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: IGU fifo dump buffer.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                    results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_get_igu_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
						  u32 *dump_buf,
						  u32 num_dumped_dwords,
						  u32 *results_buf_size);

/**
 * qed_print_igu_fifo_results(): Prints IGU fifo results
 *
 * @p_hwfn: HW device data.
 * @dump_buf: IGU fifo dump buffer, starting from the header.
 * @num_dumped_dwords: Number of dwords that were dumped.
 * @results_buf: Buffer for printing the IGU fifo results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_igu_fifo_results(struct qed_hwfn *p_hwfn,
					   u32 *dump_buf,
					   u32 num_dumped_dwords,
					   char *results_buf);

/**
 * qed_get_protection_override_results_buf_size(): Returns the required
 *         buffer size for protection override results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: Protection override dump buffer.
 * @num_dumped_dwords: Number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                    results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status
qed_get_protection_override_results_buf_size(struct qed_hwfn *p_hwfn,
					     u32 *dump_buf,
					     u32 num_dumped_dwords,
					     u32 *results_buf_size);

/**
 * qed_print_protection_override_results(): Prints protection override
 *                                          results.
 *
 * @p_hwfn: HW device data.
 * @dump_buf: Protection override dump buffer, starting from the header.
 * @num_dumped_dwords: Number of dwords that were dumped.
 * @results_buf: Buffer for printing the reg fifo results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_protection_override_results(struct qed_hwfn *p_hwfn,
						      u32 *dump_buf,
						      u32 num_dumped_dwords,
						      char *results_buf);

/**
 * qed_get_fw_asserts_results_buf_size(): Returns the required buffer size
 *                                        for FW Asserts results (in bytes).
 *
 * @p_hwfn: HW device data.
 * @dump_buf: FW Asserts dump buffer.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf_size: (OUT) required buffer size (in bytes) for the parsed
 *                    results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_get_fw_asserts_results_buf_size(struct qed_hwfn *p_hwfn,
						    u32 *dump_buf,
						    u32 num_dumped_dwords,
						    u32 *results_buf_size);

/**
 * qed_print_fw_asserts_results(): Prints FW Asserts results.
 *
 * @p_hwfn: HW device data.
 * @dump_buf: FW Asserts dump buffer, starting from the header.
 * @num_dumped_dwords: number of dwords that were dumped.
 * @results_buf: buffer for printing the FW Asserts results.
 *
 * Return: Error if the parsing fails, ok otherwise.
 */
enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
					     u32 *dump_buf,
					     u32 num_dumped_dwords,
					     char *results_buf);

/**
 * qed_dbg_parse_attn(): Parses and prints attention registers values in
 *                      the specified results struct.
 *
 * @p_hwfn: HW device data.
 * @results: Pointer to the attention read results
 *
 * Return: Error if one of the following holds:
 *         - The version wasn't set.
 *           Otherwise, returns ok.
 */
enum dbg_status qed_dbg_parse_attn(struct qed_hwfn *p_hwfn,
				   struct dbg_attn_block_result *results);
#endif