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.
62 * @brief This file contains all of the basic data types utilized by an
63 * SCI user or implementor.
70 #include <dev/isci/types.h>
72 #ifndef sci_cb_physical_address_upper
73 #error "sci_cb_physical_address_upper needs to be defined in appropriate environment.h"
76 #ifndef sci_cb_physical_address_lower
77 #error "sci_cb_physical_address_lower needs to be defined in appropriate environment.h"
80 #ifndef sci_cb_make_physical_address
81 #error "sci_cb_make_physical_address needs to be defined in appropriate environment.h"
85 #error "ASSERT needs to be defined in appropriate environment.h or system"
90 * This constant defines the value utilized by SCI Components to indicate
93 #define SCI_INVALID_HANDLE 0x0
96 * @typedef SCI_OBJECT_HANDLE_T
97 * @brief This typedef just provides an opaque handle for all SCI
100 typedef void* SCI_OBJECT_HANDLE_T;
103 * @typedef SCI_LOGGER_HANDLE_T
104 * @brief This typedef just provides an opaque handle for all SCI
107 typedef void* SCI_LOGGER_HANDLE_T;
110 * @typedef SCI_IO_REQUEST_HANDLE_T
111 * @brief The SCI_IO_REQUEST_HANDLE_T will be utilized by SCI users as an
112 * opaque handle for the various SCI IO Request objects.
114 typedef void * SCI_IO_REQUEST_HANDLE_T;
117 * @typedef SCI_TASK_REQUEST_HANDLE_T
118 * @brief The SCI_TASK_REQUEST_HANDLE_T will be utilized by SCI users as an
119 * opaque handle for the various SCI Task Management Request objects.
121 typedef void * SCI_TASK_REQUEST_HANDLE_T;
124 * @typedef SCI_PHY_HANDLE_T
125 * @brief This typedef just provides an opaque handle for all SCI
128 typedef void * SCI_PHY_HANDLE_T;
131 * @typedef SCI_REMOTE_DEVICE_HANDLE_T
132 * @brief The SCI_REMOTE_DEVICE_HANDLE_T will be utilized by SCI users as
133 * an opaque handle for the SCI remote device object.
135 typedef void * SCI_REMOTE_DEVICE_HANDLE_T;
138 * @typedef SCI_DOMAIN_HANDLE_T
139 * @brief This typedef just provides an opaque handle for all SCI
142 typedef void* SCI_DOMAIN_HANDLE_T;
145 * @typedef SCI_PORT_HANDLE_T
146 * @brief This typedef just provides an opaque handle for all SCI
147 * SAS or SATA Port objects.
149 typedef void * SCI_PORT_HANDLE_T;
152 * @typedef SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T
153 * @brief The SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T will be utilized by SCI
154 * users as an opaque handle for the SCI MEMORY DESCRIPTOR LIST object.
156 typedef void * SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T;
159 * @typedef SCI_LOCK_HANDLE_T
160 * @brief The SCI_LOCK_HANDLE_T will be utilized by SCI users as an
161 * opaque handle for the SCI LOCK object. A lock denotes a
162 * critical code section of some form.
164 typedef void * SCI_LOCK_HANDLE_T;
167 * @typedef SCI_CONTROLLER_HANDLE_T
168 * @brief The SCI_CONTROLLER_HANDLE_T will be utilized by SCI users as an
169 * opaque handle for all SCI Controller objects.
171 typedef void * SCI_CONTROLLER_HANDLE_T;
174 * @typedef SCI_LIBRARY_HANDLE_T
175 * @brief The SCI_LIBRARY_HANDLE_T will be utilized by SCI users as an
176 * opaque handle for the SCI Library object.
178 typedef void * SCI_LIBRARY_HANDLE_T;
181 * @typedef SCI_ITERATOR_HANDLE_T
182 * @brief The SCI_ITERATOR_T will be utilized by SCI users as an
183 * opaque handle for the SCI Iterator object.
185 typedef void * SCI_ITERATOR_HANDLE_T;
188 * @typedef SCI_TIMER_CALLBACK_T
189 * @brief This callback defines the format of all other timer callback
190 * methods that are to be implemented by an SCI user, including
191 * the method that will be invoked as a result of timer expiration.
194 * - The void* value passed into the callback represents the cookie
195 * supplied by the SCI component when the timer was created.
200 typedef void (*SCI_TIMER_CALLBACK_T)(void*);
203 * @brief This enumeration is provided so the SCI User can communicate the
204 * data direction for an IO request.
209 * The data direction for the request is in (a read operation)
210 * This is also the value to use for an io request that has no specific
213 SCI_IO_REQUEST_DATA_IN = 0,
216 * The data direction for the request is out (a write operation)
218 SCI_IO_REQUEST_DATA_OUT,
221 * There is no data transfer for the associated request.
223 SCI_IO_REQUEST_NO_DATA
225 } SCI_IO_REQUEST_DATA_DIRECTION;
228 * @enum SCI_LOCK_LEVEL
229 * @brief This enumeration defines the various lock levels utilized by
230 * the SCI component. These lock levels help inform users, of the
231 * library, about what APIs must be protected from other APIs.
232 * The higher the lock level the more restricted the access. For
233 * example, APIs specifying lock level 5 are allowed to be executed
234 * while an API of lock level 4 is on-going, but the converse is
240 * This value indicates there is no lock level required. This is
241 * primarily utilized for situations in which there is a true critical
242 * code section that merely needs to protect against access to a
256 * @enum _SCI_CONTROLLER_MODE
257 * @brief This enumeration is utilized to indicate the operating mode
258 * in which the SCI component should function.
260 typedef enum _SCI_CONTROLLER_MODE
263 * This enumerant specifies that the SCI component be optimized to
264 * perform as fast as possible without concern for the amount of
265 * memory being utilized.
270 * This enumerant specifies that the SCI component be optimized to
271 * save memory space without concern for performance of the system.
275 } SCI_CONTROLLER_MODE;
279 #endif // __cplusplus
281 #endif // _SCI_TYPES_H_