src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_dump_fw_ver_param(struct ecore_hwfn *p_hwfn,
				 struct ecore_ptt *p_ptt,
				 u32 *dump_buf, bool dump)
{
	char fw_ver_str[16] = EMPTY_FW_VERSION_STR;
	char fw_img_str[16] = EMPTY_FW_IMAGE_STR;
	struct fw_info fw_info = { {0}, {0} };
	u32 offset = 0;

	if (dump && !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_FW_VER)) {
		/* Read FW info from chip */
		qed_read_fw_info(p_hwfn, p_ptt, &fw_info);

		/* Create FW version/image strings */
		if (snprintf(fw_ver_str, sizeof(fw_ver_str),
			     "%d_%d_%d_%d", fw_info.ver.num.major,
			     fw_info.ver.num.minor, fw_info.ver.num.rev,
			     fw_info.ver.num.eng) < 0)
			DP_NOTICE(p_hwfn, false,
				  "Unexpected debug error: invalid FW version string\n");
		switch (fw_info.ver.image_id) {
		case FW_IMG_MAIN:
			strcpy(fw_img_str, "main");
			break;
		default:
			strcpy(fw_img_str, "unknown");
			break;
		}
	}

	/* Dump FW version, image and timestamp */
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "fw-version", fw_ver_str);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "fw-image", fw_img_str);
	offset += qed_dump_num_param(dump_buf + offset,
				     dump,
				     "fw-timestamp", fw_info.ver.timestamp);

	return offset;
}
/* Reads the FW version and writes it as a param to the specified buffer.
 * Returns the dumped size in dwords.
 */
Reads the FW version and writes it as a param to the specified buffer.
Returns the dumped size in dwords.
Reads the FW version and writes it as a param to the specified buffer . Returns the dumped size in dwords .
static u32 qed_dump_fw_ver_param(struct ecore_hwfn *p_hwfn,
				 struct ecore_ptt *p_ptt,
				 u32 *dump_buf, bool dump)
{
	char fw_ver_str[16] = EMPTY_FW_VERSION_STR;
	char fw_img_str[16] = EMPTY_FW_IMAGE_STR;
	struct fw_info fw_info = { {0}, {0} };
	u32 offset = 0;
	if (dump && !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_FW_VER)) {
		qed_read_fw_info(p_hwfn, p_ptt, &fw_info);
		if (snprintf(fw_ver_str, sizeof(fw_ver_str),
			     "%d_%d_%d_%d", fw_info.ver.num.major,
			     fw_info.ver.num.minor, fw_info.ver.num.rev,
			     fw_info.ver.num.eng) < 0)
			DP_NOTICE(p_hwfn, false,
				  "Unexpected debug error: invalid FW version string\n");
		switch (fw_info.ver.image_id) {
		case FW_IMG_MAIN:
			strcpy(fw_img_str, "main");
			break;
		default:
			strcpy(fw_img_str, "unknown");
			break;
		}
	}
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "fw-version", fw_ver_str);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "fw-image", fw_img_str);
	offset += qed_dump_num_param(dump_buf + offset,
				     dump,
				     "fw-timestamp", fw_info.ver.timestamp);
	return offset;
}
static u32 qed_dump_fw_ver_param ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump ) { char fw_ver_str [ 16 ] = EMPTY_FW_VERSION_STR ; char fw_img_str [ 16 ] = EMPTY_FW_IMAGE_STR ; struct fw_info fw_info = { { 0 } , { 0 } } ; u32 offset = 0 ; if ( dump && ! qed_grc_get_param ( p_hwfn , DBG_GRC_PARAM_NO_FW_VER ) ) { qed_read_fw_info ( p_hwfn , p_ptt , & fw_info ) ; if ( snprintf ( fw_ver_str , sizeof ( fw_ver_str ) , " " , fw_info . ver . num . major , fw_info . ver . num . minor , fw_info . ver . num . rev , fw_info . ver . num . eng ) < 0 ) DP_NOTICE ( p_hwfn , false , " \n " ) ; switch ( fw_info . ver . image_id ) { case FW_IMG_MAIN : strcpy ( fw_img_str , " " ) ; break ; default : strcpy ( fw_img_str , " " ) ; break ; } } offset += qed_dump_str_param ( dump_buf + offset , dump , " " , fw_ver_str ) ; offset += qed_dump_str_param ( dump_buf + offset , dump , " " , fw_img_str ) ; offset += qed_dump_num_param ( dump_buf + offset , dump , " " , fw_info . ver . timestamp ) ; return offset ; }
Reads the FW version and writes it as a param to the specified buffer.
Reads the FW version and writes it as a param to the specified buffer .
/* Read FW info from chip */ /* Create FW version/image strings */ /* Dump FW version, image and timestamp */