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.
56 #ifndef _SCI_CONTROLLER_CONSTANTS_H_
57 #define _SCI_CONTROLLER_CONSTANTS_H_
59 #include <sys/param.h>
64 * @brief This file contains constant values that change based on the type
65 * of core or framework being managed. These constants are exported
66 * in order to provide the user with information as to the bounds
67 * (i.e. how many) of specific objects.
74 #ifdef SCIC_SDS_4_ENABLED
78 * This constant defines the maximum number of phy objects that can be
79 * supported for the SCU Driver Standard (SDS) library. This is tied
80 * directly to silicon capabilities.
82 #define SCI_MAX_PHYS (4)
87 * This constant defines the maximum number of port objects that can be
88 * supported for the SCU Driver Standard (SDS) library. This is tied
89 * directly to silicon capabilities.
91 #define SCI_MAX_PORTS SCI_MAX_PHYS
94 #ifndef SCI_MIN_SMP_PHYS
96 * This constant defines the minimum number of SMP phy objects that
97 * can be supported for a single expander level.
98 * This was determined by using 36 physical phys and room for 2 virtual
101 #define SCI_MIN_SMP_PHYS (38)
104 #ifndef SCI_MAX_SMP_PHYS
106 * This constant defines the maximum number of SMP phy objects that
107 * can be supported for the SCU Driver Standard (SDS) library.
108 * This number can be increased if required.
110 #define SCI_MAX_SMP_PHYS (384)
113 #ifndef SCI_MAX_REMOTE_DEVICES
115 * This constant defines the maximum number of remote device objects that
116 * can be supported for the SCU Driver Standard (SDS) library. This is tied
117 * directly to silicon capabilities.
119 #define SCI_MAX_REMOTE_DEVICES (256)
122 #ifndef SCI_MIN_REMOTE_DEVICES
124 * This constant defines the minimum number of remote device objects that
125 * can be supported for the SCU Driver Standard (SDS) library. This # can
126 * be configured for minimum memory environments to any value less than
127 * SCI_MAX_REMOTE_DEVICES
129 #define SCI_MIN_REMOTE_DEVICES (16)
132 #ifndef SCI_MAX_IO_REQUESTS
134 * This constant defines the maximum number of IO request objects that
135 * can be supported for the SCU Driver Standard (SDS) library. This is tied
136 * directly to silicon capabilities.
138 #define SCI_MAX_IO_REQUESTS (256)
141 #ifndef SCI_MIN_IO_REQUESTS
143 * This constant defines the minimum number of IO request objects that
144 * can be supported for the SCU Driver Standard (SDS) library. This #
145 * can be configured for minimum memory environments to any value less
146 * than SCI_MAX_IO_REQUESTS.
148 #define SCI_MIN_IO_REQUESTS (1)
151 #ifndef SCI_MAX_SCATTER_GATHER_ELEMENTS
153 * This constant defines the maximum number of Scatter-Gather Elements
154 * to be used by any SCI component.
156 * Note: number of elements must be an even number, since descriptors
157 * posted to hardware always contain pairs of elements (with second
158 * element set to zeroes if not needed).
160 #define __MAXPHYS_ELEMENTS ((MAXPHYS / PAGE_SIZE) + 1)
161 #define SCI_MAX_SCATTER_GATHER_ELEMENTS ((__MAXPHYS_ELEMENTS + 1) & ~0x1)
164 #ifndef SCI_MIN_SCATTER_GATHER_ELEMENTS
166 * This constant defines the minimum number of Scatter-Gather Elements
167 * to be used by any SCI component.
169 #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1
172 #else // SCIC_SDS_4_ENABLED
174 #error "SCI Core configuration left unspecified (e.g. SCIC_SDS_4_ENABLED)"
176 #endif // SCIC_SDS_4_ENABLED
179 * This constant defines the maximum number of PCI devices that can be supported
182 #define SCI_MAX_PCI_DEVICES (2)
185 * This constant defines the maximum number of controllers that can
186 * occur in a single silicon package.
188 #define SCI_MAX_CONTROLLERS_PER_PCI_DEVICE (2)
191 * This constant defines the maximum number of controllers that can
192 * be supported by a library object. The user specified maximum controller
193 * count must be less than or equal to this number. This is a driver
194 * specific constant that is not tied to silicon capabilities.
196 #if !defined(SCI_MAX_CONTROLLERS)
197 #define SCI_MAX_CONTROLLERS (2)
200 #ifndef SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER
202 * This constant defines the maximum number of MSI-X interrupt vectors/messages
203 * supported for an SCU hardware controller instance.
205 #define SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER (2)
209 * This constant defines the maximum number of MSI-X interrupt vectors/messages
210 * supported for an SCU device.
212 #define SCI_MAX_MSIX_MESSAGES \
213 (SCI_MAX_MSIX_MESSAGES_PER_CONTROLLER * SCI_MAX_CONTROLLERS)
216 * The maximum number of supported domain objects is currently tied to the
217 * maximum number of support port objects.
219 #define SCI_MAX_DOMAINS SCI_MAX_PORTS
223 #endif // __cplusplus
225 #endif // _SCI_CONTROLLER_CONSTANTS_H_