src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_read_param(u32 *dump_buf,
			  const char **param_name,
			  const char **param_str_val, u32 *param_num_val)
{
	char *char_buf = (char *)dump_buf;
	size_t offset = 0;

	/* Extract param name */
	*param_name = char_buf;
	offset += strlen(*param_name) + 1;

	/* Check param type */
	if (*(char_buf + offset++)) {
		/* String param */
		*param_str_val = char_buf + offset;
		*param_num_val = 0;
		offset += strlen(*param_str_val) + 1;
		if (offset & 0x3)
			offset += (4 - (offset & 0x3));
	} else {
		/* Numeric param */
		*param_str_val = NULL;
		if (offset & 0x3)
			offset += (4 - (offset & 0x3));
		*param_num_val = *(u32 *)(char_buf + offset);
		offset += 4;
	}

	return (u32)offset / 4;
}
/* Reads a param from the specified buffer. Returns the number of dwords read.
 * If the returned str_param is NULL, the param is numeric and its value is
 * returned in num_param.
 * Otheriwise, the param is a string and its pointer is returned in str_param.
 */
Reads a param from the specified buffer. Returns the number of dwords read.
If the returned str_param is NULL, the param is numeric and its value is
returned in num_param.
Otheriwise, the param is a string and its pointer is returned in str_param.
Reads a param from the specified buffer . Returns the number of dwords read . If the returned str_param is NULL the param is numeric and its value is returned in num_param . Otheriwise the param is a string and its pointer is returned in str_param .
static u32 qed_read_param(u32 *dump_buf,
			  const char **param_name,
			  const char **param_str_val, u32 *param_num_val)
{
	char *char_buf = (char *)dump_buf;
	size_t offset = 0;
	*param_name = char_buf;
	offset += strlen(*param_name) + 1;
	if (*(char_buf + offset++)) {
		*param_str_val = char_buf + offset;
		*param_num_val = 0;
		offset += strlen(*param_str_val) + 1;
		if (offset & 0x3)
			offset += (4 - (offset & 0x3));
	} else {
		*param_str_val = NULL;
		if (offset & 0x3)
			offset += (4 - (offset & 0x3));
		*param_num_val = *(u32 *)(char_buf + offset);
		offset += 4;
	}
	return (u32)offset / 4;
}
static u32 qed_read_param ( u32 * dump_buf , const char * * param_name , const char * * param_str_val , u32 * param_num_val ) { char * char_buf = ( char * ) dump_buf ; size_t offset = 0 ; * param_name = char_buf ; offset += strlen ( * param_name ) + 1 ; if ( * ( char_buf + offset ++ ) ) { * param_str_val = char_buf + offset ; * param_num_val = 0 ; offset += strlen ( * param_str_val ) + 1 ; if ( offset & 0x3 ) offset += ( 4 - ( offset & 0x3 ) ) ; } else { * param_str_val = NULL ; if ( offset & 0x3 ) offset += ( 4 - ( offset & 0x3 ) ) ; * param_num_val = * ( u32 * ) ( char_buf + offset ) ; offset += 4 ; } return ( u32 ) offset / 4 ; }
Reads a param from the specified buffer.
Reads a param from the specified buffer .
/* Extract param name */ /* Check param type */ /* String param */ /* Numeric param */