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 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 237c478bd9Sstevel@tonic-gate * Copyright 2005 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 62*30a83a24Scth * 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 214*30a83a24Scth #define SCMD_PERSISTENT_RESERVE_IN 0x5E 215*30a83a24Scth #define SCMD_PERSISTENT_RESERVE_OUT 0x5F 216*30a83a24Scth #define SCMD_PRIN SCMD_PERSISTENT_RESERVE_IN 217*30a83a24Scth #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 233*30a83a24Scth #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 2917c478bd9Sstevel@tonic-gate /* 2927c478bd9Sstevel@tonic-gate * Group 4 Commands, All Devices 2937c478bd9Sstevel@tonic-gate */ 2947c478bd9Sstevel@tonic-gate #define SCMD_GROUP4 0x80 2957c478bd9Sstevel@tonic-gate #define SCMD_EXTENDED_COPY 0x83 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate /* 2987c478bd9Sstevel@tonic-gate * Group 4 Commands, Direct Access Devices 2997c478bd9Sstevel@tonic-gate */ 3007c478bd9Sstevel@tonic-gate #define SCMD_READ_G4 0x88 3017c478bd9Sstevel@tonic-gate #define SCMD_WRITE_G4 0x8a 3027c478bd9Sstevel@tonic-gate #define SCMD_SVC_ACTION_IN_G4 0x9e 3037c478bd9Sstevel@tonic-gate #define SCMD_SVC_ACTION_OUT_G4 0x9f 3047c478bd9Sstevel@tonic-gate 3057c478bd9Sstevel@tonic-gate /* 3067c478bd9Sstevel@tonic-gate * Group 4 Service Actions for Service Action In (16) 3077c478bd9Sstevel@tonic-gate */ 3087c478bd9Sstevel@tonic-gate #define SSVC_ACTION_READ_CAPACITY_G4 0x10 3097c478bd9Sstevel@tonic-gate #define SSVC_ACTION_READ_LONG_G4 0x11 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate /* 3127c478bd9Sstevel@tonic-gate * Group 4 Service Actions for Service Action Out (16) 3137c478bd9Sstevel@tonic-gate */ 3147c478bd9Sstevel@tonic-gate #define SSVC_ACTION_WRITE_LONG_G4 0x11 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gate /* 3177c478bd9Sstevel@tonic-gate * Define for Group 5 command. 3187c478bd9Sstevel@tonic-gate */ 3197c478bd9Sstevel@tonic-gate #define SCMD_GROUP5 0xA0 320*30a83a24Scth #define SCMD_REPORT_LUNS 0xA0 3217c478bd9Sstevel@tonic-gate #define SCMD_READ_G5 0xA8 3227c478bd9Sstevel@tonic-gate #define SCMD_WRITE_G5 0xAA 3237c478bd9Sstevel@tonic-gate #define SCMD_GET_PERFORMANCE 0xAC 3247c478bd9Sstevel@tonic-gate 3257c478bd9Sstevel@tonic-gate 326*30a83a24Scth 327*30a83a24Scth /* 328*30a83a24Scth * scsi_key_strings for SCMD_ definitions 329*30a83a24Scth * NOTE: see SCSI_CMDS_KEY_STRINGS_CDIO in cdio.h for additional 330*30a83a24Scth * command-to-string translations. 331*30a83a24Scth */ 332*30a83a24Scth #define SCSI_CMDS_KEY_STRINGS \ 333*30a83a24Scth /* 0x00 */ SCMD_TEST_UNIT_READY, "test_unit_ready", \ 334*30a83a24Scth /* 0x01 */ SCMD_REWIND | \ 335*30a83a24Scth SCMD_REZERO_UNIT, "rezero/rewind", \ 336*30a83a24Scth /* 0x03 */ SCMD_REQUEST_SENSE, "request_sense", \ 337*30a83a24Scth /* 0x04 */ SCMD_FORMAT, "format", \ 338*30a83a24Scth /* 0x05 */ SCMD_READ_BLKLIM, "read_block_limits", \ 339*30a83a24Scth /* 0x07 */ SCMD_REASSIGN_BLOCK, "reassign", \ 340*30a83a24Scth /* 0x08 */ SCMD_READ | \ 341*30a83a24Scth SCMD_RECEIVE, "read", \ 342*30a83a24Scth /* 0x0a */ SCMD_PRINT | \ 343*30a83a24Scth SCMD_SEND | \ 344*30a83a24Scth SCMD_WRITE, "write", \ 345*30a83a24Scth /* 0x0b */ SCMD_SEEK | \ 346*30a83a24Scth SCMD_SLEW_PRINT | \ 347*30a83a24Scth SCMD_TRK_SEL, "seek", \ 348*30a83a24Scth /* 0x0f */ SCMD_READ_REVERSE, "read_reverse", \ 349*30a83a24Scth /* 0x10 */ SCMD_WRITE_FILE_MARK | \ 350*30a83a24Scth SCMD_FLUSH_PRINT_BUF, "write_file_mark", \ 351*30a83a24Scth /* 0x11 */ SCMD_SPACE, "space", \ 352*30a83a24Scth /* 0x12 */ SCMD_INQUIRY, "inquiry", \ 353*30a83a24Scth /* 0x13 */ SCMD_VERIFY_G0, "verify", \ 354*30a83a24Scth /* 0x14 */ SCMD_RECOVER_BUF, "recover_buffer_data", \ 355*30a83a24Scth /* 0x15 */ SCMD_MODE_SELECT, "mode_select", \ 356*30a83a24Scth /* 0x16 */ SCMD_RESERVE, "reserve", \ 357*30a83a24Scth /* 0x17 */ SCMD_RELEASE, "release", \ 358*30a83a24Scth /* 0x18 */ SCMD_COPY, "copy", \ 359*30a83a24Scth /* 0x19 */ SCMD_ERASE, "erase_tape", \ 360*30a83a24Scth /* 0x1a */ SCMD_MODE_SENSE, "mode_sense", \ 361*30a83a24Scth /* 0x1b */ SCMD_LOAD | \ 362*30a83a24Scth SCMD_START_STOP | \ 363*30a83a24Scth SCMD_STOP_PRINT, "load/start/stop", \ 364*30a83a24Scth /* 0x1c */ SCMD_GDIAG, "get_diagnostic_results", \ 365*30a83a24Scth /* 0x1d */ SCMD_SDIAG, "send_diagnostic_command", \ 366*30a83a24Scth /* 0x1e */ SCMD_DOORLOCK, "door_lock", \ 367*30a83a24Scth /* 0x23 */ SCMD_READ_FORMAT_CAP, "read_format_capacity", \ 368*30a83a24Scth /* 0x25 */ SCMD_READ_CAPACITY, "read_capacity", \ 369*30a83a24Scth /* 0x28 */ SCMD_READ_G1, "read(10)", \ 370*30a83a24Scth /* 0x2a */ SCMD_WRITE_G1, "write(10)", \ 371*30a83a24Scth /* 0x2b */ SCMD_SEEK_G1 | \ 372*30a83a24Scth SCMD_LOCATE, "seek(10)", \ 373*30a83a24Scth /* 0x2e */ SCMD_WRITE_VERIFY, "write_verify", \ 374*30a83a24Scth /* 0x2f */ SCMD_VERIFY, "verify(10)", \ 375*30a83a24Scth /* 0x30 */ SCMD_SEARCH_HIGH, "search_data_high", \ 376*30a83a24Scth /* 0x31 */ SCMD_SEARCH_EQUAL, "search_data_equal", \ 377*30a83a24Scth /* 0x32 */ SCMD_SEARCH_LOW, "search_data_low", \ 378*30a83a24Scth /* 0x33 */ SCMD_SET_LIMITS, "set_limits", \ 379*30a83a24Scth /* 0x34 */ SCMD_READ_POSITION, "read_position", \ 380*30a83a24Scth /* 0x35 */ SCMD_SYNCHRONIZE_CACHE, "synchronize_cache", \ 381*30a83a24Scth /* 0x37 */ SCMD_READ_DEFECT_LIST, "read_defect_data", \ 382*30a83a24Scth /* 0x39 */ SCMD_COMPARE, "compare", \ 383*30a83a24Scth /* 0x3a */ SCMD_COPY_VERIFY, "copy_verify", \ 384*30a83a24Scth /* 0x3b */ SCMD_WRITE_BUFFER, "write_buffer", \ 385*30a83a24Scth /* 0x3c */ SCMD_READ_BUFFER, "read_buffer", \ 386*30a83a24Scth /* 0x3e */ SCMD_READ_LONG, "read_long", \ 387*30a83a24Scth /* 0x3f */ SCMD_WRITE_LONG, "write_long", \ 388*30a83a24Scth /* 0x44 */ SCMD_REPORT_DENSITIES | \ 389*30a83a24Scth /* SCMD_READ_HEADER (from cdio.h) | */ \ 390*30a83a24Scth 0, "report_densities/read_header", \ 391*30a83a24Scth /* 0x4c */ SCMD_LOG_SELECT_G1, "log_select", \ 392*30a83a24Scth /* 0x4d */ SCMD_LOG_SENSE_G1, "log_sense", \ 393*30a83a24Scth /* 0x55 */ SCMD_MODE_SELECT_G1, "mode_select(10)", \ 394*30a83a24Scth /* 0x56 */ SCMD_RESERVE_G1, "reserve(10)", \ 395*30a83a24Scth /* 0x57 */ SCMD_RELEASE_G1, "release(10)", \ 396*30a83a24Scth /* 0x5a */ SCMD_MODE_SENSE_G1, "mode_sense(10)", \ 397*30a83a24Scth /* 0x5e */ SCMD_PERSISTENT_RESERVE_IN, "persistent_reserve_in", \ 398*30a83a24Scth /* 0x5f */ SCMD_PERSISTENT_RESERVE_OUT, "persistent_reserve_out", \ 399*30a83a24Scth /* 0x83 */ SCMD_EXTENDED_COPY, "extended_copy", \ 400*30a83a24Scth /* 0x88 */ SCMD_READ_G4, "read(16)", \ 401*30a83a24Scth /* 0x8a */ SCMD_WRITE_G4, "write(16)", \ 402*30a83a24Scth /* 0xa0 */ SCMD_REPORT_LUNS, "report_luns", \ 403*30a83a24Scth /* 0xa8 */ SCMD_READ_G5, "read(12)", \ 404*30a83a24Scth /* 0xaa */ SCMD_WRITE_G5, "write(12)", \ 405*30a83a24Scth /* 0xac */ SCMD_GET_PERFORMANCE, "get_performance" \ 406*30a83a24Scth /* see cdio.h for additional command-to-string translations */ 407*30a83a24Scth 408*30a83a24Scth /* XXX not a command code, does not belong here */ 409*30a83a24Scth #define ATAPI_CAPABILITIES 0x2A 410*30a83a24Scth 4117c478bd9Sstevel@tonic-gate #ifdef __cplusplus 4127c478bd9Sstevel@tonic-gate } 4137c478bd9Sstevel@tonic-gate #endif 4147c478bd9Sstevel@tonic-gate 4157c478bd9Sstevel@tonic-gate /* 4167c478bd9Sstevel@tonic-gate * Below are inclusions of files describing various command structures 4177c478bd9Sstevel@tonic-gate * of interest. 4187c478bd9Sstevel@tonic-gate */ 4197c478bd9Sstevel@tonic-gate #include <sys/scsi/generic/inquiry.h> 4207c478bd9Sstevel@tonic-gate #include <sys/scsi/generic/sense.h> 4217c478bd9Sstevel@tonic-gate 4227c478bd9Sstevel@tonic-gate /* 4237c478bd9Sstevel@tonic-gate * Private Vendor Unique Commands - Each implementation provides this. 4247c478bd9Sstevel@tonic-gate */ 4257c478bd9Sstevel@tonic-gate #include <sys/scsi/impl/commands.h> 4267c478bd9Sstevel@tonic-gate 4277c478bd9Sstevel@tonic-gate #endif /* _SYS_SCSI_GENERIC_COMMANDS_H */ 428