17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 536c5fee3Smcneal * Common Development and Distribution License (the "License"). 636c5fee3Smcneal * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 2136c5fee3Smcneal 227c478bd9Sstevel@tonic-gate /* 2336c5fee3Smcneal * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_SCSI_GENERIC_COMMANDS_H 287c478bd9Sstevel@tonic-gate #define _SYS_SCSI_GENERIC_COMMANDS_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* 377c478bd9Sstevel@tonic-gate * Standard SCSI Command Definitions 387c478bd9Sstevel@tonic-gate * 397c478bd9Sstevel@tonic-gate * Macros to determine known command sizes 407c478bd9Sstevel@tonic-gate */ 417c478bd9Sstevel@tonic-gate #define CDB_GROUPID(cmd) ((cmd >> 5) & 0x7) 427c478bd9Sstevel@tonic-gate #define CDB_GROUPID_0 0 437c478bd9Sstevel@tonic-gate #define CDB_GROUPID_1 1 447c478bd9Sstevel@tonic-gate #define CDB_GROUPID_2 2 457c478bd9Sstevel@tonic-gate #define CDB_GROUPID_3 3 467c478bd9Sstevel@tonic-gate #define CDB_GROUPID_4 4 477c478bd9Sstevel@tonic-gate #define CDB_GROUPID_5 5 487c478bd9Sstevel@tonic-gate #define CDB_GROUPID_6 6 497c478bd9Sstevel@tonic-gate #define CDB_GROUPID_7 7 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate #define CDB_GROUP0 6 /* 6-byte cdb's */ 527c478bd9Sstevel@tonic-gate #define CDB_GROUP1 10 /* 10-byte cdb's */ 537c478bd9Sstevel@tonic-gate #define CDB_GROUP2 10 /* 10-byte cdb's */ 547c478bd9Sstevel@tonic-gate #define CDB_GROUP3 0 /* reserved */ 557c478bd9Sstevel@tonic-gate #define CDB_GROUP4 16 /* 16-byte cdb's */ 567c478bd9Sstevel@tonic-gate #define CDB_GROUP5 12 /* 12-byte cdb's */ 577c478bd9Sstevel@tonic-gate #define CDB_GROUP6 0 /* reserved */ 587c478bd9Sstevel@tonic-gate #define CDB_GROUP7 0 /* reserved */ 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* 617c478bd9Sstevel@tonic-gate * Generic Command Definitions 6230a83a24Scth * NOTE: CDROM commands are defined in cdio.h 637c478bd9Sstevel@tonic-gate */ 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate /* 667c478bd9Sstevel@tonic-gate * Group 0 Commands (CDB range 0x00 - 0x1F) 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate #define SCMD_GROUP0 0x00 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* 717c478bd9Sstevel@tonic-gate * Group 0 commands, All Devices 727c478bd9Sstevel@tonic-gate */ 737c478bd9Sstevel@tonic-gate #define SCMD_TEST_UNIT_READY 0x00 747c478bd9Sstevel@tonic-gate #define SCMD_REQUEST_SENSE 0x03 757c478bd9Sstevel@tonic-gate #define SCMD_INQUIRY 0x12 767c478bd9Sstevel@tonic-gate #define SCMD_COPY 0x18 777c478bd9Sstevel@tonic-gate #define SCMD_GDIAG 0x1C /* receive diagnostic results */ 787c478bd9Sstevel@tonic-gate #define SCMD_SDIAG 0x1D /* send diagnostic results */ 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate /* 817c478bd9Sstevel@tonic-gate * Group 0 commands, Direct Access Devices 827c478bd9Sstevel@tonic-gate */ 837c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 847c478bd9Sstevel@tonic-gate #define SCMD_REZERO_UNIT 0x01 857c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 867c478bd9Sstevel@tonic-gate #define SCMD_FORMAT 0x04 877c478bd9Sstevel@tonic-gate #define SCMD_REASSIGN_BLOCK 0x07 887c478bd9Sstevel@tonic-gate #define SCMD_READ 0x08 897c478bd9Sstevel@tonic-gate #define SCMD_WRITE 0x0a 907c478bd9Sstevel@tonic-gate #define SCMD_SEEK 0x0b 917c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 927c478bd9Sstevel@tonic-gate #define SCMD_MODE_SELECT 0x15 937c478bd9Sstevel@tonic-gate #define SCMD_RESERVE 0x16 947c478bd9Sstevel@tonic-gate #define SCMD_RELEASE 0x17 957c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 967c478bd9Sstevel@tonic-gate #define SCMD_MODE_SENSE 0x1a 977c478bd9Sstevel@tonic-gate #define SCMD_START_STOP 0x1b 987c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1C */ 997c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1D */ 1007c478bd9Sstevel@tonic-gate #define SCMD_DOORLOCK 0x1E /* Prevent/Allow Medium Removal */ 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate /* 1037c478bd9Sstevel@tonic-gate * Group 0 commands, Sequential Access Devices 1047c478bd9Sstevel@tonic-gate */ 1057c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 1067c478bd9Sstevel@tonic-gate #define SCMD_REWIND 0x01 /* Note similarity to SCMD_REZERO */ 1077c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 1087c478bd9Sstevel@tonic-gate #define SCMD_READ_BLKLIM 0x05 1097c478bd9Sstevel@tonic-gate /* SCMD_READ 0x08 */ 1107c478bd9Sstevel@tonic-gate /* SCMD_WRITE 0x0a */ 1117c478bd9Sstevel@tonic-gate #define SCMD_TRK_SEL 0x0b /* Note similarity to SCMD_SEEK */ 1127c478bd9Sstevel@tonic-gate #define SCMD_READ_REVERSE 0x0f 1137c478bd9Sstevel@tonic-gate #define SCMD_WRITE_FILE_MARK 0x10 1147c478bd9Sstevel@tonic-gate #define SCMD_SPACE 0x11 1157c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 1167c478bd9Sstevel@tonic-gate #define SCMD_VERIFY_G0 0x13 1177c478bd9Sstevel@tonic-gate #define SCMD_RECOVER_BUF 0x14 1187c478bd9Sstevel@tonic-gate /* SCMD_MODE_SELECT 0x15 */ 1197c478bd9Sstevel@tonic-gate /* SCMD_RESERVE 0x16 */ 1207c478bd9Sstevel@tonic-gate /* SCMD_RELEASE 0x17 */ 1217c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 1227c478bd9Sstevel@tonic-gate #define SCMD_ERASE 0x19 1237c478bd9Sstevel@tonic-gate /* SCMD_MODE_SENSE 0x1a */ 1247c478bd9Sstevel@tonic-gate #define SCMD_LOAD 0x1b /* Note similarity to SCMD_START_STOP */ 1257c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1c */ 1267c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1d */ 1277c478bd9Sstevel@tonic-gate /* SCMD_DOORLOCK 0x1e */ 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate /* 1317c478bd9Sstevel@tonic-gate * Group 0 commands, Printer Devices 1327c478bd9Sstevel@tonic-gate */ 1337c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 1347c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 1357c478bd9Sstevel@tonic-gate /* SCMD_FORMAT 0x04 */ 1367c478bd9Sstevel@tonic-gate #define SCMD_PRINT 0x0a /* Note similarity to SCMD_WRITE */ 1377c478bd9Sstevel@tonic-gate #define SCMD_SLEW_PRINT 0x0b /* ? similar to SCMD_SEEK ? */ 1387c478bd9Sstevel@tonic-gate #define SCMD_FLUSH_PRINT_BUF 0x10 /* ? similar to SCMD_WRITE_FILE_MARK */ 1397c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 1407c478bd9Sstevel@tonic-gate /* SCMD_RECOVER_BUF 0x14 */ 1417c478bd9Sstevel@tonic-gate /* SCMD_MODE_SELECT 0x15 */ 1427c478bd9Sstevel@tonic-gate /* SCMD_RESERVE 0x16 */ 1437c478bd9Sstevel@tonic-gate /* SCMD_RELEASE 0x17 */ 1447c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 1457c478bd9Sstevel@tonic-gate /* SCMD_MODE_SENSE 0x1a */ 1467c478bd9Sstevel@tonic-gate #define SCMD_STOP_PRINT 0x1b /* Note similarity to SCMD_START_STOP */ 1477c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1c */ 1487c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1d */ 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate /* 1517c478bd9Sstevel@tonic-gate * Group 0 commands, Processor Devices 1527c478bd9Sstevel@tonic-gate */ 1537c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 1547c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 1557c478bd9Sstevel@tonic-gate #define SCMD_RECEIVE 0x08 /* Note similarity to SCMD_READ */ 1567c478bd9Sstevel@tonic-gate #define SCMD_SEND 0x0a /* Note similarity to SCMD_WRITE */ 1577c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 1587c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 1597c478bd9Sstevel@tonic-gate /* SCMD_MODE_SENSE 0x1a */ 1607c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1c */ 1617c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1d */ 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate /* 1647c478bd9Sstevel@tonic-gate * Group 0 commands, WORM Devices 1657c478bd9Sstevel@tonic-gate */ 1667c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 1677c478bd9Sstevel@tonic-gate /* SCMD_REZERO_UNIT 0x01 */ 1687c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 1697c478bd9Sstevel@tonic-gate /* SCMD_REASSIGN_BLOCK 0x07 */ 1707c478bd9Sstevel@tonic-gate /* SCMD_READ 0x08 */ 1717c478bd9Sstevel@tonic-gate /* SCMD_WRITE 0x0a */ 1727c478bd9Sstevel@tonic-gate /* SCMD_SEEK 0x0b */ 1737c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 1747c478bd9Sstevel@tonic-gate /* SCMD_MODE_SELECT 0x15 */ 1757c478bd9Sstevel@tonic-gate /* SCMD_RESERVE 0x16 */ 1767c478bd9Sstevel@tonic-gate /* SCMD_RELEASE 0x17 */ 1777c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 1787c478bd9Sstevel@tonic-gate /* SCMD_MODE_SENSE 0x1a */ 1797c478bd9Sstevel@tonic-gate /* SCMD_START_STOP 0x1b */ 1807c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1C */ 1817c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1D */ 1827c478bd9Sstevel@tonic-gate /* SCMD_DOORLOCK 0x1E */ 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate /* 1857c478bd9Sstevel@tonic-gate * Group 0 commands, Read Only Devices 1867c478bd9Sstevel@tonic-gate */ 1877c478bd9Sstevel@tonic-gate /* SCMD_TEST_UNIT_READY 0x00 */ 1887c478bd9Sstevel@tonic-gate /* SCMD_REZERO_UNIT 0x01 */ 1897c478bd9Sstevel@tonic-gate /* SCMD_REQUEST_SENSE 0x03 */ 1907c478bd9Sstevel@tonic-gate /* SCMD_REASSIGN_BLOCK 0x07 */ 1917c478bd9Sstevel@tonic-gate /* SCMD_READ 0x08 */ 1927c478bd9Sstevel@tonic-gate /* SCMD_SEEK 0x0b */ 1937c478bd9Sstevel@tonic-gate /* SCMD_INQUIRY 0x12 */ 1947c478bd9Sstevel@tonic-gate /* SCMD_MODE_SELECT 0x15 */ 1957c478bd9Sstevel@tonic-gate /* SCMD_RESERVE 0x16 */ 1967c478bd9Sstevel@tonic-gate /* SCMD_RELEASE 0x17 */ 1977c478bd9Sstevel@tonic-gate /* SCMD_COPY 0x18 */ 1987c478bd9Sstevel@tonic-gate /* SCMD_MODE_SENSE 0x1a */ 1997c478bd9Sstevel@tonic-gate /* SCMD_START_STOP 0x1b */ 2007c478bd9Sstevel@tonic-gate /* SCMD_GDIAG 0x1C */ 2017c478bd9Sstevel@tonic-gate /* SCMD_SDIAG 0x1D */ 2027c478bd9Sstevel@tonic-gate /* SCMD_DOORLOCK 0x1E */ 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate /* 2057c478bd9Sstevel@tonic-gate * Group 1 Commands (CDB range 0x20 - 0x3F) 2067c478bd9Sstevel@tonic-gate */ 2077c478bd9Sstevel@tonic-gate #define SCMD_GROUP1 0x20 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate /* 2107c478bd9Sstevel@tonic-gate * Group 1 Commands, All Devices 2117c478bd9Sstevel@tonic-gate */ 2127c478bd9Sstevel@tonic-gate #define SCMD_COMPARE 0x39 2137c478bd9Sstevel@tonic-gate #define SCMD_COPY_VERIFY 0x3A 21430a83a24Scth #define SCMD_PERSISTENT_RESERVE_IN 0x5E 21530a83a24Scth #define SCMD_PERSISTENT_RESERVE_OUT 0x5F 21630a83a24Scth #define SCMD_PRIN SCMD_PERSISTENT_RESERVE_IN 21730a83a24Scth #define SCMD_PROUT SCMD_PERSISTENT_RESERVE_OUT 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate /* 2207c478bd9Sstevel@tonic-gate * Group 1 Commands, Direct Access Devices 2217c478bd9Sstevel@tonic-gate */ 2227c478bd9Sstevel@tonic-gate #define SCMD_READ_FORMAT_CAP 0x23 2237c478bd9Sstevel@tonic-gate #define SCMD_READ_CAPACITY 0x25 2247c478bd9Sstevel@tonic-gate #define SCMD_READ_G1 0x28 /* Note that only the group changed */ 2257c478bd9Sstevel@tonic-gate #define SCMD_WRITE_G1 0x2a /* Note that only the group changed */ 2267c478bd9Sstevel@tonic-gate #define SCMD_SEEK_G1 0x2b /* Note that only the group changed */ 2277c478bd9Sstevel@tonic-gate #define SCMD_WRITE_VERIFY 0x2e 2287c478bd9Sstevel@tonic-gate #define SCMD_VERIFY 0x2f 2297c478bd9Sstevel@tonic-gate #define SCMD_SEARCH_HIGH 0x30 2307c478bd9Sstevel@tonic-gate #define SCMD_SEARCH_EQUAL 0x31 2317c478bd9Sstevel@tonic-gate #define SCMD_SEARCH_LOW 0x32 2327c478bd9Sstevel@tonic-gate #define SCMD_SET_LIMITS 0x33 23330a83a24Scth #define SCMD_SYNCHRONIZE_CACHE 0x35 2347c478bd9Sstevel@tonic-gate #define SCMD_READ_DEFECT_LIST 0x37 2357c478bd9Sstevel@tonic-gate #define SCMD_WRITE_BUFFER 0x3B 2367c478bd9Sstevel@tonic-gate #define SCMD_READ_BUFFER 0x3c 2377c478bd9Sstevel@tonic-gate #define SCMD_READ_LONG 0x3E 2387c478bd9Sstevel@tonic-gate #define SCMD_WRITE_LONG 0x3F 2397c478bd9Sstevel@tonic-gate #define SCMD_RESERVE_G1 0x56 2407c478bd9Sstevel@tonic-gate #define SCMD_RELEASE_G1 0x57 2417c478bd9Sstevel@tonic-gate #define SCMD_MODE_SELECT_G1 0x55 2427c478bd9Sstevel@tonic-gate #define SCMD_MODE_SENSE_G1 0x5A 2437c478bd9Sstevel@tonic-gate #define SCMD_GET_CONFIGURATION 0x46 2447c478bd9Sstevel@tonic-gate #define SCMD_LOG_SELECT_G1 0x4C 2457c478bd9Sstevel@tonic-gate #define SCMD_LOG_SENSE_G1 0x4d 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate 2487c478bd9Sstevel@tonic-gate /* 2497c478bd9Sstevel@tonic-gate * Group 1 Commands, Sequential Access Devices 2507c478bd9Sstevel@tonic-gate */ 2517c478bd9Sstevel@tonic-gate #define SCMD_LOCATE 0x2B /* Note similarity to SCMD_SEEK_G1 */ 2527c478bd9Sstevel@tonic-gate #define SCMD_READ_POSITION 0x34 2537c478bd9Sstevel@tonic-gate #define SCMD_REPORT_DENSITIES 0x44 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate /* 2567c478bd9Sstevel@tonic-gate * Group 1 Commands, Printer Devices 2577c478bd9Sstevel@tonic-gate */ 2587c478bd9Sstevel@tonic-gate /* (None Defined) */ 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate /* 2617c478bd9Sstevel@tonic-gate * Group 1 Commands, Processor Devices 2627c478bd9Sstevel@tonic-gate */ 2637c478bd9Sstevel@tonic-gate /* (None Defined) */ 2647c478bd9Sstevel@tonic-gate 2657c478bd9Sstevel@tonic-gate /* 2667c478bd9Sstevel@tonic-gate * Group 1 Commands, WORM Devices 2677c478bd9Sstevel@tonic-gate */ 2687c478bd9Sstevel@tonic-gate /* SCMD_READ_CAPACITY 0x25 */ 2697c478bd9Sstevel@tonic-gate /* SCMD_READ_G1 0x28 */ 2707c478bd9Sstevel@tonic-gate /* SCMD_WRITE_G1 0x2a */ 2717c478bd9Sstevel@tonic-gate /* SCMD_SEEK_G1 0x2b */ 2727c478bd9Sstevel@tonic-gate /* SCMD_WRITE_VERIFY 0x2e */ 2737c478bd9Sstevel@tonic-gate /* SCMD_VERIFY 0x2f */ 2747c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_HIGH 0x30 */ 2757c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_EQUAL 0x31 */ 2767c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_LOW 0x32 */ 2777c478bd9Sstevel@tonic-gate /* SCMD_SET_LIMITS 0x33 */ 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate /* 2807c478bd9Sstevel@tonic-gate * Group 1 Commands, Read Only Devices 2817c478bd9Sstevel@tonic-gate */ 2827c478bd9Sstevel@tonic-gate /* SCMD_READ_CAPACITY 0x25 */ 2837c478bd9Sstevel@tonic-gate /* SCMD_READ_G1 0x28 */ 2847c478bd9Sstevel@tonic-gate /* SCMD_SEEK_G1 0x2b */ 2857c478bd9Sstevel@tonic-gate /* SCMD_VERIFY 0x2f */ 2867c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_HIGH 0x30 */ 2877c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_EQUAL 0x31 */ 2887c478bd9Sstevel@tonic-gate /* SCMD_SEARCH_LOW 0x32 */ 2897c478bd9Sstevel@tonic-gate /* SCMD_SET_LIMITS 0x33 */ 2907c478bd9Sstevel@tonic-gate 291305d694fStaylor /* 292305d694fStaylor * Group 3 Commands 293305d694fStaylor */ 294305d694fStaylor #define SCMD_VAR_LEN 0x7f 295305d694fStaylor 2967c478bd9Sstevel@tonic-gate /* 2977c478bd9Sstevel@tonic-gate * Group 4 Commands, All Devices 2987c478bd9Sstevel@tonic-gate */ 2997c478bd9Sstevel@tonic-gate #define SCMD_GROUP4 0x80 3007c478bd9Sstevel@tonic-gate #define SCMD_EXTENDED_COPY 0x83 301*8a16ae8fSmcneal #define SCMD_VERIFY_G4 0x8f 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate /* 3047c478bd9Sstevel@tonic-gate * Group 4 Commands, Direct Access Devices 3057c478bd9Sstevel@tonic-gate */ 3067c478bd9Sstevel@tonic-gate #define SCMD_READ_G4 0x88 3077c478bd9Sstevel@tonic-gate #define SCMD_WRITE_G4 0x8a 3087c478bd9Sstevel@tonic-gate #define SCMD_SVC_ACTION_IN_G4 0x9e 3097c478bd9Sstevel@tonic-gate #define SCMD_SVC_ACTION_OUT_G4 0x9f 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate /* 3127c478bd9Sstevel@tonic-gate * Group 4 Service Actions for Service Action In (16) 3137c478bd9Sstevel@tonic-gate */ 3147c478bd9Sstevel@tonic-gate #define SSVC_ACTION_READ_CAPACITY_G4 0x10 3157c478bd9Sstevel@tonic-gate #define SSVC_ACTION_READ_LONG_G4 0x11 3167c478bd9Sstevel@tonic-gate 3177c478bd9Sstevel@tonic-gate /* 3187c478bd9Sstevel@tonic-gate * Group 4 Service Actions for Service Action Out (16) 3197c478bd9Sstevel@tonic-gate */ 3207c478bd9Sstevel@tonic-gate #define SSVC_ACTION_WRITE_LONG_G4 0x11 3217c478bd9Sstevel@tonic-gate 3225988135dSrralphs /* 3235988135dSrralphs * Group 4 Commands, Sequential Access Devics 3245988135dSrralphs */ 3255988135dSrralphs #define SCMD_READ_ATTRIBUTE 0x8c 3265988135dSrralphs #define SCMD_WRITE_ATTRIBUTE 0x8d 3275988135dSrralphs 3287c478bd9Sstevel@tonic-gate /* 3297c478bd9Sstevel@tonic-gate * Define for Group 5 command. 3307c478bd9Sstevel@tonic-gate */ 3317c478bd9Sstevel@tonic-gate #define SCMD_GROUP5 0xA0 33230a83a24Scth #define SCMD_REPORT_LUNS 0xA0 33336c5fee3Smcneal #define SCMD_REPORT_TARGET_PORT_GROUPS 0xA3 3347c478bd9Sstevel@tonic-gate #define SCMD_READ_G5 0xA8 3357c478bd9Sstevel@tonic-gate #define SCMD_WRITE_G5 0xAA 33636c5fee3Smcneal #define SCMD_READ_MEDIA_SERIAL 0xAB 3377c478bd9Sstevel@tonic-gate #define SCMD_GET_PERFORMANCE 0xAC 338*8a16ae8fSmcneal #define SCMD_VERIFY_G5 0xAF 3397c478bd9Sstevel@tonic-gate 34030a83a24Scth 34130a83a24Scth /* 34230a83a24Scth * scsi_key_strings for SCMD_ definitions 34330a83a24Scth * NOTE: see SCSI_CMDS_KEY_STRINGS_CDIO in cdio.h for additional 34430a83a24Scth * command-to-string translations. 34530a83a24Scth */ 34630a83a24Scth #define SCSI_CMDS_KEY_STRINGS \ 34730a83a24Scth /* 0x00 */ SCMD_TEST_UNIT_READY, "test_unit_ready", \ 34830a83a24Scth /* 0x01 */ SCMD_REWIND | \ 34930a83a24Scth SCMD_REZERO_UNIT, "rezero/rewind", \ 35030a83a24Scth /* 0x03 */ SCMD_REQUEST_SENSE, "request_sense", \ 35130a83a24Scth /* 0x04 */ SCMD_FORMAT, "format", \ 35230a83a24Scth /* 0x05 */ SCMD_READ_BLKLIM, "read_block_limits", \ 35330a83a24Scth /* 0x07 */ SCMD_REASSIGN_BLOCK, "reassign", \ 35430a83a24Scth /* 0x08 */ SCMD_READ | \ 35530a83a24Scth SCMD_RECEIVE, "read", \ 35630a83a24Scth /* 0x0a */ SCMD_PRINT | \ 35730a83a24Scth SCMD_SEND | \ 35830a83a24Scth SCMD_WRITE, "write", \ 35930a83a24Scth /* 0x0b */ SCMD_SEEK | \ 36030a83a24Scth SCMD_SLEW_PRINT | \ 36130a83a24Scth SCMD_TRK_SEL, "seek", \ 36230a83a24Scth /* 0x0f */ SCMD_READ_REVERSE, "read_reverse", \ 36330a83a24Scth /* 0x10 */ SCMD_WRITE_FILE_MARK | \ 36430a83a24Scth SCMD_FLUSH_PRINT_BUF, "write_file_mark", \ 36530a83a24Scth /* 0x11 */ SCMD_SPACE, "space", \ 36630a83a24Scth /* 0x12 */ SCMD_INQUIRY, "inquiry", \ 36730a83a24Scth /* 0x13 */ SCMD_VERIFY_G0, "verify", \ 36830a83a24Scth /* 0x14 */ SCMD_RECOVER_BUF, "recover_buffer_data", \ 36930a83a24Scth /* 0x15 */ SCMD_MODE_SELECT, "mode_select", \ 37030a83a24Scth /* 0x16 */ SCMD_RESERVE, "reserve", \ 37130a83a24Scth /* 0x17 */ SCMD_RELEASE, "release", \ 37230a83a24Scth /* 0x18 */ SCMD_COPY, "copy", \ 37330a83a24Scth /* 0x19 */ SCMD_ERASE, "erase_tape", \ 37430a83a24Scth /* 0x1a */ SCMD_MODE_SENSE, "mode_sense", \ 37530a83a24Scth /* 0x1b */ SCMD_LOAD | \ 37630a83a24Scth SCMD_START_STOP | \ 37730a83a24Scth SCMD_STOP_PRINT, "load/start/stop", \ 37830a83a24Scth /* 0x1c */ SCMD_GDIAG, "get_diagnostic_results", \ 37930a83a24Scth /* 0x1d */ SCMD_SDIAG, "send_diagnostic_command", \ 38030a83a24Scth /* 0x1e */ SCMD_DOORLOCK, "door_lock", \ 38130a83a24Scth /* 0x23 */ SCMD_READ_FORMAT_CAP, "read_format_capacity", \ 38230a83a24Scth /* 0x25 */ SCMD_READ_CAPACITY, "read_capacity", \ 38330a83a24Scth /* 0x28 */ SCMD_READ_G1, "read(10)", \ 38430a83a24Scth /* 0x2a */ SCMD_WRITE_G1, "write(10)", \ 38530a83a24Scth /* 0x2b */ SCMD_SEEK_G1 | \ 38630a83a24Scth SCMD_LOCATE, "seek(10)", \ 38730a83a24Scth /* 0x2e */ SCMD_WRITE_VERIFY, "write_verify", \ 38830a83a24Scth /* 0x2f */ SCMD_VERIFY, "verify(10)", \ 38930a83a24Scth /* 0x30 */ SCMD_SEARCH_HIGH, "search_data_high", \ 39030a83a24Scth /* 0x31 */ SCMD_SEARCH_EQUAL, "search_data_equal", \ 39130a83a24Scth /* 0x32 */ SCMD_SEARCH_LOW, "search_data_low", \ 39230a83a24Scth /* 0x33 */ SCMD_SET_LIMITS, "set_limits", \ 39330a83a24Scth /* 0x34 */ SCMD_READ_POSITION, "read_position", \ 39430a83a24Scth /* 0x35 */ SCMD_SYNCHRONIZE_CACHE, "synchronize_cache", \ 39530a83a24Scth /* 0x37 */ SCMD_READ_DEFECT_LIST, "read_defect_data", \ 39630a83a24Scth /* 0x39 */ SCMD_COMPARE, "compare", \ 39730a83a24Scth /* 0x3a */ SCMD_COPY_VERIFY, "copy_verify", \ 39830a83a24Scth /* 0x3b */ SCMD_WRITE_BUFFER, "write_buffer", \ 39930a83a24Scth /* 0x3c */ SCMD_READ_BUFFER, "read_buffer", \ 40030a83a24Scth /* 0x3e */ SCMD_READ_LONG, "read_long", \ 40130a83a24Scth /* 0x3f */ SCMD_WRITE_LONG, "write_long", \ 40230a83a24Scth /* 0x44 */ SCMD_REPORT_DENSITIES | \ 40330a83a24Scth /* SCMD_READ_HEADER (from cdio.h) | */ \ 40430a83a24Scth 0, "report_densities/read_header", \ 40530a83a24Scth /* 0x4c */ SCMD_LOG_SELECT_G1, "log_select", \ 40630a83a24Scth /* 0x4d */ SCMD_LOG_SENSE_G1, "log_sense", \ 40730a83a24Scth /* 0x55 */ SCMD_MODE_SELECT_G1, "mode_select(10)", \ 40830a83a24Scth /* 0x56 */ SCMD_RESERVE_G1, "reserve(10)", \ 40930a83a24Scth /* 0x57 */ SCMD_RELEASE_G1, "release(10)", \ 41030a83a24Scth /* 0x5a */ SCMD_MODE_SENSE_G1, "mode_sense(10)", \ 41130a83a24Scth /* 0x5e */ SCMD_PERSISTENT_RESERVE_IN, "persistent_reserve_in", \ 41230a83a24Scth /* 0x5f */ SCMD_PERSISTENT_RESERVE_OUT, "persistent_reserve_out", \ 41330a83a24Scth /* 0x83 */ SCMD_EXTENDED_COPY, "extended_copy", \ 41430a83a24Scth /* 0x88 */ SCMD_READ_G4, "read(16)", \ 41530a83a24Scth /* 0x8a */ SCMD_WRITE_G4, "write(16)", \ 4165988135dSrralphs /* 0x8c */ SCMD_READ_ATTRIBUTE, "read_attribute", \ 4175988135dSrralphs /* 0x8d */ SCMD_WRITE_ATTRIBUTE, "write_attribute", \ 41830a83a24Scth /* 0xa0 */ SCMD_REPORT_LUNS, "report_luns", \ 41930a83a24Scth /* 0xa8 */ SCMD_READ_G5, "read(12)", \ 42030a83a24Scth /* 0xaa */ SCMD_WRITE_G5, "write(12)", \ 42130a83a24Scth /* 0xac */ SCMD_GET_PERFORMANCE, "get_performance" \ 42230a83a24Scth /* see cdio.h for additional command-to-string translations */ 42330a83a24Scth 42430a83a24Scth /* XXX not a command code, does not belong here */ 42530a83a24Scth #define ATAPI_CAPABILITIES 0x2A 42630a83a24Scth 4277c478bd9Sstevel@tonic-gate #ifdef __cplusplus 4287c478bd9Sstevel@tonic-gate } 4297c478bd9Sstevel@tonic-gate #endif 4307c478bd9Sstevel@tonic-gate 4317c478bd9Sstevel@tonic-gate /* 4327c478bd9Sstevel@tonic-gate * Below are inclusions of files describing various command structures 4337c478bd9Sstevel@tonic-gate * of interest. 4347c478bd9Sstevel@tonic-gate */ 4357c478bd9Sstevel@tonic-gate #include <sys/scsi/generic/inquiry.h> 4367c478bd9Sstevel@tonic-gate #include <sys/scsi/generic/sense.h> 4377c478bd9Sstevel@tonic-gate 4387c478bd9Sstevel@tonic-gate /* 4397c478bd9Sstevel@tonic-gate * Private Vendor Unique Commands - Each implementation provides this. 4407c478bd9Sstevel@tonic-gate */ 4417c478bd9Sstevel@tonic-gate #include <sys/scsi/impl/commands.h> 4427c478bd9Sstevel@tonic-gate 4437c478bd9Sstevel@tonic-gate #endif /* _SYS_SCSI_GENERIC_COMMANDS_H */ 444