xref: /freebsd/sys/dev/aac/aac_debug.c (revision a35d88931c87cfe6bd38f01d7bad22140b3b38f3)
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
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
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 
30 #include <sys/cdefs.h>
31 __FBSDID("$FreeBSD$");
32 
33 /*
34  * Debugging support.
35  */
36 #include "opt_aac.h"
37 
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/kernel.h>
41 #include <sys/conf.h>
42 
43 #include <sys/bus.h>
44 
45 #include <machine/resource.h>
46 #include <machine/bus.h>
47 
48 #include <dev/aac/aac_compat.h>
49 #include <dev/aac/aacreg.h>
50 #include <dev/aac/aac_ioctl.h>
51 #include <dev/aac/aacvar.h>
52 
53 #ifdef AAC_DEBUG
54 void	aac_printstate0(void);
55 void	aac_intr0(void);
56 
57 /*
58  * Dump the command queue indices
59  */
60 void
61 aac_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][
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 }
124 
125 /*
126  * Print the command queue states for controller 0 (callable from DDB)
127  */
128 void
129 aac_printstate0(void)
130 {
131 	struct aac_softc *sc;
132 
133 	sc = devclass_get_softc(devclass_find("aac"), 0);
134 
135 	aac_print_queues(sc);
136 	switch (sc->aac_hwif) {
137 	case AAC_HWIF_I960RX:
138 		device_printf(sc->aac_dev, "IDBR 0x%08x  IIMR 0x%08x  "
139 		    "IISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_IDBR),
140 		    AAC_GETREG4(sc, AAC_RX_IIMR), AAC_GETREG4(sc, AAC_RX_IISR));
141 		device_printf(sc->aac_dev, "ODBR 0x%08x  OIMR 0x%08x  "
142 		    "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR),
143 		    AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR));
144 		AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY |
145 			    AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/);
146 		device_printf(sc->aac_dev, "ODBR 0x%08x  OIMR 0x%08x  "
147 		    "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR),
148 		    AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR));
149 		break;
150 	case AAC_HWIF_STRONGARM:
151 		/* XXX implement */
152 		break;
153 	}
154 }
155 
156 /*
157  * simulate an interrupt for controller 0
158  */
159 void
160 aac_intr0(void)
161 {
162 	struct aac_softc *sc;
163 
164 	sc = devclass_get_softc(devclass_find("aac"), 0);
165 
166 	aac_intr(sc);
167 }
168 
169 /*
170  * Panic in a slightly informative fashion
171  */
172 void
173 aac_panic(struct aac_softc *sc, char *reason)
174 {
175 	aac_print_queues(sc);
176 	panic(reason);
177 }
178 
179 /*
180  * Print a FIB
181  */
182 void
183 aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, const char *caller)
184 {
185 	if (fib == NULL) {
186 		device_printf(sc->aac_dev,
187 			      "aac_print_fib called with NULL fib\n");
188 		return;
189 	}
190 	device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib);
191 	device_printf(sc->aac_dev, "  XferState %b\n", fib->Header.XferState,
192 		      "\20"
193 		      "\1HOSTOWNED"
194 		      "\2ADAPTEROWNED"
195 		      "\3INITIALISED"
196 		      "\4EMPTY"
197 		      "\5FROMPOOL"
198 		      "\6FROMHOST"
199 		      "\7FROMADAP"
200 		      "\10REXPECTED"
201 		      "\11RNOTEXPECTED"
202 		      "\12DONEADAP"
203 		      "\13DONEHOST"
204 		      "\14HIGH"
205 		      "\15NORM"
206 		      "\16ASYNC"
207 		      "\17PAGEFILEIO"
208 		      "\20SHUTDOWN"
209 		      "\21LAZYWRITE"
210 		      "\22ADAPMICROFIB"
211 		      "\23BIOSFIB"
212 		      "\24FAST_RESPONSE"
213 		      "\25APIFIB\n");
214 	device_printf(sc->aac_dev, "  Command       %d\n", fib->Header.Command);
215 	device_printf(sc->aac_dev, "  StructType    %d\n",
216 		      fib->Header.StructType);
217 	device_printf(sc->aac_dev, "  Flags         0x%x\n", fib->Header.Flags);
218 	device_printf(sc->aac_dev, "  Size          %d\n", fib->Header.Size);
219 	device_printf(sc->aac_dev, "  SenderSize    %d\n",
220 		      fib->Header.SenderSize);
221 	device_printf(sc->aac_dev, "  SenderAddress 0x%x\n",
222 		      fib->Header.SenderFibAddress);
223 	device_printf(sc->aac_dev, "  RcvrAddress   0x%x\n",
224 		      fib->Header.ReceiverFibAddress);
225 	device_printf(sc->aac_dev, "  SenderData    0x%x\n",
226 		      fib->Header.SenderData);
227 	switch(fib->Header.Command) {
228 	case ContainerCommand:
229 	{
230 		struct aac_blockread *br;
231 		struct aac_blockwrite *bw;
232 		struct aac_sg_table *sg;
233 		int i;
234 
235 		br = (struct aac_blockread*)fib->data;
236 		bw = (struct aac_blockwrite*)fib->data;
237 		sg = NULL;
238 
239 		if (br->Command == VM_CtBlockRead) {
240 			device_printf(sc->aac_dev,
241 				      "  BlockRead: container %d  0x%x/%d\n",
242 				      br->ContainerId, br->BlockNumber,
243 				      br->ByteCount);
244 			sg = &br->SgMap;
245 		}
246 		if (bw->Command == VM_CtBlockWrite) {
247 			device_printf(sc->aac_dev,
248 				      "  BlockWrite: container %d  0x%x/%d "
249 				      "(%s)\n", bw->ContainerId,
250 				      bw->BlockNumber, bw->ByteCount,
251 				      bw->Stable == CSTABLE ? "stable" :
252 				      "unstable");
253 			sg = &bw->SgMap;
254 		}
255 		if (sg != NULL) {
256 			device_printf(sc->aac_dev,
257 				      "  %d s/g entries\n", sg->SgCount);
258 			for (i = 0; i < sg->SgCount; i++)
259 				device_printf(sc->aac_dev, "  0x%08x/%d\n",
260 					      sg->SgEntry[i].SgAddress,
261 					      sg->SgEntry[i].SgByteCount);
262 		}
263 		break;
264 	}
265 	default:
266 		device_printf(sc->aac_dev, "   %16D\n", fib->data, " ");
267 		device_printf(sc->aac_dev, "   %16D\n", fib->data + 16, " ");
268 		break;
269 	}
270 }
271 
272 /*
273  * Describe an AIF we have received.
274  */
275 void
276 aac_print_aif(struct aac_softc *sc, struct aac_aif_command *aif)
277 {
278 	switch(aif->command) {
279 	case AifCmdEventNotify:
280 		device_printf(sc->aac_dev, "EventNotify(%d)\n", aif->seqNumber);
281 		switch(aif->data.EN.type) {
282 		case AifEnGeneric:		/* Generic notification */
283 			device_printf(sc->aac_dev, "(Generic) %.*s\n",
284 				  (int)sizeof(aif->data.EN.data.EG),
285 				  aif->data.EN.data.EG.text);
286 			break;
287 		case AifEnTaskComplete:		/* Task has completed */
288 			device_printf(sc->aac_dev, "(TaskComplete)\n");
289 			break;
290 		case AifEnConfigChange:		/* Adapter configuration change
291 						 * occurred */
292 			device_printf(sc->aac_dev, "(ConfigChange)\n");
293 			break;
294 		case AifEnContainerChange:	/* Adapter specific container
295 						 * configuration change */
296 			device_printf(sc->aac_dev, "(ContainerChange) "
297 				      "container %d,%d\n",
298 				      aif->data.EN.data.ECC.container[0],
299 				      aif->data.EN.data.ECC.container[1]);
300 			break;
301 		case AifEnDeviceFailure:	/* SCSI device failed */
302 			device_printf(sc->aac_dev, "(DeviceFailure) "
303 				      "handle %d\n",
304 				      aif->data.EN.data.EDF.deviceHandle);
305 			break;
306 		case AifEnMirrorFailover:	/* Mirror failover started */
307 			device_printf(sc->aac_dev, "(MirrorFailover) "
308 				      "container %d failed, "
309 				      "migrating from slice %d to %d\n",
310 				      aif->data.EN.data.EMF.container,
311 				      aif->data.EN.data.EMF.failedSlice,
312 				      aif->data.EN.data.EMF.creatingSlice);
313 			break;
314 		case AifEnContainerEvent:	/* Significant container
315 						 * event */
316 			device_printf(sc->aac_dev, "(ContainerEvent) "
317 				      "container %d event "
318 				      "%d\n", aif->data.EN.data.ECE.container,
319 				      aif->data.EN.data.ECE.eventType);
320 			break;
321 		case AifEnFileSystemChange:	/* File system changed */
322 			device_printf(sc->aac_dev, "(FileSystemChange)\n");
323 			break;
324 		case AifEnConfigPause:		/* Container pause event */
325 			device_printf(sc->aac_dev, "(ConfigPause)\n");
326 			break;
327 		case AifEnConfigResume:		/* Container resume event */
328 			device_printf(sc->aac_dev, "(ConfigResume)\n");
329 			break;
330 		case AifEnFailoverChange:	/* Failover space assignment
331 						 * changed */
332 			device_printf(sc->aac_dev, "(FailoverChange)\n");
333 			break;
334 		case AifEnRAID5RebuildDone:	/* RAID5 rebuild finished */
335 			device_printf(sc->aac_dev, "(RAID5RebuildDone)\n");
336 			break;
337 		case AifEnEnclosureManagement:	/* Enclosure management event */
338 			device_printf(sc->aac_dev, "(EnclosureManagement) "
339 				      "EMPID %d unit %d "
340 				      "event %d\n", aif->data.EN.data.EEE.empID,
341 				      aif->data.EN.data.EEE.unitID,
342 				      aif->data.EN.data.EEE.eventType);
343 			break;
344 		case AifEnBatteryEvent:		/* Significant NV battery
345 						 * event */
346 			device_printf(sc->aac_dev, "(BatteryEvent) %d "
347 				      "(state was %d, is %d\n",
348 				      aif->data.EN.data.EBE.transition_type,
349 				      aif->data.EN.data.EBE.current_state,
350 				      aif->data.EN.data.EBE.prior_state);
351 			break;
352 		case AifEnAddContainer:		/* A new container was
353 						 * created. */
354 			device_printf(sc->aac_dev, "(AddContainer)\n");
355 			break;
356 		case AifEnDeleteContainer:	/* A container was deleted. */
357 			device_printf(sc->aac_dev, "(DeleteContainer)\n");
358 			break;
359 		case AifEnBatteryNeedsRecond:	/* The battery needs
360 						 * reconditioning */
361 			device_printf(sc->aac_dev, "(BatteryNeedsRecond)\n");
362 			break;
363 		case AifEnClusterEvent:		/* Some cluster event */
364 			device_printf(sc->aac_dev, "(ClusterEvent) event %d\n",
365 				      aif->data.EN.data.ECLE.eventType);
366 			break;
367 		case AifEnDiskSetEvent:		/* A disk set event occured. */
368 			device_printf(sc->aac_dev, "(DiskSetEvent) event %d "
369 				      "diskset %jd creator %jd\n",
370 				      aif->data.EN.data.EDS.eventType,
371 				      (intmax_t)aif->data.EN.data.EDS.DsNum,
372 				      (intmax_t)aif->data.EN.data.EDS.CreatorId);
373 			break;
374 		case AifDenMorphComplete: 	/* A morph operation
375 						 * completed */
376 			device_printf(sc->aac_dev, "(MorphComplete)\n");
377 			break;
378 		case AifDenVolumeExtendComplete: /* A volume expand operation
379 						  * completed */
380 			device_printf(sc->aac_dev, "(VolumeExtendComplete)\n");
381 			break;
382 		default:
383 			device_printf(sc->aac_dev, "(%d)\n", aif->data.EN.type);
384 			break;
385 		}
386 		break;
387 	case AifCmdJobProgress:
388 	{
389 		char	*status;
390 		switch(aif->data.PR[0].status) {
391 		case AifJobStsSuccess:
392 			status = "success"; break;
393 		case AifJobStsFinished:
394 			status = "finished"; break;
395 		case AifJobStsAborted:
396 			status = "aborted"; break;
397 		case AifJobStsFailed:
398 			status = "failed"; break;
399 		case AifJobStsSuspended:
400 			status = "suspended"; break;
401 		case AifJobStsRunning:
402 			status = "running"; break;
403 		default:
404 			status = "unknown status"; break;
405 		}
406 
407 		device_printf(sc->aac_dev, "JobProgress (%d) - %s (%d, %d)\n",
408 			      aif->seqNumber, status,
409 			      aif->data.PR[0].currentTick,
410 			      aif->data.PR[0].finalTick);
411 		switch(aif->data.PR[0].jd.type) {
412 		case AifJobScsiZero:		/* SCSI dev clear operation */
413 			device_printf(sc->aac_dev, "(ScsiZero) handle %d\n",
414 				      aif->data.PR[0].jd.client.scsi_dh);
415 			break;
416 		case AifJobScsiVerify:		/* SCSI device Verify operation
417 						 * NO REPAIR */
418 			device_printf(sc->aac_dev, "(ScsiVerify) handle %d\n",
419 				      aif->data.PR[0].jd.client.scsi_dh);
420 			break;
421 		case AifJobScsiExercise:	/* SCSI device Exercise
422 						 * operation */
423 			device_printf(sc->aac_dev, "(ScsiExercise) handle %d\n",
424 				      aif->data.PR[0].jd.client.scsi_dh);
425 			break;
426 		case AifJobScsiVerifyRepair:	/* SCSI device Verify operation
427 						 * WITH repair */
428 			device_printf(sc->aac_dev,
429 				      "(ScsiVerifyRepair) handle %d\n",
430 				      aif->data.PR[0].jd.client.scsi_dh);
431 			break;
432 		case AifJobCtrZero:		/* Container clear operation */
433 			device_printf(sc->aac_dev,
434 				      "(ConatainerZero) container %d\n",
435 				      aif->data.PR[0].jd.client.container.src);
436 			break;
437 		case AifJobCtrCopy:		/* Container copy operation */
438 			device_printf(sc->aac_dev,
439 				      "(ConatainerCopy) container %d to %d\n",
440 				      aif->data.PR[0].jd.client.container.src,
441 				      aif->data.PR[0].jd.client.container.dst);
442 			break;
443 		case AifJobCtrCreateMirror:	/* Container Create Mirror
444 						 * operation */
445 			device_printf(sc->aac_dev,
446 				      "(ConatainerCreateMirror) container %d\n",
447 				      aif->data.PR[0].jd.client.container.src);
448 				      /* XXX two containers? */
449 			break;
450 		case AifJobCtrMergeMirror:	/* Container Merge Mirror
451 						 * operation */
452 			device_printf(sc->aac_dev,
453 				      "(ConatainerMergeMirror) container %d\n",
454 				      aif->data.PR[0].jd.client.container.src);
455 				      /* XXX two containers? */
456 			break;
457 		case AifJobCtrScrubMirror:	/* Container Scrub Mirror
458 						 * operation */
459 			device_printf(sc->aac_dev,
460 				      "(ConatainerScrubMirror) container %d\n",
461 				      aif->data.PR[0].jd.client.container.src);
462 			break;
463 		case AifJobCtrRebuildRaid5:	/* Container Rebuild Raid5
464 						 * operation */
465 			device_printf(sc->aac_dev,
466 				      "(ConatainerRebuildRaid5) container %d\n",
467 				      aif->data.PR[0].jd.client.container.src);
468 			break;
469 		case AifJobCtrScrubRaid5:	/* Container Scrub Raid5
470 						 * operation */
471 			device_printf(sc->aac_dev,
472 				      "(ConatainerScrubRaid5) container %d\n",
473 				      aif->data.PR[0].jd.client.container.src);
474 			break;
475 		case AifJobCtrMorph:		/* Container morph operation */
476 			device_printf(sc->aac_dev,
477 				      "(ConatainerMorph) container %d\n",
478 				      aif->data.PR[0].jd.client.container.src);
479 				      /* XXX two containers? */
480 			break;
481 		case AifJobCtrPartCopy:		/* Container Partition copy
482 						 * operation */
483 			device_printf(sc->aac_dev,
484 				      "(ConatainerPartCopy) container %d to "
485 				      "%d\n",
486 				      aif->data.PR[0].jd.client.container.src,
487 				      aif->data.PR[0].jd.client.container.dst);
488 			break;
489 		case AifJobCtrRebuildMirror:	/* Container Rebuild Mirror
490 						 * operation */
491 			device_printf(sc->aac_dev,
492 				      "(ConatainerRebuildMirror) container "
493 				      "%d\n",
494 				      aif->data.PR[0].jd.client.container.src);
495 			break;
496 		case AifJobCtrCrazyCache:	/* crazy cache */
497 			device_printf(sc->aac_dev,
498 				      "(ConatainerCrazyCache) container %d\n",
499 				      aif->data.PR[0].jd.client.container.src);
500 				      /* XXX two containers? */
501 			break;
502 		case AifJobFsCreate:		/* File System Create
503 						 * operation */
504 			device_printf(sc->aac_dev, "(FsCreate)\n");
505 			break;
506 		case AifJobFsVerify:		/* File System Verify
507 						 * operation */
508 			device_printf(sc->aac_dev, "(FsVerivy)\n");
509 			break;
510 		case AifJobFsExtend:		/* File System Extend
511 						 * operation */
512 			device_printf(sc->aac_dev, "(FsExtend)\n");
513 			break;
514 		case AifJobApiFormatNTFS:	/* Format a drive to NTFS */
515 			device_printf(sc->aac_dev, "(FormatNTFS)\n");
516 			break;
517 		case AifJobApiFormatFAT:	/* Format a drive to FAT */
518 			device_printf(sc->aac_dev, "(FormatFAT)\n");
519 			break;
520 		case AifJobApiUpdateSnapshot:	/* update the read/write half
521 						 * of a snapshot */
522 			device_printf(sc->aac_dev, "(UpdateSnapshot)\n");
523 			break;
524 		case AifJobApiFormatFAT32:	/* Format a drive to FAT32 */
525 			device_printf(sc->aac_dev, "(FormatFAT32)\n");
526 			break;
527 		case AifJobCtlContinuousCtrVerify: /* Adapter operation */
528 			device_printf(sc->aac_dev, "(ContinuousCtrVerify)\n");
529 			break;
530 		default:
531 			device_printf(sc->aac_dev, "(%d)\n",
532 				      aif->data.PR[0].jd.type);
533 			break;
534 		}
535 		break;
536 	}
537 	case AifCmdAPIReport:
538 		device_printf(sc->aac_dev, "APIReport (%d)\n", aif->seqNumber);
539 		break;
540 	case AifCmdDriverNotify:
541 		device_printf(sc->aac_dev, "DriverNotify (%d)\n",
542 			      aif->seqNumber);
543 		break;
544 	default:
545 		device_printf(sc->aac_dev, "AIF %d (%d)\n", aif->command,
546 			      aif->seqNumber);
547 		break;
548 	}
549 }
550 #endif /* AAC_DEBUG */
551