- Print number of channels and firmware revision.

- Cut polling delay to make crashdumps faster.
This commit is contained in:
ad 2006-12-29 14:07:08 +00:00
parent ce9d4b0004
commit dfe565a4b0
1 changed files with 11 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: cac.c,v 1.37 2006/11/28 20:29:14 ad Exp $ */ /* $NetBSD: cac.c,v 1.38 2006/12/29 14:07:08 ad Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000, 2006 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
* *
* This code is derived from software contributed to The NetBSD Foundation * This code is derived from software contributed to The NetBSD Foundation
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.37 2006/11/28 20:29:14 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.38 2006/12/29 14:07:08 ad Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -100,6 +100,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
bus_dma_segment_t seg; bus_dma_segment_t seg;
struct cac_ccb *ccb; struct cac_ccb *ccb;
int locs[CACCF_NLOCS]; int locs[CACCF_NLOCS];
char firm[8];
if (intrstr != NULL) if (intrstr != NULL)
aprint_normal("%s: interrupting at %s\n", sc->sc_dv.dv_xname, aprint_normal("%s: interrupting at %s\n", sc->sc_dv.dv_xname,
@ -178,6 +179,10 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
return (-1); return (-1);
} }
strlcpy(firm, cinfo.firm_rev, 4+1);
printf("%s: %d channels, firmware <%s>\n", sc->sc_dv.dv_xname,
cinfo.scsi_chips, firm);
sc->sc_nunits = cinfo.num_drvs; sc->sc_nunits = cinfo.num_drvs;
for (i = 0; i < cinfo.num_drvs; i++) { for (i = 0; i < cinfo.num_drvs; i++) {
caca.caca_unit = i; caca.caca_unit = i;
@ -185,7 +190,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
locs[CACCF_UNIT] = i; locs[CACCF_UNIT] = i;
config_found_sm_loc(&sc->sc_dv, "cac", locs, &caca, config_found_sm_loc(&sc->sc_dv, "cac", locs, &caca,
cac_print, config_stdsubmatch); cac_print, config_stdsubmatch);
} }
/* Set our `shutdownhook' before we start any device activity. */ /* Set our `shutdownhook' before we start any device activity. */
@ -354,14 +359,14 @@ cac_ccb_poll(struct cac_softc *sc, struct cac_ccb *wantccb, int timo)
{ {
struct cac_ccb *ccb; struct cac_ccb *ccb;
timo *= 10; timo *= 1000;
do { do {
for (; timo != 0; timo--) { for (; timo != 0; timo--) {
ccb = (*sc->sc_cl.cl_completed)(sc); ccb = (*sc->sc_cl.cl_completed)(sc);
if (ccb != NULL) if (ccb != NULL)
break; break;
DELAY(100); DELAY(1);
} }
if (timo == 0) { if (timo == 0) {