Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Nov 2006 23:10:16 GMT
From:      Matt Jacob <mjacob@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 109491 for review
Message-ID:  <200611072310.kA7NAGeZ077079@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109491

Change 109491 by mjacob@newisp on 2006/11/07 23:10:01

	move isp_dump_portdb to isp_library so the outer layers can
	use it directly.

Affected files ...

.. //depot/projects/newisp/dev/isp/isp.c#28 edit
.. //depot/projects/newisp/dev/isp/isp_freebsd.c#20 edit
.. //depot/projects/newisp/dev/isp/isp_library.c#15 edit
.. //depot/projects/newisp/dev/isp/isp_library.h#11 edit

Differences ...

==== //depot/projects/newisp/dev/isp/isp.c#28 (text+ko) ====

@@ -109,7 +109,6 @@
 static void isp_scsi_channel_init(ispsoftc_t *, int);
 static void isp_fibre_init(ispsoftc_t *);
 static void isp_fibre_init_2400(ispsoftc_t *);
-static void isp_dump_portdb(ispsoftc_t *);
 static void isp_mark_portdb(ispsoftc_t *, int);
 static void isp_plogx_24xx(ispsoftc_t *, uint16_t, uint32_t, int *);
 static int isp_port_login(ispsoftc_t *, uint16_t, uint32_t);
@@ -2047,53 +2046,6 @@
 	isp->isp_state = ISP_INITSTATE;
 }
 
-/*
- * Fibre Channel Support- get the port database for the id.
- */
-static void
-isp_dump_portdb(ispsoftc_t *isp)
-{
-	fcparam *fcp = (fcparam *) isp->isp_param;
-	int i;
-
-	for (i = 0; i < MAX_FC_TARG; i++) {
-		char mb[4];
-		const char *dbs[8] = {
-			"NIL ",
-			"PROB",
-			"DEAD",
-			"CHGD",
-			"NEW ",
-			"PVLD",
-			"????",
-			"VLD "
-		};
-		const char *roles[4] = {
-			" UNK", " TGT", " INI", "TINI"
-		};
-		fcportdb_t *lp = &fcp->portdb[i];
-
-		if (lp->state == FC_PORTDB_STATE_NIL) {
-			continue;
-		}
-		if (lp->ini_map_idx) {
-			SNPRINTF(mb, sizeof (mb), "%3d",
-			    ((int) lp->ini_map_idx) - 1);
-		} else {
-			SNPRINTF(mb, sizeof (mb), "---");
-		}
-		isp_prt(isp, ISP_LOGALL, "%d: %s al%d tgt %s %s 0x%06x =>%s"
-		    " 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", i,
-		    dbs[lp->state], lp->autologin, mb,
-		    roles[lp->roles], lp->portid,
-		    roles[lp->new_roles], lp->new_portid,
-		    (uint32_t) (lp->node_wwn >> 32),
-		    (uint32_t) (lp->node_wwn),
-		    (uint32_t) (lp->port_wwn >> 32),
-		    (uint32_t) (lp->port_wwn));
-	}
-}
-
 static void
 isp_mark_portdb(ispsoftc_t *isp, int onprobation)
 {

==== //depot/projects/newisp/dev/isp/isp_freebsd.c#20 (text+ko) ====

@@ -2937,6 +2937,7 @@
 				lp->ini_map_idx = i + 1;
 			} else {
 				isp_prt(isp, ISP_LOGWARN, "out of target ids");
+				isp_dump_portdb(isp);
 			}
 		}
 		if (lp->ini_map_idx) {

==== //depot/projects/newisp/dev/isp/isp_library.c#15 (text) ====

@@ -233,6 +233,53 @@
 	return (0);
 }
 
+/*
+ * Fibre Channel Support- get the port database for the id.
+ */
+void
+isp_dump_portdb(ispsoftc_t *isp)
+{
+	fcparam *fcp = (fcparam *) isp->isp_param;
+	int i;
+
+	for (i = 0; i < MAX_FC_TARG; i++) {
+		char mb[4];
+		const char *dbs[8] = {
+			"NIL ",
+			"PROB",
+			"DEAD",
+			"CHGD",
+			"NEW ",
+			"PVLD",
+			"????",
+			"VLD "
+		};
+		const char *roles[4] = {
+			" UNK", " TGT", " INI", "TINI"
+		};
+		fcportdb_t *lp = &fcp->portdb[i];
+
+		if (lp->state == FC_PORTDB_STATE_NIL) {
+			continue;
+		}
+		if (lp->ini_map_idx) {
+			SNPRINTF(mb, sizeof (mb), "%3d",
+			    ((int) lp->ini_map_idx) - 1);
+		} else {
+			SNPRINTF(mb, sizeof (mb), "---");
+		}
+		isp_prt(isp, ISP_LOGALL, "%d: %s al%d tgt %s %s 0x%06x =>%s"
+		    " 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", i,
+		    dbs[lp->state], lp->autologin, mb,
+		    roles[lp->roles], lp->portid,
+		    roles[lp->new_roles], lp->new_portid,
+		    (uint32_t) (lp->node_wwn >> 32),
+		    (uint32_t) (lp->node_wwn),
+		    (uint32_t) (lp->port_wwn >> 32),
+		    (uint32_t) (lp->port_wwn));
+	}
+}
+
 void
 isp_shutdown(ispsoftc_t *isp)
 {

==== //depot/projects/newisp/dev/isp/isp_library.h#11 (text) ====

@@ -39,6 +39,7 @@
 extern void isp_print_qentry (ispsoftc_t *, char *, int, void *);
 extern void isp_print_bytes(ispsoftc_t *, char *, int, void *);
 extern int isp_fc_runstate(ispsoftc_t *, int);
+extern void isp_dump_portdb(ispsoftc_t *);
 extern void isp_shutdown(ispsoftc_t *);
 extern void isp_put_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *);
 extern void isp_get_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *);



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