1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 14:42:36 +02:00

Introduce enum test_state

Previously boards in the wiki were tagged either as working or as known
bad. But we added support to various boards via board enables that were
then never tested because the owners have not reported back. This can
now be tagged with NT and is shown appropriately.

Also, the underlying data structure indicating state was converted from
macros to an enum while preserving original integer values and is used
for programmers and chipsets too.

Corresponding to flashrom svn r1555.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Stefan Tauner 2012-07-28 19:35:26 +00:00
parent d94d25d75b
commit 2c20b28f0e
4 changed files with 525 additions and 508 deletions

View File

@ -253,8 +253,11 @@ int doit(struct flashctx *flash, int force, const char *filename, int read_it, i
int read_buf_from_file(unsigned char *buf, unsigned long size, const char *filename);
int write_buf_to_file(unsigned char *buf, unsigned long size, const char *filename);
#define OK 0
#define NT 1 /* Not tested */
enum test_state {
OK = 0,
NT = 1, /* Not tested */
BAD
};
/* Something happened that shouldn't happen, but we can go on. */
#define ERROR_NONFATAL 0x100

997
print.c

File diff suppressed because it is too large Load Diff

View File

@ -129,23 +129,27 @@ static void print_supported_chipsets_wiki(int cols)
static void wiki_helper(const char *devicetype, int cols,
const struct board_info boards[])
{
int i, j, k = 0, boardcount_good = 0, boardcount_bad = 0, color = 1;
int num_notes = 0;
int i, j, k;
unsigned int boardcount_good = 0, boardcount_bad = 0, boardcount_nt = 0;
int num_notes = 0, color = 1;
char *notes = calloc(1, 1);
char tmp[900 + 1];
const struct board_match *b = board_matches;
for (i = 0; boards[i].vendor != NULL; i++) {
if (boards[i].working)
if (boards[i].working == OK)
boardcount_good++;
else if (boards[i].working == NT)
boardcount_nt++;
else
boardcount_bad++;
}
printf("\n\nTotal amount of supported %s: '''%d'''. "
"Not yet supported (i.e., known-bad): '''%d'''.\n\n"
printf("\n\nTotal amount of known good boards %s: '''%d'''; "
"Untested (e.g. user vanished before testing new code): '''%d'''; "
"Not yet supported (i.e. known-bad): '''%d'''.\n\n"
"{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s",
devicetype, boardcount_good, boardcount_bad, board_th);
devicetype, boardcount_good, boardcount_nt, boardcount_bad, board_th);
for (i = 0, j = 0; boards[i].vendor != NULL; i++, j++) {
@ -171,7 +175,8 @@ static void wiki_helper(const char *devicetype, int cols,
b[k].lb_vendor ? b[k].lb_vendor : "",
b[k].lb_vendor ? ":" : "",
b[k].lb_vendor ? b[k].lb_part : "",
(boards[i].working) ? "OK" : "No");
(boards[i].working == OK) ? "OK" :
(boards[i].working == NT) ? "?3" : "No");
if (boards[i].note) {
printf("<sup>%d</sup>\n", num_notes + 1);

View File

@ -148,7 +148,7 @@ struct pci_dev;
struct penable {
uint16_t vendor_id;
uint16_t device_id;
int status; /* OK=0 and NT=1 are defines only. Beware! */
const enum test_state status;
const char *vendor_name;
const char *device_name;
int (*doit) (struct pci_dev *dev, const char *name);
@ -190,7 +190,7 @@ struct board_match {
const char *board_name;
int max_rom_decode_parallel;
int status;
const enum test_state status;
int (*enable) (void); /* May be NULL. */
};
@ -199,7 +199,7 @@ extern const struct board_match board_matches[];
struct board_info {
const char *vendor;
const char *name;
const int working;
const enum test_state working;
#ifdef CONFIG_PRINT_WIKI
const char *url;
const char *note;
@ -224,7 +224,7 @@ extern struct pci_dev *pcidev_dev;
struct pcidev_status {
uint16_t vendor_id;
uint16_t device_id;
int status;
const enum test_state status;
const char *vendor_name;
const char *device_name;
};
@ -425,7 +425,7 @@ extern const struct pcidev_status ata_hpt[];
struct usbdev_status {
uint16_t vendor_id;
uint16_t device_id;
int status;
const enum test_state status;
const char *vendor_name;
const char *device_name;
};