summaryrefslogtreecommitdiffstats
path: root/print.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.c
parentffb0cf649c1c66c85441314434cd1cd57f89fe02 (diff)
downloadast2050-flashrom-6455dff07b06e3b870f75e88652e0501810bd104.zip
ast2050-flashrom-6455dff07b06e3b870f75e88652e0501810bd104.tar.gz
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.c')
-rw-r--r--print.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/print.c b/print.c
index fd4b2a7..8ca99d5 100644
--- a/print.c
+++ b/print.c
@@ -249,38 +249,46 @@ static int print_supported_chips(void)
for (i = curdevlen; i < maxchiplen; i++)
msg_ginfo(" ");
- if ((chip->tested & TEST_OK_PROBE))
+ if (chip->tested.probe == OK)
msg_ginfo("P");
+ else if (chip->tested.probe == NA)
+ msg_ginfo("-");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_OK_READ))
+ if (chip->tested.read == OK)
msg_ginfo("R");
+ else if (chip->tested.read == NA)
+ msg_ginfo("-");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_OK_ERASE))
+ if (chip->tested.erase == OK)
msg_ginfo("E");
+ else if (chip->tested.erase == NA)
+ msg_ginfo("-");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_OK_WRITE))
+ if (chip->tested.write == OK)
msg_ginfo("W");
+ else if (chip->tested.write == NA)
+ msg_ginfo("-");
else
msg_ginfo(" ");
for (i = 0; i < border; i++)
msg_ginfo(" ");
- if ((chip->tested & TEST_BAD_PROBE))
+ if (chip->tested.probe == BAD)
msg_ginfo("P");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_BAD_READ))
+ if (chip->tested.read == BAD)
msg_ginfo("R");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_BAD_ERASE))
+ if (chip->tested.erase == BAD)
msg_ginfo("E");
else
msg_ginfo(" ");
- if ((chip->tested & TEST_BAD_WRITE))
+ if (chip->tested.write == BAD)
msg_ginfo("W");
else
msg_ginfo(" ");
OpenPOWER on IntegriCloud