From 515ab3de05f81253b94e7dd659f09c50724fb830 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 15 May 2009 17:02:34 +0000 Subject: Refactor parts of the 3COM NIC code Move the reusable PCI specific parts into pcidev.c, they'll be usable for other NIC code (Realtek, VIA, ...) and also for SATA/IDE controller cards as external programmers (for every PCI device which can program EEPROMs basically). Also add print_supported_pcidevs() to show the supported PCI devices (currently only NICs, soon more) in the 'flashrom -L' output. Corresponding to flashrom svn r515. Signed-off-by: Uwe Hermann Acked-by: Carl-Daniel Hailfinger --- flashrom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index 9c26b59..e00e678 100644 --- a/flashrom.c +++ b/flashrom.c @@ -35,7 +35,6 @@ char *chip_to_probe = NULL; int exclude_start_page, exclude_end_page; int verbose = 0; int programmer = PROGRAMMER_INTERNAL; -char *nic_pcidev = NULL; const struct programmer_entry programmer_table[] = { { @@ -446,6 +445,9 @@ int main(int argc, char *argv[]) print_supported_chips(); print_supported_chipsets(); print_supported_boards(); + printf("\nSupported PCI devices flashrom can use " + "as programmer:\n\n"); + print_supported_pcidevs(nics_3com); exit(0); break; case 'p': @@ -456,7 +458,7 @@ int main(int argc, char *argv[]) } else if (strncmp(optarg, "nic3com", 7) == 0) { programmer = PROGRAMMER_NIC3COM; if (optarg[7] == '=') - nic_pcidev = strdup(optarg + 8); + pcidev_bdf = strdup(optarg + 8); } else { printf("Error: Unknown programmer.\n"); exit(1); -- cgit v1.1