Lines Matching refs:scmd
41 struct uscsi_cmd *scmd; in test_unit_ready() local
43 scmd = get_uscsi_cmd(); in test_unit_ready()
44 scmd->uscsi_flags = USCSI_SILENT; in test_unit_ready()
45 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in test_unit_ready()
47 scmd->uscsi_cdblen = 6; in test_unit_ready()
48 if ((uscsi_error = uscsi(fd, scmd)) < 0) in test_unit_ready()
56 struct uscsi_cmd *scmd; in inquiry() local
58 scmd = get_uscsi_cmd(); in inquiry()
59 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in inquiry()
60 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in inquiry()
61 scmd->uscsi_cdb[0] = INQUIRY_CMD; in inquiry()
62 scmd->uscsi_cdb[4] = INQUIRY_DATA_LENGTH; in inquiry()
63 scmd->uscsi_cdblen = 6; in inquiry()
64 scmd->uscsi_bufaddr = (char *)inq; in inquiry()
65 scmd->uscsi_buflen = INQUIRY_DATA_LENGTH; in inquiry()
66 if ((uscsi_error = uscsi(fd, scmd)) < 0) in inquiry()
74 struct uscsi_cmd *scmd; in read_capacity() local
76 scmd = get_uscsi_cmd(); in read_capacity()
77 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_capacity()
78 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_capacity()
79 scmd->uscsi_cdb[0] = READ_CAP_CMD; in read_capacity()
80 scmd->uscsi_cdblen = 10; in read_capacity()
81 scmd->uscsi_bufaddr = (char *)capbuf; in read_capacity()
82 scmd->uscsi_buflen = 8; in read_capacity()
83 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_capacity()
91 struct uscsi_cmd *scmd; in mode_sense() local
93 scmd = get_uscsi_cmd(); in mode_sense()
94 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in mode_sense()
95 scmd->uscsi_buflen = page_len; in mode_sense()
96 scmd->uscsi_bufaddr = (char *)buffer; in mode_sense()
97 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in mode_sense()
98 scmd->uscsi_cdblen = 0xa; in mode_sense()
99 scmd->uscsi_cdb[0] = MODE_SENSE_10_CMD; in mode_sense()
102 scmd->uscsi_cdb[1] = 0x8; in mode_sense()
105 scmd->uscsi_cdb[2] = pc; in mode_sense()
107 scmd->uscsi_cdb[7] = (page_len >> 8) & 0xff; in mode_sense()
108 scmd->uscsi_cdb[8] = page_len & 0xff; in mode_sense()
110 if ((uscsi_error = uscsi(fd, scmd)) < 0) in mode_sense()
118 struct uscsi_cmd *scmd; in mode_select() local
120 scmd = get_uscsi_cmd(); in mode_select()
121 scmd->uscsi_flags = USCSI_WRITE|USCSI_SILENT; in mode_select()
122 scmd->uscsi_buflen = page_len; in mode_select()
123 scmd->uscsi_bufaddr = (char *)buffer; in mode_select()
124 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in mode_select()
125 scmd->uscsi_cdblen = 0xa; in mode_select()
128 scmd->uscsi_cdb[0] = MODE_SELECT_10_CMD; in mode_select()
129 scmd->uscsi_cdb[1] = 0x10; in mode_select()
132 scmd->uscsi_cdb[7] = (page_len >> 8) & 0xff; in mode_select()
133 scmd->uscsi_cdb[8] = page_len & 0xff; in mode_select()
135 if ((uscsi_error = uscsi(fd, scmd)) < 0) in mode_select()
143 struct uscsi_cmd *scmd; in read_track_info() local
145 scmd = get_uscsi_cmd(); in read_track_info()
146 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_track_info()
147 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_track_info()
148 scmd->uscsi_cdb[0] = READ_TRACK_CMD; in read_track_info()
151 scmd->uscsi_cdb[1] = 1; in read_track_info()
156 ((uchar_t *)scmd->uscsi_cdb)[5] = 0xff; in read_track_info()
159 scmd->uscsi_cdb[1] = 0; in read_track_info()
160 ((uchar_t *)scmd->uscsi_cdb)[5] = 0; in read_track_info()
163 scmd->uscsi_cdb[5] = (uchar_t)trackno; in read_track_info()
165 scmd->uscsi_cdb[8] = TRACK_INFO_SIZE; in read_track_info()
166 scmd->uscsi_cdblen = 10; in read_track_info()
167 scmd->uscsi_bufaddr = (char *)ti; in read_track_info()
168 scmd->uscsi_buflen = TRACK_INFO_SIZE; in read_track_info()
169 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_track_info()
177 struct uscsi_cmd *scmd; in read_toc() local
179 scmd = get_uscsi_cmd(); in read_toc()
180 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_toc()
181 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_toc()
182 scmd->uscsi_cdb[0] = READ_TOC_CMD; in read_toc()
183 scmd->uscsi_cdb[2] = format & 0xf; in read_toc()
184 scmd->uscsi_cdb[6] = trackno; in read_toc()
185 scmd->uscsi_cdb[8] = buflen & 0xff; in read_toc()
186 scmd->uscsi_cdb[7] = (buflen >> 8) & 0xff; in read_toc()
187 scmd->uscsi_cdblen = 10; in read_toc()
188 scmd->uscsi_bufaddr = (char *)buf; in read_toc()
189 scmd->uscsi_buflen = buflen; in read_toc()
190 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_toc()
206 struct uscsi_cmd *scmd; in read_header() local
208 scmd = get_uscsi_cmd(); in read_header()
209 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_header()
210 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_header()
211 scmd->uscsi_cdb[0] = READ_HDR_CMD; in read_header()
214 load_scsi32(&scmd->uscsi_cdb[2], lba); in read_header()
217 scmd->uscsi_cdb[8] = 8; in read_header()
218 scmd->uscsi_cdblen = 10; in read_header()
219 scmd->uscsi_bufaddr = (char *)buf; in read_header()
220 scmd->uscsi_buflen = 8; in read_header()
221 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_header()
229 struct uscsi_cmd *scmd; in read_disc_info() local
231 scmd = get_uscsi_cmd(); in read_disc_info()
232 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_disc_info()
233 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_disc_info()
234 scmd->uscsi_cdb[0] = READ_INFO_CMD; in read_disc_info()
235 scmd->uscsi_cdb[8] = DISC_INFO_BLOCK_SIZE; in read_disc_info()
236 scmd->uscsi_cdblen = 10; in read_disc_info()
237 scmd->uscsi_bufaddr = (char *)di; in read_disc_info()
238 scmd->uscsi_buflen = DISC_INFO_BLOCK_SIZE; in read_disc_info()
239 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_disc_info()
248 struct uscsi_cmd *scmd; in get_configuration() local
250 scmd = get_uscsi_cmd(); in get_configuration()
251 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in get_configuration()
252 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in get_configuration()
255 scmd->uscsi_cdb[0] = GET_CONFIG_CMD; in get_configuration()
261 scmd->uscsi_cdb[1] = 0x2; in get_configuration()
264 scmd->uscsi_cdb[2] = (feature >> 8) & 0xff; in get_configuration()
265 scmd->uscsi_cdb[3] = feature & 0xff; in get_configuration()
268 scmd->uscsi_cdb[7] = (bufsize >> 8) & 0xff; in get_configuration()
269 scmd->uscsi_cdb[8] = bufsize & 0xff; in get_configuration()
271 scmd->uscsi_cdblen = 10; in get_configuration()
272 scmd->uscsi_bufaddr = (char *)buf; in get_configuration()
273 scmd->uscsi_buflen = bufsize; in get_configuration()
274 if ((uscsi_error = uscsi(fd, scmd)) < 0) in get_configuration()
283 struct uscsi_cmd *scmd; in read10() local
285 scmd = get_uscsi_cmd(); in read10()
286 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read10()
287 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read10()
288 scmd->uscsi_cdb[0] = READ_10_CMD; in read10()
289 load_scsi32(&scmd->uscsi_cdb[2], start_blk); in read10()
290 scmd->uscsi_cdb[8] = nblk & 0xff; in read10()
291 scmd->uscsi_cdb[7] = (nblk >> 8) & 0xff; in read10()
292 scmd->uscsi_cdblen = 10; in read10()
293 scmd->uscsi_bufaddr = (char *)buf; in read10()
294 scmd->uscsi_buflen = bufsize; in read10()
295 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read10()
304 struct uscsi_cmd *scmd; in write10() local
306 scmd = get_uscsi_cmd(); in write10()
307 scmd->uscsi_flags = USCSI_WRITE|USCSI_SILENT; in write10()
313 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT * 3; in write10()
314 scmd->uscsi_cdb[0] = WRITE_10_CMD; in write10()
315 load_scsi32(&scmd->uscsi_cdb[2], start_blk); in write10()
316 scmd->uscsi_cdb[8] = nblk & 0xff; in write10()
317 scmd->uscsi_cdb[7] = (nblk >> 8) & 0xff; in write10()
318 scmd->uscsi_cdblen = 10; in write10()
319 scmd->uscsi_bufaddr = (char *)buf; in write10()
320 scmd->uscsi_buflen = bufsize; in write10()
321 if ((uscsi_error = uscsi(fd, scmd)) < 0) in write10()
329 struct uscsi_cmd *scmd; in close_track() local
331 scmd = get_uscsi_cmd(); in close_track()
332 scmd->uscsi_flags = USCSI_SILENT; in close_track()
333 scmd->uscsi_cdb[0] = CLOSE_TRACK_CMD; in close_track()
335 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in close_track()
336 scmd->uscsi_cdb[1] = 1; in close_track()
338 scmd->uscsi_timeout = 240; in close_track()
343 scmd->uscsi_cdb[2] = 2; in close_track()
347 scmd->uscsi_cdb[2] = 1; in close_track()
348 scmd->uscsi_cdb[5] = trackno & 0xff; in close_track()
357 scmd->uscsi_cdb[5] = 1; /* only 1 track */ in close_track()
360 scmd->uscsi_cdb[2] = 6; /* session */ in close_track()
362 scmd->uscsi_cdb[2] = 1; /* track */ in close_track()
366 scmd->uscsi_cdblen = 10; in close_track()
367 if ((uscsi_error = uscsi(fd, scmd)) < 0) in close_track()
375 struct uscsi_cmd *scmd; in blank_disc() local
377 scmd = get_uscsi_cmd(); in blank_disc()
378 scmd->uscsi_flags = USCSI_SILENT; in blank_disc()
381 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in blank_disc()
382 scmd->uscsi_cdb[1] = 0x10; in blank_disc()
384 scmd->uscsi_timeout = 0x12c0; in blank_disc()
386 ((uchar_t *)scmd->uscsi_cdb)[0] = BLANK_CMD; in blank_disc()
389 scmd->uscsi_cdb[1] |= type & 0x07; in blank_disc()
390 scmd->uscsi_cdblen = 12; in blank_disc()
392 if ((uscsi_error = uscsi(fd, scmd)) < 0) in blank_disc()
401 struct uscsi_cmd *scmd; in read_cd() local
403 scmd = get_uscsi_cmd(); in read_cd()
404 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_cd()
405 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_cd()
406 ((uchar_t *)scmd->uscsi_cdb)[0] = READ_CD_CMD; in read_cd()
407 scmd->uscsi_cdb[1] = (sector_type & 0x7) << 2; in read_cd()
408 scmd->uscsi_cdb[5] = start_blk & 0xff; in read_cd()
409 scmd->uscsi_cdb[4] = (start_blk >> 8) & 0xff; in read_cd()
410 scmd->uscsi_cdb[3] = (start_blk >> 16) & 0xff; in read_cd()
411 scmd->uscsi_cdb[2] = (start_blk >> 24) & 0xff; in read_cd()
412 scmd->uscsi_cdb[8] = nblk & 0xff; in read_cd()
413 scmd->uscsi_cdb[7] = (nblk >> 8) & 0xff; in read_cd()
414 scmd->uscsi_cdb[9] = 0x10; in read_cd()
415 scmd->uscsi_cdblen = 12; in read_cd()
416 scmd->uscsi_bufaddr = (char *)buf; in read_cd()
417 scmd->uscsi_buflen = bufsize; in read_cd()
418 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_cd()
426 struct uscsi_cmd *scmd; in load_unload() local
428 scmd = get_uscsi_cmd(); in load_unload()
429 scmd->uscsi_flags = USCSI_SILENT; in load_unload()
430 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in load_unload()
431 scmd->uscsi_cdb[0] = START_STOP_CMD; in load_unload()
434 scmd->uscsi_cdb[4] = 2; in load_unload()
437 scmd->uscsi_cdb[4] = 3; in load_unload()
439 scmd->uscsi_cdblen = 6; in load_unload()
441 if ((uscsi_error = uscsi(fd, scmd)) < 0) in load_unload()
449 struct uscsi_cmd *scmd; in prevent_allow_mr() local
451 scmd = get_uscsi_cmd(); in prevent_allow_mr()
452 scmd->uscsi_flags = USCSI_SILENT; in prevent_allow_mr()
453 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in prevent_allow_mr()
454 scmd->uscsi_cdb[0] = PREVENT_ALLOW_CMD; in prevent_allow_mr()
456 scmd->uscsi_cdb[4] = 1; in prevent_allow_mr()
458 scmd->uscsi_cdblen = 6; in prevent_allow_mr()
459 if ((uscsi_error = uscsi(fd, scmd)) < 0) in prevent_allow_mr()
467 struct uscsi_cmd *scmd; in set_cd_speed() local
469 scmd = get_uscsi_cmd(); in set_cd_speed()
470 scmd->uscsi_flags = USCSI_SILENT; in set_cd_speed()
471 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in set_cd_speed()
472 scmd->uscsi_cdblen = 0xc; in set_cd_speed()
473 ((uchar_t *)scmd->uscsi_cdb)[0] = SET_CD_SPEED; in set_cd_speed()
474 scmd->uscsi_cdb[2] = (read_speed >> 8) & 0xff; in set_cd_speed()
475 scmd->uscsi_cdb[3] = read_speed & 0xff; in set_cd_speed()
476 scmd->uscsi_cdb[4] = (write_speed >> 8) & 0xff; in set_cd_speed()
477 scmd->uscsi_cdb[5] = write_speed & 0xff; in set_cd_speed()
479 if ((uscsi_error = uscsi(fd, scmd)) < 0) in set_cd_speed()
487 struct uscsi_cmd *scmd; in get_performance() local
489 scmd = get_uscsi_cmd(); in get_performance()
490 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in get_performance()
491 scmd->uscsi_buflen = GET_PERF_DATA_LEN; in get_performance()
492 scmd->uscsi_bufaddr = (char *)perf; in get_performance()
493 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in get_performance()
494 scmd->uscsi_cdblen = 0xc; in get_performance()
495 ((uchar_t *)scmd->uscsi_cdb)[0] = GET_PERFORMANCE_CMD; in get_performance()
496 scmd->uscsi_cdb[1] = 0x10; in get_performance()
498 scmd->uscsi_cdb[1] |= 4; in get_performance()
499 scmd->uscsi_cdb[9] = 2; in get_performance()
500 if ((uscsi_error = uscsi(fd, scmd)) < 0) in get_performance()
508 struct uscsi_cmd *scmd; in set_streaming() local
510 scmd = get_uscsi_cmd(); in set_streaming()
511 scmd->uscsi_flags = USCSI_WRITE|USCSI_SILENT; in set_streaming()
512 scmd->uscsi_buflen = SET_STREAM_DATA_LEN; in set_streaming()
513 scmd->uscsi_bufaddr = (char *)buf; in set_streaming()
514 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in set_streaming()
515 scmd->uscsi_cdblen = 0xc; in set_streaming()
516 ((uchar_t *)scmd->uscsi_cdb)[0] = STREAM_CMD; in set_streaming()
517 scmd->uscsi_cdb[10] = SET_STREAM_DATA_LEN; in set_streaming()
518 if ((uscsi_error = uscsi(fd, scmd)) < 0) in set_streaming()
526 struct uscsi_cmd *scmd; in rezero_unit() local
528 scmd = get_uscsi_cmd(); in rezero_unit()
529 scmd->uscsi_flags = USCSI_SILENT; in rezero_unit()
530 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in rezero_unit()
531 scmd->uscsi_cdblen = 0x6; in rezero_unit()
532 scmd->uscsi_cdb[0] = REZERO_UNIT_CMD; in rezero_unit()
533 if ((uscsi_error = uscsi(fd, scmd)) < 0) in rezero_unit()
541 struct uscsi_cmd *scmd; in start_stop() local
543 scmd = get_uscsi_cmd(); in start_stop()
544 scmd->uscsi_flags = USCSI_SILENT; in start_stop()
545 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in start_stop()
546 scmd->uscsi_cdblen = 0x6; in start_stop()
547 scmd->uscsi_cdb[0] = START_STOP_CMD; in start_stop()
549 scmd->uscsi_cdb[4] = 1; in start_stop()
551 if ((uscsi_error = uscsi(fd, scmd)) < 0) in start_stop()
559 struct uscsi_cmd *scmd; in flush_cache() local
561 scmd = get_uscsi_cmd(); in flush_cache()
562 scmd->uscsi_flags = USCSI_SILENT; in flush_cache()
563 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in flush_cache()
564 scmd->uscsi_cdblen = 10; in flush_cache()
565 scmd->uscsi_cdb[0] = SYNC_CACHE_CMD; in flush_cache()
567 scmd->uscsi_cdb[1] = 0x2; /* Immediate */ in flush_cache()
570 if ((uscsi_error = uscsi(fd, scmd)) < 0) in flush_cache()
582 struct uscsi_cmd *scmd; in set_reservation() local
584 scmd = get_uscsi_cmd(); in set_reservation()
585 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in set_reservation()
586 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in set_reservation()
587 scmd->uscsi_cdb[0] = SET_RESERVATION_CMD; in set_reservation()
588 scmd->uscsi_cdblen = 10; in set_reservation()
589 scmd->uscsi_cdb[5] = (uchar_t)(size >> 24); in set_reservation()
590 scmd->uscsi_cdb[6] = (uchar_t)(size >> 16); in set_reservation()
591 scmd->uscsi_cdb[7] = (uchar_t)(size >> 8); in set_reservation()
592 scmd->uscsi_cdb[8] = (uchar_t)size; in set_reservation()
593 if ((uscsi_error = uscsi(fd, scmd)) < 0) in set_reservation()
606 struct uscsi_cmd *scmd; in format_media() local
610 scmd = get_uscsi_cmd(); in format_media()
611 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in format_media()
612 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in format_media()
614 scmd->uscsi_cdblen = 12; in format_media()
615 scmd->uscsi_cdb[0] = READ_FORMAT_CAP_CMD; in format_media()
616 scmd->uscsi_cdb[8] = 0x14; /* buffer length */ in format_media()
617 scmd->uscsi_buflen = 20; in format_media()
618 scmd->uscsi_bufaddr = (char *)buf; in format_media()
620 if ((uscsi_error = uscsi(fd, scmd)) < 0) in format_media()
625 scmd->uscsi_flags = USCSI_WRITE|USCSI_SILENT; in format_media()
626 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in format_media()
627 scmd->uscsi_cdblen = 6; in format_media()
628 scmd->uscsi_cdb[0] = FORMAT_UNIT_CMD; in format_media()
630 scmd->uscsi_cdb[1] = 0x11; in format_media()
631 scmd->uscsi_buflen = 12; in format_media()
637 if ((uscsi_error = uscsi(fd, scmd)) < 0) in format_media()
650 struct uscsi_cmd *scmd; in read_format_capacity() local
654 scmd = get_uscsi_cmd(); in read_format_capacity()
655 scmd->uscsi_flags = USCSI_READ|USCSI_SILENT; in read_format_capacity()
656 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in read_format_capacity()
657 scmd->uscsi_cdblen = 12; in read_format_capacity()
658 scmd->uscsi_cdb[0] = READ_FORMAT_CAP_CMD; in read_format_capacity()
659 scmd->uscsi_cdb[8] = 0x14; in read_format_capacity()
660 scmd->uscsi_buflen = 20; in read_format_capacity()
661 scmd->uscsi_bufaddr = buf; in read_format_capacity()
663 if ((uscsi_error = uscsi(fd, scmd)) < 0) in read_format_capacity()
685 struct uscsi_cmd *scmd; in reset_dev() local
693 scmd = get_uscsi_cmd(); in reset_dev()
696 scmd->uscsi_flags = USCSI_SILENT | USCSI_RESET; in reset_dev()
698 scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT; in reset_dev()
699 scmd->uscsi_cdblen = 6; in reset_dev()
702 uscsi_error = uscsi(fd, scmd); in reset_dev()