scu_remote_node_context.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 __SCU_REMOTE_NODE_CONTEXT_HEADER__
  56. #define __SCU_REMOTE_NODE_CONTEXT_HEADER__
  57. /**
  58. * This file contains the structures and constatns used by the SCU hardware to
  59. * describe a remote node context.
  60. *
  61. *
  62. */
  63. /**
  64. * struct ssp_remote_node_context - This structure contains the SCU hardware
  65. * definition for an SSP remote node.
  66. *
  67. *
  68. */
  69. struct ssp_remote_node_context {
  70. /* WORD 0 */
  71. /**
  72. * This field is the remote node index assigned for this remote node. All
  73. * remote nodes must have a unique remote node index. The value of the remote
  74. * node index can not exceed the maximum number of remote nodes reported in
  75. * the SCU device context capacity register.
  76. */
  77. u32 remote_node_index:12;
  78. u32 reserved0_1:4;
  79. /**
  80. * This field tells the SCU hardware how many simultaneous connections that
  81. * this remote node will support.
  82. */
  83. u32 remote_node_port_width:4;
  84. /**
  85. * This field tells the SCU hardware which logical port to associate with this
  86. * remote node.
  87. */
  88. u32 logical_port_index:3;
  89. u32 reserved0_2:5;
  90. /**
  91. * This field will enable the I_T nexus loss timer for this remote node.
  92. */
  93. u32 nexus_loss_timer_enable:1;
  94. /**
  95. * This field is the for driver debug only and is not used.
  96. */
  97. u32 check_bit:1;
  98. /**
  99. * This field must be set to true when the hardware DMAs the remote node
  100. * context to the hardware SRAM. When the remote node is being invalidated
  101. * this field must be set to false.
  102. */
  103. u32 is_valid:1;
  104. /**
  105. * This field must be set to true.
  106. */
  107. u32 is_remote_node_context:1;
  108. /* WORD 1 - 2 */
  109. /**
  110. * This is the low word of the remote device SAS Address
  111. */
  112. u32 remote_sas_address_lo;
  113. /**
  114. * This field is the high word of the remote device SAS Address
  115. */
  116. u32 remote_sas_address_hi;
  117. /* WORD 3 */
  118. /**
  119. * This field reprensets the function number assigned to this remote device.
  120. * This value must match the virtual function number that is being used to
  121. * communicate to the device.
  122. */
  123. u32 function_number:8;
  124. u32 reserved3_1:8;
  125. /**
  126. * This field provides the driver a way to cheat on the arbitration wait time
  127. * for this remote node.
  128. */
  129. u32 arbitration_wait_time:16;
  130. /* WORD 4 */
  131. /**
  132. * This field tells the SCU hardware how long this device may occupy the
  133. * connection before it must be closed.
  134. */
  135. u32 connection_occupancy_timeout:16;
  136. /**
  137. * This field tells the SCU hardware how long to maintain a connection when
  138. * there are no frames being transmitted on the link.
  139. */
  140. u32 connection_inactivity_timeout:16;
  141. /* WORD 5 */
  142. /**
  143. * This field allows the driver to cheat on the arbitration wait time for this
  144. * remote node.
  145. */
  146. u32 initial_arbitration_wait_time:16;
  147. /**
  148. * This field is tells the hardware what to program for the connection rate in
  149. * the open address frame. See the SAS spec for valid values.
  150. */
  151. u32 oaf_connection_rate:4;
  152. /**
  153. * This field tells the SCU hardware what to program for the features in the
  154. * open address frame. See the SAS spec for valid values.
  155. */
  156. u32 oaf_features:4;
  157. /**
  158. * This field tells the SCU hardware what to use for the source zone group in
  159. * the open address frame. See the SAS spec for more details on zoning.
  160. */
  161. u32 oaf_source_zone_group:8;
  162. /* WORD 6 */
  163. /**
  164. * This field tells the SCU hardware what to use as the more capibilities in
  165. * the open address frame. See the SAS Spec for details.
  166. */
  167. u32 oaf_more_compatibility_features;
  168. /* WORD 7 */
  169. u32 reserved7;
  170. };
  171. /**
  172. * struct stp_remote_node_context - This structure contains the SCU hardware
  173. * definition for a STP remote node.
  174. *
  175. * STP Targets are not yet supported so this definition is a placeholder until
  176. * we do support them.
  177. */
  178. struct stp_remote_node_context {
  179. /**
  180. * Placeholder data for the STP remote node.
  181. */
  182. u32 data[8];
  183. };
  184. /**
  185. * This union combines the SAS and SATA remote node definitions.
  186. *
  187. * union scu_remote_node_context
  188. */
  189. union scu_remote_node_context {
  190. /**
  191. * SSP Remote Node
  192. */
  193. struct ssp_remote_node_context ssp;
  194. /**
  195. * STP Remote Node
  196. */
  197. struct stp_remote_node_context stp;
  198. };
  199. #endif /* __SCU_REMOTE_NODE_CONTEXT_HEADER__ */