Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint/stand/altboot Support disk units from mul...



details:   https://anonhg.NetBSD.org/src/rev/834f1d3a09cb
branches:  trunk
changeset: 765878:834f1d3a09cb
user:      phx <phx%NetBSD.org@localhost>
date:      Wed Jun 08 18:06:02 2011 +0000

description:
Support disk units from multiple IDE/SATA PCI controllers.

diffstat:

 sys/arch/sandpoint/stand/altboot/dsk.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (56 lines):

diff -r d8af52cb8850 -r 834f1d3a09cb sys/arch/sandpoint/stand/altboot/dsk.c
--- a/sys/arch/sandpoint/stand/altboot/dsk.c    Wed Jun 08 17:47:48 2011 +0000
+++ b/sys/arch/sandpoint/stand/altboot/dsk.c    Wed Jun 08 18:06:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.5 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.6 2011/06/08 18:06:02 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 };
 static int ndskdv = sizeof(ldskdv)/sizeof(ldskdv[0]);
 
-static int disk_scan(void *);
+static void disk_scan(void *);
 static int probe_drive(struct dkdev_ata *, int);
 static void drive_ident(struct disk *, char *);
 static char *mkident(char *, int);
@@ -80,7 +80,8 @@
 static void issue28(struct dvata_chan *, int64_t, int);
 static struct disk *lookup_disk(int);
 
-static struct disk ldisk[4];
+#define MAX_UNITS 8
+static struct disk ldisk[MAX_UNITS];
 
 int
 dskdv_init(void *self)
@@ -103,15 +104,15 @@
        return 1;
 }
 
-static int
+static void
 disk_scan(void *drv)
 {
        struct dkdev_ata *l = drv;
        struct disk *d;
-       int n, ndrive;
+       static int ndrive = 0;
+       int n;
 
-       ndrive = 0;
-       for (n = 0; n < 4; n++) {
+       for (n = 0; n < 4 && ndrive < MAX_UNITS; n++) {
                if (l->presense[n] == 0)
                        continue;
                if (probe_drive(l, n) == 0) {
@@ -127,7 +128,6 @@
                decode_dlabel(d, l->iobuf);
                ndrive += 1;
        }
-       return ndrive;
 }
 
 int



Home | Main Index | Thread Index | Old Index