intel_scsi.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. /*
  2. * This file is provided under a dual BSD/GPLv2 license. When using or
  3. * redistributing this file, you may do so under either license.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of version 2 of the GNU General Public License as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * BSD LICENSE
  25. *
  26. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. *
  33. * * Redistributions of source code must retain the above copyright
  34. * notice, this list of conditions and the following disclaimer.
  35. * * Redistributions in binary form must reproduce the above copyright
  36. * notice, this list of conditions and the following disclaimer in
  37. * the documentation and/or other materials provided with the
  38. * distribution.
  39. * * Neither the name of Intel Corporation nor the names of its
  40. * contributors may be used to endorse or promote products derived
  41. * from this software without specific prior written permission.
  42. *
  43. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  46. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  47. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  48. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  49. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  50. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  51. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  53. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. /**
  56. * This file defines all of the SCSI related constants, enumerations, and
  57. * types. Please note that this file does not necessarily contain an
  58. * exhaustive list of all constants, commands, sub-commands, etc.
  59. *
  60. *
  61. */
  62. #ifndef _SCSI_H__
  63. #define _SCSI_H__
  64. /*
  65. * ******************************************************************************
  66. * * C O N S T A N T S A N D M A C R O S
  67. * ****************************************************************************** */
  68. /**
  69. * enum _SCSI_TASK_MGMT_REQUEST_CODES - This enumberation contains the
  70. * constants to be used for SCSI task management request codes. SAM does
  71. * not specify any particular values for these codes so constants used here
  72. * are the same as those specified in SAS.
  73. *
  74. *
  75. */
  76. enum scsi_task_mgmt_request_codes {
  77. SCSI_TASK_REQUEST_ABORT_TASK = 0x01,
  78. SCSI_TASK_REQUEST_ABORT_TASK_SET = 0x02,
  79. SCSI_TASK_REQUEST_CLEAR_TASK_SET = 0x04,
  80. SCSI_TASK_REQUEST_LOGICAL_UNIT_RESET = 0x08,
  81. SCSI_TASK_REQUEST_I_T_NEXUS_RESET = 0x10,
  82. SCSI_TASK_REQUEST_CLEAR_ACA = 0x40,
  83. SCSI_TASK_REQUEST_QUERY_TASK = 0x80,
  84. SCSI_TASK_REQUEST_QUERY_TASK_SET = 0x81,
  85. SCSI_TASK_REQUEST_QUERY_UNIT_ATTENTION = 0x82,
  86. };
  87. /**
  88. * enum _SCSI_TASK_MGMT_RESPONSE_CODES - This enumeration contains all of the
  89. * SCSI task management response codes.
  90. *
  91. *
  92. */
  93. enum scsi_task_mgmt_response_codes {
  94. SCSI_TASK_MGMT_FUNC_COMPLETE = 0,
  95. SCSI_INVALID_FRAME = 2,
  96. SCSI_TASK_MGMT_FUNC_NOT_SUPPORTED = 4,
  97. SCSI_TASK_MGMT_FUNC_FAILED = 5,
  98. SCSI_TASK_MGMT_FUNC_SUCCEEDED = 8,
  99. SCSI_INVALID_LUN = 9
  100. };
  101. /**
  102. * enum _SCSI_SENSE_RESPONSE_CODE - this enumeration depicts the types of sense
  103. * data responses as per SPC-3.
  104. *
  105. *
  106. */
  107. enum scsi_sense_response_code {
  108. SCSI_FIXED_CURRENT_RESPONSE_CODE = 0x70,
  109. SCSI_FIXED_DEFERRED_RESPONSE_CODE = 0x71,
  110. SCSI_DESCRIPTOR_CURRENT_RESPONSE_CODE = 0x72,
  111. SCSI_DESCRIPTOR_DEFERRED_RESPONSE_CODE = 0x73
  112. };
  113. /*
  114. * This constant represents the valid bit located in byte 0 of a FIXED
  115. * format sense data. */
  116. #define SCSI_FIXED_SENSE_DATA_VALID_BIT 0x80
  117. #define SCSI_FIXED_SENSE_DATA_BASE_LENGTH 18
  118. /* This value is used in the DATAPRES field of the SCSI Response IU. */
  119. #define SCSI_RESPONSE_DATA_PRES_SENSE_DATA 0x02
  120. /**
  121. *
  122. *
  123. * SCSI_SENSE_KEYS These constants delineate all of the SCSI protocol sense key
  124. * constants
  125. */
  126. #define SCSI_SENSE_NO_SENSE 0x00
  127. #define SCSI_SENSE_RECOVERED_ERROR 0x01
  128. #define SCSI_SENSE_NOT_READY 0x02
  129. #define SCSI_SENSE_MEDIUM_ERROR 0x03
  130. #define SCSI_SENSE_HARDWARE_ERROR 0x04
  131. #define SCSI_SENSE_ILLEGAL_REQUEST 0x05
  132. #define SCSI_SENSE_UNIT_ATTENTION 0x06
  133. #define SCSI_SENSE_DATA_PROTECT 0x07
  134. #define SCSI_SENSE_BLANK_CHECK 0x08
  135. #define SCSI_SENSE_VENDOR_SPECIFIC 0x09
  136. #define SCSI_SENSE_COPY_ABORTED 0x0A
  137. #define SCSI_SENSE_ABORTED_COMMAND 0x0B
  138. #define SCSI_SENSE_VOLUME_OVERFLOW 0x0D
  139. #define SCSI_SENSE_MISCOMPARE 0x0E
  140. /**
  141. *
  142. *
  143. * SCSI_ADDITIONAL_SENSE_CODES These constants delineate all of the SCSI
  144. * protocol additional sense code constants.
  145. */
  146. #define SCSI_ASC_NO_ADDITIONAL_SENSE 0x00
  147. #define SCSI_ASC_INITIALIZING_COMMAND_REQUIRED 0x04
  148. #define SCSI_ASC_LUN_SELF_TEST_IN_PROGRESS 0x04
  149. #define SCSI_ASC_LUN_FORMAT_IN_PROGRESS 0x04
  150. #define SCSI_ASC_LUN_NOT_RESPOND_TO_SELECTION 0x05
  151. #define SCSI_ASC_UNRECOVERED_READ_ERROR 0x11
  152. #define SCSI_ASC_INVALID_COMMAND_OPERATION_CODE 0x20
  153. #define SCSI_ASC_LBA_OUT_OF_RANGE 0x21
  154. #define SCSI_ASC_INVALID_FIELD_IN_CDB 0x24
  155. #define SCSI_ASC_INVALID_FIELD_IN_PARM_LIST 0x26
  156. #define SCSI_ASC_WRITE_PROTECTED 0x27
  157. #define SCSI_ASC_NOT_READY_TO_READY_CHANGE 0x28
  158. #define SCSI_ASC_SAVING_PARMS_NOT_SUPPORTED 0x39
  159. #define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A
  160. #define SCSI_ASC_INTERNAL_TARGET_FAILURE 0x44
  161. #define SCSI_ASC_IU_CRC_ERROR_DETECTED 0x47
  162. #define SCSI_ASC_MEDIUM_REMOVAL_REQUEST 0x5A
  163. #define SCSI_ASC_COMMAND_SEQUENCE_ERROR 0x2C
  164. #define SCSI_ASC_MEDIA_LOAD_OR_EJECT_FAILED 0x53
  165. #define SCSI_ASC_HARDWARE_IMPENDING_FAILURE 0x5D
  166. #define SCSI_ASC_POWER_STATE_CHANGE 0x5E
  167. #define SCSI_DIAGNOSTIC_FAILURE_ON_COMPONENT 0x40
  168. #define SCSI_ASC_ATA_DEVICE_FEATURE_NOT_ENABLED 0x67
  169. /**
  170. *
  171. *
  172. * SCSI_ADDITIONAL_SENSE_CODE_QUALIFIERS This enumeration contains all of the
  173. * used SCSI protocol additional sense code qualifier constants.
  174. */
  175. #define SCSI_ASCQ_NO_ADDITIONAL_SENSE 0x00
  176. #define SCSI_ASCQ_INVALID_FIELD_IN_CDB 0x00
  177. #define SCSI_ASCQ_INVALID_FIELD_IN_PARM_LIST 0x00
  178. #define SCSI_ASCQ_LUN_NOT_RESPOND_TO_SELECTION 0x00
  179. #define SCSI_ASCQ_INTERNAL_TARGET_FAILURE 0x00
  180. #define SCSI_ASCQ_LBA_OUT_OF_RANGE 0x00
  181. #define SCSI_ASCQ_MEDIUM_NOT_PRESENT 0x00
  182. #define SCSI_ASCQ_NOT_READY_TO_READY_CHANGE 0x00
  183. #define SCSI_ASCQ_WRITE_PROTECTED 0x00
  184. #define SCSI_ASCQ_UNRECOVERED_READ_ERROR 0x00
  185. #define SCSI_ASCQ_SAVING_PARMS_NOT_SUPPORTED 0x00
  186. #define SCSI_ASCQ_INVALID_COMMAND_OPERATION_CODE 0x00
  187. #define SCSI_ASCQ_MEDIUM_REMOVAL_REQUEST 0x01
  188. #define SCSI_ASCQ_INITIALIZING_COMMAND_REQUIRED 0x02
  189. #define SCSI_ASCQ_IU_CRC_ERROR_DETECTED 0x03
  190. #define SCSI_ASCQ_LUN_FORMAT_IN_PROGRESS 0x04
  191. #define SCSI_ASCQ_LUN_SELF_TEST_IN_PROGRESS 0x09
  192. #define SCSI_ASCQ_GENERAL_HARD_DRIVE_FAILURE 0x10
  193. #define SCSI_ASCQ_IDLE_CONDITION_ACTIVATE_BY_COMMAND 0x03
  194. #define SCSI_ASCQ_STANDBY_CONDITION_ACTIVATE_BY_COMMAND 0x04
  195. #define SCSI_ASCQ_POWER_STATE_CHANGE_TO_IDLE 0x42
  196. #define SCSI_ASCQ_POWER_STATE_CHANGE_TO_STANDBY 0x43
  197. #define SCSI_ASCQ_ATA_DEVICE_FEATURE_NOT_ENABLED 0x0B
  198. #define SCSI_ASCQ_UNRECOVERED_READ_ERROR_AUTO_REALLOCATE_FAIL 0x04
  199. /**
  200. *
  201. *
  202. * SCSI_STATUS_CODES These constants define all of the used SCSI status values.
  203. */
  204. #define SCSI_STATUS_GOOD 0x00
  205. #define SCSI_STATUS_CHECK_CONDITION 0x02
  206. #define SCSI_STATUS_CONDITION_MET 0x04
  207. #define SCSI_STATUS_BUSY 0x08
  208. #define SCSI_STATUS_TASKFULL 0x28
  209. #define SCSI_STATUS_ACA 0x30
  210. #define SCSI_STATUS_ABORT 0x40
  211. /**
  212. *
  213. *
  214. * SCSI_OPERATION_CODES These constants delineate all of the SCSI
  215. * command/operation codes.
  216. */
  217. #define SCSI_INQUIRY 0x12
  218. #define SCSI_READ_CAPACITY_10 0x25
  219. #define SCSI_SERVICE_ACTION_IN_16 0x9E
  220. #define SCSI_TEST_UNIT_READY 0x00
  221. #define SCSI_START_STOP_UNIT 0x1B
  222. #define SCSI_SYNCHRONIZE_CACHE_10 0x35
  223. #define SCSI_SYNCHRONIZE_CACHE_16 0x91
  224. #define SCSI_REQUEST_SENSE 0x03
  225. #define SCSI_REPORT_LUNS 0xA0
  226. #define SCSI_REASSIGN_BLOCKS 0x07
  227. #define SCSI_READ_6 0x08
  228. #define SCSI_READ_10 0x28
  229. #define SCSI_READ_12 0xA8
  230. #define SCSI_READ_16 0x88
  231. #define SCSI_WRITE_6 0x0A
  232. #define SCSI_WRITE_10 0x2A
  233. #define SCSI_WRITE_12 0xAA
  234. #define SCSI_WRITE_16 0x8A
  235. #define SCSI_VERIFY_10 0x2F
  236. #define SCSI_VERIFY_12 0xAF
  237. #define SCSI_VERIFY_16 0x8F
  238. #define SCSI_SEEK_6 0x01
  239. #define SCSI_SEEK_10 0x02
  240. #define SCSI_WRITE_VERIFY 0x2E
  241. #define SCSI_FORMAT_UNIT 0x04
  242. #define SCSI_READ_BUFFER 0x3C
  243. #define SCSI_WRITE_BUFFER 0x3B
  244. #define SCSI_SEND_DIAGNOSTIC 0x1D
  245. #define SCSI_RECEIVE_DIAGNOSTIC 0x1C
  246. #define SCSI_MODE_SENSE_6 0x1A
  247. #define SCSI_MODE_SENSE_10 0x5A
  248. #define SCSI_MODE_SELECT_6 0x15
  249. #define SCSI_MODE_SELECT_10 0x55
  250. #define SCSI_MAINTENANCE_IN 0xA3
  251. #define SCSI_LOG_SENSE 0x4D
  252. #define SCSI_LOG_SELECT 0x4C
  253. #define SCSI_RESERVE_6 0x16
  254. #define SCSI_RESERVE_10 0x56
  255. #define SCSI_RELEASE_6 0x17
  256. #define SCSI_RELEASE_10 0x57
  257. #define SCSI_ATA_PASSTHRU_12 0xA1
  258. #define SCSI_ATA_PASSTHRU_16 0x85
  259. #define SCSI_WRITE_LONG_10 0x3F
  260. #define SCSI_WRITE_LONG_16 0x9F
  261. #define SCSI_PERSISTENT_RESERVE_IN 0x5E
  262. #define SCSI_PERSISTENT_RESERVE_OUT 0x5F
  263. /**
  264. *
  265. *
  266. * SCSI_SERVICE_ACTION_IN_CODES Service action in operations.
  267. */
  268. #define SCSI_SERVICE_ACTION_IN_CODES_READ_CAPACITY_16 0x10
  269. #define SCSI_SERVICE_ACTION_MASK 0x1f
  270. /**
  271. *
  272. *
  273. * SCSI_MAINTENANCE_IN_SERVICE_ACTION_CODES MAINTENANCE IN service action codes.
  274. */
  275. #define SCSI_REPORT_TASK_MGMT 0x0D
  276. #define SCSI_REPORT_OP_CODES 0x0C
  277. /**
  278. *
  279. *
  280. * SCSI_MODE_PAGE_CONTROLS These constants delineate all of the used SCSI Mode
  281. * Page control values.
  282. */
  283. #define SCSI_MODE_SENSE_PC_CURRENT 0x0
  284. #define SCSI_MODE_SENSE_PC_CHANGEABLE 0x1
  285. #define SCSI_MODE_SENSE_PC_DEFAULT 0x2
  286. #define SCSI_MODE_SENSE_PC_SAVED 0x3
  287. #define SCSI_MODE_SENSE_PC_SHIFT 0x06
  288. #define SCSI_MODE_SENSE_PAGE_CODE_ENABLE 0x3F
  289. #define SCSI_MODE_SENSE_DBD_ENABLE 0x08
  290. #define SCSI_MODE_SENSE_LLBAA_ENABLE 0x10
  291. /**
  292. *
  293. *
  294. * SCSI_MODE_PAGE_CODES These constants delineate all of the used SCSI Mode
  295. * Page codes.
  296. */
  297. #define SCSI_MODE_PAGE_READ_WRITE_ERROR 0x01
  298. #define SCSI_MODE_PAGE_DISCONNECT_RECONNECT 0x02
  299. #define SCSI_MODE_PAGE_CACHING 0x08
  300. #define SCSI_MODE_PAGE_CONTROL 0x0A
  301. #define SCSI_MODE_PAGE_PROTOCOL_SPECIFIC_PORT 0x19
  302. #define SCSI_MODE_PAGE_POWER_CONDITION 0x1A
  303. #define SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL 0x1C
  304. #define SCSI_MODE_PAGE_ALL_PAGES 0x3F
  305. #define SCSI_MODE_SENSE_ALL_SUB_PAGES_CODE 0xFF
  306. #define SCSI_MODE_SENSE_NO_SUB_PAGES_CODE 0x0
  307. #define SCSI_MODE_SENSE_PROTOCOL_PORT_NUM_SUBPAGES 0x1
  308. #define SCSI_MODE_PAGE_CACHE_PAGE_WCE_BIT 0x04
  309. #define SCSI_MODE_PAGE_CACHE_PAGE_DRA_BIT 0x20
  310. #define SCSI_MODE_PAGE_DEXCPT_ENABLE 0x08
  311. #define SCSI_MODE_SENSE_HEADER_FUA_ENABLE 0x10
  312. #define SCSI_MODE_PAGE_POWER_CONDITION_STANDBY 0x1
  313. #define SCSI_MODE_PAGE_POWER_CONDITION_IDLE 0x2
  314. #define SCSI_MODE_SENSE_6_HEADER_LENGTH 4
  315. #define SCSI_MODE_SENSE_10_HEADER_LENGTH 8
  316. #define SCSI_MODE_SENSE_STD_BLOCK_DESCRIPTOR_LENGTH 8
  317. #define SCSI_MODE_SENSE_LLBA_BLOCK_DESCRIPTOR_LENGTH 16
  318. #define SCSI_MODE_PAGE_INFORMATIONAL_EXCP_DXCPT_ENABLE 0x08
  319. #define SCSI_MODE_PAGE_19_SAS_ID 0x6
  320. #define SCSI_MODE_PAGE_19_SUB1_PAGE_NUM 0x1
  321. #define SCSI_MODE_PAGE_19_SUB1_PC 0x59
  322. #define SCSI_MODE_HEADER_MEDIUM_TYPE_SBC 0x00
  323. /* Mode Select constrains related masks value */
  324. #define SCSI_MODE_SELECT_PF_BIT 0x1
  325. #define SCSI_MODE_SELECT_PF_MASK 0x10
  326. #define SCSI_MODE_SELECT_MODE_PAGE_MRIE_BYTE 0x6
  327. #define SCSI_MODE_SELECT_MODE_PAGE_MRIE_MASK 0x0F
  328. #define SCSI_MODE_SELECT_MODE_PAGE_SPF_MASK 0x40
  329. #define SCSI_MODE_SELECT_MODE_PAGE_01_AWRE_MASK 0x80
  330. #define SCSI_MODE_SELECT_MODE_PAGE_01_ARRE_MASK 0x40
  331. #define SCSI_MODE_SELECT_MODE_PAGE_01_RC_ERBITS_MASK 0x1F
  332. #define SCSI_MODE_SELECT_MODE_PAGE_08_FSW_LBCSS_NVDIS 0xC1
  333. #define SCSI_MODE_SELECT_MODE_PAGE_1C_PERF_TEST 0x84
  334. #define SCSI_MODE_SELECT_MODE_PAGE_0A_TST_TMF_RLEC 0xF1
  335. #define SCSI_MODE_SELECT_MODE_PAGE_0A_MODIFIER 0xF0
  336. #define SCSI_MODE_SELECT_MODE_PAGE_0A_UA_SWP 0x38
  337. #define SCSI_MODE_SELECT_MODE_PAGE_0A_TAS_AUTO 0x47
  338. #define SCSI_CONTROL_BYTE_NACA_BIT_ENABLE 0x04
  339. #define SCSI_MOVE_FUA_BIT_ENABLE 0x08
  340. #define SCSI_READ_CAPACITY_PMI_BIT_ENABLE 0x01
  341. #define SCSI_READ_CAPACITY_10_DATA_LENGTH 8
  342. #define SCSI_READ_CAPACITY_16_DATA_LENGTH 32
  343. /* Inquiry constants */
  344. #define SCSI_INQUIRY_EVPD_ENABLE 0x01
  345. #define SCSI_INQUIRY_PAGE_CODE_OFFSET 0x02
  346. #define SCSI_INQUIRY_SUPPORTED_PAGES_PAGE 0x00
  347. #define SCSI_INQUIRY_UNIT_SERIAL_NUM_PAGE 0x80
  348. #define SCSI_INQUIRY_DEVICE_ID_PAGE 0x83
  349. #define SCSI_INQUIRY_ATA_INFORMATION_PAGE 0x89
  350. #define SCSI_INQUIRY_BLOCK_DEVICE_PAGE 0xB1
  351. #define SCSI_INQUIRY_BLOCK_DEVICE_LENGTH 0x3C
  352. #define SCSI_INQUIRY_STANDARD_ALLOCATION_LENGTH 0x24 /* 36 */
  353. #define SCSI_REQUEST_SENSE_ALLOCATION_LENGTH 0xFC /* 252 */
  354. /** Defines the log page codes that are use in gathing Smart data
  355. */
  356. #define SCSI_LOG_PAGE_SUPPORTED_PAGES 0x00
  357. #define SCSI_LOG_PAGE_INFORMATION_EXCEPTION 0x2F
  358. #define SCSI_LOG_PAGE_SELF_TEST 0x10
  359. /**
  360. *
  361. *
  362. * SCSI_INQUIRY_VPD The following are constants used with vital product data
  363. * inquiry pages. Values are already shifted into the proper nibble location.
  364. */
  365. #define SCSI_PIV_ENABLE 0x80
  366. #define SCSI_LUN_ASSOCIATION 0x00
  367. #define SCSI_TARGET_PORT_ASSOCIATION 0x10
  368. #define SCSI_VEN_UNIQUE_IDENTIFIER_TYPE 0x00
  369. #define SCSI_NAA_IDENTIFIER_TYPE 0x03
  370. #define SCSI_T10_IDENTIFIER_TYPE 0x01
  371. #define SCSI_BINARY_CODE_SET 0x01
  372. #define SCSI_ASCII_CODE_SET 0x02
  373. #define SCSI_FC_PROTOCOL_IDENTIFIER 0x00
  374. #define SCSI_SAS_PROTOCOL_IDENTIFIER 0x60
  375. #define SCSI_VERIFY_BYTCHK_ENABLED 0x02
  376. #define SCSI_SYNCHRONIZE_CACHE_IMMED_ENABLED 0x02
  377. /**
  378. *
  379. *
  380. * SCSI_START_STOP_UNIT_POWER_CONDITION_CODES The following are SCSI Start Stop
  381. * Unit command Power Condition codes.
  382. */
  383. #define SCSI_START_STOP_UNIT_POWER_CONDITION_START_VALID 0x0
  384. #define SCSI_START_STOP_UNIT_POWER_CONDITION_ACTIVE 0x1
  385. #define SCSI_START_STOP_UNIT_POWER_CONDITION_IDLE 0x2
  386. #define SCSI_START_STOP_UNIT_POWER_CONDITION_STANDBY 0x3
  387. #define SCSI_START_STOP_UNIT_POWER_CONDITION_LU_CONTROL 0x7
  388. #define SCSI_START_STOP_UNIT_POWER_CONDITION_FORCE_S_CONTROL 0xB
  389. #define SCSI_START_STOP_UNIT_IMMED_MASK 0x1
  390. #define SCSI_START_STOP_UNIT_IMMED_SHIFT 0
  391. #define SCSI_START_STOP_UNIT_START_BIT_MASK 0x1
  392. #define SCSI_START_STOP_UNIT_START_BIT_SHIFT 0
  393. #define SCSI_START_STOP_UNIT_LOEJ_BIT_MASK 0x2
  394. #define SCSI_START_STOP_UNIT_LOEJ_BIT_SHIFT 1
  395. #define SCSI_START_STOP_UNIT_NO_FLUSH_MASK 0x4
  396. #define SCSI_START_STOP_UNIT_NO_FLUSH_SHIFT 2
  397. #define SCSI_START_STOP_UNIT_POWER_CONDITION_MODIFIER_MASK 0xF
  398. #define SCSI_START_STOP_UNIT_POWER_CONDITION_MODIFIER_SHIFT 0
  399. #define SCSI_START_STOP_UNIT_POWER_CONDITION_MASK 0xF0
  400. #define SCSI_START_STOP_UNIT_POWER_CONDITION_SHIFT 4
  401. #define SCSI_LOG_SENSE_PC_FIELD_MASK 0xC0
  402. #define SCSI_LOG_SENSE_PC_FIELD_SHIFT 6
  403. #define SCSI_LOG_SENSE_PAGE_CODE_FIELD_MASK 0x3F
  404. #define SCSI_LOG_SENSE_PAGE_CODE_FIELD_SHIFT 0
  405. /**
  406. *
  407. *
  408. * MRIE - Method of reporting informational exceptions codes
  409. */
  410. #define NO_REPORTING_INFO_EXCEPTION_CONDITION 0x0
  411. #define ASYNCHRONOUS_EVENT_REPORTING 0x1
  412. #define ESTABLISH_UNIT_ATTENTION_CONDITION 0x2
  413. #define CONDITIONALLY_GENERATE_RECOVERED_ERROR 0x3
  414. #define UNCONDITIONALLY_GENERATE_RECOVERED_ERROR 0x4
  415. #define GENERATE_NO_SENSE 0x5
  416. #define REPORT_INFO_EXCEPTION_CONDITION_ON_REQUEST 0x6
  417. #define SCSI_INFORMATION_EXCEPTION_DEXCPT_BIT 0x08
  418. /* Reassign Blocks masks */
  419. #define SCSI_REASSIGN_BLOCKS_LONGLBA_BIT 0x02
  420. #define SCSI_REASSIGN_BLOCKS_LONGLIST_BIT 0x01
  421. #endif /* _SCSI_H_ */