xref: /freebsd/sys/dev/aac/aac_debug.c (revision 0b94a66e3f8a898cdf6481c428f6cedca31c3958)
135863739SMike Smith /*-
235863739SMike Smith  * Copyright (c) 2000 Michael Smith
335863739SMike Smith  * Copyright (c) 2000 BSDi
435863739SMike Smith  * All rights reserved.
535863739SMike Smith  *
635863739SMike Smith  * Redistribution and use in source and binary forms, with or without
735863739SMike Smith  * modification, are permitted provided that the following conditions
835863739SMike Smith  * are met:
935863739SMike Smith  * 1. Redistributions of source code must retain the above copyright
1035863739SMike Smith  *    notice, this list of conditions and the following disclaimer.
1135863739SMike Smith  * 2. Redistributions in binary form must reproduce the above copyright
1235863739SMike Smith  *    notice, this list of conditions and the following disclaimer in the
1335863739SMike Smith  *    documentation and/or other materials provided with the distribution.
1435863739SMike Smith  *
1535863739SMike Smith  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1635863739SMike Smith  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1735863739SMike Smith  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1835863739SMike Smith  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1935863739SMike Smith  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2035863739SMike Smith  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2135863739SMike Smith  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2235863739SMike Smith  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2335863739SMike Smith  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2435863739SMike Smith  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2535863739SMike Smith  * SUCH DAMAGE.
2635863739SMike Smith  *
2735863739SMike Smith  *	$FreeBSD$
2835863739SMike Smith  */
2935863739SMike Smith 
3035863739SMike Smith /*
3135863739SMike Smith  * Debugging support.
3235863739SMike Smith  */
3335863739SMike Smith 
3435863739SMike Smith #include <sys/param.h>
3535863739SMike Smith #include <sys/systm.h>
3635863739SMike Smith #include <sys/kernel.h>
3735863739SMike Smith 
3835863739SMike Smith #include <dev/aac/aac_compat.h>
3935863739SMike Smith #include <sys/bus.h>
4035863739SMike Smith #include <sys/devicestat.h>
4135863739SMike Smith #include <sys/disk.h>
4235863739SMike Smith 
4335863739SMike Smith #include <machine/resource.h>
4435863739SMike Smith #include <machine/bus.h>
4535863739SMike Smith 
4635863739SMike Smith #include <dev/aac/aacreg.h>
470b94a66eSMike Smith #include <dev/aac/aac_ioctl.h>
4835863739SMike Smith #include <dev/aac/aacvar.h>
4935863739SMike Smith 
5035863739SMike Smith void		aac_printstate0(void);
5135863739SMike Smith void		aac_intr0(void);
5235863739SMike Smith 
5335863739SMike Smith /********************************************************************************
5435863739SMike Smith  * Dump the command queue indices
5535863739SMike Smith  */
5635863739SMike Smith void
5735863739SMike Smith aac_print_queues(struct aac_softc *sc)
5835863739SMike Smith {
5935863739SMike Smith     device_printf(sc->aac_dev, "FIB queue header at %p  queues at %p\n",
6035863739SMike Smith 		  &sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][0],
6135863739SMike Smith 		  &sc->aac_queues->qt_HostNormCmdQueue[0]);
6235863739SMike Smith     device_printf(sc->aac_dev, "HOST_NORM_CMD  %d/%d (%d)\n",
6335863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX],
6435863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX],
6535863739SMike Smith 		  AAC_HOST_NORM_CMD_ENTRIES);
6635863739SMike Smith     device_printf(sc->aac_dev, "HOST_HIGH_CMD  %d/%d (%d)\n",
6735863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX],
6835863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX],
6935863739SMike Smith 		  AAC_HOST_HIGH_CMD_ENTRIES);
7035863739SMike Smith     device_printf(sc->aac_dev, "ADAP_NORM_CMD  %d/%d (%d)\n",
7135863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX],
7235863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX],
7335863739SMike Smith 		  AAC_ADAP_NORM_CMD_ENTRIES);
7435863739SMike Smith     device_printf(sc->aac_dev, "ADAP_HIGH_CMD  %d/%d (%d)\n",
7535863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX],
7635863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX],
7735863739SMike Smith 		  AAC_ADAP_HIGH_CMD_ENTRIES);
7835863739SMike Smith     device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n",
7935863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX],
8035863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX],
8135863739SMike Smith 		  AAC_HOST_NORM_RESP_ENTRIES);
8235863739SMike Smith     device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n",
8335863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX],
8435863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX],
8535863739SMike Smith 		  AAC_HOST_HIGH_RESP_ENTRIES);
8635863739SMike Smith     device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n",
8735863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX],
8835863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX],
8935863739SMike Smith 		  AAC_ADAP_NORM_RESP_ENTRIES);
9035863739SMike Smith     device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n",
9135863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX],
9235863739SMike Smith 		  sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX],
9335863739SMike Smith 		  AAC_ADAP_HIGH_RESP_ENTRIES);
940b94a66eSMike Smith     device_printf(sc->aac_dev, "AACQ_FREE      %d/%d\n",
950b94a66eSMike Smith 		  sc->aac_qstat[AACQ_FREE].q_length, sc->aac_qstat[AACQ_FREE].q_max);
960b94a66eSMike Smith     device_printf(sc->aac_dev, "AACQ_BIO       %d/%d\n",
970b94a66eSMike Smith 		  sc->aac_qstat[AACQ_BIO].q_length, sc->aac_qstat[AACQ_BIO].q_max);
980b94a66eSMike Smith     device_printf(sc->aac_dev, "AACQ_READY     %d/%d\n",
990b94a66eSMike Smith 		  sc->aac_qstat[AACQ_READY].q_length, sc->aac_qstat[AACQ_READY].q_max);
1000b94a66eSMike Smith     device_printf(sc->aac_dev, "AACQ_BUSY      %d/%d\n",
1010b94a66eSMike Smith 		  sc->aac_qstat[AACQ_BUSY].q_length, sc->aac_qstat[AACQ_BUSY].q_max);
1020b94a66eSMike Smith     device_printf(sc->aac_dev, "AACQ_COMPLETE  %d/%d\n",
1030b94a66eSMike Smith 		  sc->aac_qstat[AACQ_COMPLETE].q_length, sc->aac_qstat[AACQ_COMPLETE].q_max);
10435863739SMike Smith }
10535863739SMike Smith 
10635863739SMike Smith /********************************************************************************
10735863739SMike Smith  * Print the command queue states for controller 0 (callable from DDB)
10835863739SMike Smith  */
10935863739SMike Smith void
11035863739SMike Smith aac_printstate0(void)
11135863739SMike Smith {
11235863739SMike Smith     struct aac_softc	*sc = devclass_get_softc(aac_devclass, 0);
11335863739SMike Smith 
11435863739SMike Smith     aac_print_queues(sc);
11535863739SMike Smith     switch (sc->aac_hwif) {
11635863739SMike Smith     case AAC_HWIF_I960RX:
11735863739SMike Smith 	device_printf(sc->aac_dev, "IDBR 0x%08x  IIMR 0x%08x  IISR 0x%08x\n",
11835863739SMike Smith 		      AAC_GETREG4(sc, AAC_RX_IDBR), AAC_GETREG4(sc, AAC_RX_IIMR), AAC_GETREG4(sc, AAC_RX_IISR));
11935863739SMike Smith 	device_printf(sc->aac_dev, "ODBR 0x%08x  OIMR 0x%08x  OISR 0x%08x\n",
12035863739SMike Smith 		      AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR));
12135863739SMike Smith 	AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/);
12235863739SMike Smith 	device_printf(sc->aac_dev, "ODBR 0x%08x  OIMR 0x%08x  OISR 0x%08x\n",
12335863739SMike Smith 		      AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR));
12435863739SMike Smith 	break;
12535863739SMike Smith     case AAC_HWIF_STRONGARM:
12635863739SMike Smith 	/* XXX implement */
12735863739SMike Smith     }
12835863739SMike Smith }
12935863739SMike Smith 
13035863739SMike Smith /********************************************************************************
13135863739SMike Smith  * simulate an interrupt for controller 0
13235863739SMike Smith  */
13335863739SMike Smith void
13435863739SMike Smith aac_intr0(void)
13535863739SMike Smith {
13635863739SMike Smith     struct aac_softc	*sc = devclass_get_softc(aac_devclass, 0);
13735863739SMike Smith 
13835863739SMike Smith     aac_intr(sc);
13935863739SMike Smith }
14035863739SMike Smith 
14135863739SMike Smith /********************************************************************************
14235863739SMike Smith  * Panic in a slightly informative fashion
14335863739SMike Smith  */
14435863739SMike Smith void
14535863739SMike Smith aac_panic(struct aac_softc *sc, char *reason)
14635863739SMike Smith {
14735863739SMike Smith     aac_print_queues(sc);
14835863739SMike Smith     panic(reason);
14935863739SMike Smith }
15035863739SMike Smith 
15135863739SMike Smith /********************************************************************************
15235863739SMike Smith  * Print a FIB
15335863739SMike Smith  */
15435863739SMike Smith void
15535863739SMike Smith aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller)
15635863739SMike Smith {
15735863739SMike Smith     device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib);
15835863739SMike Smith     device_printf(sc->aac_dev, "  XferState %b\n", fib->Header.XferState, "\20"
15935863739SMike Smith 		  "\1HOSTOWNED"
16035863739SMike Smith 		  "\2ADAPTEROWNED"
16135863739SMike Smith 		  "\3INITIALISED"
16235863739SMike Smith 		  "\4EMPTY"
16335863739SMike Smith 		  "\5FROMPOOL"
16435863739SMike Smith 		  "\6FROMHOST"
16535863739SMike Smith 		  "\7FROMADAP"
16635863739SMike Smith 		  "\10REXPECTED"
16735863739SMike Smith 		  "\11RNOTEXPECTED"
16835863739SMike Smith 		  "\12DONEADAP"
16935863739SMike Smith 		  "\13DONEHOST"
17035863739SMike Smith 		  "\14HIGH"
17135863739SMike Smith 		  "\15NORM"
17235863739SMike Smith 		  "\16ASYNC"
17335863739SMike Smith 		  "\17PAGEFILEIO"
17435863739SMike Smith 		  "\20SHUTDOWN"
17535863739SMike Smith 		  "\21LAZYWRITE"
17635863739SMike Smith 		  "\22ADAPMICROFIB"
17735863739SMike Smith 		  "\23BIOSFIB"
17835863739SMike Smith 		  "\24FAST_RESPONSE"
17935863739SMike Smith 		  "\25APIFIB\n");
18035863739SMike Smith     device_printf(sc->aac_dev, "  Command         %d\n", fib->Header.Command);
18135863739SMike Smith     device_printf(sc->aac_dev, "  StructType      %d\n", fib->Header.StructType);
18235863739SMike Smith     device_printf(sc->aac_dev, "  Flags           0x%x\n", fib->Header.Flags);
18335863739SMike Smith     device_printf(sc->aac_dev, "  Size            %d\n", fib->Header.Size);
18435863739SMike Smith     device_printf(sc->aac_dev, "  SenderSize      %d\n", fib->Header.SenderSize);
18535863739SMike Smith     device_printf(sc->aac_dev, "  SenderAddress   0x%x\n", fib->Header.SenderFibAddress);
18635863739SMike Smith     device_printf(sc->aac_dev, "  ReceiverAddress 0x%x\n", fib->Header.ReceiverFibAddress);
18735863739SMike Smith     device_printf(sc->aac_dev, "  SenderData      0x%x\n", fib->Header.SenderData);
18835863739SMike Smith     switch(fib->Header.Command) {
18935863739SMike Smith     case ContainerCommand:
19035863739SMike Smith     {
19135863739SMike Smith 	struct aac_blockread	*br = (struct aac_blockread *)fib->data;
19235863739SMike Smith 	struct aac_blockwrite	*bw = (struct aac_blockwrite *)fib->data;
19335863739SMike Smith 	struct aac_sg_table	*sg = NULL;
19435863739SMike Smith 	int			i;
19535863739SMike Smith 	if (br->Command == VM_CtBlockRead) {
19635863739SMike Smith 	    device_printf(sc->aac_dev, "  BlockRead: container %d  0x%x/%d\n",
19735863739SMike Smith 			  br->ContainerId, br->BlockNumber, br->ByteCount);
19835863739SMike Smith 	    sg = &br->SgMap;
19935863739SMike Smith 	}
20035863739SMike Smith 	if (bw->Command == VM_CtBlockWrite) {
20135863739SMike Smith 	    device_printf(sc->aac_dev, "  BlockWrite: container %d  0x%x/%d (%s)\n",
20235863739SMike Smith 			  bw->ContainerId, bw->BlockNumber, bw->ByteCount,
20335863739SMike Smith 			  bw->Stable == CSTABLE ? "stable" : "unstable");
20435863739SMike Smith 	    sg = &bw->SgMap;
20535863739SMike Smith 	}
20635863739SMike Smith 	if (sg != NULL) {
20735863739SMike Smith 	    device_printf(sc->aac_dev, "  %d s/g entries\n", sg->SgCount);
20835863739SMike Smith 	    for (i = 0; i < sg->SgCount; i++)
20935863739SMike Smith 		device_printf(sc->aac_dev, "  0x%08x/%d\n", sg->SgEntry[i].SgAddress, sg->SgEntry[i].SgByteCount);
21035863739SMike Smith 	}
21135863739SMike Smith 	break;
21235863739SMike Smith     }
21335863739SMike Smith     default:
21435863739SMike Smith 	device_printf(sc->aac_dev, "   %16D\n", fib->data, " ");
21535863739SMike Smith 	device_printf(sc->aac_dev, "   %16D\n", fib->data + 16, " ");
21635863739SMike Smith 	break;
21735863739SMike Smith     }
21835863739SMike Smith }
21935863739SMike Smith 
22035863739SMike Smith /********************************************************************************
22135863739SMike Smith  * Describe an AIF we have received.
22235863739SMike Smith  */
22335863739SMike Smith void
22435863739SMike Smith aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif)
22535863739SMike Smith {
22635863739SMike Smith     switch(aif->command) {
22735863739SMike Smith     case AifCmdEventNotify:
22835863739SMike Smith 	device_printf(sc->aac_dev, "EventNotify (%d)\n", aif->seqNumber);
22935863739SMike Smith 	switch(aif->data.EN.type) {
23035863739SMike Smith 	case AifEnGeneric:			/* Generic notification */
23135863739SMike Smith 	    device_printf(sc->aac_dev, "(Generic) %.*s\n",
23235863739SMike Smith 			  (int)sizeof(aif->data.EN.data.EG), aif->data.EN.data.EG.text);
23335863739SMike Smith 	    break;
23435863739SMike Smith 	case AifEnTaskComplete:			/* Task has completed */
23535863739SMike Smith 	    device_printf(sc->aac_dev, "(TaskComplete)\n");
23635863739SMike Smith 	    break;
23735863739SMike Smith 	case AifEnConfigChange:			/* Adapter configuration change occurred */
23835863739SMike Smith 	    device_printf(sc->aac_dev, "(ConfigChange)\n");
23935863739SMike Smith 	    break;
24035863739SMike Smith 	case AifEnContainerChange:		/* Adapter specific container configuration change */
24135863739SMike Smith 	    device_printf(sc->aac_dev, "(ContainerChange) container %d,%d\n",
24235863739SMike Smith 			  aif->data.EN.data.ECC.container[0],
24335863739SMike Smith 			  aif->data.EN.data.ECC.container[1]);
24435863739SMike Smith 	    break;
24535863739SMike Smith 	case AifEnDeviceFailure:		/* SCSI device failed */
24635863739SMike Smith 	    device_printf(sc->aac_dev, "(DeviceFailure) handle %d\n",
24735863739SMike Smith 			  aif->data.EN.data.EDF.deviceHandle);	/* XXX interpret */
24835863739SMike Smith 	    break;
24935863739SMike Smith 	case AifEnMirrorFailover:		/* Mirror failover started */
25035863739SMike Smith 	    device_printf(sc->aac_dev, "(MirrorFailover) container %d failed, migrating from slice %d to %d\n",
25135863739SMike Smith 			  aif->data.EN.data.EMF.container,
25235863739SMike Smith 			  aif->data.EN.data.EMF.failedSlice,
25335863739SMike Smith 			  aif->data.EN.data.EMF.creatingSlice);
25435863739SMike Smith 	    break;
25535863739SMike Smith 	case AifEnContainerEvent:		/* Significant container event */
25635863739SMike Smith 	    device_printf(sc->aac_dev, "(ContainerEvent) container %d event %d\n",
25735863739SMike Smith 			  aif->data.EN.data.ECE.container,
25835863739SMike Smith 			  aif->data.EN.data.ECE.eventType);		/* XXX interpret? */
25935863739SMike Smith 	    break;
26035863739SMike Smith 	case AifEnFileSystemChange:		/* File system changed */
26135863739SMike Smith 	    device_printf(sc->aac_dev, "(FileSystemChange)\n");
26235863739SMike Smith 	    break;
26335863739SMike Smith 	case AifEnConfigPause:			/* Container pause event */
26435863739SMike Smith 	    device_printf(sc->aac_dev, "(ConfigPause)\n");
26535863739SMike Smith 	    break;
26635863739SMike Smith 	case AifEnConfigResume:			/* Container resume event */
26735863739SMike Smith 	    device_printf(sc->aac_dev, "(ConfigResume)\n");
26835863739SMike Smith 	    break;
26935863739SMike Smith 	case AifEnFailoverChange:		/* Failover space assignment changed */
27035863739SMike Smith 	    device_printf(sc->aac_dev, "(FailoverChange)\n");
27135863739SMike Smith 	    break;
27235863739SMike Smith 	case AifEnRAID5RebuildDone:		/* RAID5 rebuild finished */
27335863739SMike Smith 	    device_printf(sc->aac_dev, "(RAID5RebuildDone)\n");
27435863739SMike Smith 	    break;
27535863739SMike Smith 	case AifEnEnclosureManagement:		/* Enclosure management event */
27635863739SMike Smith 	    device_printf(sc->aac_dev, "(EnclosureManagement) EMPID %d unit %d event %d\n",
27735863739SMike Smith 			  aif->data.EN.data.EEE.empID,
27835863739SMike Smith 			  aif->data.EN.data.EEE.unitID,
27935863739SMike Smith 			  aif->data.EN.data.EEE.eventType);
28035863739SMike Smith 	    break;
28135863739SMike Smith 	case AifEnBatteryEvent:			/* Significant NV battery event */
28235863739SMike Smith 	    device_printf(sc->aac_dev, "(BatteryEvent) %d (state was %d, is %d)\n",
28335863739SMike Smith 			  aif->data.EN.data.EBE.transition_type, 	/* XXX interpret */
28435863739SMike Smith 			  aif->data.EN.data.EBE.current_state,
28535863739SMike Smith 			  aif->data.EN.data.EBE.prior_state);
28635863739SMike Smith 	    break;
28735863739SMike Smith 	case AifEnAddContainer:			/* A new container was created. */
28835863739SMike Smith 	    device_printf(sc->aac_dev, "(AddContainer)\n");
28935863739SMike Smith 	    break;
29035863739SMike Smith 	case AifEnDeleteContainer:		/* A container was deleted. */
29135863739SMike Smith 	    device_printf(sc->aac_dev, "(DeleteContainer)\n");
29235863739SMike Smith 	    break;
29335863739SMike Smith 	case AifEnBatteryNeedsRecond:		/* The battery needs reconditioning */
29435863739SMike Smith 	    device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n");
29535863739SMike Smith 	    break;
29635863739SMike Smith 	case AifEnClusterEvent:			/* Some cluster event */
29735863739SMike Smith 	    device_printf(sc->aac_dev, "(ClusterEvent) event %d\n",
29835863739SMike Smith 			  aif->data.EN.data.ECLE.eventType);
29935863739SMike Smith 	    break;
30035863739SMike Smith 	case AifEnDiskSetEvent:			/* A disk set event occured. */
30135863739SMike Smith 	    device_printf(sc->aac_dev, "(DiskSetEvent) event %d diskset %lld creator %lld\n",
30235863739SMike Smith 			  aif->data.EN.data.EDS.eventType,
30335863739SMike Smith 			  aif->data.EN.data.EDS.DsNum,
30435863739SMike Smith 			  aif->data.EN.data.EDS.CreatorId);
30535863739SMike Smith 	    break;
30635863739SMike Smith 	case AifDenMorphComplete: 		/* A morph operation completed */
30735863739SMike Smith 	    device_printf(sc->aac_dev, "(MorphComplete)\n");
30835863739SMike Smith 	    break;
30935863739SMike Smith 	case AifDenVolumeExtendComplete: 		/* A volume expand operation completed */
31035863739SMike Smith 	    device_printf(sc->aac_dev, "(VolumeExtendComplete)\n");
31135863739SMike Smith 	    break;
31235863739SMike Smith 	default:
31335863739SMike Smith 	    device_printf(sc->aac_dev, "(%d)\n", aif->data.EN.type);
31435863739SMike Smith 	    break;
31535863739SMike Smith 	}
31635863739SMike Smith 	break;
31735863739SMike Smith     case AifCmdJobProgress:
31835863739SMike Smith     {
31935863739SMike Smith 	char	*status;
32035863739SMike Smith 	switch(aif->data.PR[0].status) {
32135863739SMike Smith 	case AifJobStsSuccess:
32235863739SMike Smith 	    status = "success"; break;
32335863739SMike Smith 	case AifJobStsFinished:
32435863739SMike Smith 	    status = "finished"; break;
32535863739SMike Smith 	case AifJobStsAborted:
32635863739SMike Smith 	    status = "aborted"; break;
32735863739SMike Smith 	case AifJobStsFailed:
32835863739SMike Smith 	    status = "failed"; break;
32935863739SMike Smith 	case AifJobStsSuspended:
33035863739SMike Smith 	    status = "suspended"; break;
33135863739SMike Smith 	case AifJobStsRunning:
33235863739SMike Smith 	    status = "running"; break;
33335863739SMike Smith 	default:
33435863739SMike Smith 	    status = "unknown status"; break;
33535863739SMike Smith 	}
33635863739SMike Smith 
33735863739SMike Smith 	device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n", aif->seqNumber, status,
33835863739SMike Smith 		      aif->data.PR[0].currentTick, aif->data.PR[0].finalTick);
33935863739SMike Smith 	switch(aif->data.PR[0].jd.type) {
34035863739SMike Smith 	case AifJobScsiZero:			/* SCSI device clear operation */
34135863739SMike Smith 	    device_printf(sc->aac_dev, "(ScsiZero) handle %d\n", aif->data.PR[0].jd.client.scsi_dh);
34235863739SMike Smith 	    break;
34335863739SMike Smith 	case AifJobScsiVerify:			/* SCSI device Verify operation NO REPAIR */
34435863739SMike Smith 	    device_printf(sc->aac_dev, "(ScsiVerify) handle %d\n", aif->data.PR[0].jd.client.scsi_dh);
34535863739SMike Smith 	    break;
34635863739SMike Smith 	case AifJobScsiExercise:		/* SCSI device Exercise operation */
34735863739SMike Smith 	    device_printf(sc->aac_dev, "(ScsiExercise) handle %d\n", aif->data.PR[0].jd.client.scsi_dh);
34835863739SMike Smith 	    break;
34935863739SMike Smith 	case AifJobScsiVerifyRepair:		/* SCSI device Verify operation WITH repair */
35035863739SMike Smith 	    device_printf(sc->aac_dev, "(ScsiVerifyRepair) handle %d\n", aif->data.PR[0].jd.client.scsi_dh);
35135863739SMike Smith 	    break;
35235863739SMike Smith 	case AifJobCtrZero:			/* Container clear operation */
35335863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerZero) container %d\n",
35435863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);
35535863739SMike Smith 	    break;
35635863739SMike Smith 	case AifJobCtrCopy:			/* Container copy operation */
35735863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerCopy) container %d to %d\n",
35835863739SMike Smith 			  aif->data.PR[0].jd.client.container.src, aif->data.PR[0].jd.client.container.dst);
35935863739SMike Smith 	    break;
36035863739SMike Smith 	case AifJobCtrCreateMirror:		/* Container Create Mirror operation */
36135863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerCreateMirror) container %d\n",
36235863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);	/* XXX two containers? */
36335863739SMike Smith 	    break;
36435863739SMike Smith 	case AifJobCtrMergeMirror:		/* Container Merge Mirror operation */
36535863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerMergeMirror) container %d\n",
36635863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);	/* XXX two containers? */
36735863739SMike Smith 	    break;
36835863739SMike Smith 	case AifJobCtrScrubMirror:		/* Container Scrub Mirror operation */
36935863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerScrubMirror) container %d\n",
37035863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);
37135863739SMike Smith 	    break;
37235863739SMike Smith 	case AifJobCtrRebuildRaid5:		/* Container Rebuild Raid5 operation */
37335863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerRebuildRaid5) container %d\n",
37435863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);
37535863739SMike Smith 	    break;
37635863739SMike Smith 	case AifJobCtrScrubRaid5:		/* Container Scrub Raid5 operation */
37735863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerScrubRaid5) container %d\n",
37835863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);
37935863739SMike Smith 	    break;
38035863739SMike Smith 	case AifJobCtrMorph:			/* Container morph operation */
38135863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerMorph) container %d\n",
38235863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);	/* XXX two containers? */
38335863739SMike Smith 	    break;
38435863739SMike Smith 	case AifJobCtrPartCopy:			/* Container Partition copy operation */
38535863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerPartCopy) container %d to %d\n",
38635863739SMike Smith 			  aif->data.PR[0].jd.client.container.src, aif->data.PR[0].jd.client.container.dst);
38735863739SMike Smith 	    break;
38835863739SMike Smith 	case AifJobCtrRebuildMirror:		/* Container Rebuild Mirror operation */
38935863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerRebuildMirror) container %d\n",
39035863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);
39135863739SMike Smith 	    break;
39235863739SMike Smith 	case AifJobCtrCrazyCache:		/* crazy cache */
39335863739SMike Smith 	    device_printf(sc->aac_dev, "(ConatainerCrazyCache) container %d\n",
39435863739SMike Smith 			  aif->data.PR[0].jd.client.container.src);	/* XXX two containers? */
39535863739SMike Smith 	    break;
39635863739SMike Smith 	case AifJobFsCreate:			/* File System Create operation */
39735863739SMike Smith 	    device_printf(sc->aac_dev, "(FsCreate)\n");
39835863739SMike Smith 	    break;
39935863739SMike Smith 	case AifJobFsVerify:			/* File System Verify operation */
40035863739SMike Smith 	    device_printf(sc->aac_dev, "(FsVerivy)\n");
40135863739SMike Smith 	    break;
40235863739SMike Smith 	case AifJobFsExtend:			/* File System Extend operation */
40335863739SMike Smith 	    device_printf(sc->aac_dev, "(FsExtend)\n");
40435863739SMike Smith 	    break;
40535863739SMike Smith 	case AifJobApiFormatNTFS:		/* Format a drive to NTFS */
40635863739SMike Smith 	    device_printf(sc->aac_dev, "(FormatNTFS)\n");
40735863739SMike Smith 	    break;
40835863739SMike Smith 	case AifJobApiFormatFAT:		/* Format a drive to FAT */
40935863739SMike Smith 	    device_printf(sc->aac_dev, "(FormatFAT)\n");
41035863739SMike Smith 	    break;
41135863739SMike Smith 	case AifJobApiUpdateSnapshot:		/* update the read/write half of a snapshot */
41235863739SMike Smith 	    device_printf(sc->aac_dev, "(UpdateSnapshot)\n");
41335863739SMike Smith 	    break;
41435863739SMike Smith 	case AifJobApiFormatFAT32:		/* Format a drive to FAT32 */
41535863739SMike Smith 	    device_printf(sc->aac_dev, "(FormatFAT32)\n");
41635863739SMike Smith 	    break;
41735863739SMike Smith 	case AifJobCtlContinuousCtrVerify:	/* Adapter operation */
41835863739SMike Smith 	    device_printf(sc->aac_dev, "(ContinuousCtrVerify)\n");
41935863739SMike Smith 	    break;
42035863739SMike Smith 	default:
42135863739SMike Smith 	    device_printf(sc->aac_dev, "(%d)\n", aif->data.PR[0].jd.type);
42235863739SMike Smith 	    break;
42335863739SMike Smith 	}
42435863739SMike Smith 	break;
42535863739SMike Smith     }
42635863739SMike Smith     case AifCmdAPIReport:
42735863739SMike Smith 	device_printf(sc->aac_dev, "APIReport (%d)\n", aif->seqNumber);
42835863739SMike Smith 	break;
42935863739SMike Smith     case AifCmdDriverNotify:
43035863739SMike Smith 	device_printf(sc->aac_dev, "DriverNotify (%d)\n", aif->seqNumber);
43135863739SMike Smith 	break;
43235863739SMike Smith     default:
43335863739SMike Smith 	device_printf(sc->aac_dev, "AIF %d (%d)\n", aif->command, aif->seqNumber);
43435863739SMike Smith 	break;
43535863739SMike Smith     }
43635863739SMike Smith }
437