Fix boot device detection in the face of multiple SCSI controllers. This
isn't perfect (the NetBSD device units must match ARCS device numbers), but it's better than randomly matching one of the devices. Fixes PR 16584 from Scott G. Taylor.
This commit is contained in:
parent
0b1aae71e4
commit
653e0b546e
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.c,v 1.8 2002/03/13 13:12:29 simonb Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.9 2002/07/15 04:38:59 rafal Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang
|
||||
@ -50,7 +50,7 @@
|
||||
#include <dev/scsipi/scsiconf.h>
|
||||
|
||||
struct device *booted_device = NULL;
|
||||
static struct device *booted_controller;
|
||||
static struct device *booted_controller = NULL;
|
||||
static int booted_slot, booted_unit, booted_partition;
|
||||
static char *booted_protocol = NULL;
|
||||
|
||||
@ -177,8 +177,12 @@ device_register(dev, aux)
|
||||
* Check for WDC controller
|
||||
*/
|
||||
if (scsiboot && strcmp(cd->cd_name, "wdsc") == 0) {
|
||||
/* XXX Check controller number == booted_slot */
|
||||
booted_controller = dev;
|
||||
/*
|
||||
* XXX: this fails if the controllers were attached
|
||||
* in an order other than the ARCS-imposed order.
|
||||
*/
|
||||
if (dev->dv_unit == booted_slot)
|
||||
booted_controller = dev;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user