SPARC64: introduce a convenience function for getting physical addresses
[qemu.git] / hw / scsi-defs.h
blob413cce07b5a4084d1fdd7d3bc931583600e4d311
1 /* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 * This header file contains public constants and structures used by
20 * the scsi code for linux.
24 * SCSI opcodes
27 #define TEST_UNIT_READY 0x00
28 #define REZERO_UNIT 0x01
29 #define REQUEST_SENSE 0x03
30 #define FORMAT_UNIT 0x04
31 #define READ_BLOCK_LIMITS 0x05
32 #define REASSIGN_BLOCKS 0x07
33 #define READ_6 0x08
34 #define WRITE_6 0x0a
35 #define SEEK_6 0x0b
36 #define READ_REVERSE 0x0f
37 #define WRITE_FILEMARKS 0x10
38 #define SPACE 0x11
39 #define INQUIRY 0x12
40 #define RECOVER_BUFFERED_DATA 0x14
41 #define MODE_SELECT 0x15
42 #define RESERVE 0x16
43 #define RELEASE 0x17
44 #define COPY 0x18
45 #define ERASE 0x19
46 #define MODE_SENSE 0x1a
47 #define START_STOP 0x1b
48 #define RECEIVE_DIAGNOSTIC 0x1c
49 #define SEND_DIAGNOSTIC 0x1d
50 #define ALLOW_MEDIUM_REMOVAL 0x1e
52 #define SET_WINDOW 0x24
53 #define READ_CAPACITY 0x25
54 #define READ_10 0x28
55 #define WRITE_10 0x2a
56 #define SEEK_10 0x2b
57 #define WRITE_VERIFY 0x2e
58 #define VERIFY 0x2f
59 #define SEARCH_HIGH 0x30
60 #define SEARCH_EQUAL 0x31
61 #define SEARCH_LOW 0x32
62 #define SET_LIMITS 0x33
63 #define PRE_FETCH 0x34
64 #define READ_POSITION 0x34
65 #define SYNCHRONIZE_CACHE 0x35
66 #define LOCK_UNLOCK_CACHE 0x36
67 #define READ_DEFECT_DATA 0x37
68 #define MEDIUM_SCAN 0x38
69 #define COMPARE 0x39
70 #define COPY_VERIFY 0x3a
71 #define WRITE_BUFFER 0x3b
72 #define READ_BUFFER 0x3c
73 #define UPDATE_BLOCK 0x3d
74 #define READ_LONG 0x3e
75 #define WRITE_LONG 0x3f
76 #define CHANGE_DEFINITION 0x40
77 #define WRITE_SAME 0x41
78 #define READ_TOC 0x43
79 #define LOG_SELECT 0x4c
80 #define LOG_SENSE 0x4d
81 #define MODE_SELECT_10 0x55
82 #define RESERVE_10 0x56
83 #define RELEASE_10 0x57
84 #define MODE_SENSE_10 0x5a
85 #define PERSISTENT_RESERVE_IN 0x5e
86 #define PERSISTENT_RESERVE_OUT 0x5f
87 #define WRITE_SAME_16 0x93
88 #define MAINTENANCE_IN 0xa3
89 #define MAINTENANCE_OUT 0xa4
90 #define MOVE_MEDIUM 0xa5
91 #define READ_12 0xa8
92 #define WRITE_12 0xaa
93 #define WRITE_VERIFY_12 0xae
94 #define SEARCH_HIGH_12 0xb0
95 #define SEARCH_EQUAL_12 0xb1
96 #define SEARCH_LOW_12 0xb2
97 #define READ_ELEMENT_STATUS 0xb8
98 #define SEND_VOLUME_TAG 0xb6
99 #define WRITE_LONG_2 0xea
101 /* from hw/scsi-generic.c */
102 #define REWIND 0x01
103 #define REPORT_DENSITY_SUPPORT 0x44
104 #define GET_CONFIGURATION 0x46
105 #define READ_16 0x88
106 #define WRITE_16 0x8a
107 #define WRITE_VERIFY_16 0x8e
108 #define SERVICE_ACTION_IN 0x9e
109 #define REPORT_LUNS 0xa0
110 #define LOAD_UNLOAD 0xa6
111 #define SET_CD_SPEED 0xbb
112 #define BLANK 0xa1
115 * SAM Status codes
118 #define GOOD 0x00
119 #define CHECK_CONDITION 0x02
120 #define CONDITION_GOOD 0x04
121 #define BUSY 0x08
122 #define INTERMEDIATE_GOOD 0x10
123 #define INTERMEDIATE_C_GOOD 0x14
124 #define RESERVATION_CONFLICT 0x18
125 #define COMMAND_TERMINATED 0x22
126 #define TASK_SET_FULL 0x28
127 #define ACA_ACTIVE 0x30
128 #define TASK_ABORTED 0x40
130 #define STATUS_MASK 0x3e
133 * SENSE KEYS
136 #define NO_SENSE 0x00
137 #define RECOVERED_ERROR 0x01
138 #define NOT_READY 0x02
139 #define MEDIUM_ERROR 0x03
140 #define HARDWARE_ERROR 0x04
141 #define ILLEGAL_REQUEST 0x05
142 #define UNIT_ATTENTION 0x06
143 #define DATA_PROTECT 0x07
144 #define BLANK_CHECK 0x08
145 #define COPY_ABORTED 0x0a
146 #define ABORTED_COMMAND 0x0b
147 #define VOLUME_OVERFLOW 0x0d
148 #define MISCOMPARE 0x0e
152 * DEVICE TYPES
155 #define TYPE_DISK 0x00
156 #define TYPE_TAPE 0x01
157 #define TYPE_PROCESSOR 0x03 /* HP scanners use this */
158 #define TYPE_WORM 0x04 /* Treated as ROM by our system */
159 #define TYPE_ROM 0x05
160 #define TYPE_SCANNER 0x06
161 #define TYPE_MOD 0x07 /* Magneto-optical disk -
162 * - treated as TYPE_DISK */
163 #define TYPE_MEDIUM_CHANGER 0x08
164 #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
165 #define TYPE_NO_LUN 0x7f