2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 #include <sys/cdefs.h>
54 __FBSDID("$FreeBSD$");
58 * @brief This file contains the mode page constants and data for the mode
59 * pages supported by this translation implementation.
62 // DO NOT MOVE THIS INCLUDE STATEMENT! This include must occur before
63 // the below check for ENABLE_SATI_MODE_PAGES.
64 #include <dev/isci/scil/sati_types.h>
66 #if defined(ENABLE_SATI_MODE_PAGES)
68 #include <dev/isci/scil/sati_mode_pages.h>
69 #include <dev/isci/scil/intel_scsi.h>
71 //******************************************************************************
73 //******************************************************************************
75 #define SCSI_MODE_PAGE19_SAS_ID 0x6
76 #define SCSI_MODE_PAGE19_SUB1_PAGE_NUM 0x1
77 #define SCSI_MODE_PAGE19_SUB1_PC 0x59
79 //******************************************************************************
81 //******************************************************************************
83 U8 sat_default_mode_page_01[] =
85 SCSI_MODE_PAGE_READ_WRITE_ERROR, // Byte 0 - Page Code, SPF(0), PS(0)
86 SCSI_MODE_PAGE_01_LENGTH-2, // Byte 1 - Page Length
87 0x80, // Byte 2 - AWRE, ARRE, TB, RC, EER, PER, DTE, DCR
88 0x00, // Byte 3 - Read Retry Count
90 0x00, // Byte 4 - Obsolete
91 0x00, // Byte 5 - Obsolete
92 0x00, // Byte 6 - Obsolete
93 0x00, // Byte 7 - Restricted for MMC-4
95 0x00, // Byte 8 - Write Retry Count
96 0x00, // Byte 9 - Reserved
97 0x00, // Byte 10 - Recovery Time Limit
101 U8 sat_changeable_mode_page_01[] =
103 SCSI_MODE_PAGE_READ_WRITE_ERROR,
104 SCSI_MODE_PAGE_01_LENGTH-2,
119 U8 sat_default_mode_page_02[] =
121 SCSI_MODE_PAGE_DISCONNECT_RECONNECT, // Byte 0 - Page Code, SPF(0), PS(0)
122 SCSI_MODE_PAGE_02_LENGTH-2, // Byte 1 - Page Length
123 0x00, // Byte 2 - Buffer Full Ratio
124 0x00, // Byte 3 - Buffer Empty Ratio
126 0x00, // Byte 4 - Bus Inactivity Limit
128 0x00, // Byte 6 - Disconnect Time Limit
131 0x00, // Byte 8 - Connect Time Limit
133 0x00, // Byte 10 - Maximum Burst Size
136 0x00, // Byte 12 - EMDP, FAIR_ARB, DIMM, DTDC
138 0x00, // Byte 14 - First Burst Size
142 U8 sat_changeable_mode_page_02[] =
144 SCSI_MODE_PAGE_DISCONNECT_RECONNECT,
145 SCSI_MODE_PAGE_02_LENGTH-2,
165 U8 sat_default_mode_page_08[] =
167 SCSI_MODE_PAGE_CACHING, // Byte 0 - Page Code, SPF(0), PS(0)
168 SCSI_MODE_PAGE_08_LENGTH-2, // Byte 1 - Page Length
169 0x00, // Byte 2 - IC, ABPF, CAP, DISC, SIZE, WCE(1), MF, RCD
170 0x00, // Byte 3 - Demand Read Retention Priority, Write Retention Priority
172 0x00, // Byte 4 - Disable Pre-Fetch Transfer Length
174 0x00, // Byte 6 - Minimum Pre-Fetch
177 0x00, // Byte 8 - Maximum Pre-Fetch
179 0x00, // Byte 10 - Maximum Pre-Fetch Ceiling
182 0x00, // Byte 12 - FSW, LBCSS, DRA(0), Vendor Specific, NV_DIS
183 0x00, // Byte 13 - Number of Cache Segments
184 0x00, // Byte 14 - Cache Segment Size
187 0x00, // Byte 16 - Reserved
188 0x00, // Byte 17 - Non-Cache Segment Size
193 U8 sat_changeable_mode_page_08[] =
195 SCSI_MODE_PAGE_CACHING,
196 SCSI_MODE_PAGE_08_LENGTH-2,
197 SCSI_MODE_PAGE_CACHE_PAGE_WCE_BIT,
210 SCSI_MODE_PAGE_CACHE_PAGE_DRA_BIT,
221 U8 sat_default_mode_page_0A[] =
223 SCSI_MODE_PAGE_CONTROL, // Byte 0 - Page Code, SPF(0), PS(0)
224 SCSI_MODE_PAGE_0A_LENGTH-2, // Byte 1 - Page Length
225 0x00, // Byte 2 - TST(0), TMF_ONLY(0), D_SENSE(0), GLTSD(0), RLEC(0)
226 0x10, // Byte 3 - Queue Algorithm(0), QErr(0)
228 0x00, // Byte 4 - TAS(0), RAC(0), UA_(0), SWP(0)
229 0x00, // Byte 5 - ATO(0), AUTOLOAD(0)
233 0xFF, // Byte 8 - Unlimited Busy timeout
235 0x00, // Byte 10 - do not support self time compl time xlation
239 U8 sat_changeable_mode_page_0A[] =
241 SCSI_MODE_PAGE_CONTROL,
242 SCSI_MODE_PAGE_0A_LENGTH-2,
257 U8 sat_default_mode_page_19[] =
259 SCSI_MODE_PAGE_PROTOCOL_SPECIFIC_PORT, // Byte 0 - PS, SPF, Page Code
260 SCSI_MODE_PAGE_19_LENGTH-2, // Byte 1 - Page Length
261 SCSI_MODE_PAGE19_SAS_ID, // Byte 2 - Rsvd, READY_LED, ProtoID
264 0xFF, // Byte 4 - IT NLT MSB, 0xFF retry forever
265 0xFF, // Byte 5 - IT NLT LSB, 0xFF retry forever
266 0x00, // Byte 6 - IRT MSB, 0x0 disable init resp timer
267 0x00, // Byte 7 - IRT LSB, 0x0 disable init resp timer
270 U8 sat_changeable_mode_page_19[] =
272 SCSI_MODE_PAGE_PROTOCOL_SPECIFIC_PORT,
273 SCSI_MODE_PAGE_19_LENGTH-2,
283 U8 sat_default_mode_page_1C[] =
285 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL, // Byte 0 - Page Code,
287 SCSI_MODE_PAGE_1C_LENGTH-2, // Byte 1 - Page Length
288 SCSI_MODE_PAGE_DEXCPT_ENABLE, // Byte 2 - Perf, EBF, EWasc,
289 // DExcpt(1), Test, LogErr
290 0x06, // Byte 3 -- MRIE (6 == values only available upon request)
292 0x00, // Byte 4 -- Interval Timer
297 0x00, // Byte 8 -- Report Count
303 U8 sat_changeable_mode_page_1C[] =
305 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL,
306 SCSI_MODE_PAGE_1C_LENGTH-2,
307 SCSI_MODE_PAGE_DEXCPT_ENABLE,
321 U8 sat_supported_mode_pages[] =
323 SCSI_MODE_PAGE_READ_WRITE_ERROR,
324 SCSI_MODE_PAGE_DISCONNECT_RECONNECT,
325 SCSI_MODE_PAGE_CACHING,
326 SCSI_MODE_PAGE_CONTROL,
327 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL
330 U8 *sat_changeable_mode_pages[] =
332 sat_changeable_mode_page_01,
333 sat_changeable_mode_page_02,
334 sat_changeable_mode_page_08,
335 sat_changeable_mode_page_0A,
336 sat_changeable_mode_page_1C
339 U8 *sat_default_mode_pages[] =
341 sat_default_mode_page_01,
342 sat_default_mode_page_02,
343 sat_default_mode_page_08,
344 sat_default_mode_page_0A,
345 sat_default_mode_page_1C
348 U16 sat_mode_page_sizes[] =
350 sizeof(sat_default_mode_page_01),
351 sizeof(sat_default_mode_page_02),
352 sizeof(sat_default_mode_page_08),
353 sizeof(sat_default_mode_page_0A),
354 sizeof(sat_default_mode_page_1C)
357 U16 sati_mode_page_get_page_index(
362 for (index = 0; index < SAT_SUPPORTED_MODE_PAGES_LENGTH; index++)
364 if (sat_supported_mode_pages[index] == page_code)
368 return SATI_MODE_PAGE_UNSUPPORTED_INDEX;
371 #endif // defined(ENABLE_SATI_MODE_PAGES)