Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2013 17:20:44 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253712 - head/sys/dev/ciss
Message-ID:  <201307271720.r6RHKix6062083@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Sat Jul 27 17:20:43 2013
New Revision: 253712
URL: http://svnweb.freebsd.org/changeset/base/253712

Log:
  update ciss debugger command to iterate over multiple raid controllers up to
  max controllers supported
  
  PR:	kern/179932
  Reviewed by:	Markus Gebert <markus.gebert@hostpoint.ch>
  MFC after:	2 weeks
  Sponsored by:	Yahoo! Inc.

Modified:
  head/sys/dev/ciss/ciss.c

Modified: head/sys/dev/ciss/ciss.c
==============================================================================
--- head/sys/dev/ciss/ciss.c	Sat Jul 27 17:16:59 2013	(r253711)
+++ head/sys/dev/ciss/ciss.c	Sat Jul 27 17:20:43 2013	(r253712)
@@ -4378,11 +4378,17 @@ ciss_print_adapter(struct ciss_softc *sc
 DB_COMMAND(ciss_prt, db_ciss_prt)
 {
     struct ciss_softc	*sc;
+    devclass_t dc;
+    int maxciss, i;
 
-    sc = devclass_get_softc(devclass_find("ciss"), 0);
-    if (sc == NULL) {
-	printf("no ciss controllers\n");
-    } else {
+    dc = devclass_find("ciss");
+    if ( dc == NULL ) {
+        printf("%s: can't find devclass!\n", __func__);
+        return;
+    }
+    maxciss = devclass_get_maxunit(dc);
+    for (i = 0; i < maxciss; i++) {
+        sc = devclass_get_softc(dc, i);
 	ciss_print_adapter(sc);
     }
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307271720.r6RHKix6062083>