1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright 2000-2020 Broadcom Inc. All rights reserved.
4  *
5  *
6  *          Name:  mpi2_cnfg.h
7  *         Title:  MPI Configuration messages and pages
8  * Creation Date:  November 10, 2006
9  *
10  *    mpi2_cnfg.h Version:  02.00.46
11  *
12  * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
13  *       prefix are for use only on MPI v2.5 products, and must not be used
14  *       with MPI v2.0 products. Unless otherwise noted, names beginning with
15  *       MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
16  *
17  * Version History
18  * ---------------
19  *
20  * Date      Version   Description
21  * --------  --------  ------------------------------------------------------
22  * 04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
23  * 06-04-07  02.00.01  Added defines for SAS IO Unit Page 2 PhyFlags.
24  *                     Added Manufacturing Page 11.
25  *                     Added MPI2_SAS_EXPANDER0_FLAGS_CONNECTOR_END_DEVICE
26  *                     define.
27  * 06-26-07  02.00.02  Adding generic structure for product-specific
28  *                     Manufacturing pages: MPI2_CONFIG_PAGE_MANUFACTURING_PS.
29  *                     Rework of BIOS Page 2 configuration page.
30  *                     Fixed MPI2_BIOSPAGE2_BOOT_DEVICE to be a union of the
31  *                     forms.
32  *                     Added configuration pages IOC Page 8 and Driver
33  *                     Persistent Mapping Page 0.
34  * 08-31-07  02.00.03  Modified configuration pages dealing with Integrated
35  *                     RAID (Manufacturing Page 4, RAID Volume Pages 0 and 1,
36  *                     RAID Physical Disk Pages 0 and 1, RAID Configuration
37  *                     Page 0).
38  *                     Added new value for AccessStatus field of SAS Device
39  *                     Page 0 (_SATA_NEEDS_INITIALIZATION).
40  * 10-31-07  02.00.04  Added missing SEPDevHandle field to
41  *                     MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0.
42  * 12-18-07  02.00.05  Modified IO Unit Page 0 to use 32-bit version fields for
43  *                     NVDATA.
44  *                     Modified IOC Page 7 to use masks and added field for
45  *                     SASBroadcastPrimitiveMasks.
46  *                     Added MPI2_CONFIG_PAGE_BIOS_4.
47  *                     Added MPI2_CONFIG_PAGE_LOG_0.
48  * 02-29-08  02.00.06  Modified various names to make them 32-character unique.
49  *                     Added SAS Device IDs.
50  *                     Updated Integrated RAID configuration pages including
51  *                     Manufacturing Page 4, IOC Page 6, and RAID Configuration
52  *                     Page 0.
53  * 05-21-08  02.00.07  Added define MPI2_MANPAGE4_MIX_SSD_SAS_SATA.
54  *                     Added define MPI2_MANPAGE4_PHYSDISK_128MB_COERCION.
55  *                     Fixed define MPI2_IOCPAGE8_FLAGS_ENCLOSURE_SLOT_MAPPING.
56  *                     Added missing MaxNumRoutedSasAddresses field to
57  *                     MPI2_CONFIG_PAGE_EXPANDER_0.
58  *                     Added SAS Port Page 0.
59  *                     Modified structure layout for
60  *                     MPI2_CONFIG_PAGE_DRIVER_MAPPING_0.
61  * 06-27-08  02.00.08  Changed MPI2_CONFIG_PAGE_RD_PDISK_1 to use
62  *                     MPI2_RAID_PHYS_DISK1_PATH_MAX to size the array.
63  * 10-02-08  02.00.09  Changed MPI2_RAID_PGAD_CONFIGNUM_MASK from 0x0000FFFF
64  *                     to 0x000000FF.
65  *                     Added two new values for the Physical Disk Coercion Size
66  *                     bits in the Flags field of Manufacturing Page 4.
67  *                     Added product-specific Manufacturing pages 16 to 31.
68  *                     Modified Flags bits for controlling write cache on SATA
69  *                     drives in IO Unit Page 1.
70  *                     Added new bit to AdditionalControlFlags of SAS IO Unit
71  *                     Page 1 to control Invalid Topology Correction.
72  *                     Added additional defines for RAID Volume Page 0
73  *                     VolumeStatusFlags field.
74  *                     Modified meaning of RAID Volume Page 0 VolumeSettings
75  *                     define for auto-configure of hot-swap drives.
76  *                     Added SupportedPhysDisks field to RAID Volume Page 1 and
77  *                     added related defines.
78  *                     Added PhysDiskAttributes field (and related defines) to
79  *                     RAID Physical Disk Page 0.
80  *                     Added MPI2_SAS_PHYINFO_PHY_VACANT define.
81  *                     Added three new DiscoveryStatus bits for SAS IO Unit
82  *                     Page 0 and SAS Expander Page 0.
83  *                     Removed multiplexing information from SAS IO Unit pages.
84  *                     Added BootDeviceWaitTime field to SAS IO Unit Page 4.
85  *                     Removed Zone Address Resolved bit from PhyInfo and from
86  *                     Expander Page 0 Flags field.
87  *                     Added two new AccessStatus values to SAS Device Page 0
88  *                     for indicating routing problems. Added 3 reserved words
89  *                     to this page.
90  * 01-19-09  02.00.10  Fixed defines for GPIOVal field of IO Unit Page 3.
91  *                     Inserted missing reserved field into structure for IOC
92  *                     Page 6.
93  *                     Added more pending task bits to RAID Volume Page 0
94  *                     VolumeStatusFlags defines.
95  *                     Added MPI2_PHYSDISK0_STATUS_FLAG_NOT_CERTIFIED define.
96  *                     Added a new DiscoveryStatus bit for SAS IO Unit Page 0
97  *                     and SAS Expander Page 0 to flag a downstream initiator
98  *                     when in simplified routing mode.
99  *                     Removed SATA Init Failure defines for DiscoveryStatus
100  *                     fields of SAS IO Unit Page 0 and SAS Expander Page 0.
101  *                     Added MPI2_SAS_DEVICE0_ASTATUS_DEVICE_BLOCKED define.
102  *                     Added PortGroups, DmaGroup, and ControlGroup fields to
103  *                     SAS Device Page 0.
104  * 05-06-09  02.00.11  Added structures and defines for IO Unit Page 5 and IO
105  *                     Unit Page 6.
106  *                     Added expander reduced functionality data to SAS
107  *                     Expander Page 0.
108  *                     Added SAS PHY Page 2 and SAS PHY Page 3.
109  * 07-30-09  02.00.12  Added IO Unit Page 7.
110  *                     Added new device ids.
111  *                     Added SAS IO Unit Page 5.
112  *                     Added partial and slumber power management capable flags
113  *                     to SAS Device Page 0 Flags field.
114  *                     Added PhyInfo defines for power condition.
115  *                     Added Ethernet configuration pages.
116  * 10-28-09  02.00.13  Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY.
117  *                     Added SAS PHY Page 4 structure and defines.
118  * 02-10-10  02.00.14  Modified the comments for the configuration page
119  *                     structures that contain an array of data. The host
120  *                     should use the "count" field in the page data (e.g. the
121  *                     NumPhys field) to determine the number of valid elements
122  *                     in the array.
123  *                     Added/modified some MPI2_MFGPAGE_DEVID_SAS defines.
124  *                     Added PowerManagementCapabilities to IO Unit Page 7.
125  *                     Added PortWidthModGroup field to
126  *                     MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS.
127  *                     Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines.
128  *                     Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines.
129  *                     Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines.
130  * 05-12-10  02.00.15  Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT
131  *                     define.
132  *                     Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define.
133  *                     Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define.
134  * 08-11-10  02.00.16  Removed IO Unit Page 1 device path (multi-pathing)
135  *                     defines.
136  * 11-10-10  02.00.17  Added ReceptacleID field (replacing Reserved1) to
137  *                     MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for
138  *                     the Pinout field.
139  *                     Added BoardTemperature and BoardTemperatureUnits fields
140  *                     to MPI2_CONFIG_PAGE_IO_UNIT_7.
141  *                     Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define
142  *                     and MPI2_CONFIG_PAGE_EXT_MAN_PS structure.
143  * 02-23-11  02.00.18  Added ProxyVF_ID field to MPI2_CONFIG_REQUEST.
144  *                     Added IO Unit Page 8, IO Unit Page 9,
145  *                     and IO Unit Page 10.
146  *                     Added SASNotifyPrimitiveMasks field to
147  *                     MPI2_CONFIG_PAGE_IOC_7.
148  * 03-09-11  02.00.19  Fixed IO Unit Page 10 (to match the spec).
149  * 05-25-11  02.00.20  Cleaned up a few comments.
150  * 08-24-11  02.00.21  Marked the IO Unit Page 7 PowerManagementCapabilities
151  *                     for PCIe link as obsolete.
152  *                     Added SpinupFlags field containing a Disable Spin-up bit
153  *                     to the MPI2_SAS_IOUNIT4_SPINUP_GROUP fields of SAS IO
154  *                     Unit Page 4.
155  * 11-18-11  02.00.22  Added define MPI2_IOCPAGE6_CAP_FLAGS_4K_SECTORS_SUPPORT.
156  *                     Added UEFIVersion field to BIOS Page 1 and defined new
157  *                     BiosOptions bits.
158  *                     Incorporating additions for MPI v2.5.
159  * 11-27-12  02.00.23  Added MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER.
160  *                     Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID.
161  * 12-20-12  02.00.24  Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as
162  *                     obsolete for MPI v2.5 and later.
163  *                     Added some defines for 12G SAS speeds.
164  * 04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
165  *                     Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
166  *                     match the specification.
167  * 08-19-13  02.00.26  Added reserved words to MPI2_CONFIG_PAGE_IO_UNIT_7 for
168  *			future use.
169  * 12-05-13  02.00.27  Added MPI2_MANPAGE7_FLAG_BASE_ENCLOSURE_LEVEL for
170  *		       MPI2_CONFIG_PAGE_MAN_7.
171  *		       Added EnclosureLevel and ConnectorName fields to
172  *		       MPI2_CONFIG_PAGE_SAS_DEV_0.
173  *		       Added MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID for
174  *		       MPI2_CONFIG_PAGE_SAS_DEV_0.
175  *		       Added EnclosureLevel field to
176  *		       MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0.
177  *		       Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for
178  *		       MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0.
179  * 01-08-14  02.00.28  Added more defines for the BiosOptions field of
180  *		       MPI2_CONFIG_PAGE_BIOS_1.
181  * 06-13-14  02.00.29  Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and
182  *                     more defines for the BiosOptions field.
183  * 11-18-14  02.00.30  Updated copyright information.
184  *                     Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG.
185  *                     Added AdapterOrderAux fields to BIOS Page 3.
186  * 03-16-15  02.00.31  Updated for MPI v2.6.
187  *                     Added Flags field to IO Unit Page 7.
188  *                     Added new SAS Phy Event codes
189  * 05-25-15  02.00.33  Added more defines for the BiosOptions field of
190  *                     MPI2_CONFIG_PAGE_BIOS_1.
191  * 08-25-15  02.00.34  Bumped Header Version.
192  * 12-18-15  02.00.35  Added SATADeviceWaitTime to SAS IO Unit Page 4.
193  * 01-21-16  02.00.36  Added/modified MPI2_MFGPAGE_DEVID_SAS defines.
194  *                     Added Link field to PCIe Link Pages
195  *                     Added EnclosureLevel and ConnectorName to PCIe
196  *                     Device Page 0.
197  *                     Added define for PCIE IoUnit page 1 max rate shift.
198  *                     Added comment for reserved ExtPageTypes.
199  *                     Added SAS 4 22.5 gbs speed support.
200  *                     Added PCIe 4 16.0 GT/sec speec support.
201  *                     Removed AHCI support.
202  *                     Removed SOP support.
203  *                     Added NegotiatedLinkRate and NegotiatedPortWidth to
204  *                     PCIe device page 0.
205  * 04-10-16  02.00.37  Fixed MPI2_MFGPAGE_DEVID_SAS3616/3708 defines
206  * 07-01-16  02.00.38  Added Manufacturing page 7 Connector types.
207  *                     Changed declaration of ConnectorName in PCIe DevicePage0
208  *                     to match SAS DevicePage 0.
209  *                     Added SATADeviceWaitTime to IO Unit Page 11.
210  *                     Added MPI26_MFGPAGE_DEVID_SAS4008
211  *                     Added x16 PCIe width to IO Unit Page 7
212  *                     Added LINKFLAGS to control SRIS in PCIe IO Unit page 1
213  *                     phy data.
214  *                     Added InitStatus to PCIe IO Unit Page 1 header.
215  * 09-01-16  02.00.39  Added MPI26_CONFIG_PAGE_ENCLOSURE_0 and related defines.
216  *                     Added MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE and
217  *                     MPI26_ENCLOS_PGAD_FORM_HANDLE page address formats.
218  * 02-02-17  02.00.40  Added MPI2_MANPAGE7_SLOT_UNKNOWN.
219  *                     Added ChassisSlot field to SAS Enclosure Page 0.
220  *                     Added ChassisSlot Valid bit (bit 5) to the Flags field
221  *                     in SAS Enclosure Page 0.
222  * 06-13-17  02.00.41  Added MPI26_MFGPAGE_DEVID_SAS3816 and
223  *                     MPI26_MFGPAGE_DEVID_SAS3916 defines.
224  *                     Removed MPI26_MFGPAGE_DEVID_SAS4008 define.
225  *                     Added MPI26_PCIEIOUNIT1_LINKFLAGS_SRNS_EN define.
226  *                     Renamed PI26_PCIEIOUNIT1_LINKFLAGS_EN_SRIS to
227  *                     PI26_PCIEIOUNIT1_LINKFLAGS_SRIS_EN.
228  *                     Renamed MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SRIS to
229  *                     MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SEPARATE_REFCLK.
230  * 09-29-17  02.00.42  Added ControllerResetTO field to PCIe Device Page 2.
231  *                     Added NOIOB field to PCIe Device Page 2.
232  *                     Added MPI26_PCIEDEV2_CAP_DATA_BLK_ALIGN_AND_GRAN to
233  *                     the Capabilities field of PCIe Device Page 2.
234  * 07-22-18  02.00.43  Added defines for SAS3916 and SAS3816.
235  *                     Added WRiteCache defines to IO Unit Page 1.
236  *                     Added MaxEnclosureLevel to BIOS Page 1.
237  *                     Added OEMRD to SAS Enclosure Page 1.
238  *                     Added DMDReportPCIe to PCIe IO Unit Page 1.
239  *                     Added Flags field and flags for Retimers to
240  *                     PCIe Switch Page 1.
241  * 08-02-18  02.00.44  Added Slotx2, Slotx4 to ManPage 7.
242  * 08-15-18  02.00.45  Added ProductSpecific field at end of IOC Page 1
243  * 08-28-18  02.00.46  Added NVMs Write Cache flag to IOUnitPage1
244  *                     Added DMDReport Delay Time defines to
245  *                     PCIeIOUnitPage1
246  * --------------------------------------------------------------------------
247  */
248 
249 #ifndef MPI2_CNFG_H
250 #define MPI2_CNFG_H
251 
252 /*****************************************************************************
253 *  Configuration Page Header and defines
254 *****************************************************************************/
255 
256 /*Config Page Header */
257 typedef struct _MPI2_CONFIG_PAGE_HEADER {
258 	U8                 PageVersion;                /*0x00 */
259 	U8                 PageLength;                 /*0x01 */
260 	U8                 PageNumber;                 /*0x02 */
261 	U8                 PageType;                   /*0x03 */
262 } MPI2_CONFIG_PAGE_HEADER, *PTR_MPI2_CONFIG_PAGE_HEADER,
263 	Mpi2ConfigPageHeader_t, *pMpi2ConfigPageHeader_t;
264 
265 typedef union _MPI2_CONFIG_PAGE_HEADER_UNION {
266 	MPI2_CONFIG_PAGE_HEADER  Struct;
267 	U8                       Bytes[4];
268 	U16                      Word16[2];
269 	U32                      Word32;
270 } MPI2_CONFIG_PAGE_HEADER_UNION, *PTR_MPI2_CONFIG_PAGE_HEADER_UNION,
271 	Mpi2ConfigPageHeaderUnion, *pMpi2ConfigPageHeaderUnion;
272 
273 /*Extended Config Page Header */
274 typedef struct _MPI2_CONFIG_EXTENDED_PAGE_HEADER {
275 	U8                  PageVersion;                /*0x00 */
276 	U8                  Reserved1;                  /*0x01 */
277 	U8                  PageNumber;                 /*0x02 */
278 	U8                  PageType;                   /*0x03 */
279 	U16                 ExtPageLength;              /*0x04 */
280 	U8                  ExtPageType;                /*0x06 */
281 	U8                  Reserved2;                  /*0x07 */
282 } MPI2_CONFIG_EXTENDED_PAGE_HEADER,
283 	*PTR_MPI2_CONFIG_EXTENDED_PAGE_HEADER,
284 	Mpi2ConfigExtendedPageHeader_t,
285 	*pMpi2ConfigExtendedPageHeader_t;
286 
287 typedef union _MPI2_CONFIG_EXT_PAGE_HEADER_UNION {
288 	MPI2_CONFIG_PAGE_HEADER          Struct;
289 	MPI2_CONFIG_EXTENDED_PAGE_HEADER Ext;
290 	U8                               Bytes[8];
291 	U16                              Word16[4];
292 	U32                              Word32[2];
293 } MPI2_CONFIG_EXT_PAGE_HEADER_UNION,
294 	*PTR_MPI2_CONFIG_EXT_PAGE_HEADER_UNION,
295 	Mpi2ConfigPageExtendedHeaderUnion,
296 	*pMpi2ConfigPageExtendedHeaderUnion;
297 
298 
299 /*PageType field values */
300 #define MPI2_CONFIG_PAGEATTR_READ_ONLY              (0x00)
301 #define MPI2_CONFIG_PAGEATTR_CHANGEABLE             (0x10)
302 #define MPI2_CONFIG_PAGEATTR_PERSISTENT             (0x20)
303 #define MPI2_CONFIG_PAGEATTR_MASK                   (0xF0)
304 
305 #define MPI2_CONFIG_PAGETYPE_IO_UNIT                (0x00)
306 #define MPI2_CONFIG_PAGETYPE_IOC                    (0x01)
307 #define MPI2_CONFIG_PAGETYPE_BIOS                   (0x02)
308 #define MPI2_CONFIG_PAGETYPE_RAID_VOLUME            (0x08)
309 #define MPI2_CONFIG_PAGETYPE_MANUFACTURING          (0x09)
310 #define MPI2_CONFIG_PAGETYPE_RAID_PHYSDISK          (0x0A)
311 #define MPI2_CONFIG_PAGETYPE_EXTENDED               (0x0F)
312 #define MPI2_CONFIG_PAGETYPE_MASK                   (0x0F)
313 
314 #define MPI2_CONFIG_TYPENUM_MASK                    (0x0FFF)
315 
316 
317 /*ExtPageType field values */
318 #define MPI2_CONFIG_EXTPAGETYPE_SAS_IO_UNIT         (0x10)
319 #define MPI2_CONFIG_EXTPAGETYPE_SAS_EXPANDER        (0x11)
320 #define MPI2_CONFIG_EXTPAGETYPE_SAS_DEVICE          (0x12)
321 #define MPI2_CONFIG_EXTPAGETYPE_SAS_PHY             (0x13)
322 #define MPI2_CONFIG_EXTPAGETYPE_LOG                 (0x14)
323 #define MPI2_CONFIG_EXTPAGETYPE_ENCLOSURE           (0x15)
324 #define MPI2_CONFIG_EXTPAGETYPE_RAID_CONFIG         (0x16)
325 #define MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING      (0x17)
326 #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT            (0x18)
327 #define MPI2_CONFIG_EXTPAGETYPE_ETHERNET            (0x19)
328 #define MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING   (0x1A)
329 #define MPI2_CONFIG_EXTPAGETYPE_PCIE_IO_UNIT        (0x1B)
330 #define MPI2_CONFIG_EXTPAGETYPE_PCIE_SWITCH         (0x1C)
331 #define MPI2_CONFIG_EXTPAGETYPE_PCIE_DEVICE         (0x1D)
332 #define MPI2_CONFIG_EXTPAGETYPE_PCIE_LINK           (0x1E)
333 
334 
335 /*****************************************************************************
336 *  PageAddress defines
337 *****************************************************************************/
338 
339 /*RAID Volume PageAddress format */
340 #define MPI2_RAID_VOLUME_PGAD_FORM_MASK             (0xF0000000)
341 #define MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE  (0x00000000)
342 #define MPI2_RAID_VOLUME_PGAD_FORM_HANDLE           (0x10000000)
343 
344 #define MPI2_RAID_VOLUME_PGAD_HANDLE_MASK           (0x0000FFFF)
345 
346 
347 /*RAID Physical Disk PageAddress format */
348 #define MPI2_PHYSDISK_PGAD_FORM_MASK                    (0xF0000000)
349 #define MPI2_PHYSDISK_PGAD_FORM_GET_NEXT_PHYSDISKNUM    (0x00000000)
350 #define MPI2_PHYSDISK_PGAD_FORM_PHYSDISKNUM             (0x10000000)
351 #define MPI2_PHYSDISK_PGAD_FORM_DEVHANDLE               (0x20000000)
352 
353 #define MPI2_PHYSDISK_PGAD_PHYSDISKNUM_MASK             (0x000000FF)
354 #define MPI2_PHYSDISK_PGAD_DEVHANDLE_MASK               (0x0000FFFF)
355 
356 
357 /*SAS Expander PageAddress format */
358 #define MPI2_SAS_EXPAND_PGAD_FORM_MASK              (0xF0000000)
359 #define MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL     (0x00000000)
360 #define MPI2_SAS_EXPAND_PGAD_FORM_HNDL_PHY_NUM      (0x10000000)
361 #define MPI2_SAS_EXPAND_PGAD_FORM_HNDL              (0x20000000)
362 
363 #define MPI2_SAS_EXPAND_PGAD_HANDLE_MASK            (0x0000FFFF)
364 #define MPI2_SAS_EXPAND_PGAD_PHYNUM_MASK            (0x00FF0000)
365 #define MPI2_SAS_EXPAND_PGAD_PHYNUM_SHIFT           (16)
366 
367 
368 /*SAS Device PageAddress format */
369 #define MPI2_SAS_DEVICE_PGAD_FORM_MASK              (0xF0000000)
370 #define MPI2_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE   (0x00000000)
371 #define MPI2_SAS_DEVICE_PGAD_FORM_HANDLE            (0x20000000)
372 
373 #define MPI2_SAS_DEVICE_PGAD_HANDLE_MASK            (0x0000FFFF)
374 
375 
376 /*SAS PHY PageAddress format */
377 #define MPI2_SAS_PHY_PGAD_FORM_MASK                 (0xF0000000)
378 #define MPI2_SAS_PHY_PGAD_FORM_PHY_NUMBER           (0x00000000)
379 #define MPI2_SAS_PHY_PGAD_FORM_PHY_TBL_INDEX        (0x10000000)
380 
381 #define MPI2_SAS_PHY_PGAD_PHY_NUMBER_MASK           (0x000000FF)
382 #define MPI2_SAS_PHY_PGAD_PHY_TBL_INDEX_MASK        (0x0000FFFF)
383 
384 
385 /*SAS Port PageAddress format */
386 #define MPI2_SASPORT_PGAD_FORM_MASK                 (0xF0000000)
387 #define MPI2_SASPORT_PGAD_FORM_GET_NEXT_PORT        (0x00000000)
388 #define MPI2_SASPORT_PGAD_FORM_PORT_NUM             (0x10000000)
389 
390 #define MPI2_SASPORT_PGAD_PORTNUMBER_MASK           (0x00000FFF)
391 
392 
393 /*SAS Enclosure PageAddress format */
394 #define MPI2_SAS_ENCLOS_PGAD_FORM_MASK              (0xF0000000)
395 #define MPI2_SAS_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE   (0x00000000)
396 #define MPI2_SAS_ENCLOS_PGAD_FORM_HANDLE            (0x10000000)
397 
398 #define MPI2_SAS_ENCLOS_PGAD_HANDLE_MASK            (0x0000FFFF)
399 
400 /*Enclosure PageAddress format */
401 #define MPI26_ENCLOS_PGAD_FORM_MASK                 (0xF0000000)
402 #define MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE      (0x00000000)
403 #define MPI26_ENCLOS_PGAD_FORM_HANDLE               (0x10000000)
404 
405 #define MPI26_ENCLOS_PGAD_HANDLE_MASK               (0x0000FFFF)
406 
407 /*RAID Configuration PageAddress format */
408 #define MPI2_RAID_PGAD_FORM_MASK                    (0xF0000000)
409 #define MPI2_RAID_PGAD_FORM_GET_NEXT_CONFIGNUM      (0x00000000)
410 #define MPI2_RAID_PGAD_FORM_CONFIGNUM               (0x10000000)
411 #define MPI2_RAID_PGAD_FORM_ACTIVE_CONFIG           (0x20000000)
412 
413 #define MPI2_RAID_PGAD_CONFIGNUM_MASK               (0x000000FF)
414 
415 
416 /*Driver Persistent Mapping PageAddress format */
417 #define MPI2_DPM_PGAD_FORM_MASK                     (0xF0000000)
418 #define MPI2_DPM_PGAD_FORM_ENTRY_RANGE              (0x00000000)
419 
420 #define MPI2_DPM_PGAD_ENTRY_COUNT_MASK              (0x0FFF0000)
421 #define MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT             (16)
422 #define MPI2_DPM_PGAD_START_ENTRY_MASK              (0x0000FFFF)
423 
424 
425 /*Ethernet PageAddress format */
426 #define MPI2_ETHERNET_PGAD_FORM_MASK                (0xF0000000)
427 #define MPI2_ETHERNET_PGAD_FORM_IF_NUM              (0x00000000)
428 
429 #define MPI2_ETHERNET_PGAD_IF_NUMBER_MASK           (0x000000FF)
430 
431 
432 /*PCIe Switch PageAddress format */
433 #define MPI26_PCIE_SWITCH_PGAD_FORM_MASK            (0xF0000000)
434 #define MPI26_PCIE_SWITCH_PGAD_FORM_GET_NEXT_HNDL   (0x00000000)
435 #define MPI26_PCIE_SWITCH_PGAD_FORM_HNDL_PORTNUM    (0x10000000)
436 #define MPI26_PCIE_SWITCH_EXPAND_PGAD_FORM_HNDL     (0x20000000)
437 
438 #define MPI26_PCIE_SWITCH_PGAD_HANDLE_MASK          (0x0000FFFF)
439 #define MPI26_PCIE_SWITCH_PGAD_PORTNUM_MASK         (0x00FF0000)
440 #define MPI26_PCIE_SWITCH_PGAD_PORTNUM_SHIFT        (16)
441 
442 
443 /*PCIe Device PageAddress format */
444 #define MPI26_PCIE_DEVICE_PGAD_FORM_MASK            (0xF0000000)
445 #define MPI26_PCIE_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
446 #define MPI26_PCIE_DEVICE_PGAD_FORM_HANDLE          (0x20000000)
447 
448 #define MPI26_PCIE_DEVICE_PGAD_HANDLE_MASK          (0x0000FFFF)
449 
450 /*PCIe Link PageAddress format */
451 #define MPI26_PCIE_LINK_PGAD_FORM_MASK            (0xF0000000)
452 #define MPI26_PCIE_LINK_PGAD_FORM_GET_NEXT_LINK   (0x00000000)
453 #define MPI26_PCIE_LINK_PGAD_FORM_LINK_NUM        (0x10000000)
454 
455 #define MPI26_PCIE_DEVICE_PGAD_LINKNUM_MASK       (0x000000FF)
456 
457 
458 
459 /****************************************************************************
460 *  Configuration messages
461 ****************************************************************************/
462 
463 /*Configuration Request Message */
464 typedef struct _MPI2_CONFIG_REQUEST {
465 	U8                      Action;                     /*0x00 */
466 	U8                      SGLFlags;                   /*0x01 */
467 	U8                      ChainOffset;                /*0x02 */
468 	U8                      Function;                   /*0x03 */
469 	U16                     ExtPageLength;              /*0x04 */
470 	U8                      ExtPageType;                /*0x06 */
471 	U8                      MsgFlags;                   /*0x07 */
472 	U8                      VP_ID;                      /*0x08 */
473 	U8                      VF_ID;                      /*0x09 */
474 	U16                     Reserved1;                  /*0x0A */
475 	U8                      Reserved2;                  /*0x0C */
476 	U8                      ProxyVF_ID;                 /*0x0D */
477 	U16                     Reserved4;                  /*0x0E */
478 	U32                     Reserved3;                  /*0x10 */
479 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x14 */
480 	U32                     PageAddress;                /*0x18 */
481 	MPI2_SGE_IO_UNION       PageBufferSGE;              /*0x1C */
482 } MPI2_CONFIG_REQUEST, *PTR_MPI2_CONFIG_REQUEST,
483 	Mpi2ConfigRequest_t, *pMpi2ConfigRequest_t;
484 
485 /*values for the Action field */
486 #define MPI2_CONFIG_ACTION_PAGE_HEADER              (0x00)
487 #define MPI2_CONFIG_ACTION_PAGE_READ_CURRENT        (0x01)
488 #define MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT       (0x02)
489 #define MPI2_CONFIG_ACTION_PAGE_DEFAULT             (0x03)
490 #define MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM         (0x04)
491 #define MPI2_CONFIG_ACTION_PAGE_READ_DEFAULT        (0x05)
492 #define MPI2_CONFIG_ACTION_PAGE_READ_NVRAM          (0x06)
493 #define MPI2_CONFIG_ACTION_PAGE_GET_CHANGEABLE      (0x07)
494 
495 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
496 
497 
498 /*Config Reply Message */
499 typedef struct _MPI2_CONFIG_REPLY {
500 	U8                      Action;                     /*0x00 */
501 	U8                      SGLFlags;                   /*0x01 */
502 	U8                      MsgLength;                  /*0x02 */
503 	U8                      Function;                   /*0x03 */
504 	U16                     ExtPageLength;              /*0x04 */
505 	U8                      ExtPageType;                /*0x06 */
506 	U8                      MsgFlags;                   /*0x07 */
507 	U8                      VP_ID;                      /*0x08 */
508 	U8                      VF_ID;                      /*0x09 */
509 	U16                     Reserved1;                  /*0x0A */
510 	U16                     Reserved2;                  /*0x0C */
511 	U16                     IOCStatus;                  /*0x0E */
512 	U32                     IOCLogInfo;                 /*0x10 */
513 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x14 */
514 } MPI2_CONFIG_REPLY, *PTR_MPI2_CONFIG_REPLY,
515 	Mpi2ConfigReply_t, *pMpi2ConfigReply_t;
516 
517 
518 
519 /*****************************************************************************
520 *
521 *              C o n f i g u r a t i o n    P a g e s
522 *
523 *****************************************************************************/
524 
525 /****************************************************************************
526 *  Manufacturing Config pages
527 ****************************************************************************/
528 
529 #define MPI2_MFGPAGE_VENDORID_LSI                   (0x1000)
530 
531 /*MPI v2.0 SAS products */
532 #define MPI2_MFGPAGE_DEVID_SAS2004                  (0x0070)
533 #define MPI2_MFGPAGE_DEVID_SAS2008                  (0x0072)
534 #define MPI2_MFGPAGE_DEVID_SAS2108_1                (0x0074)
535 #define MPI2_MFGPAGE_DEVID_SAS2108_2                (0x0076)
536 #define MPI2_MFGPAGE_DEVID_SAS2108_3                (0x0077)
537 #define MPI2_MFGPAGE_DEVID_SAS2116_1                (0x0064)
538 #define MPI2_MFGPAGE_DEVID_SAS2116_2                (0x0065)
539 
540 #define MPI2_MFGPAGE_DEVID_SSS6200                  (0x007E)
541 
542 #define MPI2_MFGPAGE_DEVID_SAS2208_1                (0x0080)
543 #define MPI2_MFGPAGE_DEVID_SAS2208_2                (0x0081)
544 #define MPI2_MFGPAGE_DEVID_SAS2208_3                (0x0082)
545 #define MPI2_MFGPAGE_DEVID_SAS2208_4                (0x0083)
546 #define MPI2_MFGPAGE_DEVID_SAS2208_5                (0x0084)
547 #define MPI2_MFGPAGE_DEVID_SAS2208_6                (0x0085)
548 #define MPI2_MFGPAGE_DEVID_SAS2308_1                (0x0086)
549 #define MPI2_MFGPAGE_DEVID_SAS2308_2                (0x0087)
550 #define MPI2_MFGPAGE_DEVID_SAS2308_3                (0x006E)
551 #define MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP            (0x02B0)
552 #define MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP_1          (0x02B1)
553 
554 /*MPI v2.5 SAS products */
555 #define MPI25_MFGPAGE_DEVID_SAS3004                 (0x0096)
556 #define MPI25_MFGPAGE_DEVID_SAS3008                 (0x0097)
557 #define MPI25_MFGPAGE_DEVID_SAS3108_1               (0x0090)
558 #define MPI25_MFGPAGE_DEVID_SAS3108_2               (0x0091)
559 #define MPI25_MFGPAGE_DEVID_SAS3108_5               (0x0094)
560 #define MPI25_MFGPAGE_DEVID_SAS3108_6               (0x0095)
561 
562 /* MPI v2.6 SAS Products */
563 #define MPI26_MFGPAGE_DEVID_SAS3216                 (0x00C9)
564 #define MPI26_MFGPAGE_DEVID_SAS3224                 (0x00C4)
565 #define MPI26_MFGPAGE_DEVID_SAS3316_1               (0x00C5)
566 #define MPI26_MFGPAGE_DEVID_SAS3316_2               (0x00C6)
567 #define MPI26_MFGPAGE_DEVID_SAS3316_3               (0x00C7)
568 #define MPI26_MFGPAGE_DEVID_SAS3316_4               (0x00C8)
569 #define MPI26_MFGPAGE_DEVID_SAS3324_1               (0x00C0)
570 #define MPI26_MFGPAGE_DEVID_SAS3324_2               (0x00C1)
571 #define MPI26_MFGPAGE_DEVID_SAS3324_3               (0x00C2)
572 #define MPI26_MFGPAGE_DEVID_SAS3324_4               (0x00C3)
573 
574 #define MPI26_MFGPAGE_DEVID_SAS3516                 (0x00AA)
575 #define MPI26_MFGPAGE_DEVID_SAS3516_1               (0x00AB)
576 #define MPI26_MFGPAGE_DEVID_SAS3416                 (0x00AC)
577 #define MPI26_MFGPAGE_DEVID_SAS3508                 (0x00AD)
578 #define MPI26_MFGPAGE_DEVID_SAS3508_1               (0x00AE)
579 #define MPI26_MFGPAGE_DEVID_SAS3408                 (0x00AF)
580 #define MPI26_MFGPAGE_DEVID_SAS3716                 (0x00D0)
581 #define MPI26_MFGPAGE_DEVID_SAS3616                 (0x00D1)
582 #define MPI26_MFGPAGE_DEVID_SAS3708                 (0x00D2)
583 
584 #define MPI26_MFGPAGE_DEVID_SEC_MASK_3916           (0x0003)
585 #define MPI26_MFGPAGE_DEVID_INVALID0_3916           (0x00E0)
586 #define MPI26_MFGPAGE_DEVID_CFG_SEC_3916            (0x00E1)
587 #define MPI26_MFGPAGE_DEVID_HARD_SEC_3916           (0x00E2)
588 #define MPI26_MFGPAGE_DEVID_INVALID1_3916           (0x00E3)
589 
590 #define MPI26_MFGPAGE_DEVID_SEC_MASK_3816           (0x0003)
591 #define MPI26_MFGPAGE_DEVID_INVALID0_3816           (0x00E4)
592 #define MPI26_MFGPAGE_DEVID_CFG_SEC_3816            (0x00E5)
593 #define MPI26_MFGPAGE_DEVID_HARD_SEC_3816           (0x00E6)
594 #define MPI26_MFGPAGE_DEVID_INVALID1_3816           (0x00E7)
595 
596 
597 /*Manufacturing Page 0 */
598 
599 typedef struct _MPI2_CONFIG_PAGE_MAN_0 {
600 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
601 	U8                      ChipName[16];               /*0x04 */
602 	U8                      ChipRevision[8];            /*0x14 */
603 	U8                      BoardName[16];              /*0x1C */
604 	U8                      BoardAssembly[16];          /*0x2C */
605 	U8                      BoardTracerNumber[16];      /*0x3C */
606 } MPI2_CONFIG_PAGE_MAN_0,
607 	*PTR_MPI2_CONFIG_PAGE_MAN_0,
608 	Mpi2ManufacturingPage0_t,
609 	*pMpi2ManufacturingPage0_t;
610 
611 #define MPI2_MANUFACTURING0_PAGEVERSION                (0x00)
612 
613 
614 /*Manufacturing Page 1 */
615 
616 typedef struct _MPI2_CONFIG_PAGE_MAN_1 {
617 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
618 	U8                      VPD[256];                   /*0x04 */
619 } MPI2_CONFIG_PAGE_MAN_1,
620 	*PTR_MPI2_CONFIG_PAGE_MAN_1,
621 	Mpi2ManufacturingPage1_t,
622 	*pMpi2ManufacturingPage1_t;
623 
624 #define MPI2_MANUFACTURING1_PAGEVERSION                (0x00)
625 
626 
627 typedef struct _MPI2_CHIP_REVISION_ID {
628 	U16 DeviceID;                                       /*0x00 */
629 	U8  PCIRevisionID;                                  /*0x02 */
630 	U8  Reserved;                                       /*0x03 */
631 } MPI2_CHIP_REVISION_ID, *PTR_MPI2_CHIP_REVISION_ID,
632 	Mpi2ChipRevisionId_t, *pMpi2ChipRevisionId_t;
633 
634 
635 /*Manufacturing Page 2 */
636 
637 /*
638  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
639  *one and check Header.PageLength at runtime.
640  */
641 #ifndef MPI2_MAN_PAGE_2_HW_SETTINGS_WORDS
642 #define MPI2_MAN_PAGE_2_HW_SETTINGS_WORDS   (1)
643 #endif
644 
645 typedef struct _MPI2_CONFIG_PAGE_MAN_2 {
646 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
647 	MPI2_CHIP_REVISION_ID   ChipId;                     /*0x04 */
648 	U32
649 		HwSettings[MPI2_MAN_PAGE_2_HW_SETTINGS_WORDS];/*0x08 */
650 } MPI2_CONFIG_PAGE_MAN_2,
651 	*PTR_MPI2_CONFIG_PAGE_MAN_2,
652 	Mpi2ManufacturingPage2_t,
653 	*pMpi2ManufacturingPage2_t;
654 
655 #define MPI2_MANUFACTURING2_PAGEVERSION                 (0x00)
656 
657 
658 /*Manufacturing Page 3 */
659 
660 /*
661  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
662  *one and check Header.PageLength at runtime.
663  */
664 #ifndef MPI2_MAN_PAGE_3_INFO_WORDS
665 #define MPI2_MAN_PAGE_3_INFO_WORDS          (1)
666 #endif
667 
668 typedef struct _MPI2_CONFIG_PAGE_MAN_3 {
669 	MPI2_CONFIG_PAGE_HEADER             Header;         /*0x00 */
670 	MPI2_CHIP_REVISION_ID               ChipId;         /*0x04 */
671 	U32
672 		Info[MPI2_MAN_PAGE_3_INFO_WORDS];/*0x08 */
673 } MPI2_CONFIG_PAGE_MAN_3,
674 	*PTR_MPI2_CONFIG_PAGE_MAN_3,
675 	Mpi2ManufacturingPage3_t,
676 	*pMpi2ManufacturingPage3_t;
677 
678 #define MPI2_MANUFACTURING3_PAGEVERSION                 (0x00)
679 
680 
681 /*Manufacturing Page 4 */
682 
683 typedef struct _MPI2_MANPAGE4_PWR_SAVE_SETTINGS {
684 	U8                          PowerSaveFlags;                 /*0x00 */
685 	U8                          InternalOperationsSleepTime;    /*0x01 */
686 	U8                          InternalOperationsRunTime;      /*0x02 */
687 	U8                          HostIdleTime;                   /*0x03 */
688 } MPI2_MANPAGE4_PWR_SAVE_SETTINGS,
689 	*PTR_MPI2_MANPAGE4_PWR_SAVE_SETTINGS,
690 	Mpi2ManPage4PwrSaveSettings_t,
691 	*pMpi2ManPage4PwrSaveSettings_t;
692 
693 /*defines for the PowerSaveFlags field */
694 #define MPI2_MANPAGE4_MASK_POWERSAVE_MODE               (0x03)
695 #define MPI2_MANPAGE4_POWERSAVE_MODE_DISABLED           (0x00)
696 #define MPI2_MANPAGE4_CUSTOM_POWERSAVE_MODE             (0x01)
697 #define MPI2_MANPAGE4_FULL_POWERSAVE_MODE               (0x02)
698 
699 typedef struct _MPI2_CONFIG_PAGE_MAN_4 {
700 	MPI2_CONFIG_PAGE_HEADER             Header;                 /*0x00 */
701 	U32                                 Reserved1;              /*0x04 */
702 	U32                                 Flags;                  /*0x08 */
703 	U8                                  InquirySize;            /*0x0C */
704 	U8                                  Reserved2;              /*0x0D */
705 	U16                                 Reserved3;              /*0x0E */
706 	U8                                  InquiryData[56];        /*0x10 */
707 	U32                                 RAID0VolumeSettings;    /*0x48 */
708 	U32                                 RAID1EVolumeSettings;   /*0x4C */
709 	U32                                 RAID1VolumeSettings;    /*0x50 */
710 	U32                                 RAID10VolumeSettings;   /*0x54 */
711 	U32                                 Reserved4;              /*0x58 */
712 	U32                                 Reserved5;              /*0x5C */
713 	MPI2_MANPAGE4_PWR_SAVE_SETTINGS     PowerSaveSettings;      /*0x60 */
714 	U8                                  MaxOCEDisks;            /*0x64 */
715 	U8                                  ResyncRate;             /*0x65 */
716 	U16                                 DataScrubDuration;      /*0x66 */
717 	U8                                  MaxHotSpares;           /*0x68 */
718 	U8                                  MaxPhysDisksPerVol;     /*0x69 */
719 	U8                                  MaxPhysDisks;           /*0x6A */
720 	U8                                  MaxVolumes;             /*0x6B */
721 } MPI2_CONFIG_PAGE_MAN_4,
722 	*PTR_MPI2_CONFIG_PAGE_MAN_4,
723 	Mpi2ManufacturingPage4_t,
724 	*pMpi2ManufacturingPage4_t;
725 
726 #define MPI2_MANUFACTURING4_PAGEVERSION                 (0x0A)
727 
728 /*Manufacturing Page 4 Flags field */
729 #define MPI2_MANPAGE4_METADATA_SIZE_MASK                (0x00030000)
730 #define MPI2_MANPAGE4_METADATA_512MB                    (0x00000000)
731 
732 #define MPI2_MANPAGE4_MIX_SSD_SAS_SATA                  (0x00008000)
733 #define MPI2_MANPAGE4_MIX_SSD_AND_NON_SSD               (0x00004000)
734 #define MPI2_MANPAGE4_HIDE_PHYSDISK_NON_IR              (0x00002000)
735 
736 #define MPI2_MANPAGE4_MASK_PHYSDISK_COERCION            (0x00001C00)
737 #define MPI2_MANPAGE4_PHYSDISK_COERCION_1GB             (0x00000000)
738 #define MPI2_MANPAGE4_PHYSDISK_128MB_COERCION           (0x00000400)
739 #define MPI2_MANPAGE4_PHYSDISK_ADAPTIVE_COERCION        (0x00000800)
740 #define MPI2_MANPAGE4_PHYSDISK_ZERO_COERCION            (0x00000C00)
741 
742 #define MPI2_MANPAGE4_MASK_BAD_BLOCK_MARKING            (0x00000300)
743 #define MPI2_MANPAGE4_DEFAULT_BAD_BLOCK_MARKING         (0x00000000)
744 #define MPI2_MANPAGE4_TABLE_BAD_BLOCK_MARKING           (0x00000100)
745 #define MPI2_MANPAGE4_WRITE_LONG_BAD_BLOCK_MARKING      (0x00000200)
746 
747 #define MPI2_MANPAGE4_FORCE_OFFLINE_FAILOVER            (0x00000080)
748 #define MPI2_MANPAGE4_RAID10_DISABLE                    (0x00000040)
749 #define MPI2_MANPAGE4_RAID1E_DISABLE                    (0x00000020)
750 #define MPI2_MANPAGE4_RAID1_DISABLE                     (0x00000010)
751 #define MPI2_MANPAGE4_RAID0_DISABLE                     (0x00000008)
752 #define MPI2_MANPAGE4_IR_MODEPAGE8_DISABLE              (0x00000004)
753 #define MPI2_MANPAGE4_IM_RESYNC_CACHE_ENABLE            (0x00000002)
754 #define MPI2_MANPAGE4_IR_NO_MIX_SAS_SATA                (0x00000001)
755 
756 
757 /*Manufacturing Page 5 */
758 
759 /*
760  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
761  *one and check the value returned for NumPhys at runtime.
762  */
763 #ifndef MPI2_MAN_PAGE_5_PHY_ENTRIES
764 #define MPI2_MAN_PAGE_5_PHY_ENTRIES         (1)
765 #endif
766 
767 typedef struct _MPI2_MANUFACTURING5_ENTRY {
768 	U64                                 WWID;           /*0x00 */
769 	U64                                 DeviceName;     /*0x08 */
770 } MPI2_MANUFACTURING5_ENTRY,
771 	*PTR_MPI2_MANUFACTURING5_ENTRY,
772 	Mpi2Manufacturing5Entry_t,
773 	*pMpi2Manufacturing5Entry_t;
774 
775 typedef struct _MPI2_CONFIG_PAGE_MAN_5 {
776 	MPI2_CONFIG_PAGE_HEADER             Header;         /*0x00 */
777 	U8                                  NumPhys;        /*0x04 */
778 	U8                                  Reserved1;      /*0x05 */
779 	U16                                 Reserved2;      /*0x06 */
780 	U32                                 Reserved3;      /*0x08 */
781 	U32                                 Reserved4;      /*0x0C */
782 	MPI2_MANUFACTURING5_ENTRY
783 		Phy[MPI2_MAN_PAGE_5_PHY_ENTRIES];/*0x08 */
784 } MPI2_CONFIG_PAGE_MAN_5,
785 	*PTR_MPI2_CONFIG_PAGE_MAN_5,
786 	Mpi2ManufacturingPage5_t,
787 	*pMpi2ManufacturingPage5_t;
788 
789 #define MPI2_MANUFACTURING5_PAGEVERSION                 (0x03)
790 
791 
792 /*Manufacturing Page 6 */
793 
794 typedef struct _MPI2_CONFIG_PAGE_MAN_6 {
795 	MPI2_CONFIG_PAGE_HEADER         Header;             /*0x00 */
796 	U32                             ProductSpecificInfo;/*0x04 */
797 } MPI2_CONFIG_PAGE_MAN_6,
798 	*PTR_MPI2_CONFIG_PAGE_MAN_6,
799 	Mpi2ManufacturingPage6_t,
800 	*pMpi2ManufacturingPage6_t;
801 
802 #define MPI2_MANUFACTURING6_PAGEVERSION                 (0x00)
803 
804 
805 /*Manufacturing Page 7 */
806 
807 typedef struct _MPI2_MANPAGE7_CONNECTOR_INFO {
808 	U32                         Pinout;                 /*0x00 */
809 	U8                          Connector[16];          /*0x04 */
810 	U8                          Location;               /*0x14 */
811 	U8                          ReceptacleID;           /*0x15 */
812 	U16                         Slot;                   /*0x16 */
813 	U32                         Reserved2;              /*0x18 */
814 } MPI2_MANPAGE7_CONNECTOR_INFO,
815 	*PTR_MPI2_MANPAGE7_CONNECTOR_INFO,
816 	Mpi2ManPage7ConnectorInfo_t,
817 	*pMpi2ManPage7ConnectorInfo_t;
818 
819 /*defines for the Pinout field */
820 #define MPI2_MANPAGE7_PINOUT_LANE_MASK                  (0x0000FF00)
821 #define MPI2_MANPAGE7_PINOUT_LANE_SHIFT                 (8)
822 
823 #define MPI2_MANPAGE7_PINOUT_TYPE_MASK                  (0x000000FF)
824 #define MPI2_MANPAGE7_PINOUT_TYPE_UNKNOWN               (0x00)
825 #define MPI2_MANPAGE7_PINOUT_SATA_SINGLE                (0x01)
826 #define MPI2_MANPAGE7_PINOUT_SFF_8482                   (0x02)
827 #define MPI2_MANPAGE7_PINOUT_SFF_8486                   (0x03)
828 #define MPI2_MANPAGE7_PINOUT_SFF_8484                   (0x04)
829 #define MPI2_MANPAGE7_PINOUT_SFF_8087                   (0x05)
830 #define MPI2_MANPAGE7_PINOUT_SFF_8643_4I                (0x06)
831 #define MPI2_MANPAGE7_PINOUT_SFF_8643_8I                (0x07)
832 #define MPI2_MANPAGE7_PINOUT_SFF_8470                   (0x08)
833 #define MPI2_MANPAGE7_PINOUT_SFF_8088                   (0x09)
834 #define MPI2_MANPAGE7_PINOUT_SFF_8644_4X                (0x0A)
835 #define MPI2_MANPAGE7_PINOUT_SFF_8644_8X                (0x0B)
836 #define MPI2_MANPAGE7_PINOUT_SFF_8644_16X               (0x0C)
837 #define MPI2_MANPAGE7_PINOUT_SFF_8436                   (0x0D)
838 #define MPI2_MANPAGE7_PINOUT_SFF_8088_A                 (0x0E)
839 #define MPI2_MANPAGE7_PINOUT_SFF_8643_16i               (0x0F)
840 #define MPI2_MANPAGE7_PINOUT_SFF_8654_4i                (0x10)
841 #define MPI2_MANPAGE7_PINOUT_SFF_8654_8i                (0x11)
842 #define MPI2_MANPAGE7_PINOUT_SFF_8611_4i                (0x12)
843 #define MPI2_MANPAGE7_PINOUT_SFF_8611_8i                (0x13)
844 
845 /*defines for the Location field */
846 #define MPI2_MANPAGE7_LOCATION_UNKNOWN                  (0x01)
847 #define MPI2_MANPAGE7_LOCATION_INTERNAL                 (0x02)
848 #define MPI2_MANPAGE7_LOCATION_EXTERNAL                 (0x04)
849 #define MPI2_MANPAGE7_LOCATION_SWITCHABLE               (0x08)
850 #define MPI2_MANPAGE7_LOCATION_AUTO                     (0x10)
851 #define MPI2_MANPAGE7_LOCATION_NOT_PRESENT              (0x20)
852 #define MPI2_MANPAGE7_LOCATION_NOT_CONNECTED            (0x80)
853 
854 /*defines for the Slot field */
855 #define MPI2_MANPAGE7_SLOT_UNKNOWN                      (0xFFFF)
856 
857 /*
858  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
859  *one and check the value returned for NumPhys at runtime.
860  */
861 #ifndef MPI2_MANPAGE7_CONNECTOR_INFO_MAX
862 #define MPI2_MANPAGE7_CONNECTOR_INFO_MAX  (1)
863 #endif
864 
865 typedef struct _MPI2_CONFIG_PAGE_MAN_7 {
866 	MPI2_CONFIG_PAGE_HEADER         Header;             /*0x00 */
867 	U32                             Reserved1;          /*0x04 */
868 	U32                             Reserved2;          /*0x08 */
869 	U32                             Flags;              /*0x0C */
870 	U8                              EnclosureName[16];  /*0x10 */
871 	U8                              NumPhys;            /*0x20 */
872 	U8                              Reserved3;          /*0x21 */
873 	U16                             Reserved4;          /*0x22 */
874 	MPI2_MANPAGE7_CONNECTOR_INFO
875 	ConnectorInfo[MPI2_MANPAGE7_CONNECTOR_INFO_MAX]; /*0x24 */
876 } MPI2_CONFIG_PAGE_MAN_7,
877 	*PTR_MPI2_CONFIG_PAGE_MAN_7,
878 	Mpi2ManufacturingPage7_t,
879 	*pMpi2ManufacturingPage7_t;
880 
881 #define MPI2_MANUFACTURING7_PAGEVERSION                 (0x01)
882 
883 /*defines for the Flags field */
884 #define MPI2_MANPAGE7_FLAG_BASE_ENCLOSURE_LEVEL         (0x00000008)
885 #define MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER       (0x00000002)
886 #define MPI2_MANPAGE7_FLAG_USE_SLOT_INFO                (0x00000001)
887 
888 
889 /*
890  *Generic structure to use for product-specific manufacturing pages
891  *(currently Manufacturing Page 8 through Manufacturing Page 31).
892  */
893 
894 typedef struct _MPI2_CONFIG_PAGE_MAN_PS {
895 	MPI2_CONFIG_PAGE_HEADER         Header;             /*0x00 */
896 	U32                             ProductSpecificInfo;/*0x04 */
897 } MPI2_CONFIG_PAGE_MAN_PS,
898 	*PTR_MPI2_CONFIG_PAGE_MAN_PS,
899 	Mpi2ManufacturingPagePS_t,
900 	*pMpi2ManufacturingPagePS_t;
901 
902 #define MPI2_MANUFACTURING8_PAGEVERSION                 (0x00)
903 #define MPI2_MANUFACTURING9_PAGEVERSION                 (0x00)
904 #define MPI2_MANUFACTURING10_PAGEVERSION                (0x00)
905 #define MPI2_MANUFACTURING11_PAGEVERSION                (0x00)
906 #define MPI2_MANUFACTURING12_PAGEVERSION                (0x00)
907 #define MPI2_MANUFACTURING13_PAGEVERSION                (0x00)
908 #define MPI2_MANUFACTURING14_PAGEVERSION                (0x00)
909 #define MPI2_MANUFACTURING15_PAGEVERSION                (0x00)
910 #define MPI2_MANUFACTURING16_PAGEVERSION                (0x00)
911 #define MPI2_MANUFACTURING17_PAGEVERSION                (0x00)
912 #define MPI2_MANUFACTURING18_PAGEVERSION                (0x00)
913 #define MPI2_MANUFACTURING19_PAGEVERSION                (0x00)
914 #define MPI2_MANUFACTURING20_PAGEVERSION                (0x00)
915 #define MPI2_MANUFACTURING21_PAGEVERSION                (0x00)
916 #define MPI2_MANUFACTURING22_PAGEVERSION                (0x00)
917 #define MPI2_MANUFACTURING23_PAGEVERSION                (0x00)
918 #define MPI2_MANUFACTURING24_PAGEVERSION                (0x00)
919 #define MPI2_MANUFACTURING25_PAGEVERSION                (0x00)
920 #define MPI2_MANUFACTURING26_PAGEVERSION                (0x00)
921 #define MPI2_MANUFACTURING27_PAGEVERSION                (0x00)
922 #define MPI2_MANUFACTURING28_PAGEVERSION                (0x00)
923 #define MPI2_MANUFACTURING29_PAGEVERSION                (0x00)
924 #define MPI2_MANUFACTURING30_PAGEVERSION                (0x00)
925 #define MPI2_MANUFACTURING31_PAGEVERSION                (0x00)
926 
927 
928 /****************************************************************************
929 *  IO Unit Config Pages
930 ****************************************************************************/
931 
932 /*IO Unit Page 0 */
933 
934 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_0 {
935 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
936 	U64                     UniqueValue;                /*0x04 */
937 	MPI2_VERSION_UNION      NvdataVersionDefault;       /*0x08 */
938 	MPI2_VERSION_UNION      NvdataVersionPersistent;    /*0x0A */
939 } MPI2_CONFIG_PAGE_IO_UNIT_0,
940 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_0,
941 	Mpi2IOUnitPage0_t, *pMpi2IOUnitPage0_t;
942 
943 #define MPI2_IOUNITPAGE0_PAGEVERSION                    (0x02)
944 
945 
946 /*IO Unit Page 1 */
947 
948 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1 {
949 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
950 	U32                     Flags;                      /*0x04 */
951 } MPI2_CONFIG_PAGE_IO_UNIT_1,
952 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_1,
953 	Mpi2IOUnitPage1_t, *pMpi2IOUnitPage1_t;
954 
955 #define MPI2_IOUNITPAGE1_PAGEVERSION                    (0x04)
956 
957 /* IO Unit Page 1 Flags defines */
958 #define MPI26_IOUNITPAGE1_NVME_WRCACHE_MASK             (0x00030000)
959 #define MPI26_IOUNITPAGE1_NVME_WRCACHE_ENABLE           (0x00000000)
960 #define MPI26_IOUNITPAGE1_NVME_WRCACHE_DISABLE          (0x00010000)
961 #define MPI26_IOUNITPAGE1_NVME_WRCACHE_NO_CHANGE        (0x00020000)
962 #define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK       (0x00004000)
963 #define MPI25_IOUNITPAGE1_NEW_DEVICE_FAST_PATH_DISABLE  (0x00002000)
964 #define MPI25_IOUNITPAGE1_DISABLE_FAST_PATH             (0x00001000)
965 #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY    (0x00000800)
966 #define MPI2_IOUNITPAGE1_MASK_SATA_WRITE_CACHE          (0x00000600)
967 #define MPI2_IOUNITPAGE1_SATA_WRITE_CACHE_SHIFT         (9)
968 #define MPI2_IOUNITPAGE1_ENABLE_SATA_WRITE_CACHE        (0x00000000)
969 #define MPI2_IOUNITPAGE1_DISABLE_SATA_WRITE_CACHE       (0x00000200)
970 #define MPI2_IOUNITPAGE1_UNCHANGED_SATA_WRITE_CACHE     (0x00000400)
971 #define MPI2_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE       (0x00000100)
972 #define MPI2_IOUNITPAGE1_DISABLE_IR                     (0x00000040)
973 #define MPI2_IOUNITPAGE1_DISABLE_TASK_SET_FULL_HANDLING (0x00000020)
974 #define MPI2_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID        (0x00000004)
975 
976 
977 /*IO Unit Page 3 */
978 
979 /*
980  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
981  *one and check the value returned for GPIOCount at runtime.
982  */
983 #ifndef MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX
984 #define MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX    (1)
985 #endif
986 
987 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_3 {
988 	MPI2_CONFIG_PAGE_HEADER Header;			 /*0x00 */
989 	U8                      GPIOCount;		 /*0x04 */
990 	U8                      Reserved1;		 /*0x05 */
991 	U16                     Reserved2;		 /*0x06 */
992 	U16
993 		GPIOVal[MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX];/*0x08 */
994 } MPI2_CONFIG_PAGE_IO_UNIT_3,
995 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_3,
996 	Mpi2IOUnitPage3_t, *pMpi2IOUnitPage3_t;
997 
998 #define MPI2_IOUNITPAGE3_PAGEVERSION                    (0x01)
999 
1000 /*defines for IO Unit Page 3 GPIOVal field */
1001 #define MPI2_IOUNITPAGE3_GPIO_FUNCTION_MASK             (0xFFFC)
1002 #define MPI2_IOUNITPAGE3_GPIO_FUNCTION_SHIFT            (2)
1003 #define MPI2_IOUNITPAGE3_GPIO_SETTING_OFF               (0x0000)
1004 #define MPI2_IOUNITPAGE3_GPIO_SETTING_ON                (0x0001)
1005 
1006 
1007 /*IO Unit Page 5 */
1008 
1009 /*
1010  *Upper layer code (drivers, utilities, etc.) should leave this define set to
1011  *one and check the value returned for NumDmaEngines at runtime.
1012  */
1013 #ifndef MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES
1014 #define MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES      (1)
1015 #endif
1016 
1017 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_5 {
1018 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1019 	U64
1020 		RaidAcceleratorBufferBaseAddress;           /*0x04 */
1021 	U64
1022 		RaidAcceleratorBufferSize;                  /*0x0C */
1023 	U64
1024 		RaidAcceleratorControlBaseAddress;          /*0x14 */
1025 	U8                      RAControlSize;              /*0x1C */
1026 	U8                      NumDmaEngines;              /*0x1D */
1027 	U8                      RAMinControlSize;           /*0x1E */
1028 	U8                      RAMaxControlSize;           /*0x1F */
1029 	U32                     Reserved1;                  /*0x20 */
1030 	U32                     Reserved2;                  /*0x24 */
1031 	U32                     Reserved3;                  /*0x28 */
1032 	U32
1033 	DmaEngineCapabilities[MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES]; /*0x2C */
1034 } MPI2_CONFIG_PAGE_IO_UNIT_5,
1035 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_5,
1036 	Mpi2IOUnitPage5_t, *pMpi2IOUnitPage5_t;
1037 
1038 #define MPI2_IOUNITPAGE5_PAGEVERSION                    (0x00)
1039 
1040 /*defines for IO Unit Page 5 DmaEngineCapabilities field */
1041 #define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS      (0xFFFF0000)
1042 #define MPI2_IOUNITPAGE5_DMA_CAP_SHIFT_MAX_REQUESTS     (16)
1043 
1044 #define MPI2_IOUNITPAGE5_DMA_CAP_EEDP                   (0x0008)
1045 #define MPI2_IOUNITPAGE5_DMA_CAP_PARITY_GENERATION      (0x0004)
1046 #define MPI2_IOUNITPAGE5_DMA_CAP_HASHING                (0x0002)
1047 #define MPI2_IOUNITPAGE5_DMA_CAP_ENCRYPTION             (0x0001)
1048 
1049 
1050 /*IO Unit Page 6 */
1051 
1052 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_6 {
1053 	MPI2_CONFIG_PAGE_HEADER Header;                 /*0x00 */
1054 	U16                     Flags;                  /*0x04 */
1055 	U8                      RAHostControlSize;      /*0x06 */
1056 	U8                      Reserved0;              /*0x07 */
1057 	U64
1058 		RaidAcceleratorHostControlBaseAddress;  /*0x08 */
1059 	U32                     Reserved1;              /*0x10 */
1060 	U32                     Reserved2;              /*0x14 */
1061 	U32                     Reserved3;              /*0x18 */
1062 } MPI2_CONFIG_PAGE_IO_UNIT_6,
1063 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_6,
1064 	Mpi2IOUnitPage6_t, *pMpi2IOUnitPage6_t;
1065 
1066 #define MPI2_IOUNITPAGE6_PAGEVERSION                    (0x00)
1067 
1068 /*defines for IO Unit Page 6 Flags field */
1069 #define MPI2_IOUNITPAGE6_FLAGS_ENABLE_RAID_ACCELERATOR  (0x0001)
1070 
1071 
1072 /*IO Unit Page 7 */
1073 
1074 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_7 {
1075 	MPI2_CONFIG_PAGE_HEADER Header;                 /*0x00 */
1076 	U8                      CurrentPowerMode;       /*0x04 */
1077 	U8                      PreviousPowerMode;      /*0x05 */
1078 	U8                      PCIeWidth;              /*0x06 */
1079 	U8                      PCIeSpeed;              /*0x07 */
1080 	U32                     ProcessorState;         /*0x08 */
1081 	U32
1082 		PowerManagementCapabilities;            /*0x0C */
1083 	U16                     IOCTemperature;         /*0x10 */
1084 	U8
1085 		IOCTemperatureUnits;                    /*0x12 */
1086 	U8                      IOCSpeed;               /*0x13 */
1087 	U16                     BoardTemperature;       /*0x14 */
1088 	U8
1089 		BoardTemperatureUnits;                  /*0x16 */
1090 	U8                      Reserved3;              /*0x17 */
1091 	U32			BoardPowerRequirement;	/*0x18 */
1092 	U32			PCISlotPowerAllocation;	/*0x1C */
1093 /* reserved prior to MPI v2.6 */
1094 	U8		Flags;			/* 0x20 */
1095 	U8		Reserved6;			/* 0x21 */
1096 	U16		Reserved7;			/* 0x22 */
1097 	U32		Reserved8;			/* 0x24 */
1098 } MPI2_CONFIG_PAGE_IO_UNIT_7,
1099 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_7,
1100 	Mpi2IOUnitPage7_t, *pMpi2IOUnitPage7_t;
1101 
1102 #define MPI2_IOUNITPAGE7_PAGEVERSION			(0x05)
1103 
1104 /*defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */
1105 #define MPI25_IOUNITPAGE7_PM_INIT_MASK              (0xC0)
1106 #define MPI25_IOUNITPAGE7_PM_INIT_UNAVAILABLE       (0x00)
1107 #define MPI25_IOUNITPAGE7_PM_INIT_HOST              (0x40)
1108 #define MPI25_IOUNITPAGE7_PM_INIT_IO_UNIT           (0x80)
1109 #define MPI25_IOUNITPAGE7_PM_INIT_PCIE_DPA          (0xC0)
1110 
1111 #define MPI25_IOUNITPAGE7_PM_MODE_MASK              (0x07)
1112 #define MPI25_IOUNITPAGE7_PM_MODE_UNAVAILABLE       (0x00)
1113 #define MPI25_IOUNITPAGE7_PM_MODE_UNKNOWN           (0x01)
1114 #define MPI25_IOUNITPAGE7_PM_MODE_FULL_POWER        (0x04)
1115 #define MPI25_IOUNITPAGE7_PM_MODE_REDUCED_POWER     (0x05)
1116 #define MPI25_IOUNITPAGE7_PM_MODE_STANDBY           (0x06)
1117 
1118 
1119 /*defines for IO Unit Page 7 PCIeWidth field */
1120 #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X1              (0x01)
1121 #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X2              (0x02)
1122 #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X4              (0x04)
1123 #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X8              (0x08)
1124 #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X16             (0x10)
1125 
1126 /*defines for IO Unit Page 7 PCIeSpeed field */
1127 #define MPI2_IOUNITPAGE7_PCIE_SPEED_2_5_GBPS        (0x00)
1128 #define MPI2_IOUNITPAGE7_PCIE_SPEED_5_0_GBPS        (0x01)
1129 #define MPI2_IOUNITPAGE7_PCIE_SPEED_8_0_GBPS        (0x02)
1130 #define MPI2_IOUNITPAGE7_PCIE_SPEED_16_0_GBPS       (0x03)
1131 
1132 /*defines for IO Unit Page 7 ProcessorState field */
1133 #define MPI2_IOUNITPAGE7_PSTATE_MASK_SECOND         (0x0000000F)
1134 #define MPI2_IOUNITPAGE7_PSTATE_SHIFT_SECOND        (0)
1135 
1136 #define MPI2_IOUNITPAGE7_PSTATE_NOT_PRESENT         (0x00)
1137 #define MPI2_IOUNITPAGE7_PSTATE_DISABLED            (0x01)
1138 #define MPI2_IOUNITPAGE7_PSTATE_ENABLED             (0x02)
1139 
1140 /*defines for IO Unit Page 7 PowerManagementCapabilities field */
1141 #define MPI25_IOUNITPAGE7_PMCAP_DPA_FULL_PWR_MODE       (0x00400000)
1142 #define MPI25_IOUNITPAGE7_PMCAP_DPA_REDUCED_PWR_MODE    (0x00200000)
1143 #define MPI25_IOUNITPAGE7_PMCAP_DPA_STANDBY_MODE        (0x00100000)
1144 #define MPI25_IOUNITPAGE7_PMCAP_HOST_FULL_PWR_MODE      (0x00040000)
1145 #define MPI25_IOUNITPAGE7_PMCAP_HOST_REDUCED_PWR_MODE   (0x00020000)
1146 #define MPI25_IOUNITPAGE7_PMCAP_HOST_STANDBY_MODE       (0x00010000)
1147 #define MPI25_IOUNITPAGE7_PMCAP_IO_FULL_PWR_MODE        (0x00004000)
1148 #define MPI25_IOUNITPAGE7_PMCAP_IO_REDUCED_PWR_MODE     (0x00002000)
1149 #define MPI25_IOUNITPAGE7_PMCAP_IO_STANDBY_MODE         (0x00001000)
1150 #define MPI2_IOUNITPAGE7_PMCAP_HOST_12_5_PCT_IOCSPEED   (0x00000400)
1151 #define MPI2_IOUNITPAGE7_PMCAP_HOST_25_0_PCT_IOCSPEED   (0x00000200)
1152 #define MPI2_IOUNITPAGE7_PMCAP_HOST_50_0_PCT_IOCSPEED   (0x00000100)
1153 #define MPI25_IOUNITPAGE7_PMCAP_IO_12_5_PCT_IOCSPEED    (0x00000040)
1154 #define MPI25_IOUNITPAGE7_PMCAP_IO_25_0_PCT_IOCSPEED    (0x00000020)
1155 #define MPI25_IOUNITPAGE7_PMCAP_IO_50_0_PCT_IOCSPEED    (0x00000010)
1156 #define MPI2_IOUNITPAGE7_PMCAP_HOST_WIDTH_CHANGE_PCIE   (0x00000008)
1157 #define MPI2_IOUNITPAGE7_PMCAP_HOST_SPEED_CHANGE_PCIE   (0x00000004)
1158 #define MPI25_IOUNITPAGE7_PMCAP_IO_WIDTH_CHANGE_PCIE    (0x00000002)
1159 #define MPI25_IOUNITPAGE7_PMCAP_IO_SPEED_CHANGE_PCIE    (0x00000001)
1160 
1161 /*obsolete names for the PowerManagementCapabilities bits (above) */
1162 #define MPI2_IOUNITPAGE7_PMCAP_12_5_PCT_IOCSPEED    (0x00000400)
1163 #define MPI2_IOUNITPAGE7_PMCAP_25_0_PCT_IOCSPEED    (0x00000200)
1164 #define MPI2_IOUNITPAGE7_PMCAP_50_0_PCT_IOCSPEED    (0x00000100)
1165 #define MPI2_IOUNITPAGE7_PMCAP_PCIE_WIDTH_CHANGE    (0x00000008) /*obsolete */
1166 #define MPI2_IOUNITPAGE7_PMCAP_PCIE_SPEED_CHANGE    (0x00000004) /*obsolete */
1167 
1168 
1169 /*defines for IO Unit Page 7 IOCTemperatureUnits field */
1170 #define MPI2_IOUNITPAGE7_IOC_TEMP_NOT_PRESENT       (0x00)
1171 #define MPI2_IOUNITPAGE7_IOC_TEMP_FAHRENHEIT        (0x01)
1172 #define MPI2_IOUNITPAGE7_IOC_TEMP_CELSIUS           (0x02)
1173 
1174 /*defines for IO Unit Page 7 IOCSpeed field */
1175 #define MPI2_IOUNITPAGE7_IOC_SPEED_FULL             (0x01)
1176 #define MPI2_IOUNITPAGE7_IOC_SPEED_HALF             (0x02)
1177 #define MPI2_IOUNITPAGE7_IOC_SPEED_QUARTER          (0x04)
1178 #define MPI2_IOUNITPAGE7_IOC_SPEED_EIGHTH           (0x08)
1179 
1180 /*defines for IO Unit Page 7 BoardTemperatureUnits field */
1181 #define MPI2_IOUNITPAGE7_BOARD_TEMP_NOT_PRESENT     (0x00)
1182 #define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT      (0x01)
1183 #define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS         (0x02)
1184 
1185 /* defines for IO Unit Page 7 Flags field */
1186 #define MPI2_IOUNITPAGE7_FLAG_CABLE_POWER_EXC       (0x01)
1187 
1188 /*IO Unit Page 8 */
1189 
1190 #define MPI2_IOUNIT8_NUM_THRESHOLDS     (4)
1191 
1192 typedef struct _MPI2_IOUNIT8_SENSOR {
1193 	U16                     Flags;                  /*0x00 */
1194 	U16                     Reserved1;              /*0x02 */
1195 	U16
1196 		Threshold[MPI2_IOUNIT8_NUM_THRESHOLDS]; /*0x04 */
1197 	U32                     Reserved2;              /*0x0C */
1198 	U32                     Reserved3;              /*0x10 */
1199 	U32                     Reserved4;              /*0x14 */
1200 } MPI2_IOUNIT8_SENSOR, *PTR_MPI2_IOUNIT8_SENSOR,
1201 	Mpi2IOUnit8Sensor_t, *pMpi2IOUnit8Sensor_t;
1202 
1203 /*defines for IO Unit Page 8 Sensor Flags field */
1204 #define MPI2_IOUNIT8_SENSOR_FLAGS_T3_ENABLE         (0x0008)
1205 #define MPI2_IOUNIT8_SENSOR_FLAGS_T2_ENABLE         (0x0004)
1206 #define MPI2_IOUNIT8_SENSOR_FLAGS_T1_ENABLE         (0x0002)
1207 #define MPI2_IOUNIT8_SENSOR_FLAGS_T0_ENABLE         (0x0001)
1208 
1209 /*
1210  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1211  *one and check the value returned for NumSensors at runtime.
1212  */
1213 #ifndef MPI2_IOUNITPAGE8_SENSOR_ENTRIES
1214 #define MPI2_IOUNITPAGE8_SENSOR_ENTRIES     (1)
1215 #endif
1216 
1217 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_8 {
1218 	MPI2_CONFIG_PAGE_HEADER Header;                 /*0x00 */
1219 	U32                     Reserved1;              /*0x04 */
1220 	U32                     Reserved2;              /*0x08 */
1221 	U8                      NumSensors;             /*0x0C */
1222 	U8                      PollingInterval;        /*0x0D */
1223 	U16                     Reserved3;              /*0x0E */
1224 	MPI2_IOUNIT8_SENSOR
1225 		Sensor[MPI2_IOUNITPAGE8_SENSOR_ENTRIES];/*0x10 */
1226 } MPI2_CONFIG_PAGE_IO_UNIT_8,
1227 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_8,
1228 	Mpi2IOUnitPage8_t, *pMpi2IOUnitPage8_t;
1229 
1230 #define MPI2_IOUNITPAGE8_PAGEVERSION                    (0x00)
1231 
1232 
1233 /*IO Unit Page 9 */
1234 
1235 typedef struct _MPI2_IOUNIT9_SENSOR {
1236 	U16                     CurrentTemperature;     /*0x00 */
1237 	U16                     Reserved1;              /*0x02 */
1238 	U8                      Flags;                  /*0x04 */
1239 	U8                      Reserved2;              /*0x05 */
1240 	U16                     Reserved3;              /*0x06 */
1241 	U32                     Reserved4;              /*0x08 */
1242 	U32                     Reserved5;              /*0x0C */
1243 } MPI2_IOUNIT9_SENSOR, *PTR_MPI2_IOUNIT9_SENSOR,
1244 	Mpi2IOUnit9Sensor_t, *pMpi2IOUnit9Sensor_t;
1245 
1246 /*defines for IO Unit Page 9 Sensor Flags field */
1247 #define MPI2_IOUNIT9_SENSOR_FLAGS_TEMP_VALID        (0x01)
1248 
1249 /*
1250  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1251  *one and check the value returned for NumSensors at runtime.
1252  */
1253 #ifndef MPI2_IOUNITPAGE9_SENSOR_ENTRIES
1254 #define MPI2_IOUNITPAGE9_SENSOR_ENTRIES     (1)
1255 #endif
1256 
1257 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_9 {
1258 	MPI2_CONFIG_PAGE_HEADER Header;                 /*0x00 */
1259 	U32                     Reserved1;              /*0x04 */
1260 	U32                     Reserved2;              /*0x08 */
1261 	U8                      NumSensors;             /*0x0C */
1262 	U8                      Reserved4;              /*0x0D */
1263 	U16                     Reserved3;              /*0x0E */
1264 	MPI2_IOUNIT9_SENSOR
1265 		Sensor[MPI2_IOUNITPAGE9_SENSOR_ENTRIES];/*0x10 */
1266 } MPI2_CONFIG_PAGE_IO_UNIT_9,
1267 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_9,
1268 	Mpi2IOUnitPage9_t, *pMpi2IOUnitPage9_t;
1269 
1270 #define MPI2_IOUNITPAGE9_PAGEVERSION                    (0x00)
1271 
1272 
1273 /*IO Unit Page 10 */
1274 
1275 typedef struct _MPI2_IOUNIT10_FUNCTION {
1276 	U8                      CreditPercent;      /*0x00 */
1277 	U8                      Reserved1;          /*0x01 */
1278 	U16                     Reserved2;          /*0x02 */
1279 } MPI2_IOUNIT10_FUNCTION,
1280 	*PTR_MPI2_IOUNIT10_FUNCTION,
1281 	Mpi2IOUnit10Function_t,
1282 	*pMpi2IOUnit10Function_t;
1283 
1284 /*
1285  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1286  *one and check the value returned for NumFunctions at runtime.
1287  */
1288 #ifndef MPI2_IOUNITPAGE10_FUNCTION_ENTRIES
1289 #define MPI2_IOUNITPAGE10_FUNCTION_ENTRIES      (1)
1290 #endif
1291 
1292 typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_10 {
1293 	MPI2_CONFIG_PAGE_HEADER Header;                      /*0x00 */
1294 	U8                      NumFunctions;                /*0x04 */
1295 	U8                      Reserved1;                   /*0x05 */
1296 	U16                     Reserved2;                   /*0x06 */
1297 	U32                     Reserved3;                   /*0x08 */
1298 	U32                     Reserved4;                   /*0x0C */
1299 	MPI2_IOUNIT10_FUNCTION
1300 		Function[MPI2_IOUNITPAGE10_FUNCTION_ENTRIES];/*0x10 */
1301 } MPI2_CONFIG_PAGE_IO_UNIT_10,
1302 	*PTR_MPI2_CONFIG_PAGE_IO_UNIT_10,
1303 	Mpi2IOUnitPage10_t, *pMpi2IOUnitPage10_t;
1304 
1305 #define MPI2_IOUNITPAGE10_PAGEVERSION                   (0x01)
1306 
1307 
1308 /* IO Unit Page 11 (for MPI v2.6 and later) */
1309 
1310 typedef struct _MPI26_IOUNIT11_SPINUP_GROUP {
1311 	U8          MaxTargetSpinup;            /* 0x00 */
1312 	U8          SpinupDelay;                /* 0x01 */
1313 	U8          SpinupFlags;                /* 0x02 */
1314 	U8          Reserved1;                  /* 0x03 */
1315 } MPI26_IOUNIT11_SPINUP_GROUP,
1316 	*PTR_MPI26_IOUNIT11_SPINUP_GROUP,
1317 	Mpi26IOUnit11SpinupGroup_t,
1318 	*pMpi26IOUnit11SpinupGroup_t;
1319 
1320 /* defines for IO Unit Page 11 SpinupFlags */
1321 #define MPI26_IOUNITPAGE11_SPINUP_DISABLE_FLAG          (0x01)
1322 
1323 
1324 /*
1325  * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1326  * four and check the value returned for NumPhys at runtime.
1327  */
1328 #ifndef MPI26_IOUNITPAGE11_PHY_MAX
1329 #define MPI26_IOUNITPAGE11_PHY_MAX        (4)
1330 #endif
1331 
1332 typedef struct _MPI26_CONFIG_PAGE_IO_UNIT_11 {
1333 	MPI2_CONFIG_PAGE_HEADER       Header;			       /*0x00 */
1334 	U32                           Reserved1;                      /*0x04 */
1335 	MPI26_IOUNIT11_SPINUP_GROUP   SpinupGroupParameters[4];       /*0x08 */
1336 	U32                           Reserved2;                      /*0x18 */
1337 	U32                           Reserved3;                      /*0x1C */
1338 	U32                           Reserved4;                      /*0x20 */
1339 	U8                            BootDeviceWaitTime;             /*0x24 */
1340 	U8                            Reserved5;                      /*0x25 */
1341 	U16                           Reserved6;                      /*0x26 */
1342 	U8                            NumPhys;                        /*0x28 */
1343 	U8                            PEInitialSpinupDelay;           /*0x29 */
1344 	U8                            PEReplyDelay;                   /*0x2A */
1345 	U8                            Flags;                          /*0x2B */
1346 	U8			      PHY[MPI26_IOUNITPAGE11_PHY_MAX];/*0x2C */
1347 } MPI26_CONFIG_PAGE_IO_UNIT_11,
1348 	*PTR_MPI26_CONFIG_PAGE_IO_UNIT_11,
1349 	Mpi26IOUnitPage11_t,
1350 	*pMpi26IOUnitPage11_t;
1351 
1352 #define MPI26_IOUNITPAGE11_PAGEVERSION                  (0x00)
1353 
1354 /* defines for Flags field */
1355 #define MPI26_IOUNITPAGE11_FLAGS_AUTO_PORTENABLE        (0x01)
1356 
1357 /* defines for PHY field */
1358 #define MPI26_IOUNITPAGE11_PHY_SPINUP_GROUP_MASK        (0x03)
1359 
1360 
1361 
1362 
1363 
1364 
1365 /****************************************************************************
1366 *  IOC Config Pages
1367 ****************************************************************************/
1368 
1369 /*IOC Page 0 */
1370 
1371 typedef struct _MPI2_CONFIG_PAGE_IOC_0 {
1372 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1373 	U32                     Reserved1;                  /*0x04 */
1374 	U32                     Reserved2;                  /*0x08 */
1375 	U16                     VendorID;                   /*0x0C */
1376 	U16                     DeviceID;                   /*0x0E */
1377 	U8                      RevisionID;                 /*0x10 */
1378 	U8                      Reserved3;                  /*0x11 */
1379 	U16                     Reserved4;                  /*0x12 */
1380 	U32                     ClassCode;                  /*0x14 */
1381 	U16                     SubsystemVendorID;          /*0x18 */
1382 	U16                     SubsystemID;                /*0x1A */
1383 } MPI2_CONFIG_PAGE_IOC_0,
1384 	*PTR_MPI2_CONFIG_PAGE_IOC_0,
1385 	Mpi2IOCPage0_t, *pMpi2IOCPage0_t;
1386 
1387 #define MPI2_IOCPAGE0_PAGEVERSION                       (0x02)
1388 
1389 
1390 /*IOC Page 1 */
1391 
1392 typedef struct _MPI2_CONFIG_PAGE_IOC_1 {
1393 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1394 	U32                     Flags;                      /*0x04 */
1395 	U32                     CoalescingTimeout;          /*0x08 */
1396 	U8                      CoalescingDepth;            /*0x0C */
1397 	U8                      PCISlotNum;                 /*0x0D */
1398 	U8                      PCIBusNum;                  /*0x0E */
1399 	U8                      PCIDomainSegment;           /*0x0F */
1400 	U32                     Reserved1;                  /*0x10 */
1401 	U32                     ProductSpecific;            /* 0x14 */
1402 } MPI2_CONFIG_PAGE_IOC_1,
1403 	*PTR_MPI2_CONFIG_PAGE_IOC_1,
1404 	Mpi2IOCPage1_t, *pMpi2IOCPage1_t;
1405 
1406 #define MPI2_IOCPAGE1_PAGEVERSION                       (0x05)
1407 
1408 /*defines for IOC Page 1 Flags field */
1409 #define MPI2_IOCPAGE1_REPLY_COALESCING                  (0x00000001)
1410 
1411 #define MPI2_IOCPAGE1_PCISLOTNUM_UNKNOWN                (0xFF)
1412 #define MPI2_IOCPAGE1_PCIBUSNUM_UNKNOWN                 (0xFF)
1413 #define MPI2_IOCPAGE1_PCIDOMAIN_UNKNOWN                 (0xFF)
1414 
1415 /*IOC Page 6 */
1416 
1417 typedef struct _MPI2_CONFIG_PAGE_IOC_6 {
1418 	MPI2_CONFIG_PAGE_HEADER Header;         /*0x00 */
1419 	U32
1420 		CapabilitiesFlags;              /*0x04 */
1421 	U8                      MaxDrivesRAID0; /*0x08 */
1422 	U8                      MaxDrivesRAID1; /*0x09 */
1423 	U8
1424 		 MaxDrivesRAID1E;                /*0x0A */
1425 	U8
1426 		 MaxDrivesRAID10;		/*0x0B */
1427 	U8                      MinDrivesRAID0; /*0x0C */
1428 	U8                      MinDrivesRAID1; /*0x0D */
1429 	U8
1430 		 MinDrivesRAID1E;                /*0x0E */
1431 	U8
1432 		 MinDrivesRAID10;                /*0x0F */
1433 	U32                     Reserved1;      /*0x10 */
1434 	U8
1435 		 MaxGlobalHotSpares;             /*0x14 */
1436 	U8                      MaxPhysDisks;   /*0x15 */
1437 	U8                      MaxVolumes;     /*0x16 */
1438 	U8                      MaxConfigs;     /*0x17 */
1439 	U8                      MaxOCEDisks;    /*0x18 */
1440 	U8                      Reserved2;      /*0x19 */
1441 	U16                     Reserved3;      /*0x1A */
1442 	U32
1443 		SupportedStripeSizeMapRAID0;    /*0x1C */
1444 	U32
1445 		SupportedStripeSizeMapRAID1E;   /*0x20 */
1446 	U32
1447 		SupportedStripeSizeMapRAID10;   /*0x24 */
1448 	U32                     Reserved4;      /*0x28 */
1449 	U32                     Reserved5;      /*0x2C */
1450 	U16
1451 		DefaultMetadataSize;            /*0x30 */
1452 	U16                     Reserved6;      /*0x32 */
1453 	U16
1454 		MaxBadBlockTableEntries;        /*0x34 */
1455 	U16                     Reserved7;      /*0x36 */
1456 	U32
1457 		IRNvsramVersion;                /*0x38 */
1458 } MPI2_CONFIG_PAGE_IOC_6,
1459 	*PTR_MPI2_CONFIG_PAGE_IOC_6,
1460 	Mpi2IOCPage6_t, *pMpi2IOCPage6_t;
1461 
1462 #define MPI2_IOCPAGE6_PAGEVERSION                       (0x05)
1463 
1464 /*defines for IOC Page 6 CapabilitiesFlags */
1465 #define MPI2_IOCPAGE6_CAP_FLAGS_4K_SECTORS_SUPPORT      (0x00000020)
1466 #define MPI2_IOCPAGE6_CAP_FLAGS_RAID10_SUPPORT          (0x00000010)
1467 #define MPI2_IOCPAGE6_CAP_FLAGS_RAID1_SUPPORT           (0x00000008)
1468 #define MPI2_IOCPAGE6_CAP_FLAGS_RAID1E_SUPPORT          (0x00000004)
1469 #define MPI2_IOCPAGE6_CAP_FLAGS_RAID0_SUPPORT           (0x00000002)
1470 #define MPI2_IOCPAGE6_CAP_FLAGS_GLOBAL_HOT_SPARE        (0x00000001)
1471 
1472 
1473 /*IOC Page 7 */
1474 
1475 #define MPI2_IOCPAGE7_EVENTMASK_WORDS       (4)
1476 
1477 typedef struct _MPI2_CONFIG_PAGE_IOC_7 {
1478 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1479 	U32                     Reserved1;                  /*0x04 */
1480 	U32
1481 		EventMasks[MPI2_IOCPAGE7_EVENTMASK_WORDS];/*0x08 */
1482 	U16                     SASBroadcastPrimitiveMasks; /*0x18 */
1483 	U16                     SASNotifyPrimitiveMasks;    /*0x1A */
1484 	U32                     Reserved3;                  /*0x1C */
1485 } MPI2_CONFIG_PAGE_IOC_7,
1486 	*PTR_MPI2_CONFIG_PAGE_IOC_7,
1487 	Mpi2IOCPage7_t, *pMpi2IOCPage7_t;
1488 
1489 #define MPI2_IOCPAGE7_PAGEVERSION                       (0x02)
1490 
1491 
1492 /*IOC Page 8 */
1493 
1494 typedef struct _MPI2_CONFIG_PAGE_IOC_8 {
1495 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1496 	U8                      NumDevsPerEnclosure;        /*0x04 */
1497 	U8                      Reserved1;                  /*0x05 */
1498 	U16                     Reserved2;                  /*0x06 */
1499 	U16                     MaxPersistentEntries;       /*0x08 */
1500 	U16                     MaxNumPhysicalMappedIDs;    /*0x0A */
1501 	U16                     Flags;                      /*0x0C */
1502 	U16                     Reserved3;                  /*0x0E */
1503 	U16                     IRVolumeMappingFlags;       /*0x10 */
1504 	U16                     Reserved4;                  /*0x12 */
1505 	U32                     Reserved5;                  /*0x14 */
1506 } MPI2_CONFIG_PAGE_IOC_8,
1507 	*PTR_MPI2_CONFIG_PAGE_IOC_8,
1508 	Mpi2IOCPage8_t, *pMpi2IOCPage8_t;
1509 
1510 #define MPI2_IOCPAGE8_PAGEVERSION                       (0x00)
1511 
1512 /*defines for IOC Page 8 Flags field */
1513 #define MPI2_IOCPAGE8_FLAGS_DA_START_SLOT_1             (0x00000020)
1514 #define MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0         (0x00000010)
1515 
1516 #define MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE           (0x0000000E)
1517 #define MPI2_IOCPAGE8_FLAGS_DEVICE_PERSISTENCE_MAPPING  (0x00000000)
1518 #define MPI2_IOCPAGE8_FLAGS_ENCLOSURE_SLOT_MAPPING      (0x00000002)
1519 
1520 #define MPI2_IOCPAGE8_FLAGS_DISABLE_PERSISTENT_MAPPING  (0x00000001)
1521 #define MPI2_IOCPAGE8_FLAGS_ENABLE_PERSISTENT_MAPPING   (0x00000000)
1522 
1523 /*defines for IOC Page 8 IRVolumeMappingFlags */
1524 #define MPI2_IOCPAGE8_IRFLAGS_MASK_VOLUME_MAPPING_MODE  (0x00000003)
1525 #define MPI2_IOCPAGE8_IRFLAGS_LOW_VOLUME_MAPPING        (0x00000000)
1526 #define MPI2_IOCPAGE8_IRFLAGS_HIGH_VOLUME_MAPPING       (0x00000001)
1527 
1528 
1529 /****************************************************************************
1530 *  BIOS Config Pages
1531 ****************************************************************************/
1532 
1533 /*BIOS Page 1 */
1534 
1535 typedef struct _MPI2_CONFIG_PAGE_BIOS_1 {
1536 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1537 	U32                     BiosOptions;                /*0x04 */
1538 	U32                     IOCSettings;                /*0x08 */
1539 	U8                      SSUTimeout;                 /*0x0C */
1540 	U8                      MaxEnclosureLevel;          /*0x0D */
1541 	U16                     Reserved2;                  /*0x0E */
1542 	U32                     DeviceSettings;             /*0x10 */
1543 	U16                     NumberOfDevices;            /*0x14 */
1544 	U16                     UEFIVersion;                /*0x16 */
1545 	U16                     IOTimeoutBlockDevicesNonRM; /*0x18 */
1546 	U16                     IOTimeoutSequential;        /*0x1A */
1547 	U16                     IOTimeoutOther;             /*0x1C */
1548 	U16                     IOTimeoutBlockDevicesRM;    /*0x1E */
1549 } MPI2_CONFIG_PAGE_BIOS_1,
1550 	*PTR_MPI2_CONFIG_PAGE_BIOS_1,
1551 	Mpi2BiosPage1_t, *pMpi2BiosPage1_t;
1552 
1553 #define MPI2_BIOSPAGE1_PAGEVERSION                      (0x07)
1554 
1555 /*values for BIOS Page 1 BiosOptions field */
1556 #define MPI2_BIOSPAGE1_OPTIONS_BOOT_LIST_ADD_ALT_BOOT_DEVICE    (0x00008000)
1557 #define MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG                  (0x00004000)
1558 
1559 #define MPI2_BIOSPAGE1_OPTIONS_PNS_MASK                         (0x00003800)
1560 #define MPI2_BIOSPAGE1_OPTIONS_PNS_PBDHL                        (0x00000000)
1561 #define MPI2_BIOSPAGE1_OPTIONS_PNS_ENCSLOSURE                   (0x00000800)
1562 #define MPI2_BIOSPAGE1_OPTIONS_PNS_LWWID                        (0x00001000)
1563 #define MPI2_BIOSPAGE1_OPTIONS_PNS_PSENS                        (0x00001800)
1564 #define MPI2_BIOSPAGE1_OPTIONS_PNS_ESPHY                        (0x00002000)
1565 
1566 #define MPI2_BIOSPAGE1_OPTIONS_X86_DISABLE_BIOS		(0x00000400)
1567 
1568 #define MPI2_BIOSPAGE1_OPTIONS_MASK_REGISTRATION_UEFI_BSD	(0x00000300)
1569 #define MPI2_BIOSPAGE1_OPTIONS_USE_BIT0_REGISTRATION_UEFI_BSD	(0x00000000)
1570 #define MPI2_BIOSPAGE1_OPTIONS_FULL_REGISTRATION_UEFI_BSD	(0x00000100)
1571 #define MPI2_BIOSPAGE1_OPTIONS_ADAPTER_REGISTRATION_UEFI_BSD	(0x00000200)
1572 #define MPI2_BIOSPAGE1_OPTIONS_DISABLE_REGISTRATION_UEFI_BSD	(0x00000300)
1573 
1574 #define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID                  (0x000000F0)
1575 #define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID                   (0x00000000)
1576 
1577 #define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION   (0x00000006)
1578 #define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII              (0x00000000)
1579 #define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII             (0x00000002)
1580 #define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII       (0x00000004)
1581 
1582 #define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS                 (0x00000001)
1583 
1584 /*values for BIOS Page 1 IOCSettings field */
1585 #define MPI2_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE      (0x00030000)
1586 #define MPI2_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT       (0x00000000)
1587 #define MPI2_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT          (0x00010000)
1588 
1589 #define MPI2_BIOSPAGE1_IOCSET_MASK_RM_SETTING           (0x000000C0)
1590 #define MPI2_BIOSPAGE1_IOCSET_NONE_RM_SETTING           (0x00000000)
1591 #define MPI2_BIOSPAGE1_IOCSET_BOOT_RM_SETTING           (0x00000040)
1592 #define MPI2_BIOSPAGE1_IOCSET_MEDIA_RM_SETTING          (0x00000080)
1593 
1594 #define MPI2_BIOSPAGE1_IOCSET_MASK_ADAPTER_SUPPORT      (0x00000030)
1595 #define MPI2_BIOSPAGE1_IOCSET_NO_SUPPORT                (0x00000000)
1596 #define MPI2_BIOSPAGE1_IOCSET_BIOS_SUPPORT              (0x00000010)
1597 #define MPI2_BIOSPAGE1_IOCSET_OS_SUPPORT                (0x00000020)
1598 #define MPI2_BIOSPAGE1_IOCSET_ALL_SUPPORT               (0x00000030)
1599 
1600 #define MPI2_BIOSPAGE1_IOCSET_ALTERNATE_CHS             (0x00000008)
1601 
1602 /*values for BIOS Page 1 DeviceSettings field */
1603 #define MPI2_BIOSPAGE1_DEVSET_DISABLE_SMART_POLLING     (0x00000010)
1604 #define MPI2_BIOSPAGE1_DEVSET_DISABLE_SEQ_LUN           (0x00000008)
1605 #define MPI2_BIOSPAGE1_DEVSET_DISABLE_RM_LUN            (0x00000004)
1606 #define MPI2_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN        (0x00000002)
1607 #define MPI2_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN         (0x00000001)
1608 
1609 /*defines for BIOS Page 1 UEFIVersion field */
1610 #define MPI2_BIOSPAGE1_UEFI_VER_MAJOR_MASK              (0xFF00)
1611 #define MPI2_BIOSPAGE1_UEFI_VER_MAJOR_SHIFT             (8)
1612 #define MPI2_BIOSPAGE1_UEFI_VER_MINOR_MASK              (0x00FF)
1613 #define MPI2_BIOSPAGE1_UEFI_VER_MINOR_SHIFT             (0)
1614 
1615 
1616 
1617 /*BIOS Page 2 */
1618 
1619 typedef struct _MPI2_BOOT_DEVICE_ADAPTER_ORDER {
1620 	U32         Reserved1;                              /*0x00 */
1621 	U32         Reserved2;                              /*0x04 */
1622 	U32         Reserved3;                              /*0x08 */
1623 	U32         Reserved4;                              /*0x0C */
1624 	U32         Reserved5;                              /*0x10 */
1625 	U32         Reserved6;                              /*0x14 */
1626 } MPI2_BOOT_DEVICE_ADAPTER_ORDER,
1627 	*PTR_MPI2_BOOT_DEVICE_ADAPTER_ORDER,
1628 	Mpi2BootDeviceAdapterOrder_t,
1629 	*pMpi2BootDeviceAdapterOrder_t;
1630 
1631 typedef struct _MPI2_BOOT_DEVICE_SAS_WWID {
1632 	U64         SASAddress;                             /*0x00 */
1633 	U8          LUN[8];                                 /*0x08 */
1634 	U32         Reserved1;                              /*0x10 */
1635 	U32         Reserved2;                              /*0x14 */
1636 } MPI2_BOOT_DEVICE_SAS_WWID,
1637 	*PTR_MPI2_BOOT_DEVICE_SAS_WWID,
1638 	Mpi2BootDeviceSasWwid_t,
1639 	*pMpi2BootDeviceSasWwid_t;
1640 
1641 typedef struct _MPI2_BOOT_DEVICE_ENCLOSURE_SLOT {
1642 	U64         EnclosureLogicalID;                     /*0x00 */
1643 	U32         Reserved1;                              /*0x08 */
1644 	U32         Reserved2;                              /*0x0C */
1645 	U16         SlotNumber;                             /*0x10 */
1646 	U16         Reserved3;                              /*0x12 */
1647 	U32         Reserved4;                              /*0x14 */
1648 } MPI2_BOOT_DEVICE_ENCLOSURE_SLOT,
1649 	*PTR_MPI2_BOOT_DEVICE_ENCLOSURE_SLOT,
1650 	Mpi2BootDeviceEnclosureSlot_t,
1651 	*pMpi2BootDeviceEnclosureSlot_t;
1652 
1653 typedef struct _MPI2_BOOT_DEVICE_DEVICE_NAME {
1654 	U64         DeviceName;                             /*0x00 */
1655 	U8          LUN[8];                                 /*0x08 */
1656 	U32         Reserved1;                              /*0x10 */
1657 	U32         Reserved2;                              /*0x14 */
1658 } MPI2_BOOT_DEVICE_DEVICE_NAME,
1659 	*PTR_MPI2_BOOT_DEVICE_DEVICE_NAME,
1660 	Mpi2BootDeviceDeviceName_t,
1661 	*pMpi2BootDeviceDeviceName_t;
1662 
1663 typedef union _MPI2_MPI2_BIOSPAGE2_BOOT_DEVICE {
1664 	MPI2_BOOT_DEVICE_ADAPTER_ORDER  AdapterOrder;
1665 	MPI2_BOOT_DEVICE_SAS_WWID       SasWwid;
1666 	MPI2_BOOT_DEVICE_ENCLOSURE_SLOT EnclosureSlot;
1667 	MPI2_BOOT_DEVICE_DEVICE_NAME    DeviceName;
1668 } MPI2_BIOSPAGE2_BOOT_DEVICE,
1669 	*PTR_MPI2_BIOSPAGE2_BOOT_DEVICE,
1670 	Mpi2BiosPage2BootDevice_t,
1671 	*pMpi2BiosPage2BootDevice_t;
1672 
1673 typedef struct _MPI2_CONFIG_PAGE_BIOS_2 {
1674 	MPI2_CONFIG_PAGE_HEADER     Header;                 /*0x00 */
1675 	U32                         Reserved1;              /*0x04 */
1676 	U32                         Reserved2;              /*0x08 */
1677 	U32                         Reserved3;              /*0x0C */
1678 	U32                         Reserved4;              /*0x10 */
1679 	U32                         Reserved5;              /*0x14 */
1680 	U32                         Reserved6;              /*0x18 */
1681 	U8                          ReqBootDeviceForm;      /*0x1C */
1682 	U8                          Reserved7;              /*0x1D */
1683 	U16                         Reserved8;              /*0x1E */
1684 	MPI2_BIOSPAGE2_BOOT_DEVICE  RequestedBootDevice;    /*0x20 */
1685 	U8                          ReqAltBootDeviceForm;   /*0x38 */
1686 	U8                          Reserved9;              /*0x39 */
1687 	U16                         Reserved10;             /*0x3A */
1688 	MPI2_BIOSPAGE2_BOOT_DEVICE  RequestedAltBootDevice; /*0x3C */
1689 	U8                          CurrentBootDeviceForm;  /*0x58 */
1690 	U8                          Reserved11;             /*0x59 */
1691 	U16                         Reserved12;             /*0x5A */
1692 	MPI2_BIOSPAGE2_BOOT_DEVICE  CurrentBootDevice;      /*0x58 */
1693 } MPI2_CONFIG_PAGE_BIOS_2, *PTR_MPI2_CONFIG_PAGE_BIOS_2,
1694 	Mpi2BiosPage2_t, *pMpi2BiosPage2_t;
1695 
1696 #define MPI2_BIOSPAGE2_PAGEVERSION                      (0x04)
1697 
1698 /*values for BIOS Page 2 BootDeviceForm fields */
1699 #define MPI2_BIOSPAGE2_FORM_MASK                        (0x0F)
1700 #define MPI2_BIOSPAGE2_FORM_NO_DEVICE_SPECIFIED         (0x00)
1701 #define MPI2_BIOSPAGE2_FORM_SAS_WWID                    (0x05)
1702 #define MPI2_BIOSPAGE2_FORM_ENCLOSURE_SLOT              (0x06)
1703 #define MPI2_BIOSPAGE2_FORM_DEVICE_NAME                 (0x07)
1704 
1705 
1706 /*BIOS Page 3 */
1707 
1708 #define MPI2_BIOSPAGE3_NUM_ADAPTER      (4)
1709 
1710 typedef struct _MPI2_ADAPTER_INFO {
1711 	U8      PciBusNumber;                        /*0x00 */
1712 	U8      PciDeviceAndFunctionNumber;          /*0x01 */
1713 	U16     AdapterFlags;                        /*0x02 */
1714 } MPI2_ADAPTER_INFO, *PTR_MPI2_ADAPTER_INFO,
1715 	Mpi2AdapterInfo_t, *pMpi2AdapterInfo_t;
1716 
1717 #define MPI2_ADAPTER_INFO_FLAGS_EMBEDDED                (0x0001)
1718 #define MPI2_ADAPTER_INFO_FLAGS_INIT_STATUS             (0x0002)
1719 
1720 typedef struct _MPI2_ADAPTER_ORDER_AUX {
1721 	U64     WWID;					/* 0x00 */
1722 	U32     Reserved1;				/* 0x08 */
1723 	U32     Reserved2;				/* 0x0C */
1724 } MPI2_ADAPTER_ORDER_AUX, *PTR_MPI2_ADAPTER_ORDER_AUX,
1725 	Mpi2AdapterOrderAux_t, *pMpi2AdapterOrderAux_t;
1726 
1727 
1728 typedef struct _MPI2_CONFIG_PAGE_BIOS_3 {
1729 	MPI2_CONFIG_PAGE_HEADER Header;              /*0x00 */
1730 	U32                     GlobalFlags;         /*0x04 */
1731 	U32                     BiosVersion;         /*0x08 */
1732 	MPI2_ADAPTER_INFO       AdapterOrder[MPI2_BIOSPAGE3_NUM_ADAPTER];
1733 	U32                     Reserved1;           /*0x1C */
1734 	MPI2_ADAPTER_ORDER_AUX  AdapterOrderAux[MPI2_BIOSPAGE3_NUM_ADAPTER];
1735 } MPI2_CONFIG_PAGE_BIOS_3,
1736 	*PTR_MPI2_CONFIG_PAGE_BIOS_3,
1737 	Mpi2BiosPage3_t, *pMpi2BiosPage3_t;
1738 
1739 #define MPI2_BIOSPAGE3_PAGEVERSION                      (0x01)
1740 
1741 /*values for BIOS Page 3 GlobalFlags */
1742 #define MPI2_BIOSPAGE3_FLAGS_PAUSE_ON_ERROR             (0x00000002)
1743 #define MPI2_BIOSPAGE3_FLAGS_VERBOSE_ENABLE             (0x00000004)
1744 #define MPI2_BIOSPAGE3_FLAGS_HOOK_INT_40_DISABLE        (0x00000010)
1745 
1746 #define MPI2_BIOSPAGE3_FLAGS_DEV_LIST_DISPLAY_MASK      (0x000000E0)
1747 #define MPI2_BIOSPAGE3_FLAGS_INSTALLED_DEV_DISPLAY      (0x00000000)
1748 #define MPI2_BIOSPAGE3_FLAGS_ADAPTER_DISPLAY            (0x00000020)
1749 #define MPI2_BIOSPAGE3_FLAGS_ADAPTER_DEV_DISPLAY        (0x00000040)
1750 
1751 
1752 /*BIOS Page 4 */
1753 
1754 /*
1755  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1756  *one and check the value returned for NumPhys at runtime.
1757  */
1758 #ifndef MPI2_BIOS_PAGE_4_PHY_ENTRIES
1759 #define MPI2_BIOS_PAGE_4_PHY_ENTRIES        (1)
1760 #endif
1761 
1762 typedef struct _MPI2_BIOS4_ENTRY {
1763 	U64                     ReassignmentWWID;       /*0x00 */
1764 	U64                     ReassignmentDeviceName; /*0x08 */
1765 } MPI2_BIOS4_ENTRY, *PTR_MPI2_BIOS4_ENTRY,
1766 	Mpi2MBios4Entry_t, *pMpi2Bios4Entry_t;
1767 
1768 typedef struct _MPI2_CONFIG_PAGE_BIOS_4 {
1769 	MPI2_CONFIG_PAGE_HEADER Header;             /*0x00 */
1770 	U8                      NumPhys;            /*0x04 */
1771 	U8                      Reserved1;          /*0x05 */
1772 	U16                     Reserved2;          /*0x06 */
1773 	MPI2_BIOS4_ENTRY
1774 		Phy[MPI2_BIOS_PAGE_4_PHY_ENTRIES];  /*0x08 */
1775 } MPI2_CONFIG_PAGE_BIOS_4, *PTR_MPI2_CONFIG_PAGE_BIOS_4,
1776 	Mpi2BiosPage4_t, *pMpi2BiosPage4_t;
1777 
1778 #define MPI2_BIOSPAGE4_PAGEVERSION                      (0x01)
1779 
1780 
1781 /****************************************************************************
1782 *  RAID Volume Config Pages
1783 ****************************************************************************/
1784 
1785 /*RAID Volume Page 0 */
1786 
1787 typedef struct _MPI2_RAIDVOL0_PHYS_DISK {
1788 	U8                      RAIDSetNum;        /*0x00 */
1789 	U8                      PhysDiskMap;       /*0x01 */
1790 	U8                      PhysDiskNum;       /*0x02 */
1791 	U8                      Reserved;          /*0x03 */
1792 } MPI2_RAIDVOL0_PHYS_DISK, *PTR_MPI2_RAIDVOL0_PHYS_DISK,
1793 	Mpi2RaidVol0PhysDisk_t, *pMpi2RaidVol0PhysDisk_t;
1794 
1795 /*defines for the PhysDiskMap field */
1796 #define MPI2_RAIDVOL0_PHYSDISK_PRIMARY                  (0x01)
1797 #define MPI2_RAIDVOL0_PHYSDISK_SECONDARY                (0x02)
1798 
1799 typedef struct _MPI2_RAIDVOL0_SETTINGS {
1800 	U16                     Settings;          /*0x00 */
1801 	U8                      HotSparePool;      /*0x01 */
1802 	U8                      Reserved;          /*0x02 */
1803 } MPI2_RAIDVOL0_SETTINGS, *PTR_MPI2_RAIDVOL0_SETTINGS,
1804 	Mpi2RaidVol0Settings_t,
1805 	*pMpi2RaidVol0Settings_t;
1806 
1807 /*RAID Volume Page 0 HotSparePool defines, also used in RAID Physical Disk */
1808 #define MPI2_RAID_HOT_SPARE_POOL_0                      (0x01)
1809 #define MPI2_RAID_HOT_SPARE_POOL_1                      (0x02)
1810 #define MPI2_RAID_HOT_SPARE_POOL_2                      (0x04)
1811 #define MPI2_RAID_HOT_SPARE_POOL_3                      (0x08)
1812 #define MPI2_RAID_HOT_SPARE_POOL_4                      (0x10)
1813 #define MPI2_RAID_HOT_SPARE_POOL_5                      (0x20)
1814 #define MPI2_RAID_HOT_SPARE_POOL_6                      (0x40)
1815 #define MPI2_RAID_HOT_SPARE_POOL_7                      (0x80)
1816 
1817 /*RAID Volume Page 0 VolumeSettings defines */
1818 #define MPI2_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX     (0x0008)
1819 #define MPI2_RAIDVOL0_SETTING_AUTO_CONFIG_HSWAP_DISABLE (0x0004)
1820 
1821 #define MPI2_RAIDVOL0_SETTING_MASK_WRITE_CACHING        (0x0003)
1822 #define MPI2_RAIDVOL0_SETTING_UNCHANGED                 (0x0000)
1823 #define MPI2_RAIDVOL0_SETTING_DISABLE_WRITE_CACHING     (0x0001)
1824 #define MPI2_RAIDVOL0_SETTING_ENABLE_WRITE_CACHING      (0x0002)
1825 
1826 /*
1827  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
1828  *one and check the value returned for NumPhysDisks at runtime.
1829  */
1830 #ifndef MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX
1831 #define MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX       (1)
1832 #endif
1833 
1834 typedef struct _MPI2_CONFIG_PAGE_RAID_VOL_0 {
1835 	MPI2_CONFIG_PAGE_HEADER Header;            /*0x00 */
1836 	U16                     DevHandle;         /*0x04 */
1837 	U8                      VolumeState;       /*0x06 */
1838 	U8                      VolumeType;        /*0x07 */
1839 	U32                     VolumeStatusFlags; /*0x08 */
1840 	MPI2_RAIDVOL0_SETTINGS  VolumeSettings;    /*0x0C */
1841 	U64                     MaxLBA;            /*0x10 */
1842 	U32                     StripeSize;        /*0x18 */
1843 	U16                     BlockSize;         /*0x1C */
1844 	U16                     Reserved1;         /*0x1E */
1845 	U8                      SupportedPhysDisks;/*0x20 */
1846 	U8                      ResyncRate;        /*0x21 */
1847 	U16                     DataScrubDuration; /*0x22 */
1848 	U8                      NumPhysDisks;      /*0x24 */
1849 	U8                      Reserved2;         /*0x25 */
1850 	U8                      Reserved3;         /*0x26 */
1851 	U8                      InactiveStatus;    /*0x27 */
1852 	MPI2_RAIDVOL0_PHYS_DISK
1853 	PhysDisk[MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX]; /*0x28 */
1854 } MPI2_CONFIG_PAGE_RAID_VOL_0,
1855 	*PTR_MPI2_CONFIG_PAGE_RAID_VOL_0,
1856 	Mpi2RaidVolPage0_t, *pMpi2RaidVolPage0_t;
1857 
1858 #define MPI2_RAIDVOLPAGE0_PAGEVERSION           (0x0A)
1859 
1860 /*values for RAID VolumeState */
1861 #define MPI2_RAID_VOL_STATE_MISSING                         (0x00)
1862 #define MPI2_RAID_VOL_STATE_FAILED                          (0x01)
1863 #define MPI2_RAID_VOL_STATE_INITIALIZING                    (0x02)
1864 #define MPI2_RAID_VOL_STATE_ONLINE                          (0x03)
1865 #define MPI2_RAID_VOL_STATE_DEGRADED                        (0x04)
1866 #define MPI2_RAID_VOL_STATE_OPTIMAL                         (0x05)
1867 
1868 /*values for RAID VolumeType */
1869 #define MPI2_RAID_VOL_TYPE_RAID0                            (0x00)
1870 #define MPI2_RAID_VOL_TYPE_RAID1E                           (0x01)
1871 #define MPI2_RAID_VOL_TYPE_RAID1                            (0x02)
1872 #define MPI2_RAID_VOL_TYPE_RAID10                           (0x05)
1873 #define MPI2_RAID_VOL_TYPE_UNKNOWN                          (0xFF)
1874 
1875 /*values for RAID Volume Page 0 VolumeStatusFlags field */
1876 #define MPI2_RAIDVOL0_STATUS_FLAG_PENDING_RESYNC            (0x02000000)
1877 #define MPI2_RAIDVOL0_STATUS_FLAG_BACKG_INIT_PENDING        (0x01000000)
1878 #define MPI2_RAIDVOL0_STATUS_FLAG_MDC_PENDING               (0x00800000)
1879 #define MPI2_RAIDVOL0_STATUS_FLAG_USER_CONSIST_PENDING      (0x00400000)
1880 #define MPI2_RAIDVOL0_STATUS_FLAG_MAKE_DATA_CONSISTENT      (0x00200000)
1881 #define MPI2_RAIDVOL0_STATUS_FLAG_DATA_SCRUB                (0x00100000)
1882 #define MPI2_RAIDVOL0_STATUS_FLAG_CONSISTENCY_CHECK         (0x00080000)
1883 #define MPI2_RAIDVOL0_STATUS_FLAG_CAPACITY_EXPANSION        (0x00040000)
1884 #define MPI2_RAIDVOL0_STATUS_FLAG_BACKGROUND_INIT           (0x00020000)
1885 #define MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS        (0x00010000)
1886 #define MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT        (0x00000080)
1887 #define MPI2_RAIDVOL0_STATUS_FLAG_OCE_ALLOWED               (0x00000040)
1888 #define MPI2_RAIDVOL0_STATUS_FLAG_BGI_COMPLETE              (0x00000020)
1889 #define MPI2_RAIDVOL0_STATUS_FLAG_1E_OFFSET_MIRROR          (0x00000000)
1890 #define MPI2_RAIDVOL0_STATUS_FLAG_1E_ADJACENT_MIRROR        (0x00000010)
1891 #define MPI2_RAIDVOL0_STATUS_FLAG_BAD_BLOCK_TABLE_FULL      (0x00000008)
1892 #define MPI2_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE           (0x00000004)
1893 #define MPI2_RAIDVOL0_STATUS_FLAG_QUIESCED                  (0x00000002)
1894 #define MPI2_RAIDVOL0_STATUS_FLAG_ENABLED                   (0x00000001)
1895 
1896 /*values for RAID Volume Page 0 SupportedPhysDisks field */
1897 #define MPI2_RAIDVOL0_SUPPORT_SOLID_STATE_DISKS             (0x08)
1898 #define MPI2_RAIDVOL0_SUPPORT_HARD_DISKS                    (0x04)
1899 #define MPI2_RAIDVOL0_SUPPORT_SAS_PROTOCOL                  (0x02)
1900 #define MPI2_RAIDVOL0_SUPPORT_SATA_PROTOCOL                 (0x01)
1901 
1902 /*values for RAID Volume Page 0 InactiveStatus field */
1903 #define MPI2_RAIDVOLPAGE0_UNKNOWN_INACTIVE                  (0x00)
1904 #define MPI2_RAIDVOLPAGE0_STALE_METADATA_INACTIVE           (0x01)
1905 #define MPI2_RAIDVOLPAGE0_FOREIGN_VOLUME_INACTIVE           (0x02)
1906 #define MPI2_RAIDVOLPAGE0_INSUFFICIENT_RESOURCE_INACTIVE    (0x03)
1907 #define MPI2_RAIDVOLPAGE0_CLONE_VOLUME_INACTIVE             (0x04)
1908 #define MPI2_RAIDVOLPAGE0_INSUFFICIENT_METADATA_INACTIVE    (0x05)
1909 #define MPI2_RAIDVOLPAGE0_PREVIOUSLY_DELETED                (0x06)
1910 
1911 
1912 /*RAID Volume Page 1 */
1913 
1914 typedef struct _MPI2_CONFIG_PAGE_RAID_VOL_1 {
1915 	MPI2_CONFIG_PAGE_HEADER Header;                     /*0x00 */
1916 	U16                     DevHandle;                  /*0x04 */
1917 	U16                     Reserved0;                  /*0x06 */
1918 	U8                      GUID[24];                   /*0x08 */
1919 	U8                      Name[16];                   /*0x20 */
1920 	U64                     WWID;                       /*0x30 */
1921 	U32                     Reserved1;                  /*0x38 */
1922 	U32                     Reserved2;                  /*0x3C */
1923 } MPI2_CONFIG_PAGE_RAID_VOL_1,
1924 	*PTR_MPI2_CONFIG_PAGE_RAID_VOL_1,
1925 	Mpi2RaidVolPage1_t, *pMpi2RaidVolPage1_t;
1926 
1927 #define MPI2_RAIDVOLPAGE1_PAGEVERSION           (0x03)
1928 
1929 
1930 /****************************************************************************
1931 *  RAID Physical Disk Config Pages
1932 ****************************************************************************/
1933 
1934 /*RAID Physical Disk Page 0 */
1935 
1936 typedef struct _MPI2_RAIDPHYSDISK0_SETTINGS {
1937 	U16                     Reserved1;                  /*0x00 */
1938 	U8                      HotSparePool;               /*0x02 */
1939 	U8                      Reserved2;                  /*0x03 */
1940 } MPI2_RAIDPHYSDISK0_SETTINGS,
1941 	*PTR_MPI2_RAIDPHYSDISK0_SETTINGS,
1942 	Mpi2RaidPhysDisk0Settings_t,
1943 	*pMpi2RaidPhysDisk0Settings_t;
1944 
1945 /*use MPI2_RAID_HOT_SPARE_POOL_ defines for the HotSparePool field */
1946 
1947 typedef struct _MPI2_RAIDPHYSDISK0_INQUIRY_DATA {
1948 	U8                      VendorID[8];                /*0x00 */
1949 	U8                      ProductID[16];              /*0x08 */
1950 	U8                      ProductRevLevel[4];         /*0x18 */
1951 	U8                      SerialNum[32];              /*0x1C */
1952 } MPI2_RAIDPHYSDISK0_INQUIRY_DATA,
1953 	*PTR_MPI2_RAIDPHYSDISK0_INQUIRY_DATA,
1954 	Mpi2RaidPhysDisk0InquiryData_t,
1955 	*pMpi2RaidPhysDisk0InquiryData_t;
1956 
1957 typedef struct _MPI2_CONFIG_PAGE_RD_PDISK_0 {
1958 	MPI2_CONFIG_PAGE_HEADER         Header;             /*0x00 */
1959 	U16                             DevHandle;          /*0x04 */
1960 	U8                              Reserved1;          /*0x06 */
1961 	U8                              PhysDiskNum;        /*0x07 */
1962 	MPI2_RAIDPHYSDISK0_SETTINGS     PhysDiskSettings;   /*0x08 */
1963 	U32                             Reserved2;          /*0x0C */
1964 	MPI2_RAIDPHYSDISK0_INQUIRY_DATA InquiryData;        /*0x10 */
1965 	U32                             Reserved3;          /*0x4C */
1966 	U8                              PhysDiskState;      /*0x50 */
1967 	U8                              OfflineReason;      /*0x51 */
1968 	U8                              IncompatibleReason; /*0x52 */
1969 	U8                              PhysDiskAttributes; /*0x53 */
1970 	U32                             PhysDiskStatusFlags;/*0x54 */
1971 	U64                             DeviceMaxLBA;       /*0x58 */
1972 	U64                             HostMaxLBA;         /*0x60 */
1973 	U64                             CoercedMaxLBA;      /*0x68 */
1974 	U16                             BlockSize;          /*0x70 */
1975 	U16                             Reserved5;          /*0x72 */
1976 	U32                             Reserved6;          /*0x74 */
1977 } MPI2_CONFIG_PAGE_RD_PDISK_0,
1978 	*PTR_MPI2_CONFIG_PAGE_RD_PDISK_0,
1979 	Mpi2RaidPhysDiskPage0_t,
1980 	*pMpi2RaidPhysDiskPage0_t;
1981 
1982 #define MPI2_RAIDPHYSDISKPAGE0_PAGEVERSION          (0x05)
1983 
1984 /*PhysDiskState defines */
1985 #define MPI2_RAID_PD_STATE_NOT_CONFIGURED               (0x00)
1986 #define MPI2_RAID_PD_STATE_NOT_COMPATIBLE               (0x01)
1987 #define MPI2_RAID_PD_STATE_OFFLINE                      (0x02)
1988 #define MPI2_RAID_PD_STATE_ONLINE                       (0x03)
1989 #define MPI2_RAID_PD_STATE_HOT_SPARE                    (0x04)
1990 #define MPI2_RAID_PD_STATE_DEGRADED                     (0x05)
1991 #define MPI2_RAID_PD_STATE_REBUILDING                   (0x06)
1992 #define MPI2_RAID_PD_STATE_OPTIMAL                      (0x07)
1993 
1994 /*OfflineReason defines */
1995 #define MPI2_PHYSDISK0_ONLINE                           (0x00)
1996 #define MPI2_PHYSDISK0_OFFLINE_MISSING                  (0x01)
1997 #define MPI2_PHYSDISK0_OFFLINE_FAILED                   (0x03)
1998 #define MPI2_PHYSDISK0_OFFLINE_INITIALIZING             (0x04)
1999 #define MPI2_PHYSDISK0_OFFLINE_REQUESTED                (0x05)
2000 #define MPI2_PHYSDISK0_OFFLINE_FAILED_REQUESTED         (0x06)
2001 #define MPI2_PHYSDISK0_OFFLINE_OTHER                    (0xFF)
2002 
2003 /*IncompatibleReason defines */
2004 #define MPI2_PHYSDISK0_COMPATIBLE                       (0x00)
2005 #define MPI2_PHYSDISK0_INCOMPATIBLE_PROTOCOL            (0x01)
2006 #define MPI2_PHYSDISK0_INCOMPATIBLE_BLOCKSIZE           (0x02)
2007 #define MPI2_PHYSDISK0_INCOMPATIBLE_MAX_LBA             (0x03)
2008 #define MPI2_PHYSDISK0_INCOMPATIBLE_SATA_EXTENDED_CMD   (0x04)
2009 #define MPI2_PHYSDISK0_INCOMPATIBLE_REMOVEABLE_MEDIA    (0x05)
2010 #define MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE          (0x06)
2011 #define MPI2_PHYSDISK0_INCOMPATIBLE_UNKNOWN             (0xFF)
2012 
2013 /*PhysDiskAttributes defines */
2014 #define MPI2_PHYSDISK0_ATTRIB_MEDIA_MASK                (0x0C)
2015 #define MPI2_PHYSDISK0_ATTRIB_SOLID_STATE_DRIVE         (0x08)
2016 #define MPI2_PHYSDISK0_ATTRIB_HARD_DISK_DRIVE           (0x04)
2017 
2018 #define MPI2_PHYSDISK0_ATTRIB_PROTOCOL_MASK             (0x03)
2019 #define MPI2_PHYSDISK0_ATTRIB_SAS_PROTOCOL              (0x02)
2020 #define MPI2_PHYSDISK0_ATTRIB_SATA_PROTOCOL             (0x01)
2021 
2022 /*PhysDiskStatusFlags defines */
2023 #define MPI2_PHYSDISK0_STATUS_FLAG_NOT_CERTIFIED        (0x00000040)
2024 #define MPI2_PHYSDISK0_STATUS_FLAG_OCE_TARGET           (0x00000020)
2025 #define MPI2_PHYSDISK0_STATUS_FLAG_WRITE_CACHE_ENABLED  (0x00000010)
2026 #define MPI2_PHYSDISK0_STATUS_FLAG_OPTIMAL_PREVIOUS     (0x00000000)
2027 #define MPI2_PHYSDISK0_STATUS_FLAG_NOT_OPTIMAL_PREVIOUS (0x00000008)
2028 #define MPI2_PHYSDISK0_STATUS_FLAG_INACTIVE_VOLUME      (0x00000004)
2029 #define MPI2_PHYSDISK0_STATUS_FLAG_QUIESCED             (0x00000002)
2030 #define MPI2_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC          (0x00000001)
2031 
2032 
2033 /*RAID Physical Disk Page 1 */
2034 
2035 /*
2036  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2037  *one and check the value returned for NumPhysDiskPaths at runtime.
2038  */
2039 #ifndef MPI2_RAID_PHYS_DISK1_PATH_MAX
2040 #define MPI2_RAID_PHYS_DISK1_PATH_MAX   (1)
2041 #endif
2042 
2043 typedef struct _MPI2_RAIDPHYSDISK1_PATH {
2044 	U16             DevHandle;          /*0x00 */
2045 	U16             Reserved1;          /*0x02 */
2046 	U64             WWID;               /*0x04 */
2047 	U64             OwnerWWID;          /*0x0C */
2048 	U8              OwnerIdentifier;    /*0x14 */
2049 	U8              Reserved2;          /*0x15 */
2050 	U16             Flags;              /*0x16 */
2051 } MPI2_RAIDPHYSDISK1_PATH, *PTR_MPI2_RAIDPHYSDISK1_PATH,
2052 	Mpi2RaidPhysDisk1Path_t,
2053 	*pMpi2RaidPhysDisk1Path_t;
2054 
2055 /*RAID Physical Disk Page 1 Physical Disk Path Flags field defines */
2056 #define MPI2_RAID_PHYSDISK1_FLAG_PRIMARY        (0x0004)
2057 #define MPI2_RAID_PHYSDISK1_FLAG_BROKEN         (0x0002)
2058 #define MPI2_RAID_PHYSDISK1_FLAG_INVALID        (0x0001)
2059 
2060 typedef struct _MPI2_CONFIG_PAGE_RD_PDISK_1 {
2061 	MPI2_CONFIG_PAGE_HEADER         Header;             /*0x00 */
2062 	U8                              NumPhysDiskPaths;   /*0x04 */
2063 	U8                              PhysDiskNum;        /*0x05 */
2064 	U16                             Reserved1;          /*0x06 */
2065 	U32                             Reserved2;          /*0x08 */
2066 	MPI2_RAIDPHYSDISK1_PATH
2067 		PhysicalDiskPath[MPI2_RAID_PHYS_DISK1_PATH_MAX];/*0x0C */
2068 } MPI2_CONFIG_PAGE_RD_PDISK_1,
2069 	*PTR_MPI2_CONFIG_PAGE_RD_PDISK_1,
2070 	Mpi2RaidPhysDiskPage1_t,
2071 	*pMpi2RaidPhysDiskPage1_t;
2072 
2073 #define MPI2_RAIDPHYSDISKPAGE1_PAGEVERSION          (0x02)
2074 
2075 
2076 /****************************************************************************
2077 *  values for fields used by several types of SAS Config Pages
2078 ****************************************************************************/
2079 
2080 /*values for NegotiatedLinkRates fields */
2081 #define MPI2_SAS_NEG_LINK_RATE_MASK_LOGICAL             (0xF0)
2082 #define MPI2_SAS_NEG_LINK_RATE_SHIFT_LOGICAL            (4)
2083 #define MPI2_SAS_NEG_LINK_RATE_MASK_PHYSICAL            (0x0F)
2084 /*link rates used for Negotiated Physical and Logical Link Rate */
2085 #define MPI2_SAS_NEG_LINK_RATE_UNKNOWN_LINK_RATE        (0x00)
2086 #define MPI2_SAS_NEG_LINK_RATE_PHY_DISABLED             (0x01)
2087 #define MPI2_SAS_NEG_LINK_RATE_NEGOTIATION_FAILED       (0x02)
2088 #define MPI2_SAS_NEG_LINK_RATE_SATA_OOB_COMPLETE        (0x03)
2089 #define MPI2_SAS_NEG_LINK_RATE_PORT_SELECTOR            (0x04)
2090 #define MPI2_SAS_NEG_LINK_RATE_SMP_RESET_IN_PROGRESS    (0x05)
2091 #define MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY          (0x06)
2092 #define MPI2_SAS_NEG_LINK_RATE_1_5                      (0x08)
2093 #define MPI2_SAS_NEG_LINK_RATE_3_0                      (0x09)
2094 #define MPI2_SAS_NEG_LINK_RATE_6_0                      (0x0A)
2095 #define MPI25_SAS_NEG_LINK_RATE_12_0                    (0x0B)
2096 #define MPI26_SAS_NEG_LINK_RATE_22_5                    (0x0C)
2097 
2098 
2099 /*values for AttachedPhyInfo fields */
2100 #define MPI2_SAS_APHYINFO_INSIDE_ZPSDS_PERSISTENT       (0x00000040)
2101 #define MPI2_SAS_APHYINFO_REQUESTED_INSIDE_ZPSDS        (0x00000020)
2102 #define MPI2_SAS_APHYINFO_BREAK_REPLY_CAPABLE           (0x00000010)
2103 
2104 #define MPI2_SAS_APHYINFO_REASON_MASK                   (0x0000000F)
2105 #define MPI2_SAS_APHYINFO_REASON_UNKNOWN                (0x00000000)
2106 #define MPI2_SAS_APHYINFO_REASON_POWER_ON               (0x00000001)
2107 #define MPI2_SAS_APHYINFO_REASON_HARD_RESET             (0x00000002)
2108 #define MPI2_SAS_APHYINFO_REASON_SMP_PHY_CONTROL        (0x00000003)
2109 #define MPI2_SAS_APHYINFO_REASON_LOSS_OF_SYNC           (0x00000004)
2110 #define MPI2_SAS_APHYINFO_REASON_MULTIPLEXING_SEQ       (0x00000005)
2111 #define MPI2_SAS_APHYINFO_REASON_IT_NEXUS_LOSS_TIMER    (0x00000006)
2112 #define MPI2_SAS_APHYINFO_REASON_BREAK_TIMEOUT          (0x00000007)
2113 #define MPI2_SAS_APHYINFO_REASON_PHY_TEST_STOPPED       (0x00000008)
2114 
2115 
2116 /*values for PhyInfo fields */
2117 #define MPI2_SAS_PHYINFO_PHY_VACANT                     (0x80000000)
2118 
2119 #define MPI2_SAS_PHYINFO_PHY_POWER_CONDITION_MASK       (0x18000000)
2120 #define MPI2_SAS_PHYINFO_SHIFT_PHY_POWER_CONDITION      (27)
2121 #define MPI2_SAS_PHYINFO_PHY_POWER_ACTIVE               (0x00000000)
2122 #define MPI2_SAS_PHYINFO_PHY_POWER_PARTIAL              (0x08000000)
2123 #define MPI2_SAS_PHYINFO_PHY_POWER_SLUMBER              (0x10000000)
2124 
2125 #define MPI2_SAS_PHYINFO_CHANGED_REQ_INSIDE_ZPSDS       (0x04000000)
2126 #define MPI2_SAS_PHYINFO_INSIDE_ZPSDS_PERSISTENT        (0x02000000)
2127 #define MPI2_SAS_PHYINFO_REQ_INSIDE_ZPSDS               (0x01000000)
2128 #define MPI2_SAS_PHYINFO_ZONE_GROUP_PERSISTENT          (0x00400000)
2129 #define MPI2_SAS_PHYINFO_INSIDE_ZPSDS                   (0x00200000)
2130 #define MPI2_SAS_PHYINFO_ZONING_ENABLED                 (0x00100000)
2131 
2132 #define MPI2_SAS_PHYINFO_REASON_MASK                    (0x000F0000)
2133 #define MPI2_SAS_PHYINFO_REASON_UNKNOWN                 (0x00000000)
2134 #define MPI2_SAS_PHYINFO_REASON_POWER_ON                (0x00010000)
2135 #define MPI2_SAS_PHYINFO_REASON_HARD_RESET              (0x00020000)
2136 #define MPI2_SAS_PHYINFO_REASON_SMP_PHY_CONTROL         (0x00030000)
2137 #define MPI2_SAS_PHYINFO_REASON_LOSS_OF_SYNC            (0x00040000)
2138 #define MPI2_SAS_PHYINFO_REASON_MULTIPLEXING_SEQ        (0x00050000)
2139 #define MPI2_SAS_PHYINFO_REASON_IT_NEXUS_LOSS_TIMER     (0x00060000)
2140 #define MPI2_SAS_PHYINFO_REASON_BREAK_TIMEOUT           (0x00070000)
2141 #define MPI2_SAS_PHYINFO_REASON_PHY_TEST_STOPPED        (0x00080000)
2142 
2143 #define MPI2_SAS_PHYINFO_MULTIPLEXING_SUPPORTED         (0x00008000)
2144 #define MPI2_SAS_PHYINFO_SATA_PORT_ACTIVE               (0x00004000)
2145 #define MPI2_SAS_PHYINFO_SATA_PORT_SELECTOR_PRESENT     (0x00002000)
2146 #define MPI2_SAS_PHYINFO_VIRTUAL_PHY                    (0x00001000)
2147 
2148 #define MPI2_SAS_PHYINFO_MASK_PARTIAL_PATHWAY_TIME      (0x00000F00)
2149 #define MPI2_SAS_PHYINFO_SHIFT_PARTIAL_PATHWAY_TIME     (8)
2150 
2151 #define MPI2_SAS_PHYINFO_MASK_ROUTING_ATTRIBUTE         (0x000000F0)
2152 #define MPI2_SAS_PHYINFO_DIRECT_ROUTING                 (0x00000000)
2153 #define MPI2_SAS_PHYINFO_SUBTRACTIVE_ROUTING            (0x00000010)
2154 #define MPI2_SAS_PHYINFO_TABLE_ROUTING                  (0x00000020)
2155 
2156 
2157 /*values for SAS ProgrammedLinkRate fields */
2158 #define MPI2_SAS_PRATE_MAX_RATE_MASK                    (0xF0)
2159 #define MPI2_SAS_PRATE_MAX_RATE_NOT_PROGRAMMABLE        (0x00)
2160 #define MPI2_SAS_PRATE_MAX_RATE_1_5                     (0x80)
2161 #define MPI2_SAS_PRATE_MAX_RATE_3_0                     (0x90)
2162 #define MPI2_SAS_PRATE_MAX_RATE_6_0                     (0xA0)
2163 #define MPI25_SAS_PRATE_MAX_RATE_12_0                   (0xB0)
2164 #define MPI26_SAS_PRATE_MAX_RATE_22_5                   (0xC0)
2165 #define MPI2_SAS_PRATE_MIN_RATE_MASK                    (0x0F)
2166 #define MPI2_SAS_PRATE_MIN_RATE_NOT_PROGRAMMABLE        (0x00)
2167 #define MPI2_SAS_PRATE_MIN_RATE_1_5                     (0x08)
2168 #define MPI2_SAS_PRATE_MIN_RATE_3_0                     (0x09)
2169 #define MPI2_SAS_PRATE_MIN_RATE_6_0                     (0x0A)
2170 #define MPI25_SAS_PRATE_MIN_RATE_12_0                   (0x0B)
2171 #define MPI26_SAS_PRATE_MIN_RATE_22_5                   (0x0C)
2172 
2173 
2174 /*values for SAS HwLinkRate fields */
2175 #define MPI2_SAS_HWRATE_MAX_RATE_MASK                   (0xF0)
2176 #define MPI2_SAS_HWRATE_MAX_RATE_1_5                    (0x80)
2177 #define MPI2_SAS_HWRATE_MAX_RATE_3_0                    (0x90)
2178 #define MPI2_SAS_HWRATE_MAX_RATE_6_0                    (0xA0)
2179 #define MPI25_SAS_HWRATE_MAX_RATE_12_0                  (0xB0)
2180 #define MPI26_SAS_HWRATE_MAX_RATE_22_5                  (0xC0)
2181 #define MPI2_SAS_HWRATE_MIN_RATE_MASK                   (0x0F)
2182 #define MPI2_SAS_HWRATE_MIN_RATE_1_5                    (0x08)
2183 #define MPI2_SAS_HWRATE_MIN_RATE_3_0                    (0x09)
2184 #define MPI2_SAS_HWRATE_MIN_RATE_6_0                    (0x0A)
2185 #define MPI25_SAS_HWRATE_MIN_RATE_12_0                  (0x0B)
2186 #define MPI26_SAS_HWRATE_MIN_RATE_22_5                  (0x0C)
2187 
2188 
2189 
2190 /****************************************************************************
2191 *  SAS IO Unit Config Pages
2192 ****************************************************************************/
2193 
2194 /*SAS IO Unit Page 0 */
2195 
2196 typedef struct _MPI2_SAS_IO_UNIT0_PHY_DATA {
2197 	U8          Port;                   /*0x00 */
2198 	U8          PortFlags;              /*0x01 */
2199 	U8          PhyFlags;               /*0x02 */
2200 	U8          NegotiatedLinkRate;     /*0x03 */
2201 	U32         ControllerPhyDeviceInfo;/*0x04 */
2202 	U16         AttachedDevHandle;      /*0x08 */
2203 	U16         ControllerDevHandle;    /*0x0A */
2204 	U32         DiscoveryStatus;        /*0x0C */
2205 	U32         Reserved;               /*0x10 */
2206 } MPI2_SAS_IO_UNIT0_PHY_DATA,
2207 	*PTR_MPI2_SAS_IO_UNIT0_PHY_DATA,
2208 	Mpi2SasIOUnit0PhyData_t,
2209 	*pMpi2SasIOUnit0PhyData_t;
2210 
2211 /*
2212  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2213  *one and check the value returned for NumPhys at runtime.
2214  */
2215 #ifndef MPI2_SAS_IOUNIT0_PHY_MAX
2216 #define MPI2_SAS_IOUNIT0_PHY_MAX        (1)
2217 #endif
2218 
2219 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_0 {
2220 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;   /*0x00 */
2221 	U32                                 Reserved1;/*0x08 */
2222 	U8                                  NumPhys;  /*0x0C */
2223 	U8                                  Reserved2;/*0x0D */
2224 	U16                                 Reserved3;/*0x0E */
2225 	MPI2_SAS_IO_UNIT0_PHY_DATA
2226 		PhyData[MPI2_SAS_IOUNIT0_PHY_MAX];    /*0x10 */
2227 } MPI2_CONFIG_PAGE_SASIOUNIT_0,
2228 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_0,
2229 	Mpi2SasIOUnitPage0_t, *pMpi2SasIOUnitPage0_t;
2230 
2231 #define MPI2_SASIOUNITPAGE0_PAGEVERSION                     (0x05)
2232 
2233 /*values for SAS IO Unit Page 0 PortFlags */
2234 #define MPI2_SASIOUNIT0_PORTFLAGS_DISCOVERY_IN_PROGRESS     (0x08)
2235 #define MPI2_SASIOUNIT0_PORTFLAGS_AUTO_PORT_CONFIG          (0x01)
2236 
2237 /*values for SAS IO Unit Page 0 PhyFlags */
2238 #define MPI2_SASIOUNIT0_PHYFLAGS_INIT_PERSIST_CONNECT       (0x40)
2239 #define MPI2_SASIOUNIT0_PHYFLAGS_TARG_PERSIST_CONNECT       (0x20)
2240 #define MPI2_SASIOUNIT0_PHYFLAGS_ZONING_ENABLED             (0x10)
2241 #define MPI2_SASIOUNIT0_PHYFLAGS_PHY_DISABLED               (0x08)
2242 
2243 /*use MPI2_SAS_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
2244 
2245 /*see mpi2_sas.h for values for
2246  *SAS IO Unit Page 0 ControllerPhyDeviceInfo values */
2247 
2248 /*values for SAS IO Unit Page 0 DiscoveryStatus */
2249 #define MPI2_SASIOUNIT0_DS_MAX_ENCLOSURES_EXCEED            (0x80000000)
2250 #define MPI2_SASIOUNIT0_DS_MAX_EXPANDERS_EXCEED             (0x40000000)
2251 #define MPI2_SASIOUNIT0_DS_MAX_DEVICES_EXCEED               (0x20000000)
2252 #define MPI2_SASIOUNIT0_DS_MAX_TOPO_PHYS_EXCEED             (0x10000000)
2253 #define MPI2_SASIOUNIT0_DS_DOWNSTREAM_INITIATOR             (0x08000000)
2254 #define MPI2_SASIOUNIT0_DS_MULTI_SUBTRACTIVE_SUBTRACTIVE    (0x00008000)
2255 #define MPI2_SASIOUNIT0_DS_EXP_MULTI_SUBTRACTIVE            (0x00004000)
2256 #define MPI2_SASIOUNIT0_DS_MULTI_PORT_DOMAIN                (0x00002000)
2257 #define MPI2_SASIOUNIT0_DS_TABLE_TO_SUBTRACTIVE_LINK        (0x00001000)
2258 #define MPI2_SASIOUNIT0_DS_UNSUPPORTED_DEVICE               (0x00000800)
2259 #define MPI2_SASIOUNIT0_DS_TABLE_LINK                       (0x00000400)
2260 #define MPI2_SASIOUNIT0_DS_SUBTRACTIVE_LINK                 (0x00000200)
2261 #define MPI2_SASIOUNIT0_DS_SMP_CRC_ERROR                    (0x00000100)
2262 #define MPI2_SASIOUNIT0_DS_SMP_FUNCTION_FAILED              (0x00000080)
2263 #define MPI2_SASIOUNIT0_DS_INDEX_NOT_EXIST                  (0x00000040)
2264 #define MPI2_SASIOUNIT0_DS_OUT_ROUTE_ENTRIES                (0x00000020)
2265 #define MPI2_SASIOUNIT0_DS_SMP_TIMEOUT                      (0x00000010)
2266 #define MPI2_SASIOUNIT0_DS_MULTIPLE_PORTS                   (0x00000004)
2267 #define MPI2_SASIOUNIT0_DS_UNADDRESSABLE_DEVICE             (0x00000002)
2268 #define MPI2_SASIOUNIT0_DS_LOOP_DETECTED                    (0x00000001)
2269 
2270 
2271 /*SAS IO Unit Page 1 */
2272 
2273 typedef struct _MPI2_SAS_IO_UNIT1_PHY_DATA {
2274 	U8          Port;                       /*0x00 */
2275 	U8          PortFlags;                  /*0x01 */
2276 	U8          PhyFlags;                   /*0x02 */
2277 	U8          MaxMinLinkRate;             /*0x03 */
2278 	U32         ControllerPhyDeviceInfo;    /*0x04 */
2279 	U16         MaxTargetPortConnectTime;   /*0x08 */
2280 	U16         Reserved1;                  /*0x0A */
2281 } MPI2_SAS_IO_UNIT1_PHY_DATA,
2282 	*PTR_MPI2_SAS_IO_UNIT1_PHY_DATA,
2283 	Mpi2SasIOUnit1PhyData_t,
2284 	*pMpi2SasIOUnit1PhyData_t;
2285 
2286 /*
2287  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2288  *one and check the value returned for NumPhys at runtime.
2289  */
2290 #ifndef MPI2_SAS_IOUNIT1_PHY_MAX
2291 #define MPI2_SAS_IOUNIT1_PHY_MAX        (1)
2292 #endif
2293 
2294 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_1 {
2295 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header; /*0x00 */
2296 	U16
2297 		ControlFlags;                       /*0x08 */
2298 	U16
2299 		SASNarrowMaxQueueDepth;             /*0x0A */
2300 	U16
2301 		AdditionalControlFlags;             /*0x0C */
2302 	U16
2303 		SASWideMaxQueueDepth;               /*0x0E */
2304 	U8
2305 		NumPhys;                            /*0x10 */
2306 	U8
2307 		SATAMaxQDepth;                      /*0x11 */
2308 	U8
2309 		ReportDeviceMissingDelay;           /*0x12 */
2310 	U8
2311 		IODeviceMissingDelay;               /*0x13 */
2312 	MPI2_SAS_IO_UNIT1_PHY_DATA
2313 		PhyData[MPI2_SAS_IOUNIT1_PHY_MAX];  /*0x14 */
2314 } MPI2_CONFIG_PAGE_SASIOUNIT_1,
2315 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_1,
2316 	Mpi2SasIOUnitPage1_t, *pMpi2SasIOUnitPage1_t;
2317 
2318 #define MPI2_SASIOUNITPAGE1_PAGEVERSION     (0x09)
2319 
2320 /*values for SAS IO Unit Page 1 ControlFlags */
2321 #define MPI2_SASIOUNIT1_CONTROL_DEVICE_SELF_TEST                    (0x8000)
2322 #define MPI2_SASIOUNIT1_CONTROL_SATA_3_0_MAX                        (0x4000)
2323 #define MPI2_SASIOUNIT1_CONTROL_SATA_1_5_MAX                        (0x2000)
2324 #define MPI2_SASIOUNIT1_CONTROL_SATA_SW_PRESERVE                    (0x1000)
2325 
2326 #define MPI2_SASIOUNIT1_CONTROL_MASK_DEV_SUPPORT                    (0x0600)
2327 #define MPI2_SASIOUNIT1_CONTROL_SHIFT_DEV_SUPPORT                   (9)
2328 #define MPI2_SASIOUNIT1_CONTROL_DEV_SUPPORT_BOTH                    (0x0)
2329 #define MPI2_SASIOUNIT1_CONTROL_DEV_SAS_SUPPORT                     (0x1)
2330 #define MPI2_SASIOUNIT1_CONTROL_DEV_SATA_SUPPORT                    (0x2)
2331 
2332 #define MPI2_SASIOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED             (0x0080)
2333 #define MPI2_SASIOUNIT1_CONTROL_SATA_SMART_REQUIRED                 (0x0040)
2334 #define MPI2_SASIOUNIT1_CONTROL_SATA_NCQ_REQUIRED                   (0x0020)
2335 #define MPI2_SASIOUNIT1_CONTROL_SATA_FUA_REQUIRED                   (0x0010)
2336 #define MPI2_SASIOUNIT1_CONTROL_TABLE_SUBTRACTIVE_ILLEGAL           (0x0008)
2337 #define MPI2_SASIOUNIT1_CONTROL_SUBTRACTIVE_ILLEGAL                 (0x0004)
2338 #define MPI2_SASIOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY                 (0x0002)
2339 #define MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION                   (0x0001)
2340 
2341 /*values for SAS IO Unit Page 1 AdditionalControlFlags */
2342 #define MPI2_SASIOUNIT1_ACONTROL_DA_PERSIST_CONNECT                 (0x0100)
2343 #define MPI2_SASIOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL          (0x0080)
2344 #define MPI2_SASIOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION    (0x0040)
2345 #define MPI2_SASIOUNIT1_ACONTROL_INVALID_TOPOLOGY_CORRECTION        (0x0020)
2346 #define MPI2_SASIOUNIT1_ACONTROL_PORT_ENABLE_ONLY_SATA_LINK_RESET   (0x0010)
2347 #define MPI2_SASIOUNIT1_ACONTROL_OTHER_AFFILIATION_SATA_LINK_RESET  (0x0008)
2348 #define MPI2_SASIOUNIT1_ACONTROL_SELF_AFFILIATION_SATA_LINK_RESET   (0x0004)
2349 #define MPI2_SASIOUNIT1_ACONTROL_NO_AFFILIATION_SATA_LINK_RESET     (0x0002)
2350 #define MPI2_SASIOUNIT1_ACONTROL_ALLOW_TABLE_TO_TABLE               (0x0001)
2351 
2352 /*defines for SAS IO Unit Page 1 ReportDeviceMissingDelay */
2353 #define MPI2_SASIOUNIT1_REPORT_MISSING_TIMEOUT_MASK                 (0x7F)
2354 #define MPI2_SASIOUNIT1_REPORT_MISSING_UNIT_16                      (0x80)
2355 
2356 /*values for SAS IO Unit Page 1 PortFlags */
2357 #define MPI2_SASIOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG                 (0x01)
2358 
2359 /*values for SAS IO Unit Page 1 PhyFlags */
2360 #define MPI2_SASIOUNIT1_PHYFLAGS_INIT_PERSIST_CONNECT               (0x40)
2361 #define MPI2_SASIOUNIT1_PHYFLAGS_TARG_PERSIST_CONNECT               (0x20)
2362 #define MPI2_SASIOUNIT1_PHYFLAGS_ZONING_ENABLE                      (0x10)
2363 #define MPI2_SASIOUNIT1_PHYFLAGS_PHY_DISABLE                        (0x08)
2364 
2365 /*values for SAS IO Unit Page 1 MaxMinLinkRate */
2366 #define MPI2_SASIOUNIT1_MAX_RATE_MASK                               (0xF0)
2367 #define MPI2_SASIOUNIT1_MAX_RATE_1_5                                (0x80)
2368 #define MPI2_SASIOUNIT1_MAX_RATE_3_0                                (0x90)
2369 #define MPI2_SASIOUNIT1_MAX_RATE_6_0                                (0xA0)
2370 #define MPI25_SASIOUNIT1_MAX_RATE_12_0                              (0xB0)
2371 #define MPI26_SASIOUNIT1_MAX_RATE_22_5                              (0xC0)
2372 #define MPI2_SASIOUNIT1_MIN_RATE_MASK                               (0x0F)
2373 #define MPI2_SASIOUNIT1_MIN_RATE_1_5                                (0x08)
2374 #define MPI2_SASIOUNIT1_MIN_RATE_3_0                                (0x09)
2375 #define MPI2_SASIOUNIT1_MIN_RATE_6_0                                (0x0A)
2376 #define MPI25_SASIOUNIT1_MIN_RATE_12_0                              (0x0B)
2377 #define MPI26_SASIOUNIT1_MIN_RATE_22_5                              (0x0C)
2378 
2379 /*see mpi2_sas.h for values for
2380  *SAS IO Unit Page 1 ControllerPhyDeviceInfo values */
2381 
2382 
2383 /*SAS IO Unit Page 4 (for MPI v2.5 and earlier) */
2384 
2385 typedef struct _MPI2_SAS_IOUNIT4_SPINUP_GROUP {
2386 	U8          MaxTargetSpinup;            /*0x00 */
2387 	U8          SpinupDelay;                /*0x01 */
2388 	U8          SpinupFlags;                /*0x02 */
2389 	U8          Reserved1;                  /*0x03 */
2390 } MPI2_SAS_IOUNIT4_SPINUP_GROUP,
2391 	*PTR_MPI2_SAS_IOUNIT4_SPINUP_GROUP,
2392 	Mpi2SasIOUnit4SpinupGroup_t,
2393 	*pMpi2SasIOUnit4SpinupGroup_t;
2394 /*defines for SAS IO Unit Page 4 SpinupFlags */
2395 #define MPI2_SASIOUNIT4_SPINUP_DISABLE_FLAG         (0x01)
2396 
2397 
2398 /*
2399  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2400  *one and check the value returned for NumPhys at runtime.
2401  */
2402 #ifndef MPI2_SAS_IOUNIT4_PHY_MAX
2403 #define MPI2_SAS_IOUNIT4_PHY_MAX        (4)
2404 #endif
2405 
2406 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_4 {
2407 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;/*0x00 */
2408 	MPI2_SAS_IOUNIT4_SPINUP_GROUP
2409 		SpinupGroupParameters[4];       /*0x08 */
2410 	U32
2411 		Reserved1;                      /*0x18 */
2412 	U32
2413 		Reserved2;                      /*0x1C */
2414 	U32
2415 		Reserved3;                      /*0x20 */
2416 	U8
2417 		BootDeviceWaitTime;             /*0x24 */
2418 	U8
2419 		SATADeviceWaitTime;		/*0x25 */
2420 	U16
2421 		Reserved5;                      /*0x26 */
2422 	U8
2423 		NumPhys;                        /*0x28 */
2424 	U8
2425 		PEInitialSpinupDelay;           /*0x29 */
2426 	U8
2427 		PEReplyDelay;                   /*0x2A */
2428 	U8
2429 		Flags;                          /*0x2B */
2430 	U8
2431 		PHY[MPI2_SAS_IOUNIT4_PHY_MAX];  /*0x2C */
2432 } MPI2_CONFIG_PAGE_SASIOUNIT_4,
2433 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_4,
2434 	Mpi2SasIOUnitPage4_t, *pMpi2SasIOUnitPage4_t;
2435 
2436 #define MPI2_SASIOUNITPAGE4_PAGEVERSION     (0x02)
2437 
2438 /*defines for Flags field */
2439 #define MPI2_SASIOUNIT4_FLAGS_AUTO_PORTENABLE               (0x01)
2440 
2441 /*defines for PHY field */
2442 #define MPI2_SASIOUNIT4_PHY_SPINUP_GROUP_MASK               (0x03)
2443 
2444 
2445 /*SAS IO Unit Page 5 */
2446 
2447 typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS {
2448 	U8          ControlFlags;               /*0x00 */
2449 	U8          PortWidthModGroup;          /*0x01 */
2450 	U16         InactivityTimerExponent;    /*0x02 */
2451 	U8          SATAPartialTimeout;         /*0x04 */
2452 	U8          Reserved2;                  /*0x05 */
2453 	U8          SATASlumberTimeout;         /*0x06 */
2454 	U8          Reserved3;                  /*0x07 */
2455 	U8          SASPartialTimeout;          /*0x08 */
2456 	U8          Reserved4;                  /*0x09 */
2457 	U8          SASSlumberTimeout;          /*0x0A */
2458 	U8          Reserved5;                  /*0x0B */
2459 } MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS,
2460 	*PTR_MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS,
2461 	Mpi2SasIOUnit5PhyPmSettings_t,
2462 	*pMpi2SasIOUnit5PhyPmSettings_t;
2463 
2464 /*defines for ControlFlags field */
2465 #define MPI2_SASIOUNIT5_CONTROL_SAS_SLUMBER_ENABLE      (0x08)
2466 #define MPI2_SASIOUNIT5_CONTROL_SAS_PARTIAL_ENABLE      (0x04)
2467 #define MPI2_SASIOUNIT5_CONTROL_SATA_SLUMBER_ENABLE     (0x02)
2468 #define MPI2_SASIOUNIT5_CONTROL_SATA_PARTIAL_ENABLE     (0x01)
2469 
2470 /*defines for PortWidthModeGroup field */
2471 #define MPI2_SASIOUNIT5_PWMG_DISABLE                    (0xFF)
2472 
2473 /*defines for InactivityTimerExponent field */
2474 #define MPI2_SASIOUNIT5_ITE_MASK_SAS_SLUMBER            (0x7000)
2475 #define MPI2_SASIOUNIT5_ITE_SHIFT_SAS_SLUMBER           (12)
2476 #define MPI2_SASIOUNIT5_ITE_MASK_SAS_PARTIAL            (0x0700)
2477 #define MPI2_SASIOUNIT5_ITE_SHIFT_SAS_PARTIAL           (8)
2478 #define MPI2_SASIOUNIT5_ITE_MASK_SATA_SLUMBER           (0x0070)
2479 #define MPI2_SASIOUNIT5_ITE_SHIFT_SATA_SLUMBER          (4)
2480 #define MPI2_SASIOUNIT5_ITE_MASK_SATA_PARTIAL           (0x0007)
2481 #define MPI2_SASIOUNIT5_ITE_SHIFT_SATA_PARTIAL          (0)
2482 
2483 #define MPI2_SASIOUNIT5_ITE_TEN_SECONDS                 (7)
2484 #define MPI2_SASIOUNIT5_ITE_ONE_SECOND                  (6)
2485 #define MPI2_SASIOUNIT5_ITE_HUNDRED_MILLISECONDS        (5)
2486 #define MPI2_SASIOUNIT5_ITE_TEN_MILLISECONDS            (4)
2487 #define MPI2_SASIOUNIT5_ITE_ONE_MILLISECOND             (3)
2488 #define MPI2_SASIOUNIT5_ITE_HUNDRED_MICROSECONDS        (2)
2489 #define MPI2_SASIOUNIT5_ITE_TEN_MICROSECONDS            (1)
2490 #define MPI2_SASIOUNIT5_ITE_ONE_MICROSECOND             (0)
2491 
2492 /*
2493  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2494  *one and check the value returned for NumPhys at runtime.
2495  */
2496 #ifndef MPI2_SAS_IOUNIT5_PHY_MAX
2497 #define MPI2_SAS_IOUNIT5_PHY_MAX        (1)
2498 #endif
2499 
2500 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_5 {
2501 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;   /*0x00 */
2502 	U8                                  NumPhys;  /*0x08 */
2503 	U8                                  Reserved1;/*0x09 */
2504 	U16                                 Reserved2;/*0x0A */
2505 	U32                                 Reserved3;/*0x0C */
2506 	MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS
2507 	SASPhyPowerManagementSettings[MPI2_SAS_IOUNIT5_PHY_MAX];/*0x10 */
2508 } MPI2_CONFIG_PAGE_SASIOUNIT_5,
2509 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_5,
2510 	Mpi2SasIOUnitPage5_t, *pMpi2SasIOUnitPage5_t;
2511 
2512 #define MPI2_SASIOUNITPAGE5_PAGEVERSION     (0x01)
2513 
2514 
2515 /*SAS IO Unit Page 6 */
2516 
2517 typedef struct _MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS {
2518 	U8          CurrentStatus;              /*0x00 */
2519 	U8          CurrentModulation;          /*0x01 */
2520 	U8          CurrentUtilization;         /*0x02 */
2521 	U8          Reserved1;                  /*0x03 */
2522 	U32         Reserved2;                  /*0x04 */
2523 } MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS,
2524 	*PTR_MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS,
2525 	Mpi2SasIOUnit6PortWidthModGroupStatus_t,
2526 	*pMpi2SasIOUnit6PortWidthModGroupStatus_t;
2527 
2528 /*defines for CurrentStatus field */
2529 #define MPI2_SASIOUNIT6_STATUS_UNAVAILABLE                      (0x00)
2530 #define MPI2_SASIOUNIT6_STATUS_UNCONFIGURED                     (0x01)
2531 #define MPI2_SASIOUNIT6_STATUS_INVALID_CONFIG                   (0x02)
2532 #define MPI2_SASIOUNIT6_STATUS_LINK_DOWN                        (0x03)
2533 #define MPI2_SASIOUNIT6_STATUS_OBSERVATION_ONLY                 (0x04)
2534 #define MPI2_SASIOUNIT6_STATUS_INACTIVE                         (0x05)
2535 #define MPI2_SASIOUNIT6_STATUS_ACTIVE_IOUNIT                    (0x06)
2536 #define MPI2_SASIOUNIT6_STATUS_ACTIVE_HOST                      (0x07)
2537 
2538 /*defines for CurrentModulation field */
2539 #define MPI2_SASIOUNIT6_MODULATION_25_PERCENT                   (0x00)
2540 #define MPI2_SASIOUNIT6_MODULATION_50_PERCENT                   (0x01)
2541 #define MPI2_SASIOUNIT6_MODULATION_75_PERCENT                   (0x02)
2542 #define MPI2_SASIOUNIT6_MODULATION_100_PERCENT                  (0x03)
2543 
2544 /*
2545  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2546  *one and check the value returned for NumGroups at runtime.
2547  */
2548 #ifndef MPI2_SAS_IOUNIT6_GROUP_MAX
2549 #define MPI2_SAS_IOUNIT6_GROUP_MAX      (1)
2550 #endif
2551 
2552 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_6 {
2553 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;                 /*0x00 */
2554 	U32                                 Reserved1;              /*0x08 */
2555 	U32                                 Reserved2;              /*0x0C */
2556 	U8                                  NumGroups;              /*0x10 */
2557 	U8                                  Reserved3;              /*0x11 */
2558 	U16                                 Reserved4;              /*0x12 */
2559 	MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS
2560 	PortWidthModulationGroupStatus[MPI2_SAS_IOUNIT6_GROUP_MAX]; /*0x14 */
2561 } MPI2_CONFIG_PAGE_SASIOUNIT_6,
2562 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_6,
2563 	Mpi2SasIOUnitPage6_t, *pMpi2SasIOUnitPage6_t;
2564 
2565 #define MPI2_SASIOUNITPAGE6_PAGEVERSION     (0x00)
2566 
2567 
2568 /*SAS IO Unit Page 7 */
2569 
2570 typedef struct _MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS {
2571 	U8          Flags;                      /*0x00 */
2572 	U8          Reserved1;                  /*0x01 */
2573 	U16         Reserved2;                  /*0x02 */
2574 	U8          Threshold75Pct;             /*0x04 */
2575 	U8          Threshold50Pct;             /*0x05 */
2576 	U8          Threshold25Pct;             /*0x06 */
2577 	U8          Reserved3;                  /*0x07 */
2578 } MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS,
2579 	*PTR_MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS,
2580 	Mpi2SasIOUnit7PortWidthModGroupSettings_t,
2581 	*pMpi2SasIOUnit7PortWidthModGroupSettings_t;
2582 
2583 /*defines for Flags field */
2584 #define MPI2_SASIOUNIT7_FLAGS_ENABLE_PORT_WIDTH_MODULATION  (0x01)
2585 
2586 
2587 /*
2588  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2589  *one and check the value returned for NumGroups at runtime.
2590  */
2591 #ifndef MPI2_SAS_IOUNIT7_GROUP_MAX
2592 #define MPI2_SAS_IOUNIT7_GROUP_MAX      (1)
2593 #endif
2594 
2595 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_7 {
2596 	MPI2_CONFIG_EXTENDED_PAGE_HEADER Header;             /*0x00 */
2597 	U8                               SamplingInterval;   /*0x08 */
2598 	U8                               WindowLength;       /*0x09 */
2599 	U16                              Reserved1;          /*0x0A */
2600 	U32                              Reserved2;          /*0x0C */
2601 	U32                              Reserved3;          /*0x10 */
2602 	U8                               NumGroups;          /*0x14 */
2603 	U8                               Reserved4;          /*0x15 */
2604 	U16                              Reserved5;          /*0x16 */
2605 	MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS
2606 	PortWidthModulationGroupSettings[MPI2_SAS_IOUNIT7_GROUP_MAX];/*0x18 */
2607 } MPI2_CONFIG_PAGE_SASIOUNIT_7,
2608 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_7,
2609 	Mpi2SasIOUnitPage7_t, *pMpi2SasIOUnitPage7_t;
2610 
2611 #define MPI2_SASIOUNITPAGE7_PAGEVERSION     (0x00)
2612 
2613 
2614 /*SAS IO Unit Page 8 */
2615 
2616 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_8 {
2617 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2618 		Header;                         /*0x00 */
2619 	U32
2620 		Reserved1;                      /*0x08 */
2621 	U32
2622 		PowerManagementCapabilities;    /*0x0C */
2623 	U8
2624 		TxRxSleepStatus;                /*0x10 */
2625 	U8
2626 		Reserved2;                      /*0x11 */
2627 	U16
2628 		Reserved3;                      /*0x12 */
2629 } MPI2_CONFIG_PAGE_SASIOUNIT_8,
2630 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT_8,
2631 	Mpi2SasIOUnitPage8_t, *pMpi2SasIOUnitPage8_t;
2632 
2633 #define MPI2_SASIOUNITPAGE8_PAGEVERSION     (0x00)
2634 
2635 /*defines for PowerManagementCapabilities field */
2636 #define MPI2_SASIOUNIT8_PM_HOST_PORT_WIDTH_MOD          (0x00001000)
2637 #define MPI2_SASIOUNIT8_PM_HOST_SAS_SLUMBER_MODE        (0x00000800)
2638 #define MPI2_SASIOUNIT8_PM_HOST_SAS_PARTIAL_MODE        (0x00000400)
2639 #define MPI2_SASIOUNIT8_PM_HOST_SATA_SLUMBER_MODE       (0x00000200)
2640 #define MPI2_SASIOUNIT8_PM_HOST_SATA_PARTIAL_MODE       (0x00000100)
2641 #define MPI2_SASIOUNIT8_PM_IOUNIT_PORT_WIDTH_MOD        (0x00000010)
2642 #define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_SLUMBER_MODE      (0x00000008)
2643 #define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_PARTIAL_MODE      (0x00000004)
2644 #define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_SLUMBER_MODE     (0x00000002)
2645 #define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_PARTIAL_MODE     (0x00000001)
2646 
2647 /*defines for TxRxSleepStatus field */
2648 #define MPI25_SASIOUNIT8_TXRXSLEEP_UNSUPPORTED          (0x00)
2649 #define MPI25_SASIOUNIT8_TXRXSLEEP_DISENGAGED           (0x01)
2650 #define MPI25_SASIOUNIT8_TXRXSLEEP_ACTIVE               (0x02)
2651 #define MPI25_SASIOUNIT8_TXRXSLEEP_SHUTDOWN             (0x03)
2652 
2653 
2654 
2655 /*SAS IO Unit Page 16 */
2656 
2657 typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT16 {
2658 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2659 		Header;                             /*0x00 */
2660 	U64
2661 		TimeStamp;                          /*0x08 */
2662 	U32
2663 		Reserved1;                          /*0x10 */
2664 	U32
2665 		Reserved2;                          /*0x14 */
2666 	U32
2667 		FastPathPendedRequests;             /*0x18 */
2668 	U32
2669 		FastPathUnPendedRequests;           /*0x1C */
2670 	U32
2671 		FastPathHostRequestStarts;          /*0x20 */
2672 	U32
2673 		FastPathFirmwareRequestStarts;      /*0x24 */
2674 	U32
2675 		FastPathHostCompletions;            /*0x28 */
2676 	U32
2677 		FastPathFirmwareCompletions;        /*0x2C */
2678 	U32
2679 		NonFastPathRequestStarts;           /*0x30 */
2680 	U32
2681 		NonFastPathHostCompletions;         /*0x30 */
2682 } MPI2_CONFIG_PAGE_SASIOUNIT16,
2683 	*PTR_MPI2_CONFIG_PAGE_SASIOUNIT16,
2684 	Mpi2SasIOUnitPage16_t, *pMpi2SasIOUnitPage16_t;
2685 
2686 #define MPI2_SASIOUNITPAGE16_PAGEVERSION    (0x00)
2687 
2688 
2689 /****************************************************************************
2690 *  SAS Expander Config Pages
2691 ****************************************************************************/
2692 
2693 /*SAS Expander Page 0 */
2694 
2695 typedef struct _MPI2_CONFIG_PAGE_EXPANDER_0 {
2696 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2697 		Header;                     /*0x00 */
2698 	U8
2699 		PhysicalPort;               /*0x08 */
2700 	U8
2701 		ReportGenLength;            /*0x09 */
2702 	U16
2703 		EnclosureHandle;            /*0x0A */
2704 	U64
2705 		SASAddress;                 /*0x0C */
2706 	U32
2707 		DiscoveryStatus;            /*0x14 */
2708 	U16
2709 		DevHandle;                  /*0x18 */
2710 	U16
2711 		ParentDevHandle;            /*0x1A */
2712 	U16
2713 		ExpanderChangeCount;        /*0x1C */
2714 	U16
2715 		ExpanderRouteIndexes;       /*0x1E */
2716 	U8
2717 		NumPhys;                    /*0x20 */
2718 	U8
2719 		SASLevel;                   /*0x21 */
2720 	U16
2721 		Flags;                      /*0x22 */
2722 	U16
2723 		STPBusInactivityTimeLimit;  /*0x24 */
2724 	U16
2725 		STPMaxConnectTimeLimit;     /*0x26 */
2726 	U16
2727 		STP_SMP_NexusLossTime;      /*0x28 */
2728 	U16
2729 		MaxNumRoutedSasAddresses;   /*0x2A */
2730 	U64
2731 		ActiveZoneManagerSASAddress;/*0x2C */
2732 	U16
2733 		ZoneLockInactivityLimit;    /*0x34 */
2734 	U16
2735 		Reserved1;                  /*0x36 */
2736 	U8
2737 		TimeToReducedFunc;          /*0x38 */
2738 	U8
2739 		InitialTimeToReducedFunc;   /*0x39 */
2740 	U8
2741 		MaxReducedFuncTime;         /*0x3A */
2742 	U8
2743 		Reserved2;                  /*0x3B */
2744 } MPI2_CONFIG_PAGE_EXPANDER_0,
2745 	*PTR_MPI2_CONFIG_PAGE_EXPANDER_0,
2746 	Mpi2ExpanderPage0_t, *pMpi2ExpanderPage0_t;
2747 
2748 #define MPI2_SASEXPANDER0_PAGEVERSION       (0x06)
2749 
2750 /*values for SAS Expander Page 0 DiscoveryStatus field */
2751 #define MPI2_SAS_EXPANDER0_DS_MAX_ENCLOSURES_EXCEED         (0x80000000)
2752 #define MPI2_SAS_EXPANDER0_DS_MAX_EXPANDERS_EXCEED          (0x40000000)
2753 #define MPI2_SAS_EXPANDER0_DS_MAX_DEVICES_EXCEED            (0x20000000)
2754 #define MPI2_SAS_EXPANDER0_DS_MAX_TOPO_PHYS_EXCEED          (0x10000000)
2755 #define MPI2_SAS_EXPANDER0_DS_DOWNSTREAM_INITIATOR          (0x08000000)
2756 #define MPI2_SAS_EXPANDER0_DS_MULTI_SUBTRACTIVE_SUBTRACTIVE (0x00008000)
2757 #define MPI2_SAS_EXPANDER0_DS_EXP_MULTI_SUBTRACTIVE         (0x00004000)
2758 #define MPI2_SAS_EXPANDER0_DS_MULTI_PORT_DOMAIN             (0x00002000)
2759 #define MPI2_SAS_EXPANDER0_DS_TABLE_TO_SUBTRACTIVE_LINK     (0x00001000)
2760 #define MPI2_SAS_EXPANDER0_DS_UNSUPPORTED_DEVICE            (0x00000800)
2761 #define MPI2_SAS_EXPANDER0_DS_TABLE_LINK                    (0x00000400)
2762 #define MPI2_SAS_EXPANDER0_DS_SUBTRACTIVE_LINK              (0x00000200)
2763 #define MPI2_SAS_EXPANDER0_DS_SMP_CRC_ERROR                 (0x00000100)
2764 #define MPI2_SAS_EXPANDER0_DS_SMP_FUNCTION_FAILED           (0x00000080)
2765 #define MPI2_SAS_EXPANDER0_DS_INDEX_NOT_EXIST               (0x00000040)
2766 #define MPI2_SAS_EXPANDER0_DS_OUT_ROUTE_ENTRIES             (0x00000020)
2767 #define MPI2_SAS_EXPANDER0_DS_SMP_TIMEOUT                   (0x00000010)
2768 #define MPI2_SAS_EXPANDER0_DS_MULTIPLE_PORTS                (0x00000004)
2769 #define MPI2_SAS_EXPANDER0_DS_UNADDRESSABLE_DEVICE          (0x00000002)
2770 #define MPI2_SAS_EXPANDER0_DS_LOOP_DETECTED                 (0x00000001)
2771 
2772 /*values for SAS Expander Page 0 Flags field */
2773 #define MPI2_SAS_EXPANDER0_FLAGS_REDUCED_FUNCTIONALITY      (0x2000)
2774 #define MPI2_SAS_EXPANDER0_FLAGS_ZONE_LOCKED                (0x1000)
2775 #define MPI2_SAS_EXPANDER0_FLAGS_SUPPORTED_PHYSICAL_PRES    (0x0800)
2776 #define MPI2_SAS_EXPANDER0_FLAGS_ASSERTED_PHYSICAL_PRES     (0x0400)
2777 #define MPI2_SAS_EXPANDER0_FLAGS_ZONING_SUPPORT             (0x0200)
2778 #define MPI2_SAS_EXPANDER0_FLAGS_ENABLED_ZONING             (0x0100)
2779 #define MPI2_SAS_EXPANDER0_FLAGS_TABLE_TO_TABLE_SUPPORT     (0x0080)
2780 #define MPI2_SAS_EXPANDER0_FLAGS_CONNECTOR_END_DEVICE       (0x0010)
2781 #define MPI2_SAS_EXPANDER0_FLAGS_OTHERS_CONFIG              (0x0004)
2782 #define MPI2_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS         (0x0002)
2783 #define MPI2_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG         (0x0001)
2784 
2785 
2786 /*SAS Expander Page 1 */
2787 
2788 typedef struct _MPI2_CONFIG_PAGE_EXPANDER_1 {
2789 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2790 		Header;                     /*0x00 */
2791 	U8
2792 		PhysicalPort;               /*0x08 */
2793 	U8
2794 		Reserved1;                  /*0x09 */
2795 	U16
2796 		Reserved2;                  /*0x0A */
2797 	U8
2798 		NumPhys;                    /*0x0C */
2799 	U8
2800 		Phy;                        /*0x0D */
2801 	U16
2802 		NumTableEntriesProgrammed;  /*0x0E */
2803 	U8
2804 		ProgrammedLinkRate;         /*0x10 */
2805 	U8
2806 		HwLinkRate;                 /*0x11 */
2807 	U16
2808 		AttachedDevHandle;          /*0x12 */
2809 	U32
2810 		PhyInfo;                    /*0x14 */
2811 	U32
2812 		AttachedDeviceInfo;         /*0x18 */
2813 	U16
2814 		ExpanderDevHandle;          /*0x1C */
2815 	U8
2816 		ChangeCount;                /*0x1E */
2817 	U8
2818 		NegotiatedLinkRate;         /*0x1F */
2819 	U8
2820 		PhyIdentifier;              /*0x20 */
2821 	U8
2822 		AttachedPhyIdentifier;      /*0x21 */
2823 	U8
2824 		Reserved3;                  /*0x22 */
2825 	U8
2826 		DiscoveryInfo;              /*0x23 */
2827 	U32
2828 		AttachedPhyInfo;            /*0x24 */
2829 	U8
2830 		ZoneGroup;                  /*0x28 */
2831 	U8
2832 		SelfConfigStatus;           /*0x29 */
2833 	U16
2834 		Reserved4;                  /*0x2A */
2835 } MPI2_CONFIG_PAGE_EXPANDER_1,
2836 	*PTR_MPI2_CONFIG_PAGE_EXPANDER_1,
2837 	Mpi2ExpanderPage1_t, *pMpi2ExpanderPage1_t;
2838 
2839 #define MPI2_SASEXPANDER1_PAGEVERSION       (0x02)
2840 
2841 /*use MPI2_SAS_PRATE_ defines for the ProgrammedLinkRate field */
2842 
2843 /*use MPI2_SAS_HWRATE_ defines for the HwLinkRate field */
2844 
2845 /*use MPI2_SAS_PHYINFO_ for the PhyInfo field */
2846 
2847 /*see mpi2_sas.h for the MPI2_SAS_DEVICE_INFO_ defines
2848  *used for the AttachedDeviceInfo field */
2849 
2850 /*use MPI2_SAS_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
2851 
2852 /*values for SAS Expander Page 1 DiscoveryInfo field */
2853 #define MPI2_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED    (0x04)
2854 #define MPI2_SAS_EXPANDER1_DISCINFO_LINK_STATUS_CHANGE  (0x02)
2855 #define MPI2_SAS_EXPANDER1_DISCINFO_NO_ROUTING_ENTRIES  (0x01)
2856 
2857 /*use MPI2_SAS_APHYINFO_ defines for AttachedPhyInfo field */
2858 
2859 
2860 /****************************************************************************
2861 *  SAS Device Config Pages
2862 ****************************************************************************/
2863 
2864 /*SAS Device Page 0 */
2865 
2866 typedef struct _MPI2_CONFIG_PAGE_SAS_DEV_0 {
2867 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2868 		Header;                 /*0x00 */
2869 	U16
2870 		Slot;                   /*0x08 */
2871 	U16
2872 		EnclosureHandle;        /*0x0A */
2873 	U64
2874 		SASAddress;             /*0x0C */
2875 	U16
2876 		ParentDevHandle;        /*0x14 */
2877 	U8
2878 		PhyNum;                 /*0x16 */
2879 	U8
2880 		AccessStatus;           /*0x17 */
2881 	U16
2882 		DevHandle;              /*0x18 */
2883 	U8
2884 		AttachedPhyIdentifier;  /*0x1A */
2885 	U8
2886 		ZoneGroup;              /*0x1B */
2887 	U32
2888 		DeviceInfo;             /*0x1C */
2889 	U16
2890 		Flags;                  /*0x20 */
2891 	U8
2892 		PhysicalPort;           /*0x22 */
2893 	U8
2894 		MaxPortConnections;     /*0x23 */
2895 	U64
2896 		DeviceName;             /*0x24 */
2897 	U8
2898 		PortGroups;             /*0x2C */
2899 	U8
2900 		DmaGroup;               /*0x2D */
2901 	U8
2902 		ControlGroup;           /*0x2E */
2903 	U8
2904 		EnclosureLevel;		/*0x2F */
2905 	U32
2906 		ConnectorName[4];	/*0x30 */
2907 	U32
2908 		Reserved3;              /*0x34 */
2909 } MPI2_CONFIG_PAGE_SAS_DEV_0,
2910 	*PTR_MPI2_CONFIG_PAGE_SAS_DEV_0,
2911 	Mpi2SasDevicePage0_t,
2912 	*pMpi2SasDevicePage0_t;
2913 
2914 #define MPI2_SASDEVICE0_PAGEVERSION         (0x09)
2915 
2916 /*values for SAS Device Page 0 AccessStatus field */
2917 #define MPI2_SAS_DEVICE0_ASTATUS_NO_ERRORS                  (0x00)
2918 #define MPI2_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED           (0x01)
2919 #define MPI2_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED     (0x02)
2920 #define MPI2_SAS_DEVICE0_ASTATUS_SATA_AFFILIATION_CONFLICT  (0x03)
2921 #define MPI2_SAS_DEVICE0_ASTATUS_SATA_NEEDS_INITIALIZATION  (0x04)
2922 #define MPI2_SAS_DEVICE0_ASTATUS_ROUTE_NOT_ADDRESSABLE      (0x05)
2923 #define MPI2_SAS_DEVICE0_ASTATUS_SMP_ERROR_NOT_ADDRESSABLE  (0x06)
2924 #define MPI2_SAS_DEVICE0_ASTATUS_DEVICE_BLOCKED             (0x07)
2925 /*specific values for SATA Init failures */
2926 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_UNKNOWN                (0x10)
2927 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_AFFILIATION_CONFLICT   (0x11)
2928 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_DIAG                   (0x12)
2929 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_IDENTIFICATION         (0x13)
2930 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_CHECK_POWER            (0x14)
2931 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_PIO_SN                 (0x15)
2932 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_MDMA_SN                (0x16)
2933 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_UDMA_SN                (0x17)
2934 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_ZONING_VIOLATION       (0x18)
2935 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_NOT_ADDRESSABLE        (0x19)
2936 #define MPI2_SAS_DEVICE0_ASTATUS_SIF_MAX                    (0x1F)
2937 
2938 /*see mpi2_sas.h for values for SAS Device Page 0 DeviceInfo values */
2939 
2940 /*values for SAS Device Page 0 Flags field */
2941 #define MPI2_SAS_DEVICE0_FLAGS_UNAUTHORIZED_DEVICE          (0x8000)
2942 #define MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH           (0x4000)
2943 #define MPI25_SAS_DEVICE0_FLAGS_FAST_PATH_CAPABLE           (0x2000)
2944 #define MPI2_SAS_DEVICE0_FLAGS_SLUMBER_PM_CAPABLE           (0x1000)
2945 #define MPI2_SAS_DEVICE0_FLAGS_PARTIAL_PM_CAPABLE           (0x0800)
2946 #define MPI2_SAS_DEVICE0_FLAGS_SATA_ASYNCHRONOUS_NOTIFY     (0x0400)
2947 #define MPI2_SAS_DEVICE0_FLAGS_SATA_SW_PRESERVE             (0x0200)
2948 #define MPI2_SAS_DEVICE0_FLAGS_UNSUPPORTED_DEVICE           (0x0100)
2949 #define MPI2_SAS_DEVICE0_FLAGS_SATA_48BIT_LBA_SUPPORTED     (0x0080)
2950 #define MPI2_SAS_DEVICE0_FLAGS_SATA_SMART_SUPPORTED         (0x0040)
2951 #define MPI2_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED           (0x0020)
2952 #define MPI2_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED           (0x0010)
2953 #define MPI2_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH         (0x0008)
2954 #define MPI2_SAS_DEVICE0_FLAGS_PERSIST_CAPABLE              (0x0004)
2955 #define MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID             (0x0002)
2956 #define MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT               (0x0001)
2957 
2958 
2959 /*SAS Device Page 1 */
2960 
2961 typedef struct _MPI2_CONFIG_PAGE_SAS_DEV_1 {
2962 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2963 		Header;                 /*0x00 */
2964 	U32
2965 		Reserved1;              /*0x08 */
2966 	U64
2967 		SASAddress;             /*0x0C */
2968 	U32
2969 		Reserved2;              /*0x14 */
2970 	U16
2971 		DevHandle;              /*0x18 */
2972 	U16
2973 		Reserved3;              /*0x1A */
2974 	U8
2975 		InitialRegDeviceFIS[20];/*0x1C */
2976 } MPI2_CONFIG_PAGE_SAS_DEV_1,
2977 	*PTR_MPI2_CONFIG_PAGE_SAS_DEV_1,
2978 	Mpi2SasDevicePage1_t,
2979 	*pMpi2SasDevicePage1_t;
2980 
2981 #define MPI2_SASDEVICE1_PAGEVERSION         (0x01)
2982 
2983 
2984 /****************************************************************************
2985 *  SAS PHY Config Pages
2986 ****************************************************************************/
2987 
2988 /*SAS PHY Page 0 */
2989 
2990 typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_0 {
2991 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
2992 		Header;                 /*0x00 */
2993 	U16
2994 		OwnerDevHandle;         /*0x08 */
2995 	U16
2996 		Reserved1;              /*0x0A */
2997 	U16
2998 		AttachedDevHandle;      /*0x0C */
2999 	U8
3000 		AttachedPhyIdentifier;  /*0x0E */
3001 	U8
3002 		Reserved2;              /*0x0F */
3003 	U32
3004 		AttachedPhyInfo;        /*0x10 */
3005 	U8
3006 		ProgrammedLinkRate;     /*0x14 */
3007 	U8
3008 		HwLinkRate;             /*0x15 */
3009 	U8
3010 		ChangeCount;            /*0x16 */
3011 	U8
3012 		Flags;                  /*0x17 */
3013 	U32
3014 		PhyInfo;                /*0x18 */
3015 	U8
3016 		NegotiatedLinkRate;     /*0x1C */
3017 	U8
3018 		Reserved3;              /*0x1D */
3019 	U16
3020 		Reserved4;              /*0x1E */
3021 } MPI2_CONFIG_PAGE_SAS_PHY_0,
3022 	*PTR_MPI2_CONFIG_PAGE_SAS_PHY_0,
3023 	Mpi2SasPhyPage0_t, *pMpi2SasPhyPage0_t;
3024 
3025 #define MPI2_SASPHY0_PAGEVERSION            (0x03)
3026 
3027 /*use MPI2_SAS_APHYINFO_ defines for AttachedPhyInfo field */
3028 
3029 /*use MPI2_SAS_PRATE_ defines for the ProgrammedLinkRate field */
3030 
3031 /*use MPI2_SAS_HWRATE_ defines for the HwLinkRate field */
3032 
3033 /*values for SAS PHY Page 0 Flags field */
3034 #define MPI2_SAS_PHY0_FLAGS_SGPIO_DIRECT_ATTACH_ENC             (0x01)
3035 
3036 /*use MPI2_SAS_PHYINFO_ for the PhyInfo field */
3037 
3038 /*use MPI2_SAS_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
3039 
3040 
3041 /*SAS PHY Page 1 */
3042 
3043 typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_1 {
3044 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3045 		Header;                     /*0x00 */
3046 	U32
3047 		Reserved1;                  /*0x08 */
3048 	U32
3049 		InvalidDwordCount;          /*0x0C */
3050 	U32
3051 		RunningDisparityErrorCount; /*0x10 */
3052 	U32
3053 		LossDwordSynchCount;        /*0x14 */
3054 	U32
3055 		PhyResetProblemCount;       /*0x18 */
3056 } MPI2_CONFIG_PAGE_SAS_PHY_1,
3057 	*PTR_MPI2_CONFIG_PAGE_SAS_PHY_1,
3058 	Mpi2SasPhyPage1_t, *pMpi2SasPhyPage1_t;
3059 
3060 #define MPI2_SASPHY1_PAGEVERSION            (0x01)
3061 
3062 
3063 /*SAS PHY Page 2 */
3064 
3065 typedef struct _MPI2_SASPHY2_PHY_EVENT {
3066 	U8          PhyEventCode;       /*0x00 */
3067 	U8          Reserved1;          /*0x01 */
3068 	U16         Reserved2;          /*0x02 */
3069 	U32         PhyEventInfo;       /*0x04 */
3070 } MPI2_SASPHY2_PHY_EVENT, *PTR_MPI2_SASPHY2_PHY_EVENT,
3071 	Mpi2SasPhy2PhyEvent_t, *pMpi2SasPhy2PhyEvent_t;
3072 
3073 /*use MPI2_SASPHY3_EVENT_CODE_ for the PhyEventCode field */
3074 
3075 
3076 /*
3077  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3078  *one and check the value returned for NumPhyEvents at runtime.
3079  */
3080 #ifndef MPI2_SASPHY2_PHY_EVENT_MAX
3081 #define MPI2_SASPHY2_PHY_EVENT_MAX      (1)
3082 #endif
3083 
3084 typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_2 {
3085 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3086 		Header;                     /*0x00 */
3087 	U32
3088 		Reserved1;                  /*0x08 */
3089 	U8
3090 		NumPhyEvents;               /*0x0C */
3091 	U8
3092 		Reserved2;                  /*0x0D */
3093 	U16
3094 		Reserved3;                  /*0x0E */
3095 	MPI2_SASPHY2_PHY_EVENT
3096 		PhyEvent[MPI2_SASPHY2_PHY_EVENT_MAX]; /*0x10 */
3097 } MPI2_CONFIG_PAGE_SAS_PHY_2,
3098 	*PTR_MPI2_CONFIG_PAGE_SAS_PHY_2,
3099 	Mpi2SasPhyPage2_t,
3100 	*pMpi2SasPhyPage2_t;
3101 
3102 #define MPI2_SASPHY2_PAGEVERSION            (0x00)
3103 
3104 
3105 /*SAS PHY Page 3 */
3106 
3107 typedef struct _MPI2_SASPHY3_PHY_EVENT_CONFIG {
3108 	U8          PhyEventCode;       /*0x00 */
3109 	U8          Reserved1;          /*0x01 */
3110 	U16         Reserved2;          /*0x02 */
3111 	U8          CounterType;        /*0x04 */
3112 	U8          ThresholdWindow;    /*0x05 */
3113 	U8          TimeUnits;          /*0x06 */
3114 	U8          Reserved3;          /*0x07 */
3115 	U32         EventThreshold;     /*0x08 */
3116 	U16         ThresholdFlags;     /*0x0C */
3117 	U16         Reserved4;          /*0x0E */
3118 } MPI2_SASPHY3_PHY_EVENT_CONFIG,
3119 	*PTR_MPI2_SASPHY3_PHY_EVENT_CONFIG,
3120 	Mpi2SasPhy3PhyEventConfig_t,
3121 	*pMpi2SasPhy3PhyEventConfig_t;
3122 
3123 /*values for PhyEventCode field */
3124 #define MPI2_SASPHY3_EVENT_CODE_NO_EVENT                    (0x00)
3125 #define MPI2_SASPHY3_EVENT_CODE_INVALID_DWORD               (0x01)
3126 #define MPI2_SASPHY3_EVENT_CODE_RUNNING_DISPARITY_ERROR     (0x02)
3127 #define MPI2_SASPHY3_EVENT_CODE_LOSS_DWORD_SYNC             (0x03)
3128 #define MPI2_SASPHY3_EVENT_CODE_PHY_RESET_PROBLEM           (0x04)
3129 #define MPI2_SASPHY3_EVENT_CODE_ELASTICITY_BUF_OVERFLOW     (0x05)
3130 #define MPI2_SASPHY3_EVENT_CODE_RX_ERROR                    (0x06)
3131 #define MPI2_SASPHY3_EVENT_CODE_RX_ADDR_FRAME_ERROR         (0x20)
3132 #define MPI2_SASPHY3_EVENT_CODE_TX_AC_OPEN_REJECT           (0x21)
3133 #define MPI2_SASPHY3_EVENT_CODE_RX_AC_OPEN_REJECT           (0x22)
3134 #define MPI2_SASPHY3_EVENT_CODE_TX_RC_OPEN_REJECT           (0x23)
3135 #define MPI2_SASPHY3_EVENT_CODE_RX_RC_OPEN_REJECT           (0x24)
3136 #define MPI2_SASPHY3_EVENT_CODE_RX_AIP_PARTIAL_WAITING_ON   (0x25)
3137 #define MPI2_SASPHY3_EVENT_CODE_RX_AIP_CONNECT_WAITING_ON   (0x26)
3138 #define MPI2_SASPHY3_EVENT_CODE_TX_BREAK                    (0x27)
3139 #define MPI2_SASPHY3_EVENT_CODE_RX_BREAK                    (0x28)
3140 #define MPI2_SASPHY3_EVENT_CODE_BREAK_TIMEOUT               (0x29)
3141 #define MPI2_SASPHY3_EVENT_CODE_CONNECTION                  (0x2A)
3142 #define MPI2_SASPHY3_EVENT_CODE_PEAKTX_PATHWAY_BLOCKED      (0x2B)
3143 #define MPI2_SASPHY3_EVENT_CODE_PEAKTX_ARB_WAIT_TIME        (0x2C)
3144 #define MPI2_SASPHY3_EVENT_CODE_PEAK_ARB_WAIT_TIME          (0x2D)
3145 #define MPI2_SASPHY3_EVENT_CODE_PEAK_CONNECT_TIME           (0x2E)
3146 #define MPI2_SASPHY3_EVENT_CODE_TX_SSP_FRAMES               (0x40)
3147 #define MPI2_SASPHY3_EVENT_CODE_RX_SSP_FRAMES               (0x41)
3148 #define MPI2_SASPHY3_EVENT_CODE_TX_SSP_ERROR_FRAMES         (0x42)
3149 #define MPI2_SASPHY3_EVENT_CODE_RX_SSP_ERROR_FRAMES         (0x43)
3150 #define MPI2_SASPHY3_EVENT_CODE_TX_CREDIT_BLOCKED           (0x44)
3151 #define MPI2_SASPHY3_EVENT_CODE_RX_CREDIT_BLOCKED           (0x45)
3152 #define MPI2_SASPHY3_EVENT_CODE_TX_SATA_FRAMES              (0x50)
3153 #define MPI2_SASPHY3_EVENT_CODE_RX_SATA_FRAMES              (0x51)
3154 #define MPI2_SASPHY3_EVENT_CODE_SATA_OVERFLOW               (0x52)
3155 #define MPI2_SASPHY3_EVENT_CODE_TX_SMP_FRAMES               (0x60)
3156 #define MPI2_SASPHY3_EVENT_CODE_RX_SMP_FRAMES               (0x61)
3157 #define MPI2_SASPHY3_EVENT_CODE_RX_SMP_ERROR_FRAMES         (0x63)
3158 #define MPI2_SASPHY3_EVENT_CODE_HOTPLUG_TIMEOUT             (0xD0)
3159 #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE    (0xD1)
3160 #define MPI2_SASPHY3_EVENT_CODE_RX_AIP                      (0xD2)
3161 
3162 /*Following codes are product specific and in MPI v2.6 and later */
3163 #define MPI2_SASPHY3_EVENT_CODE_LCARB_WAIT_TIME		    (0xD3)
3164 #define MPI2_SASPHY3_EVENT_CODE_RCVD_CONN_RESP_WAIT_TIME    (0xD4)
3165 #define MPI2_SASPHY3_EVENT_CODE_LCCONN_TIME	            (0xD5)
3166 #define MPI2_SASPHY3_EVENT_CODE_SSP_TX_START_TRANSMIT	    (0xD6)
3167 #define MPI2_SASPHY3_EVENT_CODE_SATA_TX_START	            (0xD7)
3168 #define MPI2_SASPHY3_EVENT_CODE_SMP_TX_START_TRANSMT	    (0xD8)
3169 #define MPI2_SASPHY3_EVENT_CODE_TX_SMP_BREAK_CONN	    (0xD9)
3170 #define MPI2_SASPHY3_EVENT_CODE_SSP_RX_START_RECEIVE	    (0xDA)
3171 #define MPI2_SASPHY3_EVENT_CODE_SATA_RX_START_RECEIVE	    (0xDB)
3172 #define MPI2_SASPHY3_EVENT_CODE_SMP_RX_START_RECEIVE	    (0xDC)
3173 
3174 
3175 /*values for the CounterType field */
3176 #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING                  (0x00)
3177 #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING                (0x01)
3178 #define MPI2_SASPHY3_COUNTER_TYPE_PEAK_VALUE                (0x02)
3179 
3180 /*values for the TimeUnits field */
3181 #define MPI2_SASPHY3_TIME_UNITS_10_MICROSECONDS             (0x00)
3182 #define MPI2_SASPHY3_TIME_UNITS_100_MICROSECONDS            (0x01)
3183 #define MPI2_SASPHY3_TIME_UNITS_1_MILLISECOND               (0x02)
3184 #define MPI2_SASPHY3_TIME_UNITS_10_MILLISECONDS             (0x03)
3185 
3186 /*values for the ThresholdFlags field */
3187 #define MPI2_SASPHY3_TFLAGS_PHY_RESET                       (0x0002)
3188 #define MPI2_SASPHY3_TFLAGS_EVENT_NOTIFY                    (0x0001)
3189 
3190 /*
3191  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3192  *one and check the value returned for NumPhyEvents at runtime.
3193  */
3194 #ifndef MPI2_SASPHY3_PHY_EVENT_MAX
3195 #define MPI2_SASPHY3_PHY_EVENT_MAX      (1)
3196 #endif
3197 
3198 typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_3 {
3199 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3200 		Header;                     /*0x00 */
3201 	U32
3202 		Reserved1;                  /*0x08 */
3203 	U8
3204 		NumPhyEvents;               /*0x0C */
3205 	U8
3206 		Reserved2;                  /*0x0D */
3207 	U16
3208 		Reserved3;                  /*0x0E */
3209 	MPI2_SASPHY3_PHY_EVENT_CONFIG
3210 		PhyEventConfig[MPI2_SASPHY3_PHY_EVENT_MAX]; /*0x10 */
3211 } MPI2_CONFIG_PAGE_SAS_PHY_3,
3212 	*PTR_MPI2_CONFIG_PAGE_SAS_PHY_3,
3213 	Mpi2SasPhyPage3_t, *pMpi2SasPhyPage3_t;
3214 
3215 #define MPI2_SASPHY3_PAGEVERSION            (0x00)
3216 
3217 
3218 /*SAS PHY Page 4 */
3219 
3220 typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_4 {
3221 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3222 		Header;                     /*0x00 */
3223 	U16
3224 		Reserved1;                  /*0x08 */
3225 	U8
3226 		Reserved2;                  /*0x0A */
3227 	U8
3228 		Flags;                      /*0x0B */
3229 	U8
3230 		InitialFrame[28];           /*0x0C */
3231 } MPI2_CONFIG_PAGE_SAS_PHY_4,
3232 	*PTR_MPI2_CONFIG_PAGE_SAS_PHY_4,
3233 	Mpi2SasPhyPage4_t, *pMpi2SasPhyPage4_t;
3234 
3235 #define MPI2_SASPHY4_PAGEVERSION            (0x00)
3236 
3237 /*values for the Flags field */
3238 #define MPI2_SASPHY4_FLAGS_FRAME_VALID        (0x02)
3239 #define MPI2_SASPHY4_FLAGS_SATA_FRAME         (0x01)
3240 
3241 
3242 
3243 
3244 /****************************************************************************
3245 *  SAS Port Config Pages
3246 ****************************************************************************/
3247 
3248 /*SAS Port Page 0 */
3249 
3250 typedef struct _MPI2_CONFIG_PAGE_SAS_PORT_0 {
3251 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3252 		Header;                     /*0x00 */
3253 	U8
3254 		PortNumber;                 /*0x08 */
3255 	U8
3256 		PhysicalPort;               /*0x09 */
3257 	U8
3258 		PortWidth;                  /*0x0A */
3259 	U8
3260 		PhysicalPortWidth;          /*0x0B */
3261 	U8
3262 		ZoneGroup;                  /*0x0C */
3263 	U8
3264 		Reserved1;                  /*0x0D */
3265 	U16
3266 		Reserved2;                  /*0x0E */
3267 	U64
3268 		SASAddress;                 /*0x10 */
3269 	U32
3270 		DeviceInfo;                 /*0x18 */
3271 	U32
3272 		Reserved3;                  /*0x1C */
3273 	U32
3274 		Reserved4;                  /*0x20 */
3275 } MPI2_CONFIG_PAGE_SAS_PORT_0,
3276 	*PTR_MPI2_CONFIG_PAGE_SAS_PORT_0,
3277 	Mpi2SasPortPage0_t, *pMpi2SasPortPage0_t;
3278 
3279 #define MPI2_SASPORT0_PAGEVERSION           (0x00)
3280 
3281 /*see mpi2_sas.h for values for SAS Port Page 0 DeviceInfo values */
3282 
3283 
3284 /****************************************************************************
3285 *  SAS Enclosure Config Pages
3286 ****************************************************************************/
3287 
3288 /*SAS Enclosure Page 0 */
3289 
3290 typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 {
3291 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3292 	U32	Reserved1;			/*0x08 */
3293 	U64	EnclosureLogicalID;		/*0x0C */
3294 	U16	Flags;				/*0x14 */
3295 	U16	EnclosureHandle;		/*0x16 */
3296 	U16	NumSlots;			/*0x18 */
3297 	U16	StartSlot;			/*0x1A */
3298 	U8	ChassisSlot;			/*0x1C */
3299 	U8	EnclosureLevel;			/*0x1D */
3300 	U16	SEPDevHandle;			/*0x1E */
3301 	U8	OEMRD;				/*0x20 */
3302 	U8	Reserved1a;			/*0x21 */
3303 	U16	Reserved2;			/*0x22 */
3304 	U32	Reserved3;			/*0x24 */
3305 } MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0,
3306 	*PTR_MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0,
3307 	Mpi2SasEnclosurePage0_t, *pMpi2SasEnclosurePage0_t,
3308 	MPI26_CONFIG_PAGE_ENCLOSURE_0,
3309 	*PTR_MPI26_CONFIG_PAGE_ENCLOSURE_0,
3310 	Mpi26EnclosurePage0_t, *pMpi26EnclosurePage0_t;
3311 
3312 #define MPI2_SASENCLOSURE0_PAGEVERSION      (0x04)
3313 
3314 /*values for SAS Enclosure Page 0 Flags field */
3315 #define MPI26_SAS_ENCLS0_FLAGS_OEMRD_VALID          (0x0080)
3316 #define MPI26_SAS_ENCLS0_FLAGS_OEMRD_COLLECTING     (0x0040)
3317 #define MPI2_SAS_ENCLS0_FLAGS_CHASSIS_SLOT_VALID    (0x0020)
3318 #define MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID      (0x0010)
3319 #define MPI2_SAS_ENCLS0_FLAGS_MNG_MASK              (0x000F)
3320 #define MPI2_SAS_ENCLS0_FLAGS_MNG_UNKNOWN           (0x0000)
3321 #define MPI2_SAS_ENCLS0_FLAGS_MNG_IOC_SES           (0x0001)
3322 #define MPI2_SAS_ENCLS0_FLAGS_MNG_IOC_SGPIO         (0x0002)
3323 #define MPI2_SAS_ENCLS0_FLAGS_MNG_EXP_SGPIO         (0x0003)
3324 #define MPI2_SAS_ENCLS0_FLAGS_MNG_SES_ENCLOSURE     (0x0004)
3325 #define MPI2_SAS_ENCLS0_FLAGS_MNG_IOC_GPIO          (0x0005)
3326 
3327 #define MPI26_ENCLOSURE0_PAGEVERSION        (0x04)
3328 
3329 /*Values for Enclosure Page 0 Flags field */
3330 #define MPI26_ENCLS0_FLAGS_OEMRD_VALID              (0x0080)
3331 #define MPI26_ENCLS0_FLAGS_OEMRD_COLLECTING         (0x0040)
3332 #define MPI26_ENCLS0_FLAGS_CHASSIS_SLOT_VALID       (0x0020)
3333 #define MPI26_ENCLS0_FLAGS_ENCL_LEVEL_VALID         (0x0010)
3334 #define MPI26_ENCLS0_FLAGS_MNG_MASK                 (0x000F)
3335 #define MPI26_ENCLS0_FLAGS_MNG_UNKNOWN              (0x0000)
3336 #define MPI26_ENCLS0_FLAGS_MNG_IOC_SES              (0x0001)
3337 #define MPI26_ENCLS0_FLAGS_MNG_IOC_SGPIO            (0x0002)
3338 #define MPI26_ENCLS0_FLAGS_MNG_EXP_SGPIO            (0x0003)
3339 #define MPI26_ENCLS0_FLAGS_MNG_SES_ENCLOSURE        (0x0004)
3340 #define MPI26_ENCLS0_FLAGS_MNG_IOC_GPIO             (0x0005)
3341 
3342 /****************************************************************************
3343 *  Log Config Page
3344 ****************************************************************************/
3345 
3346 /*Log Page 0 */
3347 
3348 /*
3349  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3350  *one and check the value returned for NumLogEntries at runtime.
3351  */
3352 #ifndef MPI2_LOG_0_NUM_LOG_ENTRIES
3353 #define MPI2_LOG_0_NUM_LOG_ENTRIES          (1)
3354 #endif
3355 
3356 #define MPI2_LOG_0_LOG_DATA_LENGTH          (0x1C)
3357 
3358 typedef struct _MPI2_LOG_0_ENTRY {
3359 	U64         TimeStamp;                      /*0x00 */
3360 	U32         Reserved1;                      /*0x08 */
3361 	U16         LogSequence;                    /*0x0C */
3362 	U16         LogEntryQualifier;              /*0x0E */
3363 	U8          VP_ID;                          /*0x10 */
3364 	U8          VF_ID;                          /*0x11 */
3365 	U16         Reserved2;                      /*0x12 */
3366 	U8
3367 		LogData[MPI2_LOG_0_LOG_DATA_LENGTH];/*0x14 */
3368 } MPI2_LOG_0_ENTRY, *PTR_MPI2_LOG_0_ENTRY,
3369 	Mpi2Log0Entry_t, *pMpi2Log0Entry_t;
3370 
3371 /*values for Log Page 0 LogEntry LogEntryQualifier field */
3372 #define MPI2_LOG_0_ENTRY_QUAL_ENTRY_UNUSED          (0x0000)
3373 #define MPI2_LOG_0_ENTRY_QUAL_POWER_ON_RESET        (0x0001)
3374 #define MPI2_LOG_0_ENTRY_QUAL_TIMESTAMP_UPDATE      (0x0002)
3375 #define MPI2_LOG_0_ENTRY_QUAL_MIN_IMPLEMENT_SPEC    (0x8000)
3376 #define MPI2_LOG_0_ENTRY_QUAL_MAX_IMPLEMENT_SPEC    (0xFFFF)
3377 
3378 typedef struct _MPI2_CONFIG_PAGE_LOG_0 {
3379 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;       /*0x00 */
3380 	U32                                 Reserved1;    /*0x08 */
3381 	U32                                 Reserved2;    /*0x0C */
3382 	U16                                 NumLogEntries;/*0x10 */
3383 	U16                                 Reserved3;    /*0x12 */
3384 	MPI2_LOG_0_ENTRY
3385 		LogEntry[MPI2_LOG_0_NUM_LOG_ENTRIES]; /*0x14 */
3386 } MPI2_CONFIG_PAGE_LOG_0, *PTR_MPI2_CONFIG_PAGE_LOG_0,
3387 	Mpi2LogPage0_t, *pMpi2LogPage0_t;
3388 
3389 #define MPI2_LOG_0_PAGEVERSION              (0x02)
3390 
3391 
3392 /****************************************************************************
3393 *  RAID Config Page
3394 ****************************************************************************/
3395 
3396 /*RAID Page 0 */
3397 
3398 /*
3399  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3400  *one and check the value returned for NumElements at runtime.
3401  */
3402 #ifndef MPI2_RAIDCONFIG0_MAX_ELEMENTS
3403 #define MPI2_RAIDCONFIG0_MAX_ELEMENTS       (1)
3404 #endif
3405 
3406 typedef struct _MPI2_RAIDCONFIG0_CONFIG_ELEMENT {
3407 	U16                     ElementFlags;             /*0x00 */
3408 	U16                     VolDevHandle;             /*0x02 */
3409 	U8                      HotSparePool;             /*0x04 */
3410 	U8                      PhysDiskNum;              /*0x05 */
3411 	U16                     PhysDiskDevHandle;        /*0x06 */
3412 } MPI2_RAIDCONFIG0_CONFIG_ELEMENT,
3413 	*PTR_MPI2_RAIDCONFIG0_CONFIG_ELEMENT,
3414 	Mpi2RaidConfig0ConfigElement_t,
3415 	*pMpi2RaidConfig0ConfigElement_t;
3416 
3417 /*values for the ElementFlags field */
3418 #define MPI2_RAIDCONFIG0_EFLAGS_MASK_ELEMENT_TYPE       (0x000F)
3419 #define MPI2_RAIDCONFIG0_EFLAGS_VOLUME_ELEMENT          (0x0000)
3420 #define MPI2_RAIDCONFIG0_EFLAGS_VOL_PHYS_DISK_ELEMENT   (0x0001)
3421 #define MPI2_RAIDCONFIG0_EFLAGS_HOT_SPARE_ELEMENT       (0x0002)
3422 #define MPI2_RAIDCONFIG0_EFLAGS_OCE_ELEMENT             (0x0003)
3423 
3424 
3425 typedef struct _MPI2_CONFIG_PAGE_RAID_CONFIGURATION_0 {
3426 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;         /*0x00 */
3427 	U8                                  NumHotSpares;   /*0x08 */
3428 	U8                                  NumPhysDisks;   /*0x09 */
3429 	U8                                  NumVolumes;     /*0x0A */
3430 	U8                                  ConfigNum;      /*0x0B */
3431 	U32                                 Flags;          /*0x0C */
3432 	U8                                  ConfigGUID[24]; /*0x10 */
3433 	U32                                 Reserved1;      /*0x28 */
3434 	U8                                  NumElements;    /*0x2C */
3435 	U8                                  Reserved2;      /*0x2D */
3436 	U16                                 Reserved3;      /*0x2E */
3437 	MPI2_RAIDCONFIG0_CONFIG_ELEMENT
3438 		ConfigElement[MPI2_RAIDCONFIG0_MAX_ELEMENTS]; /*0x30 */
3439 } MPI2_CONFIG_PAGE_RAID_CONFIGURATION_0,
3440 	*PTR_MPI2_CONFIG_PAGE_RAID_CONFIGURATION_0,
3441 	Mpi2RaidConfigurationPage0_t,
3442 	*pMpi2RaidConfigurationPage0_t;
3443 
3444 #define MPI2_RAIDCONFIG0_PAGEVERSION            (0x00)
3445 
3446 /*values for RAID Configuration Page 0 Flags field */
3447 #define MPI2_RAIDCONFIG0_FLAG_FOREIGN_CONFIG        (0x00000001)
3448 
3449 
3450 /****************************************************************************
3451 *  Driver Persistent Mapping Config Pages
3452 ****************************************************************************/
3453 
3454 /*Driver Persistent Mapping Page 0 */
3455 
3456 typedef struct _MPI2_CONFIG_PAGE_DRIVER_MAP0_ENTRY {
3457 	U64	PhysicalIdentifier;         /*0x00 */
3458 	U16	MappingInformation;         /*0x08 */
3459 	U16	DeviceIndex;                /*0x0A */
3460 	U32	PhysicalBitsMapping;        /*0x0C */
3461 	U32	Reserved1;                  /*0x10 */
3462 } MPI2_CONFIG_PAGE_DRIVER_MAP0_ENTRY,
3463 	*PTR_MPI2_CONFIG_PAGE_DRIVER_MAP0_ENTRY,
3464 	Mpi2DriverMap0Entry_t, *pMpi2DriverMap0Entry_t;
3465 
3466 typedef struct _MPI2_CONFIG_PAGE_DRIVER_MAPPING_0 {
3467 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header; /*0x00 */
3468 	MPI2_CONFIG_PAGE_DRIVER_MAP0_ENTRY  Entry;  /*0x08 */
3469 } MPI2_CONFIG_PAGE_DRIVER_MAPPING_0,
3470 	*PTR_MPI2_CONFIG_PAGE_DRIVER_MAPPING_0,
3471 	Mpi2DriverMappingPage0_t, *pMpi2DriverMappingPage0_t;
3472 
3473 #define MPI2_DRIVERMAPPING0_PAGEVERSION         (0x00)
3474 
3475 /*values for Driver Persistent Mapping Page 0 MappingInformation field */
3476 #define MPI2_DRVMAP0_MAPINFO_SLOT_MASK              (0x07F0)
3477 #define MPI2_DRVMAP0_MAPINFO_SLOT_SHIFT             (4)
3478 #define MPI2_DRVMAP0_MAPINFO_MISSING_MASK           (0x000F)
3479 
3480 
3481 /****************************************************************************
3482 *  Ethernet Config Pages
3483 ****************************************************************************/
3484 
3485 /*Ethernet Page 0 */
3486 
3487 /*IP address (union of IPv4 and IPv6) */
3488 typedef union _MPI2_ETHERNET_IP_ADDR {
3489 	U32     IPv4Addr;
3490 	U32     IPv6Addr[4];
3491 } MPI2_ETHERNET_IP_ADDR, *PTR_MPI2_ETHERNET_IP_ADDR,
3492 	Mpi2EthernetIpAddr_t, *pMpi2EthernetIpAddr_t;
3493 
3494 #define MPI2_ETHERNET_HOST_NAME_LENGTH          (32)
3495 
3496 typedef struct _MPI2_CONFIG_PAGE_ETHERNET_0 {
3497 	MPI2_CONFIG_EXTENDED_PAGE_HEADER    Header;          /*0x00 */
3498 	U8                                  NumInterfaces;   /*0x08 */
3499 	U8                                  Reserved0;       /*0x09 */
3500 	U16                                 Reserved1;       /*0x0A */
3501 	U32                                 Status;          /*0x0C */
3502 	U8                                  MediaState;      /*0x10 */
3503 	U8                                  Reserved2;       /*0x11 */
3504 	U16                                 Reserved3;       /*0x12 */
3505 	U8                                  MacAddress[6];   /*0x14 */
3506 	U8                                  Reserved4;       /*0x1A */
3507 	U8                                  Reserved5;       /*0x1B */
3508 	MPI2_ETHERNET_IP_ADDR               IpAddress;       /*0x1C */
3509 	MPI2_ETHERNET_IP_ADDR               SubnetMask;      /*0x2C */
3510 	MPI2_ETHERNET_IP_ADDR               GatewayIpAddress;/*0x3C */
3511 	MPI2_ETHERNET_IP_ADDR               DNS1IpAddress;   /*0x4C */
3512 	MPI2_ETHERNET_IP_ADDR               DNS2IpAddress;   /*0x5C */
3513 	MPI2_ETHERNET_IP_ADDR               DhcpIpAddress;   /*0x6C */
3514 	U8
3515 		HostName[MPI2_ETHERNET_HOST_NAME_LENGTH];/*0x7C */
3516 } MPI2_CONFIG_PAGE_ETHERNET_0,
3517 	*PTR_MPI2_CONFIG_PAGE_ETHERNET_0,
3518 	Mpi2EthernetPage0_t, *pMpi2EthernetPage0_t;
3519 
3520 #define MPI2_ETHERNETPAGE0_PAGEVERSION   (0x00)
3521 
3522 /*values for Ethernet Page 0 Status field */
3523 #define MPI2_ETHPG0_STATUS_IPV6_CAPABLE             (0x80000000)
3524 #define MPI2_ETHPG0_STATUS_IPV4_CAPABLE             (0x40000000)
3525 #define MPI2_ETHPG0_STATUS_CONSOLE_CONNECTED        (0x20000000)
3526 #define MPI2_ETHPG0_STATUS_DEFAULT_IF               (0x00000100)
3527 #define MPI2_ETHPG0_STATUS_FW_DWNLD_ENABLED         (0x00000080)
3528 #define MPI2_ETHPG0_STATUS_TELNET_ENABLED           (0x00000040)
3529 #define MPI2_ETHPG0_STATUS_SSH2_ENABLED             (0x00000020)
3530 #define MPI2_ETHPG0_STATUS_DHCP_CLIENT_ENABLED      (0x00000010)
3531 #define MPI2_ETHPG0_STATUS_IPV6_ENABLED             (0x00000008)
3532 #define MPI2_ETHPG0_STATUS_IPV4_ENABLED             (0x00000004)
3533 #define MPI2_ETHPG0_STATUS_IPV6_ADDRESSES           (0x00000002)
3534 #define MPI2_ETHPG0_STATUS_ETH_IF_ENABLED           (0x00000001)
3535 
3536 /*values for Ethernet Page 0 MediaState field */
3537 #define MPI2_ETHPG0_MS_DUPLEX_MASK                  (0x80)
3538 #define MPI2_ETHPG0_MS_HALF_DUPLEX                  (0x00)
3539 #define MPI2_ETHPG0_MS_FULL_DUPLEX                  (0x80)
3540 
3541 #define MPI2_ETHPG0_MS_CONNECT_SPEED_MASK           (0x07)
3542 #define MPI2_ETHPG0_MS_NOT_CONNECTED                (0x00)
3543 #define MPI2_ETHPG0_MS_10MBIT                       (0x01)
3544 #define MPI2_ETHPG0_MS_100MBIT                      (0x02)
3545 #define MPI2_ETHPG0_MS_1GBIT                        (0x03)
3546 
3547 
3548 /*Ethernet Page 1 */
3549 
3550 typedef struct _MPI2_CONFIG_PAGE_ETHERNET_1 {
3551 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3552 		Header;                 /*0x00 */
3553 	U32
3554 		Reserved0;              /*0x08 */
3555 	U32
3556 		Flags;                  /*0x0C */
3557 	U8
3558 		MediaState;             /*0x10 */
3559 	U8
3560 		Reserved1;              /*0x11 */
3561 	U16
3562 		Reserved2;              /*0x12 */
3563 	U8
3564 		MacAddress[6];          /*0x14 */
3565 	U8
3566 		Reserved3;              /*0x1A */
3567 	U8
3568 		Reserved4;              /*0x1B */
3569 	MPI2_ETHERNET_IP_ADDR
3570 		StaticIpAddress;        /*0x1C */
3571 	MPI2_ETHERNET_IP_ADDR
3572 		StaticSubnetMask;       /*0x2C */
3573 	MPI2_ETHERNET_IP_ADDR
3574 		StaticGatewayIpAddress; /*0x3C */
3575 	MPI2_ETHERNET_IP_ADDR
3576 		StaticDNS1IpAddress;    /*0x4C */
3577 	MPI2_ETHERNET_IP_ADDR
3578 		StaticDNS2IpAddress;    /*0x5C */
3579 	U32
3580 		Reserved5;              /*0x6C */
3581 	U32
3582 		Reserved6;              /*0x70 */
3583 	U32
3584 		Reserved7;              /*0x74 */
3585 	U32
3586 		Reserved8;              /*0x78 */
3587 	U8
3588 		HostName[MPI2_ETHERNET_HOST_NAME_LENGTH];/*0x7C */
3589 } MPI2_CONFIG_PAGE_ETHERNET_1,
3590 	*PTR_MPI2_CONFIG_PAGE_ETHERNET_1,
3591 	Mpi2EthernetPage1_t, *pMpi2EthernetPage1_t;
3592 
3593 #define MPI2_ETHERNETPAGE1_PAGEVERSION   (0x00)
3594 
3595 /*values for Ethernet Page 1 Flags field */
3596 #define MPI2_ETHPG1_FLAG_SET_DEFAULT_IF             (0x00000100)
3597 #define MPI2_ETHPG1_FLAG_ENABLE_FW_DOWNLOAD         (0x00000080)
3598 #define MPI2_ETHPG1_FLAG_ENABLE_TELNET              (0x00000040)
3599 #define MPI2_ETHPG1_FLAG_ENABLE_SSH2                (0x00000020)
3600 #define MPI2_ETHPG1_FLAG_ENABLE_DHCP_CLIENT         (0x00000010)
3601 #define MPI2_ETHPG1_FLAG_ENABLE_IPV6                (0x00000008)
3602 #define MPI2_ETHPG1_FLAG_ENABLE_IPV4                (0x00000004)
3603 #define MPI2_ETHPG1_FLAG_USE_IPV6_ADDRESSES         (0x00000002)
3604 #define MPI2_ETHPG1_FLAG_ENABLE_ETH_IF              (0x00000001)
3605 
3606 /*values for Ethernet Page 1 MediaState field */
3607 #define MPI2_ETHPG1_MS_DUPLEX_MASK                  (0x80)
3608 #define MPI2_ETHPG1_MS_HALF_DUPLEX                  (0x00)
3609 #define MPI2_ETHPG1_MS_FULL_DUPLEX                  (0x80)
3610 
3611 #define MPI2_ETHPG1_MS_DATA_RATE_MASK               (0x07)
3612 #define MPI2_ETHPG1_MS_DATA_RATE_AUTO               (0x00)
3613 #define MPI2_ETHPG1_MS_DATA_RATE_10MBIT             (0x01)
3614 #define MPI2_ETHPG1_MS_DATA_RATE_100MBIT            (0x02)
3615 #define MPI2_ETHPG1_MS_DATA_RATE_1GBIT              (0x03)
3616 
3617 
3618 /****************************************************************************
3619 *  Extended Manufacturing Config Pages
3620 ****************************************************************************/
3621 
3622 /*
3623  *Generic structure to use for product-specific extended manufacturing pages
3624  *(currently Extended Manufacturing Page 40 through Extended Manufacturing
3625  *Page 60).
3626  */
3627 
3628 typedef struct _MPI2_CONFIG_PAGE_EXT_MAN_PS {
3629 	MPI2_CONFIG_EXTENDED_PAGE_HEADER
3630 		Header;                 /*0x00 */
3631 	U32
3632 		ProductSpecificInfo;    /*0x08 */
3633 } MPI2_CONFIG_PAGE_EXT_MAN_PS,
3634 	*PTR_MPI2_CONFIG_PAGE_EXT_MAN_PS,
3635 	Mpi2ExtManufacturingPagePS_t,
3636 	*pMpi2ExtManufacturingPagePS_t;
3637 
3638 /*PageVersion should be provided by product-specific code */
3639 
3640 
3641 
3642 /****************************************************************************
3643 *  values for fields used by several types of PCIe Config Pages
3644 ****************************************************************************/
3645 
3646 /*values for NegotiatedLinkRates fields */
3647 #define MPI26_PCIE_NEG_LINK_RATE_MASK_PHYSICAL          (0x0F)
3648 /*link rates used for Negotiated Physical Link Rate */
3649 #define MPI26_PCIE_NEG_LINK_RATE_UNKNOWN                (0x00)
3650 #define MPI26_PCIE_NEG_LINK_RATE_PHY_DISABLED           (0x01)
3651 #define MPI26_PCIE_NEG_LINK_RATE_2_5                    (0x02)
3652 #define MPI26_PCIE_NEG_LINK_RATE_5_0                    (0x03)
3653 #define MPI26_PCIE_NEG_LINK_RATE_8_0                    (0x04)
3654 #define MPI26_PCIE_NEG_LINK_RATE_16_0                   (0x05)
3655 
3656 
3657 /****************************************************************************
3658 *  PCIe IO Unit Config Pages (MPI v2.6 and later)
3659 ****************************************************************************/
3660 
3661 /*PCIe IO Unit Page 0 */
3662 
3663 typedef struct _MPI26_PCIE_IO_UNIT0_PHY_DATA {
3664 	U8	Link;                   /*0x00 */
3665 	U8	LinkFlags;              /*0x01 */
3666 	U8	PhyFlags;               /*0x02 */
3667 	U8	NegotiatedLinkRate;     /*0x03 */
3668 	U32	ControllerPhyDeviceInfo;/*0x04 */
3669 	U16	AttachedDevHandle;      /*0x08 */
3670 	U16	ControllerDevHandle;    /*0x0A */
3671 	U32	EnumerationStatus;      /*0x0C */
3672 	U32	Reserved1;              /*0x10 */
3673 } MPI26_PCIE_IO_UNIT0_PHY_DATA,
3674 	*PTR_MPI26_PCIE_IO_UNIT0_PHY_DATA,
3675 	Mpi26PCIeIOUnit0PhyData_t, *pMpi26PCIeIOUnit0PhyData_t;
3676 
3677 /*
3678  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3679  *one and check the value returned for NumPhys at runtime.
3680  */
3681 #ifndef MPI26_PCIE_IOUNIT0_PHY_MAX
3682 #define MPI26_PCIE_IOUNIT0_PHY_MAX      (1)
3683 #endif
3684 
3685 typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_0 {
3686 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header; /*0x00 */
3687 	U32	Reserved1;                              /*0x08 */
3688 	U8	NumPhys;                                /*0x0C */
3689 	U8	InitStatus;                             /*0x0D */
3690 	U16	Reserved3;                              /*0x0E */
3691 	MPI26_PCIE_IO_UNIT0_PHY_DATA
3692 		PhyData[MPI26_PCIE_IOUNIT0_PHY_MAX];    /*0x10 */
3693 } MPI26_CONFIG_PAGE_PIOUNIT_0,
3694 	*PTR_MPI26_CONFIG_PAGE_PIOUNIT_0,
3695 	Mpi26PCIeIOUnitPage0_t, *pMpi26PCIeIOUnitPage0_t;
3696 
3697 #define MPI26_PCIEIOUNITPAGE0_PAGEVERSION                   (0x00)
3698 
3699 /*values for PCIe IO Unit Page 0 LinkFlags */
3700 #define MPI26_PCIEIOUNIT0_LINKFLAGS_ENUMERATION_IN_PROGRESS (0x08)
3701 
3702 /*values for PCIe IO Unit Page 0 PhyFlags */
3703 #define MPI26_PCIEIOUNIT0_PHYFLAGS_PHY_DISABLED             (0x08)
3704 
3705 /*use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
3706 
3707 /*see mpi2_pci.h for values for PCIe IO Unit Page 0 ControllerPhyDeviceInfo
3708  *values
3709  */
3710 
3711 /*values for PCIe IO Unit Page 0 EnumerationStatus */
3712 #define MPI26_PCIEIOUNIT0_ES_MAX_SWITCHES_EXCEEDED          (0x40000000)
3713 #define MPI26_PCIEIOUNIT0_ES_MAX_DEVICES_EXCEEDED           (0x20000000)
3714 
3715 
3716 /*PCIe IO Unit Page 1 */
3717 
3718 typedef struct _MPI26_PCIE_IO_UNIT1_PHY_DATA {
3719 	U8	Link;                       /*0x00 */
3720 	U8	LinkFlags;                  /*0x01 */
3721 	U8	PhyFlags;                   /*0x02 */
3722 	U8	MaxMinLinkRate;             /*0x03 */
3723 	U32	ControllerPhyDeviceInfo;    /*0x04 */
3724 	U32	Reserved1;                  /*0x08 */
3725 } MPI26_PCIE_IO_UNIT1_PHY_DATA,
3726 	*PTR_MPI26_PCIE_IO_UNIT1_PHY_DATA,
3727 	Mpi26PCIeIOUnit1PhyData_t, *pMpi26PCIeIOUnit1PhyData_t;
3728 
3729 /*values for LinkFlags */
3730 #define MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SEPARATE_REFCLK     (0x00)
3731 #define MPI26_PCIEIOUNIT1_LINKFLAGS_SRIS_EN                 (0x01)
3732 #define MPI26_PCIEIOUNIT1_LINKFLAGS_SRNS_EN                 (0x02)
3733 
3734 /*
3735  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3736  *one and check the value returned for NumPhys at runtime.
3737  */
3738 #ifndef MPI26_PCIE_IOUNIT1_PHY_MAX
3739 #define MPI26_PCIE_IOUNIT1_PHY_MAX      (1)
3740 #endif
3741 
3742 typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_1 {
3743 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3744 	U16	ControlFlags;                       /*0x08 */
3745 	U16	Reserved;                           /*0x0A */
3746 	U16	AdditionalControlFlags;             /*0x0C */
3747 	U16	NVMeMaxQueueDepth;                  /*0x0E */
3748 	U8	NumPhys;                            /*0x10 */
3749 	U8	DMDReportPCIe;                      /*0x11 */
3750 	U16	Reserved2;                          /*0x12 */
3751 	MPI26_PCIE_IO_UNIT1_PHY_DATA
3752 		PhyData[MPI26_PCIE_IOUNIT1_PHY_MAX];/*0x14 */
3753 } MPI26_CONFIG_PAGE_PIOUNIT_1,
3754 	*PTR_MPI26_CONFIG_PAGE_PIOUNIT_1,
3755 	Mpi26PCIeIOUnitPage1_t, *pMpi26PCIeIOUnitPage1_t;
3756 
3757 #define MPI26_PCIEIOUNITPAGE1_PAGEVERSION   (0x00)
3758 
3759 /*values for PCIe IO Unit Page 1 PhyFlags */
3760 #define MPI26_PCIEIOUNIT1_PHYFLAGS_PHY_DISABLE                      (0x08)
3761 #define MPI26_PCIEIOUNIT1_PHYFLAGS_ENDPOINT_ONLY                    (0x01)
3762 
3763 /*values for PCIe IO Unit Page 1 MaxMinLinkRate */
3764 #define MPI26_PCIEIOUNIT1_MAX_RATE_MASK                             (0xF0)
3765 #define MPI26_PCIEIOUNIT1_MAX_RATE_SHIFT                            (4)
3766 #define MPI26_PCIEIOUNIT1_MAX_RATE_2_5                              (0x20)
3767 #define MPI26_PCIEIOUNIT1_MAX_RATE_5_0                              (0x30)
3768 #define MPI26_PCIEIOUNIT1_MAX_RATE_8_0                              (0x40)
3769 #define MPI26_PCIEIOUNIT1_MAX_RATE_16_0                             (0x50)
3770 
3771 /*values for PCIe IO Unit Page 1 DMDReportPCIe */
3772 #define MPI26_PCIEIOUNIT1_DMDRPT_UNIT_MASK                          (0x80)
3773 #define MPI26_PCIEIOUNIT1_DMDRPT_UNIT_1_SEC                         (0x00)
3774 #define MPI26_PCIEIOUNIT1_DMDRPT_UNIT_16_SEC                        (0x80)
3775 #define MPI26_PCIEIOUNIT1_DMDRPT_DELAY_TIME_MASK                    (0x7F)
3776 
3777 /*see mpi2_pci.h for values for PCIe IO Unit Page 0 ControllerPhyDeviceInfo
3778  *values
3779  */
3780 
3781 
3782 /****************************************************************************
3783 *  PCIe Switch Config Pages (MPI v2.6 and later)
3784 ****************************************************************************/
3785 
3786 /*PCIe Switch Page 0 */
3787 
3788 typedef struct _MPI26_CONFIG_PAGE_PSWITCH_0 {
3789 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3790 	U8	PhysicalPort;               /*0x08 */
3791 	U8	Reserved1;                  /*0x09 */
3792 	U16	Reserved2;                  /*0x0A */
3793 	U16	DevHandle;                  /*0x0C */
3794 	U16	ParentDevHandle;            /*0x0E */
3795 	U8	NumPorts;                   /*0x10 */
3796 	U8	PCIeLevel;                  /*0x11 */
3797 	U16	Reserved3;                  /*0x12 */
3798 	U32	Reserved4;                  /*0x14 */
3799 	U32	Reserved5;                  /*0x18 */
3800 	U32	Reserved6;                  /*0x1C */
3801 } MPI26_CONFIG_PAGE_PSWITCH_0, *PTR_MPI26_CONFIG_PAGE_PSWITCH_0,
3802 	Mpi26PCIeSwitchPage0_t, *pMpi26PCIeSwitchPage0_t;
3803 
3804 #define MPI26_PCIESWITCH0_PAGEVERSION       (0x00)
3805 
3806 
3807 /*PCIe Switch Page 1 */
3808 
3809 typedef struct _MPI26_CONFIG_PAGE_PSWITCH_1 {
3810 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3811 	U8	PhysicalPort;               /*0x08 */
3812 	U8	Reserved1;                  /*0x09 */
3813 	U16	Reserved2;                  /*0x0A */
3814 	U8	NumPorts;                   /*0x0C */
3815 	U8	PortNum;                    /*0x0D */
3816 	U16	AttachedDevHandle;          /*0x0E */
3817 	U16	SwitchDevHandle;            /*0x10 */
3818 	U8	NegotiatedPortWidth;        /*0x12 */
3819 	U8	NegotiatedLinkRate;         /*0x13 */
3820 	U32	Reserved4;                  /*0x14 */
3821 	U32	Reserved5;                  /*0x18 */
3822 } MPI26_CONFIG_PAGE_PSWITCH_1, *PTR_MPI26_CONFIG_PAGE_PSWITCH_1,
3823 	Mpi26PCIeSwitchPage1_t, *pMpi26PCIeSwitchPage1_t;
3824 
3825 #define MPI26_PCIESWITCH1_PAGEVERSION       (0x00)
3826 
3827 /*use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
3828 
3829 /* defines for the Flags field */
3830 #define MPI26_PCIESWITCH1_2_RETIMER_PRESENCE         (0x0002)
3831 #define MPI26_PCIESWITCH1_RETIMER_PRESENCE           (0x0001)
3832 
3833 /****************************************************************************
3834 *  PCIe Device Config Pages (MPI v2.6 and later)
3835 ****************************************************************************/
3836 
3837 /*PCIe Device Page 0 */
3838 
3839 typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_0 {
3840 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3841 	U16	Slot;                   /*0x08 */
3842 	U16	EnclosureHandle;        /*0x0A */
3843 	U64	WWID;                   /*0x0C */
3844 	U16	ParentDevHandle;        /*0x14 */
3845 	U8	PortNum;                /*0x16 */
3846 	U8	AccessStatus;           /*0x17 */
3847 	U16	DevHandle;              /*0x18 */
3848 	U8	PhysicalPort;           /*0x1A */
3849 	U8	Reserved1;              /*0x1B */
3850 	U32	DeviceInfo;             /*0x1C */
3851 	U32	Flags;                  /*0x20 */
3852 	U8	SupportedLinkRates;     /*0x24 */
3853 	U8	MaxPortWidth;           /*0x25 */
3854 	U8	NegotiatedPortWidth;    /*0x26 */
3855 	U8	NegotiatedLinkRate;     /*0x27 */
3856 	U8	EnclosureLevel;         /*0x28 */
3857 	U8	Reserved2;              /*0x29 */
3858 	U16	Reserved3;              /*0x2A */
3859 	U8	ConnectorName[4];       /*0x2C */
3860 	U32	Reserved4;              /*0x30 */
3861 	U32	Reserved5;              /*0x34 */
3862 } MPI26_CONFIG_PAGE_PCIEDEV_0, *PTR_MPI26_CONFIG_PAGE_PCIEDEV_0,
3863 	Mpi26PCIeDevicePage0_t, *pMpi26PCIeDevicePage0_t;
3864 
3865 #define MPI26_PCIEDEVICE0_PAGEVERSION       (0x01)
3866 
3867 /*values for PCIe Device Page 0 AccessStatus field */
3868 #define MPI26_PCIEDEV0_ASTATUS_NO_ERRORS                    (0x00)
3869 #define MPI26_PCIEDEV0_ASTATUS_NEEDS_INITIALIZATION         (0x04)
3870 #define MPI26_PCIEDEV0_ASTATUS_CAPABILITY_FAILED            (0x02)
3871 #define MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED               (0x07)
3872 #define MPI26_PCIEDEV0_ASTATUS_MEMORY_SPACE_ACCESS_FAILED   (0x08)
3873 #define MPI26_PCIEDEV0_ASTATUS_UNSUPPORTED_DEVICE           (0x09)
3874 #define MPI26_PCIEDEV0_ASTATUS_MSIX_REQUIRED                (0x0A)
3875 #define MPI26_PCIEDEV0_ASTATUS_UNKNOWN                      (0x10)
3876 
3877 #define MPI26_PCIEDEV0_ASTATUS_NVME_READY_TIMEOUT           (0x30)
3878 #define MPI26_PCIEDEV0_ASTATUS_NVME_DEVCFG_UNSUPPORTED      (0x31)
3879 #define MPI26_PCIEDEV0_ASTATUS_NVME_IDENTIFY_FAILED         (0x32)
3880 #define MPI26_PCIEDEV0_ASTATUS_NVME_QCONFIG_FAILED          (0x33)
3881 #define MPI26_PCIEDEV0_ASTATUS_NVME_QCREATION_FAILED        (0x34)
3882 #define MPI26_PCIEDEV0_ASTATUS_NVME_EVENTCFG_FAILED         (0x35)
3883 #define MPI26_PCIEDEV0_ASTATUS_NVME_GET_FEATURE_STAT_FAILED (0x36)
3884 #define MPI26_PCIEDEV0_ASTATUS_NVME_IDLE_TIMEOUT            (0x37)
3885 #define MPI26_PCIEDEV0_ASTATUS_NVME_FAILURE_STATUS          (0x38)
3886 
3887 #define MPI26_PCIEDEV0_ASTATUS_INIT_FAIL_MAX                (0x3F)
3888 
3889 /*see mpi2_pci.h for the MPI26_PCIE_DEVINFO_ defines used for the DeviceInfo
3890  *field
3891  */
3892 
3893 /*values for PCIe Device Page 0 Flags field*/
3894 #define MPI26_PCIEDEV0_FLAGS_2_RETIMER_PRESENCE             (0x00020000)
3895 #define MPI26_PCIEDEV0_FLAGS_RETIMER_PRESENCE               (0x00010000)
3896 #define MPI26_PCIEDEV0_FLAGS_UNAUTHORIZED_DEVICE            (0x00008000)
3897 #define MPI26_PCIEDEV0_FLAGS_ENABLED_FAST_PATH              (0x00004000)
3898 #define MPI26_PCIEDEV0_FLAGS_FAST_PATH_CAPABLE              (0x00002000)
3899 #define MPI26_PCIEDEV0_FLAGS_ASYNCHRONOUS_NOTIFICATION      (0x00000400)
3900 #define MPI26_PCIEDEV0_FLAGS_ATA_SW_PRESERVATION            (0x00000200)
3901 #define MPI26_PCIEDEV0_FLAGS_UNSUPPORTED_DEVICE             (0x00000100)
3902 #define MPI26_PCIEDEV0_FLAGS_ATA_48BIT_LBA_SUPPORTED        (0x00000080)
3903 #define MPI26_PCIEDEV0_FLAGS_ATA_SMART_SUPPORTED            (0x00000040)
3904 #define MPI26_PCIEDEV0_FLAGS_ATA_NCQ_SUPPORTED              (0x00000020)
3905 #define MPI26_PCIEDEV0_FLAGS_ATA_FUA_SUPPORTED              (0x00000010)
3906 #define MPI26_PCIEDEV0_FLAGS_ENCL_LEVEL_VALID               (0x00000002)
3907 #define MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT                 (0x00000001)
3908 
3909 /* values for PCIe Device Page 0 SupportedLinkRates field */
3910 #define MPI26_PCIEDEV0_LINK_RATE_16_0_SUPPORTED             (0x08)
3911 #define MPI26_PCIEDEV0_LINK_RATE_8_0_SUPPORTED              (0x04)
3912 #define MPI26_PCIEDEV0_LINK_RATE_5_0_SUPPORTED              (0x02)
3913 #define MPI26_PCIEDEV0_LINK_RATE_2_5_SUPPORTED              (0x01)
3914 
3915 /*use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */
3916 
3917 
3918 /*PCIe Device Page 2 */
3919 
3920 typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_2 {
3921 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3922 	U16	DevHandle;		/*0x08 */
3923 	U8	ControllerResetTO;		/* 0x0A */
3924 	U8	Reserved1;		/* 0x0B */
3925 	U32	MaximumDataTransferSize;	/*0x0C */
3926 	U32	Capabilities;		/*0x10 */
3927 	U16	NOIOB;		/* 0x14 */
3928 	U16	Reserved2;		/* 0x16 */
3929 } MPI26_CONFIG_PAGE_PCIEDEV_2, *PTR_MPI26_CONFIG_PAGE_PCIEDEV_2,
3930 	Mpi26PCIeDevicePage2_t, *pMpi26PCIeDevicePage2_t;
3931 
3932 #define MPI26_PCIEDEVICE2_PAGEVERSION       (0x01)
3933 
3934 /*defines for PCIe Device Page 2 Capabilities field */
3935 #define MPI26_PCIEDEV2_CAP_DATA_BLK_ALIGN_AND_GRAN     (0x00000008)
3936 #define MPI26_PCIEDEV2_CAP_SGL_FORMAT                  (0x00000004)
3937 #define MPI26_PCIEDEV2_CAP_BIT_BUCKET_SUPPORT          (0x00000002)
3938 #define MPI26_PCIEDEV2_CAP_SGL_SUPPORT                 (0x00000001)
3939 
3940 /* Defines for the NOIOB field */
3941 #define MPI26_PCIEDEV2_NOIOB_UNSUPPORTED                (0x0000)
3942 
3943 /****************************************************************************
3944 *  PCIe Link Config Pages (MPI v2.6 and later)
3945 ****************************************************************************/
3946 
3947 /*PCIe Link Page 1 */
3948 
3949 typedef struct _MPI26_CONFIG_PAGE_PCIELINK_1 {
3950 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3951 	U8	Link;				/*0x08 */
3952 	U8	Reserved1;			/*0x09 */
3953 	U16	Reserved2;			/*0x0A */
3954 	U32	CorrectableErrorCount;		/*0x0C */
3955 	U16	NonFatalErrorCount;		/*0x10 */
3956 	U16	Reserved3;			/*0x12 */
3957 	U16	FatalErrorCount;		/*0x14 */
3958 	U16	Reserved4;			/*0x16 */
3959 } MPI26_CONFIG_PAGE_PCIELINK_1, *PTR_MPI26_CONFIG_PAGE_PCIELINK_1,
3960 	Mpi26PcieLinkPage1_t, *pMpi26PcieLinkPage1_t;
3961 
3962 #define MPI26_PCIELINK1_PAGEVERSION            (0x00)
3963 
3964 /*PCIe Link Page 2 */
3965 
3966 typedef struct _MPI26_PCIELINK2_LINK_EVENT {
3967 	U8	LinkEventCode;		/*0x00 */
3968 	U8	Reserved1;		/*0x01 */
3969 	U16	Reserved2;		/*0x02 */
3970 	U32	LinkEventInfo;		/*0x04 */
3971 } MPI26_PCIELINK2_LINK_EVENT, *PTR_MPI26_PCIELINK2_LINK_EVENT,
3972 	Mpi26PcieLink2LinkEvent_t, *pMpi26PcieLink2LinkEvent_t;
3973 
3974 /*use MPI26_PCIELINK3_EVTCODE_ for the LinkEventCode field */
3975 
3976 
3977 /*
3978  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
3979  *one and check the value returned for NumLinkEvents at runtime.
3980  */
3981 #ifndef MPI26_PCIELINK2_LINK_EVENT_MAX
3982 #define MPI26_PCIELINK2_LINK_EVENT_MAX      (1)
3983 #endif
3984 
3985 typedef struct _MPI26_CONFIG_PAGE_PCIELINK_2 {
3986 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
3987 	U8	Link;                       /*0x08 */
3988 	U8	Reserved1;                  /*0x09 */
3989 	U16	Reserved2;                  /*0x0A */
3990 	U8	NumLinkEvents;              /*0x0C */
3991 	U8	Reserved3;                  /*0x0D */
3992 	U16	Reserved4;                  /*0x0E */
3993 	MPI26_PCIELINK2_LINK_EVENT
3994 		LinkEvent[MPI26_PCIELINK2_LINK_EVENT_MAX];	/*0x10 */
3995 } MPI26_CONFIG_PAGE_PCIELINK_2, *PTR_MPI26_CONFIG_PAGE_PCIELINK_2,
3996 	Mpi26PcieLinkPage2_t, *pMpi26PcieLinkPage2_t;
3997 
3998 #define MPI26_PCIELINK2_PAGEVERSION            (0x00)
3999 
4000 /*PCIe Link Page 3 */
4001 
4002 typedef struct _MPI26_PCIELINK3_LINK_EVENT_CONFIG {
4003 	U8	LinkEventCode;      /*0x00 */
4004 	U8	Reserved1;          /*0x01 */
4005 	U16	Reserved2;          /*0x02 */
4006 	U8	CounterType;        /*0x04 */
4007 	U8	ThresholdWindow;    /*0x05 */
4008 	U8	TimeUnits;          /*0x06 */
4009 	U8	Reserved3;          /*0x07 */
4010 	U32	EventThreshold;     /*0x08 */
4011 	U16	ThresholdFlags;     /*0x0C */
4012 	U16	Reserved4;          /*0x0E */
4013 } MPI26_PCIELINK3_LINK_EVENT_CONFIG, *PTR_MPI26_PCIELINK3_LINK_EVENT_CONFIG,
4014 	Mpi26PcieLink3LinkEventConfig_t, *pMpi26PcieLink3LinkEventConfig_t;
4015 
4016 /*values for LinkEventCode field */
4017 #define MPI26_PCIELINK3_EVTCODE_NO_EVENT                              (0x00)
4018 #define MPI26_PCIELINK3_EVTCODE_CORRECTABLE_ERROR_RECEIVED            (0x01)
4019 #define MPI26_PCIELINK3_EVTCODE_NON_FATAL_ERROR_RECEIVED              (0x02)
4020 #define MPI26_PCIELINK3_EVTCODE_FATAL_ERROR_RECEIVED                  (0x03)
4021 #define MPI26_PCIELINK3_EVTCODE_DATA_LINK_ERROR_DETECTED              (0x04)
4022 #define MPI26_PCIELINK3_EVTCODE_TRANSACTION_LAYER_ERROR_DETECTED      (0x05)
4023 #define MPI26_PCIELINK3_EVTCODE_TLP_ECRC_ERROR_DETECTED               (0x06)
4024 #define MPI26_PCIELINK3_EVTCODE_POISONED_TLP                          (0x07)
4025 #define MPI26_PCIELINK3_EVTCODE_RECEIVED_NAK_DLLP                     (0x08)
4026 #define MPI26_PCIELINK3_EVTCODE_SENT_NAK_DLLP                         (0x09)
4027 #define MPI26_PCIELINK3_EVTCODE_LTSSM_RECOVERY_STATE                  (0x0A)
4028 #define MPI26_PCIELINK3_EVTCODE_LTSSM_RXL0S_STATE                     (0x0B)
4029 #define MPI26_PCIELINK3_EVTCODE_LTSSM_TXL0S_STATE                     (0x0C)
4030 #define MPI26_PCIELINK3_EVTCODE_LTSSM_L1_STATE                        (0x0D)
4031 #define MPI26_PCIELINK3_EVTCODE_LTSSM_DISABLED_STATE                  (0x0E)
4032 #define MPI26_PCIELINK3_EVTCODE_LTSSM_HOT_RESET_STATE                 (0x0F)
4033 #define MPI26_PCIELINK3_EVTCODE_SYSTEM_ERROR                          (0x10)
4034 #define MPI26_PCIELINK3_EVTCODE_DECODE_ERROR                          (0x11)
4035 #define MPI26_PCIELINK3_EVTCODE_DISPARITY_ERROR                       (0x12)
4036 
4037 /*values for the CounterType field */
4038 #define MPI26_PCIELINK3_COUNTER_TYPE_WRAPPING               (0x00)
4039 #define MPI26_PCIELINK3_COUNTER_TYPE_SATURATING             (0x01)
4040 #define MPI26_PCIELINK3_COUNTER_TYPE_PEAK_VALUE             (0x02)
4041 
4042 /*values for the TimeUnits field */
4043 #define MPI26_PCIELINK3_TM_UNITS_10_MICROSECONDS            (0x00)
4044 #define MPI26_PCIELINK3_TM_UNITS_100_MICROSECONDS           (0x01)
4045 #define MPI26_PCIELINK3_TM_UNITS_1_MILLISECOND              (0x02)
4046 #define MPI26_PCIELINK3_TM_UNITS_10_MILLISECONDS            (0x03)
4047 
4048 /*values for the ThresholdFlags field */
4049 #define MPI26_PCIELINK3_TFLAGS_EVENT_NOTIFY                 (0x0001)
4050 
4051 /*
4052  *Host code (drivers, BIOS, utilities, etc.) should leave this define set to
4053  *one and check the value returned for NumLinkEvents at runtime.
4054  */
4055 #ifndef MPI26_PCIELINK3_LINK_EVENT_MAX
4056 #define MPI26_PCIELINK3_LINK_EVENT_MAX      (1)
4057 #endif
4058 
4059 typedef struct _MPI26_CONFIG_PAGE_PCIELINK_3 {
4060 	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/*0x00 */
4061 	U8	Link;                       /*0x08 */
4062 	U8	Reserved1;                  /*0x09 */
4063 	U16	Reserved2;                  /*0x0A */
4064 	U8	NumLinkEvents;              /*0x0C */
4065 	U8	Reserved3;                  /*0x0D */
4066 	U16	Reserved4;                  /*0x0E */
4067 	MPI26_PCIELINK3_LINK_EVENT_CONFIG
4068 		LinkEventConfig[MPI26_PCIELINK3_LINK_EVENT_MAX]; /*0x10 */
4069 } MPI26_CONFIG_PAGE_PCIELINK_3, *PTR_MPI26_CONFIG_PAGE_PCIELINK_3,
4070 	Mpi26PcieLinkPage3_t, *pMpi26PcieLinkPage3_t;
4071 
4072 #define MPI26_PCIELINK3_PAGEVERSION            (0x00)
4073 
4074 
4075 #endif
4076