scsipi_verbose.c revision 1.4 1 /* $NetBSD: scsipi_verbose.c,v 1.4 1998/07/01 17:18:45 mjacob Exp $ */
2
3 /*
4 * Copyright (c) 1994, 1995, 1997 Charles M. Hannum. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Charles M. Hannum.
17 * 4. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include <sys/types.h>
33 #include <sys/param.h>
34 #include <sys/time.h>
35 #include <sys/proc.h>
36 #include <sys/device.h>
37
38 #ifdef _KERNEL
39 #include <sys/systm.h>
40
41 #include "opt_scsiverbose.h"
42 #else
43 #include <stdio.h>
44 #endif
45 #include <dev/scsipi/scsipi_all.h>
46 #include <dev/scsipi/scsi_all.h>
47 #include <dev/scsipi/scsipiconf.h>
48 #include <dev/scsipi/scsiconf.h>
49
50 static const char *sense_keys[16] = {
51 "No Additional Sense",
52 "Soft Error",
53 "Not Ready",
54 "Media Error",
55 "Hardware Error",
56 "Illegal Request",
57 "Unit Attention",
58 "Write Protected",
59 "Blank Check",
60 "Vendor Unique",
61 "Copy Aborted",
62 "Aborted Command",
63 "Equal Error",
64 "Volume Overflow",
65 "Miscompare Error",
66 "Reserved"
67 };
68
69 static const struct {
70 unsigned char asc;
71 unsigned char ascq;
72 char *description;
73 } adesc[] = {
74 { 0x00, 0x00, "No Additional Sense Information" },
75 { 0x00, 0x01, "Filemark Detected" },
76 { 0x00, 0x02, "End-Of-Partition/Medium Detected" },
77 { 0x00, 0x03, "Setmark Detected" },
78 { 0x00, 0x04, "Beginning-Of-Partition/Medium Detected" },
79 { 0x00, 0x05, "End-Of-Data Detected" },
80 { 0x00, 0x06, "I/O Process Terminated" },
81 { 0x00, 0x11, "Audio Play Operation In Progress" },
82 { 0x00, 0x12, "Audio Play Operation Paused" },
83 { 0x00, 0x13, "Audio Play Operation Successfully Completed" },
84 { 0x00, 0x14, "Audio Play Operation Stopped Due to Error" },
85 { 0x00, 0x15, "No Current Audio Status To Return" },
86 { 0x01, 0x00, "No Index/Sector Signal" },
87 { 0x02, 0x00, "No Seek Complete" },
88 { 0x03, 0x00, "Peripheral Device Write Fault" },
89 { 0x03, 0x01, "No Write Current" },
90 { 0x03, 0x02, "Excessive Write Errors" },
91 { 0x04, 0x00, "Logical Unit Not Ready, Cause Not Reportable" },
92 { 0x04, 0x01, "Logical Unit Is in Process Of Becoming Ready" },
93 { 0x04, 0x02, "Logical Unit Not Ready, Initialization Command Required" },
94 { 0x04, 0x03, "Logical Unit Not Ready, Manual Intervention Required" },
95 { 0x04, 0x04, "Logical Unit Not Ready, Format In Progress" },
96 { 0x05, 0x00, "Logical Unit Does Not Respond To Selection" },
97 { 0x06, 0x00, "No Reference Position Found" },
98 { 0x07, 0x00, "Multiple Peripheral Devices Selected" },
99 { 0x08, 0x00, "Logical Unit Communication Failure" },
100 { 0x08, 0x01, "Logical Unit Communication Timeout" },
101 { 0x08, 0x02, "Logical Unit Communication Parity Error" },
102 { 0x09, 0x00, "Track Following Error" },
103 { 0x09, 0x01, "Tracking Servo Failure" },
104 { 0x09, 0x02, "Focus Servo Failure" },
105 { 0x09, 0x03, "Spindle Servo Failure" },
106 { 0x0A, 0x00, "Error Log Overflow" },
107 { 0x0C, 0x00, "Write Error" },
108 { 0x0C, 0x01, "Write Error Recovered with Auto Reallocation" },
109 { 0x0C, 0x02, "Write Error - Auto Reallocate Failed" },
110 { 0x10, 0x00, "ID CRC Or ECC Error" },
111 { 0x11, 0x00, "Unrecovered Read Error" },
112 { 0x11, 0x01, "Read Retried Exhausted" },
113 { 0x11, 0x02, "Error Too Long To Correct" },
114 { 0x11, 0x03, "Multiple Read Errors" },
115 { 0x11, 0x04, "Unrecovered Read Error - Auto Reallocate Failed" },
116 { 0x11, 0x05, "L-EC Uncorrectable Error" },
117 { 0x11, 0x06, "CIRC Unrecovered Error" },
118 { 0x11, 0x07, "Data Resynchronization Error" },
119 { 0x11, 0x08, "Incomplete Block Found" },
120 { 0x11, 0x09, "No Gap Found" },
121 { 0x11, 0x0A, "Miscorrected Error" },
122 { 0x11, 0x0B, "Uncorrected Read Error - Recommend Reassignment" },
123 { 0x11, 0x0C, "Uncorrected Read Error - Recommend Rewrite the Data" },
124 { 0x12, 0x00, "Address Mark Not Found for ID Field" },
125 { 0x13, 0x00, "Address Mark Not Found for Data Field" },
126 { 0x14, 0x00, "Recorded Entity Not Found" },
127 { 0x14, 0x01, "Record Not Found" },
128 { 0x14, 0x02, "Filemark or Setmark Not Found" },
129 { 0x14, 0x03, "End-Of-Data Not Found" },
130 { 0x14, 0x04, "Block Sequence Error" },
131 { 0x15, 0x00, "Random Positioning Error" },
132 { 0x15, 0x01, "Mechanical Positioning Error" },
133 { 0x15, 0x02, "Positioning Error Detected By Read of Medium" },
134 { 0x16, 0x00, "Data Synchronization Mark Error" },
135 { 0x17, 0x00, "Recovered Data With No Error Correction Applied" },
136 { 0x17, 0x01, "Recovered Data With Retries" },
137 { 0x17, 0x02, "Recovered Data With Positive Head Offset" },
138 { 0x17, 0x03, "Recovered Data With Negative Head Offset" },
139 { 0x17, 0x04, "Recovered Data With Retries and/or CIRC Applied" },
140 { 0x17, 0x05, "Recovered Data Using Previous Sector ID" },
141 { 0x17, 0x06, "Recovered Data Without ECC - Data Auto-Reallocated" },
142 { 0x17, 0x07, "Recovered Data Without ECC - Recommend Reassignment" },
143 { 0x17, 0x08, "Recovered Data Without ECC - Recommend Rewrite" },
144 { 0x18, 0x00, "Recovered Data With Error Correction Applied" },
145 { 0x18, 0x01, "Recovered Data With Error Correction & Retries Applied" },
146 { 0x18, 0x02, "Recovered Data - Data Auto-Reallocated" },
147 { 0x18, 0x03, "Recovered Data With CIRC" },
148 { 0x18, 0x04, "Recovered Data With LEC" },
149 { 0x18, 0x05, "Recovered Data - Recommend Reassignment" },
150 { 0x18, 0x06, "Recovered Data - Recommend Rewrite" },
151 { 0x19, 0x00, "Defect List Error" },
152 { 0x19, 0x01, "Defect List Not Available" },
153 { 0x19, 0x02, "Defect List Error in Primary List" },
154 { 0x19, 0x03, "Defect List Error in Grown List" },
155 { 0x1A, 0x00, "Parameter List Length Error" },
156 { 0x1B, 0x00, "Synchronous Data Transfer Error" },
157 { 0x1C, 0x00, "Defect List Not Found" },
158 { 0x1C, 0x01, "Primary Defect List Not Found" },
159 { 0x1C, 0x02, "Grown Defect List Not Found" },
160 { 0x1D, 0x00, "Miscompare During Verify Operation" },
161 { 0x1E, 0x00, "Recovered ID with ECC" },
162 { 0x20, 0x00, "Invalid Command Operation Code" },
163 { 0x21, 0x00, "Logical Block Address Out of Range" },
164 { 0x21, 0x01, "Invalid Element Address" },
165 { 0x22, 0x00, "Illegal Function (Should 20 00, 24 00, or 26 00)" },
166 { 0x24, 0x00, "Illegal Field in CDB" },
167 { 0x25, 0x00, "Logical Unit Not Supported" },
168 { 0x26, 0x00, "Invalid Field In Parameter List" },
169 { 0x26, 0x01, "Parameter Not Supported" },
170 { 0x26, 0x02, "Parameter Value Invalid" },
171 { 0x26, 0x03, "Threshold Parameters Not Supported" },
172 { 0x27, 0x00, "Write Protected" },
173 { 0x28, 0x00, "Not Ready To Ready Transition (Medium May Have Changed)" },
174 { 0x28, 0x01, "Import Or Export Element Accessed" },
175 { 0x29, 0x00, "Power On, Reset, or Bus Device Reset Occurred" },
176 { 0x2A, 0x00, "Parameters Changed" },
177 { 0x2A, 0x01, "Mode Parameters Changed" },
178 { 0x2A, 0x02, "Log Parameters Changed" },
179 { 0x2B, 0x00, "Copy Cannot Execute Since Host Cannot Disconnect" },
180 { 0x2C, 0x00, "Command Sequence Error" },
181 { 0x2C, 0x01, "Too Many Windows Specified" },
182 { 0x2C, 0x02, "Invalid Combination of Windows Specified" },
183 { 0x2D, 0x00, "Overwrite Error On Update In Place" },
184 { 0x2F, 0x00, "Commands Cleared By Another Initiator" },
185 { 0x30, 0x00, "Incompatible Medium Installed" },
186 { 0x30, 0x01, "Cannot Read Medium - Unknown Format" },
187 { 0x30, 0x02, "Cannot Read Medium - Incompatible Format" },
188 { 0x30, 0x03, "Cleaning Cartridge Installed" },
189 { 0x31, 0x00, "Medium Format Corrupted" },
190 { 0x31, 0x01, "Format Command Failed" },
191 { 0x32, 0x00, "No Defect Spare Location Available" },
192 { 0x32, 0x01, "Defect List Update Failure" },
193 { 0x33, 0x00, "Tape Length Error" },
194 { 0x36, 0x00, "Ribbon, Ink, or Toner Failure" },
195 { 0x37, 0x00, "Rounded Parameter" },
196 { 0x39, 0x00, "Saving Parameters Not Supported" },
197 { 0x3A, 0x00, "Medium Not Present" },
198 { 0x3B, 0x00, "Positioning Error" },
199 { 0x3B, 0x01, "Tape Position Error At Beginning-of-Medium" },
200 { 0x3B, 0x02, "Tape Position Error At End-of-Medium" },
201 { 0x3B, 0x03, "Tape or Electronic Vertical Forms Unit Not Ready" },
202 { 0x3B, 0x04, "Slew Failure" },
203 { 0x3B, 0x05, "Paper Jam" },
204 { 0x3B, 0x06, "Failed To Sense Top-Of-Form" },
205 { 0x3B, 0x07, "Failed To Sense Bottom-Of-Form" },
206 { 0x3B, 0x08, "Reposition Error" },
207 { 0x3B, 0x09, "Read Past End Of Medium" },
208 { 0x3B, 0x0A, "Read Past Begining Of Medium" },
209 { 0x3B, 0x0B, "Position Past End Of Medium" },
210 { 0x3B, 0x0C, "Position Past Beginning Of Medium" },
211 { 0x3B, 0x0D, "Medium Destination Element Full" },
212 { 0x3B, 0x0E, "Medium Source Element Empty" },
213 { 0x3D, 0x00, "Invalid Bits In IDENTFY Message" },
214 { 0x3E, 0x00, "Logical Unit Has Not Self-Configured Yet" },
215 { 0x3F, 0x00, "Target Operating Conditions Have Changed" },
216 { 0x3F, 0x01, "Microcode Has Changed" },
217 { 0x3F, 0x02, "Changed Operating Definition" },
218 { 0x3F, 0x03, "INQUIRY Data Has Changed" },
219 { 0x40, 0x00, "RAM FAILURE (Should Use 40 NN)" },
220 { 0x41, 0x00, "Data Path FAILURE (Should Use 40 NN)" },
221 { 0x42, 0x00, "Power-On or Self-Test FAILURE (Should Use 40 NN)" },
222 { 0x43, 0x00, "Message Error" },
223 { 0x44, 0x00, "Internal Target Failure" },
224 { 0x45, 0x00, "Select Or Reselect Failure" },
225 { 0x46, 0x00, "Unsuccessful Soft Reset" },
226 { 0x47, 0x00, "SCSI Parity Error" },
227 { 0x48, 0x00, "INITIATOR DETECTED ERROR Message Received" },
228 { 0x49, 0x00, "Invalid Message Error" },
229 { 0x4A, 0x00, "Command Phase Error" },
230 { 0x4B, 0x00, "Data Phase Error" },
231 { 0x4C, 0x00, "Logical Unit Failed Self-Configuration" },
232 { 0x4E, 0x00, "Overlapped Commands Attempted" },
233 { 0x50, 0x00, "Write Append Error" },
234 { 0x50, 0x01, "Write Append Position Error" },
235 { 0x50, 0x01, "Write Append Position Error" },
236 { 0x50, 0x02, "Position Error Related To Timing" },
237 { 0x51, 0x00, "Erase Failure" },
238 { 0x52, 0x00, "Cartridge Fault" },
239 { 0x53, 0x00, "Media Load or Eject Failed" },
240 { 0x53, 0x01, "Unload Tape Failure" },
241 { 0x53, 0x02, "Medium Removal Prevented" },
242 { 0x54, 0x00, "SCSI To Host System Interface Failure" },
243 { 0x55, 0x00, "System Resource Failure" },
244 { 0x57, 0x00, "Unable To Recover Table-Of-Contents" },
245 { 0x58, 0x00, "Generation Does Not Exist" },
246 { 0x59, 0x00, "Updated Block Read" },
247 { 0x5A, 0x00, "Operator Request or State Change Input (Unspecified)" },
248 { 0x5A, 0x01, "Operator Medium Removal Requested" },
249 { 0x5A, 0x02, "Operator Selected Write Protect" },
250 { 0x5A, 0x03, "Operator Selected Write Permit" },
251 { 0x5B, 0x00, "Log Exception" },
252 { 0x5B, 0x01, "Threshold Condition Met" },
253 { 0x5B, 0x02, "Log Counter At Maximum" },
254 { 0x5B, 0x03, "Log List Codes Exhausted" },
255 { 0x5C, 0x00, "RPL Status Change" },
256 { 0x5C, 0x01, "Spindles Synchronized" },
257 { 0x5C, 0x02, "Spindles Not Synchronized" },
258 { 0x60, 0x00, "Lamp Failure" },
259 { 0x61, 0x00, "Video Acquisition Error" },
260 { 0x61, 0x01, "Unable To Acquire Video" },
261 { 0x61, 0x02, "Out Of Focus" },
262 { 0x62, 0x00, "Scan Head Positioning Error" },
263 { 0x63, 0x00, "End Of User Area Encountered On This Track" },
264 { 0x64, 0x00, "Illegal Mode For This Track" },
265 { 0x00, 0x00, NULL }
266 };
267
268 static __inline void asc2ascii __P((unsigned char, unsigned char, char *));
269
270 static __inline void
271 asc2ascii(asc, ascq, result)
272 unsigned char asc, ascq;
273 char *result;
274 {
275 register int i = 0;
276
277 while (adesc[i].description != NULL) {
278 if (adesc[i].asc == asc && adesc[i].ascq == ascq)
279 break;
280 i++;
281 }
282 if (adesc[i].description == NULL) {
283 if (asc == 0x40 && ascq != 0)
284 (void)sprintf(result,
285 "Diagnostic Failure on Component 0x%02x",
286 ascq & 0xff);
287 else
288 (void)sprintf(result, "ASC 0x%02x ASCQ 0x%02x",
289 asc & 0xff, ascq & 0xff);
290 } else
291 (void)strcpy(result, adesc[i].description);
292 }
293
294 void
295 scsi_print_sense_data(sense, verbosity)
296 struct scsipi_sense_data *sense;
297 int verbosity;
298 {
299 int32_t info;
300 register int i, j, k;
301 char *sbs, *s = (char *) sense;
302
303 /*
304 * Basics- print out SENSE KEY
305 */
306 printf(" SENSE KEY: %s", scsi_decode_sense(s, 0));
307
308 /*
309 * Print out, unqualified but aligned, FMK, EOM and ILI status.
310 */
311 if (s[2] & 0xe0) {
312 char pad;
313 printf("\n ");
314 pad = ' ';
315 if (s[2] & SSD_FILEMARK) {
316 printf("%c Filemark Detected", pad);
317 pad = ',';
318 }
319 if (s[2] & SSD_EOM) {
320 printf("%c EOM Detected", pad);
321 pad = ',';
322 }
323 if (s[2] & SSD_ILI)
324 printf("%c Incorrect Length Indicator Set", pad);
325 }
326
327 /*
328 * Now we should figure out, based upon device type, how
329 * to format the information field. Unfortunately, that's
330 * not convenient here, so we'll print it as a signed
331 * 32 bit integer.
332 */
333 info = _4btol(&s[3]);
334 if (info)
335 printf("\n INFO FIELD: %d", info);
336
337 /*
338 * Now we check additional length to see whether there is
339 * more information to extract.
340 */
341
342 /* enough for command specific information? */
343 if (s[7] < 4) {
344 printf("\n");
345 return;
346 }
347 info = _4btol(&s[8]);
348 if (info)
349 printf("\n COMMAND INFO: %d (0x%x)", info, info);
350
351 /*
352 * Decode ASC && ASCQ info, plus FRU, plus the rest...
353 */
354
355 sbs = scsi_decode_sense(s, 1);
356 if (sbs)
357 printf("\n ASC/ASCQ: %s", sbs);
358 if (s[14] != 0)
359 printf("\n FRU CODE: 0x%x", s[14] & 0xff);
360 sbs = scsi_decode_sense(s, 3);
361 if (sbs)
362 printf("\n SKSV: %s", sbs);
363 printf("\n");
364 if (verbosity == 0) {
365 printf("\n");
366 return;
367 }
368
369 /*
370 * Now figure whether we should print any additional informtion.
371 *
372 * Where should we start from? If we had SKSV data,
373 * start from offset 18, else from offset 15.
374 *
375 * From that point until the end of the buffer, check for any
376 * nonzero data. If we have some, go back and print the lot,
377 * otherwise we're done.
378 */
379 if (sbs)
380 i = 18;
381 else
382 i = 15;
383 for (j = i; j < sizeof (*sense); j++)
384 if (s[j])
385 break;
386 if (j == sizeof (*sense))
387 return;
388
389 printf("\n Additional Sense Information (byte %d out...):\n", i);
390 if (i == 15) {
391 printf("\n\t%2d:", i);
392 k = 7;
393 } else {
394 printf("\n\t%2d:", i);
395 k = 2;
396 j -= 2;
397 }
398 while (j > 0) {
399 if (i >= sizeof (*sense))
400 break;
401 if (k == 8) {
402 k = 0;
403 printf("\n\t%2d:", i);
404 }
405 printf(" 0x%02x", s[i] & 0xff);
406 k++;
407 j--;
408 i++;
409 }
410 printf("\n\n");
411 }
412
413 char *
414 scsi_decode_sense(sinfo, flag)
415 void *sinfo;
416 int flag;
417 {
418 unsigned char *snsbuf;
419 unsigned char skey;
420 static char rqsbuf[132];
421
422 skey = 0;
423
424 snsbuf = (unsigned char *) sinfo;
425 if (flag == 0 || flag == 2 || flag == 3)
426 skey = snsbuf[2] & 0xf;
427 if (flag == 0) { /* Sense Key Only */
428 (void) strcpy(rqsbuf, sense_keys[skey]);
429 return (rqsbuf);
430 } else if (flag == 1) { /* ASC/ASCQ Only */
431 asc2ascii(snsbuf[12], snsbuf[13], rqsbuf);
432 return (rqsbuf);
433 } else if (flag == 2) { /* Sense Key && ASC/ASCQ */
434 auto char localbuf[64];
435 asc2ascii(snsbuf[12], snsbuf[13], localbuf);
436 (void) sprintf(rqsbuf, "%s, %s", sense_keys[skey], localbuf);
437 return (rqsbuf);
438 } else if (flag == 3 && snsbuf[7] >= 9 && (snsbuf[15] & 0x80)) {
439 /*
440 * SKSV Data
441 */
442 switch (skey) {
443 case SKEY_ILLEGAL_REQUEST:
444 if (snsbuf[15] & 0x8)
445 (void)sprintf(rqsbuf,
446 "Error in %s, Offset %d, bit %d",
447 (snsbuf[15] & 0x40)? "CDB" : "Parameters",
448 (snsbuf[16] & 0xff) << 8 |
449 (snsbuf[17] & 0xff), snsbuf[15] & 0x7);
450 else
451 (void)sprintf(rqsbuf,
452 "Error in %s, Offset %d",
453 (snsbuf[15] & 0x40)? "CDB" : "Parameters",
454 (snsbuf[16] & 0xff) << 8 |
455 (snsbuf[17] & 0xff));
456 return (rqsbuf);
457 case SKEY_RECOVERABLE_ERROR:
458 case SKEY_MEDIUM_ERROR:
459 case SKEY_HARDWARE_ERROR:
460 (void)sprintf(rqsbuf, "Actual Retry Count: %d",
461 (snsbuf[16] & 0xff) << 8 | (snsbuf[17] & 0xff));
462 return (rqsbuf);
463 case SKEY_NOT_READY:
464 (void)sprintf(rqsbuf, "Progress Indicator: %d",
465 (snsbuf[16] & 0xff) << 8 | (snsbuf[17] & 0xff));
466 return (rqsbuf);
467 default:
468 break;
469 }
470 }
471 return (NULL);
472 }
473
474 void
475 scsi_print_sense(xs, verbosity)
476 struct scsipi_xfer *xs;
477 int verbosity;
478 {
479 int i, j;
480
481 xs->sc_link->sc_print_addr(xs->sc_link);
482 printf(" Check Condition on CDB: 0x%02x", xs->cmd->opcode);
483
484 switch (CDB_GROUPID(xs->cmd->opcode)) {
485 case CDB_GROUPID_0:
486 j = CDB_GROUP0;
487 break;
488 case CDB_GROUPID_1:
489 j = CDB_GROUP1;
490 break;
491 case CDB_GROUPID_2:
492 j = CDB_GROUP2;
493 break;
494 case CDB_GROUPID_3:
495 j = CDB_GROUP3;
496 break;
497 case CDB_GROUPID_4:
498 j = CDB_GROUP4;
499 break;
500 case CDB_GROUPID_5:
501 j = CDB_GROUP5;
502 break;
503 case CDB_GROUPID_6:
504 j = CDB_GROUP6;
505 break;
506 case CDB_GROUPID_7:
507 j = CDB_GROUP7;
508 break;
509 default:
510 j = 0;
511 }
512 if (j == 0)
513 j = sizeof (xs->cmd->bytes);
514 for (i = 0; i < j-1; i++) /* already done the opcode */
515 printf(" %02x", xs->cmd->bytes[i]);
516 printf("\n");
517 scsi_print_sense_data(&xs->sense.scsi_sense, verbosity);
518 }
519