mptsas.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * linux/drivers/message/fusion/mptsas.h
  3. * High performance SCSI + LAN / Fibre Channel device drivers.
  4. * For use with PCI chip/adapter(s):
  5. * LSIFC9xx/LSI409xx Fibre Channel
  6. * running LSI MPT (Message Passing Technology) firmware.
  7. *
  8. * Copyright (c) 1999-2008 LSI Corporation
  9. * (mailto:DL-MPTFusionLinux@lsi.com)
  10. *
  11. */
  12. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  13. /*
  14. This program is free software; you can redistribute it and/or modify
  15. it under the terms of the GNU General Public License as published by
  16. the Free Software Foundation; version 2 of the License.
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. GNU General Public License for more details.
  21. NO WARRANTY
  22. THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
  23. CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
  24. LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
  25. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
  26. solely responsible for determining the appropriateness of using and
  27. distributing the Program and assumes all risks associated with its
  28. exercise of rights under this Agreement, including but not limited to
  29. the risks and costs of program errors, damage to or loss of data,
  30. programs or equipment, and unavailability or interruption of operations.
  31. DISCLAIMER OF LIABILITY
  32. NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
  33. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  34. DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
  35. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  36. TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  37. USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
  38. HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
  39. You should have received a copy of the GNU General Public License
  40. along with this program; if not, write to the Free Software
  41. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  42. */
  43. #ifndef MPTSAS_H_INCLUDED
  44. #define MPTSAS_H_INCLUDED
  45. /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  46. struct mptsas_target_reset_event {
  47. struct list_head list;
  48. EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data;
  49. u8 target_reset_issued;
  50. };
  51. enum mptsas_hotplug_action {
  52. MPTSAS_ADD_DEVICE,
  53. MPTSAS_DEL_DEVICE,
  54. MPTSAS_ADD_RAID,
  55. MPTSAS_DEL_RAID,
  56. MPTSAS_ADD_INACTIVE_VOLUME,
  57. MPTSAS_IGNORE_EVENT,
  58. };
  59. struct mptsas_hotplug_event {
  60. struct work_struct work;
  61. MPT_ADAPTER *ioc;
  62. enum mptsas_hotplug_action event_type;
  63. u64 sas_address;
  64. u8 channel;
  65. u8 id;
  66. u32 device_info;
  67. u16 handle;
  68. u16 parent_handle;
  69. u8 phy_id;
  70. u8 phys_disk_num_valid; /* hrc (hidden raid component) */
  71. u8 phys_disk_num; /* hrc - unique index*/
  72. u8 hidden_raid_component; /* hrc - don't expose*/
  73. };
  74. struct mptsas_discovery_event {
  75. struct work_struct work;
  76. MPT_ADAPTER *ioc;
  77. };
  78. /*
  79. * SAS topology structures
  80. *
  81. * The MPT Fusion firmware interface spreads information about the
  82. * SAS topology over many manufacture pages, thus we need some data
  83. * structure to collect it and process it for the SAS transport class.
  84. */
  85. struct mptsas_devinfo {
  86. u16 handle; /* unique id to address this device */
  87. u16 handle_parent; /* unique id to address parent device */
  88. u16 handle_enclosure; /* enclosure identifier of the enclosure */
  89. u16 slot; /* physical slot in enclosure */
  90. u8 phy_id; /* phy number of parent device */
  91. u8 port_id; /* sas physical port this device
  92. is assoc'd with */
  93. u8 id; /* logical target id of this device */
  94. u32 phys_disk_num; /* phys disk id, for csmi-ioctls */
  95. u8 channel; /* logical bus number of this device */
  96. u64 sas_address; /* WWN of this device,
  97. SATA is assigned by HBA,expander */
  98. u32 device_info; /* bitfield detailed info about this device */
  99. };
  100. /*
  101. * Specific details on ports, wide/narrow
  102. */
  103. struct mptsas_portinfo_details{
  104. u16 num_phys; /* number of phys belong to this port */
  105. u64 phy_bitmask; /* TODO, extend support for 255 phys */
  106. struct sas_rphy *rphy; /* transport layer rphy object */
  107. struct sas_port *port; /* transport layer port object */
  108. struct scsi_target *starget;
  109. struct mptsas_portinfo *port_info;
  110. };
  111. struct mptsas_phyinfo {
  112. u16 handle; /* unique id to address this */
  113. u8 phy_id; /* phy index */
  114. u8 port_id; /* firmware port identifier */
  115. u8 negotiated_link_rate; /* nego'd link rate for this phy */
  116. u8 hw_link_rate; /* hardware max/min phys link rate */
  117. u8 programmed_link_rate; /* programmed max/min phy link rate */
  118. u8 sas_port_add_phy; /* flag to request sas_port_add_phy*/
  119. struct mptsas_devinfo identify; /* point to phy device info */
  120. struct mptsas_devinfo attached; /* point to attached device info */
  121. struct sas_phy *phy; /* transport layer phy object */
  122. struct mptsas_portinfo *portinfo;
  123. struct mptsas_portinfo_details * port_details;
  124. };
  125. struct mptsas_portinfo {
  126. struct list_head list;
  127. u16 num_phys; /* number of phys */
  128. struct mptsas_phyinfo *phy_info;
  129. };
  130. struct mptsas_enclosure {
  131. u64 enclosure_logical_id; /* The WWN for the enclosure */
  132. u16 enclosure_handle; /* unique id to address this */
  133. u16 flags; /* details enclosure management */
  134. u16 num_slot; /* num slots */
  135. u16 start_slot; /* first slot */
  136. u8 start_id; /* starting logical target id */
  137. u8 start_channel; /* starting logical channel id */
  138. u8 sep_id; /* SEP device logical target id */
  139. u8 sep_channel; /* SEP channel logical channel id */
  140. };
  141. /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  142. #endif