aac_debug.c (82527) | aac_debug.c (83114) |
---|---|
1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2001 Scott Long 4 * Copyright (c) 2000 BSDi 5 * Copyright (c) 2001 Adaptec, Inc. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2001 Scott Long 4 * Copyright (c) 2000 BSDi 5 * Copyright (c) 2001 Adaptec, Inc. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/dev/aac/aac_debug.c 82527 2001-08-29 23:34:05Z scottl $ | 29 * $FreeBSD: head/sys/dev/aac/aac_debug.c 83114 2001-09-05 20:43:02Z scottl $ |
30 */ 31 32/* 33 * Debugging support. 34 */ 35#include "opt_aac.h" 36 37#include <sys/param.h> --- 8 unchanged lines hidden (view full) --- 46#include <machine/resource.h> 47#include <machine/bus.h> 48 49#include <dev/aac/aacreg.h> 50#include <dev/aac/aac_ioctl.h> 51#include <dev/aac/aacvar.h> 52 53#ifdef AAC_DEBUG | 30 */ 31 32/* 33 * Debugging support. 34 */ 35#include "opt_aac.h" 36 37#include <sys/param.h> --- 8 unchanged lines hidden (view full) --- 46#include <machine/resource.h> 47#include <machine/bus.h> 48 49#include <dev/aac/aacreg.h> 50#include <dev/aac/aac_ioctl.h> 51#include <dev/aac/aacvar.h> 52 53#ifdef AAC_DEBUG |
54void aac_printstate0(void); 55void aac_intr0(void); | 54void aac_printstate0(void); 55void aac_intr0(void); |
56 | 56 |
57/****************************************************************************** | 57/* |
58 * Dump the command queue indices 59 */ 60void 61aac_print_queues(struct aac_softc *sc) 62{ | 58 * Dump the command queue indices 59 */ 60void 61aac_print_queues(struct aac_softc *sc) 62{ |
63 device_printf(sc->aac_dev, "FIB queue header at %p queues at %p\n", 64 &sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][0], 65 &sc->aac_queues->qt_HostNormCmdQueue[0]); 66 device_printf(sc->aac_dev, "HOST_NORM_CMD %d/%d (%d)\n", 67 sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX], 68 sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX], 69 AAC_HOST_NORM_CMD_ENTRIES); 70 device_printf(sc->aac_dev, "HOST_HIGH_CMD %d/%d (%d)\n", 71 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX], 72 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX], 73 AAC_HOST_HIGH_CMD_ENTRIES); 74 device_printf(sc->aac_dev, "ADAP_NORM_CMD %d/%d (%d)\n", 75 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX], 76 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][AAC_CONSUMER_INDEX], 77 AAC_ADAP_NORM_CMD_ENTRIES); 78 device_printf(sc->aac_dev, "ADAP_HIGH_CMD %d/%d (%d)\n", 79 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_PRODUCER_INDEX], 80 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][AAC_CONSUMER_INDEX], 81 AAC_ADAP_HIGH_CMD_ENTRIES); 82 device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n", 83 sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX], 84 sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX], 85 AAC_HOST_NORM_RESP_ENTRIES); 86 device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n", 87 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX], 88 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX], 89 AAC_HOST_HIGH_RESP_ENTRIES); 90 device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n", 91 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_PRODUCER_INDEX], 92 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][AAC_CONSUMER_INDEX], 93 AAC_ADAP_NORM_RESP_ENTRIES); 94 device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n", 95 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_PRODUCER_INDEX], 96 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][AAC_CONSUMER_INDEX], 97 AAC_ADAP_HIGH_RESP_ENTRIES); 98 device_printf(sc->aac_dev, "AACQ_FREE %d/%d\n", 99 sc->aac_qstat[AACQ_FREE].q_length, sc->aac_qstat[AACQ_FREE].q_max); 100 device_printf(sc->aac_dev, "AACQ_BIO %d/%d\n", 101 sc->aac_qstat[AACQ_BIO].q_length, sc->aac_qstat[AACQ_BIO].q_max); 102 device_printf(sc->aac_dev, "AACQ_READY %d/%d\n", 103 sc->aac_qstat[AACQ_READY].q_length, sc->aac_qstat[AACQ_READY].q_max); 104 device_printf(sc->aac_dev, "AACQ_BUSY %d/%d\n", 105 sc->aac_qstat[AACQ_BUSY].q_length, sc->aac_qstat[AACQ_BUSY].q_max); 106 device_printf(sc->aac_dev, "AACQ_COMPLETE %d/%d\n", 107 sc->aac_qstat[AACQ_COMPLETE].q_length, 108 sc->aac_qstat[AACQ_COMPLETE].q_max); | 63 device_printf(sc->aac_dev, "FIB queue header at %p queues at %p\n", 64 &sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][0], 65 &sc->aac_queues->qt_HostNormCmdQueue[0]); 66 device_printf(sc->aac_dev, "HOST_NORM_CMD %d/%d (%d)\n", 67 sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][ 68 AAC_PRODUCER_INDEX], 69 sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][ 70 AAC_CONSUMER_INDEX], 71 AAC_HOST_NORM_CMD_ENTRIES); 72 device_printf(sc->aac_dev, "HOST_HIGH_CMD %d/%d (%d)\n", 73 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][ 74 AAC_PRODUCER_INDEX], 75 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_CMD_QUEUE][ 76 AAC_CONSUMER_INDEX], 77 AAC_HOST_HIGH_CMD_ENTRIES); 78 device_printf(sc->aac_dev, "ADAP_NORM_CMD %d/%d (%d)\n", 79 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][ 80 AAC_PRODUCER_INDEX], 81 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_CMD_QUEUE][ 82 AAC_CONSUMER_INDEX], 83 AAC_ADAP_NORM_CMD_ENTRIES); 84 device_printf(sc->aac_dev, "ADAP_HIGH_CMD %d/%d (%d)\n", 85 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][ 86 AAC_PRODUCER_INDEX], 87 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_CMD_QUEUE][ 88 AAC_CONSUMER_INDEX], 89 AAC_ADAP_HIGH_CMD_ENTRIES); 90 device_printf(sc->aac_dev, "HOST_NORM_RESP %d/%d (%d)\n", 91 sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][ 92 AAC_PRODUCER_INDEX], 93 sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE][ 94 AAC_CONSUMER_INDEX], 95 AAC_HOST_NORM_RESP_ENTRIES); 96 device_printf(sc->aac_dev, "HOST_HIGH_RESP %d/%d (%d)\n", 97 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][ 98 AAC_PRODUCER_INDEX], 99 sc->aac_queues->qt_qindex[AAC_HOST_HIGH_RESP_QUEUE][ 100 AAC_CONSUMER_INDEX], 101 AAC_HOST_HIGH_RESP_ENTRIES); 102 device_printf(sc->aac_dev, "ADAP_NORM_RESP %d/%d (%d)\n", 103 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][ 104 AAC_PRODUCER_INDEX], 105 sc->aac_queues->qt_qindex[AAC_ADAP_NORM_RESP_QUEUE][ 106 AAC_CONSUMER_INDEX], 107 AAC_ADAP_NORM_RESP_ENTRIES); 108 device_printf(sc->aac_dev, "ADAP_HIGH_RESP %d/%d (%d)\n", 109 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][ 110 AAC_PRODUCER_INDEX], 111 sc->aac_queues->qt_qindex[AAC_ADAP_HIGH_RESP_QUEUE][ 112 AAC_CONSUMER_INDEX], 113 AAC_ADAP_HIGH_RESP_ENTRIES); 114 device_printf(sc->aac_dev, "AACQ_FREE %d/%d\n", 115 sc->aac_qstat[AACQ_FREE].q_length, sc->aac_qstat[AACQ_FREE].q_max); 116 device_printf(sc->aac_dev, "AACQ_BIO %d/%d\n", 117 sc->aac_qstat[AACQ_BIO].q_length, sc->aac_qstat[AACQ_BIO].q_max); 118 device_printf(sc->aac_dev, "AACQ_READY %d/%d\n", 119 sc->aac_qstat[AACQ_READY].q_length, 120 sc->aac_qstat[AACQ_READY].q_max); 121 device_printf(sc->aac_dev, "AACQ_BUSY %d/%d\n", 122 sc->aac_qstat[AACQ_BUSY].q_length, sc->aac_qstat[AACQ_BUSY].q_max); 123 device_printf(sc->aac_dev, "AACQ_COMPLETE %d/%d\n", 124 sc->aac_qstat[AACQ_COMPLETE].q_length, 125 sc->aac_qstat[AACQ_COMPLETE].q_max); |
109} 110 | 126} 127 |
111/****************************************************************************** | 128/* |
112 * Print the command queue states for controller 0 (callable from DDB) 113 */ 114void 115aac_printstate0(void) 116{ | 129 * Print the command queue states for controller 0 (callable from DDB) 130 */ 131void 132aac_printstate0(void) 133{ |
117 struct aac_softc *sc = devclass_get_softc(aac_devclass, 0); | 134 struct aac_softc *sc; |
118 | 135 |
119 aac_print_queues(sc); 120 switch (sc->aac_hwif) { 121 case AAC_HWIF_I960RX: 122 device_printf(sc->aac_dev, "IDBR 0x%08x IIMR 0x%08x IISR 0x%08x\n", 123 AAC_GETREG4(sc, AAC_RX_IDBR), AAC_GETREG4(sc, AAC_RX_IIMR), 124 AAC_GETREG4(sc, AAC_RX_IISR)); 125 device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x OISR 0x%08x\n", 126 AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), 127 AAC_GETREG4(sc, AAC_RX_OISR)); 128 AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | 129 AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/); 130 device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x OISR 0x%08x\n", 131 AAC_GETREG4(sc, AAC_RX_ODBR), AAC_GETREG4(sc, AAC_RX_OIMR), 132 AAC_GETREG4(sc, AAC_RX_OISR)); 133 break; 134 case AAC_HWIF_STRONGARM: 135 /* XXX implement */ 136 } | 136 sc = devclass_get_softc(aac_devclass, 0); 137 138 aac_print_queues(sc); 139 switch (sc->aac_hwif) { 140 case AAC_HWIF_I960RX: 141 device_printf(sc->aac_dev, "IDBR 0x%08x IIMR 0x%08x " 142 "IISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_IDBR), 143 AAC_GETREG4(sc, AAC_RX_IIMR), AAC_GETREG4(sc, AAC_RX_IISR)); 144 device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x " 145 "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR), 146 AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR)); 147 AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | 148 AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/); 149 device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x " 150 "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR), 151 AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR)); 152 break; 153 case AAC_HWIF_STRONGARM: 154 /* XXX implement */ 155 } |
137} 138 | 156} 157 |
139/****************************************************************************** | 158/* |
140 * simulate an interrupt for controller 0 141 */ 142void 143aac_intr0(void) 144{ | 159 * simulate an interrupt for controller 0 160 */ 161void 162aac_intr0(void) 163{ |
145 struct aac_softc *sc = devclass_get_softc(aac_devclass, 0); | 164 struct aac_softc *sc; |
146 | 165 |
147 aac_intr(sc); | 166 sc = devclass_get_softc(aac_devclass, 0); 167 168 aac_intr(sc); |
148} 149 | 169} 170 |
150/****************************************************************************** | 171/* |
151 * Panic in a slightly informative fashion 152 */ 153void 154aac_panic(struct aac_softc *sc, char *reason) 155{ | 172 * Panic in a slightly informative fashion 173 */ 174void 175aac_panic(struct aac_softc *sc, char *reason) 176{ |
156 aac_print_queues(sc); 157 panic(reason); | 177 aac_print_queues(sc); 178 panic(reason); |
158} 159 | 179} 180 |
160/****************************************************************************** | 181/* |
161 * Print a FIB 162 */ 163void 164aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller) 165{ | 182 * Print a FIB 183 */ 184void 185aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller) 186{ |
166 device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib); 167 device_printf(sc->aac_dev, " XferState %b\n", fib->Header.XferState, "\20" 168 "\1HOSTOWNED" 169 "\2ADAPTEROWNED" 170 "\3INITIALISED" 171 "\4EMPTY" 172 "\5FROMPOOL" 173 "\6FROMHOST" 174 "\7FROMADAP" 175 "\10REXPECTED" 176 "\11RNOTEXPECTED" 177 "\12DONEADAP" 178 "\13DONEHOST" 179 "\14HIGH" 180 "\15NORM" 181 "\16ASYNC" 182 "\17PAGEFILEIO" 183 "\20SHUTDOWN" 184 "\21LAZYWRITE" 185 "\22ADAPMICROFIB" 186 "\23BIOSFIB" 187 "\24FAST_RESPONSE" 188 "\25APIFIB\n"); 189 device_printf(sc->aac_dev, " Command %d\n", fib->Header.Command); 190 device_printf(sc->aac_dev, " StructType %d\n", 191 fib->Header.StructType); 192 device_printf(sc->aac_dev, " Flags 0x%x\n", fib->Header.Flags); 193 device_printf(sc->aac_dev, " Size %d\n", fib->Header.Size); 194 device_printf(sc->aac_dev, " SenderSize %d\n", 195 fib->Header.SenderSize); 196 device_printf(sc->aac_dev, " SenderAddress 0x%x\n", 197 fib->Header.SenderFibAddress); 198 device_printf(sc->aac_dev, " ReceiverAddress 0x%x\n", 199 fib->Header.ReceiverFibAddress); 200 device_printf(sc->aac_dev, " SenderData 0x%x\n", 201 fib->Header.SenderData); 202 switch(fib->Header.Command) { 203 case ContainerCommand: 204 { 205 struct aac_blockread *br = (struct aac_blockread *)fib->data; 206 struct aac_blockwrite *bw = (struct aac_blockwrite *)fib->data; 207 struct aac_sg_table *sg = NULL; 208 int i; 209 if (br->Command == VM_CtBlockRead) { 210 device_printf(sc->aac_dev, " BlockRead: container %d 0x%x/%d\n", 211 br->ContainerId, br->BlockNumber, br->ByteCount); 212 sg = &br->SgMap; | 187 device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib); 188 device_printf(sc->aac_dev, " XferState %b\n", fib->Header.XferState, 189 "\20" 190 "\1HOSTOWNED" 191 "\2ADAPTEROWNED" 192 "\3INITIALISED" 193 "\4EMPTY" 194 "\5FROMPOOL" 195 "\6FROMHOST" 196 "\7FROMADAP" 197 "\10REXPECTED" 198 "\11RNOTEXPECTED" 199 "\12DONEADAP" 200 "\13DONEHOST" 201 "\14HIGH" 202 "\15NORM" 203 "\16ASYNC" 204 "\17PAGEFILEIO" 205 "\20SHUTDOWN" 206 "\21LAZYWRITE" 207 "\22ADAPMICROFIB" 208 "\23BIOSFIB" 209 "\24FAST_RESPONSE" 210 "\25APIFIB\n"); 211 device_printf(sc->aac_dev, " Command %d\n", fib->Header.Command); 212 device_printf(sc->aac_dev, " StructType %d\n", 213 fib->Header.StructType); 214 device_printf(sc->aac_dev, " Flags 0x%x\n", fib->Header.Flags); 215 device_printf(sc->aac_dev, " Size %d\n", fib->Header.Size); 216 device_printf(sc->aac_dev, " SenderSize %d\n",xi 217 fib->Header.SenderSize); 218 device_printf(sc->aac_dev, " SenderAddress 0x%x\n", 219 fib->Header.SenderFibAddress); 220 device_printf(sc->aac_dev, " RcvrAddress 0x%x\n", 221 fib->Header.ReceiverFibAddress); 222 device_printf(sc->aac_dev, " SenderData 0x%x\n", 223 fib->Header.SenderData); 224 switch(fib->Header.Command) { 225 case ContainerCommand: 226 { 227 struct aac_blockread *br; 228 struct aac_blockwrite *br; 229 struct aac_sg_table *sg; 230 int i; 231 232 br = (struct aac_blockread*)fib->data; 233 bw = (struct aac_blockwrite*)fib->data; 234 sg = NULL; 235 236 if (br->Command == VM_CtBlockRead) { 237 device_printf(sc->aac_dev, 238 " BlockRead: container %d 0x%x/%d\n", 239 br->ContainerId, br->BlockNumber, 240 br->ByteCount); 241 sg = &br->SgMap; 242 } 243 if (bw->Command == VM_CtBlockWrite) { 244 device_printf(sc->aac_dev, 245 " BlockWrite: container %d 0x%x/%d " 246 "(%s)\n", bw->ContainerId, 247 bw->BlockNumber, bw->ByteCount, 248 bw->Stable == CSTABLE ? "stable" : 249 "unstable"); 250 sg = &bw->SgMap; 251 } 252 if (sg != NULL) { 253 device_printf(sc->aac_dev, 254 " %d s/g entries\n", sg->SgCount); 255 for (i = 0; i < sg->SgCount; i++) 256 device_printf(sc->aac_dev, " 0x%08x/%d\n", 257 sg->SgEntry[i].SgAddress, 258 sg->SgEntry[i].SgByteCount); 259 } 260 break; |
213 } | 261 } |
214 if (bw->Command == VM_CtBlockWrite) { 215 device_printf(sc->aac_dev, " BlockWrite: container %d 0x%x/%d " 216 "(%s)\n", bw->ContainerId, bw->BlockNumber, 217 bw->ByteCount, bw->Stable == CSTABLE ? "stable" : 218 "unstable"); 219 sg = &bw->SgMap; | 262 default: 263 device_printf(sc->aac_dev, " %16D\n", fib->data, " "); 264 device_printf(sc->aac_dev, " %16D\n", fib->data + 16, " "); 265 break; |
220 } | 266 } |
221 if (sg != NULL) { 222 device_printf(sc->aac_dev, " %d s/g entries\n", sg->SgCount); 223 for (i = 0; i < sg->SgCount; i++) 224 device_printf(sc->aac_dev, " 0x%08x/%d\n", 225 sg->SgEntry[i].SgAddress, 226 sg->SgEntry[i].SgByteCount); 227 } 228 break; 229 } 230 default: 231 device_printf(sc->aac_dev, " %16D\n", fib->data, " "); 232 device_printf(sc->aac_dev, " %16D\n", fib->data + 16, " "); 233 break; 234 } | |
235} 236 | 267} 268 |
237/****************************************************************************** | 269/* |
238 * Describe an AIF we have received. 239 */ 240void 241aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif) 242{ | 270 * Describe an AIF we have received. 271 */ 272void 273aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif) 274{ |
243 switch(aif->command) { 244 case AifCmdEventNotify: 245 device_printf(sc->aac_dev, "EventNotify (%d)\n", aif->seqNumber); 246 switch(aif->data.EN.type) { 247 case AifEnGeneric: /* Generic notification */ 248 device_printf(sc->aac_dev, "(Generic) %.*s\n", 249 (int)sizeof(aif->data.EN.data.EG), 250 aif->data.EN.data.EG.text); 251 break; 252 case AifEnTaskComplete: /* Task has completed */ 253 device_printf(sc->aac_dev, "(TaskComplete)\n"); 254 break; 255 case AifEnConfigChange: /* Adapter configuration change | 275 switch(aif->command) { 276 case AifCmdEventNotify: 277 device_printf(sc->aac_dev, "EventNotify(%d)\n", aif->seqNumber); 278 switch(aif->data.EN.type) { 279 case AifEnGeneric: /* Generic notification */ 280 device_printf(sc->aac_dev, "(Generic) %.*s\n", 281 (int)sizeof(aif->data.EN.data.EG), 282 aif->data.EN.data.EG.text); 283 break; 284 case AifEnTaskComplete: /* Task has completed */ 285 device_printf(sc->aac_dev, "(TaskComplete)\n"); 286 break; 287 case AifEnConfigChange: /* Adapter configuration change |
256 * occurred */ | 288 * occurred */ |
257 device_printf(sc->aac_dev, "(ConfigChange)\n"); 258 break; 259 case AifEnContainerChange: /* Adapter specific container | 289 device_printf(sc->aac_dev, "(ConfigChange)\n"); 290 break; 291 case AifEnContainerChange: /* Adapter specific container |
260 * configuration change */ | 292 * configuration change */ |
261 device_printf(sc->aac_dev, "(ContainerChange) container %d,%d\n", 262 aif->data.EN.data.ECC.container[0], 263 aif->data.EN.data.ECC.container[1]); 264 break; 265 case AifEnDeviceFailure: /* SCSI device failed */ 266 device_printf(sc->aac_dev, "(DeviceFailure) handle %d\n", 267 aif->data.EN.data.EDF.deviceHandle); /* XXX 268 * interpret */ 269 break; 270 case AifEnMirrorFailover: /* Mirror failover started */ 271 device_printf(sc->aac_dev, "(MirrorFailover) container %d failed, " 272 "migrating from slice %d to %d\n", 273 aif->data.EN.data.EMF.container, 274 aif->data.EN.data.EMF.failedSlice, 275 aif->data.EN.data.EMF.creatingSlice); 276 break; 277 case AifEnContainerEvent: /* Significant container | 293 device_printf(sc->aac_dev, "(ContainerChange) " 294 "container %d,%d\n", 295 aif->data.EN.data.ECC.container[0], 296 aif->data.EN.data.ECC.container[1]); 297 break; 298 case AifEnDeviceFailure: /* SCSI device failed */ 299 device_printf(sc->aac_dev, "(DeviceFailure) " 300 "handle %d\n", 301 aif->data.EN.data.EDF.deviceHandle); 302 break; 303 case AifEnMirrorFailover: /* Mirror failover started */ 304 device_printf(sc->aac_dev, "(MirrorFailover) " 305 "container %d failed, " 306 "migrating from slice %d to %d\n", 307 aif->data.EN.data.EMF.container, 308 aif->data.EN.data.EMF.failedSlice, 309 aif->data.EN.data.EMF.creatingSlice); 310 break; 311 case AifEnContainerEvent: /* Significant container |
278 * event */ | 312 * event */ |
279 device_printf(sc->aac_dev, "(ContainerEvent) container %d event " 280 "%d\n", aif->data.EN.data.ECE.container, 281 aif->data.EN.data.ECE.eventType); /* XXX 282 * interpret? */ 283 break; 284 case AifEnFileSystemChange: /* File system changed */ 285 device_printf(sc->aac_dev, "(FileSystemChange)\n"); 286 break; 287 case AifEnConfigPause: /* Container pause event */ 288 device_printf(sc->aac_dev, "(ConfigPause)\n"); 289 break; 290 case AifEnConfigResume: /* Container resume event */ 291 device_printf(sc->aac_dev, "(ConfigResume)\n"); 292 break; 293 case AifEnFailoverChange: /* Failover space assignment | 313 device_printf(sc->aac_dev, "(ContainerEvent) " 314 "container %d event " 315 "%d\n", aif->data.EN.data.ECE.container, 316 aif->data.EN.data.ECE.eventType); 317 break; 318 case AifEnFileSystemChange: /* File system changed */ 319 device_printf(sc->aac_dev, "(FileSystemChange)\n"); 320 break; 321 case AifEnConfigPause: /* Container pause event */ 322 device_printf(sc->aac_dev, "(ConfigPause)\n"); 323 break; 324 case AifEnConfigResume: /* Container resume event */ 325 device_printf(sc->aac_dev, "(ConfigResume)\n"); 326 break; 327 case AifEnFailoverChange: /* Failover space assignment |
294 * changed */ | 328 * changed */ |
295 device_printf(sc->aac_dev, "(FailoverChange)\n"); 296 break; 297 case AifEnRAID5RebuildDone: /* RAID5 rebuild finished */ 298 device_printf(sc->aac_dev, "(RAID5RebuildDone)\n"); 299 break; 300 case AifEnEnclosureManagement: /* Enclosure management event */ 301 device_printf(sc->aac_dev, "(EnclosureManagement) EMPID %d unit %d " 302 "event %d\n", aif->data.EN.data.EEE.empID, 303 aif->data.EN.data.EEE.unitID, 304 aif->data.EN.data.EEE.eventType); 305 break; 306 case AifEnBatteryEvent: /* Significant NV battery | 329 device_printf(sc->aac_dev, "(FailoverChange)\n"); 330 break; 331 case AifEnRAID5RebuildDone: /* RAID5 rebuild finished */ 332 device_printf(sc->aac_dev, "(RAID5RebuildDone)\n"); 333 break; 334 case AifEnEnclosureManagement: /* Enclosure management event */ 335 device_printf(sc->aac_dev, "(EnclosureManagement) " 336 "EMPID %d unit %d " 337 "event %d\n", aif->data.EN.data.EEE.empID, 338 aif->data.EN.data.EEE.unitID, 339 aif->data.EN.data.EEE.eventType); 340 break; 341 case AifEnBatteryEvent: /* Significant NV battery |
307 * event */ | 342 * event */ |
308 device_printf(sc->aac_dev, "(BatteryEvent) %d (state was %d, " 309 "is %d\n", aif->data.EN.data.EBE.transition_type, 310 aif->data.EN.data.EBE.current_state, /* XXX */ 311 aif->data.EN.data.EBE.prior_state); /* interpret? */ 312 break; 313 case AifEnAddContainer: /* A new container was | 343 device_printf(sc->aac_dev, "(BatteryEvent) %d " 344 "(state was %d, is %d\n", 345 aif->data.EN.data.EBE.transition_type, 346 aif->data.EN.data.EBE.current_state, 347 aif->data.EN.data.EBE.prior_state); 348 break; 349 case AifEnAddContainer: /* A new container was |
314 * created. */ | 350 * created. */ |
315 device_printf(sc->aac_dev, "(AddContainer)\n"); 316 break; 317 case AifEnDeleteContainer: /* A container was deleted. */ 318 device_printf(sc->aac_dev, "(DeleteContainer)\n"); 319 break; 320 case AifEnBatteryNeedsRecond: /* The battery needs | 351 device_printf(sc->aac_dev, "(AddContainer)\n"); 352 break; 353 case AifEnDeleteContainer: /* A container was deleted. */ 354 device_printf(sc->aac_dev, "(DeleteContainer)\n"); 355 break; 356 case AifEnBatteryNeedsRecond: /* The battery needs |
321 * reconditioning */ | 357 * reconditioning */ |
322 device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n"); 323 break; 324 case AifEnClusterEvent: /* Some cluster event */ 325 device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", 326 aif->data.EN.data.ECLE.eventType); 327 break; 328 case AifEnDiskSetEvent: /* A disk set event occured. */ 329 device_printf(sc->aac_dev, "(DiskSetEvent) event %d diskset %lld " 330 "creator %lld\n", aif->data.EN.data.EDS.eventType, 331 aif->data.EN.data.EDS.DsNum, 332 aif->data.EN.data.EDS.CreatorId); 333 break; 334 case AifDenMorphComplete: /* A morph operation | 358 device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n"); 359 break; 360 case AifEnClusterEvent: /* Some cluster event */ 361 device_printf(sc->aac_dev, "(ClusterEvent) event %d\n", 362 aif->data.EN.data.ECLE.eventType); 363 break; 364 case AifEnDiskSetEvent: /* A disk set event occured. */ 365 device_printf(sc->aac_dev, "(DiskSetEvent) event %d " 366 "diskset %lld creator %lld\n", 367 aif->data.EN.data.EDS.eventType, 368 aif->data.EN.data.EDS.DsNum, 369 aif->data.EN.data.EDS.CreatorId); 370 break; 371 case AifDenMorphComplete: /* A morph operation |
335 * completed */ | 372 * completed */ |
336 device_printf(sc->aac_dev, "(MorphComplete)\n"); 337 break; 338 case AifDenVolumeExtendComplete: /* A volume expand operation 339 * completed */ 340 device_printf(sc->aac_dev, "(VolumeExtendComplete)\n"); 341 break; 342 default: 343 device_printf(sc->aac_dev, "(%d)\n", aif->data.EN.type); 344 break; 345 } 346 break; 347 case AifCmdJobProgress: 348 { 349 char *status; 350 switch(aif->data.PR[0].status) { 351 case AifJobStsSuccess: 352 status = "success"; break; 353 case AifJobStsFinished: 354 status = "finished"; break; 355 case AifJobStsAborted: 356 status = "aborted"; break; 357 case AifJobStsFailed: 358 status = "failed"; break; 359 case AifJobStsSuspended: 360 status = "suspended"; break; 361 case AifJobStsRunning: 362 status = "running"; break; 363 default: 364 status = "unknown status"; break; 365 } | 373 device_printf(sc->aac_dev, "(MorphComplete)\n"); 374 break; 375 case AifDenVolumeExtendComplete: /* A volume expand operation 376 * completed */ 377 device_printf(sc->aac_dev, "(VolumeExtendComplete)\n"); 378 break; 379 default: 380 device_printf(sc->aac_dev, "(%d)\n", aif->data.EN.type); 381 break; 382 } 383 break; 384 case AifCmdJobProgress: 385 { 386 char *status; 387 switch(aif->data.PR[0].status) { 388 case AifJobStsSuccess: 389 status = "success"; break; 390 case AifJobStsFinished: 391 status = "finished"; break; 392 case AifJobStsAborted: 393 status = "aborted"; break; 394 case AifJobStsFailed: 395 status = "failed"; break; 396 case AifJobStsSuspended: 397 status = "suspended"; break; 398 case AifJobStsRunning: 399 status = "running"; break; 400 default: 401 status = "unknown status"; break; 402 } |
366 | 403 |
367 device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n", 368 aif->seqNumber, status, aif->data.PR[0].currentTick, 369 aif->data.PR[0].finalTick); 370 switch(aif->data.PR[0].jd.type) { 371 case AifJobScsiZero: /* SCSI dev clear operation */ 372 device_printf(sc->aac_dev, "(ScsiZero) handle %d\n", 373 aif->data.PR[0].jd.client.scsi_dh); 374 break; 375 case AifJobScsiVerify: /* SCSI device Verify operation | 404 device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n", 405 aif->seqNumber, status, 406 aif->data.PR[0].currentTick, 407 aif->data.PR[0].finalTick); 408 switch(aif->data.PR[0].jd.type) { 409 case AifJobScsiZero: /* SCSI dev clear operation */ 410 device_printf(sc->aac_dev, "(ScsiZero) handle %d\n", 411 aif->data.PR[0].jd.client.scsi_dh); 412 break; 413 case AifJobScsiVerify: /* SCSI device Verify operation |
376 * NO REPAIR */ | 414 * NO REPAIR */ |
377 device_printf(sc->aac_dev, "(ScsiVerify) handle %d\n", 378 aif->data.PR[0].jd.client.scsi_dh); 379 break; 380 case AifJobScsiExercise: /* SCSI device Exercise | 415 device_printf(sc->aac_dev, "(ScsiVerify) handle %d\n", 416 aif->data.PR[0].jd.client.scsi_dh); 417 break; 418 case AifJobScsiExercise: /* SCSI device Exercise |
381 * operation */ | 419 * operation */ |
382 device_printf(sc->aac_dev, "(ScsiExercise) handle %d\n", 383 aif->data.PR[0].jd.client.scsi_dh); 384 break; 385 case AifJobScsiVerifyRepair: /* SCSI device Verify operation | 420 device_printf(sc->aac_dev, "(ScsiExercise) handle %d\n", 421 aif->data.PR[0].jd.client.scsi_dh); 422 break; 423 case AifJobScsiVerifyRepair: /* SCSI device Verify operation |
386 * WITH repair */ | 424 * WITH repair */ |
387 device_printf(sc->aac_dev, "(ScsiVerifyRepair) handle %d\n", 388 aif->data.PR[0].jd.client.scsi_dh); 389 break; 390 case AifJobCtrZero: /* Container clear operation */ 391 device_printf(sc->aac_dev, "(ConatainerZero) container %d\n", 392 aif->data.PR[0].jd.client.container.src); 393 break; 394 case AifJobCtrCopy: /* Container copy operation */ 395 device_printf(sc->aac_dev, "(ConatainerCopy) container %d to %d\n", 396 aif->data.PR[0].jd.client.container.src, 397 aif->data.PR[0].jd.client.container.dst); 398 break; 399 case AifJobCtrCreateMirror: /* Container Create Mirror | 425 device_printf(sc->aac_dev, 426 "(ScsiVerifyRepair) handle %d\n", 427 aif->data.PR[0].jd.client.scsi_dh); 428 break; 429 case AifJobCtrZero: /* Container clear operation */ 430 device_printf(sc->aac_dev, 431 "(ConatainerZero) container %d\n", 432 aif->data.PR[0].jd.client.container.src); 433 break; 434 case AifJobCtrCopy: /* Container copy operation */ 435 device_printf(sc->aac_dev, 436 "(ConatainerCopy) container %d to %d\n", 437 aif->data.PR[0].jd.client.container.src, 438 aif->data.PR[0].jd.client.container.dst); 439 break; 440 case AifJobCtrCreateMirror: /* Container Create Mirror |
400 * operation */ | 441 * operation */ |
401 device_printf(sc->aac_dev, "(ConatainerCreateMirror) container " 402 "%d\n", aif->data.PR[0].jd.client.container.src); 403 /* XXX two containers? */ 404 break; 405 case AifJobCtrMergeMirror: /* Container Merge Mirror | 442 device_printf(sc->aac_dev, 443 "(ConatainerCreateMirror) container %d\n", 444 aif->data.PR[0].jd.client.container.src); 445 /* XXX two containers? */ 446 break; 447 case AifJobCtrMergeMirror: /* Container Merge Mirror |
406 * operation */ | 448 * operation */ |
407 device_printf(sc->aac_dev, "(ConatainerMergeMirror) container %d\n", 408 aif->data.PR[0].jd.client.container.src); 409 /* XXX two containers? */ 410 break; 411 case AifJobCtrScrubMirror: /* Container Scrub Mirror | 449 device_printf(sc->aac_dev, 450 "(ConatainerMergeMirror) container %d\n", 451 aif->data.PR[0].jd.client.container.src); 452 /* XXX two containers? */ 453 break; 454 case AifJobCtrScrubMirror: /* Container Scrub Mirror |
412 * operation */ | 455 * operation */ |
413 device_printf(sc->aac_dev, "(ConatainerScrubMirror) container %d\n", 414 aif->data.PR[0].jd.client.container.src); 415 break; 416 case AifJobCtrRebuildRaid5: /* Container Rebuild Raid5 | 456 device_printf(sc->aac_dev, 457 "(ConatainerScrubMirror) container %d\n", 458 aif->data.PR[0].jd.client.container.src); 459 break; 460 case AifJobCtrRebuildRaid5: /* Container Rebuild Raid5 |
417 * operation */ | 461 * operation */ |
418 device_printf(sc->aac_dev, "(ConatainerRebuildRaid5) container " 419 "%d\n", aif->data.PR[0].jd.client.container.src); 420 break; 421 case AifJobCtrScrubRaid5: /* Container Scrub Raid5 | 462 device_printf(sc->aac_dev, 463 "(ConatainerRebuildRaid5) container %d\n", 464 aif->data.PR[0].jd.client.container.src); 465 break; 466 case AifJobCtrScrubRaid5: /* Container Scrub Raid5 |
422 * operation */ | 467 * operation */ |
423 device_printf(sc->aac_dev, "(ConatainerScrubRaid5) container %d\n", 424 aif->data.PR[0].jd.client.container.src); 425 break; 426 case AifJobCtrMorph: /* Container morph operation */ 427 device_printf(sc->aac_dev, "(ConatainerMorph) container %d\n", 428 aif->data.PR[0].jd.client.container.src); 429 /* XXX two containers? */ 430 break; 431 case AifJobCtrPartCopy: /* Container Partition copy | 468 device_printf(sc->aac_dev, 469 "(ConatainerScrubRaid5) container %d\n", 470 aif->data.PR[0].jd.client.container.src); 471 break; 472 case AifJobCtrMorph: /* Container morph operation */ 473 device_printf(sc->aac_dev, 474 "(ConatainerMorph) container %d\n", 475 aif->data.PR[0].jd.client.container.src); 476 /* XXX two containers? */ 477 break; 478 case AifJobCtrPartCopy: /* Container Partition copy |
432 * operation */ | 479 * operation */ |
433 device_printf(sc->aac_dev, "(ConatainerPartCopy) container %d to " 434 "%d\n", aif->data.PR[0].jd.client.container.src, 435 aif->data.PR[0].jd.client.container.dst); 436 break; 437 case AifJobCtrRebuildMirror: /* Container Rebuild Mirror | 480 device_printf(sc->aac_dev, 481 "(ConatainerPartCopy) container %d to " 482 "%d\n", 483 aif->data.PR[0].jd.client.container.src, 484 aif->data.PR[0].jd.client.container.dst); 485 break; 486 case AifJobCtrRebuildMirror: /* Container Rebuild Mirror |
438 * operation */ | 487 * operation */ |
439 device_printf(sc->aac_dev, "(ConatainerRebuildMirror) container " 440 "%d\n", aif->data.PR[0].jd.client.container.src); 441 break; 442 case AifJobCtrCrazyCache: /* crazy cache */ 443 device_printf(sc->aac_dev, "(ConatainerCrazyCache) container %d\n", 444 aif->data.PR[0].jd.client.container.src); 445 /* XXX two containers? */ 446 break; 447 case AifJobFsCreate: /* File System Create | 488 device_printf(sc->aac_dev, 489 "(ConatainerRebuildMirror) container " 490 "%d\n", 491 aif->data.PR[0].jd.client.container.src); 492 break; 493 case AifJobCtrCrazyCache: /* crazy cache */ 494 device_printf(sc->aac_dev, 495 "(ConatainerCrazyCache) container %d\n", 496 aif->data.PR[0].jd.client.container.src); 497 /* XXX two containers? */ 498 break; 499 case AifJobFsCreate: /* File System Create |
448 * operation */ | 500 * operation */ |
449 device_printf(sc->aac_dev, "(FsCreate)\n"); 450 break; 451 case AifJobFsVerify: /* File System Verify | 501 device_printf(sc->aac_dev, "(FsCreate)\n"); 502 break; 503 case AifJobFsVerify: /* File System Verify |
452 * operation */ | 504 * operation */ |
453 device_printf(sc->aac_dev, "(FsVerivy)\n"); 454 break; 455 case AifJobFsExtend: /* File System Extend | 505 device_printf(sc->aac_dev, "(FsVerivy)\n"); 506 break; 507 case AifJobFsExtend: /* File System Extend |
456 * operation */ | 508 * operation */ |
457 device_printf(sc->aac_dev, "(FsExtend)\n"); 458 break; 459 case AifJobApiFormatNTFS: /* Format a drive to NTFS */ 460 device_printf(sc->aac_dev, "(FormatNTFS)\n"); 461 break; 462 case AifJobApiFormatFAT: /* Format a drive to FAT */ 463 device_printf(sc->aac_dev, "(FormatFAT)\n"); 464 break; 465 case AifJobApiUpdateSnapshot: /* update the read/write half | 509 device_printf(sc->aac_dev, "(FsExtend)\n"); 510 break; 511 case AifJobApiFormatNTFS: /* Format a drive to NTFS */ 512 device_printf(sc->aac_dev, "(FormatNTFS)\n"); 513 break; 514 case AifJobApiFormatFAT: /* Format a drive to FAT */ 515 device_printf(sc->aac_dev, "(FormatFAT)\n"); 516 break; 517 case AifJobApiUpdateSnapshot: /* update the read/write half |
466 * of a snapshot */ | 518 * of a snapshot */ |
467 device_printf(sc->aac_dev, "(UpdateSnapshot)\n"); 468 break; 469 case AifJobApiFormatFAT32: /* Format a drive to FAT32 */ 470 device_printf(sc->aac_dev, "(FormatFAT32)\n"); 471 break; 472 case AifJobCtlContinuousCtrVerify: /* Adapter operation */ 473 device_printf(sc->aac_dev, "(ContinuousCtrVerify)\n"); 474 break; | 519 device_printf(sc->aac_dev, "(UpdateSnapshot)\n"); 520 break; 521 case AifJobApiFormatFAT32: /* Format a drive to FAT32 */ 522 device_printf(sc->aac_dev, "(FormatFAT32)\n"); 523 break; 524 case AifJobCtlContinuousCtrVerify: /* Adapter operation */ 525 device_printf(sc->aac_dev, "(ContinuousCtrVerify)\n"); 526 break; 527 default: 528 device_printf(sc->aac_dev, "(%d)\n", 529 aif->data.PR[0].jd.type); 530 break; 531 } 532 break; 533 } 534 case AifCmdAPIReport: 535 device_printf(sc->aac_dev, "APIReport (%d)\n", aif->seqNumber); 536 break; 537 case AifCmdDriverNotify: 538 device_printf(sc->aac_dev, "DriverNotify (%d)\n", 539 aif->seqNumber); 540 break; |
475 default: | 541 default: |
476 device_printf(sc->aac_dev, "(%d)\n", aif->data.PR[0].jd.type); 477 break; | 542 device_printf(sc->aac_dev, "AIF %d (%d)\n", aif->command, 543 aif->seqNumber); 544 break; |
478 } | 545 } |
479 break; 480 } 481 case AifCmdAPIReport: 482 device_printf(sc->aac_dev, "APIReport (%d)\n", aif->seqNumber); 483 break; 484 case AifCmdDriverNotify: 485 device_printf(sc->aac_dev, "DriverNotify (%d)\n", aif->seqNumber); 486 break; 487 default: 488 device_printf(sc->aac_dev, "AIF %d (%d)\n", aif->command, 489 aif->seqNumber); 490 break; 491 } | |
492} 493#endif /* AAC_DEBUG */ | 546} 547#endif /* AAC_DEBUG */ |