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.
60 * @brief This file contains all of the basic data types utilized by an
61 * SCI user or implementor.
68 #include <dev/isci/types.h>
70 #ifndef sci_cb_physical_address_upper
71 #error "sci_cb_physical_address_upper needs to be defined in appropriate environment.h"
74 #ifndef sci_cb_physical_address_lower
75 #error "sci_cb_physical_address_lower needs to be defined in appropriate environment.h"
78 #ifndef sci_cb_make_physical_address
79 #error "sci_cb_make_physical_address needs to be defined in appropriate environment.h"
83 #error "ASSERT needs to be defined in appropriate environment.h or system"
88 * This constant defines the value utilized by SCI Components to indicate
91 #define SCI_INVALID_HANDLE 0x0
94 * @typedef SCI_OBJECT_HANDLE_T
95 * @brief This typedef just provides an opaque handle for all SCI
98 typedef void* SCI_OBJECT_HANDLE_T;
101 * @typedef SCI_LOGGER_HANDLE_T
102 * @brief This typedef just provides an opaque handle for all SCI
105 typedef void* SCI_LOGGER_HANDLE_T;
108 * @typedef SCI_IO_REQUEST_HANDLE_T
109 * @brief The SCI_IO_REQUEST_HANDLE_T will be utilized by SCI users as an
110 * opaque handle for the various SCI IO Request objects.
112 typedef void * SCI_IO_REQUEST_HANDLE_T;
115 * @typedef SCI_TASK_REQUEST_HANDLE_T
116 * @brief The SCI_TASK_REQUEST_HANDLE_T will be utilized by SCI users as an
117 * opaque handle for the various SCI Task Management Request objects.
119 typedef void * SCI_TASK_REQUEST_HANDLE_T;
122 * @typedef SCI_PHY_HANDLE_T
123 * @brief This typedef just provides an opaque handle for all SCI
126 typedef void * SCI_PHY_HANDLE_T;
129 * @typedef SCI_REMOTE_DEVICE_HANDLE_T
130 * @brief The SCI_REMOTE_DEVICE_HANDLE_T will be utilized by SCI users as
131 * an opaque handle for the SCI remote device object.
133 typedef void * SCI_REMOTE_DEVICE_HANDLE_T;
136 * @typedef SCI_DOMAIN_HANDLE_T
137 * @brief This typedef just provides an opaque handle for all SCI
140 typedef void* SCI_DOMAIN_HANDLE_T;
143 * @typedef SCI_PORT_HANDLE_T
144 * @brief This typedef just provides an opaque handle for all SCI
145 * SAS or SATA Port objects.
147 typedef void * SCI_PORT_HANDLE_T;
150 * @typedef SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T
151 * @brief The SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T will be utilized by SCI
152 * users as an opaque handle for the SCI MEMORY DESCRIPTOR LIST object.
154 typedef void * SCI_MEMORY_DESCRIPTOR_LIST_HANDLE_T;
157 * @typedef SCI_LOCK_HANDLE_T
158 * @brief The SCI_LOCK_HANDLE_T will be utilized by SCI users as an
159 * opaque handle for the SCI LOCK object. A lock denotes a
160 * critical code section of some form.
162 typedef void * SCI_LOCK_HANDLE_T;
165 * @typedef SCI_CONTROLLER_HANDLE_T
166 * @brief The SCI_CONTROLLER_HANDLE_T will be utilized by SCI users as an
167 * opaque handle for all SCI Controller objects.
169 typedef void * SCI_CONTROLLER_HANDLE_T;
172 * @typedef SCI_LIBRARY_HANDLE_T
173 * @brief The SCI_LIBRARY_HANDLE_T will be utilized by SCI users as an
174 * opaque handle for the SCI Library object.
176 typedef void * SCI_LIBRARY_HANDLE_T;
179 * @typedef SCI_ITERATOR_HANDLE_T
180 * @brief The SCI_ITERATOR_T will be utilized by SCI users as an
181 * opaque handle for the SCI Iterator object.
183 typedef void * SCI_ITERATOR_HANDLE_T;
186 * @typedef SCI_TIMER_CALLBACK_T
187 * @brief This callback defines the format of all other timer callback
188 * methods that are to be implemented by an SCI user, including
189 * the method that will be invoked as a result of timer expiration.
192 * - The void* value passed into the callback represents the cookie
193 * supplied by the SCI component when the timer was created.
198 typedef void (*SCI_TIMER_CALLBACK_T)(void*);
201 * @brief This enumeration is provided so the SCI User can communicate the
202 * data direction for an IO request.
207 * The data direction for the request is in (a read operation)
208 * This is also the value to use for an io request that has no specific
211 SCI_IO_REQUEST_DATA_IN = 0,
214 * The data direction for the request is out (a write operation)
216 SCI_IO_REQUEST_DATA_OUT,
219 * There is no data transfer for the associated request.
221 SCI_IO_REQUEST_NO_DATA
223 } SCI_IO_REQUEST_DATA_DIRECTION;
226 * @enum SCI_LOCK_LEVEL
227 * @brief This enumeration defines the various lock levels utilized by
228 * the SCI component. These lock levels help inform users, of the
229 * library, about what APIs must be protected from other APIs.
230 * The higher the lock level the more restricted the access. For
231 * example, APIs specifying lock level 5 are allowed to be executed
232 * while an API of lock level 4 is on-going, but the converse is
238 * This value indicates there is no lock level required. This is
239 * primarily utilized for situations in which there is a true critical
240 * code section that merely needs to protect against access to a
254 * @enum _SCI_CONTROLLER_MODE
255 * @brief This enumeration is utilized to indicate the operating mode
256 * in which the SCI component should function.
258 typedef enum _SCI_CONTROLLER_MODE
261 * This enumerant specifies that the SCI component be optimized to
262 * perform as fast as possible without concern for the amount of
263 * memory being utilized.
268 * This enumerant specifies that the SCI component be optimized to
269 * save memory space without concern for performance of the system.
273 } SCI_CONTROLLER_MODE;
277 #endif // __cplusplus
279 #endif // _SCI_TYPES_H_