Module Name: src Committed By: kiyohara Date: Wed Dec 19 13:53:47 UTC 2012
Modified Files: src/sys/arch/bebox/bebox: autoconf.c src/sys/arch/bebox/stand/boot: boot.c devopen.c sd.c version Log Message: Change path-format for scsi. s,scsi/B/T/L_n,scsi/BTL/0_n,. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/bebox/bebox/autoconf.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/bebox/stand/boot/boot.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/bebox/stand/boot/devopen.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/bebox/stand/boot/sd.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/bebox/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/bebox/bebox/autoconf.c diff -u src/sys/arch/bebox/bebox/autoconf.c:1.25 src/sys/arch/bebox/bebox/autoconf.c:1.26 --- src/sys/arch/bebox/bebox/autoconf.c:1.25 Sun Jul 29 18:05:40 2012 +++ src/sys/arch/bebox/bebox/autoconf.c Wed Dec 19 13:53:47 2012 @@ -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 @@ findroot(void) int part; char *p; + target = lun = drive = -1; + rdev = (struct btinfo_rootdevice *)lookup_bootinfo(BTINFO_ROOTDEVICE); if (rdev == NULL) return; @@ -127,32 +129,25 @@ findroot(void) name = "sd"; p += 5; - bus = 0; - while (isdigit(*p)) - bus = bus * 10 + (*p++) - '0'; - if (*p++ != '/') - return; - target = 0; - while (isdigit(*p)) - target = target * 10 + (*p++) - '0'; - if (*p++ != '/') - return; - lun = 0; - while (isdigit(*p)) - lun = lun * 10 + (*p++) - '0'; + if (!isdigit(*(p + 0)) || + !isdigit(*(p + 1)) || + !isdigit(*(p + 2)) || + *(p + 3) != '/') + return; + 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 @@ findroot(void) /* 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; Index: src/sys/arch/bebox/stand/boot/boot.c diff -u src/sys/arch/bebox/stand/boot/boot.c:1.25 src/sys/arch/bebox/stand/boot/boot.c:1.26 --- src/sys/arch/bebox/stand/boot/boot.c:1.25 Sat Jan 22 19:19:16 2011 +++ src/sys/arch/bebox/stand/boot/boot.c Wed Dec 19 13:53:47 2012 @@ -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", Index: src/sys/arch/bebox/stand/boot/devopen.c diff -u src/sys/arch/bebox/stand/boot/devopen.c:1.10 src/sys/arch/bebox/stand/boot/devopen.c:1.11 --- src/sys/arch/bebox/stand/boot/devopen.c:1.10 Thu Oct 14 06:39:52 2010 +++ src/sys/arch/bebox/stand/boot/devopen.c Wed Dec 19 13:53:47 2012 @@ -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 @@ static int devparse(const char *, int *, * 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 @@ devparse(const char *fname, int *dev, in p += strlen(scsi); if (*p++ != '/' || !isdigit(*p++) || - *p++ != '/' || + !isdigit(*p++) || !isdigit(*p++) || *p++ != '/' || !isdigit(*p++) || @@ -114,8 +114,8 @@ devparse(const char *fname, int *dev, in !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) { Index: src/sys/arch/bebox/stand/boot/sd.c diff -u src/sys/arch/bebox/stand/boot/sd.c:1.2 src/sys/arch/bebox/stand/boot/sd.c:1.3 --- src/sys/arch/bebox/stand/boot/sd.c:1.2 Sun Jul 17 20:54:38 2011 +++ src/sys/arch/bebox/stand/boot/sd.c Wed Dec 19 13:53:47 2012 @@ -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 @@ sdopen(struct open_file *f, ...) 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) Index: src/sys/arch/bebox/stand/boot/version diff -u src/sys/arch/bebox/stand/boot/version:1.11 src/sys/arch/bebox/stand/boot/version:1.12 --- src/sys/arch/bebox/stand/boot/version:1.11 Mon Oct 18 17:56:40 2010 +++ src/sys/arch/bebox/stand/boot/version Wed Dec 19 13:53:47 2012 @@ -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 @@ $NetBSD: version,v 1.11 2010/10/18 17:56 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,.