summaryrefslogtreecommitdiffstats
path: root/print_wiki.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-26 00:36:24 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-26 00:36:24 +0000
commit6455dff07b06e3b870f75e88652e0501810bd104 (patch)
tree0ec4cf1c51ffbd549717d6c030422e37cddddca7 /print_wiki.c
parentffb0cf649c1c66c85441314434cd1cd57f89fe02 (diff)
downloadflashrom-6455dff07b06e3b870f75e88652e0501810bd104.tar.gz
flashrom-6455dff07b06e3b870f75e88652e0501810bd104.tar.bz2
flashrom-6455dff07b06e3b870f75e88652e0501810bd104.zip
Add two new states to enum test_state and use it for flashchips
The new enum test_state looks like this: enum test_state { OK = 0, NT = 1, /* Not tested */ BAD, /* Known to not work */ DEP, /* Support depends on configuration (e.g. Intel flash descriptor) */ NA, /* Not applicable (e.g. write support on ROM chips) */ }; The second new state 'NA' is introduced, among other things, to indicate the erase and write states of real ROMs correctly. This is also implemented by this patch and required to exchange the previous bit mask in struct flashchip with a new struct containing an enum test_state for each operation. The -L output is changed accordingly to print '-' in the case of an N/A state and the wiki output uses a new template producing a greyed out cell. Previous users of enum test_state are not affected by this change (yet). Corresponding to flashrom svn r1798. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'print_wiki.c')
-rw-r--r--print_wiki.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/print_wiki.c b/print_wiki.c
index 5dcc4b6dc..cad6fef44 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -249,7 +249,6 @@ static void print_supported_boards_wiki(void)
static void print_supported_chips_wiki(int cols)
{
unsigned int lines_per_col;
- uint32_t t;
char *s;
char vmax[6];
char vmin[6];
@@ -287,7 +286,35 @@ static void print_supported_chips_wiki(int cols)
c = !c;
old = f;
- t = f->tested;
+ const char *probe, *read, *write, *erase;
+ switch (f->tested.probe) {
+ case OK: probe = "OK"; break;
+ case BAD: probe = "No"; break;
+ case NA: probe = "NA"; break;
+ case DEP: probe = "Dep"; break;
+ default: probe = "?3"; break;
+ }
+ switch (f->tested.read) {
+ case OK: read = "OK"; break;
+ case BAD: read = "No"; break;
+ case NA: read = "NA"; break;
+ case DEP: read = "Dep"; break;
+ default: read = "?3"; break;
+ }
+ switch (f->tested.erase) {
+ case OK: erase = "OK"; break;
+ case BAD: erase = "No"; break;
+ case NA: erase = "NA"; break;
+ case DEP: erase = "Dep"; break;
+ default: erase = "?3"; break;
+ }
+ switch (f->tested.write) {
+ case OK: write = "OK"; break;
+ case BAD: write = "No"; break;
+ case NA: write = "NA"; break;
+ case DEP: write = "Dep"; break;
+ default: write = "?3"; break;
+ }
s = flashbuses_to_text(f->bustype);
sprintf(vmin, "%0.03f", f->voltage.min / (double)1000);
sprintf(vmax, "%0.03f", f->voltage.max / (double)1000);
@@ -298,16 +325,9 @@ static void print_supported_chips_wiki(int cols)
"|| %s || %s \n",
(c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name,
f->total_size, s,
- (t & TEST_OK_PROBE) ? "OK" :
- (t & TEST_BAD_PROBE) ? "No" : "?3",
- (t & TEST_OK_READ) ? "OK" :
- (t & TEST_BAD_READ) ? "No" : "?3",
- (t & TEST_OK_ERASE) ? "OK" :
- (t & TEST_BAD_ERASE) ? "No" : "?3",
- (t & TEST_OK_WRITE) ? "OK" :
- (t & TEST_BAD_WRITE) ? "No" : "?3",
- f->voltage.min ? vmin : "N/A",
- f->voltage.min ? vmax : "N/A");
+ probe, read, erase, write,
+ f->voltage.min ? vmin : "?",
+ f->voltage.max ? vmax : "?");
free(s);
if (((i % lines_per_col) + 1) == lines_per_col)