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>
diff --git a/print.c b/print.c
index fd4b2a7..8ca99d5 100644
--- a/print.c
+++ b/print.c
@@ -249,38 +249,46 @@
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(" ");