-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathscsilib-solaris.c
726 lines (673 loc) · 20.1 KB
/
scsilib-solaris.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
/****************************************************************************
* *
* COPYRIGHT (c) 2006 - 2021 *
* This Software Provided *
* By *
* Robin's Nest Software Inc. *
* *
* Permission to use, copy, modify, distribute and sell this software and *
* its documentation for any purpose and without fee is hereby granted, *
* provided that the above copyright notice appear in all copies and that *
* both that copyright notice and this permission notice appear in the *
* supporting documentation, and that the name of the author not be used *
* in advertising or publicity pertaining to distribution of the software *
* without specific, written prior permission. *
* *
* THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN *
* NO EVENT SHALL HE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL *
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR *
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS *
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF *
* THIS SOFTWARE. *
* *
****************************************************************************/
/*
* Module: scsilib-sx.c
* Author: Robin T. Miller
* Date: March 29th, 2005
*
* Description:
* This module contains the OS SCSI specific functions for Solaris.
*
* Modification History:
*
* August 26th, 2010 by Robin T. Miller
* When opening device, on EROFS errno, try opening read-only.
*
* April 8th, 2008 by Robin T. Miller.
* Add USCSI_DIAGNOSE to default flags for USCSI SPT request.
*
* August 14th, 2007 by Robin T. Miller.
* Added support for Solaris queue message type control flags.
*
* August 6th, 2007 by Robin T. Miller.
* Added OS open and close functions.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/scsi/impl/uscsi.h>
#include "dt.h"
//#include "libscsi.h"
/*
* Local Definitions:
*/
/*
* Forward Declarations:
*/
static void DumpScsiCmd(scsi_generic_t *sgp, struct uscsi_cmd *siop);
/*
* os_open_device() = Open Device.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the open() which is:
* 0 = Success or -1 = Failure
*/
int
os_open_device(scsi_generic_t *sgp)
{
int status = SUCCESS;
int oflags = (O_RDWR|O_NONBLOCK);
if (sgp->debug == True) {
Printf(sgp->opaque, "Opening device %s, open flags = %#o (%#x)...\n",
sgp->dsf, oflags, oflags);
}
if ( (sgp->fd = open(sgp->dsf, oflags)) < 0) {
if (errno == EROFS) {
int oflags = (O_RDONLY|O_NONBLOCK);
if (sgp->debug == True) {
Printf(sgp->opaque, "Opening device %s read-only, open flags = %#o (%#x)...\n",
sgp->dsf, oflags, oflags);
}
sgp->fd = open(sgp->dsf, oflags);
}
if (sgp->fd == INVALID_HANDLE_VALUE) {
if (sgp->errlog == True) {
os_perror(sgp->opaque, "open() of %s failed!", sgp->dsf);
}
status = FAILURE;
}
}
if ( (sgp->debug == True) && (sgp->fd != INVALID_HANDLE_VALUE) ) {
Printf(sgp->opaque, "Device %s successfully opened, fd = %d\n", sgp->dsf, sgp->fd);
}
return(status);
}
/*
* os_close_device() = Close Device.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the close() which is:
* 0 = Success or -1 = Failure
*/
int
os_close_device(scsi_generic_t *sgp)
{
int error;
if (sgp->debug == True) {
Printf(sgp->opaque, "Closing device %s, fd %d...\n", sgp->dsf, sgp->fd);
}
if ( (error = close(sgp->fd)) < 0) {
os_perror(sgp->opaque, "close() of %s failed", sgp->dsf);
}
sgp->fd = INVALID_HANDLE_VALUE;
return(error);
}
/*
* os_abort_task_set() - Send Abort Task Set.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_abort_task_set(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Abort Task Set is not supported!\n");
}
return(error);
}
/*
* os_clear_task_set() - Send Clear Task Set.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_clear_task_set(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Clear Task Set is not supported!\n");
}
return(error);
}
/*
* os_cold_target_reset() - Send a Cold Target Reset.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning (not supported), -1 = Failure
*/
int
os_cold_target_reset(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Cold Target Reset is not implemented!\n");
}
return(error);
}
/*
* os_warm_target_reset() - Send a Warm Target Reset.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_warm_target_reset(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Warm Target Reset is not implemented!\n");
}
return(error);
}
/*
* os_reset_bus() - Reset the SCSI Bus (All targets and LUNs).
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning (not supported), -1 = Failure
*/
int
os_reset_bus(scsi_generic_t *sgp)
{
int error = WARNING;
unsigned char inquiry_data[36];
error = Inquiry(sgp->fd, sgp->dsf, sgp->debug, sgp->errlog, NULL, NULL,
inquiry_data, sizeof(inquiry_data), 0,
USCSI_RESET_ALL, sgp->timeout);
return(error);
}
/*
* os_reset_ctlr() - Reset the Controller.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning (not supported), -1 = Failure
*/
int
os_reset_ctlr(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "SCSI reset controller is not supported!\n");
}
return(error);
}
/*
* os_reset_device() - Reset the SCSI Device (including all LUNs).
*
* Note: A device reset is also known as a Bus Device Reset (BDR).
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning (not supported), -1 = Failure
*/
int
os_reset_device(scsi_generic_t *sgp)
{
int error = WARNING;
unsigned char inquiry_data[36];
error = Inquiry(sgp->fd, sgp->dsf, sgp->debug, sgp->errlog, NULL, NULL,
inquiry_data, sizeof(inquiry_data), 0,
USCSI_RESET, sgp->timeout);
return(error);
}
/*
* os_reset_lun() - Reset the SCSI LUN (Logical Unit only).
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_reset_lun(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "SCSI reset lun is not supported!\n");
}
return(error);
}
/*
* os_scan() - Scan For Devices.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_scan(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Scan for devices is not implemented!\n");
}
return(error);
}
/*
* os_resumeio() - Resume I/O to a Suspended Disk.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_resumeio(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Resume I/O is not implemented!\n");
}
return(error);
}
/*
* os_suspendio() - Suspend I/O to This Disk.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_suspendio(scsi_generic_t *sgp)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Suspend I/O is not implemented!\n");
}
return(error);
}
/*
* os_get_timeout() - Get Device Timeout.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
* timeout= Pointer to store the timeout value.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_get_timeout(scsi_generic_t *sgp, unsigned int *timeout)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Get timeout is not implemented!\n");
}
return(error);
}
/*
* os_set_timeout() - Set the Device Timeout.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
* timeout= The timeout value to set.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_set_timeout(scsi_generic_t *sgp, unsigned timeout)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Set timeout is not implemented!\n");
}
return(error);
}
/*
* os_get_qdepth() - Get the Device Queue Depth.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
* qdepth = Pointer to store the queue depth value.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_get_qdepth(scsi_generic_t *sgp, unsigned int *qdepth)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Get queue depth is not implemented!\n");
}
return(error);
}
/*
* os_set_qdepth() - Set the Device Queue Depth.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
* qdepth = The queue depth value to set.
*
* Return Value:
* Returns the status from the IOCTL request which is:
* 0 = Success, 1 = Warning, -1 = Failure
*/
int
os_set_qdepth(scsi_generic_t *sgp, unsigned int qdepth)
{
int error = WARNING;
if (sgp->errlog == True) {
Printf(sgp->opaque, "Set queue depth is not implemented!\n");
}
return(error);
}
/*
* os_spt() - OS Specific SCSI Pass-Through (spt).
*
* Description:
* This function takes a high level SCSI command, converts it
* into the format necessary for this OS, then executes it and
* returns an OS independent format to the caller.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the SCSI request which is:
* 0 = Success, -1 = Failure
*/
int
os_spt(scsi_generic_t *sgp)
{
struct uscsi_cmd scsicmd;
struct uscsi_cmd *siop = &scsicmd;
int error;
memset(siop, 0, sizeof(*siop));
siop->uscsi_flags = (sgp->sflags | USCSI_DIAGNOSE | USCSI_RQENABLE);
siop->uscsi_cdb = sgp->cdb;
siop->uscsi_cdblen = sgp->cdb_size;
siop->uscsi_bufaddr = sgp->data_buffer;
siop->uscsi_buflen = sgp->data_length;
siop->uscsi_rqbuf = sgp->sense_data;
siop->uscsi_rqlen = sgp->sense_length;
/*
* Setup the data direction:
*/
if (sgp->data_dir == scsi_data_none) {
; /* No data to be transferred. */
} else if (sgp->data_dir == scsi_data_read) {
siop->uscsi_flags |= USCSI_READ; /* Reading data from the device. */
} else { /* (sgp->data_dir == scsi_data_write) */
siop->uscsi_flags |= USCSI_WRITE; /* Writing data to the device. */
}
siop->uscsi_timeout = (sgp->timeout / MSECS); /* Timeout in seconds. */
if (siop->uscsi_timeout == 0) {
siop->uscsi_timeout++;
}
/*
* Setup (optional) transfer modes, etc.
*/
if (sgp->flags & SG_INIT_ASYNC) {
siop->uscsi_flags |= USCSI_ASYNC; /* Return bus to async mode. */
}
if (sgp->flags & SG_INIT_SYNC) {
siop->uscsi_flags |= USCSI_SYNC; /* Negotiate sync data transfers. */
}
#if defined(USCSI_RENEGOT)
if (sgp->flags & SG_INIT_WIDE) {
siop->uscsi_flags |= USCSI_RENEGOT; /* Renegotiate wide/sync data. */
}
#endif /* defined(USCSI_RENEGOT) */
if (sgp->qtag_type == SG_NO_Q) {
siop->uscsi_flags |= USCSI_NOTAG; /* Disable tagged queuing. */
} else if (sgp->qtag_type == SG_HEAD_OF_Q) {
siop->uscsi_flags |= USCSI_HTAG; /* Head of queue. */
} else if (sgp->qtag_type == SG_ORDERED_Q) {
siop->uscsi_flags |= USCSI_OTAG; /* Ordered queue. */
} else if (sgp->qtag_type == SG_HEAD_HA_Q) {
siop->uscsi_flags |= USCSI_HEAD; /* Head of HA queue. */
} else {
; /* Simple queuing must be the default. */
}
/*
* Finally, execute the SCSI command:
*/
error = ioctl(sgp->fd, USCSICMD, siop);
/*
* Handle errors, and send pertinent data back to the caller.
*/
if (error < 0) {
sgp->os_error = errno;
/*
* This OS returns failure on the IOCTL, even though the SPT data was
* valid, and the actual error is from the adapter or SCSI CDB, so we
* handle that difference here. Basically, we don't wish to log an
* IOCTL error, when it might be just a SCSI Check Condition.
*/
if (siop->uscsi_status != 0) { /* Assume a SCSI CDB failure! */
error = 0;
} else {
if (sgp->errlog == True) {
os_perror(sgp->opaque, "SCSI request (USCSICMD) failed on %s!", sgp->dsf);
}
sgp->error = True;
goto error;
}
}
if (siop->uscsi_status == SCSI_GOOD) {
sgp->error = False; /* Show SCSI command was successful. */
} else {
sgp->error = True; /* Tell caller we've had some sort of error. */
if ( (sgp->errlog == True) && (siop->uscsi_status != SCSI_CHECK_CONDITION) ) {
Fprintf(sgp->opaque, "%s failed, SCSI status = %d (%s)\n", sgp->cdb_name,
siop->uscsi_status, ScsiStatus(siop->uscsi_status));
}
}
if ( (siop->uscsi_status == SCSI_CHECK_CONDITION) &&
(siop->uscsi_rqstatus == SCSI_GOOD) ) {
sgp->sense_valid = True;
sgp->sense_resid = siop->uscsi_rqresid;
}
sgp->data_resid = siop->uscsi_resid;
/*
* Interesting, our resid can be greater than our data length if the CDB
* length is larger than the specified data length (at least on Linux).
* Note: This length mismatch caused an ABORT, but data is transferred!
*/
if (sgp->data_resid > sgp->data_length) {
sgp->data_transferred = sgp->data_length;
} else {
sgp->data_transferred = (sgp->data_length - sgp->data_resid);
}
sgp->scsi_status = siop->uscsi_status;
sgp->sense_status = siop->uscsi_rqstatus;
error:
if (sgp->debug == True) {
DumpScsiCmd(sgp, siop);
}
return(error);
}
/*
* os_is_retriable() - OS Specific Checks for Retriable Errors.
*
* Description:
* This OS specific function determines if the last SCSI request is a
* retriable error. Note: The checks performed here are those that are
* OS specific, such as looking a host, driver, or syscall errors that can
* be retried automatically, and/or to perform any OS specific recovery.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns the status from the SCSI request which is:
* 0 = False, 1 = True
*/
hbool_t
os_is_retriable(scsi_generic_t *sgp)
{
hbool_t is_retriable = False;
return (is_retriable);
}
static void
DumpScsiCmd(scsi_generic_t *sgp, struct uscsi_cmd *siop)
{
int i;
char buf[256];
char *bp = buf;
Printf(sgp->opaque, "SCSI I/O Structure:\n");
Printf(sgp->opaque, " Device Special File .............................: %s\n", sgp->dsf);
Printf(sgp->opaque, " File Descriptor .............................. fd: %d\n", sgp->fd);
/*
* Decode the SCSI flags.
*/
if (siop->uscsi_flags & USCSI_READ) {
bp += sprintf(bp, "USCSI_READ(%x)", USCSI_READ);
} else {
bp += sprintf(bp, "USCSI_WRITE(0)");
}
if (siop->uscsi_flags & USCSI_SILENT) {
bp += sprintf(bp, "|USCSI_SILENT(%x)", USCSI_SILENT);
}
if (siop->uscsi_flags & USCSI_DIAGNOSE) {
bp += sprintf(bp, "|USCSI_DIAGNOSE(%x)", USCSI_DIAGNOSE);
}
if (siop->uscsi_flags & USCSI_ISOLATE) {
bp += sprintf(bp, "|USCSI_ISOLATE(%x)", USCSI_ISOLATE);
}
if (siop->uscsi_flags & USCSI_RESET) {
bp += sprintf(bp, "|USCSI_RESET(%x)", USCSI_RESET);
}
if (siop->uscsi_flags & USCSI_RESET_ALL) {
bp += sprintf(bp, "|USCSI_RESET_ALL(%x)", USCSI_RESET_ALL);
}
if (siop->uscsi_flags & USCSI_RQENABLE) {
bp += sprintf(bp, "|USCSI_RQENABLE(%x)", USCSI_RQENABLE);
}
#if defined(USCSI_RENEGOT)
if (siop->uscsi_flags & USCSI_RENEGOT) {
bp += sprintf(bp, "|USCSI_RENEGOT(%x)", USCSI_RENEGOT);
}
#endif /* defined(USCSI_RENEGOT) */
if (siop->uscsi_flags & USCSI_NOTAG) {
bp += sprintf(bp, "|USCSI_NOTAG(%x)", USCSI_NOTAG);
}
if (siop->uscsi_flags & USCSI_OTAG) {
bp += sprintf(bp, "|USCSI_OTAG(%x)", USCSI_OTAG);
}
if (siop->uscsi_flags & USCSI_HTAG) {
bp += sprintf(bp, "|USCSI_HTAG(%x)", USCSI_HTAG);
}
if (siop->uscsi_flags & USCSI_NOTAG) {
bp += sprintf(bp, "|USCSI_HEAD(%x)", USCSI_HEAD);
}
Printf(sgp->opaque, " Control Flags ....................... uscsi_flags: %#x = %s\n",
siop->uscsi_flags, buf);
Printf(sgp->opaque, " SCSI Result Status ................. uscsi_status: %#x (%s)\n",
siop->uscsi_status, ScsiStatus(siop->uscsi_status));
Printf(sgp->opaque, " Command Timeout ................... uscsi_timeout: %d seconds\n", siop->uscsi_timeout);
for (bp = buf, i = 0; (i < siop->uscsi_cdblen); i++) {
bp += sprintf(bp, "%x ", (unsigned char)siop->uscsi_cdb[i]);
}
Printf(sgp->opaque, " Command Descriptor Block .............. uscsi_cdb: %s(%s)\n", buf, sgp->cdb_name);
Printf(sgp->opaque, " CDB Length ......................... uscsi_cdblen: %u\n", siop->uscsi_cdblen);
Printf(sgp->opaque, " I/O Buffer Address ................ uscsi_bufaddr: %#lx\n", siop->uscsi_bufaddr);
Printf(sgp->opaque, " I/O Buffer Length .................. uscsi_buflen: %u (%#x)\n",
siop->uscsi_buflen, siop->uscsi_buflen);
Printf(sgp->opaque, " I/O Residual Count .................. uscsi_resid: %u (%#x)\n",
siop->uscsi_resid, siop->uscsi_resid);
Printf(sgp->opaque, " Request Sense Buffer ................ uscsi_rqbuf: %#lx\n", siop->uscsi_rqbuf);
Printf(sgp->opaque, " Request Sense Length ................ uscsi_rqlen: %u (%#x)\n",
siop->uscsi_rqlen, siop->uscsi_rqlen);
Printf(sgp->opaque, " Request Sense Status ............. uscsi_rqstatus: %#x (%s)\n",
siop->uscsi_rqstatus, ScsiStatus(siop->uscsi_rqstatus));
Printf(sgp->opaque, "\n");
}
/*
* os_host_status_msg() - Get the Host Status Message.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns host status message or NULL if not found or unsupported.
*/
char *
os_host_status_msg(scsi_generic_t *sgp)
{
return(NULL);
}
/*
* os_driver_status_msg() - Get the Driver Status Message.
*
* Inputs:
* sgp = Pointer to the SCSI generic data structure.
*
* Return Value:
* Returns driver status message or NULL if not found or unsupported.
*/
char *
os_driver_status_msg(scsi_generic_t *sgp)
{
return(NULL);
}