2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * The full GNU General Public License is included in this distribution
24 * in the file called LICENSE.GPL.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
42 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 #include <sys/cdefs.h>
56 __FBSDID("$FreeBSD$");
60 * @brief This file contains the mode page constants and data for the mode
61 * pages supported by this translation implementation.
64 // DO NOT MOVE THIS INCLUDE STATEMENT! This include must occur before
65 // the below check for ENABLE_SATI_MODE_PAGES.
66 #include <dev/isci/scil/sati_types.h>
68 #if defined(ENABLE_SATI_MODE_PAGES)
70 #include <dev/isci/scil/sati_mode_pages.h>
71 #include <dev/isci/scil/intel_scsi.h>
73 //******************************************************************************
75 //******************************************************************************
77 #define SCSI_MODE_PAGE19_SAS_ID 0x6
78 #define SCSI_MODE_PAGE19_SUB1_PAGE_NUM 0x1
79 #define SCSI_MODE_PAGE19_SUB1_PC 0x59
81 //******************************************************************************
83 //******************************************************************************
85 U8 sat_default_mode_page_01[] =
87 SCSI_MODE_PAGE_READ_WRITE_ERROR, // Byte 0 - Page Code, SPF(0), PS(0)
88 SCSI_MODE_PAGE_01_LENGTH-2, // Byte 1 - Page Length
89 0x80, // Byte 2 - AWRE, ARRE, TB, RC, EER, PER, DTE, DCR
90 0x00, // Byte 3 - Read Retry Count
92 0x00, // Byte 4 - Obsolete
93 0x00, // Byte 5 - Obsolete
94 0x00, // Byte 6 - Obsolete
95 0x00, // Byte 7 - Restricted for MMC-4
97 0x00, // Byte 8 - Write Retry Count
98 0x00, // Byte 9 - Reserved
99 0x00, // Byte 10 - Recovery Time Limit
103 U8 sat_changeable_mode_page_01[] =
105 SCSI_MODE_PAGE_READ_WRITE_ERROR,
106 SCSI_MODE_PAGE_01_LENGTH-2,
121 U8 sat_default_mode_page_02[] =
123 SCSI_MODE_PAGE_DISCONNECT_RECONNECT, // Byte 0 - Page Code, SPF(0), PS(0)
124 SCSI_MODE_PAGE_02_LENGTH-2, // Byte 1 - Page Length
125 0x00, // Byte 2 - Buffer Full Ratio
126 0x00, // Byte 3 - Buffer Empty Ratio
128 0x00, // Byte 4 - Bus Inactivity Limit
130 0x00, // Byte 6 - Disconnect Time Limit
133 0x00, // Byte 8 - Connect Time Limit
135 0x00, // Byte 10 - Maximum Burst Size
138 0x00, // Byte 12 - EMDP, FAIR_ARB, DIMM, DTDC
140 0x00, // Byte 14 - First Burst Size
144 U8 sat_changeable_mode_page_02[] =
146 SCSI_MODE_PAGE_DISCONNECT_RECONNECT,
147 SCSI_MODE_PAGE_02_LENGTH-2,
167 U8 sat_default_mode_page_08[] =
169 SCSI_MODE_PAGE_CACHING, // Byte 0 - Page Code, SPF(0), PS(0)
170 SCSI_MODE_PAGE_08_LENGTH-2, // Byte 1 - Page Length
171 0x00, // Byte 2 - IC, ABPF, CAP, DISC, SIZE, WCE(1), MF, RCD
172 0x00, // Byte 3 - Demand Read Retention Priority, Write Retention Priority
174 0x00, // Byte 4 - Disable Pre-Fetch Transfer Length
176 0x00, // Byte 6 - Minimum Pre-Fetch
179 0x00, // Byte 8 - Maximum Pre-Fetch
181 0x00, // Byte 10 - Maximum Pre-Fetch Ceiling
184 0x00, // Byte 12 - FSW, LBCSS, DRA(0), Vendor Specific, NV_DIS
185 0x00, // Byte 13 - Number of Cache Segments
186 0x00, // Byte 14 - Cache Segment Size
189 0x00, // Byte 16 - Reserved
190 0x00, // Byte 17 - Non-Cache Segment Size
195 U8 sat_changeable_mode_page_08[] =
197 SCSI_MODE_PAGE_CACHING,
198 SCSI_MODE_PAGE_08_LENGTH-2,
199 SCSI_MODE_PAGE_CACHE_PAGE_WCE_BIT,
212 SCSI_MODE_PAGE_CACHE_PAGE_DRA_BIT,
223 U8 sat_default_mode_page_0A[] =
225 SCSI_MODE_PAGE_CONTROL, // Byte 0 - Page Code, SPF(0), PS(0)
226 SCSI_MODE_PAGE_0A_LENGTH-2, // Byte 1 - Page Length
227 0x00, // Byte 2 - TST(0), TMF_ONLY(0), D_SENSE(0), GLTSD(0), RLEC(0)
228 0x10, // Byte 3 - Queue Algorithm(0), QErr(0)
230 0x00, // Byte 4 - TAS(0), RAC(0), UA_(0), SWP(0)
231 0x00, // Byte 5 - ATO(0), AUTOLOAD(0)
235 0xFF, // Byte 8 - Unlimited Busy timeout
237 0x00, // Byte 10 - do not support self time compl time xlation
241 U8 sat_changeable_mode_page_0A[] =
243 SCSI_MODE_PAGE_CONTROL,
244 SCSI_MODE_PAGE_0A_LENGTH-2,
259 U8 sat_default_mode_page_19[] =
261 SCSI_MODE_PAGE_PROTOCOL_SPECIFIC_PORT, // Byte 0 - PS, SPF, Page Code
262 SCSI_MODE_PAGE_19_LENGTH-2, // Byte 1 - Page Length
263 SCSI_MODE_PAGE19_SAS_ID, // Byte 2 - Rsvd, READY_LED, ProtoID
266 0xFF, // Byte 4 - IT NLT MSB, 0xFF retry forever
267 0xFF, // Byte 5 - IT NLT LSB, 0xFF retry forever
268 0x00, // Byte 6 - IRT MSB, 0x0 disable init resp timer
269 0x00, // Byte 7 - IRT LSB, 0x0 disable init resp timer
272 U8 sat_changeable_mode_page_19[] =
274 SCSI_MODE_PAGE_PROTOCOL_SPECIFIC_PORT,
275 SCSI_MODE_PAGE_19_LENGTH-2,
285 U8 sat_default_mode_page_1C[] =
287 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL, // Byte 0 - Page Code,
289 SCSI_MODE_PAGE_1C_LENGTH-2, // Byte 1 - Page Length
290 SCSI_MODE_PAGE_DEXCPT_ENABLE, // Byte 2 - Perf, EBF, EWasc,
291 // DExcpt(1), Test, LogErr
292 0x06, // Byte 3 -- MRIE (6 == values only available upon request)
294 0x00, // Byte 4 -- Interval Timer
299 0x00, // Byte 8 -- Report Count
305 U8 sat_changeable_mode_page_1C[] =
307 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL,
308 SCSI_MODE_PAGE_1C_LENGTH-2,
309 SCSI_MODE_PAGE_DEXCPT_ENABLE,
323 U8 sat_supported_mode_pages[] =
325 SCSI_MODE_PAGE_READ_WRITE_ERROR,
326 SCSI_MODE_PAGE_DISCONNECT_RECONNECT,
327 SCSI_MODE_PAGE_CACHING,
328 SCSI_MODE_PAGE_CONTROL,
329 SCSI_MODE_PAGE_INFORMATIONAL_EXCP_CONTROL
332 U8 *sat_changeable_mode_pages[] =
334 sat_changeable_mode_page_01,
335 sat_changeable_mode_page_02,
336 sat_changeable_mode_page_08,
337 sat_changeable_mode_page_0A,
338 sat_changeable_mode_page_1C
341 U8 *sat_default_mode_pages[] =
343 sat_default_mode_page_01,
344 sat_default_mode_page_02,
345 sat_default_mode_page_08,
346 sat_default_mode_page_0A,
347 sat_default_mode_page_1C
350 U16 sat_mode_page_sizes[] =
352 sizeof(sat_default_mode_page_01),
353 sizeof(sat_default_mode_page_02),
354 sizeof(sat_default_mode_page_08),
355 sizeof(sat_default_mode_page_0A),
356 sizeof(sat_default_mode_page_1C)
359 U16 sati_mode_page_get_page_index(
364 for (index = 0; index < SAT_SUPPORTED_MODE_PAGES_LENGTH; index++)
366 if (sat_supported_mode_pages[index] == page_code)
370 return SATI_MODE_PAGE_UNSUPPORTED_INDEX;
373 #endif // defined(ENABLE_SATI_MODE_PAGES)