2
0

scsi-defs.h 5.0 KB

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