From e19e86d06711a9b84fadcc5b5852e7757428e11a Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 3 Jul 2009 23:51:19 +0000 Subject: Some flashrom printing changes - Also print URLs of boards with board-enables. - Mark known-bad operations for chips red in the wiki. - Clarifiy a wiki message a bit. Corresponding to flashrom svn r640. Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann --- print.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'print.c') diff --git a/print.c b/print.c index bfe5ab8..edcefa9 100644 --- a/print.c +++ b/print.c @@ -239,7 +239,7 @@ const char *wiki_header = "= Supported devices =\n\n\
\n\ Please do '''not''' edit these tables in the wiki directly, they are \ -semi-automatically generated by pasting '''flashrom -z''' output.
\ +generated by pasting '''flashrom -z''' output.
\ '''Last update:''' %s(generated by flashrom %s)\n
\n"; const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\ @@ -596,8 +596,9 @@ static void wiki_helper(const char *heading, const char *status, static void wiki_helper2(const char *heading, int cols) { - int i, j, boardcount = 0, color = 1; + int i, j, k, boardcount = 0, color = 1; struct board_pciid_enable *b; + const struct board_info_url *u = boards_url; for (b = board_pciid_enables; b->vendor_name != NULL; b++) boardcount++; @@ -612,9 +613,13 @@ static void wiki_helper2(const char *heading, int cols) if (i > 0 && strcmp(b[i].vendor_name, b[i - 1].vendor_name)) color = !color; - printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || " - "%s%s%s%s || {{OK}}\n", (color) ? "eeeeee" : "dddddd", - b[i].vendor_name, b[i].board_name, + k = url(b[i].vendor_name, b[i].board_name); + + printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s%s %s%s " + "|| %s%s%s%s || {{OK}}\n", (color) ? "eeeeee" : "dddddd", + b[i].vendor_name, (k != -1 && u[k].url) ? "[" : "", + (k != -1 && u[k].url) ? u[k].url : "", b[i].board_name, + (k != -1 && u[k].url) ? "]" : "", (b[i].lb_vendor) ? "-m " : "—", (b[i].lb_vendor) ? b[i].lb_vendor : "", (b[i].lb_vendor) ? ":" : "", @@ -646,6 +651,7 @@ void print_supported_chips_wiki(void) { int i = 0, c = 1, chipcount = 0; struct flashchip *f, *old = NULL; + uint32_t t; for (f = flashchips; f->name != NULL; f++) chipcount++; @@ -663,14 +669,19 @@ void print_supported_chips_wiki(void) if (old != NULL && strcmp(old->vendor, f->vendor)) c = !c; + t = f->tested; printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || %d " "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n", (c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name, f->total_size, flashbuses_to_text(f->bustype), - ((f->tested & TEST_OK_PROBE) ? "OK" : (c) ? "?2" : "?"), - ((f->tested & TEST_OK_READ) ? "OK" : (c) ? "?2" : "?"), - ((f->tested & TEST_OK_ERASE) ? "OK" : (c) ? "?2" : "?"), - ((f->tested & TEST_OK_WRITE) ? "OK" : (c) ? "?2" : "?")); + (t & TEST_OK_PROBE) ? "OK" : + (t & TEST_BAD_PROBE) ? "No" : ((c) ? "?2" : "?"), + (t & TEST_OK_READ) ? "OK" : + (t & TEST_BAD_READ) ? "No" : ((c) ? "?2" : "?"), + (t & TEST_OK_ERASE) ? "OK" : + (t & TEST_BAD_ERASE) ? "No" : ((c) ? "?2" : "?"), + (t & TEST_OK_WRITE) ? "OK" : + (t & TEST_BAD_WRITE) ? "No" : ((c) ? "?2" : "?")); /* Split table into three columns. */ if (i >= (chipcount / 3 + 1)) { -- cgit v1.1