Permit multiple BEV and BEV/BCV combinations in a single option rom.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 14 Jan 2012 16:55:35 +0000 (11:55 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 14 Jan 2012 17:59:26 +0000 (12:59 -0500)
The BBS spec is unclear on multiple BEV entry points for a rom.
However, the LSI scsi rom has been seen to register a BEV followed by
multiple BCV entry points.  Add support for it, as there's no harm in
it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/optionroms.c

index 725767bc81356103ab4f0884a3065eae3f8f54a2..27cfffd82a79e0e8e72b29f58949d4f8ed67c0a9 100644 (file)
@@ -388,19 +388,18 @@ optionrom_setup(void)
                          , getRomPriority(sources, rom, 0));
             continue;
         }
-        // PnP rom.
-        if (pnp->bev) {
-            // Can boot system - add to IPL list.
-            boot_add_bev(FLATPTR_TO_SEG(rom), pnp->bev, pnp->productname
-                         , getRomPriority(sources, rom, 0));
-        } else {
-            // Check for BCV (there may be multiple).
-            int instance = 0;
-            while (pnp && pnp->bcv) {
+        // PnP rom - check for BEV and BCV boot capabilities.
+        int instance = 0;
+        while (pnp) {
+            if (pnp->bev)
+                boot_add_bev(FLATPTR_TO_SEG(rom), pnp->bev, pnp->productname
+                             , getRomPriority(sources, rom, instance++));
+            else if (pnp->bcv)
                 boot_add_bcv(FLATPTR_TO_SEG(rom), pnp->bcv, pnp->productname
                              , getRomPriority(sources, rom, instance++));
-                pnp = get_pnp_next(rom, pnp);
-            }
+            else
+                break;
+            pnp = get_pnp_next(rom, pnp);
         }
     }
 }