Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/thorpej_scsipi]: src/sys/arch/sparc/sparc Adapt to scsipi API changes.



details:   https://anonhg.NetBSD.org/src/rev/1a8172ac3a19
branches:  thorpej_scsipi
changeset: 477275:1a8172ac3a19
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Oct 19 17:57:25 1999 +0000

description:
Adapt to scsipi API changes.

diffstat:

 sys/arch/sparc/sparc/autoconf.c |  16 ++++++++--------
 sys/arch/sparc/sparc/disksubr.c |  12 ++++++++----
 2 files changed, 16 insertions(+), 12 deletions(-)

diffs (94 lines):

diff -r 6eb3b7055389 -r 1a8172ac3a19 sys/arch/sparc/sparc/autoconf.c
--- a/sys/arch/sparc/sparc/autoconf.c   Tue Oct 19 17:56:39 1999 +0000
+++ b/sys/arch/sparc/sparc/autoconf.c   Tue Oct 19 17:57:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.125 1999/10/04 19:27:04 pk Exp $ */
+/*     $NetBSD: autoconf.c,v 1.125.2.1 1999/10/19 17:57:25 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -1719,23 +1719,23 @@
                 * from parent and match with current bootpath component.
                 */
                struct scsipibus_attach_args *sa = aux;
-               struct scsipi_link *sc_link = sa->sa_sc_link;
-               struct scsibus_softc *sbsc =
-                       (struct scsibus_softc *)dev->dv_parent;
+               struct scsipi_periph *periph = sa->sa_periph;
+               struct scsipi_channel *chan = periph->periph_channel;
                u_int target = bp->val[0];
                u_int lun = bp->val[1];
 
                /*
                 * Bounds check; XXX - guess a reasonable target/lun bound.
                 */
-               if (target >= 16 || lun >= 16) {
+               if (target >= chan->chan_ntargets || lun >= chan->chan_nluns) {
                        printf("SCSI disk bootpath component not accepted: "
                               "target %u; lun %u\n", target, lun);
                        return;
                }
 
                if (CPU_ISSUN4 && dvname[0] == 's' &&
-                   target == 0 && sbsc->sc_link[0][0] == NULL) {
+                   target == 0 &&
+                   scsipi_lookup_periph(chan, target, lun) == NULL) {
                        /*
                         * disk unit 0 is magic: if there is actually no
                         * target 0 scsi device, the PROM will call
@@ -1749,8 +1749,8 @@
                if (CPU_ISSUN4C && dvname[0] == 's')
                        target = sd_crazymap(target);
 
-               if (sc_link->scsipi_scsi.target == target &&
-                   sc_link->scsipi_scsi.lun == lun) {
+               if (periph->periph_target == target &&
+                   periph->periph_lun == lun) {
                        nail_bootdev(dev, bp);
                        return;
                }
diff -r 6eb3b7055389 -r 1a8172ac3a19 sys/arch/sparc/sparc/disksubr.c
--- a/sys/arch/sparc/sparc/disksubr.c   Tue Oct 19 17:56:39 1999 +0000
+++ b/sys/arch/sparc/sparc/disksubr.c   Tue Oct 19 17:57:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.23 1999/02/14 12:42:33 pk Exp $ */
+/*     $NetBSD: disksubr.c,v 1.23.8.1 1999/10/19 17:57:26 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Gordon W. Ross
@@ -76,6 +76,8 @@
 {
        struct bootpath *bp = bootpath_store(0, NULL); /* restore bootpath! */
        struct scsibus_softc *sbsc;
+       struct scsipi_channel *chan;
+       struct scsipi_periph *periph;
        int target, lun;
 
        if (bp == NULL)
@@ -88,12 +90,13 @@
            strncmp("cd", dev->dv_xname, 2) == 0) {
 
                sbsc = (struct scsibus_softc *)dev->dv_parent;
+               chan = sbsc->sc_channel;
 
                target = bp->val[0];
                lun = bp->val[1];
 
                if (CPU_ISSUN4 && dev->dv_xname[0] == 's' &&
-                   target == 0 && sbsc->sc_link[0][0] == NULL) {
+                   target == 0 && scsipi_lookup_periph(chan, 0, 0) == NULL) {
                        /*
                         * disk unit 0 is magic: if there is actually no
                         * target 0 scsi device, the PROM will call
@@ -107,8 +110,9 @@
                if (CPU_ISSUN4C && dev->dv_xname[0] == 's')
                        target = sd_crazymap(target);
 
-               if (sbsc->sc_link[target][lun] != NULL &&
-                   sbsc->sc_link[target][lun]->device_softc == (void *)dev) {
+               periph = scsipi_lookup_periph(chan, target, lun);
+               if (periph != NULL &&
+                   periph->periph_dev == (void *)dev) {
                        bp->dev = dev;  /* got it! */
                        return;
                }



Home | Main Index | Thread Index | Old Index