pull across fix from dec_3000_500.c:

>split the "asc" and "tcds" searching into two separate sections and
>keep a "tcdsdev" of the booted tcds device.  make sure that the "asc"
>is the child of the tcds.  this fixes boot device detection on dec
>5000/400 (prolly 400-900) machines in the presense of a tcds option
>card, which would use the right tcds chip & disk scsiid of the last
>attached tcds -- which meant it would choose the wrong disk, or not
>find the boot device at all if the corresponding scsiid was unused in
>the last attached disk.
>
>XXX: this may need to be copied to dec_3000_300.c but i have no idea
>as i can not test this hardware at all...
>
>fixes PR#8771 by myself.
This commit is contained in:
mrg 1999-11-20 00:01:14 +00:00
parent 83c33f4fee
commit d07a6cf8e4
1 changed files with 33 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dec_3000_300.c,v 1.28 1999/08/08 01:40:20 ross Exp $ */
/* $NetBSD: dec_3000_300.c,v 1.29 1999/11/20 00:01:14 mrg Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -33,7 +33,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.28 1999/08/08 01:40:20 ross Exp $");
__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.29 1999/11/20 00:01:14 mrg Exp $");
#include "opt_new_scc_driver.h"
@ -170,6 +170,7 @@ dec_3000_300_device_register(dev, aux)
{
static int found, initted, scsiboot, netboot;
static struct device *scsidev;
static struct device *tcdsdev;
struct bootdev_data *b = bootdev_data;
struct device *parent = dev->dv_parent;
struct cfdata *cf = dev->dv_cfdata;
@ -187,30 +188,45 @@ dec_3000_300_device_register(dev, aux)
initted = 1;
}
if (scsiboot && (strcmp(cd->cd_name, "asc") == 0)) {
if (b->slot == 4 &&
strcmp(parent->dv_cfdata->cf_driver->cd_name, "tcds")
== 0) {
struct tcdsdev_attach_args *tcdsdev = aux;
/*
* for scsi boot, we look for "tcds", make sure it has the
* right slot number, then find the "asc" on this tcds that
* as the right channel. then we find the actual scsi
* device we came from. note: no SCSI LUN support (yet).
*/
if (scsiboot && (strcmp(cd->cd_name, "tcds") == 0)) {
struct tc_attach_args *tcargs = aux;
if (b->slot != tcargs->ta_slot)
return;
tcdsdev = dev;
#if 0
printf("\ntcdsdev = %s\n", dev->dv_xname);
#endif
}
if (scsiboot && tcdsdev &&
(strcmp(cd->cd_name, "asc") == 0)) {
struct tcdsdev_attach_args *ta = aux;
if (parent != (struct device *)tcdsdev)
return;
if (ta->tcdsda_chip != b->channel)
return;
if (tcdsdev->tcdsda_chip == b->channel) {
scsidev = dev;
#if 0
printf("\nscsidev = %s\n", dev->dv_xname);
#endif
}
}
}
if (scsiboot &&
if (scsiboot && scsidev &&
(strcmp(cd->cd_name, "sd") == 0 ||
strcmp(cd->cd_name, "st") == 0 ||
strcmp(cd->cd_name, "cd") == 0)) {
struct scsipibus_attach_args *sa = aux;
if (scsidev == NULL)
return;
if (parent->dv_parent != scsidev)
return;