Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/bebox Change path-format for scsi. s, scsi/B/T/L_n, s...



details:   https://anonhg.NetBSD.org/src/rev/ca966cdb22c5
branches:  trunk
changeset: 783405:ca966cdb22c5
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Wed Dec 19 13:53:47 2012 +0000

description:
Change path-format for scsi. s,scsi/B/T/L_n,scsi/BTL/0_n,.

diffstat:

 sys/arch/bebox/bebox/autoconf.c     |  41 +++++++++++++++---------------------
 sys/arch/bebox/stand/boot/boot.c    |   6 ++--
 sys/arch/bebox/stand/boot/devopen.c |  16 +++++++-------
 sys/arch/bebox/stand/boot/sd.c      |   4 +-
 sys/arch/bebox/stand/boot/version   |   3 +-
 5 files changed, 32 insertions(+), 38 deletions(-)

diffs (184 lines):

diff -r e8fde93116a7 -r ca966cdb22c5 sys/arch/bebox/bebox/autoconf.c
--- a/sys/arch/bebox/bebox/autoconf.c   Wed Dec 19 13:47:20 2012 +0000
+++ b/sys/arch/bebox/bebox/autoconf.c   Wed Dec 19 13:53:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.25 2012/07/29 18:05:40 mlelstv Exp $    */
+/*     $NetBSD: autoconf.c,v 1.26 2012/12/19 13:53:47 kiyohara Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.25 2012/07/29 18:05:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26 2012/12/19 13:53:47 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,6 +115,8 @@
        int part;
        char *p;
 
+       target = lun = drive = -1;
+
        rdev = (struct btinfo_rootdevice *)lookup_bootinfo(BTINFO_ROOTDEVICE);
        if (rdev == NULL)
                return;
@@ -127,32 +129,25 @@
                name = "sd";
                p += 5;
 
-               bus = 0;
-               while (isdigit(*p))
-                       bus = bus * 10 + (*p++) - '0';
-               if (*p++ != '/')
+               if (!isdigit(*(p + 0)) ||
+                   !isdigit(*(p + 1)) ||
+                   !isdigit(*(p + 2)) ||
+                   *(p + 3) != '/')
                        return;
-               target = 0;
-               while (isdigit(*p))
-                       target = target * 10 + (*p++) - '0';
-               if (*p++ != '/')
-                       return;
-               lun = 0;
-               while (isdigit(*p))
-                       lun = lun * 10 + (*p++) - '0';
+               bus = (*p++) - '0';
+               target = (*p++) - '0';
+               lun = (*p++) - '0';
        } else if (strncmp(p, "ide/", 4) == 0) {
                name = "wd";
                p += 4;
 
-               bus = 0;
-               while (isdigit(*p))
-                       bus = bus * 10 + (*p++) - '0';
+               bus = (*p++) - '0';
                if (*p++ != '/')
                        return;
-               if (strncmp(p, "master/0", 8) == 0) {
+               if (strncmp(p, "master/", 7) == 0) {
                        drive = 0;
                        p += 8;
-               } else if (strncmp(p, "slave/0", 7) == 0) {
+               } else if (strncmp(p, "slave/", 6) == 0) {
                        drive = 1;
                        p += 7;
                } else
@@ -163,12 +158,10 @@
                /* unknwon disk... */
                return;
 
-       if (*p != '_' || !isdigit(*(p + 1)))
+       if (*(p + 0) != '0' || *(p + 1) != '_' || !isdigit(*(p + 2)))
                return;
-       p++;
-       part = 0;
-       while (isdigit(*p))
-               part = part * 10 + (*p++) - '0';
+       p += 2;
+       part = (*p++) - '0';
        if (p != '\0')
                return;
 
