Nick: roysjosh E-mail: none Board: ASUS L1N64 Contents: diff --git a/chipset_enable.c b/chipset_enable.c index 0aba1e0..944c31d 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -1369,37 +1369,45 @@ int chipset_flash_enable(void) chipset_enables[i].device_name); continue; } - msg_pinfo("Found chipset \"%s %s\"", - chipset_enables[i].vendor_name, - chipset_enables[i].device_name); - msg_pdbg(" with PCI ID %04x:%04x", - chipset_enables[i].vendor_id, - chipset_enables[i].device_id); - msg_pinfo(". "); - - if (chipset_enables[i].status == NT) { - msg_pinfo("\nThis chipset is marked as untested. If " - "you are using an up-to-date version\nof " - "flashrom please email a report to " - "flashrom@flashrom.org including a\nverbose " - "(-V) log. Thank you!\n"); - } - msg_pinfo("Enabling flash write... "); - ret = chipset_enables[i].doit(dev, - chipset_enables[i].device_name); - if (ret == NOT_DONE_YET) { - ret = -2; - msg_pinfo("OK - searching further chips.\n"); - } else if (ret < 0) - msg_pinfo("FAILED!\n"); - else if (ret == 0) - msg_pinfo("OK.\n"); - else if (ret == ERROR_NONFATAL) - msg_pinfo("PROBLEMS, continuing anyway\n"); - if (ret == ERROR_FATAL) { - msg_perr("FATAL ERROR!\n"); - return ret; - } + do { + msg_pinfo("Found chipset \"%s %s\"", + chipset_enables[i].vendor_name, + chipset_enables[i].device_name); + msg_pdbg(" with PCI ID %04x:%04x", + chipset_enables[i].vendor_id, + chipset_enables[i].device_id); + msg_pinfo(". "); + + if (chipset_enables[i].status == NT) { + msg_pinfo("\nThis chipset is marked as untested. If " + "you are using an up-to-date version\nof " + "flashrom please email a report to " + "flashrom@flashrom.org including a\nverbose " + "(-V) log. Thank you!\n"); + } + msg_pinfo("Enabling flash write... "); + ret = chipset_enables[i].doit(dev, + chipset_enables[i].device_name); + if (ret == NOT_DONE_YET) { + ret = -2; + msg_pinfo("OK - searching further chips.\n"); + + dev = pci_dev_find_next(dev->next, + chipset_enables[i].vendor_id, + chipset_enables[i].device_id); + if (dev) + continue; + } else if (ret < 0) + msg_pinfo("FAILED!\n"); + else if (ret == 0) + msg_pinfo("OK.\n"); + else if (ret == ERROR_NONFATAL) + msg_pinfo("PROBLEMS, continuing anyway\n"); + if (ret == ERROR_FATAL) { + msg_perr("FATAL ERROR!\n"); + return ret; + } + } while(0); } return ret; diff --git a/internal.c b/internal.c index 479cbf7..b84e2a4 100644 --- a/internal.c +++ b/internal.c @@ -55,7 +55,7 @@ struct pci_dev *pci_dev_find_vendorclass(uint16_t vendor, uint16_t devclass) return NULL; } -struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) +struct pci_dev *pci_dev_find_next(struct pci_dev *dev, uint16_t vendor, uint16_t device) { struct pci_dev *temp; struct pci_filter filter; @@ -64,13 +64,18 @@ struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) filter.vendor = vendor; filter.device = device; - for (temp = pacc->devices; temp; temp = temp->next) + for (temp = dev ? dev : pacc->devices; temp; temp = temp->next) if (pci_filter_match(&filter, temp)) return temp; return NULL; } +struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) +{ + return pci_dev_find_next(NULL, vendor, device); +} + struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, uint16_t card_vendor, uint16_t card_device) { diff --git a/programmer.h b/programmer.h index c99e37f..6e3d52f 100644 --- a/programmer.h +++ b/programmer.h @@ -288,6 +288,7 @@ extern int superio_count; #if NEED_PCI == 1 struct pci_dev *pci_dev_find_filter(struct pci_filter filter); struct pci_dev *pci_dev_find_vendorclass(uint16_t vendor, uint16_t devclass); +struct pci_dev *pci_dev_find_next(struct pci_dev *dev,uint16_t vendor, uint16_t device); struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device); struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, uint16_t card_vendor, uint16_t card_device);