Skip to content
Snippets Groups Projects
Commit b4b1fd2f authored by Kamil Zulewski's avatar Kamil Zulewski
Browse files

Readability improvments in ubus call .controller.dbg backhaul_dump

parent b4ed3625
Branches
No related tags found
1 merge request!250Readability improvments in ubus call .controller.dbg backhaul_dump
Pipeline #106795 passed
......@@ -21,9 +21,20 @@ static const char *get_prefix(enum dbg_bh_topo_indent_lvl indent_level)
const char *i1905_media_type_to_str(uint16_t media_type)
{
switch (media_type >> 8) {
case 0: return "Ethernet";
case 1: return "Wi-Fi";
switch (media_type) {
case 0x0000: return "Ethernet (802_3U_FAST_ETHERNET)";
case 0x0001: return "Ethernet (802_3AB_GIGABIT_ETHERNET)";
case 0x0100: return "Wi-Fi (802_11B_2_4_GHZ)";
case 0x0101: return "Wi-Fi (802_11G_2_4_GHZ)";
case 0x0102: return "Wi-Fi (802_11A_5_GHZ)";
case 0x0103: return "Wi-Fi (802_11N_2_4_GHZ )";
case 0x0104: return "Wi-Fi (802_11N_5_GHZ)";
case 0x0105: return "Wi-Fi (802_11AC_5_GHZ)";
case 0x0106: return "Wi-Fi (802_11AD_60_GHZ)";
case 0x0107: return "Wi-Fi (802_11AF_WHITESPACE)";
case 0x0108: return "Wi-Fi (802_11AX)";
case 0x0109: return "Wi-Fi (802_11BE)";
default: return "Other";
}
}
......
......@@ -194,8 +194,6 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx,
const struct backhaul_info *bh_info =
&topo_dev->bh_info;
blobmsg_add_u32(&bb, "time_since_topo_response",
timestamp_elapsed_sec(&topo_dev->last_topo_response));
blobmsg_add_string(&bb, "al_mac",
hwaddr_ntoa(topo_dev->al_macaddr, macaddrstr));
blobmsg_add_u16(&bb, "hops_from_root", bh_info->level_in_tree);
......@@ -220,6 +218,8 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx,
blobmsg_close_table(&bb, bh_table);
}
blobmsg_add_u32(&bb, "time_since_topo_response",
timestamp_elapsed_sec(&topo_dev->last_topo_response));
blobmsg_close_table(&bb, dev_table);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment