Commit c9ae3c1d authored by Adam Wujek's avatar Adam Wujek

tools/wrpc-dump: add dump_type_wr_role

Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent e0d0512b
......@@ -308,7 +308,7 @@ struct dump_info dump_info[] = {
DUMP_FIELD(FixedDelta, otherNodeDeltaRx),
DUMP_FIELD(wr_config_Enumeration8, wrConfig),
DUMP_FIELD(wr_config_Enumeration8, parentWrConfig),
DUMP_FIELD(Enumeration8, wrMode),
DUMP_FIELD(wr_role_Enumeration8, wrMode),
DUMP_FIELD(Enumeration8, wrPortState),
#endif
......
......@@ -56,6 +56,9 @@ enum dump_type {
dump_type_ppi_state_Enumeration8,
dump_type_wr_config,
dump_type_wr_config_Enumeration8,
dump_type_wr_role,
dump_type_wr_role_Enumeration8,
};
/* because of the sizeof later on, we need these typedefs */
......@@ -73,8 +76,10 @@ typedef int protocol_extension;
typedef int timing_mode;
typedef int ppi_state;
typedef Enumeration8 ppi_state_Enumeration8;
typedef int wr_config,
typedef Enumeration8 wr_config_Enumeration8
typedef int wr_config;
typedef Enumeration8 wr_config_Enumeration8;
typedef int wr_role;
typedef Enumeration8 wr_role_Enumeration8;
/*
* This is generated with the target compiler, and then linked
......
......@@ -360,6 +360,28 @@ void dump_one_field(void *addr, struct dump_info *info, char *info_prefix)
print_str(char_p);
printf("\n");
break;
case dump_type_wr_role:
case dump_type_wr_role_Enumeration8:
/* check the size of type, e.g. Boolean is not 8 bits! */
if (size == 1)
i = *(uint8_t *)p;
else if (size == 2)
i = wrpc_get_16(p);
else
i = wrpc_get_l32(p);
switch(i) {
ENUM_TO_P_IN_CASE(WR_ROLE_NONE, char_p);
ENUM_TO_P_IN_CASE(WR_MASTER, char_p);
ENUM_TO_P_IN_CASE(WR_SLAVE, char_p);
default:
char_p = "Unknown";
}
printf("%d", i);
print_str(char_p);
printf("\n");
break;
}
}
void dump_many_fields(void *addr, char *name, char *prefix)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment