Skip to content
Snippets Groups Projects
Commit 8dc69362 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Re-order the bus ID to look better.

parent 20b77d9e
No related merge requests found
...@@ -64,10 +64,14 @@ struct bus_record { ...@@ -64,10 +64,14 @@ struct bus_record {
}; };
static void print_id(struct bus_record* br) { static void print_id(struct bus_record* br) {
if (br->i == -1) return; if (br->i == -1) {
fprintf(stdout, "root");
fprintf(stdout, ".%d", br->i); } else if (br->parent->i == -1) {
print_id(br->parent); fprintf(stdout, "%d", br->i + 1);
} else {
print_id(br->parent);
fprintf(stdout, ".%d", br->i + 1);
}
} }
static int norecurse; static int norecurse;
...@@ -83,7 +87,7 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdwb_t sdwb, eb_s ...@@ -83,7 +87,7 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdwb_t sdwb, eb_s
exit(1); exit(1);
} }
fprintf(stdout, "SDWB Bus\n"); fprintf(stdout, "SDWB Bus "); print_id(br.parent); fprintf(stdout, "\n");
fprintf(stdout, " magic: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n" fprintf(stdout, " magic: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", " %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
sdwb->bus.magic[ 0], sdwb->bus.magic[ 1], sdwb->bus.magic[ 0], sdwb->bus.magic[ 1],
...@@ -166,6 +170,7 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdwb_t sdwb, eb_s ...@@ -166,6 +170,7 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdwb_t sdwb, eb_s
fprintf(stdout, " dev_version: %08"PRIx32"\n", des->dev_version); fprintf(stdout, " dev_version: %08"PRIx32"\n", des->dev_version);
fprintf(stdout, " dev_date: %08"PRIx32"\n", des->dev_date); fprintf(stdout, " dev_date: %08"PRIx32"\n", des->dev_date);
fprintf(stdout, " description: "); fwrite(des->description, 1, 16, stdout); fprintf(stdout, "\n"); fprintf(stdout, " description: "); fwrite(des->description, 1, 16, stdout); fprintf(stdout, "\n");
fprintf(stdout, "\n");
if (!norecurse && child && !bad) { if (!norecurse && child && !bad) {
br.bus_begin = des->wbd_begin; br.bus_begin = des->wbd_begin;
......
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