diff -r e8fde93116a7 -r ca966cdb22c5 sys/arch/bebox/stand/boot/boot.c
--- a/sys/arch/bebox/stand/boot/boot.c  Wed Dec 19 13:47:20 2012 +0000
+++ b/sys/arch/bebox/stand/boot/boot.c  Wed Dec 19 13:53:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.25 2011/01/22 19:19:16 joerg Exp $  */
+/*     $NetBSD: boot.c,v 1.26 2012/12/19 13:53:47 kiyohara Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -44,10 +44,10 @@
 #include "wdvar.h"
 
 char *names[] = {
-       "/dev/disk/scsi/0/0/0_0:/netbsd",
+       "/dev/disk/scsi/000/0_0:/netbsd",
        "/dev/disk/ide/0/master/0_0:/netbsd",
        "/dev/disk/floppy:netbsd",      "/dev/disk/floppy:netbsd.gz",
-       "/dev/disk/scsi/0/0/0_0:/onetbsd",
+       "/dev/disk/scsi/000/0_0:/onetbsd",
        "/dev/disk/ide/0/master/0_0:/onetbsd",
        "/dev/disk/floppy:onetbsd",     "/dev/disk/floppy:onetbsd.gz"
        "in",
diff -r e8fde93116a7 -r ca966cdb22c5 sys/arch/bebox/stand/boot/devopen.c
--- a/sys/arch/bebox/stand/boot/devopen.c       Wed Dec 19 13:47:20 2012 +0000
+++ b/sys/arch/bebox/stand/boot/devopen.c       Wed Dec 19 13:53:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.10 2010/10/14 06:39:52 kiyohara Exp $    */
+/*     $NetBSD: devopen.c,v 1.11 2012/12/19 13:53:47 kiyohara Exp $    */
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -40,10 +40,10 @@
  * Parse a device spec.
  *   i.e.
  *     /dev/disk/floppy
- *     /dev/disk/ide/0/master/0
- *     /dev/disk/ide/0/slave/0
- *     /dev/disk/scsi/0/0/0
- *     /dev/disk/scsi/0/3/0
+ *     /dev/disk/ide/0/master/0_n
+ *     /dev/disk/ide/0/slave/0_n
+ *     /dev/disk/scsi/000/0_n
+ *     /dev/disk/scsi/030/0_n
  */
 static int
 devparse(const char *fname, int *dev, int *ctlr, int *unit, int *lunit,
@@ -106,7 +106,7 @@
                p += strlen(scsi);
                if (*p++ != '/' ||
                    !isdigit(*p++) ||
-                   *p++ != '/' ||
+                   !isdigit(*p++) ||
                    !isdigit(*p++) ||
                    *p++ != '/' ||
                    !isdigit(*p++) ||
@@ -114,8 +114,8 @@
                    !isdigit(*p++))
                        return EINVAL;
                *ctlr = *(p - 7) - '0';
-               *unit = *(p - 5) - '0';
-               *lunit = *(p - 3) - '0';
+               *unit = *(p - 6) - '0';
+               *lunit = *(p - 5) - '0';
                *part = *(p - 1) - '0';
                for (i = 0; devsw[i].dv_name != NULL; i++)
                        if (strcmp(devsw[i].dv_name, "sd") == 0) {
diff -r e8fde93116a7 -r ca966cdb22c5 sys/arch/bebox/stand/boot/sd.c
--- a/sys/arch/bebox/stand/boot/sd.c    Wed Dec 19 13:47:20 2012 +0000
+++ b/sys/arch/bebox/stand/boot/sd.c    Wed Dec 19 13:53:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.2 2011/07/17 20:54:38 joerg Exp $     */
+/*     $NetBSD: sd.c,v 1.3 2012/12/19 13:53:47 kiyohara Exp $  */
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -583,7 +583,7 @@
        part = va_arg(ap, u_int);
        va_end(ap);
 
-       DPRINTF(("sdopen: scsi/%d/%d/%d_%d\n", bus, target, lun, part));
+       DPRINTF(("sdopen: scsi/%d%d%d/0_%d\n", bus, target, lun, part));
 
        sd = alloc(sizeof(struct sd_softc));
        if (sd == NULL)
diff -r e8fde93116a7 -r ca966cdb22c5 sys/arch/bebox/stand/boot/version
--- a/sys/arch/bebox/stand/boot/version Wed Dec 19 13:47:20 2012 +0000
+++ b/sys/arch/bebox/stand/boot/version Wed Dec 19 13:53:47 2012 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.11 2010/10/18 17:56:40 kiyohara Exp $
+$NetBSD: version,v 1.12 2012/12/19 13:53:47 kiyohara Exp $
 
 1.1:           Boot program for BeBox; initial revision
 1.2:           check BUS FREQ, add clock information
@@ -12,3 +12,4 @@
 1.8:           Support kernel load from SCSI HDD with onboard siop.
                (EXPERIMENTAL)
 1.9:           Support ustarfs for floppy.
+1.10:          Change path-format for scsi. s,scsi/B/T/L_n,scsi/BTL/0_n,.



Home | Main Index | Thread Index | Old Index