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