135863739SMike Smith /*- 235863739SMike Smith * Copyright (c) 2000 Michael Smith 3c6eafcf2SScott Long * Copyright (c) 2001 Scott Long 435863739SMike Smith * Copyright (c) 2000 BSDi 5c6eafcf2SScott Long * Copyright (c) 2001 Adaptec, Inc. 635863739SMike Smith * All rights reserved. 735863739SMike Smith * 835863739SMike Smith * Redistribution and use in source and binary forms, with or without 935863739SMike Smith * modification, are permitted provided that the following conditions 1035863739SMike Smith * are met: 1135863739SMike Smith * 1. Redistributions of source code must retain the above copyright 1235863739SMike Smith * notice, this list of conditions and the following disclaimer. 1335863739SMike Smith * 2. Redistributions in binary form must reproduce the above copyright 1435863739SMike Smith * notice, this list of conditions and the following disclaimer in the 1535863739SMike Smith * documentation and/or other materials provided with the distribution. 1635863739SMike Smith * 1735863739SMike Smith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1835863739SMike Smith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1935863739SMike Smith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2035863739SMike Smith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2135863739SMike Smith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2235863739SMike Smith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2335863739SMike Smith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2435863739SMike Smith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2535863739SMike Smith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2635863739SMike Smith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2735863739SMike Smith * SUCH DAMAGE. 2835863739SMike Smith * 2935863739SMike Smith * $FreeBSD$ 3035863739SMike Smith */ 3135863739SMike Smith 3235863739SMike Smith /* 3335863739SMike Smith * Debugging support. 3435863739SMike Smith */ 3535863739SMike Smith 3635863739SMike Smith #include <sys/param.h> 3735863739SMike Smith #include <sys/systm.h> 3835863739SMike Smith #include <sys/kernel.h> 3935863739SMike Smith 4035863739SMike Smith #include <dev/aac/aac_compat.h> 4135863739SMike Smith #include <sys/bus.h> 4235863739SMike Smith #include <sys/devicestat.h> 4335863739SMike Smith #include <sys/disk.h> 4435863739SMike Smith 4535863739SMike Smith #include <machine/resource.h> 4635863739SMike Smith #include <machine/bus.h> 4735863739SMike Smith 4835863739SMike Smith #include <dev/aac/aacreg.h> 490b94a66eSMike Smith #include <dev/aac/aac_ioctl.h> 5035863739SMike Smith #include <dev/aac/aacvar.h> 5135863739SMike Smith 52da4c1ce3SJustin T. Gibbs #ifdef AAC_DEBUG 5335863739SMike Smith void aac_printstate0(void); 5435863739SMike Smith void aac_intr0(void); 5535863739SMike Smith 56c6eafcf2SScott Long /****************************************************************************** 5735863739SMike Smith * Dump the command queue indices 5835863739SMike Smith */ 5935863739SMike Smith void 6035863739SMike Smith aac_print_queues(struct aac_softc *sc) 6135863739SMike Smith { 6235863739SMike Smith device_printf(sc->aac_dev, "FIB queue header at %p queues at %p\n", 6335863739SMike Smith &sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][0], 6435863739SMike Smith &sc->aac_queues->qt_HostNormCmdQueue[0]); 6535863739SMike Smith device_printf(sc->aac_dev, "HOST_NORM_CMD %d/%d (%d)\n", 6635863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX], 6735863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX], 6835863739SMike Smith AAC_HOST_NORM_CMD_ENTRIES); 6935863739SMike Smith device_printf(sc->aac_dev, "HOST_HIGH_CMD %d/%d (%d)\n", 7035863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX], 7135863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX], 7235863739SMike Smith AAC_HOST_HIGH_CMD_ENTRIES); 7335863739SMike Smith device_printf(sc->aac_dev, "ADAP_NORM_CMD %d/%d (%d)\n", 7435863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX], 7535863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX], 7635863739SMike Smith AAC_ADAP_NORM_CMD_ENTRIES); 7735863739SMike Smith device_printf(sc->aac_dev, "ADAP_HIGH_CMD %d/%d (%d)\n", 7835863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX], 7935863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX], 8035863739SMike Smith AAC_ADAP_HIGH_CMD_ENTRIES); 8135863739SMike Smith device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n", 8235863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX], 8335863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX], 8435863739SMike Smith AAC_HOST_NORM_RESP_ENTRIES); 8535863739SMike Smith device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n", 8635863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX], 8735863739SMike Smith sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX], 8835863739SMike Smith AAC_HOST_HIGH_RESP_ENTRIES); 8935863739SMike Smith device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n", 9035863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX], 9135863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX], 9235863739SMike Smith AAC_ADAP_NORM_RESP_ENTRIES); 9335863739SMike Smith device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n", 9435863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX], 9535863739SMike Smith sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX], 9635863739SMike Smith AAC_ADAP_HIGH_RESP_ENTRIES); 970b94a66eSMike Smith device_printf(sc->aac_dev, "AACQ_FREE %d/%d\n", 980b94a66eSMike Smith sc->aac_qstat[AACQ_FREE].q_length, sc->aac_qstat[AACQ_FREE].q_max); 990b94a66eSMike Smith device_printf(sc->aac_dev, "AACQ_BIO %d/%d\n", 1000b94a66eSMike Smith sc->aac_qstat[AACQ_BIO].q_length, sc->aac_qstat[AACQ_BIO].q_max); 1010b94a66eSMike Smith device_printf(sc->aac_dev, "AACQ_READY %d/%d\n", 1020b94a66eSMike Smith sc->aac_qstat[AACQ_READY].q_length, sc->aac_qstat[AACQ_READY].q_max); 1030b94a66eSMike Smith device_printf(sc->aac_dev, "AACQ_BUSY %d/%d\n", 1040b94a66eSMike Smith sc->aac_qstat[AACQ_BUSY].q_length, sc->aac_qstat[AACQ_BUSY].q_max); 1050b94a66eSMike Smith device_printf(sc->aac_dev, "AACQ_COMPLETE %d/%d\n", 106c6eafcf2SScott Long sc->aac_qstat[AACQ_COMPLETE].q_length, 107c6eafcf2SScott Long sc->aac_qstat[AACQ_COMPLETE].q_max); 10835863739SMike Smith } 10935863739SMike Smith 110c6eafcf2SScott Long /****************************************************************************** 11135863739SMike Smith * Print the command queue states for controller 0 (callable from DDB) 11235863739SMike Smith */ 11335863739SMike Smith void 11435863739SMike Smith aac_printstate0(void) 11535863739SMike Smith { 11635863739SMike Smith struct aac_softc *sc = devclass_get_softc(aac_devclass, 0); 11735863739SMike Smith 11835863739SMike Smith aac_print_queues(sc); 11935863739SMike Smith switch (sc->aac_hwif) { 12035863739SMike Smith case AAC_HWIF_I960RX: 12135863739SMike Smith device_printf(sc->aac_dev, "IDBR 0x%08x IIMR 0x%08x IISR 0x%08x\n", 122c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_IDBR), AAC_GETREG4(sc, AAC_RX_IIMR), 123c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_IISR)); 12435863739SMike Smith device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x OISR 0x%08x\n", 125c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), 126c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_OISR)); 127c6eafcf2SScott Long AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | 128c6eafcf2SScott Long AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/); 12935863739SMike Smith device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x OISR 0x%08x\n", 130c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), 131c6eafcf2SScott Long AAC_GETREG4(sc, AAC_RX_OISR)); 13235863739SMike Smith break; 13335863739SMike Smith case AAC_HWIF_STRONGARM: 13435863739SMike Smith /* XXX implement */ 13535863739SMike Smith } 13635863739SMike Smith } 13735863739SMike Smith 138c6eafcf2SScott Long /****************************************************************************** 13935863739SMike Smith * simulate an interrupt for controller 0 14035863739SMike Smith */ 14135863739SMike Smith void 14235863739SMike Smith aac_intr0(void) 14335863739SMike Smith { 14435863739SMike Smith struct aac_softc *sc = devclass_get_softc(aac_devclass, 0); 14535863739SMike Smith 14635863739SMike Smith aac_intr(sc); 14735863739SMike Smith } 14835863739SMike Smith 149c6eafcf2SScott Long /****************************************************************************** 15035863739SMike Smith * Panic in a slightly informative fashion 15135863739SMike Smith */ 15235863739SMike Smith void 15335863739SMike Smith aac_panic(struct aac_softc *sc, char *reason) 15435863739SMike Smith { 15535863739SMike Smith aac_print_queues(sc); 15635863739SMike Smith panic(reason); 15735863739SMike Smith } 15835863739SMike Smith 159c6eafcf2SScott Long /****************************************************************************** 16035863739SMike Smith * Print a FIB 16135863739SMike Smith */ 16235863739SMike Smith void 16335863739SMike Smith aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller) 16435863739SMike Smith { 16535863739SMike Smith device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib); 16635863739SMike Smith device_printf(sc->aac_dev, " XferState %b\n", fib->Header.XferState, "\20" 16735863739SMike Smith "\1HOSTOWNED" 16835863739SMike Smith "\2ADAPTEROWNED" 16935863739SMike Smith "\3INITIALISED" 17035863739SMike Smith "\4EMPTY" 17135863739SMike Smith "\5FROMPOOL" 17235863739SMike Smith "\6FROMHOST" 17335863739SMike Smith "\7FROMADAP" 17435863739SMike Smith "\10REXPECTED" 17535863739SMike Smith "\11RNOTEXPECTED" 17635863739SMike Smith "\12DONEADAP" 17735863739SMike Smith "\13DONEHOST" 17835863739SMike Smith "\14HIGH" 17935863739SMike Smith "\15NORM" 18035863739SMike Smith "\16ASYNC" 18135863739SMike Smith "\17PAGEFILEIO" 18235863739SMike Smith "\20SHUTDOWN" 18335863739SMike Smith "\21LAZYWRITE" 18435863739SMike Smith "\22ADAPMICROFIB" 18535863739SMike Smith "\23BIOSFIB" 18635863739SMike Smith "\24FAST_RESPONSE" 18735863739SMike Smith "\25APIFIB\n"); 18835863739SMike Smith device_printf(sc->aac_dev, " Command %d\n", fib->Header.Command); 189c6eafcf2SScott Long device_printf(sc->aac_dev, " StructType %d\n", 190c6eafcf2SScott Long fib->Header.StructType); 19135863739SMike Smith device_printf(sc->aac_dev, " Flags 0x%x\n", fib->Header.Flags); 19235863739SMike Smith device_printf(sc->aac_dev, " Size %d\n", fib->Header.Size); 193c6eafcf2SScott Long device_printf(sc->aac_dev, " SenderSize %d\n", 194c6eafcf2SScott Long fib->Header.SenderSize); 195c6eafcf2SScott Long device_printf(sc->aac_dev, " SenderAddress 0x%x\n", 196c6eafcf2SScott Long fib->Header.SenderFibAddress); 197c6eafcf2SScott Long device_printf(sc->aac_dev, " ReceiverAddress 0x%x\n", 198c6eafcf2SScott Long fib->Header.ReceiverFibAddress); 199c6eafcf2SScott Long device_printf(sc->aac_dev, " SenderData 0x%x\n", 200c6eafcf2SScott Long fib->Header.SenderData); 20135863739SMike Smith switch(fib->Header.Command) { 20235863739SMike Smith case ContainerCommand: 20335863739SMike Smith { 20435863739SMike Smith struct aac_blockread *br = (struct aac_blockread *)fib->data; 20535863739SMike Smith struct aac_blockwrite *bw = (struct aac_blockwrite *)fib->data; 20635863739SMike Smith struct aac_sg_table *sg = NULL; 20735863739SMike Smith int i; 20835863739SMike Smith if (br->Command == VM_CtBlockRead) { 20935863739SMike Smith device_printf(sc->aac_dev, " BlockRead: container %d 0x%x/%d\n", 21035863739SMike Smith br->ContainerId, br->BlockNumber, br->ByteCount); 21135863739SMike Smith sg = &br->SgMap; 21235863739SMike Smith } 21335863739SMike Smith if (bw->Command == VM_CtBlockWrite) { 214c6eafcf2SScott Long device_printf(sc->aac_dev, " BlockWrite: container %d 0x%x/%d " 215c6eafcf2SScott Long "(%s)\n", bw->ContainerId, bw->BlockNumber, 216c6eafcf2SScott Long bw->ByteCount, bw->Stable == CSTABLE ? "stable" : 217c6eafcf2SScott Long "unstable"); 21835863739SMike Smith sg = &bw->SgMap; 21935863739SMike Smith } 22035863739SMike Smith if (sg != NULL) { 22135863739SMike Smith device_printf(sc->aac_dev, " %d s/g entries\n", sg->SgCount); 22235863739SMike Smith for (i = 0; i < sg->SgCount; i++) 223c6eafcf2SScott Long device_printf(sc->aac_dev, " 0x%08x/%d\n", 224c6eafcf2SScott Long sg->SgEntry[i].SgAddress, 225c6eafcf2SScott Long sg->SgEntry[i].SgByteCount); 22635863739SMike Smith } 22735863739SMike Smith break; 22835863739SMike Smith } 22935863739SMike Smith default: 23035863739SMike Smith device_printf(sc->aac_dev, " %16D\n", fib->data, " "); 23135863739SMike Smith device_printf(sc->aac_dev, " %16D\n", fib->data + 16, " "); 23235863739SMike Smith break; 23335863739SMike Smith } 23435863739SMike Smith } 23535863739SMike Smith 236c6eafcf2SScott Long /****************************************************************************** 23735863739SMike Smith * Describe an AIF we have received. 23835863739SMike Smith */ 23935863739SMike Smith void 24035863739SMike Smith aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif) 24135863739SMike Smith { 24235863739SMike Smith switch(aif->command) { 24335863739SMike Smith case AifCmdEventNotify: 24435863739SMike Smith device_printf(sc->aac_dev, "EventNotify (%d)\n", aif->seqNumber); 24535863739SMike Smith switch(aif->data.EN.type) { 24635863739SMike Smith case AifEnGeneric: /* Generic notification */ 24735863739SMike Smith device_printf(sc->aac_dev, "(Generic) %.*s\n", 248c6eafcf2SScott Long (int)sizeof(aif->data.EN.data.EG), 249c6eafcf2SScott Long aif->data.EN.data.EG.text); 25035863739SMike Smith break; 25135863739SMike Smith case AifEnTaskComplete: /* Task has completed */ 25235863739SMike Smith device_printf(sc->aac_dev, "(TaskComplete)\n"); 25335863739SMike Smith break; 254c6eafcf2SScott Long case AifEnConfigChange: /* Adapter configuration change 255c6eafcf2SScott Long * occurred */ 25635863739SMike Smith device_printf(sc->aac_dev, "(ConfigChange)\n"); 25735863739SMike Smith break; 258c6eafcf2SScott Long case AifEnContainerChange: /* Adapter specific container 259c6eafcf2SScott Long * configuration change */ 26035863739SMike Smith device_printf(sc->aac_dev, "(ContainerChange) container %d,%d\n", 26135863739SMike Smith aif->data.EN.data.ECC.container[0], 26235863739SMike Smith aif->data.EN.data.ECC.container[1]); 26335863739SMike Smith break; 26435863739SMike Smith case AifEnDeviceFailure: /* SCSI device failed */ 26535863739SMike Smith device_printf(sc->aac_dev, "(DeviceFailure) handle %d\n", 266c6eafcf2SScott Long aif->data.EN.data.EDF.deviceHandle); /* XXX 267c6eafcf2SScott Long * interpret */ 26835863739SMike Smith break; 26935863739SMike Smith case AifEnMirrorFailover: /* Mirror failover started */ 270c6eafcf2SScott Long device_printf(sc->aac_dev, "(MirrorFailover) container %d failed, " 271c6eafcf2SScott Long "migrating from slice %d to %d\n", 27235863739SMike Smith aif->data.EN.data.EMF.container, 27335863739SMike Smith aif->data.EN.data.EMF.failedSlice, 27435863739SMike Smith aif->data.EN.data.EMF.creatingSlice); 27535863739SMike Smith break; 276c6eafcf2SScott Long case AifEnContainerEvent: /* Significant container 277c6eafcf2SScott Long * event */ 278c6eafcf2SScott Long device_printf(sc->aac_dev, "(ContainerEvent) container %d event " 279c6eafcf2SScott Long "%d\n", aif->data.EN.data.ECE.container, 280c6eafcf2SScott Long aif->data.EN.data.ECE.eventType); /* XXX 281c6eafcf2SScott Long * interpret? */ 28235863739SMike Smith break; 28335863739SMike Smith case AifEnFileSystemChange: /* File system changed */ 28435863739SMike Smith device_printf(sc->aac_dev, "(FileSystemChange)\n"); 28535863739SMike Smith break; 28635863739SMike Smith case AifEnConfigPause: /* Container pause event */ 28735863739SMike Smith device_printf(sc->aac_dev, "(ConfigPause)\n"); 28835863739SMike Smith break; 28935863739SMike Smith case AifEnConfigResume: /* Container resume event */ 29035863739SMike Smith device_printf(sc->aac_dev, "(ConfigResume)\n"); 29135863739SMike Smith break; 292c6eafcf2SScott Long case AifEnFailoverChange: /* Failover space assignment 293c6eafcf2SScott Long * changed */ 29435863739SMike Smith device_printf(sc->aac_dev, "(FailoverChange)\n"); 29535863739SMike Smith break; 29635863739SMike Smith case AifEnRAID5RebuildDone: /* RAID5 rebuild finished */ 29735863739SMike Smith device_printf(sc->aac_dev, "(RAID5RebuildDone)\n"); 29835863739SMike Smith break; 29935863739SMike Smith case AifEnEnclosureManagement: /* Enclosure management event */ 300c6eafcf2SScott Long device_printf(sc->aac_dev, "(EnclosureManagement) EMPID %d unit %d " 301c6eafcf2SScott Long "event %d\n", aif->data.EN.data.EEE.empID, 30235863739SMike Smith aif->data.EN.data.EEE.unitID, 30335863739SMike Smith aif->data.EN.data.EEE.eventType); 30435863739SMike Smith break; 305c6eafcf2SScott Long case AifEnBatteryEvent: /* Significant NV battery 306c6eafcf2SScott Long * event */ 307c6eafcf2SScott Long device_printf(sc->aac_dev, "(BatteryEvent) %d (state was %d, " 308c6eafcf2SScott Long "is %d\n", aif->data.EN.data.EBE.transition_type, 309c6eafcf2SScott Long aif->data.EN.data.EBE.current_state, /* XXX */ 310c6eafcf2SScott Long aif->data.EN.data.EBE.prior_state); /* interpret? */ 31135863739SMike Smith break; 312c6eafcf2SScott Long case AifEnAddContainer: /* A new container was 313c6eafcf2SScott Long * created. */ 31435863739SMike Smith device_printf(sc->aac_dev, "(AddContainer)\n"); 31535863739SMike Smith break; 31635863739SMike Smith case AifEnDeleteContainer: /* A container was deleted. */ 31735863739SMike Smith device_printf(sc->aac_dev, "(DeleteContainer)\n"); 31835863739SMike Smith break; 319c6eafcf2SScott Long case AifEnBatteryNeedsRecond: /* The battery needs 320c6eafcf2SScott Long * reconditioning */ 32135863739SMike Smith device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n"); 32235863739SMike Smith break; 32335863739SMike Smith case AifEnClusterEvent: /* Some cluster event */ 32435863739SMike Smith device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", 32535863739SMike Smith aif->data.EN.data.ECLE.eventType); 32635863739SMike Smith break; 32735863739SMike Smith case AifEnDiskSetEvent: /* A disk set event occured. */ 328c6eafcf2SScott Long device_printf(sc->aac_dev, "(DiskSetEvent) event %d diskset %lld " 329c6eafcf2SScott Long "creator %lld\n", aif->data.EN.data.EDS.eventType, 33035863739SMike Smith aif->data.EN.data.EDS.DsNum, 33135863739SMike Smith aif->data.EN.data.EDS.CreatorId); 33235863739SMike Smith break; 333c6eafcf2SScott Long case AifDenMorphComplete: /* A morph operation 334c6eafcf2SScott Long * completed */ 33535863739SMike Smith device_printf(sc->aac_dev, "(MorphComplete)\n"); 33635863739SMike Smith break; 337c6eafcf2SScott Long case AifDenVolumeExtendComplete: /* A volume expand operation 338c6eafcf2SScott Long * completed */ 33935863739SMike Smith device_printf(sc->aac_dev, "(VolumeExtendComplete)\n"); 34035863739SMike Smith break; 34135863739SMike Smith default: 34235863739SMike Smith device_printf(sc->aac_dev, "(%d)\n", aif->data.EN.type); 34335863739SMike Smith break; 34435863739SMike Smith } 34535863739SMike Smith break; 34635863739SMike Smith case AifCmdJobProgress: 34735863739SMike Smith { 34835863739SMike Smith char *status; 34935863739SMike Smith switch(aif->data.PR[0].status) { 35035863739SMike Smith case AifJobStsSuccess: 35135863739SMike Smith status = "success"; break; 35235863739SMike Smith case AifJobStsFinished: 35335863739SMike Smith status = "finished"; break; 35435863739SMike Smith case AifJobStsAborted: 35535863739SMike Smith status = "aborted"; break; 35635863739SMike Smith case AifJobStsFailed: 35735863739SMike Smith status = "failed"; break; 35835863739SMike Smith case AifJobStsSuspended: 35935863739SMike Smith status = "suspended"; break; 36035863739SMike Smith case AifJobStsRunning: 36135863739SMike Smith status = "running"; break; 36235863739SMike Smith default: 36335863739SMike Smith status = "unknown status"; break; 36435863739SMike Smith } 36535863739SMike Smith 366c6eafcf2SScott Long device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n", 367c6eafcf2SScott Long aif->seqNumber, status, aif->data.PR[0].currentTick, 368c6eafcf2SScott Long aif->data.PR[0].finalTick); 36935863739SMike Smith switch(aif->data.PR[0].jd.type) { 370c6eafcf2SScott Long case AifJobScsiZero: /* SCSI dev clear operation */ 371c6eafcf2SScott Long device_printf(sc->aac_dev, "(ScsiZero) handle %d\n", 372c6eafcf2SScott Long aif->data.PR[0].jd.client.scsi_dh); 37335863739SMike Smith break; 374c6eafcf2SScott Long case AifJobScsiVerify: /* SCSI device Verify operation 375c6eafcf2SScott Long * NO REPAIR */ 376c6eafcf2SScott Long device_printf(sc->aac_dev, "(ScsiVerify) handle %d\n", 377c6eafcf2SScott Long aif->data.PR[0].jd.client.scsi_dh); 37835863739SMike Smith break; 379c6eafcf2SScott Long case AifJobScsiExercise: /* SCSI device Exercise 380c6eafcf2SScott Long * operation */ 381c6eafcf2SScott Long device_printf(sc->aac_dev, "(ScsiExercise) handle %d\n", 382c6eafcf2SScott Long aif->data.PR[0].jd.client.scsi_dh); 38335863739SMike Smith break; 384c6eafcf2SScott Long case AifJobScsiVerifyRepair: /* SCSI device Verify operation 385c6eafcf2SScott Long * WITH repair */ 386c6eafcf2SScott Long device_printf(sc->aac_dev, "(ScsiVerifyRepair) handle %d\n", 387c6eafcf2SScott Long aif->data.PR[0].jd.client.scsi_dh); 38835863739SMike Smith break; 38935863739SMike Smith case AifJobCtrZero: /* Container clear operation */ 39035863739SMike Smith device_printf(sc->aac_dev, "(ConatainerZero) container %d\n", 39135863739SMike Smith aif->data.PR[0].jd.client.container.src); 39235863739SMike Smith break; 39335863739SMike Smith case AifJobCtrCopy: /* Container copy operation */ 39435863739SMike Smith device_printf(sc->aac_dev, "(ConatainerCopy) container %d to %d\n", 395c6eafcf2SScott Long aif->data.PR[0].jd.client.container.src, 396c6eafcf2SScott Long aif->data.PR[0].jd.client.container.dst); 39735863739SMike Smith break; 398c6eafcf2SScott Long case AifJobCtrCreateMirror: /* Container Create Mirror 399c6eafcf2SScott Long * operation */ 400c6eafcf2SScott Long device_printf(sc->aac_dev, "(ConatainerCreateMirror) container " 401c6eafcf2SScott Long "%d\n", aif->data.PR[0].jd.client.container.src); 402c6eafcf2SScott Long /* XXX two containers? */ 40335863739SMike Smith break; 404c6eafcf2SScott Long case AifJobCtrMergeMirror: /* Container Merge Mirror 405c6eafcf2SScott Long * operation */ 40635863739SMike Smith device_printf(sc->aac_dev, "(ConatainerMergeMirror) container %d\n", 407c6eafcf2SScott Long aif->data.PR[0].jd.client.container.src); 408c6eafcf2SScott Long /* XXX two containers? */ 40935863739SMike Smith break; 410c6eafcf2SScott Long case AifJobCtrScrubMirror: /* Container Scrub Mirror 411c6eafcf2SScott Long * operation */ 41235863739SMike Smith device_printf(sc->aac_dev, "(ConatainerScrubMirror) container %d\n", 41335863739SMike Smith aif->data.PR[0].jd.client.container.src); 41435863739SMike Smith break; 415c6eafcf2SScott Long case AifJobCtrRebuildRaid5: /* Container Rebuild Raid5 416c6eafcf2SScott Long * operation */ 417c6eafcf2SScott Long device_printf(sc->aac_dev, "(ConatainerRebuildRaid5) container " 418c6eafcf2SScott Long "%d\n", aif->data.PR[0].jd.client.container.src); 41935863739SMike Smith break; 420c6eafcf2SScott Long case AifJobCtrScrubRaid5: /* Container Scrub Raid5 421c6eafcf2SScott Long * operation */ 42235863739SMike Smith device_printf(sc->aac_dev, "(ConatainerScrubRaid5) container %d\n", 42335863739SMike Smith aif->data.PR[0].jd.client.container.src); 42435863739SMike Smith break; 42535863739SMike Smith case AifJobCtrMorph: /* Container morph operation */ 42635863739SMike Smith device_printf(sc->aac_dev, "(ConatainerMorph) container %d\n", 42735863739SMike Smith aif->data.PR[0].jd.client.container.src); 428c6eafcf2SScott Long /* XXX two containers? */ 429c6eafcf2SScott Long break; 430c6eafcf2SScott Long case AifJobCtrPartCopy: /* Container Partition copy 431c6eafcf2SScott Long * operation */ 432c6eafcf2SScott Long device_printf(sc->aac_dev, "(ConatainerPartCopy) container %d to " 433c6eafcf2SScott Long "%d\n", aif->data.PR[0].jd.client.container.src, 434c6eafcf2SScott Long aif->data.PR[0].jd.client.container.dst); 435c6eafcf2SScott Long break; 436c6eafcf2SScott Long case AifJobCtrRebuildMirror: /* Container Rebuild Mirror 437c6eafcf2SScott Long * operation */ 438c6eafcf2SScott Long device_printf(sc->aac_dev, "(ConatainerRebuildMirror) container " 439c6eafcf2SScott Long "%d\n", aif->data.PR[0].jd.client.container.src); 44035863739SMike Smith break; 44135863739SMike Smith case AifJobCtrCrazyCache: /* crazy cache */ 44235863739SMike Smith device_printf(sc->aac_dev, "(ConatainerCrazyCache) container %d\n", 443c6eafcf2SScott Long aif->data.PR[0].jd.client.container.src); 444c6eafcf2SScott Long /* XXX two containers? */ 44535863739SMike Smith break; 446c6eafcf2SScott Long case AifJobFsCreate: /* File System Create 447c6eafcf2SScott Long * operation */ 44835863739SMike Smith device_printf(sc->aac_dev, "(FsCreate)\n"); 44935863739SMike Smith break; 450c6eafcf2SScott Long case AifJobFsVerify: /* File System Verify 451c6eafcf2SScott Long * operation */ 45235863739SMike Smith device_printf(sc->aac_dev, "(FsVerivy)\n"); 45335863739SMike Smith break; 454c6eafcf2SScott Long case AifJobFsExtend: /* File System Extend 455c6eafcf2SScott Long * operation */ 45635863739SMike Smith device_printf(sc->aac_dev, "(FsExtend)\n"); 45735863739SMike Smith break; 45835863739SMike Smith case AifJobApiFormatNTFS: /* Format a drive to NTFS */ 45935863739SMike Smith device_printf(sc->aac_dev, "(FormatNTFS)\n"); 46035863739SMike Smith break; 46135863739SMike Smith case AifJobApiFormatFAT: /* Format a drive to FAT */ 46235863739SMike Smith device_printf(sc->aac_dev, "(FormatFAT)\n"); 46335863739SMike Smith break; 464c6eafcf2SScott Long case AifJobApiUpdateSnapshot: /* update the read/write half 465c6eafcf2SScott Long * of a snapshot */ 46635863739SMike Smith device_printf(sc->aac_dev, "(UpdateSnapshot)\n"); 46735863739SMike Smith break; 46835863739SMike Smith case AifJobApiFormatFAT32: /* Format a drive to FAT32 */ 46935863739SMike Smith device_printf(sc->aac_dev, "(FormatFAT32)\n"); 47035863739SMike Smith break; 47135863739SMike Smith case AifJobCtlContinuousCtrVerify: /* Adapter operation */ 47235863739SMike Smith device_printf(sc->aac_dev, "(ContinuousCtrVerify)\n"); 47335863739SMike Smith break; 47435863739SMike Smith default: 47535863739SMike Smith device_printf(sc->aac_dev, "(%d)\n", aif->data.PR[0].jd.type); 47635863739SMike Smith break; 47735863739SMike Smith } 47835863739SMike Smith break; 47935863739SMike Smith } 48035863739SMike Smith case AifCmdAPIReport: 48135863739SMike Smith device_printf(sc->aac_dev, "APIReport (%d)\n", aif->seqNumber); 48235863739SMike Smith break; 48335863739SMike Smith case AifCmdDriverNotify: 48435863739SMike Smith device_printf(sc->aac_dev, "DriverNotify (%d)\n", aif->seqNumber); 48535863739SMike Smith break; 48635863739SMike Smith default: 487c6eafcf2SScott Long device_printf(sc->aac_dev, "AIF %d (%d)\n", aif->command, 488c6eafcf2SScott Long aif->seqNumber); 48935863739SMike Smith break; 49035863739SMike Smith } 49135863739SMike Smith } 492da4c1ce3SJustin T. Gibbs #endif 493