Signed-off-by: Stefan Tauner stefan.tauner@student.tuwien.ac.at --- print_wiki.c | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/print_wiki.c b/print_wiki.c index 43fab47..c25ec28 100644 --- a/print_wiki.c +++ b/print_wiki.c @@ -73,8 +73,8 @@ static const char chip_th[] = "{\ | align="center" | Min \n| align="center" | Max\n\n";
static const char programmer_th[] = "{| border="0" style="font-size: \ -smaller" valign="top"\n|- bgcolor="#6699dd"\n! align="left" | Vendor\n\ -! align="left" | Device\n! align="center" | IDs\n\ +smaller" valign="top"\n|- bgcolor="#6699dd"\n! align="left" | Programmer\n\ +! align="left" | Vendor\n ! align="left" | Device\n! align="center" | IDs\n\ ! align="center" | Status\n\n";
#if CONFIG_INTERNAL == 1 @@ -305,17 +305,21 @@ static int count_supported_pcidevs_wiki(const struct pcidev_status *devs) return count; }
-static void print_supported_pcidevs_wiki_helper(const struct pcidev_status *devs) +static void print_supported_pcidevs_wiki_helper(const struct programmer_entry prog) { int i = 0; static int c = 0; + const struct pcidev_status *devs = prog.devices.pci; + const unsigned int count = count_supported_pcidevs_wiki(devs);
/* Alternate colors if the vendor changes. */ c = !c;
for (i = 0; devs[i].vendor_name != NULL; i++) { - printf("|- bgcolor="#%s"\n| %s || %s || " - "%04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd", + printf("|- bgcolor="#%s"\n", (c) ? "eeeeee" : "dddddd"); + if (i == 0) + printf("| rowspan="%u" | %s |", count, prog.name); + printf("| %s || %s || %04x:%04x || {{%s}}\n", devs[i].vendor_name, devs[i].device_name, devs[i].vendor_id, devs[i].device_id, (devs[i].status == NT) ? "?3" : "OK"); @@ -332,17 +336,21 @@ static int count_supported_usbdevs_wiki(const struct usbdev_status *devs) return count; }
-static void print_supported_usbdevs_wiki_helper(const struct usbdev_status *devs) +static void print_supported_usbdevs_wiki_helper(const struct programmer_entry prog) { int i = 0; static int c = 0; + const struct usbdev_status *devs = prog.devices.usb; + const unsigned int count = count_supported_usbdevs_wiki(devs);
/* Alternate colors if the vendor changes. */ c = !c;
for (i = 0; devs[i].vendor_name != NULL; i++) { - printf("|- bgcolor="#%s"\n| %s || %s || " - "%04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd", + printf("|- bgcolor="#%s"\n", (c) ? "eeeeee" : "dddddd"); + if (i == 0) + printf("| rowspan="%u" | %s |", count, prog.name); + printf("| %s || %s || %04x:%04x || {{%s}}\n", devs[i].vendor_name, devs[i].device_name, devs[i].vendor_id, devs[i].device_id, (devs[i].status == NT) ? "?3" : "OK"); @@ -379,7 +387,7 @@ static void print_supported_devs_wiki() for (i = 0; i < PROGRAMMER_INVALID; i++) { const struct programmer_entry prog = programmer_table[i]; if (prog.type == PCI) { - print_supported_pcidevs_wiki_helper(prog.devices.pci); + print_supported_pcidevs_wiki_helper(prog); } } printf("\n|}\n"); @@ -393,7 +401,7 @@ static void print_supported_devs_wiki() for (i = 0; i < PROGRAMMER_INVALID; i++) { const struct programmer_entry prog = programmer_table[i]; if (prog.type == USB) { - print_supported_usbdevs_wiki_helper(prog.devices.usb); + print_supported_usbdevs_wiki_helper(prog); } } printf("\n|}\n");