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.
54 #ifndef _SCI_CONTROLLER_CONSTANTS_H_
55 #define _SCI_CONTROLLER_CONSTANTS_H_
57 #include <sys/param.h>
62 * @brief This file contains constant values that change based on the type
63 * of core or framework being managed. These constants are exported
64 * in order to provide the user with information as to the bounds
65 * (i.e. how many) of specific objects.
72 #ifdef SCIC_SDS_4_ENABLED
76 * This constant defines the maximum number of phy objects that can be
77 * supported for the SCU Driver Standard (SDS) library. This is tied
78 * directly to silicon capabilities.
80 #define SCI_MAX_PHYS (4)
85 * This constant defines the maximum number of port objects that can be
86 * supported for the SCU Driver Standard (SDS) library. This is tied
87 * directly to silicon capabilities.
89 #define SCI_MAX_PORTS SCI_MAX_PHYS
92 #ifndef SCI_MIN_SMP_PHYS
94 * This constant defines the minimum number of SMP phy objects that
95 * can be supported for a single expander level.
96 * This was determined by using 36 physical phys and room for 2 virtual
99 #define SCI_MIN_SMP_PHYS (38)
102 #ifndef SCI_MAX_SMP_PHYS
104 * This constant defines the maximum number of SMP phy objects that
105 * can be supported for the SCU Driver Standard (SDS) library.
106 * This number can be increased if required.
108 #define SCI_MAX_SMP_PHYS (384)
111 #ifndef SCI_MAX_REMOTE_DEVICES
113 * This constant defines the maximum number of remote device objects that
114 * can be supported for the SCU Driver Standard (SDS) library. This is tied
115 * directly to silicon capabilities.
117 #define SCI_MAX_REMOTE_DEVICES (256)
120 #ifndef SCI_MIN_REMOTE_DEVICES
122 * This constant defines the minimum number of remote device objects that
123 * can be supported for the SCU Driver Standard (SDS) library. This # can
124 * be configured for minimum memory environments to any value less than
125 * SCI_MAX_REMOTE_DEVICES
127 #define SCI_MIN_REMOTE_DEVICES (16)
130 #ifndef SCI_MAX_IO_REQUESTS
132 * This constant defines the maximum number of IO request objects that
133 * can be supported for the SCU Driver Standard (SDS) library. This is tied
134 * directly to silicon capabilities.
136 #define SCI_MAX_IO_REQUESTS (256)
139 #ifndef SCI_MIN_IO_REQUESTS
141 * This constant defines the minimum number of IO request objects that
142 * can be supported for the SCU Driver Standard (SDS) library. This #
143 * can be configured for minimum memory environments to any value less
144 * than SCI_MAX_IO_REQUESTS.
146 #define SCI_MIN_IO_REQUESTS (1)
149 #ifndef SCI_MAX_SCATTER_GATHER_ELEMENTS
151 * This constant defines the maximum number of Scatter-Gather Elements
152 * to be used by any SCI component.
154 * Note: number of elements must be an even number, since descriptors
155 * posted to hardware always contain pairs of elements (with second
156 * element set to zeroes if not needed).
158 #define __MAXPHYS_ELEMENTS ((MAXPHYS / PAGE_SIZE) + 1)
159 #define SCI_MAX_SCATTER_GATHER_ELEMENTS ((__MAXPHYS_ELEMENTS + 1) & ~0x1)
162 #ifndef SCI_MIN_SCATTER_GATHER_ELEMENTS
164 * This constant defines the minimum number of Scatter-Gather Elements
165 * to be used by any SCI component.
167 #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1
170 #else // SCIC_SDS_4_ENABLED
172 #error "SCI Core configuration left unspecified (e.g. SCIC_SDS_4_ENABLED)"
174 #endif // SCIC_SDS_4_ENABLED
177 * This constant defines the maximum number of PCI devices that can be supported
180 #define SCI_MAX_PCI_DEVICES (2)
183 * This constant defines the maximum number of controllers that can
184 * occur in a single silicon package.
186 #define SCI_MAX_CONTROLLERS_PER_PCI_DEVICE (2)
189 * This constant defines the maximum number of controllers that can
190 * be supported by a library object. The user specified maximum controller
191 * count must be less than or equal to this number. This is a driver
192 * specific constant that is not tied to silicon capabilities.
194 #if !defined(SCI_MAX_CONTROLLERS)
195 #define SCI_MAX_CONTROLLERS (2)
198 #ifndef SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER
200 * This constant defines the maximum number of MSI-X interrupt vectors/messages
201 * supported for an SCU hardware controller instance.
203 #define SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER (2)
207 * This constant defines the maximum number of MSI-X interrupt vectors/messages
208 * supported for an SCU device.
210 #define SCI_MAX_MSIX_MESSAGES \
211 (SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER * SCI_MAX_CONTROLLERS)
214 * The maximum number of supported domain objects is currently tied to the
215 * maximum number of support port objects.
217 #define SCI_MAX_DOMAINS SCI_MAX_PORTS
221 #endif // __cplusplus
223 #endif // _SCI_CONTROLLER_CONSTANTS_H_