Statistics
| Branch: | Revision:

root / hw / scsi-defs.h @ 39ec9a50

History | View | Annotate | Download (4.9 kB)

1
/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
3

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.
8

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.
13

14
   You should have received a copy of the GNU Lesser General Public
15
   License along with the GNU C Library; if not, write to the Free
16
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
   02111-1307 USA.  */
18

    
19
/*
20
 * This header file contains public constants and structures used by
21
 * the scsi code for linux.
22
 */
23

    
24
/*
25
 *      SCSI opcodes
26
 */
27

    
28
#define TEST_UNIT_READY       0x00
29
#define REZERO_UNIT           0x01
30
#define REQUEST_SENSE         0x03
31
#define FORMAT_UNIT           0x04
32
#define READ_BLOCK_LIMITS     0x05
33
#define REASSIGN_BLOCKS       0x07
34
#define READ_6                0x08
35
#define WRITE_6               0x0a
36
#define SEEK_6                0x0b
37
#define READ_REVERSE          0x0f
38
#define WRITE_FILEMARKS       0x10
39
#define SPACE                 0x11
40
#define INQUIRY               0x12
41
#define RECOVER_BUFFERED_DATA 0x14
42
#define MODE_SELECT           0x15
43
#define RESERVE               0x16
44
#define RELEASE               0x17
45
#define COPY                  0x18
46
#define ERASE                 0x19
47
#define MODE_SENSE            0x1a
48
#define START_STOP            0x1b
49
#define RECEIVE_DIAGNOSTIC    0x1c
50
#define SEND_DIAGNOSTIC       0x1d
51
#define ALLOW_MEDIUM_REMOVAL  0x1e
52

    
53
#define SET_WINDOW            0x24
54
#define READ_CAPACITY         0x25
55
#define READ_10               0x28
56
#define WRITE_10              0x2a
57
#define SEEK_10               0x2b
58
#define WRITE_VERIFY          0x2e
59
#define VERIFY                0x2f
60
#define SEARCH_HIGH           0x30
61
#define SEARCH_EQUAL          0x31
62
#define SEARCH_LOW            0x32
63
#define SET_LIMITS            0x33
64
#define PRE_FETCH             0x34
65
#define READ_POSITION         0x34
66
#define SYNCHRONIZE_CACHE     0x35
67
#define LOCK_UNLOCK_CACHE     0x36
68
#define READ_DEFECT_DATA      0x37
69
#define MEDIUM_SCAN           0x38
70
#define COMPARE               0x39
71
#define COPY_VERIFY           0x3a
72
#define WRITE_BUFFER          0x3b
73
#define READ_BUFFER           0x3c
74
#define UPDATE_BLOCK          0x3d
75
#define READ_LONG             0x3e
76
#define WRITE_LONG            0x3f
77
#define CHANGE_DEFINITION     0x40
78
#define WRITE_SAME            0x41
79
#define READ_TOC              0x43
80
#define LOG_SELECT            0x4c
81
#define LOG_SENSE             0x4d
82
#define MODE_SELECT_10        0x55
83
#define RESERVE_10            0x56
84
#define RELEASE_10            0x57
85
#define MODE_SENSE_10         0x5a
86
#define PERSISTENT_RESERVE_IN 0x5e
87
#define PERSISTENT_RESERVE_OUT 0x5f
88
#define MOVE_MEDIUM           0xa5
89
#define READ_12               0xa8
90
#define WRITE_12              0xaa
91
#define WRITE_VERIFY_12       0xae
92
#define SEARCH_HIGH_12        0xb0
93
#define SEARCH_EQUAL_12       0xb1
94
#define SEARCH_LOW_12         0xb2
95
#define READ_ELEMENT_STATUS   0xb8
96
#define SEND_VOLUME_TAG       0xb6
97
#define WRITE_LONG_2          0xea
98

    
99
/* from hw/scsi-generic.c */
100
#define REWIND 0x01
101
#define REPORT_DENSITY_SUPPORT 0x44
102
#define GET_CONFIGURATION 0x46
103
#define SERVICE_ACTION_IN 0x9e
104
#define REPORT_LUNS 0xa0
105
#define LOAD_UNLOAD 0xa6
106
#define SET_CD_SPEED 0xbb
107
#define BLANK 0xa1
108

    
109
/*
110
 *  Status codes
111
 */
112

    
113
#define GOOD                 0x00
114
#define CHECK_CONDITION      0x01
115
#define CONDITION_GOOD       0x02
116
#define BUSY                 0x04
117
#define INTERMEDIATE_GOOD    0x08
118
#define INTERMEDIATE_C_GOOD  0x0a
119
#define RESERVATION_CONFLICT 0x0c
120
#define COMMAND_TERMINATED   0x11
121
#define QUEUE_FULL           0x14
122

    
123
#define STATUS_MASK          0x3e
124

    
125
/*
126
 *  SENSE KEYS
127
 */
128

    
129
#define NO_SENSE            0x00
130
#define RECOVERED_ERROR     0x01
131
#define NOT_READY           0x02
132
#define MEDIUM_ERROR        0x03
133
#define HARDWARE_ERROR      0x04
134
#define ILLEGAL_REQUEST     0x05
135
#define UNIT_ATTENTION      0x06
136
#define DATA_PROTECT        0x07
137
#define BLANK_CHECK         0x08
138
#define COPY_ABORTED        0x0a
139
#define ABORTED_COMMAND     0x0b
140
#define VOLUME_OVERFLOW     0x0d
141
#define MISCOMPARE          0x0e
142

    
143

    
144
/*
145
 *  DEVICE TYPES
146
 */
147

    
148
#define TYPE_DISK           0x00
149
#define TYPE_TAPE           0x01
150
#define TYPE_PROCESSOR      0x03    /* HP scanners use this */
151
#define TYPE_WORM           0x04    /* Treated as ROM by our system */
152
#define TYPE_ROM            0x05
153
#define TYPE_SCANNER        0x06
154
#define TYPE_MOD            0x07    /* Magneto-optical disk -
155
                                     * - treated as TYPE_DISK */
156
#define TYPE_MEDIUM_CHANGER 0x08
157
#define TYPE_ENCLOSURE            0x0d    /* Enclosure Services Device */
158
#define TYPE_NO_LUN         0x7f
159