intel_sas.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. #ifndef _INTEL_SAS_H_
  56. #define _INTEL_SAS_H_
  57. /**
  58. * This file contains all of the definitions relating to structures, constants,
  59. * etc. defined by the SAS specification.
  60. *
  61. *
  62. */
  63. #include <linux/kernel.h>
  64. #include "intel_scsi.h"
  65. /**
  66. * struct sci_sas_address - This structure depicts how a SAS address is
  67. * represented by SCI.
  68. *
  69. *
  70. */
  71. struct sci_sas_address {
  72. /**
  73. * This member contains the higher 32-bits of the SAS address.
  74. */
  75. u32 high;
  76. /**
  77. * This member contains the lower 32-bits of the SAS address.
  78. */
  79. u32 low;
  80. };
  81. /**
  82. * enum _SCI_SAS_TASK_ATTRIBUTE - This enumeration depicts the SAM/SAS
  83. * specification defined task attribute values for a command information
  84. * unit.
  85. *
  86. *
  87. */
  88. enum sci_sas_task_attribute {
  89. SCI_SAS_SIMPLE_ATTRIBUTE = 0,
  90. SCI_SAS_HEAD_OF_QUEUE_ATTRIBUTE = 1,
  91. SCI_SAS_ORDERED_ATTRIBUTE = 2,
  92. SCI_SAS_ACA_ATTRIBUTE = 4,
  93. };
  94. /**
  95. * enum _SCI_SAS_TASK_MGMT_FUNCTION - This enumeration depicts the SAM/SAS
  96. * specification defined task management functions.
  97. *
  98. * This HARD_RESET function listed here is not actually defined as a task
  99. * management function in the industry standard.
  100. */
  101. enum sci_sas_task_mgmt_function {
  102. SCI_SAS_ABORT_TASK = SCSI_TASK_REQUEST_ABORT_TASK,
  103. SCI_SAS_ABORT_TASK_SET = SCSI_TASK_REQUEST_ABORT_TASK_SET,
  104. SCI_SAS_CLEAR_TASK_SET = SCSI_TASK_REQUEST_CLEAR_TASK_SET,
  105. SCI_SAS_LOGICAL_UNIT_RESET = SCSI_TASK_REQUEST_LOGICAL_UNIT_RESET,
  106. SCI_SAS_I_T_NEXUS_RESET = SCSI_TASK_REQUEST_I_T_NEXUS_RESET,
  107. SCI_SAS_CLEAR_ACA = SCSI_TASK_REQUEST_CLEAR_ACA,
  108. SCI_SAS_QUERY_TASK = SCSI_TASK_REQUEST_QUERY_TASK,
  109. SCI_SAS_QUERY_TASK_SET = SCSI_TASK_REQUEST_QUERY_TASK_SET,
  110. SCI_SAS_QUERY_ASYNCHRONOUS_EVENT = SCSI_TASK_REQUEST_QUERY_UNIT_ATTENTION,
  111. SCI_SAS_HARD_RESET = 0xFF
  112. };
  113. /**
  114. * enum _SCI_SAS_FRAME_TYPE - This enumeration depicts the SAS specification
  115. * defined SSP frame types.
  116. *
  117. *
  118. */
  119. enum sci_sas_frame_type {
  120. SCI_SAS_DATA_FRAME = 0x01,
  121. SCI_SAS_XFER_RDY_FRAME = 0x05,
  122. SCI_SAS_COMMAND_FRAME = 0x06,
  123. SCI_SAS_RESPONSE_FRAME = 0x07,
  124. SCI_SAS_TASK_FRAME = 0x16
  125. };
  126. #define PHY_OPERATION_NOP 0x00
  127. #define PHY_OPERATION_LINK_RESET 0x01
  128. #define PHY_OPERATION_HARD_RESET 0x02
  129. #define PHY_OPERATION_DISABLE 0x03
  130. #define PHY_OPERATION_CLEAR_ERROR_LOG 0x05
  131. #define PHY_OPERATION_CLEAR_AFFILIATION 0x06
  132. #define NPLR_PHY_ENABLED_UNK_LINK_RATE 0x00
  133. #define NPLR_PHY_DISABLED 0x01
  134. #define NPLR_PHY_ENABLED_SPD_NEG_FAILED 0x02
  135. #define NPLR_PHY_ENABLED_SATA_HOLD 0x03
  136. #define NPLR_PHY_ENABLED_1_5G 0x08
  137. #define NPLR_PHY_ENABLED_3_0G 0x09
  138. /* SMP Function Result values. */
  139. #define SMP_RESULT_FUNCTION_ACCEPTED 0x00
  140. #define SMP_RESULT_UNKNOWN_FUNCTION 0x01
  141. #define SMP_RESULT_FUNCTION_FAILED 0x02
  142. #define SMP_RESULT_INVALID_REQUEST_FRAME_LEN 0x03
  143. #define SMP_RESULT_INAVALID_EXPANDER_CHANGE_COUNT 0x04
  144. #define SMP_RESULT_BUSY 0x05
  145. #define SMP_RESULT_INCOMPLETE_DESCRIPTOR_LIST 0x06
  146. #define SMP_RESULT_PHY_DOES_NOT_EXIST 0x10
  147. #define SMP_RESULT_INDEX_DOES_NOT_EXIST 0x11
  148. #define SMP_RESULT_PHY_DOES_NOT_SUPPORT_SATA 0x12
  149. #define SMP_RESULT_UNKNOWN_PHY_OPERATION 0x13
  150. #define SMP_RESULT_UNKNOWN_PHY_TEST_FUNCTION 0x14
  151. #define SMP_RESULT_PHY_TEST_IN_PROGRESS 0x15
  152. #define SMP_RESULT_PHY_VACANT 0x16
  153. /* Attached Device Types */
  154. #define SMP_NO_DEVICE_ATTACHED 0
  155. #define SMP_END_DEVICE_ONLY 1
  156. #define SMP_EDGE_EXPANDER_DEVICE 2
  157. #define SMP_FANOUT_EXPANDER_DEVICE 3
  158. /* Expander phy routine attribute */
  159. #define DIRECT_ROUTING_ATTRIBUTE 0
  160. #define SUBTRACTIVE_ROUTING_ATTRIBUTE 1
  161. #define TABLE_ROUTING_ATTRIBUTE 2
  162. #endif /* _INTEL_SAS_H_ */