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:
parent
83c33f4fee
commit
d07a6cf8e4
|
@ -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.
|
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
#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"
|
#include "opt_new_scc_driver.h"
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ dec_3000_300_device_register(dev, aux)
|
||||||
{
|
{
|
||||||
static int found, initted, scsiboot, netboot;
|
static int found, initted, scsiboot, netboot;
|
||||||
static struct device *scsidev;
|
static struct device *scsidev;
|
||||||
|
static struct device *tcdsdev;
|
||||||
struct bootdev_data *b = bootdev_data;
|
struct bootdev_data *b = bootdev_data;
|
||||||
struct device *parent = dev->dv_parent;
|
struct device *parent = dev->dv_parent;
|
||||||
struct cfdata *cf = dev->dv_cfdata;
|
struct cfdata *cf = dev->dv_cfdata;
|
||||||
|
@ -184,33 +185,48 @@ dec_3000_300_device_register(dev, aux)
|
||||||
#if 0
|
#if 0
|
||||||
printf("scsiboot = %d, netboot = %d\n", scsiboot, netboot);
|
printf("scsiboot = %d, netboot = %d\n", scsiboot, netboot);
|
||||||
#endif
|
#endif
|
||||||
initted =1;
|
initted = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scsiboot && (strcmp(cd->cd_name, "asc") == 0)) {
|
/*
|
||||||
if (b->slot == 4 &&
|
* for scsi boot, we look for "tcds", make sure it has the
|
||||||
strcmp(parent->dv_cfdata->cf_driver->cd_name, "tcds")
|
* right slot number, then find the "asc" on this tcds that
|
||||||
== 0) {
|
* as the right channel. then we find the actual scsi
|
||||||
struct tcdsdev_attach_args *tcdsdev = aux;
|
* 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 (tcdsdev->tcdsda_chip == b->channel) {
|
if (b->slot != tcargs->ta_slot)
|
||||||
scsidev = dev;
|
return;
|
||||||
|
|
||||||
|
tcdsdev = dev;
|
||||||
#if 0
|
#if 0
|
||||||
printf("\nscsidev = %s\n", dev->dv_xname);
|
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;
|
||||||
|
|
||||||
|
scsidev = dev;
|
||||||
|
#if 0
|
||||||
|
printf("\nscsidev = %s\n", dev->dv_xname);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scsiboot &&
|
if (scsiboot && scsidev &&
|
||||||
(strcmp(cd->cd_name, "sd") == 0 ||
|
(strcmp(cd->cd_name, "sd") == 0 ||
|
||||||
strcmp(cd->cd_name, "st") == 0 ||
|
strcmp(cd->cd_name, "st") == 0 ||
|
||||||
strcmp(cd->cd_name, "cd") == 0)) {
|
strcmp(cd->cd_name, "cd") == 0)) {
|
||||||
struct scsipibus_attach_args *sa = aux;
|
struct scsipibus_attach_args *sa = aux;
|
||||||
|
|
||||||
if (scsidev == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (parent->dv_parent != scsidev)
|
if (parent->dv_parent != scsidev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue